About Jd2chm...

The project files of this HTML Help
Were generated with Jd2chm version 0.3
Copyright © 2000-2003 Andre Burgaud
http://www.burgaud.com


Overview (Java EE 5)

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES

JavaTM Platform Enterprise Edition, v 5.0
API Specifications

Java EE 5 Platform Packages
javax.activation | The JavaBeans(TM) Activation Framework is used by the JavaMail(TM) API to manage MIME data.
javax.annotation |
javax.annotation.security |
javax.ejb | The javax.ejb package contains the Enterprise JavaBeans classes and interfaces that define the contracts between the enterprise bean and its clients and between the enterprise bean and the EJB container.
javax.ejb.spi | The javax.ejb.spi package defines interfaces that are implemented by the EJB container.
javax.el | Provides the API for the Unified Expression Language shared by the JSP 2.1 and JSF 1.2 technologies.
javax.enterprise.deploy.model | Provides Tool Vendor implementation classes.
javax.enterprise.deploy.model.exceptions | Provides Tool Vendor exception implementation classes.
javax.enterprise.deploy.shared | Provides shared objects for Tool Vendor and Product Vendor implementation classes.
javax.enterprise.deploy.shared.factories | Provides shared factory manager object for Tool Vendor and Product Vendor implementation classes.
javax.enterprise.deploy.spi | Provides J2EE Product Vendor implementation classes.
javax.enterprise.deploy.spi.exceptions | Provides J2EE Product Vendor deployment exception implementation classes.
javax.enterprise.deploy.spi.factories | Provides J2EE Product Vendor deployment factory implementation classes.
javax.enterprise.deploy.spi.status | Provides J2EE Product Vendor deployment status implementation classes.
javax.faces | Top level classes for the JavaServer(tm) Faces API.
javax.faces.application | APIs that are used to link an application's business logic objects to JavaServer Faces, as well as convenient pluggable mechanisms to manage the execution of an application that is based on JavaServer Faces.
javax.faces.component | Fundamental APIs for user interface components.
javax.faces.component.html | Specialized user interface component classes for HTML.
javax.faces.context | Classes and interfaces defining per-request state information.
javax.faces.convert | Contains classes and interfaces defining converters.
javax.faces.el | DEPRECATED Classes and interfaces for evaluating and processing reference expressions.
javax.faces.event | Interfaces describing events and event listeners, and concrete event implementation classes.
javax.faces.lifecycle | Classes and interfaces defining lifecycle management for the JavaServer Faces implementation.
javax.faces.model | Standard model data beans for JavaServer Faces.
javax.faces.render | Classes and interfaces defining the rendering model.
javax.faces.validator | Interface defining the validator model, and concrete validator implementation classes.
javax.faces.webapp | Classes required for integration of JavaServer Faces into web applications, including a standard servlet, base classes for JSP custom component tags, and concrete tag implementations for core tags.
javax.interceptor | The javax.interceptor package contains classes and interfaces for use with EJB interceptors.
javax.jms | The Java Message Service (JMS) API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.
javax.jws |
javax.jws.soap |
javax.mail | The JavaMailTM API provides classes that model a mail system.
javax.mail.event | Listeners and events for the JavaMail API.
javax.mail.internet | Classes specific to Internet mail systems.
javax.mail.search | Message search terms for the JavaMail API.
javax.mail.util | Utility classes.
javax.management.j2ee | Provides the J2EE Management Enterprise Bean component (MEJB) interfaces.
javax.management.j2ee.statistics | Provides the standard interfaces for accessing performance data from J2EE managed objects Package Specification JSR 77, J2EE Management Related Documentation For overviews, tutorials, examples, guides, and tool documentation, please see: J2EE Tools
javax.persistence | The javax.persistence package contains the classes and interfaces that define the contracts between a persistence provider and the managed classes and the clients of the Java Persistence API.
javax.persistence.spi | The javax.persistence.spi package defines the classes and interfaces that are implemented by the persistence provider and the Java EE container for use by the container, provider, and/or Persistence bootstrap class in deployment and bootstrapping.
javax.resource | The javax.resource package is the top-level package for the J2EE Connector API specification.
javax.resource.cci | The javax.resource.cci package contains API specification for the Common Client Interface (CCI).
javax.resource.spi | The javax.resource.spi package contains APIs for the system contracts defined in the J2EE Connector Architecture specification.
javax.resource.spi.endpoint | This package contains system contracts for service endpoint interactions.
javax.resource.spi.security | The javax.resource.spi.security package contains APIs for the security management contract.
javax.resource.spi.work | This package contains APIs for the work management contract.
javax.security.jacc | This package contains the Java Authorization Contract for Containers API
javax.servlet | The javax.servlet package contains a number of classes and interfaces that describe and define the contracts between a servlet class and the runtime environment provided for an instance of such a class by a conforming servlet container.
javax.servlet.http | The javax.servlet.http package contains a number of classes and interfaces that describe and define the contracts between a servlet class running under the HTTP protocol and the runtime environment provided for an instance of such a class by a conforming servlet container.
javax.servlet.jsp | Classes and interfaces for the Core JSP 2.1 API.
javax.servlet.jsp.el | Provides the ELResolver classes that define the object resolution rules that must be supported by a JSP container with the new unified Expression Language.
javax.servlet.jsp.tagext | Classes and interfaces for the definition of JavaServer Pages Tag Libraries.
javax.transaction | Provides the API that defines the contract between the transaction manager and the various parties involved in a distributed transaction namely : resource manager, application, and application server.
javax.transaction.xa | Provides the API that defines the contract between the transaction manager and the resource manager, which allows the transaction manager to enlist and delist resource objects (supplied by the resource manager driver) in JTA transactions.
javax.xml.bind | Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.
javax.xml.bind.annotation | Defines annotations for customizing Java program elements to XML Schema mapping.
javax.xml.bind.annotation.adapters | XmlAdapter and its spec-defined sub-classes to allow arbitrary Java classes to be used with JAXB.
javax.xml.bind.attachment | This package is implemented by a MIME-based package processor that enables the interpretation and creation of optimized binary data within an MIME-based package format.
javax.xml.bind.helpers | JAXB Provider Use Only: Provides partial default implementations for some of the javax.xml.bind interfaces.
javax.xml.bind.util | Useful client utility classes.
javax.xml.registry | This package and its sub-packages describe the API classes and interfaces for the JAXR API.
javax.xml.registry.infomodel | This package describes the information model for the JAXR API.
javax.xml.rpc | This package contains the core JAX-RPC APIs for the client programming model.
javax.xml.rpc.encoding | This package defines APIs for the extensible type mapping framework.
javax.xml.rpc.handler | This package defines APIs for SOAP Message Handlers
javax.xml.rpc.handler.soap | This package defines APIs for SOAP Message Handlers
javax.xml.rpc.holders | This package contains the standard Java Holder classes.
javax.xml.rpc.server | This package defines APIs for the servlet based JAX-RPC endpoint model.
javax.xml.rpc.soap | This package defines APIs specific to the SOAP binding.
javax.xml.soap | Provides the API for creating and building SOAP messages.
javax.xml.stream |
javax.xml.stream.events |
javax.xml.stream.util |
javax.xml.ws | This package contains the core JAX-WS APIs.
javax.xml.ws.handler | This package defines APIs for message handlers.
javax.xml.ws.handler.soap | This package defines APIs for SOAP message handlers.
javax.xml.ws.http | This package defines APIs specific to the HTTP binding.
javax.xml.ws.soap | This package defines APIs specific to the SOAP binding.
javax.xml.ws.spi | This package defines SPIs for JAX-WS 2.0.

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For All Packages

Package Hierarchies:
javax.activation, javax.annotation, javax.annotation.security, javax.ejb, javax.ejb.spi, javax.el, javax.enterprise.deploy.model, javax.enterprise.deploy.model.exceptions, javax.enterprise.deploy.shared, javax.enterprise.deploy.shared.factories, javax.enterprise.deploy.spi, javax.enterprise.deploy.spi.exceptions, javax.enterprise.deploy.spi.factories, javax.enterprise.deploy.spi.status, javax.faces, javax.faces.application, javax.faces.component, javax.faces.component.html, javax.faces.context, javax.faces.convert, javax.faces.el, javax.faces.event, javax.faces.lifecycle, javax.faces.model, javax.faces.render, javax.faces.validator, javax.faces.webapp, javax.interceptor, javax.jms, javax.jws, javax.jws.soap, javax.mail, javax.mail.event, javax.mail.internet, javax.mail.search, javax.mail.util, javax.management.j2ee, javax.management.j2ee.statistics, javax.persistence, javax.persistence.spi, javax.resource, javax.resource.cci, javax.resource.spi, javax.resource.spi.endpoint, javax.resource.spi.security, javax.resource.spi.work, javax.security.jacc, javax.servlet, javax.servlet.http, javax.servlet.jsp, javax.servlet.jsp.el, javax.servlet.jsp.tagext, javax.transaction, javax.transaction.xa, javax.xml.bind, javax.xml.bind.annotation, javax.xml.bind.annotation.adapters, javax.xml.bind.attachment, javax.xml.bind.helpers, javax.xml.bind.util, javax.xml.registry, javax.xml.registry.infomodel, javax.xml.rpc, javax.xml.rpc.encoding, javax.xml.rpc.handler, javax.xml.rpc.handler.soap, javax.xml.rpc.holders, javax.xml.rpc.server, javax.xml.rpc.soap, javax.xml.soap, javax.xml.stream, javax.xml.stream.events, javax.xml.stream.util, javax.xml.ws, javax.xml.ws.handler, javax.xml.ws.handler.soap, javax.xml.ws.http, javax.xml.ws.soap, javax.xml.ws.spi

Class Hierarchy

  • java.lang.Object
    • javax.xml.bind.helpers.AbstractMarshallerImpl (implements javax.xml.bind.Marshaller)
    • javax.xml.bind.helpers.AbstractUnmarshallerImpl (implements javax.xml.bind.Unmarshaller)
    • javax.enterprise.deploy.shared.ActionType
    • javax.mail.Address (implements java.io.Serializable)
      • javax.mail.internet.InternetAddress (implements java.lang.Cloneable)
      • javax.mail.internet.NewsAddress
    • javax.faces.application.Application
    • javax.faces.application.ApplicationFactory
    • javax.xml.bind.attachment.AttachmentMarshaller
    • javax.xml.soap.AttachmentPart
    • javax.xml.bind.attachment.AttachmentUnmarshaller
    • javax.mail.Authenticator
    • javax.el.BeanELResolver.BeanProperties
    • javax.el.BeanELResolver.BeanProperty
    • javax.faces.convert.BigDecimalConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.BigDecimalHolder (implements javax.xml.rpc.holders.Holder)
    • javax.faces.convert.BigIntegerConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.BigIntegerHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.bind.Binder<XmlNode>
    • javax.mail.BodyPart (implements javax.mail.Part)
      • javax.mail.internet.MimeBodyPart (implements javax.mail.internet.MimePart)
        • javax.mail.internet.PreencodedMimeBodyPart
    • javax.faces.convert.BooleanConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.BooleanHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.BooleanWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.mail.util.ByteArrayDataSource (implements javax.activation.DataSource)
    • javax.xml.rpc.holders.ByteArrayHolder (implements javax.xml.rpc.holders.Holder)
    • javax.faces.convert.ByteConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.ByteHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ByteWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.CalendarHolder (implements javax.xml.rpc.holders.Holder)
    • javax.faces.convert.CharacterConverter (implements javax.faces.convert.Converter)
    • javax.activation.CommandInfo
    • javax.activation.CommandMap
      • javax.activation.MailcapCommandMap
    • javax.enterprise.deploy.shared.CommandType
    • javax.mail.event.ConnectionAdapter (implements javax.mail.event.ConnectionListener)
    • javax.xml.registry.ConnectionFactory
    • javax.mail.internet.ContentDisposition
    • javax.mail.internet.ContentType
    • javax.servlet.http.Cookie (implements java.lang.Cloneable)
    • java.awt.datatransfer.DataFlavor (implements java.lang.Cloneable, java.io.Externalizable)
      • javax.activation.ActivationDataFlavor
    • javax.activation.DataHandler (implements java.awt.datatransfer.Transferable)
    • javax.faces.model.DataModel
      • javax.faces.model.ArrayDataModel
      • javax.faces.model.ListDataModel
      • javax.faces.model.ResultDataModel
      • javax.faces.model.ResultSetDataModel
      • javax.faces.model.ScalarDataModel
    • javax.xml.bind.DatatypeConverter
    • javax.faces.convert.DateTimeConverter (implements javax.faces.convert.Converter, javax.faces.component.StateHolder)
    • javax.enterprise.deploy.shared.DConfigBeanVersionType
    • javax.xml.bind.helpers.DefaultValidationEventHandler (implements javax.xml.bind.ValidationEventHandler)
    • javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
    • javax.xml.transform.dom.DOMResult (implements javax.xml.transform.Result)
      • javax.xml.soap.SAAJResult
    • javax.faces.convert.DoubleConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.DoubleHolder (implements javax.xml.rpc.holders.Holder)
    • javax.faces.validator.DoubleRangeValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • javax.xml.rpc.holders.DoubleWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.el.ELContext
    • javax.el.ELResolver
      • javax.el.ArrayELResolver
      • javax.el.BeanELResolver
      • javax.el.CompositeELResolver
      • javax.servlet.jsp.el.ImplicitObjectELResolver
      • javax.el.ListELResolver
      • javax.el.MapELResolver
      • javax.el.ResourceBundleELResolver
      • javax.servlet.jsp.el.ScopedAttributeELResolver
    • javax.xml.ws.Endpoint
    • javax.faces.convert.EnumConverter (implements javax.faces.convert.Converter, javax.faces.component.StateHolder)
    • javax.servlet.jsp.ErrorData
    • java.util.EventObject (implements java.io.Serializable)
      • javax.resource.spi.ConnectionEvent
      • javax.faces.model.DataModelEvent
      • javax.el.ELContextEvent
      • javax.faces.event.FacesEvent
        • javax.faces.event.ActionEvent
        • javax.faces.event.ValueChangeEvent
      • javax.servlet.http.HttpSessionEvent
        • javax.servlet.http.HttpSessionBindingEvent
      • javax.mail.event.MailEvent
        • javax.mail.event.ConnectionEvent
        • javax.mail.event.FolderEvent
        • javax.mail.event.MessageChangedEvent
        • javax.mail.event.MessageCountEvent
        • javax.mail.event.StoreEvent
        • javax.mail.event.TransportEvent
      • javax.faces.event.PhaseEvent
      • javax.enterprise.deploy.spi.status.ProgressEvent
      • javax.servlet.ServletContextEvent
        • javax.servlet.ServletContextAttributeEvent
      • javax.servlet.ServletRequestEvent
        • javax.servlet.ServletRequestAttributeEvent
      • javax.resource.spi.work.WorkEvent
    • javax.xml.stream.util.EventReaderDelegate (implements javax.xml.stream.XMLEventReader)
    • javax.resource.spi.work.ExecutionContext
    • javax.el.Expression (implements java.io.Serializable)
      • javax.el.MethodExpression
      • javax.el.ValueExpression
    • javax.servlet.jsp.el.Expression
    • javax.servlet.jsp.el.ExpressionEvaluator
    • javax.el.ExpressionFactory
    • javax.faces.context.ExternalContext
    • javax.faces.context.FacesContext
    • javax.faces.context.FacesContextFactory
    • javax.faces.application.FacesMessage (implements java.io.Serializable)
    • javax.faces.application.FacesMessage.Severity (implements java.lang.Comparable<T>)
    • javax.faces.webapp.FacesServlet (implements javax.servlet.Servlet)
    • javax.faces.FactoryFinder
    • javax.mail.FetchProfile
    • javax.mail.FetchProfile.Item
      • javax.mail.UIDFolder.FetchProfileItem
    • javax.activation.FileDataSource (implements javax.activation.DataSource)
    • javax.activation.FileTypeMap
      • javax.activation.MimetypesFileTypeMap
    • javax.mail.Flags (implements java.lang.Cloneable, java.io.Serializable)
    • javax.mail.Flags.Flag
    • javax.faces.convert.FloatConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.FloatHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.FloatWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.mail.Folder
    • javax.mail.event.FolderAdapter (implements javax.mail.event.FolderListener)
    • java.text.Format (implements java.lang.Cloneable, java.io.Serializable)
      • java.text.DateFormat
        • java.text.SimpleDateFormat
          • javax.mail.internet.MailDateFormat
    • javax.servlet.jsp.tagext.FunctionInfo
    • javax.el.FunctionMapper
    • javax.xml.rpc.handler.GenericHandler (implements javax.xml.rpc.handler.Handler)
    • javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig)
      • javax.servlet.http.HttpServlet (implements java.io.Serializable)
    • javax.xml.rpc.handler.HandlerInfo (implements java.io.Serializable)
    • javax.mail.Header
      • javax.mail.internet.InternetHeaders.InternetHeader
    • javax.mail.internet.HeaderTokenizer
    • javax.mail.internet.HeaderTokenizer.Token
    • javax.xml.ws.Holder<T>
    • javax.servlet.http.HttpUtils
    • java.io.InputStream (implements java.io.Closeable)
      • java.io.ByteArrayInputStream
        • javax.mail.util.SharedByteArrayInputStream (implements javax.mail.internet.SharedInputStream)
      • java.io.FilterInputStream
        • java.io.BufferedInputStream
          • javax.mail.util.SharedFileInputStream (implements javax.mail.internet.SharedInputStream)
      • javax.servlet.ServletInputStream
    • javax.faces.convert.IntegerConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.IntegerWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.mail.internet.InternetHeaders
    • javax.xml.rpc.holders.IntHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.bind.JAXBContext
    • javax.xml.bind.JAXBElement<T> (implements java.io.Serializable)
    • javax.xml.bind.JAXBElement.GlobalScope
    • javax.xml.bind.JAXBIntrospector
    • javax.servlet.jsp.JspContext
      • javax.servlet.jsp.PageContext
    • javax.servlet.jsp.JspEngineInfo
    • javax.servlet.jsp.JspFactory
    • javax.servlet.jsp.tagext.JspFragment
    • javax.faces.validator.LengthValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • javax.faces.lifecycle.Lifecycle
    • javax.faces.lifecycle.LifecycleFactory
    • javax.faces.convert.LongConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.LongHolder (implements javax.xml.rpc.holders.Holder)
    • javax.faces.validator.LongRangeValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • javax.xml.rpc.holders.LongWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.bind.Marshaller.Listener
    • javax.mail.Message (implements javax.mail.Part)
      • javax.mail.internet.MimeMessage (implements javax.mail.internet.MimePart)
    • javax.mail.Message.RecipientType (implements java.io.Serializable)
      • javax.mail.internet.MimeMessage.RecipientType
    • javax.mail.MessageContext
    • javax.mail.event.MessageCountAdapter (implements javax.mail.event.MessageCountListener)
    • javax.xml.soap.MessageFactory
    • javax.faces.el.MethodBinding
    • javax.faces.event.MethodExpressionActionListener (implements javax.faces.event.ActionListener, javax.faces.component.StateHolder)
    • javax.faces.validator.MethodExpressionValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • javax.faces.event.MethodExpressionValueChangeListener (implements javax.faces.component.StateHolder, javax.faces.event.ValueChangeListener)
    • javax.el.MethodInfo
    • javax.xml.soap.MimeHeader
    • javax.xml.soap.MimeHeaders
    • javax.mail.internet.MimePartDataSource (implements javax.activation.DataSource, javax.mail.MessageAware)
    • javax.activation.MimeType (implements java.io.Externalizable)
    • javax.activation.MimeTypeParameterList
    • javax.mail.internet.MimeUtility
    • javax.enterprise.deploy.shared.ModuleType
    • javax.mail.Multipart
      • javax.mail.internet.MimeMultipart
    • javax.xml.rpc.NamespaceConstants
    • javax.faces.application.NavigationHandler
    • javax.faces.convert.NumberConverter (implements javax.faces.convert.Converter, javax.faces.component.StateHolder)
    • javax.xml.rpc.holders.ObjectHolder (implements javax.xml.rpc.holders.Holder)
    • java.io.OutputStream (implements java.io.Closeable, java.io.Flushable)
      • javax.faces.context.ResponseStream
      • javax.servlet.ServletOutputStream
    • javax.servlet.jsp.tagext.PageData
    • javax.mail.internet.ParameterList
    • javax.xml.rpc.ParameterMode
    • javax.mail.PasswordAuthentication
    • javax.resource.spi.security.PasswordCredential (implements java.io.Serializable)
    • java.security.Permission (implements java.security.Guard, java.io.Serializable)
      • java.security.BasicPermission (implements java.io.Serializable)
        • javax.xml.ws.WebServicePermission
      • javax.security.jacc.EJBMethodPermission (implements java.io.Serializable)
      • javax.security.jacc.EJBRoleRefPermission (implements java.io.Serializable)
      • javax.security.jacc.WebResourcePermission (implements java.io.Serializable)
      • javax.security.jacc.WebRoleRefPermission (implements java.io.Serializable)
      • javax.security.jacc.WebUserDataPermission (implements java.io.Serializable)
    • javax.persistence.Persistence
    • javax.faces.event.PhaseId (implements java.lang.Comparable<T>)
    • javax.security.jacc.PolicyConfigurationFactory
    • javax.security.jacc.PolicyContext
    • javax.faces.el.PropertyResolver
    • javax.xml.ws.spi.Provider
    • javax.mail.Provider
    • javax.mail.Provider.Type
    • javax.xml.rpc.holders.QNameHolder (implements javax.xml.rpc.holders.Holder)
    • javax.jms.QueueRequestor
    • javax.mail.Quota
    • javax.mail.Quota.Resource
    • javax.faces.render.Renderer
    • javax.faces.render.RenderKit
    • javax.faces.render.RenderKitFactory
    • javax.faces.render.ResponseStateManager
    • javax.xml.soap.SAAJMetaFactory
    • javax.xml.transform.sax.SAXResult (implements javax.xml.transform.Result)
      • javax.xml.bind.util.JAXBResult
    • javax.xml.transform.sax.SAXSource (implements javax.xml.transform.Source)
      • javax.xml.bind.util.JAXBSource
    • javax.xml.bind.SchemaOutputResolver
    • javax.mail.search.SearchTerm (implements java.io.Serializable)
      • javax.mail.search.AddressTerm
        • javax.mail.search.FromTerm
        • javax.mail.search.RecipientTerm
      • javax.mail.search.AndTerm
      • javax.mail.search.ComparisonTerm
        • javax.mail.search.DateTerm
          • javax.mail.search.ReceivedDateTerm
          • javax.mail.search.SentDateTerm
        • javax.mail.search.IntegerComparisonTerm
          • javax.mail.search.MessageNumberTerm
          • javax.mail.search.SizeTerm
      • javax.mail.search.FlagTerm
      • javax.mail.search.NotTerm
      • javax.mail.search.OrTerm
      • javax.mail.search.StringTerm
        • javax.mail.search.AddressStringTerm
          • javax.mail.search.FromStringTerm
          • javax.mail.search.RecipientStringTerm
        • javax.mail.search.BodyTerm
        • javax.mail.search.HeaderTerm
        • javax.mail.search.MessageIDTerm
        • javax.mail.search.SubjectTerm
    • javax.faces.model.SelectItem (implements java.io.Serializable)
      • javax.faces.model.SelectItemGroup
    • javax.xml.ws.Service
    • javax.mail.Service
      • javax.mail.Store
      • javax.mail.Transport
    • javax.xml.ws.spi.ServiceDelegate
    • javax.xml.rpc.ServiceFactory
    • javax.servlet.ServletRequestWrapper (implements javax.servlet.ServletRequest)
      • javax.servlet.http.HttpServletRequestWrapper (implements javax.servlet.http.HttpServletRequest)
    • javax.servlet.ServletResponseWrapper (implements javax.servlet.ServletResponse)
      • javax.servlet.http.HttpServletResponseWrapper (implements javax.servlet.http.HttpServletResponse)
    • javax.mail.Session
    • javax.faces.convert.ShortConverter (implements javax.faces.convert.Converter)
    • javax.xml.rpc.holders.ShortHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ShortWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.servlet.jsp.tagext.SimpleTagSupport (implements javax.servlet.jsp.tagext.SimpleTag)
    • javax.xml.soap.SOAPConnection
    • javax.xml.soap.SOAPConnectionFactory
    • javax.xml.soap.SOAPElementFactory
    • javax.xml.soap.SOAPFactory
    • javax.xml.soap.SOAPMessage
    • javax.xml.soap.SOAPPart (implements org.w3c.dom.Document, javax.xml.soap.Node)
    • javax.faces.application.StateManager
      • javax.faces.application.StateManagerWrapper
    • javax.faces.application.StateManager.SerializedView
    • javax.enterprise.deploy.shared.StateType
    • javax.xml.stream.util.StreamReaderDelegate (implements javax.xml.stream.XMLStreamReader)
    • javax.xml.rpc.holders.StringHolder (implements javax.xml.rpc.holders.Holder)
    • javax.servlet.jsp.tagext.TagAdapter (implements javax.servlet.jsp.tagext.Tag)
    • javax.servlet.jsp.tagext.TagAttributeInfo
    • javax.servlet.jsp.tagext.TagData (implements java.lang.Cloneable)
    • javax.servlet.jsp.tagext.TagExtraInfo
    • javax.servlet.jsp.tagext.TagFileInfo
    • javax.servlet.jsp.tagext.TagInfo
    • javax.servlet.jsp.tagext.TagLibraryInfo
    • javax.servlet.jsp.tagext.TagLibraryValidator
    • javax.servlet.jsp.tagext.TagSupport (implements javax.servlet.jsp.tagext.IterationTag, java.io.Serializable)
      • javax.faces.webapp.AttributeTag
      • javax.servlet.jsp.tagext.BodyTagSupport (implements javax.servlet.jsp.tagext.BodyTag)
      • javax.faces.webapp.ConverterELTag
      • javax.faces.webapp.ConverterTag
      • javax.faces.webapp.FacetTag
      • javax.faces.webapp.ValidatorELTag
      • javax.faces.webapp.ValidatorTag
    • javax.servlet.jsp.tagext.TagVariableInfo
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Error
        • javax.xml.stream.FactoryConfigurationError
      • java.lang.Exception
        • javax.enterprise.deploy.spi.exceptions.BeanNotFoundException
        • javax.enterprise.deploy.spi.exceptions.ClientExecuteException
        • javax.enterprise.deploy.spi.exceptions.ConfigurationException
        • javax.ejb.CreateException
          • javax.ejb.DuplicateKeyException
        • javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException
        • javax.enterprise.deploy.model.exceptions.DDBeanCreateException
        • javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
        • javax.servlet.jsp.el.ELException
          • javax.servlet.jsp.el.ELParseException
        • javax.ejb.FinderException
          • javax.ejb.ObjectNotFoundException
        • javax.transaction.HeuristicCommitException
        • javax.transaction.HeuristicMixedException
        • javax.transaction.HeuristicRollbackException
        • javax.enterprise.deploy.spi.exceptions.InvalidModuleException
        • java.io.IOException
          • java.rmi.RemoteException
            • javax.transaction.InvalidTransactionException
            • javax.transaction.TransactionRequiredException
            • javax.transaction.TransactionRolledbackException
          • javax.activation.UnsupportedDataTypeException
        • javax.xml.bind.JAXBException
          • javax.xml.bind.MarshalException
          • javax.xml.bind.PropertyException
          • javax.xml.bind.UnmarshalException
          • javax.xml.bind.ValidationException
        • javax.xml.registry.JAXRException (implements javax.xml.registry.JAXRResponse)
          • javax.xml.registry.InvalidRequestException
          • javax.xml.registry.RegistryException
            • javax.xml.registry.DeleteException
            • javax.xml.registry.FindException
            • javax.xml.registry.SaveException
          • javax.xml.registry.UnexpectedObjectException
          • javax.xml.registry.UnsupportedCapabilityException
        • javax.jms.JMSException
          • javax.jms.IllegalStateException
          • javax.jms.InvalidClientIDException
          • javax.jms.InvalidDestinationException
          • javax.jms.InvalidSelectorException
          • javax.jms.JMSSecurityException
          • javax.jms.MessageEOFException
          • javax.jms.MessageFormatException
          • javax.jms.MessageNotReadableException
          • javax.jms.MessageNotWriteableException
          • javax.jms.ResourceAllocationException
          • javax.jms.TransactionInProgressException
          • javax.jms.TransactionRolledBackException
        • javax.servlet.jsp.JspException
          • javax.servlet.jsp.JspTagException
          • javax.servlet.jsp.SkipPageException
        • javax.mail.MessagingException
          • javax.mail.AuthenticationFailedException
          • javax.mail.FolderClosedException
          • javax.mail.FolderNotFoundException
          • javax.mail.IllegalWriteException
          • javax.mail.MessageRemovedException
          • javax.mail.MethodNotSupportedException
          • javax.mail.NoSuchProviderException
          • javax.mail.internet.ParseException
            • javax.mail.internet.AddressException
          • javax.mail.ReadOnlyFolderException
          • javax.mail.search.SearchException
          • javax.mail.SendFailedException
          • javax.mail.StoreClosedException
        • javax.activation.MimeTypeParseException
        • javax.transaction.NotSupportedException
        • javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
        • javax.security.jacc.PolicyContextException
        • javax.ejb.RemoveException
        • javax.resource.ResourceException
          • javax.resource.spi.ApplicationServerInternalException
          • javax.resource.spi.CommException
          • javax.resource.spi.EISSystemException
          • javax.resource.spi.IllegalStateException
          • javax.resource.spi.InvalidPropertyException
          • javax.resource.spi.LocalTransactionException
          • javax.resource.NotSupportedException
          • javax.resource.spi.ResourceAdapterInternalException
          • javax.resource.spi.ResourceAllocationException
          • javax.resource.cci.ResourceWarning
          • javax.resource.spi.SecurityException
          • javax.resource.spi.SharingViolationException
          • javax.resource.spi.UnavailableException
          • javax.resource.spi.work.WorkException
            • javax.resource.spi.work.WorkCompletedException
            • javax.resource.spi.work.WorkRejectedException
        • javax.transaction.RollbackException
        • java.lang.RuntimeException
          • javax.ejb.EJBException
            • javax.ejb.AccessLocalException
            • javax.ejb.ConcurrentAccessException
            • javax.ejb.EJBAccessException
            • javax.ejb.EJBTransactionRequiredException
            • javax.ejb.EJBTransactionRolledbackException
            • javax.ejb.NoSuchEJBException
            • javax.ejb.NoSuchEntityException
            • javax.ejb.NoSuchObjectLocalException
            • javax.ejb.TransactionRequiredLocalException
            • javax.ejb.TransactionRolledbackLocalException
          • javax.el.ELException
            • javax.el.MethodNotFoundException
            • javax.el.PropertyNotFoundException
            • javax.el.PropertyNotWritableException
          • javax.faces.FacesException
            • javax.faces.event.AbortProcessingException
            • javax.faces.convert.ConverterException
            • javax.faces.el.EvaluationException
              • javax.faces.el.MethodNotFoundException
              • javax.faces.el.PropertyNotFoundException
              • javax.faces.el.ReferenceSyntaxException
            • javax.faces.validator.ValidatorException
            • javax.faces.application.ViewExpiredException
          • javax.xml.rpc.JAXRPCException
          • javax.persistence.PersistenceException
            • javax.persistence.EntityExistsException
            • javax.persistence.EntityNotFoundException
            • javax.persistence.NonUniqueResultException
            • javax.persistence.NoResultException
            • javax.persistence.OptimisticLockException
            • javax.persistence.RollbackException
            • javax.persistence.TransactionRequiredException
          • javax.xml.rpc.soap.SOAPFaultException
          • javax.xml.bind.TypeConstraintException
          • javax.xml.ws.WebServiceException
            • javax.xml.ws.ProtocolException
              • javax.xml.ws.http.HTTPException
              • javax.xml.ws.soap.SOAPFaultException
        • javax.xml.rpc.ServiceException
        • javax.servlet.ServletException
          • javax.servlet.UnavailableException
        • javax.xml.soap.SOAPException
        • javax.transaction.SystemException
        • javax.enterprise.deploy.spi.exceptions.TargetException
        • javax.transaction.xa.XAException
        • javax.xml.stream.XMLStreamException
    • javax.jms.TopicRequestor
    • javax.mail.event.TransportAdapter (implements javax.mail.event.TransportListener)
    • javax.faces.component.UIComponent (implements javax.faces.component.StateHolder)
      • javax.faces.component.UIComponentBase
        • javax.faces.component.UIColumn
          • javax.faces.component.html.HtmlColumn
        • javax.faces.component.UICommand (implements javax.faces.component.ActionSource2)
          • javax.faces.component.html.HtmlCommandButton
          • javax.faces.component.html.HtmlCommandLink
        • javax.faces.component.UIData (implements javax.faces.component.NamingContainer)
          • javax.faces.component.html.HtmlDataTable
        • javax.faces.component.UIForm (implements javax.faces.component.NamingContainer)
          • javax.faces.component.html.HtmlForm
        • javax.faces.component.UIGraphic
          • javax.faces.component.html.HtmlGraphicImage
        • javax.faces.component.UIMessage
          • javax.faces.component.html.HtmlMessage
        • javax.faces.component.UIMessages
          • javax.faces.component.html.HtmlMessages
        • javax.faces.component.UINamingContainer (implements javax.faces.component.NamingContainer)
        • javax.faces.component.UIOutput (implements javax.faces.component.ValueHolder)
          • javax.faces.component.html.HtmlOutputFormat
          • javax.faces.component.html.HtmlOutputLabel
          • javax.faces.component.html.HtmlOutputLink
          • javax.faces.component.html.HtmlOutputText
          • javax.faces.component.UIInput (implements javax.faces.component.EditableValueHolder)
            • javax.faces.component.html.HtmlInputHidden
            • javax.faces.component.html.HtmlInputSecret
            • javax.faces.component.html.HtmlInputText
            • javax.faces.component.html.HtmlInputTextarea
            • javax.faces.component.UISelectBoolean
              • javax.faces.component.html.HtmlSelectBooleanCheckbox
            • javax.faces.component.UISelectMany
              • javax.faces.component.html.HtmlSelectManyCheckbox
              • javax.faces.component.html.HtmlSelectManyListbox
              • javax.faces.component.html.HtmlSelectManyMenu
            • javax.faces.component.UISelectOne
              • javax.faces.component.html.HtmlSelectOneListbox
              • javax.faces.component.html.HtmlSelectOneMenu
              • javax.faces.component.html.HtmlSelectOneRadio
        • javax.faces.component.UIPanel
          • javax.faces.component.html.HtmlPanelGrid
          • javax.faces.component.html.HtmlPanelGroup
        • javax.faces.component.UIParameter
        • javax.faces.component.UISelectItem
        • javax.faces.component.UISelectItems
        • javax.faces.component.UIViewRoot
    • javax.faces.webapp.UIComponentTagBase (implements javax.servlet.jsp.tagext.JspTag)
      • javax.faces.webapp.UIComponentClassicTagBase (implements javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.JspIdConsumer)
        • javax.faces.webapp.UIComponentELTag (implements javax.servlet.jsp.tagext.Tag)
        • javax.faces.webapp.UIComponentTag (implements javax.servlet.jsp.tagext.Tag)
          • javax.faces.webapp.UIComponentBodyTag
    • javax.xml.bind.Unmarshaller.Listener
    • javax.activation.URLDataSource (implements javax.activation.DataSource)
    • javax.mail.URLName
    • javax.xml.bind.util.ValidationEventCollector (implements javax.xml.bind.ValidationEventHandler)
    • javax.xml.bind.helpers.ValidationEventImpl (implements javax.xml.bind.ValidationEvent)
      • javax.xml.bind.helpers.NotIdentifiableEventImpl (implements javax.xml.bind.NotIdentifiableEvent)
      • javax.xml.bind.helpers.ParseConversionEventImpl (implements javax.xml.bind.ParseConversionEvent)
      • javax.xml.bind.helpers.PrintConversionEventImpl (implements javax.xml.bind.PrintConversionEvent)
    • javax.xml.bind.helpers.ValidationEventLocatorImpl (implements javax.xml.bind.ValidationEventLocator)
    • javax.servlet.jsp.tagext.ValidationMessage
    • javax.faces.el.ValueBinding
    • javax.servlet.jsp.tagext.VariableInfo
    • javax.el.VariableMapper
    • javax.faces.el.VariableResolver
    • javax.faces.application.ViewHandler
      • javax.faces.application.ViewHandlerWrapper
    • javax.xml.bind.annotation.W3CDomHandler (implements javax.xml.bind.annotation.DomHandler<ElementT,ResultT>)
    • javax.resource.spi.work.WorkAdapter (implements javax.resource.spi.work.WorkListener)
    • java.io.Writer (implements java.lang.Appendable, java.io.Closeable, java.io.Flushable)
      • javax.servlet.jsp.JspWriter
        • javax.servlet.jsp.tagext.BodyContent
      • javax.faces.context.ResponseWriter
        • javax.faces.context.ResponseWriterWrapper
    • javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
      • javax.xml.bind.annotation.adapters.CollapsedStringAdapter
      • javax.xml.bind.annotation.adapters.HexBinaryAdapter
      • javax.xml.bind.annotation.adapters.NormalizedStringAdapter
    • javax.xml.bind.annotation.XmlElement.DEFAULT
    • javax.xml.bind.annotation.XmlElementDecl.GLOBAL
    • javax.xml.bind.annotation.XmlElementRef.DEFAULT
    • javax.xml.stream.XMLEventFactory
    • javax.xml.stream.XMLInputFactory
    • javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT
    • javax.xml.stream.XMLOutputFactory
    • javax.xml.bind.annotation.XmlSchemaType.DEFAULT
    • javax.xml.rpc.encoding.XMLType
    • javax.xml.bind.annotation.XmlType.DEFAULT
    • javax.enterprise.deploy.model.XpathEvent

Interface Hierarchy

  • javax.faces.component.ActionSource
    • javax.faces.component.ActionSource2
  • javax.xml.ws.AsyncHandler<T>
  • javax.xml.ws.Binding
    • javax.xml.ws.http.HTTPBinding
    • javax.xml.ws.soap.SOAPBinding
  • javax.xml.ws.BindingProvider
    • javax.xml.ws.Dispatch<T>
  • javax.resource.spi.BootstrapContext
  • javax.xml.rpc.Call
  • javax.xml.registry.CapabilityProfile
  • javax.persistence.spi.ClassTransformer
  • java.lang.Cloneable
    • javax.resource.cci.Record (also extends java.io.Serializable)
      • javax.resource.cci.IndexedRecord (also extends java.util.List<E>, java.io.Serializable)
      • javax.resource.cci.MappedRecord (also extends java.util.Map<K,V>, java.io.Serializable)
      • javax.resource.cci.ResultSet (also extends java.sql.ResultSet)
  • javax.activation.CommandObject
  • javax.resource.cci.Connection
  • javax.jms.Connection
    • javax.jms.QueueConnection
      • javax.jms.XAQueueConnection (also extends javax.jms.XAConnection)
    • javax.jms.TopicConnection
      • javax.jms.XATopicConnection (also extends javax.jms.XAConnection)
    • javax.jms.XAConnection
      • javax.jms.XAQueueConnection (also extends javax.jms.QueueConnection)
      • javax.jms.XATopicConnection (also extends javax.jms.TopicConnection)
    • javax.jms.XAQueueConnection (also extends javax.jms.QueueConnection, javax.jms.XAConnection)
    • javax.jms.XATopicConnection (also extends javax.jms.TopicConnection, javax.jms.XAConnection)
  • javax.xml.registry.Connection
    • javax.xml.registry.FederatedConnection
  • javax.jms.ConnectionConsumer
  • javax.jms.ConnectionFactory
    • javax.jms.QueueConnectionFactory
      • javax.jms.XAQueueConnectionFactory (also extends javax.jms.XAConnectionFactory)
    • javax.jms.TopicConnectionFactory
      • javax.jms.XATopicConnectionFactory (also extends javax.jms.XAConnectionFactory)
    • javax.jms.XAQueueConnectionFactory (also extends javax.jms.QueueConnectionFactory, javax.jms.XAConnectionFactory)
    • javax.jms.XATopicConnectionFactory (also extends javax.jms.TopicConnectionFactory, javax.jms.XAConnectionFactory)
  • javax.resource.cci.ConnectionMetaData
  • javax.jms.ConnectionMetaData
  • javax.resource.spi.ConnectionRequestInfo
  • javax.resource.cci.ConnectionSpec
  • org.xml.sax.ContentHandler
    • javax.xml.bind.UnmarshallerHandler
  • javax.faces.component.ContextCallback
  • javax.faces.convert.Converter
  • javax.activation.DataContentHandler
  • javax.activation.DataContentHandlerFactory
  • javax.activation.DataSource
    • javax.mail.MultipartDataSource
  • javax.xml.bind.DatatypeConverterInterface
  • javax.enterprise.deploy.spi.DConfigBean
    • javax.enterprise.deploy.spi.DConfigBeanRoot
  • javax.enterprise.deploy.model.DDBean
    • javax.enterprise.deploy.model.DDBeanRoot
  • javax.jms.DeliveryMode
  • javax.enterprise.deploy.model.DeployableObject
    • javax.enterprise.deploy.model.J2eeApplicationObject
  • javax.enterprise.deploy.spi.DeploymentConfiguration
  • javax.enterprise.deploy.spi.factories.DeploymentFactory
  • javax.enterprise.deploy.spi.DeploymentManager
  • javax.enterprise.deploy.spi.status.DeploymentStatus
  • javax.xml.rpc.encoding.DeserializationContext
  • javax.jms.Destination
    • javax.jms.Queue
      • javax.jms.TemporaryQueue
    • javax.jms.TemporaryQueue
    • javax.jms.TemporaryTopic
    • javax.jms.Topic
      • javax.jms.TemporaryTopic
  • javax.resource.spi.DissociatableManagedConnection
  • javax.xml.bind.annotation.DomHandler<ElementT,ResultT>
  • javax.servlet.jsp.tagext.DynamicAttributes
  • javax.ejb.EJBContext
    • javax.ejb.EntityContext
    • javax.ejb.MessageDrivenContext
    • javax.ejb.SessionContext
  • javax.ejb.EJBLocalHome
  • javax.ejb.EJBLocalObject
  • javax.ejb.EJBMetaData
  • javax.xml.bind.Element
  • javax.xml.registry.infomodel.EmailAddress
  • javax.persistence.EntityManager
  • javax.persistence.EntityManagerFactory
  • javax.persistence.EntityTransaction
  • javax.xml.stream.EventFilter
  • java.util.EventListener
    • javax.resource.spi.ConnectionEventListener
    • javax.mail.event.ConnectionListener
    • javax.faces.model.DataModelListener
    • javax.el.ELContextListener
    • javax.faces.event.FacesListener
      • javax.faces.event.ActionListener
      • javax.faces.event.ValueChangeListener
    • javax.mail.event.FolderListener
    • javax.servlet.http.HttpSessionActivationListener
    • javax.servlet.http.HttpSessionAttributeListener
    • javax.servlet.http.HttpSessionBindingListener
    • javax.servlet.http.HttpSessionListener
    • javax.mail.event.MessageChangedListener
    • javax.mail.event.MessageCountListener
    • javax.faces.event.PhaseListener (also extends java.io.Serializable)
    • javax.enterprise.deploy.spi.status.ProgressListener
    • javax.servlet.ServletContextAttributeListener
    • javax.servlet.ServletContextListener
    • javax.servlet.ServletRequestAttributeListener
    • javax.servlet.ServletRequestListener
    • javax.mail.event.StoreListener
    • javax.mail.event.TransportListener
    • javax.faces.validator.Validator
    • javax.resource.spi.work.WorkListener
  • javax.jms.ExceptionListener
  • javax.xml.registry.infomodel.ExtensibleObject
    • javax.xml.registry.infomodel.Association
    • javax.xml.registry.infomodel.AuditableEvent
    • javax.xml.registry.infomodel.Classification
    • javax.xml.registry.infomodel.ClassificationScheme
    • javax.xml.registry.infomodel.Concept
    • javax.xml.registry.infomodel.ExternalIdentifier
    • javax.xml.registry.infomodel.ExternalLink (also extends javax.xml.registry.infomodel.RegistryObject, javax.xml.registry.infomodel.URIValidator)
    • javax.xml.registry.infomodel.ExtrinsicObject
    • javax.xml.registry.infomodel.Organization
    • javax.xml.registry.infomodel.PostalAddress
    • javax.xml.registry.infomodel.RegistryEntry (also extends javax.xml.registry.infomodel.RegistryObject, javax.xml.registry.infomodel.Versionable)
      • javax.xml.registry.infomodel.ClassificationScheme
      • javax.xml.registry.infomodel.ExtrinsicObject
      • javax.xml.registry.infomodel.RegistryPackage
      • javax.xml.registry.infomodel.Service
    • javax.xml.registry.infomodel.RegistryObject
      • javax.xml.registry.infomodel.Association
      • javax.xml.registry.infomodel.AuditableEvent
      • javax.xml.registry.infomodel.Classification
      • javax.xml.registry.infomodel.ClassificationScheme
      • javax.xml.registry.infomodel.Concept
      • javax.xml.registry.infomodel.ExternalIdentifier
      • javax.xml.registry.infomodel.ExternalLink (also extends javax.xml.registry.infomodel.URIValidator)
      • javax.xml.registry.infomodel.ExtrinsicObject
      • javax.xml.registry.infomodel.Organization
      • javax.xml.registry.infomodel.RegistryEntry (also extends javax.xml.registry.infomodel.Versionable)
        • javax.xml.registry.infomodel.ClassificationScheme
        • javax.xml.registry.infomodel.ExtrinsicObject
        • javax.xml.registry.infomodel.RegistryPackage
        • javax.xml.registry.infomodel.Service
      • javax.xml.registry.infomodel.RegistryPackage
      • javax.xml.registry.infomodel.Service
      • javax.xml.registry.infomodel.ServiceBinding (also extends javax.xml.registry.infomodel.URIValidator)
      • javax.xml.registry.infomodel.SpecificationLink
      • javax.xml.registry.infomodel.User
    • javax.xml.registry.infomodel.RegistryPackage
    • javax.xml.registry.infomodel.Service
    • javax.xml.registry.infomodel.ServiceBinding (also extends javax.xml.registry.infomodel.RegistryObject, javax.xml.registry.infomodel.URIValidator)
    • javax.xml.registry.infomodel.SpecificationLink
    • javax.xml.registry.infomodel.User
  • javax.servlet.Filter
  • javax.servlet.FilterChain
  • javax.servlet.FilterConfig
  • javax.xml.registry.FindQualifier
  • javax.servlet.jsp.el.FunctionMapper
  • java.util.concurrent.Future<V>
    • javax.xml.ws.Response<T>
  • javax.resource.spi.security.GenericCredential
  • javax.ejb.spi.HandleDelegate
  • javax.xml.rpc.handler.Handler
  • javax.xml.ws.handler.Handler<C>
    • javax.xml.ws.handler.LogicalHandler<C>
    • javax.xml.ws.handler.soap.SOAPHandler<T>
  • javax.xml.ws.handler.HandlerResolver
  • javax.xml.rpc.holders.Holder
  • javax.servlet.http.HttpSession
  • javax.servlet.http.HttpSessionContext
  • javax.resource.cci.Interaction
  • javax.xml.registry.infomodel.InternationalString
  • javax.interceptor.InvocationContext
  • java.lang.Iterable<T>
    • java.util.Collection<E>
      • java.util.List<E>
        • javax.xml.rpc.handler.HandlerChain
        • javax.resource.cci.IndexedRecord (also extends javax.resource.cci.Record, java.io.Serializable)
  • java.util.Iterator<E>
    • javax.xml.stream.XMLEventReader
  • javax.management.j2ee.statistics.JavaMailStats
  • javax.xml.registry.JAXRResponse
    • javax.xml.registry.BulkResponse
  • javax.servlet.jsp.JspApplicationContext
  • javax.servlet.jsp.tagext.JspIdConsumer
  • javax.servlet.jsp.tagext.JspTag
    • javax.servlet.jsp.tagext.BodyTag
    • javax.servlet.jsp.tagext.IterationTag
      • javax.servlet.jsp.tagext.BodyTag
    • javax.servlet.jsp.tagext.SimpleTag
    • javax.servlet.jsp.tagext.Tag
      • javax.servlet.jsp.tagext.BodyTag
      • javax.servlet.jsp.tagext.IterationTag
        • javax.servlet.jsp.tagext.BodyTag
  • javax.xml.registry.infomodel.Key
  • javax.resource.spi.LazyAssociatableConnectionManager
  • javax.resource.spi.LazyEnlistableConnectionManager
  • javax.resource.spi.LazyEnlistableManagedConnection
  • javax.xml.registry.LifeCycleManager
    • javax.xml.registry.BusinessLifeCycleManager
  • javax.xml.registry.infomodel.LocalizedString
  • javax.resource.cci.LocalTransaction
  • javax.resource.spi.LocalTransaction
  • javax.xml.stream.Location
  • javax.xml.ws.LogicalMessage
  • javax.resource.spi.ManagedConnection
  • javax.resource.spi.ManagedConnectionMetaData
  • java.util.Map<K,V>
    • javax.resource.cci.MappedRecord (also extends javax.resource.cci.Record, java.io.Serializable)
    • javax.xml.ws.handler.MessageContext
      • javax.xml.ws.handler.LogicalMessageContext
      • javax.xml.ws.handler.soap.SOAPMessageContext
  • javax.xml.bind.Marshaller
  • javax.jms.Message
    • javax.jms.BytesMessage
    • javax.jms.MapMessage
    • javax.jms.ObjectMessage
    • javax.jms.StreamMessage
    • javax.jms.TextMessage
  • javax.mail.MessageAware
  • javax.jms.MessageConsumer
    • javax.jms.QueueReceiver
    • javax.jms.TopicSubscriber
  • javax.xml.rpc.handler.MessageContext
    • javax.xml.rpc.handler.soap.SOAPMessageContext
  • javax.resource.spi.endpoint.MessageEndpoint
  • javax.resource.spi.endpoint.MessageEndpointFactory
  • javax.resource.cci.MessageListener
  • javax.jms.MessageListener
  • javax.jms.MessageProducer
    • javax.jms.QueueSender
    • javax.jms.TopicPublisher
  • javax.xml.soap.Name
  • javax.faces.component.NamingContainer
  • org.w3c.dom.Node
    • org.w3c.dom.CharacterData
      • org.w3c.dom.Text
        • javax.xml.soap.Text (also extends javax.xml.soap.Node)
    • org.w3c.dom.Element
      • javax.xml.soap.SOAPElement (also extends javax.xml.soap.Node)
        • javax.xml.soap.Detail
        • javax.xml.soap.DetailEntry
        • javax.xml.soap.SOAPBody
        • javax.xml.soap.SOAPBodyElement
          • javax.xml.soap.SOAPFault
        • javax.xml.soap.SOAPEnvelope
        • javax.xml.soap.SOAPFault
        • javax.xml.soap.SOAPFaultElement
          • javax.xml.soap.Detail
        • javax.xml.soap.SOAPHeader
        • javax.xml.soap.SOAPHeaderElement
    • javax.xml.soap.Node
      • javax.xml.soap.Detail
      • javax.xml.soap.DetailEntry
      • javax.xml.soap.SOAPBody
      • javax.xml.soap.SOAPBodyElement
        • javax.xml.soap.SOAPFault
      • javax.xml.soap.SOAPElement (also extends org.w3c.dom.Element)
        • javax.xml.soap.Detail
        • javax.xml.soap.DetailEntry
        • javax.xml.soap.SOAPBody
        • javax.xml.soap.SOAPBodyElement
          • javax.xml.soap.SOAPFault
        • javax.xml.soap.SOAPEnvelope
        • javax.xml.soap.SOAPFault
        • javax.xml.soap.SOAPFaultElement
          • javax.xml.soap.Detail
        • javax.xml.soap.SOAPHeader
        • javax.xml.soap.SOAPHeaderElement
      • javax.xml.soap.SOAPEnvelope
      • javax.xml.soap.SOAPFault
      • javax.xml.soap.SOAPFaultElement
        • javax.xml.soap.Detail
      • javax.xml.soap.SOAPHeader
      • javax.xml.soap.SOAPHeaderElement
      • javax.xml.soap.Text (also extends org.w3c.dom.Text)
  • javax.mail.Part
    • javax.mail.internet.MimePart
  • javax.persistence.spi.PersistenceProvider
  • javax.persistence.spi.PersistenceUnitInfo
  • javax.xml.registry.infomodel.PersonName
  • javax.security.jacc.PolicyConfiguration
  • javax.security.jacc.PolicyContextHandler
  • javax.xml.ws.handler.PortInfo
  • javax.enterprise.deploy.spi.status.ProgressObject
  • javax.xml.ws.Provider<T>
  • javax.xml.registry.Query
  • javax.persistence.Query
  • javax.xml.registry.QueryManager
    • javax.xml.registry.BusinessQueryManager
    • javax.xml.registry.DeclarativeQueryManager
  • javax.jms.QueueBrowser
  • javax.mail.QuotaAwareStore
  • javax.resource.cci.RecordFactory
  • javax.naming.Referenceable
    • javax.resource.Referenceable
      • javax.resource.cci.ConnectionFactory (also extends java.io.Serializable)
  • javax.xml.registry.RegistryService
  • java.rmi.Remote
    • javax.ejb.EJBHome
      • javax.management.j2ee.ManagementHome
    • javax.ejb.EJBObject
      • javax.management.j2ee.Management
  • javax.servlet.RequestDispatcher
  • javax.resource.spi.ResourceAdapter
  • javax.resource.spi.ResourceAdapterAssociation
    • javax.resource.spi.ActivationSpec
  • javax.resource.cci.ResourceAdapterMetaData
  • java.sql.ResultSet
    • javax.resource.cci.ResultSet (also extends javax.resource.cci.Record)
  • javax.resource.cci.ResultSetInfo
  • java.lang.Runnable
    • javax.jms.Session
      • javax.jms.QueueSession
      • javax.jms.TopicSession
      • javax.jms.XAQueueSession
      • javax.jms.XASession
        • javax.jms.XAQueueSession
        • javax.jms.XATopicSession
      • javax.jms.XATopicSession
    • javax.resource.spi.work.Work
  • java.io.Serializable
    • javax.enterprise.deploy.spi.status.ClientConfiguration
    • javax.resource.cci.ConnectionFactory (also extends javax.resource.Referenceable)
    • javax.resource.spi.ConnectionManager
    • javax.xml.rpc.encoding.Deserializer
    • javax.xml.rpc.encoding.DeserializerFactory
    • javax.ejb.EnterpriseBean
      • javax.ejb.EntityBean
      • javax.ejb.MessageDrivenBean
      • javax.ejb.SessionBean
    • javax.ejb.Handle
    • javax.xml.rpc.handler.HandlerRegistry
    • javax.ejb.HomeHandle
    • javax.resource.cci.IndexedRecord (also extends java.util.List<E>, javax.resource.cci.Record)
    • javax.resource.cci.InteractionSpec
    • javax.management.j2ee.ListenerRegistration
    • javax.resource.spi.ManagedConnectionFactory
    • javax.resource.cci.MappedRecord (also extends java.util.Map<K,V>, javax.resource.cci.Record)
    • javax.faces.event.PhaseListener (also extends java.util.EventListener)
    • javax.resource.cci.Record (also extends java.lang.Cloneable)
      • javax.resource.cci.IndexedRecord (also extends java.util.List<E>, java.io.Serializable)
      • javax.resource.cci.MappedRecord (also extends java.util.Map<K,V>, java.io.Serializable)
      • javax.resource.cci.ResultSet (also extends java.sql.ResultSet)
    • javax.xml.rpc.encoding.Serializer
    • javax.xml.rpc.encoding.SerializerFactory
    • javax.ejb.TimerHandle
    • javax.xml.rpc.encoding.TypeMappingRegistry
  • javax.xml.rpc.encoding.SerializationContext
  • javax.jms.ServerSession
  • javax.jms.ServerSessionPool
  • javax.xml.rpc.Service
  • javax.xml.rpc.server.ServiceLifecycle
  • javax.servlet.Servlet
    • javax.servlet.jsp.HttpJspPage
    • javax.servlet.jsp.JspPage
      • javax.servlet.jsp.HttpJspPage
  • javax.servlet.ServletConfig
  • javax.servlet.ServletContext
  • javax.xml.rpc.server.ServletEndpointContext
  • javax.servlet.ServletRequest
    • javax.servlet.http.HttpServletRequest
  • javax.servlet.ServletResponse
    • javax.servlet.http.HttpServletResponse
  • javax.ejb.SessionSynchronization
  • javax.mail.internet.SharedInputStream
  • javax.servlet.SingleThreadModel
  • javax.xml.registry.infomodel.Slot
  • javax.xml.soap.SOAPConstants
  • javax.faces.component.StateHolder
  • javax.management.j2ee.statistics.Statistic
    • javax.management.j2ee.statistics.BoundaryStatistic
      • javax.management.j2ee.statistics.BoundedRangeStatistic (also extends javax.management.j2ee.statistics.RangeStatistic)
    • javax.management.j2ee.statistics.BoundedRangeStatistic (also extends javax.management.j2ee.statistics.BoundaryStatistic, javax.management.j2ee.statistics.RangeStatistic)
    • javax.management.j2ee.statistics.CountStatistic
    • javax.management.j2ee.statistics.RangeStatistic
      • javax.management.j2ee.statistics.BoundedRangeStatistic (also extends javax.management.j2ee.statistics.BoundaryStatistic)
    • javax.management.j2ee.statistics.TimeStatistic
  • javax.management.j2ee.statistics.Stats
    • javax.management.j2ee.statistics.EJBStats
      • javax.management.j2ee.statistics.EntityBeanStats
      • javax.management.j2ee.statistics.MessageDrivenBeanStats
      • javax.management.j2ee.statistics.SessionBeanStats
        • javax.management.j2ee.statistics.StatefulSessionBeanStats
        • javax.management.j2ee.statistics.StatelessSessionBeanStats
      • javax.management.j2ee.statistics.StatefulSessionBeanStats
      • javax.management.j2ee.statistics.StatelessSessionBeanStats
    • javax.management.j2ee.statistics.EntityBeanStats
    • javax.management.j2ee.statistics.JCAConnectionPoolStats
    • javax.management.j2ee.statistics.JCAConnectionStats
      • javax.management.j2ee.statistics.JCAConnectionPoolStats
    • javax.management.j2ee.statistics.JCAStats
    • javax.management.j2ee.statistics.JDBCConnectionPoolStats
    • javax.management.j2ee.statistics.JDBCConnectionStats
      • javax.management.j2ee.statistics.JDBCConnectionPoolStats
    • javax.management.j2ee.statistics.JDBCStats
    • javax.management.j2ee.statistics.JMSConnectionStats
    • javax.management.j2ee.statistics.JMSConsumerStats
    • javax.management.j2ee.statistics.JMSEndpointStats
      • javax.management.j2ee.statistics.JMSConsumerStats
      • javax.management.j2ee.statistics.JMSProducerStats
    • javax.management.j2ee.statistics.JMSProducerStats
    • javax.management.j2ee.statistics.JMSSessionStats
    • javax.management.j2ee.statistics.JMSStats
    • javax.management.j2ee.statistics.JTAStats
    • javax.management.j2ee.statistics.JVMStats
    • javax.management.j2ee.statistics.MessageDrivenBeanStats
    • javax.management.j2ee.statistics.ServletStats
    • javax.management.j2ee.statistics.SessionBeanStats
      • javax.management.j2ee.statistics.StatefulSessionBeanStats
      • javax.management.j2ee.statistics.StatelessSessionBeanStats
    • javax.management.j2ee.statistics.StatefulSessionBeanStats
    • javax.management.j2ee.statistics.StatelessSessionBeanStats
    • javax.management.j2ee.statistics.URLStats
  • javax.transaction.Status
  • javax.resource.cci.Streamable
  • javax.xml.stream.StreamFilter
  • javax.xml.rpc.Stub
  • javax.transaction.Synchronization
  • javax.enterprise.deploy.spi.Target
  • javax.enterprise.deploy.spi.TargetModuleID
  • javax.xml.registry.infomodel.TelephoneNumber
  • javax.ejb.TimedObject
  • javax.ejb.Timer
  • javax.ejb.TimerService
  • javax.transaction.Transaction
  • javax.transaction.TransactionManager
  • javax.transaction.TransactionSynchronizationRegistry
  • javax.servlet.jsp.tagext.TryCatchFinally
  • javax.xml.rpc.encoding.TypeMapping
  • javax.mail.UIDFolder
  • javax.xml.bind.Unmarshaller
  • javax.xml.registry.infomodel.URIValidator
    • javax.xml.registry.infomodel.ExternalLink (also extends javax.xml.registry.infomodel.RegistryObject)
    • javax.xml.registry.infomodel.ServiceBinding (also extends javax.xml.registry.infomodel.RegistryObject)
  • javax.transaction.UserTransaction
  • javax.resource.spi.ValidatingManagedConnectionFactory
  • javax.xml.bind.ValidationEvent
    • javax.xml.bind.NotIdentifiableEvent
    • javax.xml.bind.ParseConversionEvent
    • javax.xml.bind.PrintConversionEvent
  • javax.xml.bind.ValidationEventHandler
  • javax.xml.bind.ValidationEventLocator
  • javax.xml.bind.Validator
  • javax.faces.component.ValueHolder
    • javax.faces.component.EditableValueHolder
  • javax.servlet.jsp.el.VariableResolver
  • javax.xml.registry.infomodel.Versionable
    • javax.xml.registry.infomodel.ClassificationScheme
    • javax.xml.registry.infomodel.ExtrinsicObject
    • javax.xml.registry.infomodel.RegistryEntry (also extends javax.xml.registry.infomodel.RegistryObject)
      • javax.xml.registry.infomodel.ClassificationScheme
      • javax.xml.registry.infomodel.ExtrinsicObject
      • javax.xml.registry.infomodel.RegistryPackage
      • javax.xml.registry.infomodel.Service
    • javax.xml.registry.infomodel.RegistryPackage
    • javax.xml.registry.infomodel.Service
  • javax.xml.ws.WebServiceContext
  • javax.resource.spi.work.WorkManager
  • javax.jms.XAConnectionFactory
    • javax.jms.XAQueueConnectionFactory (also extends javax.jms.QueueConnectionFactory)
    • javax.jms.XATopicConnectionFactory (also extends javax.jms.TopicConnectionFactory)
  • javax.transaction.xa.XAResource
  • javax.resource.spi.XATerminator
  • javax.transaction.xa.Xid
  • javax.xml.stream.util.XMLEventAllocator
  • javax.xml.stream.util.XMLEventConsumer
    • javax.xml.stream.XMLEventWriter
  • javax.xml.stream.XMLReporter
  • javax.xml.stream.XMLResolver
  • javax.xml.stream.XMLStreamConstants
    • javax.xml.stream.events.Attribute
      • javax.xml.stream.events.Namespace
    • javax.xml.stream.events.Characters
    • javax.xml.stream.events.Comment
    • javax.xml.stream.events.DTD
    • javax.xml.stream.events.EndDocument
    • javax.xml.stream.events.EndElement
    • javax.xml.stream.events.EntityDeclaration
    • javax.xml.stream.events.EntityReference
    • javax.xml.stream.events.Namespace
    • javax.xml.stream.events.NotationDeclaration
    • javax.xml.stream.events.ProcessingInstruction
    • javax.xml.stream.events.StartDocument
    • javax.xml.stream.events.StartElement
    • javax.xml.stream.events.XMLEvent
      • javax.xml.stream.events.Attribute
        • javax.xml.stream.events.Namespace
      • javax.xml.stream.events.Characters
      • javax.xml.stream.events.Comment
      • javax.xml.stream.events.DTD
      • javax.xml.stream.events.EndDocument
      • javax.xml.stream.events.EndElement
      • javax.xml.stream.events.EntityDeclaration
      • javax.xml.stream.events.EntityReference
      • javax.xml.stream.events.Namespace
      • javax.xml.stream.events.NotationDeclaration
      • javax.xml.stream.events.ProcessingInstruction
      • javax.xml.stream.events.StartDocument
      • javax.xml.stream.events.StartElement
    • javax.xml.stream.XMLStreamReader
  • javax.xml.stream.XMLStreamWriter
  • javax.enterprise.deploy.model.XpathListener

Annotation Type Hierarchy

  • javax.ejb.ActivationConfigProperty (implements java.lang.annotation.Annotation)
  • javax.ejb.ApplicationException (implements java.lang.annotation.Annotation)
  • javax.ejb.EJB (implements java.lang.annotation.Annotation)
  • javax.ejb.EJBs (implements java.lang.annotation.Annotation)
  • javax.ejb.Init (implements java.lang.annotation.Annotation)
  • javax.ejb.Local (implements java.lang.annotation.Annotation)
  • javax.ejb.LocalHome (implements java.lang.annotation.Annotation)
  • javax.ejb.MessageDriven (implements java.lang.annotation.Annotation)
  • javax.ejb.PostActivate (implements java.lang.annotation.Annotation)
  • javax.ejb.PrePassivate (implements java.lang.annotation.Annotation)
  • javax.ejb.Remote (implements java.lang.annotation.Annotation)
  • javax.ejb.RemoteHome (implements java.lang.annotation.Annotation)
  • javax.ejb.Remove (implements java.lang.annotation.Annotation)
  • javax.ejb.Stateful (implements java.lang.annotation.Annotation)
  • javax.ejb.Stateless (implements java.lang.annotation.Annotation)
  • javax.ejb.Timeout (implements java.lang.annotation.Annotation)
  • javax.ejb.TransactionAttribute (implements java.lang.annotation.Annotation)
  • javax.ejb.TransactionManagement (implements java.lang.annotation.Annotation)
  • javax.interceptor.AroundInvoke (implements java.lang.annotation.Annotation)
  • javax.interceptor.ExcludeClassInterceptors (implements java.lang.annotation.Annotation)
  • javax.interceptor.ExcludeDefaultInterceptors (implements java.lang.annotation.Annotation)
  • javax.interceptor.Interceptors (implements java.lang.annotation.Annotation)
  • javax.annotation.Generated (implements java.lang.annotation.Annotation)
  • javax.annotation.PostConstruct (implements java.lang.annotation.Annotation)
  • javax.annotation.PreDestroy (implements java.lang.annotation.Annotation)
  • javax.annotation.Resource (implements java.lang.annotation.Annotation)
  • javax.annotation.Resources (implements java.lang.annotation.Annotation)
  • javax.annotation.security.DeclareRoles (implements java.lang.annotation.Annotation)
  • javax.annotation.security.DenyAll (implements java.lang.annotation.Annotation)
  • javax.annotation.security.PermitAll (implements java.lang.annotation.Annotation)
  • javax.annotation.security.RolesAllowed (implements java.lang.annotation.Annotation)
  • javax.annotation.security.RunAs (implements java.lang.annotation.Annotation)
  • javax.xml.ws.BindingType (implements java.lang.annotation.Annotation)
  • javax.xml.ws.RequestWrapper (implements java.lang.annotation.Annotation)
  • javax.xml.ws.ResponseWrapper (implements java.lang.annotation.Annotation)
  • javax.xml.ws.ServiceMode (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebEndpoint (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebFault (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceClient (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceProvider (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceRef (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceRefs (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAccessorOrder (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAccessorType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAnyAttribute (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAnyElement (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAttachmentRef (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAttribute (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElement (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementDecl (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementRef (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementRefs (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementWrapper (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElements (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlEnum (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlEnumValue (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlID (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlIDREF (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlInlineBinaryData (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlList (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlMimeType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlMixed (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlNs (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlRegistry (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlRootElement (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlSchema (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlSchemaType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlSchemaTypes (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlTransient (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlValue (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters (implements java.lang.annotation.Annotation)
  • javax.jws.HandlerChain (implements java.lang.annotation.Annotation)
  • javax.jws.Oneway (implements java.lang.annotation.Annotation)
  • javax.jws.WebMethod (implements java.lang.annotation.Annotation)
  • javax.jws.WebParam (implements java.lang.annotation.Annotation)
  • javax.jws.WebResult (implements java.lang.annotation.Annotation)
  • javax.jws.WebService (implements java.lang.annotation.Annotation)
  • javax.jws.soap.InitParam (implements java.lang.annotation.Annotation)
  • javax.jws.soap.SOAPBinding (implements java.lang.annotation.Annotation)
  • javax.jws.soap.SOAPMessageHandler (implements java.lang.annotation.Annotation)
  • javax.jws.soap.SOAPMessageHandlers (implements java.lang.annotation.Annotation)
  • javax.persistence.AssociationOverride (implements java.lang.annotation.Annotation)
  • javax.persistence.AssociationOverrides (implements java.lang.annotation.Annotation)
  • javax.persistence.AttributeOverride (implements java.lang.annotation.Annotation)
  • javax.persistence.AttributeOverrides (implements java.lang.annotation.Annotation)
  • javax.persistence.Basic (implements java.lang.annotation.Annotation)
  • javax.persistence.Column (implements java.lang.annotation.Annotation)
  • javax.persistence.ColumnResult (implements java.lang.annotation.Annotation)
  • javax.persistence.DiscriminatorColumn (implements java.lang.annotation.Annotation)
  • javax.persistence.DiscriminatorValue (implements java.lang.annotation.Annotation)
  • javax.persistence.Embeddable (implements java.lang.annotation.Annotation)
  • javax.persistence.Embedded (implements java.lang.annotation.Annotation)
  • javax.persistence.EmbeddedId (implements java.lang.annotation.Annotation)
  • javax.persistence.Entity (implements java.lang.annotation.Annotation)
  • javax.persistence.EntityListeners (implements java.lang.annotation.Annotation)
  • javax.persistence.EntityResult (implements java.lang.annotation.Annotation)
  • javax.persistence.Enumerated (implements java.lang.annotation.Annotation)
  • javax.persistence.ExcludeDefaultListeners (implements java.lang.annotation.Annotation)
  • javax.persistence.ExcludeSuperclassListeners (implements java.lang.annotation.Annotation)
  • javax.persistence.FieldResult (implements java.lang.annotation.Annotation)
  • javax.persistence.GeneratedValue (implements java.lang.annotation.Annotation)
  • javax.persistence.Id (implements java.lang.annotation.Annotation)
  • javax.persistence.IdClass (implements java.lang.annotation.Annotation)
  • javax.persistence.Inheritance (implements java.lang.annotation.Annotation)
  • javax.persistence.JoinColumn (implements java.lang.annotation.Annotation)
  • javax.persistence.JoinColumns (implements java.lang.annotation.Annotation)
  • javax.persistence.JoinTable (implements java.lang.annotation.Annotation)
  • javax.persistence.Lob (implements java.lang.annotation.Annotation)
  • javax.persistence.ManyToMany (implements java.lang.annotation.Annotation)
  • javax.persistence.ManyToOne (implements java.lang.annotation.Annotation)
  • javax.persistence.MapKey (implements java.lang.annotation.Annotation)
  • javax.persistence.MappedSuperclass (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedNativeQueries (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedNativeQuery (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedQueries (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedQuery (implements java.lang.annotation.Annotation)
  • javax.persistence.OneToMany (implements java.lang.annotation.Annotation)
  • javax.persistence.OneToOne (implements java.lang.annotation.Annotation)
  • javax.persistence.OrderBy (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceContext (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceContexts (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceProperty (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceUnit (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceUnits (implements java.lang.annotation.Annotation)
  • javax.persistence.PostLoad (implements java.lang.annotation.Annotation)
  • javax.persistence.PostPersist (implements java.lang.annotation.Annotation)
  • javax.persistence.PostRemove (implements java.lang.annotation.Annotation)
  • javax.persistence.PostUpdate (implements java.lang.annotation.Annotation)
  • javax.persistence.PrePersist (implements java.lang.annotation.Annotation)
  • javax.persistence.PreRemove (implements java.lang.annotation.Annotation)
  • javax.persistence.PreUpdate (implements java.lang.annotation.Annotation)
  • javax.persistence.PrimaryKeyJoinColumn (implements java.lang.annotation.Annotation)
  • javax.persistence.PrimaryKeyJoinColumns (implements java.lang.annotation.Annotation)
  • javax.persistence.QueryHint (implements java.lang.annotation.Annotation)
  • javax.persistence.SecondaryTable (implements java.lang.annotation.Annotation)
  • javax.persistence.SecondaryTables (implements java.lang.annotation.Annotation)
  • javax.persistence.SequenceGenerator (implements java.lang.annotation.Annotation)
  • javax.persistence.SqlResultSetMapping (implements java.lang.annotation.Annotation)
  • javax.persistence.SqlResultSetMappings (implements java.lang.annotation.Annotation)
  • javax.persistence.Table (implements java.lang.annotation.Annotation)
  • javax.persistence.TableGenerator (implements java.lang.annotation.Annotation)
  • javax.persistence.Temporal (implements java.lang.annotation.Annotation)
  • javax.persistence.Transient (implements java.lang.annotation.Annotation)
  • javax.persistence.UniqueConstraint (implements java.lang.annotation.Annotation)
  • javax.persistence.Version (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.ejb.TransactionAttributeType
      • javax.ejb.TransactionManagementType
      • javax.annotation.Resource.AuthenticationType
      • javax.xml.ws.Service.Mode
      • javax.xml.ws.handler.MessageContext.Scope
      • javax.xml.bind.annotation.XmlAccessOrder
      • javax.xml.bind.annotation.XmlAccessType
      • javax.xml.bind.annotation.XmlNsForm
      • javax.jws.WebParam.Mode
      • javax.jws.soap.SOAPBinding.Style
      • javax.jws.soap.SOAPBinding.Use
      • javax.jws.soap.SOAPBinding.ParameterStyle
      • javax.persistence.CascadeType
      • javax.persistence.DiscriminatorType
      • javax.persistence.EnumType
      • javax.persistence.FetchType
      • javax.persistence.FlushModeType
      • javax.persistence.GenerationType
      • javax.persistence.InheritanceType
      • javax.persistence.LockModeType
      • javax.persistence.PersistenceContextType
      • javax.persistence.TemporalType
      • javax.persistence.spi.PersistenceUnitTransactionType
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


javax.activation (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.activation

The JavaBeans(TM) Activation Framework is used by the JavaMail(TM) API to manage MIME data.

See:
Description

Interface Summary
CommandObject | JavaBeans components that are Activation Framework aware implement this interface to find out which command verb they're being asked to perform, and to obtain the DataHandler representing the data they should operate on.
DataContentHandler | The DataContentHandler interface is implemented by objects that can be used to extend the capabilities of the DataHandler's implementation of the Transferable interface.
DataContentHandlerFactory | This interface defines a factory for DataContentHandlers.
DataSource | The DataSource interface provides the JavaBeans Activation Framework with an abstraction of an arbitrary collection of data.

Class Summary
ActivationDataFlavor | The ActivationDataFlavor class is a special subclass of java.awt.datatransfer.DataFlavor.
CommandInfo | The CommandInfo class is used by CommandMap implementations to describe the results of command requests.
CommandMap | The CommandMap class provides an interface to a registry of command objects available in the system.
DataHandler | The DataHandler class provides a consistent interface to data available in many different sources and formats.
FileDataSource | The FileDataSource class implements a simple DataSource object that encapsulates a file.
FileTypeMap | The FileTypeMap is an abstract class that provides a data typing interface for files.
MailcapCommandMap | MailcapCommandMap extends the CommandMap abstract class.
MimeType | A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
MimeTypeParameterList | A parameter list of a MimeType as defined in RFC 2045 and 2046.
MimetypesFileTypeMap | This class extends FileTypeMap and provides data typing of files via their file extension.
URLDataSource | The URLDataSource class provides an object that wraps a URL object in a DataSource interface.

Exception Summary
MimeTypeParseException | A class to encapsulate MimeType parsing related exceptions.
UnsupportedDataTypeException | Signals that the requested operation does not support the requested data type.

Package javax.activation Description

The JavaBeans(TM) Activation Framework is used by the JavaMail(TM) API to manage MIME data.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.activation Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.activation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.activation.CommandInfo
    • javax.activation.CommandMap
      • javax.activation.MailcapCommandMap
    • java.awt.datatransfer.DataFlavor (implements java.lang.Cloneable, java.io.Externalizable)
      • javax.activation.ActivationDataFlavor
    • javax.activation.DataHandler (implements java.awt.datatransfer.Transferable)
    • javax.activation.FileDataSource (implements javax.activation.DataSource)
    • javax.activation.FileTypeMap
      • javax.activation.MimetypesFileTypeMap
    • javax.activation.MimeType (implements java.io.Externalizable)
    • javax.activation.MimeTypeParameterList
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.io.IOException
          • javax.activation.UnsupportedDataTypeException
        • javax.activation.MimeTypeParseException
    • javax.activation.URLDataSource (implements javax.activation.DataSource)

Interface Hierarchy

  • javax.activation.CommandObject
  • javax.activation.DataContentHandler
  • javax.activation.DataContentHandlerFactory
  • javax.activation.DataSource
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


CommandObject (Java EE 5)

PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

javax.activation
Interface CommandObject

public interface CommandObject

Activation Framework 所知的 JavaBean 组件实现此接口，以找出请求这些组件执行的命令动词，并获取表示这些组件要操作的数据的 DataHandler。不实现此接口的 JavaBean 也同样可以使用。这类命令可以使用 Externalizable 接口或特定于应用程序的方法来获取数据。

英文文档：

JavaBeans components that are Activation Framework aware implement this interface to find out which command verb they're being asked to perform, and to obtain the DataHandler representing the data they should operate on. JavaBeans that don't implement this interface may be used as well. Such commands may obtain the data using the Externalizable interface, or using an application-specific method.

Method Summary
 void setCommandContext(String verb, DataHandler dh)
Initialize the Command with the verb it is requested to handle and the DataHandler that describes the data it will operate on.

Method Detail

public void setCommandContext(String verb, DataHandler dh) throws java.io.IOException
用请求处理的动词和描述将要操作的数据的 DataHandler 来初始化 Command。注：调用者为 DataHandler 传递 null 值是可以接受的。
verb | 此对象引用的 Command Verb。
dh | DataHandler。
英文文档：

setCommandContext

void setCommandContext(String verb,
                       DataHandler dh)
                       throws IOException
Initialize the Command with the verb it is requested to handle and the DataHandler that describes the data it will operate on. NOTE: it is acceptable for the caller to pass null as the value for DataHandler.

Parameters:
verb - The Command Verb this object refers to.
dh - The DataHandler.
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. 一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正；若因此而造成任何损失请直接找人民主席，请勿与本人联系。谢谢！


DataContentHandler (Java EE 5)

javax.activation
Interface DataContentHandler

public interface DataContentHandler

DataContentHandler 接口由可用于扩展 Transferable 接口的 DataHandler 实现性能的对象来实现。通过 DataContentHandlers 可扩展该框架，使它能够将流转入对象，并能将对象写入流。

应用程序通常不直接调用 DataContentHandler 中的方法。相反，应用程序调用 DataHandler 中的等效方法。DataHandler 将使用当前 DataContentHandlerFactory 尝试找到与其 MIME 类型对应的恰当 DataContentHandler。然后，DataHandler 调用到该 DataContentHandlerthen 中的方法。

英文文档：

The DataContentHandler interface is implemented by objects that can be used to extend the capabilities of the DataHandler's implementation of the Transferable interface. Through DataContentHandlers the framework can be extended to convert streams in to objects, and to write objects to streams.

Applications don't generally call the methods in DataContentHandlers directly. Instead, an application calls the equivalent methods in DataHandler. The DataHandler will attempt to find an appropriate DataContentHandler that corresponds to its MIME type using the current DataContentHandlerFactory. The DataHandler then calls through to the methods in the DataContentHandler.

Method Summary
Object | getContent(DataSource ds) Return an object representing the data in its most preferred form.
Object | getTransferData(DataFlavor df, DataSource ds) Returns an object which represents the data to be transferred.
DataFlavor[] | getTransferDataFlavors() Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
void | writeTo(Object obj, String mimeType, OutputStream os) Convert the object to a byte stream of the specified MIME type and write it to the output stream.

Method Detail

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
返回一个 DataFlavor 对象数组，这些对象指示可用于提供数据的 flavor。该数组应该根据提供数据的首选项来排序（从描述最多的到描述最少的）。
return DataFlavor。
英文文档：

getTransferDataFlavors

DataFlavor[] getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).

Returns:
The DataFlavors.

public Object getTransferData(java.awt.datatransfer.DataFlavor df, DataSource ds) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
返回一个对象，该对象表示将要传输的数据。返回的对象的类是由该 flavor 的表示形式类定义的。
df | 表示所请求类型的 DataFlavor。
ds | 表示要转换的数据的 DataSource。
return | 构造的对象
Throws | java.awt.datatransfer.UnsupportedFlavorException: 如果处理程序不支持所请求的 flavor
Throws | java.io.IOException: 如果数据不能被访问
英文文档：

getTransferData

Object getTransferData(DataFlavor df,
                       DataSource ds)
                       throws UnsupportedFlavorException,
                              IOException
Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.

Parameters:
df - The DataFlavor representing the requested type.
ds - The DataSource representing the data to be converted.
Returns:
The constructed Object.
Throws:
UnsupportedFlavorException - if the handler doesn't support the requested flavor
IOException - if the data can't be accessed

public Object getContent(DataSource ds) throws java.io.IOException
返回一个对象，该对象表示其首选形式的数据。通常，这将是 getTransferDataFlavors 方法返回的第一个 DataFlavor 所描述的形式。
ds | 表示要转换的数据的 DataSource。
return | 构造的对象
Throws | java.io.IOException: 如果数据不能被访问
英文文档：

getContent

Object getContent(DataSource ds)
                  throws IOException
Return an object representing the data in its most preferred form. Generally this will be the form described by the first DataFlavor returned by the getTransferDataFlavors method.

Parameters:
ds - The DataSource representing the data to be converted.
Returns:
The constructed Object.
Throws:
IOException - if the data can't be accessed

public void writeTo(Object obj, String mimeType, java.io.OutputStream os) throws java.io.IOException
将对象转换为指定 MIME 类型的字节流，并将其写入输出流。
obj | 要转换的对象。
mimeType | 所请求的结果字节流的 MIME 类型。
os | 要写入转换的字节流的输出流。
Throws | java.io.IOException: 写入流时出现错误
英文文档：

writeTo

void writeTo(Object obj,
             String mimeType,
             OutputStream os)
             throws IOException
Convert the object to a byte stream of the specified MIME type and write it to the output stream.

Parameters:
obj - The object to be converted.
mimeType - The requested MIME type of the resulting byte stream.
os - The output stream into which to write the converted byte stream.
Throws:
IOException - errors writing to the stream
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataContentHandlerFactory (Java EE 5)

javax.activation
Interface DataContentHandlerFactory

public interface DataContentHandlerFactory

此接口定义了 DataContentHandler 的工厂。此接口的实现应该将 MIME 类型映射到 ContentHandler 的实例中。类实现此接口的设计模式与 java.net.URL 中使用的 ContentHandler 机制相同。
英文文档：

This interface defines a factory for DataContentHandlers. An implementation of this interface should map a MIME type into an instance of DataContentHandler. The design pattern for classes implementing this interface is the same as for the ContentHandler mechanism used in java.net.URL.

Method Summary
 DataContentHandler createDataContentHandler(String mimeType)
Creates a new DataContentHandler object for the MIME type.

Method Detail

public DataContentHandler createDataContentHandler(String mimeType)
针对 MIME 类型创建一个新的 DataContentHandler 对象。
mimeType | 要为其创建 DataContentHandler 的 MIME 类型。
return | 新的 DataContentHandler；如果不存在，则返回 null。
英文文档：

createDataContentHandler

DataContentHandler createDataContentHandler(String mimeType)
Creates a new DataContentHandler object for the MIME type.

Parameters:
mimeType - the MIME type to create the DataContentHandler for.
Returns:
The new DataContentHandler, or null if none are found.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataSource (Java EE 5)

javax.activation
Interface DataSource

All Known Subinterfaces:
MultipartDataSource
All Known Implementing Classes:
ByteArrayDataSource, FileDataSource, MimePartDataSource, URLDataSource
public interface DataSource

Implemented by: ByteArrayDataSource, FileDataSource, MimePartDataSource, MultipartDataSource, URLDataSource

DataSource 接口为 JavaBeans Activation Framework 提供任意数据集合的抽象。它提供该数据的类型，并在适当的时候以 InputStream 和 OutputStream 的形式提供对该数据的访问。
英文文档：

The DataSource interface provides the JavaBeans Activation Framework with an abstraction of an arbitrary collection of data. It provides a type for that data as well as access to it in the form of InputStreams and OutputStreams where appropriate.

Method Summary
String | getContentType() This method returns the MIME type of the data in the form of a string.
InputStream | getInputStream() This method returns an InputStream representing the data and throws the appropriate exception if it can not do so.
String | getName() Return the name of this object where the name of the object is dependant on the nature of the underlying objects.
OutputStream | getOutputStream() This method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so.

Method Detail

public java.io.InputStream getInputStream() throws java.io.IOException
此方法返回一个表示数据的 InputStream；如果无法提供，则抛出适当的异常。注意，每次调用此方法时都必须返回一个新的 InputStream 对象，并且流必须位于数据的开始位置。
return InputStream
英文文档：

getInputStream

InputStream getInputStream()
                           throws IOException
This method returns an InputStream representing the data and throws the appropriate exception if it can not do so. Note that a new InputStream object must be returned each time this method is called, and the stream must be positioned at the beginning of the data.

Returns:
an InputStream
Throws:
IOException

public java.io.OutputStream getOutputStream() throws java.io.IOException
此方法返回一个可以写入数据的 OutputStream，如果无法返回，则抛出适当的异常。注意，每次调用此方法时都必须返回一个新的 OutputStream 对象，并且流必须位于要写入数据的位置。
return OutputStream
英文文档：

getOutputStream

OutputStream getOutputStream()
                             throws IOException
This method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so. Note that a new OutputStream object must be returned each time this method is called, and the stream must be positioned at the location the data is to be written.

Returns:
an OutputStream
Throws:
IOException

public String getContentType()
此方法以字符串形式返回数据的 MIME 类型。应该始终返回有效类型。如果 DataSource 实现不能确定数据类型，则建议 getContentType 返回 "application/octet-stream"。
return MIME 类型
英文文档：

getContentType

String getContentType()
This method returns the MIME type of the data in the form of a string. It should always return a valid type. It is suggested that getContentType return "application/octet-stream" if the DataSource implementation can not determine the data type.

Returns:
the MIME Type

public String getName()
返回此对象的名称，其中对象的名称依赖于底层对象的特性。封装文件的 DataSources 可以选择返回对象的文件名。(通常，这是文件名的最后部分，并不是完整路径名。)
return 对象的名称。
英文文档：

getName

String getName()
Return the name of this object where the name of the object is dependant on the nature of the underlying objects. DataSources encapsulating files may choose to return the filename of the object. (Typically this would be the last component of the filename, not an entire pathname.)

Returns:
the name of the object.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ActivationDataFlavor (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.activation
Class ActivationDataFlavor

java.lang.Object
    extended by  java.awt.datatransfer.DataFlavor
        extended by  javax.activation.ActivationDataFlavor
All Implemented Interfaces:
Externalizable, Serializable, Cloneable
public class ActivationDataFlavor
extends DataFlavor

Extends: java.awt.datatransfer.DataFlavor

ActivationDataFlavor 类是 java.awt.datatransfer.DataFlavor 的一个特殊子类。它允许 JAF 通过新的构造方法设置 DataFlavor 类所存储的所有三个值。它还包含 equals 方法中增强的 MIME 解析。除了增强的解析外，其语义与 JDK DataFlavor 类的语义相同。
英文文档：

The ActivationDataFlavor class is a special subclass of java.awt.datatransfer.DataFlavor. It allows the JAF to set all three values stored by the DataFlavor class via a new constructor. It also contains improved MIME parsing in the equals method. Except for the improved parsing, its semantics are identical to that of the JDK's DataFlavor class.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.awt.datatransfer.DataFlavor
imageFlavor, javaFileListFlavor, javaJVMLocalObjectMimeType, javaRemoteObjectMimeType, javaSerializedObjectMimeType, plainTextFlavor, stringFlavor
Constructor Summary
ActivationDataFlavor(Class representationClass, String humanPresentableName)
Construct a DataFlavor that represents a MimeType.
ActivationDataFlavor(Class representationClass, String mimeType, String humanPresentableName)
Construct a DataFlavor that represents an arbitrary Java object.
ActivationDataFlavor(String mimeType, String humanPresentableName)
Construct a DataFlavor that represents a MimeType.
Method Summary
boolean | equals(DataFlavor dataFlavor) Compares the DataFlavor passed in with this DataFlavor; calls the isMimeTypeEqual method.
String | getHumanPresentableName() Return the Human Presentable name.
String | getMimeType() Return the MIME type for this DataFlavor.
Class | getRepresentationClass() Return the representation class.
boolean | isMimeTypeEqual(String mimeType) Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor.
protected String | normalizeMimeType(String mimeType) Deprecated.
protected String | normalizeMimeTypeParameter(String parameterName, String parameterValue) Deprecated.
void | setHumanPresentableName(String humanPresentableName) Set the human presentable name.
Methods inherited from class java.awt.datatransfer.DataFlavor
clone, equals, equals, getDefaultRepresentationClass, getDefaultRepresentationClassAsString, getParameter, getPrimaryType, getReaderForText, getSubType, getTextPlainUnicodeFlavor, hashCode, isFlavorJavaFileListType, isFlavorRemoteObjectType, isFlavorSerializedObjectType, isFlavorTextType, isMimeTypeEqual, isMimeTypeSerializedObject, isRepresentationClassByteBuffer, isRepresentationClassCharBuffer, isRepresentationClassInputStream, isRepresentationClassReader, isRepresentationClassRemote, isRepresentationClassSerializable, match, readExternal, selectBestTextFlavor, toString, tryToLoadClass, writeExternal
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

public ActivationDataFlavor(Class<T> representationClass, String mimeType, String humanPresentableName)
构造一个表示任意 Java 对象的 DataFlavor。此构造方法是 JDK DataFlavor 的扩展，它允许显示设置所有三个 DataFlavor 属性。

返回的 DataFlavor 将具有以下特征：

representationClass = representationClass
mimeType = mimeType
humanName = humanName

representationClass | 此 DataFlavor 中使用的类
mimeType | 此类表示的数据 MIME 类型
humanPresentableName | flavor 的得体的名称
英文文档：

ActivationDataFlavor

public ActivationDataFlavor(Class representationClass,
                            String mimeType,
                            String humanPresentableName)
Construct a DataFlavor that represents an arbitrary Java object. This constructor is an extension of the JDK's DataFlavor in that it allows the explicit setting of all three DataFlavor attributes.

The returned DataFlavor will have the following characteristics:

representationClass = representationClass
mimeType = mimeType
humanName = humanName

Parameters:
representationClass - the class used in this DataFlavor
mimeType - the MIME type of the data represented by this class
humanPresentableName - the human presentable name of the flavor

public ActivationDataFlavor(Class<T> representationClass, String humanPresentableName)
构造一个表示 MimeType 的 DataFlavor。

返回的 DataFlavor 将具有以下特征：

如果 mimeType 为 "application/x-java-serialized-object; class="，则结果与调用新的 DataFlavor(Class:forName()) 相同（同上）。

否则：

representationClass = InputStream

mimeType = mimeType

representationClass | 此 DataFlavor 中使用的类
humanPresentableName | flavor 的得体的名称
英文文档：

ActivationDataFlavor

public ActivationDataFlavor(Class representationClass,
                            String humanPresentableName)
Construct a DataFlavor that represents a MimeType.

The returned DataFlavor will have the following characteristics:

If the mimeType is "application/x-java-serialized-object;
class=", the result is the same as calling new
DataFlavor(Class.forName()) as above.

otherwise:

representationClass = InputStream

mimeType = mimeType

Parameters:
representationClass - the class used in this DataFlavor
humanPresentableName - the human presentable name of the flavor

public ActivationDataFlavor(String mimeType, String humanPresentableName)
构造一个表示 MimeType 的 DataFlavor。

返回的 DataFlavor 将具有以下特征：

如果 mimeType 为 "application/x-java-serialized-object; class="，则结果与调用新的 DataFlavor(Class:forName()) 相同（同上），否则：

representationClass = InputStream

mimeType = mimeType

mimeType | 此类表示的数据 MIME 类型
humanPresentableName | flavor 的得体的名称
英文文档：

ActivationDataFlavor

public ActivationDataFlavor(String mimeType,
                            String humanPresentableName)
Construct a DataFlavor that represents a MimeType.

The returned DataFlavor will have the following characteristics:

If the mimeType is "application/x-java-serialized-object; class=", the result is the same as calling new DataFlavor(Class.forName()) as above, otherwise:

representationClass = InputStream

mimeType = mimeType

Parameters:
mimeType - the MIME type of the data represented by this class
humanPresentableName - the human presentable name of the flavor
Method Detail

public String getMimeType()
返回此 DataFlavor 的 MIME 类型。
return MIME 类型
英文文档：

getMimeType

public String getMimeType()
Return the MIME type for this DataFlavor.

Overrides:
getMimeType in class DataFlavor
Returns:
the MIME type

public Class<T> getRepresentationClass()
返回表示形式类。
return 表示形式类
英文文档：

getRepresentationClass

public Class getRepresentationClass()
Return the representation class.

Overrides:
getRepresentationClass in class DataFlavor
Returns:
the representation class

public String getHumanPresentableName()
返回得体的名称。
return 得体的名称
英文文档：

getHumanPresentableName

public String getHumanPresentableName()
Return the Human Presentable name.

Overrides:
getHumanPresentableName in class DataFlavor
Returns:
the human presentable name

public void setHumanPresentableName(String humanPresentableName)
设置得体的名称。
humanPresentableName 要设置的名称。
英文文档：

setHumanPresentableName

public void setHumanPresentableName(String humanPresentableName)
Set the human presentable name.

Overrides:
setHumanPresentableName in class DataFlavor
Parameters:
humanPresentableName - the name to set

public boolean equals(java.awt.datatransfer.DataFlavor dataFlavor)
将传入的 DataFlavor 与此 DataFlavor 进行比较；调用 isMimeTypeEqual 方法。
dataFlavor | 要与之比较的 DataFlavor
return | 如果 MIME 类型和表示形式类都相同，则返回 true
英文文档：

equals

public boolean equals(DataFlavor dataFlavor)
Compares the DataFlavor passed in with this DataFlavor; calls the isMimeTypeEqual method.

Overrides:
equals in class DataFlavor
Parameters:
dataFlavor - the DataFlavor to compare with
Returns:
true if the MIME type and representation class are the same

public boolean isMimeTypeEqual(String mimeType)
传入的 MIME 类型的字符串表示形式是否等效于此 DataFlavor 的 MIME 类型。

ActivationDataFlavor 将 MIME 类型的比较委托给作为 JavaBeans Activation Framework 的一部分包含的 MimeType 类。相比 DataFlavor 类中通常可用的比较，此方法提供的比较更加健壮。

mimeType | MIME 类型
return | 如果 MIME 类型相同，则返回 true
英文文档：

isMimeTypeEqual

public boolean isMimeTypeEqual(String mimeType)
Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor.

ActivationDataFlavor delegates the comparison of MIME types to the MimeType class included as part of the JavaBeans Activation Framework. This provides a more robust comparison than is normally available in the DataFlavor class.

Overrides:
isMimeTypeEqual in class DataFlavor
Parameters:
mimeType - the MIME type
Returns:
true if the same MIME type

protected String normalizeMimeTypeParameter(String parameterName, String parameterValue)
针对每个 MIME 类型参数对 DataFlavor 调用此方法，以允许 DataFlavor 子类处理特定参数，如文本/纯文本 charset 参数，其值是不区分大小写的。（MIME 类型参数值应该区分大小写）。

为每个参数名/值对调用此方法，应该返回 parameterValue 的标准化表示形式。此实现不再调用此方法。

parameterName | 参数名
parameterValue | 参数值
return | 标准化的参数值
deprecated |
英文文档：

normalizeMimeTypeParameter

protected String normalizeMimeTypeParameter(String parameterName,
                                            String parameterValue)
Deprecated.

Called on DataFlavor for every MIME Type parameter to allow DataFlavor subclasses to handle special parameters like the text/plain charset parameters, whose values are case insensitive. (MIME type parameter values are supposed to be case sensitive).

This method is called for each parameter name/value pair and should return the normalized representation of the parameterValue. This method is never invoked by this implementation.

Overrides:
normalizeMimeTypeParameter in class DataFlavor
Parameters:
parameterName - the parameter name
parameterValue - the parameter value
Returns:
the normalized parameter value

protected String normalizeMimeType(String mimeType)
为每个 MIME 类型字符串调用此方法，以使 DataFlavor 子类型能够更改实现 MIME 类型标准化的方式。一种可能的用法是，在传入的 MIME 类型字符串中不存在参数/值对的情况下添加默认的参数/值对。此实现不再调用此方法。
mimeType | MIME 类型
return | 标准化的 MIME 类型
deprecated |
英文文档：

normalizeMimeType

protected String normalizeMimeType(String mimeType)
Deprecated.

Called for each MIME type string to give DataFlavor subtypes the opportunity to change how the normalization of MIME types is accomplished. One possible use would be to add default parameter/value pairs in cases where none are present in the MIME type string passed in. This method is never invoked by this implementation.

Overrides:
normalizeMimeType in class DataFlavor
Parameters:
mimeType - the MIME type
Returns:
the normalized MIME type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommandInfo (Java EE 5)

javax.activation
Class CommandInfo

java.lang.Object
    extended by  javax.activation.CommandInfo

public class CommandInfo
extends Object

CommandMap 实现使用 CommandInfo 类描述命令请求的结果。它为请求者提供所请求的动词，以及 bean 的一个实例。还有一个方法，它将返回实现命令的类的名称，但是它不保证返回有效值。原因是允许子类化 CommandInfo 的 CommandMap 实现提供特殊行为。例如，CommandMap 能够动态生成 JavaBean。在这种情况下，不太可能仅根据类名称便创建带有全部正确状态信息的对象。
英文文档：

The CommandInfo class is used by CommandMap implementations to describe the results of command requests. It provides the requestor with both the verb requested, as well as an instance of the bean. There is also a method that will return the name of the class that implements the command but it is not guaranteed to return a valid value. The reason for this is to allow CommandMap implmentations that subclass CommandInfo to provide special behavior. For example a CommandMap could dynamically generate JavaBeans. In this case, it might not be possible to create an object with all the correct state information solely from the class name.

Constructor Summary
CommandInfo(String verb, String className)
The Constructor for CommandInfo.
Method Summary
String | getCommandClass() Return the command's class name.
String | getCommandName() Return the command verb.
Object | getCommandObject(DataHandler dh, ClassLoader loader) Return the instantiated JavaBean component.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public CommandInfo(String verb, String className)
CommandInfo 的构造方法。
verb | 此 CommandInfo 描述的命令动词。
className | 命令的完全限定类名。
英文文档：

CommandInfo

public CommandInfo(String verb,
                   String className)
The Constructor for CommandInfo.

Parameters:
verb - The command verb this CommandInfo decribes.
className - The command's fully qualified class name.
Method Detail

public String getCommandName()
返回命令动词。
return 命令动词。
英文文档：

getCommandName

public String getCommandName()
Return the command verb.

Returns:
the command verb.

public String getCommandClass()
返回命令的类名。当 CommandMap 根据其目的子类化 CommandInfo 时，此方法可能返回 null。换句话说，仅知道其类名不太可能创建命令的正确状态。不要依赖此方法来返回有效值！
return 命令的类名，或 null
英文文档：

getCommandClass

public String getCommandClass()
Return the command's class name. This method MAY return null in cases where a CommandMap subclassed CommandInfo for its own purposes. In other words, it might not be possible to create the correct state in the command by merely knowing its class name. DO NOT DEPEND ON THIS METHOD RETURNING A VALID VALUE!

Returns:
The class name of the command, or null

public Object getCommandObject(DataHandler dh, ClassLoader loader) throws java.io.IOException, ClassNotFoundException
返回已实例化的 JavaBean 组件。

从用 Beans.instantiate() 实例化组件开始。

如果 bean 实现了 javax.activation.CommandObject 接口，则调用其 setCommandContext 方法。

如果 DataHandler 参数为 null，则 bean 被实例化，且不带任何数据。注:如果由于某种原因，此方法试图访问其 InputStream 时传入的 DataHandler 抛出 IOExceptions，那么这将很有用。它将允许调用者获取对 bean 的引用（如果它可以被实例化）。

如果 bean 不实现 CommandObject 接口，那么此方法将检查它是否实现 java.io.Externalizable 接口。如果它实现 CommandObject 接口，若可以从 DataHandler 获取 InputStream，则将调用 bean 的 readExternal 方法。

dh | 描述要传递给命令的数据的 DataHandler。
loader | 将用于实例化 bean 的 ClassLoader。
return | bean
See also | instantiate, javax.activation.CommandObject
英文文档：

getCommandObject

public Object getCommandObject(DataHandler dh,
                               ClassLoader loader)
                        throws IOException,
                               ClassNotFoundException
Return the instantiated JavaBean component.

Begin by instantiating the component with Beans.instantiate().

If the bean implements the javax.activation.CommandObject interface, call its setCommandContext method.

If the DataHandler parameter is null, then the bean is instantiated with no data. NOTE: this may be useful if for some reason the DataHandler that is passed in throws IOExceptions when this method attempts to access its InputStream. It will allow the caller to retrieve a reference to the bean if it can be instantiated.

If the bean does NOT implement the CommandObject interface, this method will check if it implements the java.io.Externalizable interface. If it does, the bean's readExternal method will be called if an InputStream can be acquired from the DataHandler.

Parameters:
dh - The DataHandler that describes the data to be passed to the command.
loader - The ClassLoader to be used to instantiate the bean.
Returns:
The bean
Throws:
IOException
ClassNotFoundException
See Also:
Beans.instantiate(java.lang.ClassLoader, java.lang.String), CommandObject
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommandMap (Java EE 5)

javax.activation
Class CommandMap

java.lang.Object
    extended by  javax.activation.CommandMap
Direct Known Subclasses:
MailcapCommandMap
public abstract class CommandMap
extends Object

Extended by: MailcapCommandMap

CommandMap 类为系统中可用的命令对象注册表提供接口。期望开发人员使用此包 (MailcapCommandMap) 所包含的 CommandMap 实现，或者开发他们自己的实现。注意，此类中有些方法是抽象的。
英文文档：

The CommandMap class provides an interface to a registry of command objects available in the system. Developers are expected to either use the CommandMap implementation included with this package (MailcapCommandMap) or develop their own. Note that some of the methods in this class are abstract.

Constructor Summary
CommandMap()
Method Summary
abstract DataContentHandler | createDataContentHandler(String mimeType) Locate a DataContentHandler that corresponds to the MIME type.
DataContentHandler | createDataContentHandler(String mimeType, DataSource ds) Locate a DataContentHandler that corresponds to the MIME type.
abstract CommandInfo[] | getAllCommands(String mimeType) Get all the available commands for this type.
CommandInfo[] | getAllCommands(String mimeType, DataSource ds) Get all the available commands for this type.
abstract CommandInfo | getCommand(String mimeType, String cmdName) Get the default command corresponding to the MIME type.
CommandInfo | getCommand(String mimeType, String cmdName, DataSource ds) Get the default command corresponding to the MIME type.
static CommandMap | getDefaultCommandMap() Get the default CommandMap.
String[] | getMimeTypes() Get all the MIME types known to this command map.
abstract CommandInfo[] | getPreferredCommands(String mimeType) Get the preferred command list from a MIME Type.
CommandInfo[] | getPreferredCommands(String mimeType, DataSource ds) Get the preferred command list from a MIME Type.
static void | setDefaultCommandMap(CommandMap commandMap) Set the default CommandMap.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public CommandMap()
英文文档：

CommandMap

public CommandMap()
Method Detail

public static CommandMap getDefaultCommandMap()
获取默认的 CommandMap。

  • 在 CommandMap 实例已经被设置为某值（通过setDefaultCommandMap）的情况下，返回该 CommandMap。
  • 在没有设置任何 CommandMap 的情况下，CommandMap 创建一个 MailcapCommandMap 的实例并将其设置为默认值，返回它的值。
return CommandMap
英文文档：

getDefaultCommandMap

public static CommandMap getDefaultCommandMap()
Get the default CommandMap.

  • In cases where a CommandMap instance has been previously set to some value (via setDefaultCommandMap) return the CommandMap.
  • In cases where no CommandMap has been set, the CommandMap creates an instance of MailcapCommandMap and set that to the default, returning its value.

Returns:
the CommandMap

public static void setDefaultCommandMap(CommandMap commandMap)
设置默认的 CommandMap。通过用 null 调用此方法将 CommandMap 重置为默认值。
commandMap | 新的默认 CommandMap。
Throws | SecurityException: 如果调用者不具有更改默认的权限
英文文档：

setDefaultCommandMap

public static void setDefaultCommandMap(CommandMap commandMap)
Set the default CommandMap. Reset the CommandMap to the default by calling this method with null.

Parameters:
commandMap - The new default CommandMap.
Throws:
SecurityException - if the caller doesn't have permission to change the default

abstract public CommandInfo[] getPreferredCommands(String mimeType)
从 MIME 类型获取首选命令表。实际语义由 CommandMap 的实现来确定。
mimeType | MIME 类型
return | 表示命令 Bean 的 CommandInfo 类
英文文档：

getPreferredCommands

public abstract CommandInfo[] getPreferredCommands(String mimeType)
Get the preferred command list from a MIME Type. The actual semantics are determined by the implementation of the CommandMap.

Parameters:
mimeType - the MIME type
Returns:
the CommandInfo classes that represent the command Beans.

public CommandInfo[] getPreferredCommands(String mimeType, DataSource ds)
从 MIME 类型获取首选命令表。实际语义由 CommandMap 的实现来确定。

DataSource 提供额外信息，比如文件名，CommandMap 实现可以使用它进一步改进返回的命令表。此类中的实现调用 getPreferredCommands 方法，忽略此参数。

mimeType | MIME 类型
ds | 数据的 DataSource
return | 表示命令 Bean 的 CommandInfo 类
since | JAF 1.1
英文文档：

getPreferredCommands

public CommandInfo[] getPreferredCommands(String mimeType,
                                          DataSource ds)
Get the preferred command list from a MIME Type. The actual semantics are determined by the implementation of the CommandMap.

The DataSource provides extra information, such as the file name, that a CommandMap implementation may use to further refine the list of commands that are returned. The implementation in this class simply calls the getPreferredCommands method that ignores this argument.

Parameters:
mimeType - the MIME type
ds - a DataSource for the data
Returns:
the CommandInfo classes that represent the command Beans.
Since:
JAF 1.1

abstract public CommandInfo[] getAllCommands(String mimeType)
获取此类型的所有可用命令。此方法应该返回此 MIME 类型的所有可能命令。
mimeType | MIME 类型
return | 表示所有命令的 CommandInfo 对象
英文文档：

getAllCommands

public abstract CommandInfo[] getAllCommands(String mimeType)
Get all the available commands for this type. This method should return all the possible commands for this MIME type.

Parameters:
mimeType - the MIME type
Returns:
the CommandInfo objects representing all the commands.

public CommandInfo[] getAllCommands(String mimeType, DataSource ds)
获取此类型的所有可用命令。此方法应该返回此 MIME 类型的所有可能命令。

DataSource 提供额外信息，比如文件名，CommandMap 实现可以使用它进一步改进返回的命令表。此类中的实现调用 getAllCommands 方法，忽略此参数。

mimeType | MIME 类型
ds | 数据的 DataSource
return | 表示所有命令的 CommandInfo 对象
since | JAF 1.1
英文文档：

getAllCommands

public CommandInfo[] getAllCommands(String mimeType,
                                    DataSource ds)
Get all the available commands for this type. This method should return all the possible commands for this MIME type.

The DataSource provides extra information, such as the file name, that a CommandMap implementation may use to further refine the list of commands that are returned. The implementation in this class simply calls the getAllCommands method that ignores this argument.

Parameters:
mimeType - the MIME type
ds - a DataSource for the data
Returns:
the CommandInfo objects representing all the commands.
Since:
JAF 1.1

abstract public CommandInfo getCommand(String mimeType, String cmdName)
获取与 MIME 类型对应的默认命令。
mimeType | MIME 类型
cmdName | 命令名
return | 与命令对应的 CommandInfo
英文文档：

getCommand

public abstract CommandInfo getCommand(String mimeType,
                                       String cmdName)
Get the default command corresponding to the MIME type.

Parameters:
mimeType - the MIME type
cmdName - the command name
Returns:
the CommandInfo corresponding to the command.

public CommandInfo getCommand(String mimeType, String cmdName, DataSource ds)
获取与 MIME 类型对应的默认命令。

DataSource 提供额外信息，比如文件名，CommandMap 实现可以使用它进一步改进选择的命令。此类中的实现调用 getCommand 方法，忽略此参数。

mimeType | MIME 类型
cmdName | 命令名
ds | 数据的 DataSource
return | 与命令对应的 CommandInfo
since | JAF 1.1
英文文档：

getCommand

public CommandInfo getCommand(String mimeType,
                              String cmdName,
                              DataSource ds)
Get the default command corresponding to the MIME type.

The DataSource provides extra information, such as the file name, that a CommandMap implementation may use to further refine the command that is chosen. The implementation in this class simply calls the getCommand method that ignores this argument.

Parameters:
mimeType - the MIME type
cmdName - the command name
ds - a DataSource for the data
Returns:
the CommandInfo corresponding to the command.
Since:
JAF 1.1

abstract public DataContentHandler createDataContentHandler(String mimeType)
查找与 MIME 类型对应的 DataContentHandler。确定它的机制和语义由特定 CommandMap 的实现确定。
mimeType | MIME 类型
return | MIME 类型的 DataContentHandler
英文文档：

createDataContentHandler

public abstract DataContentHandler createDataContentHandler(String mimeType)
Locate a DataContentHandler that corresponds to the MIME type. The mechanism and semantics for determining this are determined by the implementation of the particular CommandMap.

Parameters:
mimeType - the MIME type
Returns:
the DataContentHandler for the MIME type

public DataContentHandler createDataContentHandler(String mimeType, DataSource ds)
查找与 MIME 类型对应的 DataContentHandler。确定它的机制和语义由特定 CommandMap 的实现确定。

DataSource 提供额外信息，比如文件名称，CommandMap 实现可以使用它进一步改进 DataContentHandler 的选择。此类中的实现调用 createDataContentHandler 方法，忽略此参数。

mimeType | MIME 类型
ds | 数据的 DataSource
return | MIME 类型的 DataContentHandler
since | JAF 1.1
英文文档：

createDataContentHandler

public DataContentHandler createDataContentHandler(String mimeType,
                                                   DataSource ds)
Locate a DataContentHandler that corresponds to the MIME type. The mechanism and semantics for determining this are determined by the implementation of the particular CommandMap.

The DataSource provides extra information, such as the file name, that a CommandMap implementation may use to further refine the choice of DataContentHandler. The implementation in this class simply calls the createDataContentHandler method that ignores this argument.

Parameters:
mimeType - the MIME type
ds - a DataSource for the data
Returns:
the DataContentHandler for the MIME type
Since:
JAF 1.1

public String[] getMimeTypes()
获取此命令映射已知的所有 MIME 类型。如果命令映射不支持此操作，则返回 null。
return | 以字符串形式返回 MIME 类型数组；如果不支持，则返回 null
since | JAF 1.1
英文文档：

getMimeTypes

public String[] getMimeTypes()
Get all the MIME types known to this command map. If the command map doesn't support this operation, null is returned.

Returns:
array of MIME types as strings, or null if not supported
Since:
JAF 1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataHandler (Java EE 5)

javax.activation
Class DataHandler

java.lang.Object
    extended by  javax.activation.DataHandler
All Implemented Interfaces:
Transferable
public class DataHandler
extends Object
implements Transferable

Implements: java.awt.datatransfer.Transferable

DataHandler 类为在多种不同源和格式下可用的数据提供一致的接口。它使用 DataContentHandler 管理简单流到字符串的转换以及相关操作。它提供对能够操作数据的命令的访问。使用 CommandMap 可以找到这些命令。

DataHandler 和 Transferable 接口

DataHandler 实现 Transferable 接口，以便数据能够用于 AWT 数据传输操作，比如，剪切、粘贴和拖放操作。Transferable 接口的实现依赖于已安装的 DataContentHandler 对象的可用性，该 DataContentHandler 对象与 DataHandler 的特定实例中所表示的数据的 MIME 类型相对应。

DataHandler 和 CommandMap

DataHandler 跟踪当前 CommandMap，它用于命令（getCommand、getAllCommands、getPreferredCommands）的服务请求。使用 setCommandMap 方法，DataHandler 的每个实例都可以有一个与其相关的 CommandMap。如果没有设置 CommandMap，则 DataHandler 调用 CommandMap 中的 getDefaultCommandMap 方法，并使用其返回值。有关更多信息，请参见 CommandMap。

DataHandler 和 URL

当用 URL 构造 DataHandler 时，当前 DataHandler 实现创建一个 URLDataSource 的私有实例。

See also javax.activation.CommandMap, javax.activation.DataContentHandler, javax.activation.DataSource, javax.activation.URLDataSource
英文文档：

The DataHandler class provides a consistent interface to data available in many different sources and formats. It manages simple stream to string conversions and related operations using DataContentHandlers. It provides access to commands that can operate on the data. The commands are found using a CommandMap.

DataHandler and the Transferable Interface

DataHandler implements the Transferable interface so that data can be used in AWT data transfer operations, such as cut and paste and drag and drop. The implementation of the Transferable interface relies on the availability of an installed DataContentHandler object corresponding to the MIME type of the data represented in the specific instance of the DataHandler.

DataHandler and CommandMaps

The DataHandler keeps track of the current CommandMap that it uses to service requests for commands (getCommand, getAllCommands, getPreferredCommands). Each instance of a DataHandler may have a CommandMap associated with it using the setCommandMap method. If a CommandMap was not set, DataHandler calls the getDefaultCommandMap method in CommandMap and uses the value it returns. See CommandMap for more information.

DataHandler and URLs

The current DataHandler implementation creates a private instance of URLDataSource when it is constructed with a URL.

See Also:
CommandMap, DataContentHandler, DataSource, URLDataSource

Constructor Summary
DataHandler(DataSource ds)
Create a DataHandler instance referencing the specified DataSource.
DataHandler(Object obj, String mimeType)
Create a DataHandler instance representing an object of this MIME type.
DataHandler(URL url)
Create a DataHandler instance referencing a URL.
Method Summary
CommandInfo[] | getAllCommands() Return all the commands for this type of data.
Object | getBean(CommandInfo cmdinfo) A convenience method that takes a CommandInfo object and instantiates the corresponding command, usually a JavaBean component.
CommandInfo | getCommand(String cmdName) Get the command cmdName.
Object | getContent() Return the data in its preferred Object form.
String | getContentType() Return the MIME type of this object as retrieved from the source object.
DataSource | getDataSource() Return the DataSource associated with this instance of DataHandler.
InputStream | getInputStream() Get the InputStream for this object.
String | getName() Return the name of the data object.
OutputStream | getOutputStream() Get an OutputStream for this DataHandler to allow overwriting the underlying data.
CommandInfo[] | getPreferredCommands() Return the preferred commands for this type of data.
Object | getTransferData(DataFlavor flavor) Returns an object that represents the data to be transferred.
DataFlavor[] | getTransferDataFlavors() Return the DataFlavors in which this data is available.
boolean | isDataFlavorSupported(DataFlavor flavor) Returns whether the specified data flavor is supported for this object.
void | setCommandMap(CommandMap commandMap) Set the CommandMap for use by this DataHandler.
static void | setDataContentHandlerFactory(DataContentHandlerFactory newFactory) Sets the DataContentHandlerFactory.
void | writeTo(OutputStream os) Write the data to an OutputStream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public DataHandler(DataSource ds)
创建引用指定 DataSource 的 DataHandler 实例。数据以字节流的形式存在。DataSource 将提供一个 InputStream 来访问数据。
ds DataSource
英文文档：

DataHandler

public DataHandler(DataSource ds)
Create a DataHandler instance referencing the specified DataSource. The data exists in a byte stream form. The DataSource will provide an InputStream to access the data.

Parameters:
ds - the DataSource

public DataHandler(Object obj, String mimeType)
创建表示此 MIME 类型对象的 DataHandler 实例。当应用程序已经有 Java Object 形式的数据内存表示形式 (in-memory representation) 时，使用此构造方法。
obj | Java Object
mimeType | 对象的 MIME 类型
英文文档：

DataHandler

public DataHandler(Object obj,
                   String mimeType)
Create a DataHandler instance representing an object of this MIME type. This constructor is used when the application already has an in-memory representation of the data in the form of a Java Object.

Parameters:
obj - the Java Object
mimeType - the MIME type of the object

public DataHandler(java.net.URL url)
创建引用 URL 的 DataHandler 实例。DataHandler 在内部创建一个 URLDataSource 实例来表示 URL。
url URL 对象
英文文档：

DataHandler

public DataHandler(URL url)
Create a DataHandler instance referencing a URL. The DataHandler internally creates a URLDataSource instance to represent the URL.

Parameters:
url - a URL object
Method Detail

public DataSource getDataSource()
返回与此 DataHandler 实例关联的 DataSource。

对于已经用 DataSource 实例化的 DataHandler，此方法返回用来创建该 DataHandler 对象的 DataSource。在其他情况下，DataHandler 根据用来构造 DataHandler 的数据构造 DataSource。对于没有用 DataSource 实例化的 DataHandler，为其创建的 DataSource 将被缓存，以提高性能。

return 对此 DataHandler 有效的 DataSource 对象
英文文档：

getDataSource

public DataSource getDataSource()
Return the DataSource associated with this instance of DataHandler.

For DataHandlers that have been instantiated with a DataSource, this method returns the DataSource that was used to create the DataHandler object. In other cases the DataHandler constructs a DataSource from the data used to construct the DataHandler. DataSources created for DataHandlers not instantiated with a DataSource are cached for performance reasons.

Returns:
a valid DataSource object for this DataHandler

public String getName()
返回数据对象的名称。如果此 DataHandler 是用 DataSource 创建的，则此方法直接调用 DataSource.getName 方法；否则返回 null。
return 对象的名称
英文文档：

getName

public String getName()
Return the name of the data object. If this DataHandler was created with a DataSource, this method calls through to the DataSource.getName method, otherwise it returns null.

Returns:
the name of the object

public String getContentType()
返回从源对象中获取的此对象的 MIME 类型。注意，这是带有参数的完整 类型。
return MIME 类型
英文文档：

getContentType

public String getContentType()
Return the MIME type of this object as retrieved from the source object. Note that this is the full type with parameters.

Returns:
the MIME type

public java.io.InputStream getInputStream() throws java.io.IOException
获取此对象的 InputSteam。

对于用 DataSource 实例化的 DataHandler，该 DataHandler 调用 DataSource.getInputStream 方法，并将结果返回给调用者。

对于用 Object 实例化的 DataHandler，该 DataHandler 首先尝试找到 Object 的 DataContentHandler。如果 DataHandler 找不到此 MIME 类型的 DataContentHandler，则抛出 UnsupportedDataTypeException。如果能够找到，则它将创建一个管道和一个线程。该线程使用 DataContentHandler 的 writeTo 方法将流数据写入管道的一端。管道的另一端返回给调用者。由于为复制数据创建了一个线程，所以在复制过程中发生的 IOException 不能传送回调用者。结果将是一个空流。

return | 表示此数据的 InputStream
Throws | java.io.IOException: 如果发生 I/O * 错误
See also | writeTo, javax.activation.UnsupportedDataTypeException
英文文档：

getInputStream

public InputStream getInputStream()
                           throws IOException
Get the InputStream for this object.

For DataHandlers instantiated with a DataSource, the DataHandler calls the DataSource.getInputStream method and returns the result to the caller.

For DataHandlers instantiated with an Object, the DataHandler first attempts to find a DataContentHandler for the Object. If the DataHandler can not find a DataContentHandler for this MIME type, it throws an UnsupportedDataTypeException. If it is successful, it creates a pipe and a thread. The thread uses the DataContentHandler's writeTo method to write the stream data into one end of the pipe. The other end of the pipe is returned to the caller. Because a thread is created to copy the data, IOExceptions that may occur during the copy can not be propagated back to the caller. The result is an empty stream.

Returns:
the InputStream representing this data
Throws:
IOException - if an I/O error occurs
See Also:
DataContentHandler.writeTo(java.lang.Object, java.lang.String, java.io.OutputStream), UnsupportedDataTypeException

public void writeTo(java.io.OutputStream os) throws java.io.IOException
将数据写入 OutputStream。

如果 DataHandler 是用 DataSource 创建的，那么 writeTo 获取 InputStream 并将字节从 Inputstream 复制到传入的 Outputstream。

如果 DataHandler 是用 Object 创建的，则 writeTo 获取对象类型的 DataContentHandler。如果找到了 DataContentHandler，则它对 DataContentHandler 调用 writeTo 方法。

os | 要写入的 OutputStream
Throws | java.io.IOException: 如果发生 I/O * 错误
英文文档：

writeTo

public void writeTo(OutputStream os)
             throws IOException
Write the data to an OutputStream.

If the DataHandler was created with a DataSource, writeTo retrieves the InputStream and copies the bytes from the InputStream to the OutputStream passed in.

If the DataHandler was created with an object, writeTo retrieves the DataContentHandler for the object's type. If the DataContentHandler was found, it calls the writeTo method on the DataContentHandler.

Parameters:
os - the OutputStream to write to
Throws:
IOException - if an I/O error occurs

public java.io.OutputStream getOutputStream() throws java.io.IOException
获取此 DataHandler 的 OutputStream，以允许重写底层数据。如果 DataHandler 是用 DataSource 创建的，则调用 DataSource 的 getOutputStream 方法。否则，返回 null。
return | OutputStream
See also | getOutputStream, javax.activation.URLDataSource
英文文档：

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Get an OutputStream for this DataHandler to allow overwriting the underlying data. If the DataHandler was created with a DataSource, the DataSource's getOutputStream method is called. Otherwise, null is returned.

Returns:
the OutputStream
Throws:
IOException
See Also:
DataSource.getOutputStream(), URLDataSource

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
返回此数据在其中可用的 DataFlavor。

返回能够提供数据的 flavor 的 DataFlavor 对象所组成的数组。该数组通常根据提供数据的首选项来排序（从描述最多的到描述最少的）。

DataHandler 尝试查找与数据的 MIME 类型对应的 DataContentHandler。如果找到，则该 DataHandler 调用 DataContentHandler 的 getTransferDataFlavors 方法。

如果不 能找到 DataContentHandler，并且 DataHandler 是用 DataSource （或 URL）创建的，则返回一个表示此对象 MIME 类型和 java.io.InputStream 类的 DataFlavor。如果 DataHandler 是用对象和 MIME 类型创建的，则 getTransferDataFlavors 返回一个表示此对象 MIME 类型和对象类的 DataFlavor。

return | 数据 flavor 的数组，使用它来传输此数据
See also | getTransferDataFlavors
英文文档：

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Return the DataFlavors in which this data is available.

Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array is usually ordered according to preference for providing the data, from most richly descriptive to least richly descriptive.

The DataHandler attempts to find a DataContentHandler that corresponds to the MIME type of the data. If one is located, the DataHandler calls the DataContentHandler's getTransferDataFlavors method.

If a DataContentHandler can not be located, and if the DataHandler was created with a DataSource (or URL), one DataFlavor is returned that represents this object's MIME type and the java.io.InputStream class. If the DataHandler was created with an object and a MIME type, getTransferDataFlavors returns one DataFlavor that represents this object's MIME type and the object's class.

Specified by:
getTransferDataFlavors in interface Transferable
Returns:
an array of data flavors in which this data can be transferred
See Also:
DataContentHandler.getTransferDataFlavors()

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
返回此对象是否支持指定的数据 flavor。

此方法迭代 getTransferDataFlavors 返回的 DataFlavor，将每个 DataFlavor 与指定 flavor 进行比较。

flavor | 数据所请求的 flavor
return | 如果支持该数据 flavor，则返回 true
See also | getTransferDataFlavors
英文文档：

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Returns whether the specified data flavor is supported for this object.

This method iterates through the DataFlavors returned from getTransferDataFlavors, comparing each with the specified flavor.

Specified by:
isDataFlavorSupported in interface Transferable
Parameters:
flavor - the requested flavor for the data
Returns:
true if the data flavor is supported
See Also:
getTransferDataFlavors()

public Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
返回一个对象，该对象表示要传输的数据。返回对象的类是由该数据 flavor 的表示形式类定义的。

对于用 DataSource 或 URL 创建的 DataHandler：

DataHandler 尝试为此 MIME 类型查找一个 DataContentHandler。如果找到，则将传入的 DataFlavor 和数据的类型传递给其 getTransferData 方法。如果 DataHandler 没有找到 DataContentHandler，并且 flavor 指定了此对象的 MIME 类型和 java.io.InputStream 类，则返回此对象的 InputStream。否则，抛出 UnsupportedFlavorException。

对于用 Object 创建的 DataHandler：

DataHandler 尝试为此 MIME 类型查找一个 DataContentHandler。如果找到，则将传入的 DataFlavor 和数据的类型传递给其 getTransferData 方法。如果 DataHandler 没有找到 DataContentHandler，并且 flavor 指定了此对象的 MIME 类型和它的类，则返回此 DataHandler 的引用对象。否则，抛出 UnsupportedFlavorException。

flavor | 数据所请求的 flavor
return | 对象
Throws | java.awt.datatransfer.UnsupportedFlavorException: 如果不能将该数据转换为所请求的 flavor
Throws | java.io.IOException: 如果发生 I/O * 错误
See also | javax.activation.ActivationDataFlavor
英文文档：

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
Returns an object that represents the data to be transferred. The class of the object returned is defined by the representation class of the data flavor.

For DataHandler's created with DataSources or URLs:

The DataHandler attempts to locate a DataContentHandler for this MIME type. If one is found, the passed in DataFlavor and the type of the data are passed to its getTransferData method. If the DataHandler fails to locate a DataContentHandler and the flavor specifies this object's MIME type and the java.io.InputStream class, this object's InputStream is returned. Otherwise it throws an UnsupportedFlavorException.

For DataHandler's created with Objects:

The DataHandler attempts to locate a DataContentHandler for this MIME type. If one is found, the passed in DataFlavor and the type of the data are passed to its getTransferData method. If the DataHandler fails to locate a DataContentHandler and the flavor specifies this object's MIME type and its class, this DataHandler's referenced object is returned. Otherwise it throws an UnsupportedFlavorException.

Specified by:
getTransferData in interface Transferable
Parameters:
flavor - the requested flavor for the data
Returns:
the object
Throws:
UnsupportedFlavorException - if the data could not be converted to the requested flavor
IOException - if an I/O error occurs
See Also:
ActivationDataFlavor

public void setCommandMap(CommandMap commandMap)
设置此 DataHandler 使用的 CommandMap。将其设置为 null 会使该 CommandMap 还原为 CommandMap.getDefaultCommandMap 方法所返回的 CommandMap。更改该 CommandMap 或将其设置为 null 将清除以前的 CommandMap 所缓存的所有数据。
commandMap | 此 DataHandler 中使用的 CommandMap
See also | setDefaultCommandMap
英文文档：

setCommandMap

public void setCommandMap(CommandMap commandMap)
Set the CommandMap for use by this DataHandler. Setting it to null causes the CommandMap to revert to the CommandMap returned by the CommandMap.getDefaultCommandMap method. Changing the CommandMap, or setting it to null, clears out any data cached from the previous CommandMap.

Parameters:
commandMap - the CommandMap to use in this DataHandler
See Also:
CommandMap.setDefaultCommandMap(javax.activation.CommandMap)

public CommandInfo[] getPreferredCommands()
返回此数据类型的首选 命令。此方法调用 CommandMap 中与此 DataHandler 实例关联的 getPreferredCommands 方法。此方法返回一个表示可用命令子集的数组。如果存在由此 DataHandler 表示的 MIME 类型的多个命令，则已安装的 CommandMap 将选择适当的命令。
return | 表示首选命令的 CommandInfo 对象
See also | getPreferredCommands
英文文档：

getPreferredCommands

public CommandInfo[] getPreferredCommands()
Return the preferred commands for this type of data. This method calls the getPreferredCommands method in the CommandMap associated with this instance of DataHandler. This method returns an array that represents a subset of available commands. In cases where multiple commands for the MIME type represented by this DataHandler are present, the installed CommandMap chooses the appropriate commands.

Returns:
the CommandInfo objects representing the preferred commands
See Also:
CommandMap.getPreferredCommands(java.lang.String)

public CommandInfo[] getAllCommands()
返回此数据类型的所有命令。此方法返回一个数组，此数组包含此 DataHandler 所表示的数据类型的所有命令。此 DataHandler 所表示的底层数据的 MIME 类型用于调用与此 DataHandler 关联的 CommandMap 的 getAllCommands 方法。
return | 表示所有命令的 CommandInfo 对象
See also | getAllCommands
英文文档：

getAllCommands

public CommandInfo[] getAllCommands()
Return all the commands for this type of data. This method returns an array containing all commands for the type of data represented by this DataHandler. The MIME type for the underlying data represented by this DataHandler is used to call through to the getAllCommands method of the CommandMap associated with this DataHandler.

Returns:
the CommandInfo objects representing all the commands
See Also:
CommandMap.getAllCommands(java.lang.String)

public CommandInfo getCommand(String cmdName)
获取命令 cmdName。使用此 DataHandler 中已安装的 CommandMap 所定义的搜索语义。此 DataHandler 所表示的底层数据的 MIME 类型用于调用与此 DataHandler 关联的 CommandMap 的 getCommand 方法。
cmdName | 命令名
return | 与命令对应的 CommandInfo
See also | getCommand
英文文档：

getCommand

public CommandInfo getCommand(String cmdName)
Get the command cmdName. Use the search semantics as defined by the CommandMap installed in this DataHandler. The MIME type for the underlying data represented by this DataHandler is used to call through to the getCommand method of the CommandMap associated with this DataHandler.

Parameters:
cmdName - the command name
Returns:
the CommandInfo corresponding to the command
See Also:
CommandMap.getCommand(java.lang.String, java.lang.String)

public Object getContent() throws java.io.IOException
以其首选 Object 的形式返回数据。

如果 DataHandler 是用一个对象实例化的，则返回该对象。

如果 DataHandler 是用 DataSource 实例化的，则此方法使用 DataContentHandler 返回此 DataHandler 所表示数据的内容对象。如果找不到此数据类型的 DataContentHandler，则 DataHandler 返回数据的 InputStream。

return | 内容。
Throws | java.io.IOException: 如果此操作中发生 IOException。
英文文档：

getContent

public Object getContent()
                  throws IOException
Return the data in its preferred Object form.

If the DataHandler was instantiated with an object, return the object.

If the DataHandler was instantiated with a DataSource, this method uses a DataContentHandler to return the content object for the data represented by this DataHandler. If no DataContentHandler can be found for the the type of this data, the DataHandler returns an InputStream for the data.

Returns:
the content.
Throws:
IOException - if an IOException occurs during this operation.

public Object getBean(CommandInfo cmdinfo)
一个便捷方法，它接受 CommandInfo 对象并且实例化相应的命令，通常是 JavaBean 组件。

此方法调用 CommandInfo 的 getCommandObject 方法，带有用于加载 javax.activation.DataHandler 类本身的 ClassLoader。

cmdinfo | 与命令对应的 CommandInfo
return | 已实例化的命令对象
英文文档：

getBean

public Object getBean(CommandInfo cmdinfo)
A convenience method that takes a CommandInfo object and instantiates the corresponding command, usually a JavaBean component.

This method calls the CommandInfo's getCommandObject method with the ClassLoader used to load the javax.activation.DataHandler class itself.

Parameters:
cmdinfo - the CommandInfo corresponding to a command
Returns:
the instantiated command object

public static void setDataContentHandlerFactory(DataContentHandlerFactory newFactory)
设置 DataContentHandlerFactory。首先调用 DataContentHandlerFactory 来查找 DataContentHandler。DataContentHandlerFactory 只能被设置一次。

如果 DataContentHandlerFactory 已经被设置，则此方法抛出 Error。

newFactory | DataContentHandlerFactory
Throws | Error: 如果已经定义该工厂。
See also | javax.activation.DataContentHandlerFactory
英文文档：

setDataContentHandlerFactory

public static void setDataContentHandlerFactory(DataContentHandlerFactory newFactory)
Sets the DataContentHandlerFactory. The DataContentHandlerFactory is called first to find DataContentHandlers. The DataContentHandlerFactory can only be set once.

If the DataContentHandlerFactory has already been set, this method throws an Error.

Parameters:
newFactory - the DataContentHandlerFactory
Throws:
Error - if the factory has already been defined.
See Also:
DataContentHandlerFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileDataSource (Java EE 5)

javax.activation
Class FileDataSource

java.lang.Object
    extended by  javax.activation.FileDataSource
All Implemented Interfaces:
DataSource
public class FileDataSource
extends Object
implements DataSource

Implements: DataSource

FileDataSource 类实现一个封装文件的简单 DataSource 对象。它通过 FileTypeMap 对象提供数据分类服务。

FileDataSource 分类语义

FileDataSource 类将文件的数据分类委托给一个从 FileTypeMap 类子类化的对象。setFileTypeMap 方法可用于为 FileDataSource 实例显示地设置 FileTypeMap。如果没有设置任何 FileTypeMap，则 FileDataSource 将调用 FileTypeMap 的 getDefaultFileTypeMap 方法获取系统的默认 FileTypeMap。

See also javax.activation.DataSource, javax.activation.FileTypeMap, javax.activation.MimetypesFileTypeMap
英文文档：

The FileDataSource class implements a simple DataSource object that encapsulates a file. It provides data typing services via a FileTypeMap object.

FileDataSource Typing Semantics

The FileDataSource class delegates data typing of files to an object subclassed from the FileTypeMap class. The setFileTypeMap method can be used to explicitly set the FileTypeMap for an instance of FileDataSource. If no FileTypeMap is set, the FileDataSource will call the FileTypeMap's getDefaultFileTypeMap method to get the System's default FileTypeMap.

See Also:
DataSource, FileTypeMap, MimetypesFileTypeMap

Constructor Summary
FileDataSource(File file)
Creates a FileDataSource from a File object.
FileDataSource(String name)
Creates a FileDataSource from the specified path name.
Method Summary
String | getContentType() This method returns the MIME type of the data in the form of a string.
File | getFile() Return the File object that corresponds to this FileDataSource.
InputStream | getInputStream() This method will return an InputStream representing the the data and will throw an IOException if it can not do so.
String | getName() Return the name of this object.
OutputStream | getOutputStream() This method will return an OutputStream representing the the data and will throw an IOException if it can not do so.
void | setFileTypeMap(FileTypeMap map) Set the FileTypeMap to use with this FileDataSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FileDataSource(java.io.File file)
根据 File 对象创建 FileDataSource。注：在调用要求文件打开的方法之前，文件实际上不会打开。
file 文件
英文文档：

FileDataSource

public FileDataSource(File file)
Creates a FileDataSource from a File object. Note: The file will not actually be opened until a method is called that requires the file to be opened.

Parameters:
file - the file

public FileDataSource(String name)
根据指定的路径名创建 FileDataSource。注：在调用要求文件打开的方法之前，文件实际上不会打开。
name 取决于系统的文件名。
英文文档：

FileDataSource

public FileDataSource(String name)
Creates a FileDataSource from the specified path name. Note: The file will not actually be opened until a method is called that requires the file to be opened.

Parameters:
name - the system-dependent file name.
Method Detail

public java.io.InputStream getInputStream() throws java.io.IOException
此方法将返回一个表示数据的 InputStream；如果不能返回，则抛出 IOException。每次调用此方法都会返回一个新的 InputStream 实例。
return InputStream
英文文档：

getInputStream

public InputStream getInputStream()
                           throws IOException
This method will return an InputStream representing the the data and will throw an IOException if it can not do so. This method will return a new instance of InputStream with each invocation.

Specified by:
getInputStream in interface DataSource
Returns:
an InputStream
Throws:
IOException

public java.io.OutputStream getOutputStream() throws java.io.IOException
此方法将返回一个表示数据的 OutputStream；如果不能返回，则抛出 IOException。每次调用此方法都会返回一个新的 OutputStream 实例。
return OutputStream
英文文档：

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
This method will return an OutputStream representing the the data and will throw an IOException if it can not do so. This method will return a new instance of OutputStream with each invocation.

Specified by:
getOutputStream in interface DataSource
Returns:
an OutputStream
Throws:
IOException

public String getContentType()
此方法以字符串形式返回数据的 MIME 类型。此方法使用当前安装的 FileTypeMap。如果没有显示地设置任何 FileTypeMap，FileDataSource 将对 FileTypeMap 调用 getDefaultFileTypeMap 方法获取默认的 FileTypeMap。注：默认情况下，使用的 FileTypeMap 是 MimetypesFileTypeMap。
return | MIME 类型
See also | getDefaultFileTypeMap
英文文档：

getContentType

public String getContentType()
This method returns the MIME type of the data in the form of a string. This method uses the currently installed FileTypeMap. If there is no FileTypeMap explictly set, the FileDataSource will call the getDefaultFileTypeMap method on FileTypeMap to acquire a default FileTypeMap. Note: By default, the FileTypeMap used will be a MimetypesFileTypeMap.

Specified by:
getContentType in interface DataSource
Returns:
the MIME Type
See Also:
FileTypeMap.getDefaultFileTypeMap()

public String getName()
返回此对象的名称。FileDataSource 将返回对象的文件名。
return | 对象的名称。
See also | javax.activation.DataSource
英文文档：

getName

public String getName()
Return the name of this object. The FileDataSource will return the file name of the object.

Specified by:
getName in interface DataSource
Returns:
the name of the object.
See Also:
DataSource

public java.io.File getFile()
返回与此 FileDataSource 对应的 File 对象。
return 此对象表示的文件的 File 对象。
英文文档：

getFile

public File getFile()
Return the File object that corresponds to this FileDataSource.

Returns:
the File object for the file represented by this object.

public void setFileTypeMap(FileTypeMap map)
设置用于此 FileDataSource 的 FileTypeMap。
map 此对象的 FileTypeMap。
英文文档：

setFileTypeMap

public void setFileTypeMap(FileTypeMap map)
Set the FileTypeMap to use with this FileDataSource

Parameters:
map - The FileTypeMap for this object.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FileTypeMap (Java EE 5)

javax.activation
Class FileTypeMap

java.lang.Object
    extended by  javax.activation.FileTypeMap
Direct Known Subclasses:
MimetypesFileTypeMap
public abstract class FileTypeMap
extends Object

Extended by: MimetypesFileTypeMap

FileTypeMap 是一个抽象类，它为文件提供数据分类接口。此类的实现将实现 getContentType 方法，该方法将从文件名或 File 对象得到内容类型。FileTypeMap 可以使用任一方案来确定数据类型，从检查文件的文件扩展名（如 MimetypesFileTypeMap）到打开文件并尝试从文件内容得到其类型。FileDataSource 类使用默认的 FileTypeMap（若无更改，则是 MimetypesFileTypeMap）来确定文件的内容类型。
See also javax.activation.FileTypeMap, javax.activation.FileDataSource, javax.activation.MimetypesFileTypeMap
英文文档：

The FileTypeMap is an abstract class that provides a data typing interface for files. Implementations of this class will implement the getContentType methods which will derive a content type from a file name or a File object. FileTypeMaps could use any scheme to determine the data type, from examining the file extension of a file (like the MimetypesFileTypeMap) to opening the file and trying to derive its type from the contents of the file. The FileDataSource class uses the default FileTypeMap (a MimetypesFileTypeMap unless changed) to determine the content type of files.

See Also:
FileTypeMap, FileDataSource, MimetypesFileTypeMap

Constructor Summary
FileTypeMap()
The default constructor.
Method Summary
abstract String | getContentType(File file) Return the type of the file object.
abstract String | getContentType(String filename) Return the type of the file passed in.
static FileTypeMap | getDefaultFileTypeMap() Return the default FileTypeMap for the system.
static void | setDefaultFileTypeMap(FileTypeMap map) Sets the default FileTypeMap for the system.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FileTypeMap()
默认的构造方法。
英文文档：

FileTypeMap

public FileTypeMap()
The default constructor.

Method Detail

abstract public String getContentType(java.io.File file)
返回文件对象的类型。此方法应始终返回有效的 MIME 类型。
file | 要分类的文件。
return | 内容类型。
英文文档：

getContentType

public abstract String getContentType(File file)
Return the type of the file object. This method should always return a valid MIME type.

Parameters:
file - A file to be typed.
Returns:
The content type.

abstract public String getContentType(String filename)
返回传入文件的类型。此方法应始终返回有效的 MIME 类型。
filename | 文件的路径名。
return | 内容类型。
英文文档：

getContentType

public abstract String getContentType(String filename)
Return the type of the file passed in. This method should always return a valid MIME type.

Parameters:
filename - the pathname of the file.
Returns:
The content type.

public static void setDefaultFileTypeMap(FileTypeMap map)
设置系统的默认 FileTypeMap。此实例将返回给 getDefaultFileTypeMap 的调用者。
map | FileTypeMap。
Throws | SecurityException: 如果调用者不具有更改默认的权限
英文文档：

setDefaultFileTypeMap

public static void setDefaultFileTypeMap(FileTypeMap map)
Sets the default FileTypeMap for the system. This instance will be returned to callers of getDefaultFileTypeMap.

Parameters:
map - The FileTypeMap.
Throws:
SecurityException - if the caller doesn't have permission to change the default

public static FileTypeMap getDefaultFileTypeMap()
返回系统的默认 FileTypeMap。如果调用了 setDefaultFileTypeMap，则返回该实例，否则返回 MimetypesFileTypeMap 的一个实例。
return | 默认的 FileTypeMap
See also | setDefaultFileTypeMap
英文文档：

getDefaultFileTypeMap

public static FileTypeMap getDefaultFileTypeMap()
Return the default FileTypeMap for the system. If setDefaultFileTypeMap was called, return that instance, otherwise return an instance of MimetypesFileTypeMap.

Returns:
The default FileTypeMap
See Also:
setDefaultFileTypeMap(javax.activation.FileTypeMap)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MailcapCommandMap (Java EE 5)

javax.activation
Class MailcapCommandMap

java.lang.Object
    extended by  javax.activation.CommandMap
        extended by  javax.activation.MailcapCommandMap

public class MailcapCommandMap
extends CommandMap

Extends: CommandMap

MailcapCommandMap 扩展 CommandMap 抽象类。它实现配置基于 mailcap 文件 (RFC 1524) 的 CommandMap。可以以编程方式和通过配置文件的方式来配置 MailcapCommandMap。

mailcap 文件搜索顺序：

MailcapCommandMap 在用户系统的各个位置查找 mailcap 文件条目。当发出请求以搜索 MailcapCommandMap 中的命令时，它以下面的顺序搜索 mailcap 文件：

  1. 以编程方式添加到 MailcapCommandMap 实例的条目。
  2. 用户主目录中的 .mailcap 文件。
  3. <java.home>/lib/mailcap 文件。
  4. 名为 META-INF/mailcap 的文件或资源。
  5. 名为 META-INF/mailcap.default 的文件或资源（通常只存在于 activation.jar 文件中）。

mailcap 文件格式：

mailcap 文件必须符合 mailcap 文件规范 (RFC 1524, A User Agent Configuration Mechanism For Multimedia Mail Format Information)。文件格式由与特定 MIME 类型对应的条目组成。一般情况下，当客户机本身不能对指定的 MIME 类型进行操作时，该规范为其指定使用的应用程序。MailcapCommandMap 扩展了此规范，它在 mailcap 文件中使用一个参数机制，该机制允许指定 JavaBeans(tm) 组件对应于 MIME 类型的特定命令。

解析一个 mailcap 文件时，MailcapCommandMap 识别出某些参数签名，特别是以 x-java- 开头的参数名称。MailcapCommandMap 使用此签名查找命令条目，以将其包含到注册表。用名称 name 标识一个命令时，MailcapCommandMap 读取 x-java-<name> 形式的参数名称。当 name 为 content-handler 时，MailcapCommandMap 将此参数所表示的类视为 DataContentHandler。所有其他命令的处理通常忽略其命令名。命令实现由 JavaBean(tm) 组件的一个完全限定类名指定。例如，查看某些数据的命令可以被指定为：x-java-view=com.foo.ViewBean。

当命令名是 fallback-entry 时，命令的值可以为 true 或 false。包含 x-java-fallback-entry=true 参数的 MIME 类型的条目定义了该 MIME 类型的回退 (fallback) 命令，只在找不到非回退条目的情况下才使用该命令。例如，形式为 text/*; ; x-java-fallback-entry=true; x-java-view=com.sun.TextViewer 的条目指定了用于任何文本 MIME 类型的查看命令。此查看命令只在找不到 MIME 类型的非回退查看命令的情况下使用。

支持 MailcapCommandMap 的 mailcap 文件的一般形式如下：

# 注释以 '#' 开头并延续到行的末尾。
<mime type>; ; <parameter list>
# 其中参数列表由一个或多个参数组成，
# 其中参数类似于：x-java-view=com.sun.TextViewer
# 参数列表类似于：
纯文本; ; x-java-view=com.sun.TextViewer; x-java-edit=com.sun.TextEdit
# 注意，不包含 'x-java' 参数的 mailcap 条目
# 和遵守 RFC 1524 的条目将被忽略：
image/gif; /usr/dt/bin/sdtimage %s

英文文档：

MailcapCommandMap extends the CommandMap abstract class. It implements a CommandMap whose configuration is based on mailcap files (RFC 1524). The MailcapCommandMap can be configured both programmatically and via configuration files.

Mailcap file search order:

The MailcapCommandMap looks in various places in the user's system for mailcap file entries. When requests are made to search for commands in the MailcapCommandMap, it searches mailcap files in the following order:

  1. Programatically added entries to the MailcapCommandMap instance.
  2. The file .mailcap in the user's home directory.
  3. The file <java.home>/lib/mailcap.
  4. The file or resources named META-INF/mailcap.
  5. The file or resource named META-INF/mailcap.default (usually found only in the activation.jar file).

Mailcap file format:

Mailcap files must conform to the mailcap file specification (RFC 1524, A User Agent Configuration Mechanism For Multimedia Mail Format Information). The file format consists of entries corresponding to particular MIME types. In general, the specification specifies applications for clients to use when they themselves cannot operate on the specified MIME type. The MailcapCommandMap extends this specification by using a parameter mechanism in mailcap files that allows JavaBeans(tm) components to be specified as corresponding to particular commands for a MIME type.

When a mailcap file is parsed, the MailcapCommandMap recognizes certain parameter signatures, specifically those parameter names that begin with x-java-. The MailcapCommandMap uses this signature to find command entries for inclusion into its registries. Parameter names with the form x-java-<name> are read by the MailcapCommandMap as identifying a command with the name name. When the name is content-handler the MailcapCommandMap recognizes the class signified by this parameter as a DataContentHandler. All other commands are handled generically regardless of command name. The command implementation is specified by a fully qualified class name of a JavaBean(tm) component. For example; a command for viewing some data can be specified as: x-java-view=com.foo.ViewBean.

When the command name is fallback-entry, the value of the command may be true or false. An entry for a MIME type that includes a parameter of x-java-fallback-entry=true defines fallback commands for that MIME type that will only be used if no non-fallback entry can be found. For example, an entry of the form text/*; ; x-java-fallback-entry=true; x-java-view=com.sun.TextViewer specifies a view command to be used for any text MIME type. This view command would only be used if a non-fallback view command for the MIME type could not be found.

MailcapCommandMap aware mailcap files have the following general form:

# Comments begin with a '#' and continue to the end of the line.
<mime type>; ; <parameter list>
# Where a parameter list consists of one or more parameters,
# where parameters look like: x-java-view=com.sun.TextViewer
# and a parameter list looks like:
text/plain; ; x-java-view=com.sun.TextViewer; x-java-edit=com.sun.TextEdit
# Note that mailcap entries that do not contain 'x-java' parameters
# and comply to RFC 1524 are simply ignored:
image/gif; /usr/dt/bin/sdtimage %s

Author:
Bart Calder, Bill Shannon

Constructor Summary
MailcapCommandMap()
The default Constructor.
MailcapCommandMap(InputStream is)
Constructor that allows the caller to specify an InputStream containing a mailcap file.
MailcapCommandMap(String fileName)
Constructor that allows the caller to specify the path of a mailcap file.
Method Summary
void | addMailcap(String mail_cap) Add entries to the registry.
DataContentHandler | createDataContentHandler(String mimeType) Return the DataContentHandler for the specified MIME type.
CommandInfo[] | getAllCommands(String mimeType) Get all the available commands in all mailcap files known to this instance of MailcapCommandMap for this MIME type.
CommandInfo | getCommand(String mimeType, String cmdName) Get the command corresponding to cmdName for the MIME type.
String[] | getMimeTypes() Get all the MIME types known to this command map.
String[] | getNativeCommands(String mimeType) Get the native commands for the given MIME type.
CommandInfo[] | getPreferredCommands(String mimeType) Get the preferred command list for a MIME Type.
Methods inherited from class javax.activation.CommandMap
createDataContentHandler, getAllCommands, getCommand, getDefaultCommandMap, getPreferredCommands, setDefaultCommandMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MailcapCommandMap()
默认的构造方法。
英文文档：

MailcapCommandMap

public MailcapCommandMap()
The default Constructor.

public MailcapCommandMap(String fileName) throws java.io.IOException
允许调用者指定 mailcap 文件路径的构造方法。
fileName | 要打开的 mailcap 文件的名称
Throws | java.io.IOException: 如果不能访问该文件
英文文档：

MailcapCommandMap

public MailcapCommandMap(String fileName)
                  throws IOException
Constructor that allows the caller to specify the path of a mailcap file.

Parameters:
fileName - The name of the mailcap file to open
Throws:
IOException - if the file can't be accessed

public MailcapCommandMap(java.io.InputStream is)
允许调用者指定一个包含 mailcap 文件的 InputStream 的构造方法。
is 要打开的 mailcap 文件的 InputStream
英文文档：

MailcapCommandMap

public MailcapCommandMap(InputStream is)
Constructor that allows the caller to specify an InputStream containing a mailcap file.

Parameters:
is - InputStream of the mailcap file to open
Method Detail

public CommandInfo[] getPreferredCommands(String mimeType)
获取 MIME 类型的首选命令列表。MailcapCommandMap 以如上所述的 mailcap 文件搜索顺序 来搜索 mailcap 文件。

搜索的结果是此 MailcapCommandMap 实例已知的所有 mailmap 文件中可用命令的适当子集。特定命令的第一个条目被视为首选命令。

mimeType | MIME 类型
return | 表示首选命令的 CommandInfo 对象。
英文文档：

getPreferredCommands

public CommandInfo[] getPreferredCommands(String mimeType)
Get the preferred command list for a MIME Type. The MailcapCommandMap searches the mailcap files as described above under Mailcap file search order.

The result of the search is a proper subset of available commands in all mailcap files known to this instance of MailcapCommandMap. The first entry for a particular command is considered the preferred command.

Specified by:
getPreferredCommands in class CommandMap
Parameters:
mimeType - the MIME type
Returns:
the CommandInfo objects representing the preferred commands.

public CommandInfo[] getAllCommands(String mimeType)
针对此 MIME 类型获取此 MailcapCommandMap 实例已知的所有 mailcap 文件中的所有可用命令。
mimeType | MIME 类型
return | 表示所有命令的 CommandInfo 对象
英文文档：

getAllCommands

public CommandInfo[] getAllCommands(String mimeType)
Get all the available commands in all mailcap files known to this instance of MailcapCommandMap for this MIME type.

Specified by:
getAllCommands in class CommandMap
Parameters:
mimeType - the MIME type
Returns:
the CommandInfo objects representing all the commands.

public CommandInfo getCommand(String mimeType, String cmdName)
针对 MIME 类型获取与 cmdName 对应的命令。
mimeType | MIME 类型
cmdName | 命令名
return | 与命令对应的 CommandInfo 对象。
英文文档：

getCommand

public CommandInfo getCommand(String mimeType,
                              String cmdName)
Get the command corresponding to cmdName for the MIME type.

Specified by:
getCommand in class CommandMap
Parameters:
mimeType - the MIME type
cmdName - the command name
Returns:
the CommandInfo object corresponding to the command.

public void addMailcap(String mail_cap)
将条目添加到注册表。搜索其他条目之前，先搜索以编程方式添加的条目。

传入的字符串应该是 mailcap 格式。

mail_cap 已正确格式化的 mailcap 字符串
英文文档：

addMailcap

public void addMailcap(String mail_cap)
Add entries to the registry. Programmatically added entries are searched before other entries.

The string that is passed in should be in mailcap format.

Parameters:
mail_cap - a correctly formatted mailcap string

public DataContentHandler createDataContentHandler(String mimeType)
返回指定 MIME 类型的 DataContentHandler。
mimeType | MIME 类型
return | DataContentHandler
英文文档：

createDataContentHandler

public DataContentHandler createDataContentHandler(String mimeType)
Return the DataContentHandler for the specified MIME type.

Specified by:
createDataContentHandler in class CommandMap
Parameters:
mimeType - the MIME type
Returns:
the DataContentHandler

public String[] getMimeTypes()
获取此命令映射已知的所有 MIME 类型。
return | 字符串形式的 MIME 类型数组
since | JAF 1.1
英文文档：

getMimeTypes

public String[] getMimeTypes()
Get all the MIME types known to this command map.

Overrides:
getMimeTypes in class CommandMap
Returns:
array of MIME types as strings
Since:
JAF 1.1

public String[] getNativeCommands(String mimeType)
获取给定 MIME 类型的本地命令。返回一个字符串数组，其中每个字符串都是一个完整的 mailcap 文件条目。应用程序需要解析条目以提取实际命令以及它需要的所有属性。关于 mailcap 条目语法的详细信息，请参阅 RFC 1524。只返回为指定的 MIME 类型指定查看命令的 mailcap 条目。
return | 本地命令条目数组
since | JAF 1.1
英文文档：

getNativeCommands

public String[] getNativeCommands(String mimeType)
Get the native commands for the given MIME type. Returns an array of strings where each string is an entire mailcap file entry. The application will need to parse the entry to extract the actual command as well as any attributes it needs. See RFC 1524 for details of the mailcap entry syntax. Only mailcap entries that specify a view command for the specified MIME type are returned.

Returns:
array of native command entries
Since:
JAF 1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeType (Java EE 5)

javax.activation
Class MimeType

java.lang.Object
    extended by  javax.activation.MimeType
All Implemented Interfaces:
Externalizable, Serializable
public class MimeType
extends Object
implements Externalizable

Implements: java.io.Externalizable

RFC 2045 和 2046 中定义的多用途 Internet 邮件扩展（Multipurpose Internet Mail Extension，MIME）类型。
英文文档：

A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.

See Also:
Serialized Form

Constructor Summary
MimeType()
Default constructor.
MimeType(String rawdata)
Constructor that builds a MimeType from a String.
MimeType(String primary, String sub)
Constructor that builds a MimeType with the given primary and sub type but has an empty parameter list.
Method Summary
String | getBaseType() Return a String representation of this object without the parameter list.
String | getParameter(String name) Retrieve the value associated with the given name, or null if there is no current association.
MimeTypeParameterList | getParameters() Retrieve this object's parameter list.
String | getPrimaryType() Retrieve the primary type of this object.
String | getSubType() Retrieve the subtype of this object.
boolean | match(MimeType type) Determine if the primary and sub type of this object is the same as what is in the given type.
boolean | match(String rawdata) Determine if the primary and sub type of this object is the same as the content type described in rawdata.
void | readExternal(ObjectInput in) The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
void | removeParameter(String name) Remove any value associated with the given name.
void | setParameter(String name, String value) Set the value to be associated with the given name, replacing any previous association.
void | setPrimaryType(String primary) Set the primary type for this object to the given String.
void | setSubType(String sub) Set the subtype for this object to the given String.
String | toString() Return the String representation of this object.
void | writeExternal(ObjectOutput out) The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public MimeType()
默认构造方法。
英文文档：

MimeType

public MimeType()
Default constructor.

public MimeType(String rawdata) throws MimeTypeParseException
根据 String 构建 MimeType 的构造方法。
rawdata MIME 类型字符串
英文文档：

MimeType

public MimeType(String rawdata)
         throws MimeTypeParseException
Constructor that builds a MimeType from a String.

Parameters:
rawdata - the MIME type string
Throws:
MimeTypeParseException

public MimeType(String primary, String sub) throws MimeTypeParseException
用给定的基本类型和子类型构建 MimeType 的构造方法，它的参数列表为空。
primary | 基本 MIME 类型
sub | MIME 子类型
Throws | MimeTypeParseException: 如果基本类型或子类型不是有效的标记
英文文档：

MimeType

public MimeType(String primary,
                String sub)
         throws MimeTypeParseException
Constructor that builds a MimeType with the given primary and sub type but has an empty parameter list.

Parameters:
primary - the primary MIME type
sub - the MIME sub-type
Throws:
MimeTypeParseException - if the primary type or subtype is not a valid token
Method Detail

public String getPrimaryType()
获取此对象的基本类型。
return 基本 MIME 类型
英文文档：

getPrimaryType

public String getPrimaryType()
Retrieve the primary type of this object.

Returns:
the primary MIME type

public void setPrimaryType(String primary) throws MimeTypeParseException
将此对象的基本类型设置为给定的 String。
primary | 基本 MIME 类型
Throws | MimeTypeParseException: 如果基本类型不是有效的标记
英文文档：

setPrimaryType

public void setPrimaryType(String primary)
                    throws MimeTypeParseException
Set the primary type for this object to the given String.

Parameters:
primary - the primary MIME type
Throws:
MimeTypeParseException - if the primary type is not a valid token

public String getSubType()
获取此对象的子类型。
return MIME 子类型
英文文档：

getSubType

public String getSubType()
Retrieve the subtype of this object.

Returns:
the MIME subtype

public void setSubType(String sub) throws MimeTypeParseException
将此对象的子类型设置为给定的 String。
sub | MIME 子类型
Throws | MimeTypeParseException: 如果子类型不是有效的标记
英文文档：

setSubType

public void setSubType(String sub)
                throws MimeTypeParseException
Set the subtype for this object to the given String.

Parameters:
sub - the MIME subtype
Throws:
MimeTypeParseException - if the subtype is not a valid token

public MimeTypeParameterList getParameters()
获取此对象的参数列表。
return 表示参数的 MimeTypeParameterList 对象
英文文档：

getParameters

public MimeTypeParameterList getParameters()
Retrieve this object's parameter list.

Returns:
a MimeTypeParameterList object representing the parameters

public String getParameter(String name)
获取与给定名称关联的值；如果不存在当前关联，则返回 null。
name | 参数名
return | 参数的值
英文文档：

getParameter

public String getParameter(String name)
Retrieve the value associated with the given name, or null if there is no current association.

Parameters:
name - the parameter name
Returns:
the paramter's value

public void setParameter(String name, String value)
将值设置为与给定名称关联，替换以前的任何关联。
name | 参数名
value | 参数的值
英文文档：

setParameter

public void setParameter(String name,
                         String value)
Set the value to be associated with the given name, replacing any previous association.

Parameters:
name - the parameter name
value - the paramter's value

public void removeParameter(String name)
移除与给定名称关联的所有值。
name 参数名
英文文档：

removeParameter

public void removeParameter(String name)
Remove any value associated with the given name.

Parameters:
name - the parameter name

public String toString()
返回此对象的 String 表示形式。
英文文档：

toString

public String toString()
Return the String representation of this object.

Overrides:
toString in class Object

public String getBaseType()
返回此对象的 String 表示形式，不带参数列表。
return MIME 类型和子类型
英文文档：

getBaseType

public String getBaseType()
Return a String representation of this object without the parameter list.

Returns:
the MIME type and sub-type

public boolean match(MimeType type)
确定此对象的基本类型和子类型与给定类型中的类型是否相同。
type | 要与之比较的 MimeType 对象
return | 如果匹配，则返回 true
英文文档：

match

public boolean match(MimeType type)
Determine if the primary and sub type of this object is the same as what is in the given type.

Parameters:
type - the MimeType object to compare with
Returns:
true if they match

public boolean match(String rawdata) throws MimeTypeParseException
确定此对象的基本类型和子类型与 rawdata 中描述的内容类型是否相同。
rawdata | 要与之比较的 MIME 类型字符串
return | 如果匹配，则返回 true
英文文档：

match

public boolean match(String rawdata)
              throws MimeTypeParseException
Determine if the primary and sub type of this object is the same as the content type described in rawdata.

Parameters:
rawdata - the MIME type string to compare with
Returns:
true if they match
Throws:
MimeTypeParseException

public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
对象可实现 writeExternal 方法来保存其内容：对于其基本值，调用 DataOutput 的方法；对于对象、字符串和数组，调用 ObjectOutput 的 writeObject 方法。
out | 要写入的 ObjectOutput 对象
Throws | java.io.IOException: 包含可能发生的所有 I/O 异常
英文文档：

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays.

Specified by:
writeExternal in interface Externalizable
Parameters:
out - the ObjectOutput object to write to
Throws:
IOException - Includes any I/O exceptions that may occur

public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException
对象实现 readExternal 方法来恢复其内容，它通过调用 DataInput 的方法来恢复其基础类型，调用 readObject 来恢复对象、字符串和数组。readExternal 方法必须按照与 writeExternal 方法写入值时使用的相同顺序和类型来读取这些值。
in | 要从中读取的 ObjectInput 对象
Throws | ClassNotFoundException: 如果无法找到需要恢复的某个对象的类。
英文文档：

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface Externalizable
Parameters:
in - the ObjectInput object to read from
Throws:
ClassNotFoundException - If the class for an object being restored cannot be found.
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeTypeParameterList (Java EE 5)

javax.activation
Class MimeTypeParameterList

java.lang.Object
    extended by  javax.activation.MimeTypeParameterList

public class MimeTypeParameterList
extends Object

RFC 2045 和 2046 中定义的 MimeType 参数列表。必须已经去掉了对象的基本类型。
See also javax.activation.MimeType
英文文档：

A parameter list of a MimeType as defined in RFC 2045 and 2046. The Primary type of the object must already be stripped off.

See Also:
MimeType

Constructor Summary
MimeTypeParameterList()
Default constructor.
MimeTypeParameterList(String parameterList)
Constructs a new MimeTypeParameterList with the passed in data.
Method Summary
String | get(String name) Retrieve the value associated with the given name, or null if there is no current association.
Enumeration | getNames() Retrieve an enumeration of all the names in this list.
boolean | isEmpty() Determine whether or not this list is empty.
protected void | parse(String parameterList) A routine for parsing the parameter list out of a String.
void | remove(String name) Remove any value associated with the given name.
void | set(String name, String value) Set the value to be associated with the given name, replacing any previous association.
int | size() Return the number of name-value pairs in this list.
String | toString() Return a string representation of this object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public MimeTypeParameterList()
默认构造方法。
英文文档：

MimeTypeParameterList

public MimeTypeParameterList()
Default constructor.

public MimeTypeParameterList(String parameterList) throws MimeTypeParseException
用传入的数据构造新的 MimeTypeParameterList。
parameterList RFC 2045、2046 兼容参数列表。
英文文档：

MimeTypeParameterList

public MimeTypeParameterList(String parameterList)
                      throws MimeTypeParseException
Constructs a new MimeTypeParameterList with the passed in data.

Parameters:
parameterList - an RFC 2045, 2046 compliant parameter list.
Throws:
MimeTypeParseException
Method Detail

protected void parse(String parameterList) throws MimeTypeParseException
将参数列表从一个 String 解析出来的例程。
parameterList RFC 2045、2046 兼容参数列表。
英文文档：

parse

protected void parse(String parameterList)
              throws MimeTypeParseException
A routine for parsing the parameter list out of a String.

Parameters:
parameterList - an RFC 2045, 2046 compliant parameter list.
Throws:
MimeTypeParseException

public int size()
返回此列表中名称-值对的数量。
return 参数的数量
英文文档：

size

public int size()
Return the number of name-value pairs in this list.

Returns:
the number of parameters

public boolean isEmpty()
确定此列表是否为空。
return 如果没有参数，则返回 true
英文文档：

isEmpty

public boolean isEmpty()
Determine whether or not this list is empty.

Returns:
true if there are no parameters

public String get(String name)
获取与给定名称关联的值；如果不存在当前关联，则返回 null。
name | 参数名
return | 参数的值
英文文档：

get

public String get(String name)
Retrieve the value associated with the given name, or null if there is no current association.

Parameters:
name - the parameter name
Returns:
the parameter's value

public void set(String name, String value)
将值设置为与给定名称关联，替换以前的任何关联。
name | 参数名
value | 参数的值
英文文档：

set

public void set(String name,
                String value)
Set the value to be associated with the given name, replacing any previous association.

Parameters:
name - the parameter name
value - the parameter's value

public void remove(String name)
移除与给定名称关联的所有值。
name 参数名
英文文档：

remove

public void remove(String name)
Remove any value associated with the given name.

Parameters:
name - the parameter name

public java.util.Enumeration<E> getNames()
获取此列表中所有名称的枚举。
return 所有参数名的枚举
英文文档：

getNames

public Enumeration getNames()
Retrieve an enumeration of all the names in this list.

Returns:
an enumeration of all parameter names

public String toString()
返回此对象的字符串表示形式。
英文文档：

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimetypesFileTypeMap (Java EE 5)

javax.activation
Class MimetypesFileTypeMap

java.lang.Object
    extended by  javax.activation.FileTypeMap
        extended by  javax.activation.MimetypesFileTypeMap

public class MimetypesFileTypeMap
extends FileTypeMap

Extends: FileTypeMap

此类扩展 FileTypeMap 并通过其文件扩展名提供文件的数据分类。它使用 .mime.types 格式。

MIME 类型文件搜索顺序：

MimetypesFileTypeMap 在用户系统的不同位置查找 MIME 类型文件条目。当发出在 MimetypesFileTypeMap 中搜索 MIME 类型的请求时，它将按以下顺序搜索 MIME 类型文件：

  1. 以编程方式添加到 MimetypesFileTypeMap 实例的条目。
  2. 用户主目录中的 .mime.types 文件。
  3. <java.home>/lib/mime.types 文件。
  4. 名为 META-INF/mime.types 的文件或资源。
  5. 名为 META-INF/mimetypes.default 的文件或资源（通常只存在于 activation.jar 文件中）。

MIME 类型文件格式：

# 注释以 '#' 开头
# 格式是 <mime 类型> <以空格分隔文件扩展名>
# 例如：
text/plain txt text TXT
# 这将 file.txt、file.text 和 file.TXT 映射到
# mime 类型 "text/plain"

英文文档：

This class extends FileTypeMap and provides data typing of files via their file extension. It uses the .mime.types format.

MIME types file search order:

The MimetypesFileTypeMap looks in various places in the user's system for MIME types file entries. When requests are made to search for MIME types in the MimetypesFileTypeMap, it searches MIME types files in the following order:

  1. Programmatically added entries to the MimetypesFileTypeMap instance.
  2. The file .mime.types in the user's home directory.
  3. The file <java.home>/lib/mime.types.
  4. The file or resources named META-INF/mime.types.
  5. The file or resource named META-INF/mimetypes.default (usually found only in the activation.jar file).

MIME types file format:

# comments begin with a '#'
# the format is <mime type> <space separated file extensions>
# for example:
text/plain txt text TXT
# this would map file.txt, file.text, and file.TXT to
# the mime type "text/plain"

Author:
Bart Calder, Bill Shannon

Constructor Summary
MimetypesFileTypeMap()
The default constructor.
MimetypesFileTypeMap(InputStream is)
Construct a MimetypesFileTypeMap with programmatic entries added from the InputStream.
MimetypesFileTypeMap(String mimeTypeFileName)
Construct a MimetypesFileTypeMap with programmatic entries added from the named file.
Method Summary
void | addMimeTypes(String mime_types) Prepend the MIME type values to the registry.
String | getContentType(File f) Return the MIME type of the file object.
String | getContentType(String filename) Return the MIME type based on the specified file name.
Methods inherited from class javax.activation.FileTypeMap
getDefaultFileTypeMap, setDefaultFileTypeMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MimetypesFileTypeMap()
默认的构造方法。
英文文档：

MimetypesFileTypeMap

public MimetypesFileTypeMap()
The default constructor.

public MimetypesFileTypeMap(String mimeTypeFileName) throws java.io.IOException
用从指定文件中添加的编程条目构造 MimetypesFileTypeMap。
mimeTypeFileName 文件名
英文文档：

MimetypesFileTypeMap

public MimetypesFileTypeMap(String mimeTypeFileName)
                     throws IOException
Construct a MimetypesFileTypeMap with programmatic entries added from the named file.

Parameters:
mimeTypeFileName - the file name
Throws:
IOException

public MimetypesFileTypeMap(java.io.InputStream is)
用从 InputStream 中添加的编程条目构造 MimetypesFileTypeMap。
is 要从中读取的输入流
英文文档：

MimetypesFileTypeMap

public MimetypesFileTypeMap(InputStream is)
Construct a MimetypesFileTypeMap with programmatic entries added from the InputStream.

Parameters:
is - the input stream to read from
Method Detail

public void addMimeTypes(String mime_types)
将 MIME 类型值预先添加到注册表。
mime_types 条目的 .mime. 类型格式化字符串。
英文文档：

addMimeTypes

public void addMimeTypes(String mime_types)
Prepend the MIME type values to the registry.

Parameters:
mime_types - A .mime.types formatted string of entries.

public String getContentType(java.io.File f)
返回该文件对象的 MIME 类型。此类中的实现调用 getContentType(f.getName())。
f | 文件
return | 文件的 MIME 类型
英文文档：

getContentType

public String getContentType(File f)
Return the MIME type of the file object. The implementation in this class calls getContentType(f.getName()).

Specified by:
getContentType in class FileTypeMap
Parameters:
f - the file
Returns:
the file's MIME type

public String getContentType(String filename)
返回基于指定文件名的 MIME 类型。以如上所述的 MIME 类型文件搜索顺序 来搜索 MIME 类型条目。如果找不到任何条目，则返回 "application/octet-stream" 类型。
filename | 文件名
return | 文件的 MIME 类型
英文文档：

getContentType

public String getContentType(String filename)
Return the MIME type based on the specified file name. The MIME type entries are searched as described above under MIME types file search order. If no entry is found, the type "application/octet-stream" is returned.

Specified by:
getContentType in class FileTypeMap
Parameters:
filename - the file name
Returns:
the file's MIME type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


URLDataSource (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.activation
Class URLDataSource

java.lang.Object
    extended by  javax.activation.URLDataSource
All Implemented Interfaces:
DataSource
public class URLDataSource
extends Object
implements DataSource

Implements: DataSource

URLDataSource 类提供一个对象，此对象将 URL 对象包装在 DataSource 接口中。URLDataSource 简化了 JavaBeans Activation Framework 中 URL 描述的数据处理方法，因为此类可用于创建新的 DataHandler。注：当用 URL 构造 DataHandler 对象时，DataHandler 对象在内部创建一个 URLDataSource。
See also javax.activation.DataSource, javax.activation.DataHandler
英文文档：

The URLDataSource class provides an object that wraps a URL object in a DataSource interface. URLDataSource simplifies the handling of data described by URLs within the JavaBeans Activation Framework because this class can be used to create new DataHandlers. NOTE: The DataHandler object creates a URLDataSource internally, when it is constructed with a URL.

See Also:
DataSource, DataHandler

Constructor Summary
URLDataSource(URL url)
URLDataSource constructor.
Method Summary
String | getContentType() Returns the value of the URL content-type header field.
InputStream | getInputStream() The getInputStream method from the URL.
String | getName() Calls the getFile method on the URL used to instantiate the object.
OutputStream | getOutputStream() The getOutputStream method from the URL.
URL | getURL() Return the URL used to create this DataSource.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public URLDataSource(java.net.URL url)
URLDataSource 构造方法。在调用了要求打开到 URL 连接的方法之前，URLDataSource 类不会这样做。
url 要封装在此对象中的 URL。
英文文档：

URLDataSource

public URLDataSource(URL url)
URLDataSource constructor. The URLDataSource class will not open a connection to the URL until a method requiring it to do so is called.

Parameters:
url - The URL to be encapsulated in this object.
Method Detail

public String getContentType()
返回 URL 内容-类型 (content-type) 头字段的值。获取 URLConnection 对象后，它调用 URL 的 URLConnection.getContentType 方法。注：此方法尝试调用 URL 的 openConnection 方法。如果此方法失败，或内容类型不是从 URLConnection 返回的，则 getContentType 返回 "application/octet-stream" 作为内容类型。
return 内容类型。
英文文档：

getContentType

public String getContentType()
Returns the value of the URL content-type header field. It calls the URL's URLConnection.getContentType method after retrieving a URLConnection object. Note: this method attempts to call the openConnection method on the URL. If this method fails, or if a content type is not returned from the URLConnection, getContentType returns "application/octet-stream" as the content type.

Specified by:
getContentType in interface DataSource
Returns:
the content type.

public String getName()
调用用于实例化对象的 URL 的 getFile 方法。
return 调用 URL 的 getFile 方法的结果。
英文文档：

getName

public String getName()
Calls the getFile method on the URL used to instantiate the object.

Specified by:
getName in interface DataSource
Returns:
the result of calling the URL's getFile method.

public java.io.InputStream getInputStream() throws java.io.IOException
URL 的 getInputStream 方法。调用 URL 的 openStream 方法。
return InputStream。
英文文档：

getInputStream

public InputStream getInputStream()
                           throws IOException
The getInputStream method from the URL. Calls the openStream method on the URL.

Specified by:
getInputStream in interface DataSource
Returns:
the InputStream.
Throws:
IOException

public java.io.OutputStream getOutputStream() throws java.io.IOException
URL 的 getOutputStream 方法。首先，尝试为 URL 获取 URLConnection 对象。如果成功，则返回 URLConnection 的 getOutputStream 方法。
return OutputStream。
英文文档：

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
The getOutputStream method from the URL. First an attempt is made to get the URLConnection object for the URL. If that succeeds, the getOutputStream method on the URLConnection is returned.

Specified by:
getOutputStream in interface DataSource
Returns:
the OutputStream.
Throws:
IOException

public java.net.URL getURL()
返回用于创建此 DataSource 的 URL。
return URL。
英文文档：

getURL

public URL getURL()
Return the URL used to create this DataSource.

Returns:
The URL.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MimeTypeParseException (Java EE 5)

javax.activation
Class MimeTypeParseException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.activation.MimeTypeParseException
All Implemented Interfaces:
Serializable
public class MimeTypeParseException
extends Exception

Extends: Throwable > Exception

封装与 MimeType 解析相关的异常的类。
英文文档：

A class to encapsulate MimeType parsing related exceptions.

See Also:
Serialized Form

Constructor Summary
MimeTypeParseException()
Constructs a MimeTypeParseException with no specified detail message.
MimeTypeParseException(String s)
Constructs a MimeTypeParseException with the specified detail message.
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

public MimeTypeParseException()
构造不带指定详细消息的 MimeTypeParseException。
英文文档：

MimeTypeParseException

public MimeTypeParseException()
Constructs a MimeTypeParseException with no specified detail message.

public MimeTypeParseException(String s)
构造带指定详细消息的 MimeTypeParseException。
s 详细消息。
英文文档：

MimeTypeParseException

public MimeTypeParseException(String s)
Constructs a MimeTypeParseException with the specified detail message.

Parameters:
s - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnsupportedDataTypeException (Java EE 5)

javax.activation
Class UnsupportedDataTypeException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.io.IOException
                extended by  javax.activation.UnsupportedDataTypeException
All Implemented Interfaces:
Serializable
public class UnsupportedDataTypeException
extends IOException

Extends: Throwable > Exception > java.io.IOException

当请求操作不支持请求的数据类型时，抛出此异常。
See also javax.activation.DataHandler
英文文档：

Signals that the requested operation does not support the requested data type.

See Also:
DataHandler, Serialized Form

Constructor Summary
UnsupportedDataTypeException()
Constructs an UnsupportedDataTypeException with no detail message.
UnsupportedDataTypeException(String s)
Constructs an UnsupportedDataTypeException with the specified message.
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

public UnsupportedDataTypeException()
构造不带详细消息的 UnsupportedDataTypeException。
英文文档：

UnsupportedDataTypeException

public UnsupportedDataTypeException()
Constructs an UnsupportedDataTypeException with no detail message.

public UnsupportedDataTypeException(String s)
构造带指定消息的 UnsupportedDataTypeException。
s 详细消息。
英文文档：

UnsupportedDataTypeException

public UnsupportedDataTypeException(String s)
Constructs an UnsupportedDataTypeException with the specified message.

Parameters:
s - The detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.annotation (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.annotation

Enum Summary
Resource.AuthenticationType The two possible authentication types for a resource.

Annotation Types Summary
Generated | The Generated annoation is used to mark source code that has been generated.
PostConstruct | The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization.
PreDestroy | The PreDestroy annotation is used on methods as a callback notification to signal that the instance is in the process of being removed by the container.
Resource | The Resource annotation marks a resource that is needed by the application.
Resources | This class is used to allow multiple resources declarations.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.annotation Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.annotation

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • javax.annotation.Generated (implements java.lang.annotation.Annotation)
  • javax.annotation.PostConstruct (implements java.lang.annotation.Annotation)
  • javax.annotation.PreDestroy (implements java.lang.annotation.Annotation)
  • javax.annotation.Resource (implements java.lang.annotation.Annotation)
  • javax.annotation.Resources (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.annotation.Resource.AuthenticationType
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Generated (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.annotation
Annotation Type Generated

@Documented
@Retention(value=SOURCE)
@Target(value={PACKAGE,TYPE,ANNOTATION_TYPE,METHOD,CONSTRUCTOR,FIELD,LOCAL_VARIABLE,PARAMETER})
public @interface Generated

Implements: Annotation
@Documented
@Retention(value=SOURCE)
@Target(value={PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, PARAMETER})

Generated 注释用于标记已生成的源代码。它也可以用于区分单个文件中用户编写的代码和生成的代码。使用时，值元素必须有代码生成器的名称。建议的约定是在值字段中使用代码生成器的完全限定名。例如：com.company.package.classname。日期元素用于表示生成源代码的日期。日期元素必须遵循 ISO 8601 标准。例如，日期元素可能是值 2001-07-04T12:08:56.235-0700，它表示美国太平洋时区的本地时间 2001-07-04 12:08:56。注释元素是代码生成器想要在生成代码中包含的所有注释的占位符 (place holder)。
since 1.0
英文文档：

The Generated annoation is used to mark source code that has been generated. It can also be used to differentiate user written code from generated code in a single file. When used, the value element must have the name of the code generator. The recommended convention is to use the fully qualified name of the code generator in the value field . For example: com.company.package.classname. The date element is used to indicate the date the source was generated. The date element must follow the ISO 8601 standard. For example the date element would have the following value 2001-07-04T12:08:56.235-0700 which represents 2001-07-04 12:08:56 local time in the U.S. Pacific Time time zone. The comment element is a place holder for any comments that the code generator may want to include in the generated code.

Since:
1.0

Required Element Summary
 String[] value
This is used by the code generator to mark the generated classes and methods.
Optional Element Summary
String | comments A place holder for any comments that the code generator may want to include in the generated code.
String | date Date when the source was generated.

Element Detail

abstract public String[] value()
此方法由代码生成器使用，以标记生成的类和方法。
英文文档：

value

public abstract String[] value
This is used by the code generator to mark the generated classes and methods.

abstract public String date()
生成源代码的日期。
英文文档：

date

public abstract String date
Date when the source was generated.

Default:
""

abstract public String comments()
代码生成器想要在生成代码中包含的所有注释的占位符。
英文文档：

comments

public abstract String comments
A place holder for any comments that the code generator may want to include in the generated code.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


PostConstruct (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.annotation
Annotation Type PostConstruct

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface PostConstruct

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)

PostConstruct 注释用于在依赖关系注入完成之后需要执行的方法上，以执行任何初始化。此方法必须在将类放入服务之前调用。支持依赖关系注入的所有类都必须支持此注释。即使类没有请求注入任何资源，用 PostConstruct 注释的方法也必须被调用。只有一个方法可以用此注释进行注释。应用 PostConstruct 注释的方法必须遵守以下所有标准：该方法不得有任何参数，除非是在 EJB 拦截器 (interceptor) 的情况下，根据 EJB 规范的定义，在这种情况下它将带有一个 InvocationContext 对象 ；该方法的返回类型必须为 void；该方法不得抛出已检查异常；应用 PostConstruct 的方法可以是 public、protected、package private 或 private；除了应用程序客户端之外，该方法不能是 static；该方法可以是 final；如果该方法抛出未检查异常，那么不得将类放入服务中，除非是能够处理异常并可从中恢复的 EJB。
since | 1.0
See also | javax.annotation.PreDestroy, javax.annotation.Resource
英文文档：

The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization. This method MUST be invoked before the class is put into service. This annotation MUST be supported on all classes that support dependency injection. The method annotated with PostConstruct MUST be invoked even if the class does not request any resources to be injected. Only one method can be annotated with this annotation. The method on which the PostConstruct annotation is applied MUST fulfill all of the following criteria - - The method MUST NOT have any parameters except in the case of EJB interceptors in which case it takes an InvocationC ontext object as defined by the EJB specification. - The return type of the method MUST be void. - The method MUST NOT throw a checked exception. - The method on which PostConstruct is applied MAY be public, protected, package private or private. - The method MUST NOT be static except for the application client. - The method MAY be final. - If the method throws an unchecked exception the class MUST NOT be put into service except in the case of EJBs where the EJB can handle exceptions and even recover from them.

Since:
1.0
See Also:
PreDestroy, Resource

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PreDestroy (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.annotation
Annotation Type PreDestroy

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface PreDestroy

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)

PreDestroy 注释作为回调通知用于各方法，以表示该实例正处于被容器移除的过程中。用 PreDestroy 注释的方法通常用于释放它已持有的资源。除 Java EE 5 中的应用程序客户端容器之外，所有支持 PostConstruct 的容器管理对象都必须支持此注释。应用 PreDestroy 注释的方法必须遵守以下所有标准：该方法不得有任何参数，除非是在 EJB 拦截器 (interceptor) 的情况下，根据 EJB 规范的定义，在这种情况下它将带有一个 InvocationContext 对象；该方法的返回类型必须为 void；该方法不得抛出已检查异常；应用 PreDestroy 的方法可以是 public、protected、package private 或 private；该方法不得是 static；该方法可以是 final；如果该方法抛出未检查异常，则忽略此异常，除非是能够处理异常的 EJB。
since | 1.0
See also | javax.annotation.PostConstruct, javax.annotation.Resource
英文文档：

The PreDestroy annotation is used on methods as a callback notification to signal that the instance is in the process of being removed by the container. The method annotated with PreDestroy is typically used to release resources that it has been holding. This annotation MUST be supported by all container managed objects that support PostConstruct except the application client container in Java EE 5. The method on which the PreDestroy annotation is applied MUST fulfill all of the following criteria - - The method MUST NOT have any parameters except in the case of EJB interceptors in which case it takes an InvocationContext object as defined by the EJB specification. - The return type of the method MUST be void. - The method MUST NOT throw a checked exception. - The method on which PreDestroy is applied MAY be public, protected, package private or private. - The method MUST NOT be static. - The method MAY be final. - If the method throws an unchecked exception it is ignored except in the case of EJBs where the EJB can handle exceptions.

Since:
1.0
See Also:
PostConstruct, Resource

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Resource (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.annotation
Annotation Type Resource

@Target(value={TYPE,FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface Resource

Implements: Annotation
Inner classes: Resource.AuthenticationType
@Target(value={TYPE, FIELD, METHOD})
@Retention(value=RUNTIME)

Resource 注释标记应用程序所需的资源。此注释可以应用于应用程序组件类，或者该组件类的字段或方法。如果将该注释应用于一个字段或方法，那么初始化应用程序组件时容器将把所请求资源的一个实例注入其中。如果将该注释应用于组件类，则该注释将声明一个应用程序在运行时将查找的资源。

即使此注释没有被标记为 Inherited，部署工具仍然需要检查任意组件类的所有超类，以发现这些超类中所有使用此注释的地方。所有此类注释实例都指定了应用程序组件所需的资源。注意，此注释可能出现在超类的 private 字段和方法上；在这种情况下容器也需要执行注入操作。

英文文档：

The Resource annotation marks a resource that is needed by the application. This annotation may be applied to an application component class, or to fields or methods of the component class. When the annotation is applied to a field or method, the container will inject an instance of the requested resource into the application component when the component is initialized. If the annotation is applied to the component class, the annotation declares a resource that the application will look up at runtime.

Even though this annotation is not marked Inherited, deployment tools are required to examine all superclasses of any component class to discover all uses of this annotation in all superclasses. All such annotation instances specify resources that are needed by the application component. Note that this annotation may appear on private fields and methods of superclasses; the container is required to perform injection in these cases as well.

Optional Element Summary
Resource.AuthenticationType | authentication The authentication type to use for this resource.
String | description Description of this resource.
String | mappedName A product specific name that this resource should be mapped to.
String | name The JNDI name of the resource.
boolean | shareable Indicates whether this resource can be shared between this component and other components.
Class | type The Java type of the resource.

abstract public String name()
资源的 JNDI 名称。对于字段注释，默认值为字段名称。对于方法注释，默认值为与该方法对应的 JavaBean 属性名称。对于类注释，没有默认值，必须指定此项。
英文文档：

name

public abstract String name
The JNDI name of the resource. For field annotations, the default is the field name. For method annotations, the default is the JavaBeans property name corresponding to the method. For class annotations, there is no default and this must be specified.

Default:
""

abstract public Class<T> type()
资源的 Java 类型。对于字段注释，默认值为字段的类型。对于方法注释，默认值为 JavaBean 属性的类型。对于类注释，没有默认值，必须指定此项。
英文文档：

type

public abstract Class type
The Java type of the resource. For field annotations, the default is the type of the field. For method annotations, the default is the type of the JavaBeans property. For class annotations, there is no default and this must be specified.

Default:
java.lang.Object.class

abstract public Resource.AuthenticationType authentication()
用于此资源的验证类型。可以为表示任何受支持类型的连接工厂的资源指定此方法，不得为其他类型的资源指定。
英文文档：

authentication

public abstract Resource.AuthenticationType authentication
The authentication type to use for this resource. This may be specified for resources representing a connection factory of any supported type, and must not be specified for resources of other types.

Default:
CONTAINER

abstract public boolean shareable()
指示是否能在此组件与其他组件之间共享此资源。可以为表示任何受支持类型的连接工厂的资源指定此方法，不得为其他类型的资源指定。
英文文档：

shareable

public abstract boolean shareable
Indicates whether this resource can be shared between this component and other components. This may be specified for resources representing a connection factory of any supported type, and must not be specified for resources of other types.

Default:
true

abstract public String mappedName()
此资源应该映射到的特定于产品的名称。此资源的名称（由 name 元素定义或为默认值）是使用该资源的应用程序组件的本地名称。（它的名称位于 JNDI java:comp/env 名称空间中。）许多应用程序服务器都提供一种方式将这些本地名称映射到应用程序服务器已知的资源名称。此映射的名称通常是全局 JNDI 名称，但也可以是任何形式的名称。

应用程序服务器不需要支持任何特殊形式或类型的映射名称，也不需要具有使用映射名称的能力。映射的名称与产品有关，并且通常与安装有关。任何对映射名称的使用都不可移植。

英文文档：

mappedName

public abstract String mappedName
A product specific name that this resource should be mapped to. The name of this resource, as defined by the name element or defaulted, is a name that is local to the application component using the resource. (It's a name in the JNDI java:comp/env namespace.) Many application servers provide a way to map these local names to names of resources known to the application server. This mapped name is often a global JNDI name, but may be a name of any form.

Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.

Default:
""

abstract public String description()
此资源的描述。描述应该使用部署应用程序的系统的默认语言。该描述能够呈现给部署者以帮助他们选择正确的资源。
英文文档：

description

public abstract String description
Description of this resource. The description is expected to be in the default language of the system on which the application is deployed. The description can be presented to the Deployer to help in choosing the correct resource.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Resources (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.annotation
Annotation Type Resources

@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Resources

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)

此类用于允许多个资源声明。
since | 1.0
See also | javax.annotation.Resource
英文文档：

This class is used to allow multiple resources declarations.

Since:
1.0
See Also:
Resource

Required Element Summary
 Resource[] value
Array used for multiple resource declarations.

Element Detail

abstract public Resource[] value()
用于多个资源声明的数组。
英文文档：

value

public abstract Resource[] value
Array used for multiple resource declarations.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.annotation.security (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.annotation.security

Annotation Types Summary
DeclareRoles | Used by application to declare roles.
DenyAll | Specifies that no security roles are allowed to invoke the specified method(s) - i.e that the methods are to be excluded from execution in the J2EE container.
PermitAll | Specifies that all security roles are allowed to invoke the specified method(s) i.e that the specified method(s) are "unchecked".
RolesAllowed | Specifies the list of roles permitted to access method(s) in an application.
RunAs | Defines the identity of the application during execution in a J2EE container.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.annotation.security Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.annotation.security

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • javax.annotation.security.DeclareRoles (implements java.lang.annotation.Annotation)
  • javax.annotation.security.DenyAll (implements java.lang.annotation.Annotation)
  • javax.annotation.security.PermitAll (implements java.lang.annotation.Annotation)
  • javax.annotation.security.RolesAllowed (implements java.lang.annotation.Annotation)
  • javax.annotation.security.RunAs (implements java.lang.annotation.Annotation)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DeclareRoles (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.annotation.security
Annotation Type DeclareRoles

@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface DeclareRoles

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)

应用程序使用此类声明角色。可以对类指定。
since 1.0
英文文档：

Used by application to declare roles. It can be specified on a class.

Since:
1.0

Required Element Summary
 String[] value

Element Detail

abstract public String[] value()
英文文档：

value

public abstract String[] value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


DenyAll (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.annotation.security
Annotation Type DenyAll

@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface DenyAll

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)

规定不允许任何安全角色调用指定的方法，即这些方法将不会在 J2EE 容器中执行。
since | 1.0
See also | javax.annotation.security.RolesAllowed, javax.annotation.security.PermitAll
英文文档：

Specifies that no security roles are allowed to invoke the specified method(s) - i.e that the methods are to be excluded from execution in the J2EE container.

Since:
1.0
See Also:
RolesAllowed, PermitAll

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PermitAll (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.annotation.security
Annotation Type PermitAll

@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface PermitAll

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE, METHOD})

规定允许所有安全角色调用指定的方法，即指定的方法是“未经检查的”。可以对类或方法指定。对类指定表示它应用于该类的所有方法。如果在方法级别上指定，则只影响该方法。如果在类级别上指定 RolesAllowed，且在方法级别上应用此注释，则 PermitAll 注释将对指定的方法重写 RolesAllowed。
since | 1.0
See also | javax.annotation.security.RolesAllowed, javax.annotation.security.DenyAll
英文文档：

Specifies that all security roles are allowed to invoke the specified method(s) i.e that the specified method(s) are "unchecked". It can be specified on a class or on methods. Specifying it on the class means that it applies to all methods of the class. If specified at the method level, it only affects that method. If the RolesAllowed is specified at the class level and this annotation is applied at the method level, the PermitAll annotation overrides the RolesAllowed for the specified method.

Since:
1.0
See Also:
RolesAllowed, DenyAll

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RolesAllowed (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.annotation.security
Annotation Type RolesAllowed

@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface RolesAllowed

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE, METHOD})

指定允许访问应用程序中的方法的角色列表。RolesAllowed 注释的值是一个安全角色名称的列表。可以对类或方法指定此注释。在类级别上指定表示它应用于该类的所有方法。对方法指定表示它仅适用于该方法。如果同时应用于类级别和方法级别，存在冲突时方法值将重写类值。
since 1.0
英文文档：

Specifies the list of roles permitted to access method(s) in an application. The value of the RolesAllowed annotation is a list of security role names. This annotation can be specified on a class or on method(s). Specifying it at a class level means that it applies to all the methods in the class. Specifying it on a method means that it is applicable to that method only. If applied at both the class and methods level , the method value overrides the class value if the two conflict.

Since:
1.0

Required Element Summary
 String[] value

Element Detail

abstract public String[] value()
英文文档：

value

public abstract String[] value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RunAs (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.annotation.security
Annotation Type RunAs

@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface RunAs

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)

定义应用程序在 J2EE 容器中执行期间的身份。这允许开发人员在特定的角色下执行。角色必须映射到容器安全域中的用户/组信息。它的值是安全角色的名称。
since 1.0
英文文档：

Defines the identity of the application during execution in a J2EE container. This allows developers to execute under a particular role. The role must map to the user / group information in the containers security realm. It's value is the name of a security role.

Since:
1.0

Required Element Summary
 String value

Element Detail

abstract public String value()
英文文档：

value

public abstract String value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.ejb (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.ejb

The javax.ejb package contains the Enterprise JavaBeans classes and interfaces that define the contracts between the enterprise bean and its clients and between the enterprise bean and the EJB container.

See:
Description

Interface Summary
EJBContext | The EJBContext interface provides an instance with access to the container-provided runtime context of an enterprise Bean instance.
EJBHome | The EJBHome interface must be extended by all enterprise Beans' remote home interfaces.
EJBLocalHome | The EJBLocalHome interface must be extended by all enterprise Beans' local home interfaces.
EJBLocalObject | The EJBLocalObject interface must be extended by all enterprise Beans' local interfaces.
EJBMetaData | The EJBMetaData interface allows a client to obtain the enterprise Bean's meta-data information.
EJBObject | The EJBObject interface is extended by all enterprise Beans' remote interfaces.
EnterpriseBean | The EnterpriseBean interface must be implemented by every enterprise Bean class.
EntityBean | The EntityBean interface is implemented by every entity enterprise Bean class.
EntityContext | The EntityContext interface provides an instance with access to the container-provided runtime context of an entity enterprise Bean instance.
Handle | The Handle interface is implemented by all EJB object handles.
HomeHandle | The HomeHandle interface is implemented by all home object handles.
MessageDrivenBean | The MessageDrivenBean interface is implemented by every message-driven enterprise Bean class.
MessageDrivenContext | The MessageDrivenContext interface provides access to the runtime message-driven context that the container provides for a message-driven enterprise Bean instance.
SessionBean | The SessionBean interface is implemented by every session enterprise Bean class.
SessionContext | The SessionContext interface provides access to the runtime session context that the container provides for a session enterprise Bean instance.
SessionSynchronization | The SessionSynchronization interface allows a session Bean instance to be notified by its container of transaction boundaries.
TimedObject | The TimedObject interface contains the callback method that is used to deliver timer expiration notifications.
Timer | The Timer interface contains information about a timer that was created through the EJB Timer Service.
TimerHandle | The TimerHandle interface is implemented by all EJB timer handles.
TimerService | The TimerService interface provides enterprise bean components with access to the container-provided Timer Service.

Enum Summary
TransactionAttributeType
TransactionManagementType

Exception Summary
AccessLocalException | An AccessLocalException is thrown to indicate that the caller does not have permission to call the method.
ConcurrentAccessException | A ConcurrentAccessException indicates that the client has attempted an invocation on a stateful session bean while another invocation is in progress.
CreateException | The CreateException exception must be included in the throws clauses of all create methods defined in an enterprise Bean's home interface.
DuplicateKeyException | The DuplicateKeyException exception is thrown if an entity EJB object cannot be created because an object with the same key already exists.
EJBAccessException | This exception indicates that client access to a business method was denied.
EJBException | The EJBException exception is thrown by an enterprise Bean instance to its container to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a database connection).
EJBTransactionRequiredException | This exception indicates that a request carried a null transaction context, but the target object requires an active transaction.
EJBTransactionRolledbackException | This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back.
FinderException | The FinderException exception must be included in the throws clause of every findMETHOD(...) method of an entity Bean's home interface.
NoSuchEJBException | A NoSuchEJBException is thrown if an attempt is made to invoke a method on an object that no longer exists.
NoSuchEntityException | The NoSuchEntityException exception is thrown by an Entity Bean instance to its container to report that the invoked business method or callback method could not be completed because of the underlying entity was removed from the database.
NoSuchObjectLocalException | A NoSuchObjectLocalException is thrown if an attempt is made to invoke a method on an object that no longer exists.
ObjectNotFoundException | The ObjectNotFoundException exception is thrown by a finder method to indicate that the specified EJB object does not exist.
RemoveException | The RemoveException exception is thrown at an attempt to remove an EJB object when the enterprise Bean or the container does not allow the EJB object to be removed.
TransactionRequiredLocalException | This exception indicates that a request carried a null transaction context, but the target object requires an active transaction.
TransactionRolledbackLocalException | This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back.

Annotation Types Summary
ActivationConfigProperty |
ApplicationException | Applied to an exception to denote that it is an application exception and should be reported to the client directly(i.e., unwrapped).
EJB | Indicates a dependency on the local or remote view of an Enterprise Java Bean.
EJBs | Declares multiple TYPE-level @EJB annotations.
Init | Designates a method of a session bean that corresponds to the create method of an adapted Home interface or an adapted Local Home interface.
Local | When used on the bean class, declares the local business interface(s) for a session bean.
LocalHome | Declares the Local Home or adapted Local Home interface for a session bean.
MessageDriven | Component-defining annotation for a message driven bean.
PostActivate | Designates a method to receive a callback after a stateful session bean has been activated.
PrePassivate | Designates a method to receive a callback before a stateful session bean is passivated.
Remote | Declares the remote business interface(s) for a session bean.
RemoteHome | Declares the Remote Home or adapted Remote Home interface for a session bean.
Remove | Applied to a business method of a stateful session bean class.
Stateful | Component-defining annotation for a stateful session bean.
Stateless | Component-defining annotation for a stateless session bean.
Timeout | Designates a method on a stateless session bean class or message driven bean class that should receive EJB timer expirations for that bean.
TransactionAttribute | When applied at the TYPE-level, designates the default transaction attribute for all business methods of the session or message driven bean.
TransactionManagement | Declares whether a session bean or message driven bean has container managed transactions or bean managed transactions.

Package javax.ejb Description

The javax.ejb package contains the Enterprise JavaBeans classes and interfaces that define the contracts between the enterprise bean and its clients and between the enterprise bean and the EJB container.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.ejb Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.ejb

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.ejb.CreateException
          • javax.ejb.DuplicateKeyException
        • javax.ejb.FinderException
          • javax.ejb.ObjectNotFoundException
        • javax.ejb.RemoveException
        • java.lang.RuntimeException
          • javax.ejb.EJBException
            • javax.ejb.AccessLocalException
            • javax.ejb.ConcurrentAccessException
            • javax.ejb.EJBAccessException
            • javax.ejb.EJBTransactionRequiredException
            • javax.ejb.EJBTransactionRolledbackException
            • javax.ejb.NoSuchEJBException
            • javax.ejb.NoSuchEntityException
            • javax.ejb.NoSuchObjectLocalException
            • javax.ejb.TransactionRequiredLocalException
            • javax.ejb.TransactionRolledbackLocalException

Interface Hierarchy

  • javax.ejb.EJBContext
    • javax.ejb.EntityContext
    • javax.ejb.MessageDrivenContext
    • javax.ejb.SessionContext
  • javax.ejb.EJBLocalHome
  • javax.ejb.EJBLocalObject
  • javax.ejb.EJBMetaData
  • java.rmi.Remote
    • javax.ejb.EJBHome
    • javax.ejb.EJBObject
  • java.io.Serializable
    • javax.ejb.EnterpriseBean
      • javax.ejb.EntityBean
      • javax.ejb.MessageDrivenBean
      • javax.ejb.SessionBean
    • javax.ejb.Handle
    • javax.ejb.HomeHandle
    • javax.ejb.TimerHandle
  • javax.ejb.SessionSynchronization
  • javax.ejb.TimedObject
  • javax.ejb.Timer
  • javax.ejb.TimerService

Annotation Type Hierarchy

  • javax.ejb.ActivationConfigProperty (implements java.lang.annotation.Annotation)
  • javax.ejb.ApplicationException (implements java.lang.annotation.Annotation)
  • javax.ejb.EJB (implements java.lang.annotation.Annotation)
  • javax.ejb.EJBs (implements java.lang.annotation.Annotation)
  • javax.ejb.Init (implements java.lang.annotation.Annotation)
  • javax.ejb.Local (implements java.lang.annotation.Annotation)
  • javax.ejb.LocalHome (implements java.lang.annotation.Annotation)
  • javax.ejb.MessageDriven (implements java.lang.annotation.Annotation)
  • javax.ejb.PostActivate (implements java.lang.annotation.Annotation)
  • javax.ejb.PrePassivate (implements java.lang.annotation.Annotation)
  • javax.ejb.Remote (implements java.lang.annotation.Annotation)
  • javax.ejb.RemoteHome (implements java.lang.annotation.Annotation)
  • javax.ejb.Remove (implements java.lang.annotation.Annotation)
  • javax.ejb.Stateful (implements java.lang.annotation.Annotation)
  • javax.ejb.Stateless (implements java.lang.annotation.Annotation)
  • javax.ejb.Timeout (implements java.lang.annotation.Annotation)
  • javax.ejb.TransactionAttribute (implements java.lang.annotation.Annotation)
  • javax.ejb.TransactionManagement (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.ejb.TransactionAttributeType
      • javax.ejb.TransactionManagementType
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


EJBContext (Java EE 5)

javax.ejb
Interface EJBContext

All Known Subinterfaces:
EntityContext, MessageDrivenContext, SessionContext
public interface EJBContext

Implemented by: EntityContext, MessageDrivenContext, SessionContext

EJBContext 接口为实例提供对企业 Bean 实例的容器提供的运行时上下文的访问。

该接口通过 SessionContext、EntityContext 和 MessageDrivenContext 接口扩展，以提供其他特定于企业接口 Bean 类型的方法。

英文文档：

The EJBContext interface provides an instance with access to the container-provided runtime context of an enterprise Bean instance.

This interface is extended by the SessionContext, EntityContext, and MessageDrivenContext interfaces to provide additional methods specific to the enterprise interface Bean type.

Method Summary
 Identity getCallerIdentity()
Deprecated. Use Principal getCallerPrincipal() instead.
 Principal getCallerPrincipal()
Obtain the java.security.Principal that identifies the caller.
 EJBHome getEJBHome()
Obtain the enterprise bean's remote home interface.
 EJBLocalHome getEJBLocalHome()
Obtain the enterprise bean's local home interface.
 Properties getEnvironment()
Deprecated. Use the JNDI naming context java:comp/env to access enterprise bean's environment.
 boolean getRollbackOnly()
Test if the transaction has been marked for rollback only.
 TimerService getTimerService()
Get access to the EJB Timer Service.
 UserTransaction getUserTransaction()
Obtain the transaction demarcation interface.
 boolean isCallerInRole(Identity role)
Deprecated. Use boolean isCallerInRole(String roleName) instead.
 boolean isCallerInRole(String roleName)
Test if the caller has a given security role.
 Object lookup(String name)
Lookup a resource within the component's private naming context.
 void setRollbackOnly()
Mark the current transaction for rollback.

Method Detail

public EJBHome getEJBHome()
获得企业 Bean 的远程 home 接口。
return | 企业 Bean 的远程 home 接口。
Throws | IllegalStateException: 如果企业 Bean 不具有远程 home 接口。
英文文档：

getEJBHome

EJBHome getEJBHome()
Obtain the enterprise bean's remote home interface.

Returns:
The enterprise bean's remote home interface.
Throws:
IllegalStateException - if the enterprise bean does not have a remote home interface.

public EJBLocalHome getEJBLocalHome()
获得企业 Bean 的本地 home 接口。
return | 企业 Bean 的本地 home 接口。
Throws | IllegalStateException: 如果企业 Bean 不具有本地 home 接口。
英文文档：

getEJBLocalHome

EJBLocalHome getEJBLocalHome()
Obtain the enterprise bean's local home interface.

Returns:
The enterprise bean's local home interface.
Throws:
IllegalStateException - if the enterprise bean does not have a local home interface.

public java.util.Properties getEnvironment()
获得企业 Bean 的环境属性。

注：如果企业 Bean 没有环境属性，那么此方法返回空 java.util.Properties 对象。此方法从不返回 null。

return | 企业 Bean 的环境属性。
deprecated | 使用 JNDI 命名上下文 java:comp/env 访问企业 Bean 环境。
英文文档：

getEnvironment

Properties getEnvironment()
Deprecated. Use the JNDI naming context java:comp/env to access enterprise bean's environment.

Obtain the enterprise bean's environment properties.

Note: If the enterprise bean has no environment properties this method returns an empty java.util.Properties object. This method never returns null.

Returns:
The environment properties for the enterprise bean.

public java.security.Identity getCallerIdentity()
获得调用者的 java.security.Identity。 此方法从 EJB 1.1 时起过时。Container 允许始终从此方法返回 null。企业 Bean 应改用 getCallerPrincipal 方法。
return | 标识调用者的 Identity 对象。
deprecated | 请改用 Principal getCallerPrincipal()。
英文文档：

getCallerIdentity

Identity getCallerIdentity()
Deprecated. Use Principal getCallerPrincipal() instead.

Obtain the java.security.Identity of the caller. This method is deprecated in EJB 1.1. The Container is allowed to return alway null from this method. The enterprise bean should use the getCallerPrincipal method instead.

Returns:
The Identity object that identifies the caller.

public java.security.Principal getCallerPrincipal()
获得标识调用者的 java.security.Principal。
return | 标识调用者的 Principal 对象。此方法从不返回 null。
Throws | IllegalStateException: 如果不允许实例调用此方法，则 Container 抛出该异常。
英文文档：

getCallerPrincipal

Principal getCallerPrincipal()
Obtain the java.security.Principal that identifies the caller.

Returns:
The Principal object that identifies the caller. This method never returns null.
Throws:
IllegalStateException - The Container throws the exception if the instance is not allowed to call this method.

public boolean isCallerInRole(java.security.Identity role)
测试调用者是否有给定角色。

此方法从 EJB 1.1 时起过时。企业 Bean 应改用 isCallerInRole(String roleName) 方法。

role | 要测试的角色的 java.security.Identity。
return | 如果调用者具有指定的角色，则返回 true。
deprecated | 请改用 boolean isCallerInRole(String roleName)。
英文文档：

isCallerInRole

boolean isCallerInRole(Identity role)
Deprecated. Use boolean isCallerInRole(String roleName) instead.

Test if the caller has a given role.

This method is deprecated in EJB 1.1. The enterprise bean should use the isCallerInRole(String roleName) method instead.

Parameters:
role - The java.security.Identity of the role to be tested.
Returns:
True if the caller has the specified role.

public boolean isCallerInRole(String roleName)
测试调用者是否有给定安全角色。
roleName | 安全角色的名称。角色必须是在部署描述符中定义的安全角色之一。
return | 如果调用者具有指定的角色，则返回 true。
Throws | IllegalStateException: 如果不允许实例调用此方法，则 Container 抛出该异常。
英文文档：

isCallerInRole

boolean isCallerInRole(String roleName)
Test if the caller has a given security role.

Parameters:
roleName - The name of the security role. The role must be one of the security roles that is defined in the deployment descriptor.
Returns:
True if the caller has the specified role.
Throws:
IllegalStateException - The Container throws the exception if the instance is not allowed to call this method.

public UserTransaction getUserTransaction() throws IllegalStateException
获得事务划分接口。 仅允许带有 Bean 管理事务的企业 Bean 使用 UserTransaction 接口。因为实体 Bean 必须始终使用容器管理事务，所以仅允许带有 Bean 管理事务的会话 Bean 或消息驱动 Bean 调用此方法。
return | 企业 Bean 实例用于事务划分的 UserTransaction 接口。
Throws | IllegalStateException: 如果不允许实例使用 UserTransaction 接口（即实例为带有容器管理事务的 Bean），则 Container 抛出该异常。
英文文档：

getUserTransaction

UserTransaction getUserTransaction()
                                   throws IllegalStateException
Obtain the transaction demarcation interface. Only enterprise beans with bean-managed transactions are allowed to to use the UserTransaction interface. As entity beans must always use container-managed transactions, only session beans or message-driven beans with bean-managed transactions are allowed to invoke this method.

Returns:
The UserTransaction interface that the enterprise bean instance can use for transaction demarcation.
Throws:
IllegalStateException - The Container throws the exception if the instance is not allowed to use the UserTransaction interface (i.e. the instance is of a bean with container-managed transactions).

public void setRollbackOnly() throws IllegalStateException
将当前事务标记为回滚。事务将永久标记为回滚。标记为回滚的事务永远不能提交。 仅允许带有容器管理事务的企业 Bean 使用此方法。
Throws IllegalStateException: 如果不允许实例使用此方法（即实例为带有 Bean 管理事务的 Bean），则 Container 抛出该异常。
英文文档：

setRollbackOnly

void setRollbackOnly()
                     throws IllegalStateException
Mark the current transaction for rollback. The transaction will become permanently marked for rollback. A transaction marked for rollback can never commit. Only enterprise beans with container-managed transactions are allowed to use this method.

Throws:
IllegalStateException - The Container throws the exception if the instance is not allowed to use this method (i.e. the instance is of a bean with bean-managed transactions).

public boolean getRollbackOnly() throws IllegalStateException
测试事务是否仅被标记为回滚。企业 Bean 实例可以使用此操作，例如，测试在捕获异常后代表当前事务继续计算是否无效。 仅允许带有容器管理事务的企业 Bean 使用此方法。
return | 如果当前事务被标记为回滚，则返回 true；否则返回 false。
Throws | IllegalStateException: 如果不允许实例使用此方法（即实例为带有 Bean 管理事务的 Bean），则 Container 抛出该异常。
英文文档：

getRollbackOnly

boolean getRollbackOnly()
                        throws IllegalStateException
Test if the transaction has been marked for rollback only. An enterprise bean instance can use this operation, for example, to test after an exception has been caught, whether it is fruitless to continue computation on behalf of the current transaction. Only enterprise beans with container-managed transactions are allowed to use this method.

Returns:
True if the current transaction is marked for rollback, false otherwise.
Throws:
IllegalStateException - The Container throws the exception if the instance is not allowed to use this method (i.e. the instance is of a bean with bean-managed transactions).

public TimerService getTimerService() throws IllegalStateException
获得对 EJB Timer Service 的访问。
Throws IllegalStateException: 如果不允许实例使用此方法（即如果该 Bean 是有状态会话 Bean），则 Container 抛出该异常。
英文文档：

getTimerService

TimerService getTimerService()
                             throws IllegalStateException
Get access to the EJB Timer Service.

Throws:
IllegalStateException - The Container throws the exception if the instance is not allowed to use this method (e.g. if the bean is a stateful session bean)

public Object lookup(String name)
在组件的专有命名上下文内查找资源。
name | 条目名称（相对于 java:comp/env）。
Throws | IllegalArgumentException: 如果给定名称与组件环境内的条目不匹配，则 Container 抛出该异常。
英文文档：

lookup

Object lookup(String name)
Lookup a resource within the component's private naming context.

Parameters:
name - Name of the entry (relative to java:comp/env).
Throws:
IllegalArgumentException - The Container throws the exception if the given name does not match an entry within the component's environment.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBHome (Java EE 5)

javax.ejb
Interface EJBHome

All Superinterfaces:
Remote
All Known Subinterfaces:
ManagementHome
public interface EJBHome
extends Remote

Implements: java.rmi.Remote
Implemented by: ManagementHome

EJBHome 接口必须通过所有企业 Bean 的远程 home 接口扩展。企业 Bean 的远程 home 接口定义了允许远程客户端创建、查找和移除 EJB 对象的方法，以及不特定于 Bean 实例的 home 业务方法（会话 Bean 没有查找器和 home 方法）。

远程 home 接口由企业 Bean 提供者定义，由企业 Bean 容器实现。

英文文档：

The EJBHome interface must be extended by all enterprise Beans' remote home interfaces. An enterprise Bean's remote home interface defines the methods that allow a remote client to create, find, and remove EJB objects, as well as home business methods that are not specific to a bean instance (Session Beans do not have finders and home methods).

The remote home interface is defined by the enterprise Bean provider and implemented by the enterprise Bean container.

Method Summary
EJBMetaData | getEJBMetaData() Obtain the EJBMetaData interface for the enterprise Bean.
HomeHandle | getHomeHandle() Obtain a handle for the remote home object.
void | remove(Handle handle) Remove an EJB object identified by its handle.
void | remove(Object primaryKey) Remove an EJB object identified by its primary key.

Method Detail

public void remove(Handle handle) throws java.rmi.RemoteException, RemoveException
移除由其句柄标识的 EJB 对象。
Throws | RemoveException: 如果企业 Bean 或容器不允许客户端移除该对象，则抛出该异常。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

remove

void remove(Handle handle)
            throws RemoteException,
                   RemoveException
Remove an EJB object identified by its handle.

Throws:
RemoveException - Thrown if the enterprise Bean or the container does not allow the client to remove the object.
RemoteException - Thrown when the method failed due to a system-level failure.

public void remove(Object primaryKey) throws java.rmi.RemoteException, RemoveException
移除由其主键标识的 EJB 对象。

此方法仅用于实体 Bean。试图对会话 Bean 调用此方法将导致 RemoveException。

Throws | RemoveException: 如果企业 Bean 或容器不允许客户端移除该对象，则抛出该异常。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

remove

void remove(Object primaryKey)
            throws RemoteException,
                   RemoveException
Remove an EJB object identified by its primary key.

This method can be used only for an entity bean. An attempt to call this method on a session bean will result in a RemoveException.

Throws:
RemoveException - Thrown if the enterprise Bean or the container does not allow the client to remove the object.
RemoteException - Thrown when the method failed due to a system-level failure.

public EJBMetaData getEJBMetaData() throws java.rmi.RemoteException
获得企业 Bean 的 EJBMetaData 接口。EJBMetaData 接口允许客户端获得关于企业 Bean 的信息。

通过 EJBMetaData 接口获得的信息将由工具使用。

return | 企业 Bean 的 EJBMetaData 接口。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

getEJBMetaData

EJBMetaData getEJBMetaData()
                           throws RemoteException
Obtain the EJBMetaData interface for the enterprise Bean. The EJBMetaData interface allows the client to obtain information about the enterprise Bean.

The information obtainable via the EJBMetaData interface is intended to be used by tools.

Returns:
The enterprise Bean's EJBMetaData interface.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.

public HomeHandle getHomeHandle() throws java.rmi.RemoteException
获得远程 home 对象的句柄。句柄可以随后用于重新获得对远程 home 对象的引用，可能是在不同的 Java 虚拟机中。
return | 远程 home 对象的句柄。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

getHomeHandle

HomeHandle getHomeHandle()
                         throws RemoteException
Obtain a handle for the remote home object. The handle can be used at later time to re-obtain a reference to the remote home object, possibly in a different Java Virtual Machine.

Returns:
A handle for the remote home object.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBLocalHome (Java EE 5)

javax.ejb
Interface EJBLocalHome

public interface EJBLocalHome

EJBLocalHome 接口必须通过所有企业 Bean 的本地 home 接口扩展。企业 Bean 的本地 home 接口定义了允许本地客户端创建、查找和移除 EJB 对象的方法，以及不特定于 Bean 实例的 home 业务方法（会话 Bean 没有查找器和 home 业务方法）。

本地 home 接口由企业 Bean 提供者定义，由企业 Bean 容器实现。

英文文档：

The EJBLocalHome interface must be extended by all enterprise Beans' local home interfaces. An enterprise Bean's local home interface defines the methods that allow local clients to create, find, and remove EJB objects, as well as home business methods that are not specific to a bean instance (session Beans do not have finders and home business methods).

The local home interface is defined by the enterprise Bean provider and implemented by the enterprise Bean container.

Method Summary
 void remove(Object primaryKey)
Remove an EJB object identified by its primary key.

Method Detail

public void remove(Object primaryKey) throws RemoveException, EJBException
移除由其主键标识的 EJB 对象。

只有实体 Bean 的本地客户端可以使用此方法。试图对会话 Bean 调用此方法将导致 RemoveException。

Throws | RemoveException: 如果企业 Bean 或容器不允许客户端移除该对象，则抛出该异常。
Throws | EJBException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

remove

void remove(Object primaryKey)
            throws RemoveException,
                   EJBException
Remove an EJB object identified by its primary key.

This method can only be used by local clients of an entity bean. An attempt to call this method on a session bean will result in a RemoveException.

Throws:
RemoveException - Thrown if the enterprise Bean or the container does not allow the client to remove the object.
EJBException - Thrown when the method failed due to a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBLocalObject (Java EE 5)

javax.ejb
Interface EJBLocalObject

public interface EJBLocalObject

EJBLocalObject 接口必须通过所有企业 Bean 的本地接口扩展。企业 Bean 的本地接口提供 EJB 对象的本地客户端视图。企业 Bean 的本地接口定义了本地客户端可调用的业务方法。

企业 Bean 的本地接口由企业 Bean 提供者定义，由企业 Bean 容器实现。

英文文档：

The EJBLocalObject interface must be extended by all enterprise Beans' local interfaces. An enterprise Bean's local interface provides the local client view of an EJB object. An enterprise Bean's local interface defines the business methods callable by local clients.

The enterprise Bean's local interface is defined by the enterprise Bean provider and implemented by the enterprise Bean container.

Method Summary
EJBLocalHome | getEJBLocalHome() Obtain the enterprise Bean's local home interface.
Object | getPrimaryKey() Obtain the primary key of the EJB local object.
boolean | isIdentical(EJBLocalObject obj) Test if a given EJB local object is identical to the invoked EJB local object.
void | remove() Remove the EJB local object.

Method Detail

public EJBLocalHome getEJBLocalHome() throws EJBException
获得企业 Bean 的本地 home 接口。本地 home 接口定义本地客户端可用的企业 Bean 的 create、finder、remove 和 home 业务方法。
return | 对企业 Bean 的本地 home 接口的引用。
Throws | EJBException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

getEJBLocalHome

EJBLocalHome getEJBLocalHome()
                             throws EJBException
Obtain the enterprise Bean's local home interface. The local home interface defines the enterprise Bean's create, finder, remove, and home business methods that are available to local clients.

Returns:
A reference to the enterprise Bean's local home interface.
Throws:
EJBException - Thrown when the method failed due to a system-level failure.

public Object getPrimaryKey() throws EJBException
获得 EJB 本地对象的主键。

可以对实体 Bean 调用此方法。试图对会话 Bean 调用此方法将导致 EJBException。

return | EJB 本地对象的主键。
Throws | EJBException: 方法由于系统级失败而失败或对会话 Bean 调用此方法时抛出该异常。
英文文档：

getPrimaryKey

Object getPrimaryKey()
                     throws EJBException
Obtain the primary key of the EJB local object.

This method can be called on an entity bean. An attempt to invoke this method on a session Bean will result in an EJBException.

Returns:
The EJB local object's primary key.
Throws:
EJBException - Thrown when the method failed due to a system-level failure or when invoked on a session bean.

public void remove() throws RemoveException, EJBException
移除 EJB 本地对象。
Throws | RemoveException: 如果企业 Bean 或容器不允许销毁该对象。
Throws | EJBException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

remove

void remove()
            throws RemoveException,
                   EJBException
Remove the EJB local object.

Throws:
RemoveException - The enterprise Bean or the container does not allow destruction of the object.
EJBException - Thrown when the method failed due to a system-level failure.

public boolean isIdentical(EJBLocalObject obj) throws EJBException
测试给定 EJB 本地对象是否与调用的 EJB 本地对象相同。
obj | 要与调用对象进行相等性测试的对象。
return | 如果给定 EJB 本地对象与调用对象相同，则返回 true；否则返回 false。
Throws | EJBException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

isIdentical

boolean isIdentical(EJBLocalObject obj)
                    throws EJBException
Test if a given EJB local object is identical to the invoked EJB local object.

Parameters:
obj - An object to test for identity with the invoked object.
Returns:
True if the given EJB local object is identical to the invoked object, false otherwise.
Throws:
EJBException - Thrown when the method failed due to a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBMetaData (Java EE 5)

javax.ejb
Interface EJBMetaData

public interface EJBMetaData

EJBMetaData 接口允许客户端获得企业 Bean 的元数据信息。

元数据用于让开发工具用来构建部属企业 Bean 的应用程序，让客户端使用脚本语言访问企业 Bean。

注意，EJBMetaData 不是远程接口。实现此接口的类（该类一般由容器工具生成）必须可序列化，并且必须是有效的 RMI/IDL 值类型。

英文文档：

The EJBMetaData interface allows a client to obtain the enterprise Bean's meta-data information.

The meta-data is intended for development tools used for building applications that use deployed enterprise Beans, and for clients using a scripting language to access the enterprise Bean.

Note that the EJBMetaData is not a remote interface. The class that implements this interface (this class is typically generated by container tools) must be serializable, and must be a valid RMI/IDL value type.

Method Summary
EJBHome | getEJBHome() Obtain the remote home interface of the enterprise Bean.
Class | getHomeInterfaceClass() Obtain the Class object for the enterprise Bean's remote home interface.
Class | getPrimaryKeyClass() Obtain the Class object for the enterprise Bean's primary key class.
Class | getRemoteInterfaceClass() Obtain the Class object for the enterprise Bean's remote interface.
boolean | isSession() Test if the enterprise Bean's type is "session".
boolean | isStatelessSession() Test if the enterprise Bean's type is "stateless session".

Method Detail

public EJBHome getEJBHome()
获得企业 Bean 的远程 home 接口。
return 企业 Bean 的远程 home 接口。
英文文档：

getEJBHome

EJBHome getEJBHome()
Obtain the remote home interface of the enterprise Bean.

Returns:
the remote home interface of the enterprise Bean.

public Class<T> getHomeInterfaceClass()
获得企业 Bean 远程 home 接口的 Class 对象。
return 企业 Bean 远程 home 接口的 Class 对象。
英文文档：

getHomeInterfaceClass

Class getHomeInterfaceClass()
Obtain the Class object for the enterprise Bean's remote home interface.

Returns:
the Class object for the enterprise Bean's remote home interface.

public Class<T> getRemoteInterfaceClass()
获得企业 Bean 远程接口的 Class 对象。
return 企业 Bean 远程接口的 Class 对象。
英文文档：

getRemoteInterfaceClass

Class getRemoteInterfaceClass()
Obtain the Class object for the enterprise Bean's remote interface.

Returns:
the Class object for the enterprise Bean's remote interface.

public Class<T> getPrimaryKeyClass()
获得企业 Bean 的主键类的 Class 对象。
return 企业 Bean 的主键类的 Class 对象。
英文文档：

getPrimaryKeyClass

Class getPrimaryKeyClass()
Obtain the Class object for the enterprise Bean's primary key class.

Returns:
the Class object for the enterprise Bean's primary key class.

public boolean isSession()
测试企业 Bean 的类型是否为“会话”。
return 如果企业 Bean 的类型为会话 Bean，则返回 true。
英文文档：

isSession

boolean isSession()
Test if the enterprise Bean's type is "session".

Returns:
True if the type of the enterprise Bean is session bean.

public boolean isStatelessSession()
测试企业 Bean 的类型是否是“无状态会话”。
return 如果企业 Bean 的类型为无状态会话，则返回 true。
英文文档：

isStatelessSession

boolean isStatelessSession()
Test if the enterprise Bean's type is "stateless session".

Returns:
True if the type of the enterprise Bean is stateless session.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBObject (Java EE 5)

javax.ejb
Interface EJBObject

All Superinterfaces:
Remote
All Known Subinterfaces:
Management
public interface EJBObject
extends Remote

Implements: java.rmi.Remote
Implemented by: Management

EJBObject 接口通过所有企业 Bean 的远程接口扩展。企业 Bean 的远程接口提供 EJB 对象的远程客户端视图。企业 Bean 的远程接口定义了远程客户端可调用的业务方法。

远程接口必须扩展 javax.ejb.EJBObject 接口，并且定义企业 Bean 特有的业务方法。

企业 Bean 的远程接口由企业 Bean 提供者定义，由企业 Bean 容器实现。

英文文档：

The EJBObject interface is extended by all enterprise Beans' remote interfaces. An enterprise Bean's remote interface provides the remote client view of an EJB object. An enterprise Bean's remote interface defines the business methods callable by a remote client.

The remote interface must extend the javax.ejb.EJBObject interface, and define the enterprise Bean specific business methods.

The enterprise Bean's remote interface is defined by the enterprise Bean provider and implemented by the enterprise Bean container.

Method Summary
EJBHome | getEJBHome() Obtain the enterprise Bean's remote home interface.
Handle | getHandle() Obtain a handle for the EJB object.
Object | getPrimaryKey() Obtain the primary key of the EJB object.
boolean | isIdentical(EJBObject obj) Test if a given EJB object is identical to the invoked EJB object.
void | remove() Remove the EJB object.

Method Detail

public EJBHome getEJBHome() throws java.rmi.RemoteException
获得企业 Bean 的远程 home 接口。远程 home 接口定义企业 Bean 的 create、finder、remove 和 home 业务方法。
return | 对企业 Bean 的 home 接口的引用。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

getEJBHome

EJBHome getEJBHome()
                   throws RemoteException
Obtain the enterprise Bean's remote home interface. The remote home interface defines the enterprise Bean's create, finder, remove, and home business methods.

Returns:
A reference to the enterprise Bean's home interface.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.

public Object getPrimaryKey() throws java.rmi.RemoteException
获得 EJB 对象的主键。

可以对实体 Bean 调用此方法。试图对会话 Bean 调用此方法将导致 RemoteException。

return | EJB 对象的主键。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败或对会话 Bean 调用此方法时抛出该异常。
英文文档：

getPrimaryKey

Object getPrimaryKey()
                     throws RemoteException
Obtain the primary key of the EJB object.

This method can be called on an entity bean. An attempt to invoke this method on a session bean will result in RemoteException.

Returns:
The EJB object's primary key.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure or when invoked on a session bean.

public void remove() throws java.rmi.RemoteException, RemoveException
移除 EJB 对象。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
Throws | RemoveException: 如果企业 Bean 或容器不允许销毁该对象。
英文文档：

remove

void remove()
            throws RemoteException,
                   RemoveException
Remove the EJB object.

Throws:
RemoteException - Thrown when the method failed due to a system-level failure.
RemoveException - The enterprise Bean or the container does not allow destruction of the object.

public Handle getHandle() throws java.rmi.RemoteException
获得 EJB 对象的句柄。句柄可以随后用于重新获得对 EJB 对象的引用，可能是在不同的 Java 虚拟机中。
return | EJB 对象的句柄。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

getHandle

Handle getHandle()
                 throws RemoteException
Obtain a handle for the EJB object. The handle can be used at later time to re-obtain a reference to the EJB object, possibly in a different Java Virtual Machine.

Returns:
A handle for the EJB object.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.

public boolean isIdentical(EJBObject obj) throws java.rmi.RemoteException
测试给定 EJB 对象与调用的 EJB 对象是否相同。
obj | 要与调用对象进行相等性测试的对象。
return | 如果给定 EJB 对象与调用对象相同，则返回 true；否则返回 false。
Throws | java.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档：

isIdentical

boolean isIdentical(EJBObject obj)
                    throws RemoteException
Test if a given EJB object is identical to the invoked EJB object.

Parameters:
obj - An object to test for identity with the invoked object.
Returns:
True if the given EJB object is identical to the invoked object, false otherwise.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EnterpriseBean (Java EE 5)

javax.ejb
Interface EnterpriseBean

All Superinterfaces:
Serializable
All Known Subinterfaces:
EntityBean, MessageDrivenBean, SessionBean
public interface EnterpriseBean
extends Serializable

Implements: java.io.Serializable
Implemented by: EntityBean, MessageDrivenBean, SessionBean

每个企业 Bean 类都必须实现 EnterpriseBean 接口。它是 SessionBean、EntityBean 和 MessageDrivenBean 接口的公共高级接口。
英文文档：

The EnterpriseBean interface must be implemented by every enterprise Bean class. It is a common superinterface for the SessionBean, EntityBean and MessageDrivenBean interfaces.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityBean (Java EE 5)

javax.ejb
Interface EntityBean

All Superinterfaces:
EnterpriseBean, Serializable
public interface EntityBean
extends EnterpriseBean

Implements: EnterpriseBean

EntityBean 接口由每个实体企业 Bean 类实现。容器使用 EntityBean 方法将实例的生命周期事件通知给企业 Bean 实例。
英文文档：

The EntityBean interface is implemented by every entity enterprise Bean class. The container uses the EntityBean methods to notify the enterprise Bean instances of the instance's life cycle events.

Method Summary
void | ejbActivate() A container invokes this method when the instance is taken out of the pool of available instances to become associated with a specific EJB object.
void | ejbLoad() A container invokes this method to instruct the instance to synchronize its state by loading it state from the underlying database.
void | ejbPassivate() A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object.
void | ejbRemove() A container invokes this method before it removes the EJB object that is currently associated with the instance.
void | ejbStore() A container invokes this method to instruct the instance to synchronize its state by storing it to the underlying database.
void | setEntityContext(EntityContext ctx) Set the associated entity context.
void | unsetEntityContext() Unset the associated entity context.

Method Detail

public void setEntityContext(EntityContext ctx) throws EJBException, java.rmi.RemoteException
设置相关实体上下文。容器在创建实例之后对实例调用此方法。

在未指定的事务上下文中调用此方法。

ctx | 实例的 EntityContext 接口。实例应该在实例变量中存储对上下文对象的引用。
Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

setEntityContext

void setEntityContext(EntityContext ctx)
                      throws EJBException,
                             RemoteException
Set the associated entity context. The container invokes this method on an instance after the instance has been created.

This method is called in an unspecified transaction context.

Parameters:
ctx - An EntityContext interface for the instance. The instance should store the reference to the context in an instance variable.
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void unsetEntityContext() throws EJBException, java.rmi.RemoteException
取消设置相关实体上下文。容器在移除实例之前调用此方法。

这是容器对实例调用的最后一个方法。Java 垃圾回收器最终将对实例调用 finalize() 方法。

在未指定的事务上下文中调用此方法。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

unsetEntityContext

void unsetEntityContext()
                        throws EJBException,
                               RemoteException
Unset the associated entity context. The container calls this method before removing the instance.

This is the last method that the container invokes on the instance. The Java garbage collector will eventually invoke the finalize() method on the instance.

This method is called in an unspecified transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbRemove() throws RemoveException, EJBException, java.rmi.RemoteException
容器在移除当前与实例关联的 EJB 对象之前调用此方法。当客户端对企业 Bean 的 home 接口或者 EJB 对象的远程接口调用移除操作时调用此方法。此方法将实例从准备状态转移至可用实例池中。

在移除操作的事务上下文中调用此方法。

Throws | RemoveException: 如果企业 Bean 不允许销毁该对象。
Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbRemove

void ejbRemove()
               throws RemoveException,
                      EJBException,
                      RemoteException
A container invokes this method before it removes the EJB object that is currently associated with the instance. This method is invoked when a client invokes a remove operation on the enterprise Bean's home interface or the EJB object's remote interface. This method transitions the instance from the ready state to the pool of available instances.

This method is called in the transaction context of the remove operation.

Throws:
RemoveException - The enterprise Bean does not allow destruction of the object.
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbActivate() throws EJBException, java.rmi.RemoteException
容器在实例从可用实例池中移出以使其与指定 EJB 对象关联时调用此方法。此方法将实例转换到准备状态。

在未指定的事务上下文中执行此方法。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbActivate

void ejbActivate()
                 throws EJBException,
                        RemoteException
A container invokes this method when the instance is taken out of the pool of available instances to become associated with a specific EJB object. This method transitions the instance to the ready state.

This method executes in an unspecified transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbPassivate() throws EJBException, java.rmi.RemoteException
容器在实例与特定 EJB 对象解除关联之前对实例调用此方法。此方法完成后，容器将实例放置于可用实例池中。

在未指定的事务上下文中执行此方法。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbPassivate

void ejbPassivate()
                  throws EJBException,
                         RemoteException
A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object. After this method completes, the container will place the instance into the pool of available instances.

This method executes in an unspecified transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbLoad() throws EJBException, java.rmi.RemoteException
容器调用此方法指示实例从底层数据库加载状态，以同步其状态。

此方法总是在部署描述符的事务属性值确定的事务上下文中执行。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbLoad

void ejbLoad()
             throws EJBException,
                    RemoteException
A container invokes this method to instruct the instance to synchronize its state by loading it state from the underlying database.

This method always executes in the transaction context determined by the value of the transaction attribute in the deployment descriptor.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbStore() throws EJBException, java.rmi.RemoteException
容器调用此方法指示实例通过将其状态存储到底层数据库来使其状态同步。

此方法总是在部署描述符的事务属性值确定的事务上下文中执行。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbStore

void ejbStore()
              throws EJBException,
                     RemoteException
A container invokes this method to instruct the instance to synchronize its state by storing it to the underlying database.

This method always executes in the transaction context determined by the value of the transaction attribute in the deployment descriptor.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityContext (Java EE 5)

javax.ejb
Interface EntityContext

All Superinterfaces:
EJBContext
public interface EntityContext
extends EJBContext

Implements: EJBContext

EntityContext 接口提供了一个实例来访问容器提供的实体企业 Bean 实例的运行时上下文。容器在实例创建后将 EntityContext 接口传递给实体企业 Bean 实例。

EntityContext 接口在实例的生命周期内保持与实例关联。注意实例使用 EntityContext 接口获得的信息（比如 getPrimaryKey() 方法的结果）可能会变化，因为容器在实例的生命周期内会将实例分配给不同的 EJB 对象。

英文文档：

The EntityContext interface provides an instance with access to the container-provided runtime context of an entity enterprise Bean instance. The container passes the EntityContext interface to an entity enterprise Bean instance after the instance has been created.

The EntityContext interface remains associated with the instance for the lifetime of the instance. Note that the information that the instance obtains using the EntityContext interface (such as the result of the getPrimaryKey() method) may change, as the container assigns the instance to different EJB objects during the instance's life cycle.

Method Summary
EJBLocalObject | getEJBLocalObject() Obtain a reference to the EJB local object that is currently associated with the instance.
EJBObject | getEJBObject() Obtain a reference to the EJB object that is currently associated with the instance.
Object | getPrimaryKey() Obtain the primary key of the EJB object that is currently associated with this instance.
Methods inherited from interface javax.ejb.EJBContext
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, isCallerInRole, lookup, setRollbackOnly

Method Detail

public EJBLocalObject getEJBLocalObject() throws IllegalStateException
获得对当前与实例关联的 EJB 本地对象的引用。

仅当实体企业 Bean 的实例与 EJB 本地对象身份关联时（即 ejbActivate、ejbPassivate、ejbPostCreate、ejbRemove、ejbLoad、ejbStore 和业务方法），它才可以调用此方法。

例如，如果实例希望在方法参数或结果中传递对本身的引用时，它可以使用此方法。

return | 当前与实例关联的 EJB 本地对象。
Throws | IllegalStateException: 如果在实例不允许调用此方法的情况下，或者实例没有本地接口的情况下调用此方法，则抛出该异常。
英文文档：

getEJBLocalObject

EJBLocalObject getEJBLocalObject()
                                 throws IllegalStateException
Obtain a reference to the EJB local object that is currently associated with the instance.

An instance of an entity enterprise Bean can call this method only when the instance is associated with an EJB local object identity, i.e. in the ejbActivate, ejbPassivate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore, and business methods.

An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.

Returns:
The EJB local object currently associated with the instance.
Throws:
IllegalStateException - if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method, or if the instance does not have a local interface.

public EJBObject getEJBObject() throws IllegalStateException
获得对当前与实例关联的 EJB 对象的引用。

仅当实体企业 Bean 的实例与 EJB 对象身份关联时（即 ejbActivate、ejbPassivate、ejbPostCreate、ejbRemove、ejbLoad、ejbStore 和业务方法），它才可以调用此方法。

例如，如果实例希望在方法参数或结果中传递对本身的引用时，它可以使用此方法。

return | 当前与实例关联的 EJB 对象。
Throws | IllegalStateException: 如果在实例不允许调用此方法的情况下，或者实例没有远程接口的情况下调用此方法，则抛出该异常。
英文文档：

getEJBObject

EJBObject getEJBObject()
                       throws IllegalStateException
Obtain a reference to the EJB object that is currently associated with the instance.

An instance of an entity enterprise Bean can call this method only when the instance is associated with an EJB object identity, i.e. in the ejbActivate, ejbPassivate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore, and business methods.

An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.

Returns:
The EJB object currently associated with the instance.
Throws:
IllegalStateException - Thrown if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method, or if the instance does not have a remote interface.

public Object getPrimaryKey() throws IllegalStateException
获得当前与实例关联的 EJB 对象的主键。

仅当实体企业 Bean 的实例与 EJB 对象身份关联时（即 ejbActivate、ejbPassivate、ejbPostCreate、ejbRemove、ejbLoad、ejbStore 和业务方法），它才可以调用此方法。

注：此方法的结果与 getEJBObject().getPrimaryKey() 的结果相同。

return | 当前与实例关联的主键。
Throws | IllegalStateException: 如果在实例不允许调用此方法的情况下调用此方法，则抛出该异常。
英文文档：

getPrimaryKey

Object getPrimaryKey()
                     throws IllegalStateException
Obtain the primary key of the EJB object that is currently associated with this instance.

An instance of an entity enterprise Bean can call this method only when the instance is associated with an EJB object identity, i.e. in the ejbActivate, ejbPassivate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore, and business methods.

Note: The result of this method is that same as the result of getEJBObject().getPrimaryKey().

Returns:
The primary key currently associated with the instance.
Throws:
IllegalStateException - Thrown if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Handle (Java EE 5)

javax.ejb
Interface Handle

All Superinterfaces:
Serializable
public interface Handle
extends Serializable

Implements: java.io.Serializable

Handle 接口由所有 EJB 对象句柄实现。句柄是对 EJB 对象网络引用的抽象。句柄将用作对 EJB 对象“健壮的”持久引用。
英文文档：

The Handle interface is implemented by all EJB object handles. A handle is an abstraction of a network reference to an EJB object. A handle is intended to be used as a "robust" persistent reference to an EJB object.

Method Summary
 EJBObject getEJBObject()
Obtain the EJB object reference represented by this handle.

Method Detail

public EJBObject getEJBObject() throws java.rmi.RemoteException
获得此句柄表示的 EJB 对象引用。
return | 此句柄表示的 EJB 对象引用。
Throws | java.rmi.RemoteException: 由于系统级失败无法获得 EJB 对象。
英文文档：

getEJBObject

EJBObject getEJBObject()
                       throws RemoteException
Obtain the EJB object reference represented by this handle.

Returns:
the EJB object reference represented by this handle.
Throws:
RemoteException - The EJB object could not be obtained because of a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HomeHandle (Java EE 5)

javax.ejb
Interface HomeHandle

All Superinterfaces:
Serializable
public interface HomeHandle
extends Serializable

Implements: java.io.Serializable

HomeHandle 接口由所有 home 对象句柄实现。句柄是对 home 对象网络引用的抽象。句柄将用作对 home 对象“健壮的”持久引用。
英文文档：

The HomeHandle interface is implemented by all home object handles. A handle is an abstraction of a network reference to a home object. A handle is intended to be used as a "robust" persistent reference to a home object.

Method Summary
 EJBHome getEJBHome()
Obtain the home object represented by this handle.

Method Detail

public EJBHome getEJBHome() throws java.rmi.RemoteException
获得此句柄表示的 home 对象。
return | 此句柄表示的 home 对象。
Throws | java.rmi.RemoteException: 由于系统级失败无法获得 home 对象。
英文文档：

getEJBHome

EJBHome getEJBHome()
                   throws RemoteException
Obtain the home object represented by this handle.

Returns:
the home object represented by this handle.
Throws:
RemoteException - The home object could not be obtained because of a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageDrivenBean (Java EE 5)

javax.ejb
Interface MessageDrivenBean

All Superinterfaces:
EnterpriseBean, Serializable
public interface MessageDrivenBean
extends EnterpriseBean

Implements: EnterpriseBean

MessageDrivenBean 由每个消息驱动企业 Bean 类实现。容器使用 MessageDrivenBean 方法将实例的生命周期事件通知给企业 Bean 实例。
英文文档：

The MessageDrivenBean interface is implemented by every message-driven enterprise Bean class. The container uses the MessageDrivenBean methods to notify the enterprise Bean instances of the instance's life cycle events.

Method Summary
void | ejbRemove() A container invokes this method before it ends the life of the message-driven object.
void | setMessageDrivenContext(MessageDrivenContext ctx) Set the associated message-driven context.

Method Detail

public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException
设置相关消息驱动上下文。容器在创建实例之后调用此方法。

企业 Bean 实例应该在实例变量中存储对上下文对象的引用。

在无事务上下文的情况下调用此方法。

ctx | 实例的 MessageDrivenContext 接口。
Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
英文文档：

setMessageDrivenContext

void setMessageDrivenContext(MessageDrivenContext ctx)
                             throws EJBException
Set the associated message-driven context. The container calls this method after the instance creation.

The enterprise Bean instance should store the reference to the context object in an instance variable.

This method is called with no transaction context.

Parameters:
ctx - A MessageDrivenContext interface for the instance.
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.

public void ejbRemove() throws EJBException
容器在结束消息驱动对象生命周期之前调用此方法。这在容器决定终止消息驱动对象时发生。

在无事务上下文的情况下调用此方法。

Throws EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
英文文档：

ejbRemove

void ejbRemove()
               throws EJBException
A container invokes this method before it ends the life of the message-driven object. This happens when a container decides to terminate the message-driven object.

This method is called with no transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageDrivenContext (Java EE 5)

javax.ejb
Interface MessageDrivenContext

All Superinterfaces:
EJBContext
public interface MessageDrivenContext
extends EJBContext

Implements: EJBContext

MessageDrivenContext 接口提供对容器为消息驱动企业 Bean 实例提供的运行时消息驱动上下文的访问。容器在实例创建后将 MessageDrivenContext 接口传递给实例。消息驱动上下文在实例的生命周期内保持与实例关联。
英文文档：

The MessageDrivenContext interface provides access to the runtime message-driven context that the container provides for a message-driven enterprise Bean instance. The container passes the MessageDrivenContext interface to an instance after the instance has been created. The message-driven context remains associated with the instance for the lifetime of the instance.

Method Summary
Methods inherited from interface javax.ejb.EJBContext
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, isCallerInRole, lookup, setRollbackOnly

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionBean (Java EE 5)

javax.ejb
Interface SessionBean

All Superinterfaces:
EnterpriseBean, Serializable
public interface SessionBean
extends EnterpriseBean

Implements: EnterpriseBean

SessionBean 接口由每个会话企业 Bean 类实现。容器使用 SessionBean 方法将实例的生命周期事件通知给企业 Bean 实例。
英文文档：

The SessionBean interface is implemented by every session enterprise Bean class. The container uses the SessionBean methods to notify the enterprise Bean instances of the instance's life cycle events.

Method Summary
void | ejbActivate() The activate method is called when the instance is activated from its "passive" state.
void | ejbPassivate() The passivate method is called before the instance enters the "passive" state.
void | ejbRemove() A container invokes this method before it ends the life of the session object.
void | setSessionContext(SessionContext ctx) Set the associated session context.

Method Detail

public void setSessionContext(SessionContext ctx) throws EJBException, java.rmi.RemoteException
设置相关会话上下文。容器在创建实例之后调用此方法。

企业 Bean 实例应该在实例变量中存储对上下文对象的引用。

在无事务上下文的情况下调用此方法。

ctx | 实例的 SessionContext 接口。
Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的应用程序的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

setSessionContext

void setSessionContext(SessionContext ctx)
                       throws EJBException,
                              RemoteException
Set the associated session context. The container calls this method after the instance creation.

The enterprise Bean instance should store the reference to the context object in an instance variable.

This method is called with no transaction context.

Parameters:
ctx - A SessionContext interface for the instance.
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for applications written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbRemove() throws EJBException, java.rmi.RemoteException
容器在结束会话对象生命周期之前调用此方法。这在客户端调用移除操作，或者容器决定在超时后终止会话对象时发生。

在无事务上下文的情况下调用此方法。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbRemove

void ejbRemove()
               throws EJBException,
                      RemoteException
A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout.

This method is called with no transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbActivate() throws EJBException, java.rmi.RemoteException
将实例从“钝化”状态激活时，调用该激活方法。实例应获得之前在 ejbPassivate() 方法中释放的所有资源。

在无事务上下文的情况下调用此方法。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbActivate

void ejbActivate()
                 throws EJBException,
                        RemoteException
The activate method is called when the instance is activated from its "passive" state. The instance should acquire any resource that it has released earlier in the ejbPassivate() method.

This method is called with no transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.

public void ejbPassivate() throws EJBException, java.rmi.RemoteException
在实例进入“钝化”状态之前调用该钝化方法。实例应释放它稍后可以在 ejbActivate() 方法中重新获得的所有资源。

钝化方法完成后，实例必须处于允许容器使用 Java 序列化协议来具体化和存储实例状态的状态。

在无事务上下文的情况下调用此方法。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB2.0 及更高规范编写的企业 Bean 必须抛出 javax.ejb.EJBException，而不是此异常。
英文文档：

ejbPassivate

void ejbPassivate()
                  throws EJBException,
                         RemoteException
The passivate method is called before the instance enters the "passive" state. The instance should release any resources that it can re-acquire later in the ejbActivate() method.

After the passivate method completes, the instance must be in a state that allows the container to use the Java Serialization protocol to externalize and store away the instance's state.

This method is called with no transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionContext (Java EE 5)

javax.ejb
Interface SessionContext

All Superinterfaces:
EJBContext
public interface SessionContext
extends EJBContext

Implements: EJBContext

SessionContext 接口提供对容器为会话企业 Bean 实例提供的运行时会话上下文的访问。容器在实例创建后将 SessionContext 接口传递给实例。会话上下文在实例的生命周期内保持与实例关联。
英文文档：

The SessionContext interface provides access to the runtime session context that the container provides for a session enterprise Bean instance. The container passes the SessionContext interface to an instance after the instance has been created. The session context remains associated with the instance for the lifetime of the instance.

Method Summary
<T> T
getBusinessObject(Class<T> businessInterface)
Obtain an object that can be used to invoke the current bean through the given business interface.
 EJBLocalObject getEJBLocalObject()
Obtain a reference to the EJB local object that is associated with the instance.
 EJBObject getEJBObject()
Obtain a reference to the EJB object that is currently associated with the instance.
 Class getInvokedBusinessInterface()
Obtain the business interface through which the current business method invocation was made.
 MessageContext getMessageContext()
Obtain a reference to the JAX-RPC MessageContext.
Methods inherited from interface javax.ejb.EJBContext
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, isCallerInRole, lookup, setRollbackOnly

Method Detail

public EJBLocalObject getEJBLocalObject() throws IllegalStateException
获得对与实例关联的 EJB 本地对象的引用。

会话企业 Bean 的实例可以在 ejbCreate() 和 ejbRemove() 方法之间（包括从 ejbCreate() 和 ejbRemove() 方法内）随时调用此方法。

例如，如果实例希望在方法参数或结果中传递对本身的引用时，它可以使用此方法。

return | 当前与实例关联的 EJB 本地对象。
Throws | IllegalStateException: 如果在实例不允许调用此方法的情况下，或者实例没有本地接口的情况下调用此方法，则抛出该异常。
英文文档：

getEJBLocalObject

EJBLocalObject getEJBLocalObject()
                                 throws IllegalStateException
Obtain a reference to the EJB local object that is associated with the instance.

An instance of a session enterprise Bean can call this method at anytime between the ejbCreate() and ejbRemove() methods, including from within the ejbCreate() and ejbRemove() methods.

An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.

Returns:
The EJB local object currently associated with the instance.
Throws:
IllegalStateException - Thrown if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method, or if the instance does not have a local interface.

public EJBObject getEJBObject() throws IllegalStateException
获得对当前与实例关联的 EJB 对象的引用。

会话企业 Bean 的实例可以在 ejbCreate() 和 ejbRemove() 方法之间（包括从 ejbCreate() 和 ejbRemove() 方法内）随时调用此方法。

例如，如果实例希望在方法参数或结果中传递对本身的引用时，它可以使用此方法。

return | 当前与实例关联的 EJB 对象。
Throws | IllegalStateException: 如果在实例不允许调用此方法的情况下，或者实例没有远程接口的情况下调用此方法，则抛出该异常。
英文文档：

getEJBObject

EJBObject getEJBObject()
                       throws IllegalStateException
Obtain a reference to the EJB object that is currently associated with the instance.

An instance of a session enterprise Bean can call this method at anytime between the ejbCreate() and ejbRemove() methods, including from within the ejbCreate() and ejbRemove() methods.

An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.

Returns:
The EJB object currently associated with the instance.
Throws:
IllegalStateException - Thrown if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method, or if the instance does not have a remote interface.

public MessageContext getMessageContext() throws IllegalStateException
获得对 JAX-RPC MessageContext 的引用。

无状态会话 Bean 的实例可以从任何通过其 Web 服务端点接口调用的业务方法中调用此方法。

return | 此 Web 服务调用的 MessageContext。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法，则抛出此异常。
英文文档：

getMessageContext

MessageContext getMessageContext()
                                 throws IllegalStateException
Obtain a reference to the JAX-RPC MessageContext.

An instance of a stateless session bean can call this method from any business method invoked through its web service endpoint interface.

Returns:
The MessageContext for this web service invocation.
Throws:
IllegalStateException - Thrown if this method is invoked while the instance is in a state that does not allow access to this method.

英文文档：

getBusinessObject

<T> T getBusinessObject(Class<T> businessInterface)
                    throws IllegalStateException
Obtain an object that can be used to invoke the current bean through the given business interface.

Parameters:
businessInterface - One of the local business interfaces or remote business interfaces for this session bean.
Returns:
The business object corresponding to the given business interface.
Throws:
IllegalStateException - Thrown if this method is invoked with an invalid business interface for the current bean.

public Class<T> getInvokedBusinessInterface() throws IllegalStateException
获得用于当前业务方法调用的业务接口。
Throws IllegalStateException: 如果调用此方法时还未通过业务接口调用 Bean，则抛出此异常。
英文文档：

getInvokedBusinessInterface

Class getInvokedBusinessInterface()
                                  throws IllegalStateException
Obtain the business interface through which the current business method invocation was made.

Throws:
IllegalStateException - Thrown if this method is called and the bean has not been invoked through a business interface.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionSynchronization (Java EE 5)

javax.ejb
Interface SessionSynchronization

public interface SessionSynchronization

SessionSynchronization 接口允许会话 Bean 实例接收其容器关于事务边界的通知。

会话 Bean 类不需要实现此接口。只有在会话 Bean 类希望将其状态与事务同步时才应实现此接口。

英文文档：

The SessionSynchronization interface allows a session Bean instance to be notified by its container of transaction boundaries.

An session Bean class is not required to implement this interface. A session Bean class should implement this interface only if it wishes to synchronize its state with the transactions.

Method Summary
void | afterBegin() The afterBegin method notifies a session Bean instance that a new transaction has started, and that the subsequent business methods on the instance will be invoked in the context of the transaction.
void | afterCompletion(boolean committed) The afterCompletion method notifies a session Bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back.
void | beforeCompletion() The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed.

Method Detail

public void afterBegin() throws EJBException, java.rmi.RemoteException
afterBegin 方法通知会话 Bean 实例新事务已开始，并且将在事务上下文中调用该实例的后续业务方法。

例如，实例可以使用此方法从数据库中读取数据并在实例字段中缓存数据。

在恰当的事务上下文中执行此方法。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 及更高规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB 2.0 及更高规范编写的企业 Bean 不得抛出 java.rmi.RemoteException。
英文文档：

afterBegin

void afterBegin()
                throws EJBException,
                       RemoteException
The afterBegin method notifies a session Bean instance that a new transaction has started, and that the subsequent business methods on the instance will be invoked in the context of the transaction.

The instance can use this method, for example, to read data from a database and cache the data in the instance fields.

This method executes in the proper transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 and higher specifications should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB 2.0 and higher specifications must not throw the java.rmi.RemoteException.

public void beforeCompletion() throws EJBException, java.rmi.RemoteException
beforeCompletion 方法通知会话 Bean 实例事务即将提交。例如，实例可以使用此方法将任何缓存数据写入数据库。

在恰当的事务上下文中执行此方法。

注：实例可能仍会通过在实例上下文中调用 setRollbackOnly() 方法或者通过抛出异常导致容器回滚事务。

Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 及更高规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB 2.0 及更高规范编写的企业 Bean 不得抛出 java.rmi.RemoteException。
英文文档：

beforeCompletion

void beforeCompletion()
                      throws EJBException,
                             RemoteException
The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed. The instance can use this method, for example, to write any cached data to a database.

This method executes in the proper transaction context.

Note: The instance may still cause the container to rollback the transaction by invoking the setRollbackOnly() method on the instance context, or by throwing an exception.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 and higher specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB 2.0 and higher specifications must not throw the java.rmi.RemoteException.

public void afterCompletion(boolean committed) throws EJBException, java.rmi.RemoteException
afterCompletion 方法通知会话 Bean 实例事务提交协议已完成，并告知实例事务是已提交还是已回滚。

在无事务上下文的情况下执行此方法。

在无事务上下文的情况下执行此方法。

committed | 如果事务已提交则返回 true，如果事务已回滚则返回 false。
Throws | EJBException: 该方法抛出此异常指示由于系统级错误导致的失败。
Throws | java.rmi.RemoteException: 此异常在方法签名中定义，以提供对根据 EJB 1.0 规范编写的企业 Bean 的向后兼容。根据 EJB 1.1 及更高规范编写的企业 Bean 应该抛出 javax.ejb.EJBException，而不是此异常。根据 EJB 2.0 及更高规范编写的企业 Bean 不得抛出 java.rmi.RemoteException。
英文文档：

afterCompletion

void afterCompletion(boolean committed)
                     throws EJBException,
                            RemoteException
The afterCompletion method notifies a session Bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back.

This method executes with no transaction context.

This method executes with no transaction context.

Parameters:
committed - True if the transaction has been committed, false if is has been rolled back.
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 and higher specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB 2.0 and higher specifications must not throw the java.rmi.RemoteException.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimedObject (Java EE 5)

javax.ejb
Interface TimedObject

public interface TimedObject

TimedObject 接口包含用于传送计时器过期通知的回调方法。它由实体 Bean 或无状态会话 Bean 或消息驱动 Bean 类实现。
英文文档：

The TimedObject interface contains the callback method that is used to deliver timer expiration notifications. It is implemented by an entity bean or stateless session bean or message-driven bean class.

Method Summary
 void ejbTimeout(Timer timer)
Invoked by the EJB container upon timer expiration.

Method Detail

public void ejbTimeout(Timer timer)
在计时器过期时由 EJB 容器调用。
timer 其过期导致此通知的计时器。
英文文档：

ejbTimeout

void ejbTimeout(Timer timer)
Invoked by the EJB container upon timer expiration.

Parameters:
timer - timer whose expiration caused this notification.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Timer (Java EE 5)

javax.ejb
Interface Timer

public interface Timer

Timer 接口包含有关通过 EJB Timer Service 创建的计时器的信息。
英文文档：

The Timer interface contains information about a timer that was created through the EJB Timer Service.

Method Summary
void | cancel() Cause the timer and all its associated expiration notifications to be cancelled.
TimerHandle | getHandle() Get a serializable handle to the timer.
Serializable | getInfo() Get the information associated with the timer at the time of creation.
Date | getNextTimeout() Get the point in time at which the next timer expiration is scheduled to occur.
long | getTimeRemaining() Get the number of milliseconds that will elapse before the next scheduled timer expiration.

Method Detail

public void cancel() throws IllegalStateException, NoSuchObjectLocalException, EJBException
导致删除计时器及其所有相关过期通知。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

cancel

void cancel()
            throws IllegalStateException,
                   NoSuchObjectLocalException,
                   EJBException
Cause the timer and all its associated expiration notifications to be cancelled.

Throws:
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired or has been cancelled.
EJBException - If this method could not complete due to a system-level failure.

public long getTimeRemaining() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得下一个已安排的计时器过期之前要经历的毫秒数。
return | 下一个已安排的计时器过期之前要经历的毫秒数。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

getTimeRemaining

long getTimeRemaining()
                      throws IllegalStateException,
                             NoSuchObjectLocalException,
                             EJBException
Get the number of milliseconds that will elapse before the next scheduled timer expiration.

Returns:
the number of milliseconds that will elapse before the next scheduled timer expiration.
Throws:
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired or has been cancelled.
EJBException - If this method could not complete due to a system-level failure.

public java.util.Date getNextTimeout() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得下一个计时器过期计划发生的时间点。
return | 下一个计时器过期计划发生的时间点。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

getNextTimeout

Date getNextTimeout()
                    throws IllegalStateException,
                           NoSuchObjectLocalException,
                           EJBException
Get the point in time at which the next timer expiration is scheduled to occur.

Returns:
the point in time at which the next timer expiration is scheduled to occur.
Throws:
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired or has been cancelled.
EJBException - If this method could not complete due to a system-level failure.

public java.io.Serializable getInfo() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得计时器创建时，与计时器相关的信息。
return | 在计时器创建时传入的 Serializable 对象；如果在计时器创建时传入的 info 参数为 null，则返回 null。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

getInfo

Serializable getInfo()
                     throws IllegalStateException,
                            NoSuchObjectLocalException,
                            EJBException
Get the information associated with the timer at the time of creation.

Returns:
The Serializable object that was passed in at timer creation, or null if the info argument passed in at timer creation was null.
Throws:
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired or has been cancelled.
EJBException - If this method could not complete due to a system-level failure.

public TimerHandle getHandle() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得计时器的可序列化句柄。此句柄可用于以后重新获得计时器引用。
return | 计时器的可序列化句柄。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | NoSuchObjectLocalException: 如果对已经过期或删除的计时器调用此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

getHandle

TimerHandle getHandle()
                      throws IllegalStateException,
                             NoSuchObjectLocalException,
                             EJBException
Get a serializable handle to the timer. This handle can be used at a later time to re-obtain the timer reference.

Returns:
a serializable handle to the timer.
Throws:
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired or has been cancelled.
EJBException - If this method could not complete due to a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimerHandle (Java EE 5)

javax.ejb
Interface TimerHandle

All Superinterfaces:
Serializable
public interface TimerHandle
extends Serializable

Implements: java.io.Serializable

TimerHandle 接口由所有 EJB 计时器句柄实现。
英文文档：

The TimerHandle interface is implemented by all EJB timer handles.

Method Summary
 Timer getTimer()
Obtain a reference to the timer represented by this handle.

Method Detail

public Timer getTimer() throws IllegalStateException, NoSuchObjectLocalException, EJBException
获得对此句柄表示的计时器的引用。
return | 对此句柄表示的计时器的引用。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | NoSuchObjectLocalException: 如果对其相关计时器已经过期或删除的句柄调用此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

getTimer

Timer getTimer()
               throws IllegalStateException,
                      NoSuchObjectLocalException,
                      EJBException
Obtain a reference to the timer represented by this handle.

Returns:
a reference to the timer represented by this handle.
Throws:
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
NoSuchObjectLocalException - If invoked on a handle whose associated timer has expired or has been cancelled.
EJBException - If this method could not complete due to a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimerService (Java EE 5)

javax.ejb
Interface TimerService

public interface TimerService

TimerService 接口为企业 Bean 组件提供对容器提供的 Timer Service 的访问。EJB Timer Service 允许实体 Bean、无状态会话 Bean 和消息驱动 Bean 注册在指定时间、在指定时间经过后，或在指定间隔后的计时器回调事件。
英文文档：

The TimerService interface provides enterprise bean components with access to the container-provided Timer Service. The EJB Timer Service allows entity beans, stateless session beans, and message-driven beans to be registered for timer callback events at a specified time, after a specified elapsed time, or after a specified interval.

Method Summary
Timer | createTimer(Date initialExpiration, long intervalDuration, Serializable info) Create an interval timer whose first expiration occurs at a given point in time and whose subsequent expirations occur after a specified interval.
Timer | createTimer(Date expiration, Serializable info) Create a single-action timer that expires at a given point in time.
Timer | createTimer(long initialDuration, long intervalDuration, Serializable info) Create an interval timer whose first expiration occurs after a specified duration, and whose subsequent expirations occur after a specified interval.
Timer | createTimer(long duration, Serializable info) Create a single-action timer that expires after a specified duration.
Collection | getTimers() Get all the active timers associated with this bean.

Method Detail

public Timer createTimer(long duration, java.io.Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
创建在指定时间段后过期的单个操作计时器。
duration | 计时器过期之前必须经历的毫秒数。
info | 要随计时器过期通知一起传送的应用程序信息。此参数可以为 null。
return | 新建的 Timer。
Throws | IllegalArgumentException: 如果 duration 为负。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | EJBException: 如果此方法由于系统级失败而失败。
英文文档：

createTimer

Timer createTimer(long duration,
                  Serializable info)
                  throws IllegalArgumentException,
                         IllegalStateException,
                         EJBException
Create a single-action timer that expires after a specified duration.

Parameters:
duration - The number of milliseconds that must elapse before the timer expires.
info - Application information to be delivered along with the timer expiration notification. This can be null.
Returns:
The newly created Timer.
Throws:
IllegalArgumentException - If duration is negative
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
EJBException - If this method fails due to a system-level failure.

public Timer createTimer(long initialDuration, long intervalDuration, java.io.Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
创建间隔计时器，其第一次过期发生在指定时间段后，其后续过期发生在指定间隔后。
initialDuration | 第一次计时器过期通知之前必须经历的毫秒数。
intervalDuration | 计时器过期通知之间必须经历的毫秒数。过期通知相对于第一次过期的时间进行安排。如果过期延迟（例如，由于与 Bean 上的其他方法调用交错），则可能会有两个或两个以上的过期通知接连出现以“赶上”延迟的时间。
info | 要随计时器过期一起传送的应用程序信息。此参数可以为 null。
return | 新建的 Timer。
Throws | IllegalArgumentException: 如果 initialDuration 为负，或者 intervalDuration 为负。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

createTimer

Timer createTimer(long initialDuration,
                  long intervalDuration,
                  Serializable info)
                  throws IllegalArgumentException,
                         IllegalStateException,
                         EJBException
Create an interval timer whose first expiration occurs after a specified duration, and whose subsequent expirations occur after a specified interval.

Parameters:
initialDuration - The number of milliseconds that must elapse before the first timer expiration notification.
intervalDuration - The number of milliseconds that must elapse between timer expiration notifications. Expiration notifications are scheduled relative to the time of the first expiration. If expiration is delayed(e.g. due to the interleaving of other method calls on the bean) two or more expiration notifications may occur in close succession to "catch up".
info - Application information to be delivered along with the timer expiration. This can be null.
Returns:
The newly created Timer.
Throws:
IllegalArgumentException - If initialDuration is negative, or intervalDuration is negative.
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
EJBException - If this method could not complete due to a system-level failure.

public Timer createTimer(java.util.Date expiration, java.io.Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
创建在给定时间点过期的单个动作计时器。
expiration | 计时器必须过期的时间点。
info | 要随计时器过期通知一起传送的应用程序信息。此参数可以为 null。
return | 新建的 Timer。
Throws | IllegalArgumentException: 如果 expiration 为 null，或者 expiration.getTime() 为负。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

createTimer

Timer createTimer(Date expiration,
                  Serializable info)
                  throws IllegalArgumentException,
                         IllegalStateException,
                         EJBException
Create a single-action timer that expires at a given point in time.

Parameters:
expiration - The point in time at which the timer must expire.
info - Application information to be delivered along with the timer expiration notification. This can be null.
Returns:
The newly created Timer.
Throws:
IllegalArgumentException - If expiration is null, or expiration.getTime() is negative.
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
EJBException - If this method could not complete due to a system-level failure.

public Timer createTimer(java.util.Date initialExpiration, long intervalDuration, java.io.Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
创建间隔计时器，其第一次过期发生在给定时间点，其后续过期发生在指定间隔后。
initialExpiration | 第一次计时器过期必须发生的时间点。
intervalDuration | 计时器过期通知之间必须经历的毫秒数。过期通知相对于第一次过期的时间进行安排。如果过期延迟（例如，由于与 Bean 上的其他方法调用交错），则可能会有两个或两个以上的过期通知接连出现以“赶上”延迟的时间。
info | 要随计时器过期一起传送的应用程序信息。此参数可以为 null。
return | 新建的 Timer。
Throws | IllegalArgumentException: 如果 initialExpiration 为 null，或者 initialExpiration.getTime() 为负，或者 intervalDuration 为负。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

createTimer

Timer createTimer(Date initialExpiration,
                  long intervalDuration,
                  Serializable info)
                  throws IllegalArgumentException,
                         IllegalStateException,
                         EJBException
Create an interval timer whose first expiration occurs at a given point in time and whose subsequent expirations occur after a specified interval.

Parameters:
initialExpiration - The point in time at which the first timer expiration must occur.
intervalDuration - The number of milliseconds that must elapse between timer expiration notifications. Expiration notifications are scheduled relative to the time of the first expiration. If expiration is delayed(e.g. due to the interleaving of other method calls on the bean) two or more expiration notifications may occur in close succession to "catch up".
info - Application information to be delivered along with the timer expiration. This can be null.
Returns:
The newly created Timer.
Throws:
IllegalArgumentException - If initialExpiration is null, or initialExpiration.getTime() is negative, or intervalDuration is negative.
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
EJBException - If this method could not complete due to a system-level failure.

public java.util.Collection<E> getTimers() throws IllegalStateException, EJBException
获得与此 Bean 相关的所有活动计时器。
return | javax.ejb.Timer 对象的集合。
Throws | IllegalStateException: 如果在实例不允许访问此方法的情况下调用了此方法。
Throws | EJBException: 如果此方法由于系统级失败而无法完成。
英文文档：

getTimers

Collection getTimers()
                     throws IllegalStateException,
                            EJBException
Get all the active timers associated with this bean.

Returns:
A collection of javax.ejb.Timer objects.
Throws:
IllegalStateException - If this method is invoked while the instance is in a state that does not allow access to this method.
EJBException - If this method could not complete due to a system-level failure.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionAttributeType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.ejb
Enum TransactionAttributeType

java.lang.Object
    extended by  java.lang.Enum<TransactionAttributeType>
        extended by  javax.ejb.TransactionAttributeType
All Implemented Interfaces:
Serializable, Comparable<TransactionAttributeType>
public enum TransactionAttributeType
extends Enum<TransactionAttributeType>

Extends: Enum<E>

英文文档：

Enum Constant Summary
MANDATORY
NEVER
NOT_SUPPORTED
REQUIRED
REQUIRES_NEW
SUPPORTS
Method Summary
static TransactionAttributeType | valueOf(String name) Returns the enum constant of this type with the specified name.
static TransactionAttributeType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

MANDATORY

public static final TransactionAttributeType MANDATORY

英文文档：

REQUIRED

public static final TransactionAttributeType REQUIRED

英文文档：

REQUIRES_NEW

public static final TransactionAttributeType REQUIRES_NEW

英文文档：

SUPPORTS

public static final TransactionAttributeType SUPPORTS

英文文档：

NOT_SUPPORTED

public static final TransactionAttributeType NOT_SUPPORTED

英文文档：

NEVER

public static final TransactionAttributeType NEVER
Method Detail

final public static TransactionAttributeType[] values()
英文文档：

values

public static final TransactionAttributeType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(TransactionAttributeType c : TransactionAttributeType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static TransactionAttributeType valueOf(String name)
英文文档：

valueOf

public static TransactionAttributeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


TransactionManagementType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.ejb
Enum TransactionManagementType

java.lang.Object
    extended by  java.lang.Enum<TransactionManagementType>
        extended by  javax.ejb.TransactionManagementType
All Implemented Interfaces:
Serializable, Comparable<TransactionManagementType>
public enum TransactionManagementType
extends Enum<TransactionManagementType>

Extends: Enum<E>

英文文档：

Enum Constant Summary
BEAN
CONTAINER
Method Summary
static TransactionManagementType | valueOf(String name) Returns the enum constant of this type with the specified name.
static TransactionManagementType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

CONTAINER

public static final TransactionManagementType CONTAINER

英文文档：

BEAN

public static final TransactionManagementType BEAN
Method Detail

final public static TransactionManagementType[] values()
英文文档：

values

public static final TransactionManagementType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(TransactionManagementType c : TransactionManagementType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static TransactionManagementType valueOf(String name)
英文文档：

valueOf

public static TransactionManagementType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


AccessLocalException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.ejb
Class AccessLocalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.AccessLocalException
All Implemented Interfaces:
Serializable
public class AccessLocalException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

抛出 AccessLocalException 指示调用者没有调用该方法的权限。此异常向本地客户端抛出。
英文文档：

An AccessLocalException is thrown to indicate that the caller does not have permission to call the method. This exception is thrown to local clients.

See Also:
Serialized Form

Constructor Summary
AccessLocalException()
Constructs an AccessLocalException with no detail message.
AccessLocalException(String message)
Constructs an AccessLocalException with the specified detail message.
AccessLocalException(String message, Exception ex)
Constructs an AccessLocalException with the specified detail message and a nested exception.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public AccessLocalException()
构造不带详细消息的 AccessLocalException。
英文文档：

AccessLocalException

public AccessLocalException()
Constructs an AccessLocalException with no detail message.

public AccessLocalException(String message)
构造带指定详细消息的 AccessLocalException。
英文文档：

AccessLocalException

public AccessLocalException(String message)
Constructs an AccessLocalException with the specified detail message.

public AccessLocalException(String message, Exception ex)
构造带指定详细消息和嵌入异常的 AccessLocalException。
英文文档：

AccessLocalException

public AccessLocalException(String message,
                            Exception ex)
Constructs an AccessLocalException with the specified detail message and a nested exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConcurrentAccessException (Java EE 5)

javax.ejb
Class ConcurrentAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.ConcurrentAccessException
All Implemented Interfaces:
Serializable
public class ConcurrentAccessException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

ConcurrentAccessException 指示客户端在另一个调用正在进行时尝试调用有状态会话 Bean。
英文文档：

A ConcurrentAccessException indicates that the client has attempted an invocation on a stateful session bean while another invocation is in progress.

See Also:
Serialized Form

Constructor Summary
ConcurrentAccessException()
Constructs an ConcurrentAccessException with no detail message.
ConcurrentAccessException(String message)
Constructs an ConcurrentAccessException with the specified detailed message.
ConcurrentAccessException(String message, Exception ex)
Constructs an ConcurrentAccessException with the specified detail message and a nested exception.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ConcurrentAccessException()
构造不带详细消息的 ConcurrentAccessException。
英文文档：

ConcurrentAccessException

public ConcurrentAccessException()
Constructs an ConcurrentAccessException with no detail message.

public ConcurrentAccessException(String message)
构造带指定详细消息的 ConcurrentAccessException。
英文文档：

ConcurrentAccessException

public ConcurrentAccessException(String message)
Constructs an ConcurrentAccessException with the specified detailed message.

public ConcurrentAccessException(String message, Exception ex)
构造带指定详细消息和嵌入异常的 ConcurrentAccessException。
英文文档：

ConcurrentAccessException

public ConcurrentAccessException(String message,
                                 Exception ex)
Constructs an ConcurrentAccessException with the specified detail message and a nested exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CreateException (Java EE 5)

javax.ejb
Class CreateException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.ejb.CreateException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DuplicateKeyException
public class CreateException
extends Exception

Extends: Throwable > Exception
Extended by: DuplicateKeyException

企业 Bean 的 home 接口中定义的所有创建方法的 throws 子句都必须包含 CreateException 异常。

此异常用作标准应用程序级异常，报告创建 EJB 对象失败。

英文文档：

The CreateException exception must be included in the throws clauses of all create methods defined in an enterprise Bean's home interface.

This exception is used as a standard application-level exception to report a failure to create an EJB object.

See Also:
Serialized Form

Constructor Summary
CreateException()
Constructs a CreateException with no detail message.
CreateException(String message)
Constructs a CreateException with the specified detail message.
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

public CreateException()
构造不带详细消息的 CreateException。
英文文档：

CreateException

public CreateException()
Constructs a CreateException with no detail message.

public CreateException(String message)
构造带指定详细消息的 CreateException。
英文文档：

CreateException

public CreateException(String message)
Constructs a CreateException with the specified detail message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DuplicateKeyException (Java EE 5)

javax.ejb
Class DuplicateKeyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.ejb.CreateException
                extended by  javax.ejb.DuplicateKeyException
All Implemented Interfaces:
Serializable
public class DuplicateKeyException
extends CreateException

Extends: Throwable > Exception > CreateException

如果因为具有相同键的对象已存在而不能创建实体 EJB 对象，则抛出 DuplicateKeyException 异常。此异常由实体 Bean 的 home 接口中定义的创建方法抛出。
英文文档：

The DuplicateKeyException exception is thrown if an entity EJB object cannot be created because an object with the same key already exists. This exception is thrown by the create methods defined in an entity Bean's home interface.

See Also:
Serialized Form

Constructor Summary
DuplicateKeyException()
Constructs a DuplicateKeyException with no detail message.
DuplicateKeyException(String message)
Constructs a DuplicateKeyException with the specified detail message.
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

public DuplicateKeyException()
构造不带详细消息的 DuplicateKeyException。
英文文档：

DuplicateKeyException

public DuplicateKeyException()
Constructs a DuplicateKeyException with no detail message.

public DuplicateKeyException(String message)
构造带指定详细消息的 DuplicateKeyException。
英文文档：

DuplicateKeyException

public DuplicateKeyException(String message)
Constructs a DuplicateKeyException with the specified detail message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBAccessException (Java EE 5)

javax.ejb
Class EJBAccessException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.EJBAccessException
All Implemented Interfaces:
Serializable
public class EJBAccessException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

此异常指示客户端对业务方法的访问被拒绝。
英文文档：

This exception indicates that client access to a business method was denied.

See Also:
Serialized Form

Constructor Summary
EJBAccessException()
Constructs an EJBAccessException with no detail message.
EJBAccessException(String message)
Constructs an EJBAccessException with the specified detailed message.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public EJBAccessException()
构造不带详细消息的 EJBAccessException。
英文文档：

EJBAccessException

public EJBAccessException()
Constructs an EJBAccessException with no detail message.

public EJBAccessException(String message)
构造带指定详细消息的 EJBAccessException。
英文文档：

EJBAccessException

public EJBAccessException(String message)
Constructs an EJBAccessException with the specified detailed message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBException (Java EE 5)

javax.ejb
Class EJBException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AccessLocalException, ConcurrentAccessException, EJBAccessException, EJBTransactionRequiredException, EJBTransactionRolledbackException, NoSuchEJBException, NoSuchEntityException, NoSuchObjectLocalException, TransactionRequiredLocalException, TransactionRolledbackLocalException
public class EJBException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException
Extended by: AccessLocalException, ConcurrentAccessException, EJBAccessException, EJBTransactionRequiredException, EJBTransactionRolledbackException, NoSuchEJBException, NoSuchEntityException, NoSuchObjectLocalException, TransactionRequiredLocalException, TransactionRolledbackLocalException

企业 Bean 实例抛出 EJBException 异常，向其容器报告由于不可预料的错误（例如，实例无法打开数据库连接），无法完成调用的业务方法或回调方法。
英文文档：

The EJBException exception is thrown by an enterprise Bean instance to its container to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a database connection).

See Also:
Serialized Form

Constructor Summary
EJBException()
Constructs an EJBException with no detail message.
EJBException(Exception ex)
Constructs an EJBException that embeds the originally thrown exception.
EJBException(String message)
Constructs an EJBException with the specified detailed message.
EJBException(String message, Exception ex)
Constructs an EJBException that embeds the originally thrown exception with the specified detail message.
Method Summary
Exception | getCausedByException() Obtain the exception that caused the EJBException being thrown.
String | getMessage() Returns the detail message, including the message from the nested exception if there is one.
void | printStackTrace() Prints the composite message to System.err.
void | printStackTrace(PrintStream ps) Prints the composite message and the embedded stack trace to the specified stream ps.
void | printStackTrace(PrintWriter pw) Prints the composite message and the embedded stack trace to the specified print writer pw.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public EJBException()
构造不带详细消息的 EJBException。
英文文档：

EJBException

public EJBException()
Constructs an EJBException with no detail message.

public EJBException(String message)
构造带指定详细消息的 EJBException。
英文文档：

EJBException

public EJBException(String message)
Constructs an EJBException with the specified detailed message.

public EJBException(Exception ex)
构造嵌入原始抛出异常的 EJBException。
英文文档：

EJBException

public EJBException(Exception ex)
Constructs an EJBException that embeds the originally thrown exception.

public EJBException(String message, Exception ex)
用指定的详细消息构造嵌入原始抛出异常的 EJBException。
英文文档：

EJBException

public EJBException(String message,
                    Exception ex)
Constructs an EJBException that embeds the originally thrown exception with the specified detail message.

Method Detail

public Exception getCausedByException()
获得导致 EJBException 抛出的异常。
英文文档：

getCausedByException

public Exception getCausedByException()
Obtain the exception that caused the EJBException being thrown.

public String getMessage()
返回包含来自嵌入异常的消息（如果有）的详细消息。
英文文档：

getMessage

public String getMessage()
Returns the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class Throwable

public void printStackTrace(java.io.PrintStream ps)
将复合消息和嵌入的堆栈跟踪打印到指定的流 ps。
ps 打印流
英文文档：

printStackTrace

public void printStackTrace(PrintStream ps)
Prints the composite message and the embedded stack trace to the specified stream ps.

Overrides:
printStackTrace in class Throwable
Parameters:
ps - the print stream

public void printStackTrace()
将复合消息打印到 System.err。
英文文档：

printStackTrace

public void printStackTrace()
Prints the composite message to System.err.

Overrides:
printStackTrace in class Throwable

public void printStackTrace(java.io.PrintWriter pw)
将复合消息和嵌入的堆栈跟踪打印到指定的打印编写器 pw。
pw 打印编写器
英文文档：

printStackTrace

public void printStackTrace(PrintWriter pw)
Prints the composite message and the embedded stack trace to the specified print writer pw.

Overrides:
printStackTrace in class Throwable
Parameters:
pw - the print writer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBTransactionRequiredException (Java EE 5)

javax.ejb
Class EJBTransactionRequiredException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.EJBTransactionRequiredException
All Implemented Interfaces:
Serializable
public class EJBTransactionRequiredException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

此异常指示某个请求带来了 null 事务上下文，但目标对象需要活动的事务。
英文文档：

This exception indicates that a request carried a null transaction context, but the target object requires an active transaction.

See Also:
Serialized Form

Constructor Summary
EJBTransactionRequiredException()
Constructs an EJBTransactionRequiredException with no detail message.
EJBTransactionRequiredException(String message)
Constructs an EJBTransactionRequiredException with the specified detailed message.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public EJBTransactionRequiredException()
构造不带详细消息的 EJBTransactionRequiredException。
英文文档：

EJBTransactionRequiredException

public EJBTransactionRequiredException()
Constructs an EJBTransactionRequiredException with no detail message.

public EJBTransactionRequiredException(String message)
构造带指定详细消息的 EJBTransactionRequiredException。
英文文档：

EJBTransactionRequiredException

public EJBTransactionRequiredException(String message)
Constructs an EJBTransactionRequiredException with the specified detailed message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBTransactionRolledbackException (Java EE 5)

javax.ejb
Class EJBTransactionRolledbackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.EJBTransactionRolledbackException
All Implemented Interfaces:
Serializable
public class EJBTransactionRolledbackException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

此异常指示与请求处理关联的事务已回滚，或已标记为回滚。因此，请求操作不能执行或没有执行，因为代表事务进行进一步计算没有结果。
英文文档：

This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back. Thus the requested operation either could not be performed or was not performed because further computation on behalf of the transaction would be fruitless

See Also:
Serialized Form

Constructor Summary
EJBTransactionRolledbackException()
Constructs an EJBTransactionRolledbackException with no detail message.
EJBTransactionRolledbackException(String message)
Constructs an EJBTransactionRolledbackException with the specified detailed message.
EJBTransactionRolledbackException(String message, Exception ex)
Constructs an EJBTransactionRolledbackException with the specified detail message and a nested exception.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public EJBTransactionRolledbackException()
构造不带详细消息的 EJBTransactionRolledbackException。
英文文档：

EJBTransactionRolledbackException

public EJBTransactionRolledbackException()
Constructs an EJBTransactionRolledbackException with no detail message.

public EJBTransactionRolledbackException(String message)
构造带指定详细消息的 EJBTransactionRolledbackException。
英文文档：

EJBTransactionRolledbackException

public EJBTransactionRolledbackException(String message)
Constructs an EJBTransactionRolledbackException with the specified detailed message.

public EJBTransactionRolledbackException(String message, Exception ex)
构造带指定详细消息和嵌入异常的 EJBTransactionRolledbackException。
英文文档：

EJBTransactionRolledbackException

public EJBTransactionRolledbackException(String message,
                                         Exception ex)
Constructs an EJBTransactionRolledbackException with the specified detail message and a nested exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FinderException (Java EE 5)

javax.ejb
Class FinderException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.ejb.FinderException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ObjectNotFoundException
public class FinderException
extends Exception

Extends: Throwable > Exception
Extended by: ObjectNotFoundException

实体 Bean 的 home 接口中每一个 findMETHOD(...) 方法的 throws 子句都必须包含 FinderException 异常。

该异常用作标准应用程序级异常，报告查找请求的 EJB 对象失败。

英文文档：

The FinderException exception must be included in the throws clause of every findMETHOD(...) method of an entity Bean's home interface.

The exception is used as a standard application-level exception to report a failure to find the requested EJB object(s).

See Also:
Serialized Form

Constructor Summary
FinderException()
Constructs an FinderException with no detail message.
FinderException(String message)
Constructs an FinderException with the specified detail message.
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

public FinderException()
构造不带详细消息的 FinderException。
英文文档：

FinderException

public FinderException()
Constructs an FinderException with no detail message.

public FinderException(String message)
构造带指定详细消息的 FinderException。
英文文档：

FinderException

public FinderException(String message)
Constructs an FinderException with the specified detail message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoSuchEJBException (Java EE 5)

javax.ejb
Class NoSuchEJBException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.NoSuchEJBException
All Implemented Interfaces:
Serializable
public class NoSuchEJBException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

如果试图调用已不存在的对象上的方法，则抛出 NoSuchEJBException。
英文文档：

A NoSuchEJBException is thrown if an attempt is made to invoke a method on an object that no longer exists.

See Also:
Serialized Form

Constructor Summary
NoSuchEJBException()
Constructs a NoSuchEJBException with no detail message.
NoSuchEJBException(String message)
Constructs a NoSuchEJBException with the specified detail message.
NoSuchEJBException(String message, Exception ex)
Constructs a NoSuchEJBException with the specified detail message and a nested exception.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public NoSuchEJBException()
构造不带详细消息的 NoSuchEJBException。
英文文档：

NoSuchEJBException

public NoSuchEJBException()
Constructs a NoSuchEJBException with no detail message.

public NoSuchEJBException(String message)
构造带指定详细消息的 NoSuchEJBException。
英文文档：

NoSuchEJBException

public NoSuchEJBException(String message)
Constructs a NoSuchEJBException with the specified detail message.

public NoSuchEJBException(String message, Exception ex)
构造带指定详细消息和嵌入异常的 NoSuchEJBException。
英文文档：

NoSuchEJBException

public NoSuchEJBException(String message,
                          Exception ex)
Constructs a NoSuchEJBException with the specified detail message and a nested exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoSuchEntityException (Java EE 5)

javax.ejb
Class NoSuchEntityException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.NoSuchEntityException
All Implemented Interfaces:
Serializable
public class NoSuchEntityException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

实体 Bean 实例抛出 NoSuchEntityException 异常，向其容器报告由于底层实体已从数据库中移除，无法完成调用的业务方法或回调方法。

此异常可能由实现 Bean 组件接口中定义的业务方法的 Bean 类方法或者 ejbLoad 和 ejbStore 方法抛出。

英文文档：

The NoSuchEntityException exception is thrown by an Entity Bean instance to its container to report that the invoked business method or callback method could not be completed because of the underlying entity was removed from the database.

This exception may be thrown by the bean class methods that implement the business methods defined in the bean's component interface; and by the ejbLoad and ejbStore methods.

See Also:
Serialized Form

Constructor Summary
NoSuchEntityException()
Constructs a NoSuchEntityException with no detail message.
NoSuchEntityException(Exception ex)
Constructs a NoSuchEntityException that embeds the originally thrown exception.
NoSuchEntityException(String message)
Constructs a NoSuchEntityException with the specified detailed message.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public NoSuchEntityException()
构造不带详细消息的 NoSuchEntityException。
英文文档：

NoSuchEntityException

public NoSuchEntityException()
Constructs a NoSuchEntityException with no detail message.

public NoSuchEntityException(String message)
构造带指定详细消息的 NoSuchEntityException。
英文文档：

NoSuchEntityException

public NoSuchEntityException(String message)
Constructs a NoSuchEntityException with the specified detailed message.

public NoSuchEntityException(Exception ex)
构造嵌入原始抛出异常的 NoSuchEntityException。
英文文档：

NoSuchEntityException

public NoSuchEntityException(Exception ex)
Constructs a NoSuchEntityException that embeds the originally thrown exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoSuchObjectLocalException (Java EE 5)

javax.ejb
Class NoSuchObjectLocalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.NoSuchObjectLocalException
All Implemented Interfaces:
Serializable
public class NoSuchObjectLocalException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

如果试图调用已不存在的对象上的方法，则抛出 NoSuchObjectLocalException。
英文文档：

A NoSuchObjectLocalException is thrown if an attempt is made to invoke a method on an object that no longer exists.

See Also:
Serialized Form

Constructor Summary
NoSuchObjectLocalException()
Constructs a NoSuchObjectLocalException with no detail message.
NoSuchObjectLocalException(String message)
Constructs a NoSuchObjectLocalException with the specified detail message.
NoSuchObjectLocalException(String message, Exception ex)
Constructs a NoSuchObjectLocalException with the specified detail message and a nested exception.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public NoSuchObjectLocalException()
构造不带详细消息的 NoSuchObjectLocalException。
英文文档：

NoSuchObjectLocalException

public NoSuchObjectLocalException()
Constructs a NoSuchObjectLocalException with no detail message.

public NoSuchObjectLocalException(String message)
构造带指定详细消息的 NoSuchObjectLocalException。
英文文档：

NoSuchObjectLocalException

public NoSuchObjectLocalException(String message)
Constructs a NoSuchObjectLocalException with the specified detail message.

public NoSuchObjectLocalException(String message, Exception ex)
构造带指定详细消息和嵌入异常的 NoSuchObjectLocalException。
英文文档：

NoSuchObjectLocalException

public NoSuchObjectLocalException(String message,
                                  Exception ex)
Constructs a NoSuchObjectLocalException with the specified detail message and a nested exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ObjectNotFoundException (Java EE 5)

javax.ejb
Class ObjectNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.ejb.FinderException
                extended by  javax.ejb.ObjectNotFoundException
All Implemented Interfaces:
Serializable
public class ObjectNotFoundException
extends FinderException

Extends: Throwable > Exception > FinderException

ObjectNotFoundException 异常由 finder 方法抛出，指示指定的 EJB 对象不存在。

只有当 finder 方法声明返回单个 EJB 对象时才使用此异常。如果 finder 方法返回 EJB 对象的集合，则不会抛出此异常，而应返回一个空集合。

英文文档：

The ObjectNotFoundException exception is thrown by a finder method to indicate that the specified EJB object does not exist.

Only the finder methods that are declared to return a single EJB object use this exception. This exception should not be thrown by finder methods that return a collection of EJB objects (they should return an empty collection instead).

See Also:
Serialized Form

Constructor Summary
ObjectNotFoundException()
Constructs an ObjectNotFoundException with no detail message.
ObjectNotFoundException(String message)
Constructs an ObjectNotFoundException with the specified detail message.
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

public ObjectNotFoundException()
构造不带详细消息的 ObjectNotFoundException。
英文文档：

ObjectNotFoundException

public ObjectNotFoundException()
Constructs an ObjectNotFoundException with no detail message.

public ObjectNotFoundException(String message)
构造带指定详细消息的 ObjectNotFoundException。
英文文档：

ObjectNotFoundException

public ObjectNotFoundException(String message)
Constructs an ObjectNotFoundException with the specified detail message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RemoveException (Java EE 5)

javax.ejb
Class RemoveException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.ejb.RemoveException
All Implemented Interfaces:
Serializable
public class RemoveException
extends Exception

Extends: Throwable > Exception

在企业 Bean 或容器不允许移除 EJB 对象时试图移除 EJB 对象，将抛出 RemoveException 异常。
英文文档：

The RemoveException exception is thrown at an attempt to remove an EJB object when the enterprise Bean or the container does not allow the EJB object to be removed.

See Also:
Serialized Form

Constructor Summary
RemoveException()
Constructs an RemoveException with no detail message.
RemoveException(String message)
Constructs an RemoveException with the specified detail message.
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

public RemoveException()
构造不带详细消息的 RemoveException。
英文文档：

RemoveException

public RemoveException()
Constructs an RemoveException with no detail message.

public RemoveException(String message)
构造带指定详细消息的 RemoveException。
英文文档：

RemoveException

public RemoveException(String message)
Constructs an RemoveException with the specified detail message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionRequiredLocalException (Java EE 5)

javax.ejb
Class TransactionRequiredLocalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.TransactionRequiredLocalException
All Implemented Interfaces:
Serializable
public class TransactionRequiredLocalException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

此异常指示某个请求带来了 null 事务上下文，但目标对象需要活动的事务。
英文文档：

This exception indicates that a request carried a null transaction context, but the target object requires an active transaction.

See Also:
Serialized Form

Constructor Summary
TransactionRequiredLocalException()
Constructs a TransactionRequiredLocalException with no detail message.
TransactionRequiredLocalException(String message)
Constructs an TransactionRequiredLocalException with the specified detailed message.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public TransactionRequiredLocalException()
构造不带详细消息的 TransactionRequiredLocalException。
英文文档：

TransactionRequiredLocalException

public TransactionRequiredLocalException()
Constructs a TransactionRequiredLocalException with no detail message.

public TransactionRequiredLocalException(String message)
构造带指定详细消息的 TransactionRequiredLocalException。
英文文档：

TransactionRequiredLocalException

public TransactionRequiredLocalException(String message)
Constructs an TransactionRequiredLocalException with the specified detailed message.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionRolledbackLocalException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.ejb
Class TransactionRolledbackLocalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.ejb.EJBException
                    extended by  javax.ejb.TransactionRolledbackLocalException
All Implemented Interfaces:
Serializable
public class TransactionRolledbackLocalException
extends EJBException

Extends: Throwable > Exception > RuntimeException > EJBException

此异常指示与请求处理关联的事务已回滚，或已标记为回滚。因此，请求操作不能执行或没有执行，因为代表事务进行进一步计算没有结果。
英文文档：

This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back. Thus the requested operation either could not be performed or was not performed because further computation on behalf of the transaction would be fruitless

See Also:
Serialized Form

Constructor Summary
TransactionRolledbackLocalException()
Constructs a TransactionRolledbackLocalException with no detail message.
TransactionRolledbackLocalException(String message)
Constructs a TransactionRolledbackLocalException with the specified detailed message.
TransactionRolledbackLocalException(String message, Exception ex)
Constructs a TransactionRolledbackLocalException with the specified detail message and a nested exception.
Method Summary
Methods inherited from class javax.ejb.EJBException
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public TransactionRolledbackLocalException()
构造不带详细消息的 TransactionRolledbackLocalException。
英文文档：

TransactionRolledbackLocalException

public TransactionRolledbackLocalException()
Constructs a TransactionRolledbackLocalException with no detail message.

public TransactionRolledbackLocalException(String message)
构造带指定详细消息的 TransactionRolledbackLocalException。
英文文档：

TransactionRolledbackLocalException

public TransactionRolledbackLocalException(String message)
Constructs a TransactionRolledbackLocalException with the specified detailed message.

public TransactionRolledbackLocalException(String message, Exception ex)
构造带指定详细消息和嵌入异常的 TransactionRolledbackLocalException。
英文文档：

TransactionRolledbackLocalException

public TransactionRolledbackLocalException(String message,
                                           Exception ex)
Constructs a TransactionRolledbackLocalException with the specified detail message and a nested exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ActivationConfigProperty (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type ActivationConfigProperty

@Target(value={})
@Retention(value=RUNTIME)
public @interface ActivationConfigProperty

Implements: Annotation
@Target(value={})
@Retention(value=RUNTIME)

英文文档：

Required Element Summary
String | propertyName
String | propertyValue

Element Detail

abstract public String propertyName()
英文文档：

propertyName

public abstract String propertyName

abstract public String propertyValue()
英文文档：

propertyValue

public abstract String propertyValue
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ApplicationException (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type ApplicationException

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface ApplicationException

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

应用于异常来表示它是应用程序异常，应直接报告给客户端（即解包）。
英文文档：

Applied to an exception to denote that it is an application exception and should be reported to the client directly(i.e., unwrapped).

Optional Element Summary
 boolean rollback
Indicates whether the container should cause the transaction to rollback when the exception is thrown.

abstract public boolean rollback()
指示抛出该异常时容器是否应使事务回滚。
英文文档：

rollback

public abstract boolean rollback
Indicates whether the container should cause the transaction to rollback when the exception is thrown.

Default:
false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


EJB (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type EJB

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface EJB

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

指示对 Enterprise Java Bean 本地或远程视图的依赖性。
英文文档：

Indicates a dependency on the local or remote view of an Enterprise Java Bean.

Optional Element Summary
Class | beanInterface Holds one of the following interface types of the target EJB : [ Local business interface, Remote business interface, Local Home interface, Remote Home interface ]
String | beanName The ejb-name of the Enterprise Java Bean to which this reference is mapped.
String | description
String | mappedName The product specific name of the EJB component to which this ejb reference should be mapped.
String | name The logical name of the ejb reference within the declaring component's (java:comp/env) environment.

abstract public String name()
声明组件环境内 (java:comp/env) ejb 引用的逻辑名称。
英文文档：

name

public abstract String name
The logical name of the ejb reference within the declaring component's (java:comp/env) environment.

Default:
""

abstract public String description()
英文文档：

description

public abstract String description
Default:
""

abstract public String beanName()
此引用映射到的 Enterprise Java Bean 的 ejb-name。仅适用于在同一应用程序或独立模块内将目标 EJB 定义为声明组件的情况。
英文文档：

beanName

public abstract String beanName
The ejb-name of the Enterprise Java Bean to which this reference is mapped. Only applicable if the target EJB is defined within the same application or stand-alone module as the declaring component.

Default:
""

abstract public Class<T> beanInterface()
保存以下目标 EJB 接口类型之一：[本地业务接口、远程业务接口、本地 Home 接口、远程 Home 接口]
英文文档：

beanInterface

public abstract Class beanInterface
Holds one of the following interface types of the target EJB : [ Local business interface, Remote business interface, Local Home interface, Remote Home interface ]

Default:
java.lang.Object.class

abstract public String mappedName()
此 ejb 引用应该映射到的 EJB 组件的特定产品名称。此映射的名称通常是全局 JNDI 名称，但也可以是任何形式的名称。 应用服务器不需要支持任何特殊形式或类型的映射名称，也不需要具有使用映射名称的能力。映射的名称与产品有关，并且通常与安装有关。任何对映射名称的使用都不可移植。
英文文档：

mappedName

public abstract String mappedName
The product specific name of the EJB component to which this ejb reference should be mapped. This mapped name is often a global JNDI name, but may be a name of any form. Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


EJBs (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type EJBs

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface EJBs

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

声明多个 TYPE-level @EJB 注释。
英文文档：

Declares multiple TYPE-level @EJB annotations.

Required Element Summary
 EJB[] value

Element Detail

abstract public EJB[] value()
英文文档：

value

public abstract EJB[] value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Init (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type Init

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Init

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

指定会话 Bean 与适配的 Home 接口或适配的 Local Home 接口的 create 方法相对应的方法。
英文文档：

Designates a method of a session bean that corresponds to the create method of an adapted Home interface or an adapted Local Home interface.

Optional Element Summary
 String value
The name of the corresponding create method of the adapted Home/LocalHome interface.

abstract public String value()
适配的 Home/LocalHome 接口对应的 create 方法的名称。此值用于确定一个适配的 Home/LocalHome 接口上有多个与注释的 @Init 方法有相同签名的 create 方法的情况。如果没有指定值，则仅根据签名匹配 create。
英文文档：

value

public abstract String value
The name of the corresponding create method of the adapted Home/LocalHome interface. This value is used to disambiguate the case where there are multiple create methods on an adapted Home/LocalHome interface with the same signature as the annotated @Init method. If no value is specified, the create matching is based on signature only.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Local (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type Local

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Local

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

用在 Bean 类上时，为会话 Bean 声明本地业务接口。用在接口上时，将该接口指定为本地业务接口。在这种情况下，不提供任何 value()。
英文文档：

When used on the bean class, declares the local business interface(s) for a session bean. When used on an interface, designates that interface as a local business interface. In this case, no value() is provided.

Optional Element Summary
 Class[] value

abstract public Class<T>[] value()
英文文档：

value

public abstract Class[] value
Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


LocalHome (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type LocalHome

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface LocalHome

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

为会话 Bean 声明 Local Home 或适配的 Local Home 接口。
英文文档：

Declares the Local Home or adapted Local Home interface for a session bean.

Required Element Summary
 Class value

Element Detail

abstract public Class<T> value()
英文文档：

value

public abstract Class value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


MessageDriven (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type MessageDriven

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface MessageDriven

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

消息驱动 Bean 的组件定义注释。
英文文档：

Component-defining annotation for a message driven bean.

Optional Element Summary
ActivationConfigProperty[] | activationConfig Activation config properties.
String | description
String | mappedName A product specific name(e.g. global JNDI name of a queue) that this message-driven bean should be mapped to.
Class | messageListenerInterface Message-listener interface.
String | name ejb-name for this bean.

abstract public String name()
此 Bean 的 ejb-name。
英文文档：

name

public abstract String name
ejb-name for this bean.

Default:
""

abstract public Class<T> messageListenerInterface()
消息侦听器接口。
英文文档：

messageListenerInterface

public abstract Class messageListenerInterface
Message-listener interface.

Default:
java.lang.Object.class

abstract public ActivationConfigProperty[] activationConfig()
激活 config 属性。
英文文档：

activationConfig

public abstract ActivationConfigProperty[] activationConfig
Activation config properties.

Default:
{}

abstract public String mappedName()
此消息驱动 Bean 应该映射到的特定产品名称（例如队列的全局 JNDI 名称）。 应用服务器不需要支持任何特殊形式或类型的映射名称，也不需要具有使用映射名称的能力。映射的名称与产品有关，并且通常与安装有关。任何对映射名称的使用都不可移植。
英文文档：

mappedName

public abstract String mappedName
A product specific name(e.g. global JNDI name of a queue) that this message-driven bean should be mapped to. Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.

Default:
""

abstract public String description()
英文文档：

description

public abstract String description
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PostActivate (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type PostActivate

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PostActivate

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

指定在有状态会话 Bean 被激活后接收回调的方法。
英文文档：

Designates a method to receive a callback after a stateful session bean has been activated.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PrePassivate (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type PrePassivate

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PrePassivate

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

指定在有状态会话 Bean 被钝化前接收回调的方法。
英文文档：

Designates a method to receive a callback before a stateful session bean is passivated.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Remote (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type Remote

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Remote

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

为会话 Bean 声明远程业务接口。用在接口上时，将该接口指定为远程业务接口。在这种情况下，不提供任何 value()。
英文文档：

Declares the remote business interface(s) for a session bean. When used on an interface, designates that interface as a remote business interface. In this case, no value() is provided.

Optional Element Summary
 Class[] value

abstract public Class<T>[] value()
英文文档：

value

public abstract Class[] value
Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RemoteHome (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type RemoteHome

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface RemoteHome

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

为会话 Bean 声明 Remote Home 或适配的 Remote Home 接口。
英文文档：

Declares the Remote Home or adapted Remote Home interface for a session bean.

Required Element Summary
 Class value

Element Detail

abstract public Class<T> value()
英文文档：

value

public abstract Class value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Remove (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type Remove

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Remove

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

应用于有状态会话 Bean 类的业务方法。指示有状态会话 Bean 在方法完成后将被容器移除。
英文文档：

Applied to a business method of a stateful session bean class. Indicates that the stateful session bean is to be removed by the container after completion of the method.

Optional Element Summary
 boolean retainIfException
If true, the stateful session bean will not be removed if an exception is thrown from the designated method.

abstract public boolean retainIfException()
如果为 true，则在指定的方法抛出异常的情况下，有状态会话 Bean 不会被移除。
英文文档：

retainIfException

public abstract boolean retainIfException
If true, the stateful session bean will not be removed if an exception is thrown from the designated method.

Default:
false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Stateful (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type Stateful

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Stateful

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

有状态会话 Bean 的组件定义注释。
英文文档：

Component-defining annotation for a stateful session bean.

Optional Element Summary
String | description
String | mappedName A product specific name(e.g. global JNDI name) that this session bean should be mapped to.
String | name ejb-name for this bean.

abstract public String name()
此 Bean 的 ejb-name。
英文文档：

name

public abstract String name
ejb-name for this bean.

Default:
""

abstract public String mappedName()
此会话 Bean 应该映射到的特定产品名称（例如全局 JNDI 名称）。 应用服务器不需要支持任何特殊形式或类型的映射名称，也不需要具有使用映射名称的能力。映射的名称与产品有关，并且通常与安装有关。任何对映射名称的使用都不可移植。
英文文档：

mappedName

public abstract String mappedName
A product specific name(e.g. global JNDI name) that this session bean should be mapped to. Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.

Default:
""

abstract public String description()
英文文档：

description

public abstract String description
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Stateless (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type Stateless

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Stateless

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

无状态会话 Bean 的组件定义注释。
英文文档：

Component-defining annotation for a stateless session bean.

Optional Element Summary
String | description
String | mappedName A product specific name(e.g. global JNDI name) that this session bean should be mapped to.
String | name ejb-name for this bean.

abstract public String name()
此 Bean 的 ejb-name。
英文文档：

name

public abstract String name
ejb-name for this bean.

Default:
""

abstract public String mappedName()
此会话 Bean 应该映射到的特定产品名称（例如全局 JNDI 名称）。 应用服务器不需要支持任何特殊形式或类型的映射名称，也不需要具有使用映射名称的能力。映射的名称与产品有关，并且通常与安装有关。任何对映射名称的使用都不可移植。
英文文档：

mappedName

public abstract String mappedName
A product specific name(e.g. global JNDI name) that this session bean should be mapped to. Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.

Default:
""

abstract public String description()
英文文档：

description

public abstract String description
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Timeout (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type Timeout

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Timeout

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

指定无状态会话 Bean 类或消息驱动 Bean 类上接收该 Bean 的 EJB 计时器过期的方法。
英文文档：

Designates a method on a stateless session bean class or message driven bean class that should receive EJB timer expirations for that bean.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


TransactionAttribute (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type TransactionAttribute

@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
public @interface TransactionAttribute

Implements: Annotation
@Target(value={METHOD, TYPE})
@Retention(value=RUNTIME)

在 TYPE-level 应用时，为会话或消息驱动 Bean 的所有业务方法指定默认事务属性。在方法级应用时，仅为该方法指定事务属性。
英文文档：

When applied at the TYPE-level, designates the default transaction attribute for all business methods of the session or message driven bean. When applied at the method-level, designates the transaction attribute for only that method.

Optional Element Summary
 TransactionAttributeType value

abstract public TransactionAttributeType value()
英文文档：

value

public abstract TransactionAttributeType value
Default:
REQUIRED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


TransactionManagement (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.ejb
Annotation Type TransactionManagement

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface TransactionManagement

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

声明是会话 Bean 还是消息驱动 Bean 具有容器管理事务或 Bean 管理事务。
英文文档：

Declares whether a session bean or message driven bean has container managed transactions or bean managed transactions.

Optional Element Summary
 TransactionManagementType value

abstract public TransactionManagementType value()
英文文档：

value

public abstract TransactionManagementType value
Default:
CONTAINER
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


javax.ejb.spi (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.ejb.spi

The javax.ejb.spi package defines interfaces that are implemented by the EJB container.

See:
Description

Interface Summary
HandleDelegate The HandleDelegate interface is implemented by the EJB container.

Package javax.ejb.spi Description

The javax.ejb.spi package defines interfaces that are implemented by the EJB container. These interfaces are not used by application components.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.ejb.spi Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.ejb.spi

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.ejb.spi.HandleDelegate
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


HandleDelegate (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.ejb.spi
Interface HandleDelegate

public interface HandleDelegate

HandleDelegate 接口由 EJB 容器实现。javax.ejb.Handle 和 javax.ejb.HomeHandle 的可移植实现使用此接口。EJB 组件或客户端组件不使用它。它提供了一些方法来序列化和反序列化对流的 EJBObject 和 EJBHome 引用。

通过 JNDI 查找其保留名称 "java:comp/HandleDelegate" 获得 HandleDelegate 对象。

英文文档：

The HandleDelegate interface is implemented by the EJB container. It is used by portable implementations of javax.ejb.Handle and javax.ejb.HomeHandle. It is not used by EJB components or by client components. It provides methods to serialize and deserialize EJBObject and EJBHome references to streams.

The HandleDelegate object is obtained by JNDI lookup at the reserved name "java:comp/HandleDelegate".

Method Summary
EJBHome | readEJBHome(ObjectInputStream istream) Deserialize the EJBHome reference corresponding to a HomeHandle.
EJBObject | readEJBObject(ObjectInputStream istream) Deserialize the EJBObject reference corresponding to a Handle.
void | writeEJBHome(EJBHome ejbHome, ObjectOutputStream ostream) Serialize the EJBHome reference corresponding to a HomeHandle.
void | writeEJBObject(EJBObject ejbObject, ObjectOutputStream ostream) Serialize the EJBObject reference corresponding to a Handle.

Method Detail

public void writeEJBObject(EJBObject ejbObject, java.io.ObjectOutputStream ostream) throws java.io.IOException
序列化相应 Handle 的 EJBObject 引用。

此方法从可移植 Handle 实现类的 writeObject 方法调用。ostream 对象就是传入 Handle 类的 writeObject 的那个对象。

ejbObject | 要序列化的 EJBObject 引用。
ostream | 输出流。
Throws | java.io.IOException: 由于系统级失败无法序列化 EJBObject。
英文文档：

writeEJBObject

void writeEJBObject(EJBObject ejbObject,
                    ObjectOutputStream ostream)
                    throws IOException
Serialize the EJBObject reference corresponding to a Handle.

This method is called from the writeObject method of portable Handle implementation classes. The ostream object is the same object that was passed in to the Handle class's writeObject.

Parameters:
ejbObject - The EJBObject reference to be serialized.
ostream - The output stream.
Throws:
IOException - The EJBObject could not be serialized because of a system-level failure.

public EJBObject readEJBObject(java.io.ObjectInputStream istream) throws java.io.IOException, ClassNotFoundException
反序列化相应 Handle 的 EJBObject 引用。

readEJBObject 从可移植 Handle 实现类的 readObject 方法调用。istream 对象就是传入 Handle 类的 readObject 的那个对象。调用 readEJBObject 时，istream 必须指向流中可以读取 EJBObject 引用的那个位置。容器必须确保 EJBObject 引用能够在反序列化后立即执行调用。

istream | 输入流。
return | 反序列化的 EJBObject 引用。
Throws | java.io.IOException: 由于系统级失败无法反序列化 EJBObject。
Throws | ClassNotFoundException: 因为无法找到某些类，无法反序列化 EJBObject。
英文文档：

readEJBObject

EJBObject readEJBObject(ObjectInputStream istream)
                        throws IOException,
                               ClassNotFoundException
Deserialize the EJBObject reference corresponding to a Handle.

readEJBObject is called from the readObject method of portable Handle implementation classes. The istream object is the same object that was passed in to the Handle class's readObject. When readEJBObject is called, istream must point to the location in the stream at which the EJBObject reference can be read. The container must ensure that the EJBObject reference is capable of performing invocations immediately after deserialization.

Parameters:
istream - The input stream.
Returns:
The deserialized EJBObject reference.
Throws:
IOException - The EJBObject could not be deserialized because of a system-level failure.
ClassNotFoundException - The EJBObject could not be deserialized because some class could not be found.

public void writeEJBHome(EJBHome ejbHome, java.io.ObjectOutputStream ostream) throws java.io.IOException
序列化相应 HomeHandle 的 EJBHome 引用。

此方法从可移植 HomeHandle 实现类的 writeObject 方法调用。ostream 对象就是传入 Handle 类的 writeObject 的那个对象。

ejbHome | 要序列化的 EJBHome 引用。
ostream | 输出流。
Throws | java.io.IOException: 由于系统级失败无法序列化 EJBObject。
英文文档：

writeEJBHome

void writeEJBHome(EJBHome ejbHome,
                  ObjectOutputStream ostream)
                  throws IOException
Serialize the EJBHome reference corresponding to a HomeHandle.

This method is called from the writeObject method of portable HomeHandle implementation classes. The ostream object is the same object that was passed in to the Handle class's writeObject.

Parameters:
ejbHome - The EJBHome reference to be serialized.
ostream - The output stream.
Throws:
IOException - The EJBObject could not be serialized because of a system-level failure.

public EJBHome readEJBHome(java.io.ObjectInputStream istream) throws java.io.IOException, ClassNotFoundException
反序列化相应 HomeHandle 的 EJBHome 引用。

readEJBHome 从可移植 HomeHandle 实现类的 readObject 方法调用。istream 对象就是传入 HomeHandle 类的 readObject 的那个对象。调用 readEJBHome 时，istream 必须指向流中可以读取 EJBHome 引用的那个位置。容器必须确保 EJBHome 引用能够在反序列化后立即执行调用。

istream | 输入流。
return | 反序列化的 EJBHome 引用。
Throws | java.io.IOException: 由于系统级失败无法反序列化 EJBHome。
Throws | ClassNotFoundException: 因为无法找到某些类，无法反序列化 EJBHome。
英文文档：

readEJBHome

EJBHome readEJBHome(ObjectInputStream istream)
                    throws IOException,
                           ClassNotFoundException
Deserialize the EJBHome reference corresponding to a HomeHandle.

readEJBHome is called from the readObject method of portable HomeHandle implementation classes. The istream object is the same object that was passed in to the HomeHandle class's readObject. When readEJBHome is called, istream must point to the location in the stream at which the EJBHome reference can be read. The container must ensure that the EJBHome reference is capable of performing invocations immediately after deserialization.

Parameters:
istream - The input stream.
Returns:
The deserialized EJBHome reference.
Throws:
IOException - The EJBHome could not be deserialized because of a system-level failure.
ClassNotFoundException - The EJBHome could not be deserialized because some class could not be found.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.el (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.el

Provides the API for the Unified Expression Language shared by the JSP 2.1 and JSF 1.2 technologies.

See:
Description

Interface Summary
ELContextListener The listener interface for receiving notification when an ELContext is created.

Class Summary
ArrayELResolver | Defines property resolution behavior on arrays.
BeanELResolver | Defines property resolution behavior on objects using the JavaBeans component architecture.
BeanELResolver.BeanProperties |
BeanELResolver.BeanProperty |
CompositeELResolver | Maintains an ordered composite list of child ELResolvers.
ELContext | Context information for expression evaluation.
ELContextEvent | An event which indicates that an ELContext has been created.
ELResolver | Enables customization of variable and property resolution behavior for EL expression evaluation.
Expression | Base class for the expression subclasses ValueExpression and MethodExpression, implementing characterstics common to both.
ExpressionFactory |
FunctionMapper | The interface to a map between EL function names and methods.
ListELResolver | Defines property resolution behavior on instances of List.
MapELResolver | Defines property resolution behavior on instances of Map.
MethodExpression | An Expression that refers to a method on an object.
MethodInfo | Holds information about a method that a MethodExpression evaluated to.
ResourceBundleELResolver | Defines property resolution behavior on instances of ResourceBundle.
ValueExpression | An Expression that can get or set a value.
VariableMapper | The interface to a map between EL variables and the EL expressions they are associated with.

Exception Summary
ELException | Represents any of the exception conditions that can arise during expression evaluation.
MethodNotFoundException | Thrown when a method could not be found while evaluating a MethodExpression.
PropertyNotFoundException | Thrown when a property could not be found while evaluating a ValueExpression or MethodExpression.
PropertyNotWritableException | Thrown when a property could not be written to while setting the value on a ValueExpression.

Package javax.el Description

Provides the API for the Unified Expression Language shared by the JSP 2.1 and JSF 1.2 technologies.

The Expression Language (EL) is a simple language designed to satisfy the specific needs of web application developers. It is currently defined in its own specification document within the JavaServer Pages (tm) (JSP) 2.1 specification, but does not have any dependencies on any portion of the JSP 2.1 specification. It is intended for general use outside of the JSP and JSF specifications as well.

This package contains the classes and interfaces that describe and define the programmatic access to the Expression Language engine. The API is logically partitioned as follows:

  • EL Context
  • Expression Objects
  • Creation of Expressions
  • Resolution of Model Objects and their Properties
  • EL Functions
  • EL Variables

EL Context

An important goal of the EL is to ensure it can be used in a variety of environments. It must therefore provide enough flexibility to adapt to the specific requirements of the environment where it is being used.

Class ELContext is what links the EL with the specific environment where it is being used. It provides the mechanism through which all relevant context for creating or evaluating an expression is specified.

Creation of ELContext objects is controlled through the underlying technology. For example, in JSP, the JspContext.getELContext() factory method is used.

Some technologies provide the ability to add an ELContextListener so that applications and frameworks can ensure their own context objects are attached to any newly created ELContext.

Expression Objects

At the core of the Expression Language is the notion of an expression that gets parsed according to the grammar defined by the Expression Language.

There are two types of expressions defined by the EL: value expressions and method expressions. A ValueExpression such as "${customer.name}" can be used either as an rvalue (return the value associated with property name of the model object customer) or as an lvalue (set the value of the property name of the model object customer).

A MethodExpression such as "${handler.process}" makes it possible to invoke a method (process) on a specific model object (handler).

All expression classes extend the base class Expression, making them serializable and forcing them to implement equals() and hashCode(). Morevover, each method on these expression classes that actually evaluates an expression receives a parameter of class ELContext, which provides the context required to evaluate the expression.

Creation of Expressions

An expression is created through the ExpressionFactory class. The factory provides two creation methods; one for each type of expression supported by the EL.

To create an expression, one must provide an ELContext, a string representing the expression, and the expected type (ValueExpression) or signature (MethodExpression). The ELContext provides the context necessary to parse an expression. Specifically, if the expression uses an EL function (for example ${fn:toUpperCase(customer.name)}) or an EL variable, then FunctionMapper and VariableMapper objects must be available within the ELContext so that EL functions and EL variables are properly mapped.

Resolution of Model Objects and their Properties

Through the ELResolver base class, the EL features a pluggable mechanism to resolve model object references as well as properties of these objects.

The EL API provides implementations of ELResolver supporting property resolution for common data types which include arrays (ArrayELResolver), JavaBeans (BeanELResolver), Lists (ListELResolver), Maps (MapELResolver), and ResourceBundles (ResourceBundleELResolver).

Tools can easily obtain more information about resolvable model objects and their resolvable properties by calling method getFeatureDescriptors on the ELResolver. This method exposes objects of type java.beans.FeatureDescriptor, providing all information of interest on top-level model objects as well as their properties.

EL Functions

If an EL expression uses a function (for example ${fn:toUpperCase(customer.name)}), then a FunctionMapper object must also be specified within the ELContext. The FunctionMapper is responsible to map ${prefix:name()} style functions to static methods that can execute the specified functions.

EL Variables

Just like FunctionMapper provides a flexible mechanism to add functions to the EL, VariableMapper provides a flexible mechanism to support the notion of EL variables.

An EL variable does not directly refer to a model object that can then be resolved by an ELResolver. Instead, it refers to an EL expression. The evaluation of that EL expression gives the EL variable its value.

For example, in the following code snippet

<h:inputText value="#{handler.customer.name}"/>
handler refers to a model object that can be resolved by an EL Resolver.

However, in this other example:

<c:forEach var="item" items="#{model.list}">
   <h:inputText value="#{item.name}"/>
</c:forEach>
item is an EL variable because it does not refer directly to a model object. Instead, it refers to another EL expression, namely a specific item in the collection referred to by the EL expression #{model.list}.

Assuming that there are three elements in ${model.list}, this means that for each invocation of <h:inputText>, the following information about item must be preserved in the VariableMapper:

first invocation: item maps to first element in ${model.list}
second invocation: item maps to second element in ${model.list}
third invocation: item maps to third element in ${model.list}

VariableMapper provides the mechanisms required to allow the mapping of an EL variable to the EL expression from which it gets its value.

Overview   Package  Class  Tree  Deprecated  Index  Help
 PREV PACKAGE   NEXT PACKAGE FRAMES    NO FRAMES
Submit a bug or feature

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


javax.el Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.el

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.el.BeanELResolver.BeanProperties
    • javax.el.BeanELResolver.BeanProperty
    • javax.el.ELContext
    • javax.el.ELResolver
      • javax.el.ArrayELResolver
      • javax.el.BeanELResolver
      • javax.el.CompositeELResolver
      • javax.el.ListELResolver
      • javax.el.MapELResolver
      • javax.el.ResourceBundleELResolver
    • java.util.EventObject (implements java.io.Serializable)
      • javax.el.ELContextEvent
    • javax.el.Expression (implements java.io.Serializable)
      • javax.el.MethodExpression
      • javax.el.ValueExpression
    • javax.el.ExpressionFactory
    • javax.el.FunctionMapper
    • javax.el.MethodInfo
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.el.ELException
            • javax.el.MethodNotFoundException
            • javax.el.PropertyNotFoundException
            • javax.el.PropertyNotWritableException
    • javax.el.VariableMapper

Interface Hierarchy

  • java.util.EventListener
    • javax.el.ELContextListener
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ELContextListener (Java EE 5)

javax.el
Interface ELContextListener

All Superinterfaces:
EventListener
public interface ELContextListener
extends EventListener

Implements: java.util.EventListener

用于创建 ELContext 时接收通知的侦听器接口。
since | JSP 2.1
See also | javax.el.ELContext, javax.el.ELContextEvent
英文文档：

The listener interface for receiving notification when an ELContext is created.

Since:
JSP 2.1
See Also:
ELContext, ELContextEvent

Method Summary
 void contextCreated(ELContextEvent ece)
Invoked when a new ELContext has been created.

Method Detail

public void contextCreated(ELContextEvent ece)
已创建新的 ELContext 时调用。
ece 通知事件。
英文文档：

contextCreated

void contextCreated(ELContextEvent ece)
Invoked when a new ELContext has been created.

Parameters:
ece - the notification event.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ArrayELResolver (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.el
Class ArrayELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.el.ArrayELResolver

public class ArrayELResolver
extends ELResolver

Extends: ELResolver

定义数组上的属性解析行为。

此解析器处理类型为 Java 语言数组的 base 对象。它接受任何对象作为属性，并且将该对象强制匹配为数组中的整数索引。所得值就是数组中位于该索引处的值。

此解析器可以以只读模式构建，这意味着 #isReadOnly 将总是返回 true，#setValue 将总是抛出 PropertyNotWritableException。

ELResolver 使用 CompositeELResolver 连接到一起，以定义丰富语义来计算表达式。有关 ELResolver 的详细信息，请参阅 javadoc。

since | JSP 2.1
See also | javax.el.CompositeELResolver, javax.el.ELResolver
英文文档：

Defines property resolution behavior on arrays.

This resolver handles base objects that are Java language arrays. It accepts any object as a property and coerces that object into an integer index into the array. The resulting value is the value in the array at that index.

This resolver can be constructed in read-only mode, which means that isReadOnly will always return true and setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always throw PropertyNotWritableException.

ELResolvers are combined together using CompositeELResolvers, to define rich semantics for evaluating an expression. See the javadocs for ELResolver for details.

Since:
JSP 2.1
See Also:
CompositeELResolver, ELResolver

Field Summary
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
ArrayELResolver()
Creates a new read/write ArrayELResolver.
ArrayELResolver(boolean isReadOnly)
Creates a new ArrayELResolver whose read-only status is determined by the given parameter.
Method Summary
 Class<?> getCommonPropertyType(ELContext context, Object base)
If the base object is a Java language array, returns the most general type that this resolver accepts for the property argument.
 Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
Always returns null, since there is no reason to iterate through set set of all integers.
 Class<?> getType(ELContext context, Object base, Object property)
If the base object is an array, returns the most general acceptable type for a value in this array.
 Object getValue(ELContext context, Object base, Object property)
If the base object is a Java language array, returns the value at the given index.
 boolean isReadOnly(ELContext context, Object base, Object property)
If the base object is a Java language array, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
 void setValue(ELContext context, Object base, Object property, Object val)
If the base object is a Java language array, attempts to set the value at the given index with the given value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ArrayELResolver()
创建新的读/写 ArrayELResolver。
英文文档：

ArrayELResolver

public ArrayELResolver()
Creates a new read/write ArrayELResolver.

public ArrayELResolver(boolean isReadOnly)
创建新的 ArrayELResolver，其只读状态由给定的参数确定。
isReadOnly 如果此解析器无法修改数组，则为 true；否则为 false。
英文文档：

ArrayELResolver

public ArrayELResolver(boolean isReadOnly)
Creates a new ArrayELResolver whose read-only status is determined by the given parameter.

Parameters:
isReadOnly - true if this resolver cannot modify arrays; false otherwise.
Method Detail

public Class<T> getType(ELContext context, Object base, Object property)
如果 base 对象是数组，则返回此数组中的值可以接受的最一般类型。

如果 base 为 array，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

如果 base 为 array，则此方法将总是返回 base.getClass().getComponentType()，这是可以在数组的任何给定索引位置存储的最一般组件类型。

context | 此计算的上下文。
base | 要分析的数组。此解析器仅处理属于 Java 语言数组的 base。
property | 返回可接受类型的数组元素的索引。将强制匹配为整数，其他情况下将被此解析器忽略。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回最一般的可接受类型；其他情况未定义。
Throws | PropertyNotFoundException: 如果给定索引超出此数组的范围。
Throws | NullPointerException: 如果 context 为 null
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getType

public Class<?> getType(ELContext context,
                        Object base,
                        Object property)
If the base object is an array, returns the most general acceptable type for a value in this array.

If the base is a array, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Assuming the base is an array, this method will always return base.getClass().getComponentType(), which is the most general type of component that can be stored at any given index in the array.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The array to analyze. Only bases that are Java language arrays are handled by this resolver.
property - The index of the element in the array to return the acceptable type for. Will be coerced into an integer, but otherwise ignored by this resolver.
Returns:
If the propertyResolved property of ELContext was set to true, then the most general acceptable type; otherwise undefined.
Throws:
PropertyNotFoundException - if the given index is out of bounds for this array.
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public Object getValue(ELContext context, Object base, Object property)
如果 base 对象为 Java 语言数组，则返回给定索引位置的值。property 参数指定的索引，强制匹配为整数。如果无法执行强制匹配，则抛出 IllegalArgumentException。如果索引超出边界，则返回 null。

如果 base 为 Java 语言数组，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

context | 此计算的上下文。
base | 要分析的数组。此解析器仅处理属于 Java 语言数组的 base。
property | 要返回的值的索引。将强制匹配为整数。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回给定索引处的值；如果索引超出边界，则返回 null。其他情况未定义。
Throws | IllegalArgumentException: 如果属性无法强制匹配为整数。
Throws | NullPointerException: 如果 context 为 null。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
If the base object is a Java language array, returns the value at the given index. The index is specified by the property argument, and coerced into an integer. If the coercion could not be performed, an IllegalArgumentException is thrown. If the index is out of bounds, null is returned.

If the base is a Java language array, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The array to analyze. Only bases that are Java language arrays are handled by this resolver.
property - The index of the value to be returned. Will be coerced into an integer.
Returns:
If the propertyResolved property of ELContext was set to true, then the value at the given index or null if the index was out of bounds. Otherwise, undefined.
Throws:
IllegalArgumentException - if the property could not be coerced into an integer.
NullPointerException - if context is null.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public void setValue(ELContext context, Object base, Object property, Object val)
如果 base 对象为 Java 语言数组，则尝试用给定的值设置给定索引位置的值。property 参数指定的索引，强制匹配为整数。如果无法执行强制匹配，则抛出 IllegalArgumentException。如果索引超出边界，则抛出 PropertyNotFoundException。

如果 base 为 Java 语言数组，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者可以放心地假定没有设置任何值。

如果此解析器以只读模式构造，则此方法将总是抛出 PropertyNotWritableException。

context | 此计算的上下文。
base | 要修改的数组。此解析器仅处理属于 Java 语言数组的 base。
property | 要设置的值的索引。将强制匹配为整数。
val | 要在给定索引处设置的值。
Throws | ClassCastException: 如果指定元素的类不允许该元素添加到此数组。
Throws | NullPointerException: 如果 context 为 null。
Throws | IllegalArgumentException: 如果属性无法强制匹配为整数，或者指定元素的某个方面不允许该元素添加到此数组。
Throws | PropertyNotWritableException: 如果此解析器以只读模式构建。
Throws | PropertyNotFoundException: 如果给定索引超出此数组的范围。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object val)
If the base object is a Java language array, attempts to set the value at the given index with the given value. The index is specified by the property argument, and coerced into an integer. If the coercion could not be performed, an IllegalArgumentException is thrown. If the index is out of bounds, a PropertyNotFoundException is thrown.

If the base is a Java language array, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller can safely assume no value was set.

If this resolver was constructed in read-only mode, this method will always throw PropertyNotWritableException.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The array to be modified. Only bases that are Java language arrays are handled by this resolver.
property - The index of the value to be set. Will be coerced into an integer.
val - The value to be set at the given index.
Throws:
ClassCastException - if the class of the specified element prevents it from being added to this array.
NullPointerException - if context is null.
IllegalArgumentException - if the property could not be coerced into an integer, or if some aspect of the specified element prevents it from being added to this array.
PropertyNotWritableException - if this resolver was constructed in read-only mode.
PropertyNotFoundException - if the given index is out of bounds for this array.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public boolean isReadOnly(ELContext context, Object base, Object property)
如果 base 对象是 Java 语言数组，则返回对 #setValue 的调用是否总是失败。

如果 base 为 Java 语言数组，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

如果此解析器以只读模式构造，则此方法将总是返回 true。否则返回 false。

context | 此计算的上下文。
base | 要分析的数组。此解析器仅处理属于 Java 语言数组的 base。
property | 返回可接受类型的数组元素的索引。将强制匹配为整数，其他情况下将被此解析器忽略。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则调用 setValue 方法总是失败的情况下返回 true，该调用可能成功的情况下返回 false；其他情况未定义。
Throws | PropertyNotFoundException: 如果给定索引超出此数组的范围。
Throws | NullPointerException: 如果 context 为 null
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
If the base object is a Java language array, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.

If the base is a Java language array, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

If this resolver was constructed in read-only mode, this method will always return true. Otherwise, it returns false.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - The array to analyze. Only bases that are a Java language array are handled by this resolver.
property - The index of the element in the array to return the acceptable type for. Will be coerced into an integer, but otherwise ignored by this resolver.
Returns:
If the propertyResolved property of ELContext was set to true, then true if calling the setValue method will always fail or false if it is possible that such a call may succeed; otherwise undefined.
Throws:
PropertyNotFoundException - if the given index is out of bounds for this array.
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public java.util.Iterator<E> getFeatureDescriptors(ELContext context, Object base)
总是返回 null，因为没有理由迭代所有整数集。

#getCommonPropertyType 方法返回有关此解析器接受的属性的足够信息。

context | 此计算的上下文。
base | 要分析的数组。此解析器仅处理属于 Java 语言数组的 base。
return | null。
英文文档：

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
Always returns null, since there is no reason to iterate through set set of all integers.

The getCommonPropertyType(javax.el.ELContext, java.lang.Object) method returns sufficient information about what properties this resolver accepts.

Specified by:
getFeatureDescriptors in class ELResolver
Parameters:
context - The context of this evaluation.
base - The array to analyze. Only bases that are a Java language array are handled by this resolver.
Returns:
null.
See Also:
FeatureDescriptor

public Class<T> getCommonPropertyType(ELContext context, Object base)
如果 base 对象不是 Java 语言数组，则返回对于 property 参数此解析器可接受的最一般类型。否则返回 null。

假定 base 为数组，则此方法将总是返回 Integer.class。这是因为数组接受整数作为其索引。

context | 此计算的上下文。
base | 要分析的数组。此解析器仅处理属于 Java 语言数组的 base。
return | 如果 base 不是 Java 语言数组，则返回 null；否则返回 Integer.class。
英文文档：

getCommonPropertyType

public Class<?> getCommonPropertyType(ELContext context,
                                      Object base)
If the base object is a Java language array, returns the most general type that this resolver accepts for the property argument. Otherwise, returns null.

Assuming the base is an array, this method will always return Integer.class. This is because arrays accept integers for their index.

Specified by:
getCommonPropertyType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The array to analyze. Only bases that are a Java language array are handled by this resolver.
Returns:
null if base is not a Java language array; otherwise Integer.class.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BeanELResolver (Java EE 5)

javax.el
Class BeanELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.el.BeanELResolver

public class BeanELResolver
extends ELResolver

Extends: ELResolver
Inner classes: BeanELResolver.BeanProperty, BeanELResolver.BeanProperties

使用 JavaBean 组件架构定义对象的属性解析行为。

此解析器处理任何类型的 base 对象，但 base 不能为 null。它接受任何对象作为属性，并将其强制匹配为一个字符串。然后使用该字符串在 base 对象上查找遵从 JavaBean 的属性。使用 JavaBean 获取和设置方法访问该值。

此解析器可以以只读模式构建，这意味着 #isReadOnly 将总是返回 true，#setValue 将总是抛出 PropertyNotWritableException。

ELResolver 使用 CompositeELResolver 连接到一起，以定义丰富语义来计算表达式。有关 ELResolver 的详细信息，请参阅 javadoc。

由于此解析器处理任何类型的 base 对象，因此应该将其放置在靠近复合解析器末尾的位置。否则，在位于它之后的解析器有机会测试是否能够解析某个属性前，它将声称已经解析了该属性。

since | JSP 2.1
See also | javax.el.CompositeELResolver, javax.el.ELResolver
英文文档：

Defines property resolution behavior on objects using the JavaBeans component architecture.

This resolver handles base objects of any type, as long as the base is not null. It accepts any object as a property, and coerces it to a string. That string is then used to find a JavaBeans compliant property on the base object. The value is accessed using JavaBeans getters and setters.

This resolver can be constructed in read-only mode, which means that isReadOnly will always return true and setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always throw PropertyNotWritableException.

ELResolvers are combined together using CompositeELResolvers, to define rich semantics for evaluating an expression. See the javadocs for ELResolver for details.

Because this resolver handles base objects of any type, it should be placed near the end of a composite resolver. Otherwise, it will claim to have resolved a property before any resolvers that come after it get a chance to test if they can do so as well.

Since:
JSP 2.1
See Also:
CompositeELResolver, ELResolver

Nested Class Summary
protected static class | BeanELResolver.BeanProperties
protected static class | BeanELResolver.BeanProperty
Field Summary
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
BeanELResolver()
Creates a new read/write BeanELResolver.
BeanELResolver(boolean isReadOnly)
Creates a new BeanELResolver whose read-only status is determined by the given parameter.
Method Summary
 Class<?> getCommonPropertyType(ELContext context, Object base)
If the base object is not null, returns the most general type that this resolver accepts for the property argument.
 Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
If the base object is not null, returns an Iterator containing the set of JavaBeans properties available on the given object.
 Class<?> getType(ELContext context, Object base, Object property)
If the base object is not null, returns the most general acceptable type that can be set on this bean property.
 Object getValue(ELContext context, Object base, Object property)
If the base object is not null, returns the current value of the given property on this bean.
 boolean isReadOnly(ELContext context, Object base, Object property)
If the base object is not null, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
 void setValue(ELContext context, Object base, Object property, Object val)
If the base object is not null, attempts to set the value of the given property on this bean.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public BeanELResolver()
创建新的读/写 BeanELResolver。
英文文档：

BeanELResolver

public BeanELResolver()
Creates a new read/write BeanELResolver.

public BeanELResolver(boolean isReadOnly)
创建新的 BeanELResolver，它的只读状态由给定的参数确定。
isReadOnly 如果此解析器无法修改 Bean，则为 true；否则为 false。
英文文档：

BeanELResolver

public BeanELResolver(boolean isReadOnly)
Creates a new BeanELResolver whose read-only status is determined by the given parameter.

Parameters:
isReadOnly - true if this resolver cannot modify beans; false otherwise.
Method Detail

public Class<T> getType(ELContext context, Object base, Object property)
如果 base 对象不为 null，则返回可以在此 Bean 属性上设置的最一般可接受类型。

如果 base 不为 null，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

提供的属性将首先强制匹配为 String。如果此属性有一个 BeanInfoProperty 并且获取它时没有错误，则返回 propertyDescriptor 的 propertyType。否则将抛出 PropertyNotFoundException。

context | 此计算的上下文。
base | 要分析的 Bean。
property | 要分析的属性名称将强制匹配为 String。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回最一般的可接受类型；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果 base 不为 null，并且指定的属性不存在或不可读。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getType

public Class<?> getType(ELContext context,
                        Object base,
                        Object property)
If the base object is not null, returns the most general acceptable type that can be set on this bean property.

If the base is not null, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

The provided property will first be coerced to a String. If there is a BeanInfoProperty for this property and there were no errors retrieving it, the propertyType of the propertyDescriptor is returned. Otherwise, a PropertyNotFoundException is thrown.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The bean to analyze.
property - The name of the property to analyze. Will be coerced to a String.
Returns:
If the propertyResolved property of ELContext was set to true, then the most general acceptable type; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if base is not null and the specified property does not exist or is not readable.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public Object getValue(ELContext context, Object base, Object property)
如果 base 对象不为 null，则返回此 Bean 上给定属性的当前值。

如果 base 不为 null，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

提供的属性名称将首先强制匹配为 String。如果按照 JavaBean 规范，该属性是 base 对象的可读属性，则返回调用获取方法的结果。如果获取方法抛出异常，则该异常将被传播到调用者。如果没有找到该属性或者该属性不可读，则抛出 PropertyNotFoundException。

context | 此计算的上下文。
base | 要获取属性的 Bean。
property | 要获取的属性的名称。将强制匹配为 String。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回给定属性的值。其他情况未定义。
Throws | NullPointerException: 如果 context 为 null。
Throws | PropertyNotFoundException: 如果 base 不为 null，并且指定的属性不存在或不可读。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
If the base object is not null, returns the current value of the given property on this bean.

If the base is not null, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

The provided property name will first be coerced to a String. If the property is a readable property of the base object, as per the JavaBeans specification, then return the result of the getter call. If the getter throws an exception, it is propagated to the caller. If the property is not found or is not readable, a PropertyNotFoundException is thrown.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The bean on which to get the property.
property - The name of the property to get. Will be coerced to a String.
Returns:
If the propertyResolved property of ELContext was set to true, then the value of the given property. Otherwise, undefined.
Throws:
NullPointerException - if context is null.
PropertyNotFoundException - if base is not null and the specified property does not exist or is not readable.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public void setValue(ELContext context, Object base, Object property, Object val)
如果 base 对象不为 null，则尝试设置此 Bean 上给定属性的值。

如果 base 不为 null，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者可以放心地假定没有设置任何值。

如果此解析器以只读模式构造，则此方法将总是抛出 PropertyNotWritableException。

提供的属性名称将首先强制匹配为 String。如果属性是 base（按照 JavaBean 规范）的可写属性，则调用设置方法（传递 value）。如果该属性存在，但没有设置方法，则抛出 PropertyNotFoundException。如果该属性不存在，则抛出 PropertyNotFoundException。

context | 此计算的上下文。
base | 要设置属性的 Bean。
property | 要设置的属性的名称。将强制匹配为 String。
val | 要关联到指定键的值。
Throws | NullPointerException: 如果 context 为 null。
Throws | PropertyNotFoundException: 如果 base 不为 null，并且指定的属性不存在。
Throws | PropertyNotWritableException: 如果此解析器以只读模式构造，或没有用于该属性的设置方法。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object val)
If the base object is not null, attempts to set the value of the given property on this bean.

If the base is not null, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller can safely assume no value was set.

If this resolver was constructed in read-only mode, this method will always throw PropertyNotWritableException.

The provided property name will first be coerced to a String. If property is a writable property of base (as per the JavaBeans Specification), the setter method is called (passing value). If the property exists but does not have a setter, then a PropertyNotFoundException is thrown. If the property does not exist, a PropertyNotFoundException is thrown.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The bean on which to set the property.
property - The name of the property to set. Will be coerced to a String.
val - The value to be associated with the specified key.
Throws:
NullPointerException - if context is null.
PropertyNotFoundException - if base is not null and the specified property does not exist.
PropertyNotWritableException - if this resolver was constructed in read-only mode, or if there is no setter for the property.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public boolean isReadOnly(ELContext context, Object base, Object property)
如果 base 对象不为 null，则返回对 #setValue 的调用是否总是失败。

如果 base 不为 null，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者可以放心地假定没有设置任何值。

如果此解析器以只读模式构造，则此方法将总是返回 true。

提供的属性名称将首先强制匹配为 String。如果属性为 base 的可写属性，则返回 false。如果找到该属性但该属性不可写，则返回 true。如果找不到该属性，则抛出 PropertyNotFoundException。

context | 此计算的上下文。
base | 要分析的 Bean。
property | 要分析的属性名称。将强制匹配为 String。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则调用 setValue 方法总是失败的情况下返回 true，该调用可能成功的情况下返回 false；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果 base 不为 null，并且指定的属性不存在。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
If the base object is not null, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.

If the base is not null, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller can safely assume no value was set.

If this resolver was constructed in read-only mode, this method will always return true.

The provided property name will first be coerced to a String. If property is a writable property of base, false is returned. If the property is found but is not writable, true is returned. If the property is not found, a PropertyNotFoundException is thrown.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - The bean to analyze.
property - The name of the property to analyzed. Will be coerced to a String.
Returns:
If the propertyResolved property of ELContext was set to true, then true if calling the setValue method will always fail or false if it is possible that such a call may succeed; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if base is not null and the specified property does not exist.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public java.util.Iterator<E> getFeatureDescriptors(ELContext context, Object base)
如果 base 对象不为 null，则返回包含给定对象上可用 JavaBean 属性集的 Iterator。否则返回 null。

返回的 Iterator 必须包含 0 个或多个 java.beans.FeatureDescriptor 实例。每个 info 对象包含有关 bean 中某个属性的信息，该信息可以调用 BeanInfo.getPropertyDescriptors 方法获取。使用与 PropertyDescriptor 中的字段相同的字段初始化 FeatureDescriptor，并且需要将指定的属性 "type" 和 "resolvableAtDesignTime" 设置如下：

  • ELResolver#TYPE - 属性的运行时类型，可通过 PropertyDescriptor.getPropertyType() 获取。
  • ELResolver#RESOLVABLE_AT_DESIGN_TIME - true。

    • context | 此计算的上下文。
base | 要分析的 Bean。
return | 包含 0 个或多个 FeatureDescriptor 对象的 Iterator，每个对象都代表此 Bean 上的一个属性；如果 base 对象为 null，则返回 null。
    英文文档：

    getFeatureDescriptors

    public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
    If the base object is not null, returns an Iterator containing the set of JavaBeans properties available on the given object. Otherwise, returns null.

    The Iterator returned must contain zero or more instances of FeatureDescriptor. Each info object contains information about a property in the bean, as obtained by calling the BeanInfo.getPropertyDescriptors method. The FeatureDescriptor is initialized using the same fields as are present in the PropertyDescriptor, with the additional required named attributes "type" and "resolvableAtDesignTime" set as follows:

  • ELResolver.TYPE - The runtime type of the property, from PropertyDescriptor.getPropertyType().
  • ELResolver.RESOLVABLE_AT_DESIGN_TIME - true.

    • Specified by:
    getFeatureDescriptors in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - The bean to analyze.
    Returns:
    An Iterator containing zero or more FeatureDescriptor objects, each representing a property on this bean, or null if the base object is null.
    See Also:
    FeatureDescriptor

    public Class<T> getCommonPropertyType(ELContext context, Object base)
    如果 base 对象不为 null，则返回对于 property 参数此解析器可接受的最一般类型。否则返回 null。

    如果 base 对象不为 null，则此方法将总是返回 Object.class。这是因为任何对象都可以作为密钥被接受并且被强制匹配为一个字符串。

    context | 此计算的上下文。
base | 要分析的 Bean。
return | 如果 base 为 null，则返回 null；否则返回 Object.class。
    英文文档：

    getCommonPropertyType

    public Class<?> getCommonPropertyType(ELContext context,
                                      Object base)
    If the base object is not null, returns the most general type that this resolver accepts for the property argument. Otherwise, returns null.

    Assuming the base is not null, this method will always return Object.class. This is because any object is accepted as a key and is coerced into a string.

    Specified by:
    getCommonPropertyType in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - The bean to analyze.
    Returns:
    null if base is null; otherwise Object.class.
    Overview Package Class Tree Deprecated Index Help
    PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanELResolver.BeanProperties (Java EE 5)

javax.el
Class BeanELResolver.BeanProperties

java.lang.Object
    extended by  javax.el.BeanELResolver.BeanProperties
Enclosing class:
BeanELResolver
protected static final class BeanELResolver.BeanProperties
extends Object

Contained within: BeanELResolver

英文文档：

Constructor Summary
BeanELResolver.BeanProperties(Class<?> baseClass)
Method Summary
 BeanELResolver.BeanProperty getBeanProperty(String property)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

英文文档：

BeanELResolver.BeanProperties

public BeanELResolver.BeanProperties(Class<?> baseClass)
Method Detail

public BeanELResolver.BeanProperty getBeanProperty(String property)
英文文档：

getBeanProperty

public BeanELResolver.BeanProperty getBeanProperty(String property)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BeanELResolver.BeanProperty (Java EE 5)

javax.el
Class BeanELResolver.BeanProperty

java.lang.Object
    extended by  javax.el.BeanELResolver.BeanProperty
Enclosing class:
BeanELResolver
protected static final class BeanELResolver.BeanProperty
extends Object

Contained within: BeanELResolver

英文文档：

Constructor Summary
BeanELResolver.BeanProperty(Class<?> baseClass, PropertyDescriptor descriptor)
Method Summary
Class | getPropertyType()
Method | getReadMethod()
Method | getWriteMethod()
boolean | isReadOnly()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

英文文档：

BeanELResolver.BeanProperty

public BeanELResolver.BeanProperty(Class<?> baseClass,
                                   PropertyDescriptor descriptor)
Method Detail

public Class<T> getPropertyType()
英文文档：

getPropertyType

public Class getPropertyType()

public boolean isReadOnly()
英文文档：

isReadOnly

public boolean isReadOnly()

public Method getReadMethod()
英文文档：

getReadMethod

public Method getReadMethod()

public Method getWriteMethod()
英文文档：

getWriteMethod

public Method getWriteMethod()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CompositeELResolver (Java EE 5)

javax.el
Class CompositeELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.el.CompositeELResolver

public class CompositeELResolver
extends ELResolver

Extends: ELResolver

维护一个按顺序排列的子 ELResolver 的复合列表。

尽管只有一个 ELResolver 与 ELContext 关联，但对于任何给定的变量或属性解析，通常可以使用多个解析器。ELResolver 使用 CompositeELResolver 连接到一起，以定义丰富语义来计算表达式。

对于 #getValue、#getType、#setValue 和 #isReadOnly 方法，ELResolver 不负责解析所有可能的 (base, property) 对。实际上，大部分解析器将仅能处理一种类型的 base。要指示解析器能够成功的解析特定 (base, property) 对，它必须将 ELContext 的 propertyResolved 属性设置为 true。如果它无法处理给定对，则必须保持此属性不变。如果 propertyResolved 为 false，则调用者必须忽略该方法的返回值。

CompositeELResolver 将 ELContext.propertyResolved 标志初始化为 false，并将其用作迭代其解析器组件的一个停止条件。

设计时方法 #getFeatureDescriptors 和 #getCommonPropertyType 不使用 ELContext.propertyResolved 标志。而是从所有子 ELResolver 中进行收集和组合形成这些方法的结果。

since | JSP 2.1
See also | javax.el.ELContext, javax.el.ELResolver
英文文档：

Maintains an ordered composite list of child ELResolvers.

Though only a single ELResolver is associated with an ELContext, there are usually multiple resolvers considered for any given variable or property resolution. ELResolvers are combined together using a CompositeELResolver, to define rich semantics for evaluating an expression.

For the getValue(javax.el.ELContext, java.lang.Object, java.lang.Object), getType(javax.el.ELContext, java.lang.Object, java.lang.Object), setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) and isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object) methods, an ELResolver is not responsible for resolving all possible (base, property) pairs. In fact, most resolvers will only handle a base of a single type. To indicate that a resolver has successfully resolved a particular (base, property) pair, it must set the propertyResolved property of the ELContext to true. If it could not handle the given pair, it must leave this property alone. The caller must ignore the return value of the method if propertyResolved is false.

The CompositeELResolver initializes the ELContext.propertyResolved flag to false, and uses it as a stop condition for iterating through its component resolvers.

The ELContext.propertyResolved flag is not used for the design-time methods getFeatureDescriptors(javax.el.ELContext, java.lang.Object) and getCommonPropertyType(javax.el.ELContext, java.lang.Object). Instead, results are collected and combined from all child ELResolvers for these methods.

Since:
JSP 2.1
See Also:
ELContext, ELResolver

Field Summary
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
CompositeELResolver()
Method Summary
 void add(ELResolver elResolver)
Adds the given resolver to the list of component resolvers.
 Class<?> getCommonPropertyType(ELContext context, Object base)
Returns the most general type that this resolver accepts for the property argument, given a base object.
 Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
Returns information about the set of variables or properties that can be resolved for the given base object.
 Class<?> getType(ELContext context, Object base, Object property)
For a given base and property, attempts to identify the most general type that is acceptable for an object to be passed as the value parameter in a future call to the setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) method.
 Object getValue(ELContext context, Object base, Object property)
Attempts to resolve the given property object on the given base object by querying all component resolvers.
 boolean isReadOnly(ELContext context, Object base, Object property)
For a given base and property, attempts to determine whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
 void setValue(ELContext context, Object base, Object property, Object val)
Attempts to set the value of the given property object on the given base object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public CompositeELResolver()
英文文档：

CompositeELResolver

public CompositeELResolver()
Method Detail

public void add(ELResolver elResolver)
将给定的解析器添加到解析器组件列表中。

将按添加的顺序参考解析器。

elResolver | 要添加的解析器组件。
Throws | NullPointerException: 如果提供的解析器为 null。
英文文档：

add

public void add(ELResolver elResolver)
Adds the given resolver to the list of component resolvers.

Resolvers are consulted in the order in which they are added.

Parameters:
elResolver - The component resolver to add.
Throws:
NullPointerException - If the provided resolver is null.

public Object getValue(ELContext context, Object base, Object property)
尝试通过查询所有解析器组件解析给定 base 对象上的给定 property 对象。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

首先，在提供的 ELContext 上将 propertyResolved 设置为 false。

接下来，对于此组合中的每个解析器组件：

  1. 调用 getValue() 方法，传入提供的 context、base 和 property。
  2. 如果 ELContext 的 propertyResolved 标志为 false，则继续迭代。
  3. 否则，迭代将停止，并不再考虑其他解析器组件。此方法返回 getValue() 返回的值。

如果没有一个解析器组件能够执行此操作，则返回值 null，并且 propertyResolved 标志仍然设置为 false。

迭代期间解析器组件抛出的任何异常都将传播到此方法的调用者。

context | 此计算的上下文。
base | 将返回属性值的 base 对象；或者为 null，表示解析顶级变量。
property | 要解析的属性或变量。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回变量或属性解析的结果；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在或不可读。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
Attempts to resolve the given property object on the given base object by querying all component resolvers.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

First, propertyResolved is set to false on the provided ELContext.

Next, for each component resolver in this composite:

  1. The getValue() method is called, passing in the provided context, base and property.
  2. If the ELContext's propertyResolved flag is false then iteration continues.
  3. Otherwise, iteration stops and no more component resolvers are considered. The value returned by getValue() is returned by this method.

If none of the component resolvers were able to perform this operation, the value null is returned and the propertyResolved flag remains set to false

.

Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be returned, or null to resolve a top-level variable.
property - The property or variable to be resolved.
Returns:
If the propertyResolved property of ELContext was set to true, then the result of the variable or property resolution; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist or is not readable.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public Class<T> getType(ELContext context, Object base, Object property)
对于给定的 base 和 property，尝试标识最一般的对象类型，该类型对于将来调用 #setValue 方法时作为 value 参数传递的对象而言是可接受的。将通过查询所有解析器组件获取结果。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

首先，在提供的 ELContext 上将 propertyResolved 设置为 false。

接下来，对于此组合中的每个组件解析器：

  1. 调用 getType() 方法，传入提供的 context、base 和 property。
  2. 如果 ELContext 的 propertyResolved 标志为 false，则继续迭代。
  3. 否则，迭代将停止，并不再考虑其他解析器组件。此方法返回 getType() 返回的值。

如果没有一个解析器组件能够执行此操作，则返回值 null，并且 propertyResolved 标志仍然设置为 false。

迭代期间解析器组件抛出的任何异常都将传播到此方法的调用者。

context | 此计算的上下文。
base | 将分析属性值的 base 对象；或者为 null，表示分析顶级变量。
property | 要返回可接受类型的属性或变量。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回最一般的可接受类型；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在或不可读。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getType

public Class<?> getType(ELContext context,
                        Object base,
                        Object property)
For a given base and property, attempts to identify the most general type that is acceptable for an object to be passed as the value parameter in a future call to the setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) method. The result is obtained by querying all component resolvers.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

First, propertyResolved is set to false on the provided ELContext.

Next, for each component resolver in this composite:

  1. The getType() method is called, passing in the provided context, base and property.
  2. If the ELContext's propertyResolved flag is false then iteration continues.
  3. Otherwise, iteration stops and no more component resolvers are considered. The value returned by getType() is returned by this method.

If none of the component resolvers were able to perform this operation, the value null is returned and the propertyResolved flag remains set to false

.

Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be analyzed, or null to analyze a top-level variable.
property - The property or variable to return the acceptable type for.
Returns:
If the propertyResolved property of ELContext was set to true, then the most general acceptable type; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist or is not readable.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public void setValue(ELContext context, Object base, Object property, Object val)
尝试在给定的 base 对象上设置给定的 property 对象的值。要求所有解析器组件尝试设置此值。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者可以放心地假定没有设置任何值。

首先，在提供的 ELContext 上将 propertyResolved 设置为 false。

接下来，对于此组合中的每个解析器组件：

  1. 调用 setValue() 方法，传入提供的 context、base、property 和 value。
  2. 如果 ELContext 的 propertyResolved 标志为 false，则继续迭代。
  3. 否则，迭代将停止，并不再考虑其他解析器组件。

如果没有一个解析器组件能够执行此操作，则 propertyResolved 标志仍然设置为 false。

迭代期间解析器组件抛出的任何异常都将传播到此方法的调用者。

context | 此计算的上下文。
base | 将设置属性值的 base 对象；或者为 null，表示设置顶级变量。
property | 要设置的属性或变量。
val | 用于设置属性或变量的值。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在。
Throws | PropertyNotWritableException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定的变量或属性不可写。
Throws | ELException: 如果尝试设置属性或变量时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object val)
Attempts to set the value of the given property object on the given base object. All component resolvers are asked to attempt to set the value.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller can safely assume no value has been set.

First, propertyResolved is set to false on the provided ELContext.

Next, for each component resolver in this composite:

  1. The setValue() method is called, passing in the provided context, base, property and value.
  2. If the ELContext's propertyResolved flag is false then iteration continues.
  3. Otherwise, iteration stops and no more component resolvers are considered.

If none of the component resolvers were able to perform this operation, the propertyResolved flag remains set to false

.

Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be set, or null to set a top-level variable.
property - The property or variable to be set.
val - The value to set the property or variable to.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist.
PropertyNotWritableException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property is not writable.
ELException - if an exception was thrown while attempting to set the property or variable. The thrown exception must be included as the cause property of this exception, if available.

public boolean isReadOnly(ELContext context, Object base, Object property)
对于给定的 base 和 property，尝试确定调用 #setValue 是否将总是失败。将通过查询所有解析器组件获取结果。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

首先，在提供的 ELContext 上将 propertyResolved 设置为 false。

接下来，对于此组合中的每个解析器组件：

  1. 调用 isReadOnly() 方法，传入提供的 context、base 和 property。
  2. 如果 ELContext 的 propertyResolved 标志为 false，则继续迭代。
  3. 否则，迭代将停止，并不再考虑其他解析器组件。此方法返回 isReadOnly() 返回的值。

如果没有一个解析器组件能够执行此操作，则返回值 false，并且 propertyResolved 标志仍然设置为 false。

迭代期间解析器组件抛出的任何异常都将传播到此方法的调用者。

context | 此计算的上下文。
base | 将分析属性值的 base 对象；或者为 null，表示分析顶级变量。
property | 要返回只读状态的属性或变量。
return | 如果 ELContext 的 propertyResolved 属性被设置为 true，则在属性为只读的情况下返回 true，在非只读的情况下返回 false；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
For a given base and property, attempts to determine whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail. The result is obtained by querying all component resolvers.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

First, propertyResolved is set to false on the provided ELContext.

Next, for each component resolver in this composite:

  1. The isReadOnly() method is called, passing in the provided context, base and property.
  2. If the ELContext's propertyResolved flag is false then iteration continues.
  3. Otherwise, iteration stops and no more component resolvers are considered. The value returned by isReadOnly() is returned by this method.

If none of the component resolvers were able to perform this operation, the value false is returned and the propertyResolved flag remains set to false

.

Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be analyzed, or null to analyze a top-level variable.
property - The property or variable to return the read-only status for.
Returns:
If the propertyResolved property of ELContext was set to true, then true if the property is read-only or false if not; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public java.util.Iterator<E> getFeatureDescriptors(ELContext context, Object base)
返回可以为给定 base 对象解析的变量或属性集的有关信息。此方法可以用于自动完成的辅助工具。结果将从所有解析器组件搜集得来。

ELContext 的 propertyResolved 属性与此方法无关。所有 ELResolver 的结果都连在一起。

返回的 Iterator 是一个迭代器，它对每个解析器组件的 getFeatureDescriptors 方法所返回迭代器返回的 FeatureDescriptor 对象 Collection 进行迭代。如果解析器返回 null，则跳过。

context | 此计算的上下文。
base | 要枚举有效属性集合的 base 对象；或者为 null，表示枚举此解析器可以计算的顶级变量集合。
return | 包含 0 个或多个（可能无限多个）FeatureDescriptor 对象的 Iterator；如果此解析器不处理给定的 base 对象，或者结果太复杂而无法用此方法表示，则返回 null
英文文档：

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
Returns information about the set of variables or properties that can be resolved for the given base object. One use for this method is to assist tools in auto-completion. The results are collected from all component resolvers.

The propertyResolved property of the ELContext is not relevant to this method. The results of all ELResolvers are concatenated.

The Iterator returned is an iterator over the collection of FeatureDescriptor objects returned by the iterators returned by each component resolver's getFeatureDescriptors method. If null is returned by a resolver, it is skipped.

Specified by:
getFeatureDescriptors in class ELResolver
Parameters:
context - The context of this evaluation.
base - The base object whose set of valid properties is to be enumerated, or null to enumerate the set of top-level variables that this resolver can evaluate.
Returns:
An Iterator containing zero or more (possibly infinitely more) FeatureDescriptor objects, or null if this resolver does not handle the given base object or that the results are too complex to represent with this method
See Also:
FeatureDescriptor

public Class<T> getCommonPropertyType(ELContext context, Object base)
在给定 base 对象的情况下，返回对于 property 参数此解析器可以接受的最一般类型。此方法可以用于自动完成的辅助工具。将通过查询所有解析器组件获取结果。

返回的 Class 是最具体的类，它是每个解析器组件的 getCommonPropertyType 方法所返回的所有类中的一个常见超类。如果解析器返回 null，则跳过。

context | 此计算的上下文。
base | 要返回最一般属性类型的 base 对象；或者为 null，表示枚举此解析器可以计算的顶级变量集合。
return | 如果此 ELResolver 不了解如何处理给定的 base 对象，则返回 null；否则，如果接受任何 property 类型，则返回 Object.class；其他情况下，返回给定 base 可接受的最一般的 property 类型。
英文文档：

getCommonPropertyType

public Class<?> getCommonPropertyType(ELContext context,
                                      Object base)
Returns the most general type that this resolver accepts for the property argument, given a base object. One use for this method is to assist tools in auto-completion. The result is obtained by querying all component resolvers.

The Class returned is the most specific class that is a common superclass of all the classes returned by each component resolver's getCommonPropertyType method. If null is returned by a resolver, it is skipped.

Specified by:
getCommonPropertyType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The base object to return the most general property type for, or null to enumerate the set of top-level variables that this resolver can evaluate.
Returns:
null if this ELResolver does not know how to handle the given base object; otherwise Object.class if any type of property is accepted; otherwise the most general property type accepted for the given base.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ELContext (Java EE 5)

javax.el
Class ELContext

java.lang.Object
    extended by  javax.el.ELContext

public abstract class ELContext
extends Object

表达式求值的上下文信息。

若要求一个 Expression 的值，必须提供一个 ELContext。ELContext 包含：

  • 对 base ELResolver 的引用，将参考该 base 来解析模型对象及其属性
  • 对 FunctionMapper 的引用，它将用来解析 EL 函数。
  • 对 VariableMapper 的引用，它将用来解析 EL 变量。
  • ELResolver 使用的所有相关上下文对象所组成的 Collection
  • 表达式求值期间的状态信息，如属性是否已被解析

上下文对象 Collection 是必需的，因为每个 ELResolver 可能需要访问不同的上下文对象。例如，JSP 和 Faces 解析器分别需要访问 javax.servlet.jsp.JspContext 和 javax.faces.context.FacesContext。

通过底层技术可以控制 ELContext 对象的创建。例如，在 JSP 中，使用 JspContext.getELContext() 工厂方法。某些技术提供添加 ELContextListener 的功能，以便应用程序和框架可以确保其自己的上下文对象连接到任何新建的 ELContext。

由于它存储表达式求值期间的状态，因此 ELContext 对象不是线程安全的对象。请注意，不要在两个或多个线程之间共享 ELContext 实例。

since | JSP 2.1
See also | javax.el.ELContextListener, javax.el.ELContextEvent, javax.el.ELResolver, javax.el.FunctionMapper, javax.el.VariableMapper, javax.servlet.jsp.JspContext
英文文档：

Context information for expression evaluation.

To evaluate an Expression, an ELContext must be provided. The ELContext holds:

  • a reference to the base ELResolver that will be consulted to resolve model objects and their properties
  • a reference to FunctionMapper that will be used to resolve EL Functions.
  • a reference to VariableMapper that will be used to resolve EL Variables.
  • a collection of all the relevant context objects for use by ELResolvers
  • state information during the evaluation of an expression, such as whether a property has been resolved yet

The collection of context objects is necessary because each ELResolver may need access to a different context object. For example, JSP and Faces resolvers need access to a JspContext and a FacesContext, respectively.

Creation of ELContext objects is controlled through the underlying technology. For example, in JSP the JspContext.getELContext() factory method is used. Some technologies provide the ability to add an ELContextListener so that applications and frameworks can ensure their own context objects are attached to any newly created ELContext.

Because it stores state during expression evaluation, an ELContext object is not thread-safe. Care should be taken to never share an ELContext instance between two or more threads.

Since:
JSP 2.1
See Also:
ELContextListener, ELContextEvent, ELResolver, FunctionMapper, VariableMapper, JspContext

Constructor Summary
ELContext()
Method Summary
 Object getContext(Class key)
Returns the context object associated with the given key.
abstract  ELResolver getELResolver()
Retrieves the ELResolver associated with this context.
abstract  FunctionMapper getFunctionMapper()
Retrieves the FunctionMapper associated with this ELContext.
 Locale getLocale()
Get the Locale stored by a previous invocation to setLocale(java.util.Locale).
abstract  VariableMapper getVariableMapper()
Retrieves the VariableMapper associated with this ELContext.
 boolean isPropertyResolved()
Returns whether an ELResolver has successfully resolved a given (base, property) pair.
 void putContext(Class key, Object contextObject)
Associates a context object with this ELContext.
 void setLocale(Locale locale)
Set the Locale for this instance.
 void setPropertyResolved(boolean resolved)
Called to indicate that a ELResolver has successfully resolved a given (base, property) pair.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ELContext()
英文文档：

ELContext

public ELContext()
Method Detail

public void setPropertyResolved(boolean resolved)
调用此方法指示 ELResolver 已成功解析了给定的 (base, property) 对。

CompositeELResolver 检查此属性，以确定是考虑还是跳过其他解析器组件。

resolved | 如果该属性已被解析，则返回 true；否则返回 false。
See also | javax.el.CompositeELResolver
英文文档：

setPropertyResolved

public void setPropertyResolved(boolean resolved)
Called to indicate that a ELResolver has successfully resolved a given (base, property) pair.

The CompositeELResolver checks this property to determine whether it should consider or skip other component resolvers.

Parameters:
resolved - true if the property has been resolved, or false if not.
See Also:
CompositeELResolver

public boolean isPropertyResolved()
返回 ELResolver 是否已成功解析了给定的 (base, property) 对。

CompositeELResolver 检查此属性，以确定是考虑还是跳过其他解析器组件。

return | 如果该属性已被解析，则返回 true；否则返回 false。
See also | javax.el.CompositeELResolver
英文文档：

isPropertyResolved

public boolean isPropertyResolved()
Returns whether an ELResolver has successfully resolved a given (base, property) pair.

The CompositeELResolver checks this property to determine whether it should consider or skip other component resolvers.

Returns:
true if the property has been resolved, or false if not.
See Also:
CompositeELResolver

public void putContext(Class<T> key, Object contextObject)
将上下文对象与此 ELContext 关联。

ELContext 维护与表达式计算相关的上下文对象的 Collection。这些上下文对象由 ELResolver 使用。使用此方法向该 Collection 中添加上下文对象。

按照惯例，contextObject 将为 key 指定的类型。但是，并不要求这样做，键将被严格地用作唯一标识符。

key | ELResolver 用来标识此上下文对象的键。
contextObject | 要添加到 Collection 的上下文对象。
Throws | NullPointerException: 如果 key 为 null 或者 contextObject 为 null。
英文文档：

putContext

public void putContext(Class key,
                       Object contextObject)
Associates a context object with this ELContext.

The ELContext maintains a collection of context objects relevant to the evaluation of an expression. These context objects are used by ELResolvers. This method is used to add a context object to that collection.

By convention, the contextObject will be of the type specified by the key. However, this is not required and the key is used strictly as a unique identifier.

Parameters:
key - The key used by an @{link ELResolver} to identify this context object.
contextObject - The context object to add to the collection.
Throws:
NullPointerException - if key is null or contextObject is null.

public Object getContext(Class<T> key)
返回与给定键关联的上下文对象。

ELContext 维护与表达式计算相关的上下文对象的 Collection。这些上下文对象由 ELResolver 使用。使用此方法从 Collection 中获取具有给定键的上下文。

按照惯例，返回的对象将为 key 指定的类型。但是，并不要求这样做，键将被严格地用作唯一标识符。

key | 用于将上下文对象与此 ELContext 关联的唯一标识符。
return | 返回与给定键关联的上下文对象；如果没有找到这样的上下文，则返回 null。
Throws | NullPointerException: 如果 key 为 null。
英文文档：

getContext

public Object getContext(Class key)
Returns the context object associated with the given key.

The ELContext maintains a collection of context objects relevant to the evaluation of an expression. These context objects are used by ELResolvers. This method is used to retrieve the context with the given key from the collection.

By convention, the object returned will be of the type specified by the key. However, this is not required and the key is used strictly as a unique identifier.

Parameters:
key - The unique identifier that was used to associate the context object with this ELContext.
Returns:
The context object associated with the given key, or null if no such context was found.
Throws:
NullPointerException - if key is null.

abstract public ELResolver getELResolver()
获取与此上下文关联的 ELResolver。

ELContext 维护对 ELResolver 的引用，在表达式求值期间将参考 ELResolver 来解析变量和属性。此方法获取对解析器的引用。

构建了 ELContext 之后，将无法更改对与上下文关联的 ELResolver 的引用。

return 表达式求值期间解析变量和属性时要参考的解析器。
英文文档：

getELResolver

public abstract ELResolver getELResolver()
Retrieves the ELResolver associated with this context.

The ELContext maintains a reference to the ELResolver that will be consulted to resolve variables and properties during an expression evaluation. This method retrieves the reference to the resolver.

Once an ELContext is constructed, the reference to the ELResolver associated with the context cannot be changed.

Returns:
The resolver to be consulted for variable and property resolution during expression evaluation.

abstract public FunctionMapper getFunctionMapper()
获取与此 ELContext 关联的 FunctionMapper。
return 解析 EL 函数时要参考的函数映射器。
英文文档：

getFunctionMapper

public abstract FunctionMapper getFunctionMapper()
Retrieves the FunctionMapper associated with this ELContext.

Returns:
The function mapper to be consulted for the resolution of EL functions.

public java.util.Locale getLocale()
获取以前调用 #setLocale 存储的 Locale。如果此方法返回非 null 值，则实现中所需的所有本地化都必须使用此 Locale。因为考虑到会动态更改 Locale 的应用程序，Locale 不得缓存。
return 运行此实例的 Locale。主要用于消息本地化。
英文文档：

getLocale

public Locale getLocale()
Get the Locale stored by a previous invocation to setLocale(java.util.Locale). If this method returns non null, this Locale must be used for all localization needs in the implementation. The Locale must not be cached to allow for applications that change Locale dynamically.

Returns:
The Locale in which this instance is operating. Used primarily for message localization.

public void setLocale(java.util.Locale locale)
设置此实例的 Locale。创建实例（如 JavaServer Faces 或 JSP）的一方可以调用该方法，使 EL 实现能够为用户提供已本地化的消息。如果未设置 Locale，则实现必须使用 Locale.getDefault( ) 所返回的语言环境。
英文文档：

setLocale

public void setLocale(Locale locale)
Set the Locale for this instance. This method may be called by the party creating the instance, such as JavaServer Faces or JSP, to enable the EL implementation to provide localized messages to the user. If no Locale is set, the implementation must use the locale returned by Locale.getDefault( ).

abstract public VariableMapper getVariableMapper()
获取与此 ELContext 关联的 VariableMapper。
return 解析 EL 变量时要参考的变量映射器。
英文文档：

getVariableMapper

public abstract VariableMapper getVariableMapper()
Retrieves the VariableMapper associated with this ELContext.

Returns:
The variable mapper to be consulted for the resolution of EL variables.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ELContextEvent (Java EE 5)

javax.el
Class ELContextEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.el.ELContextEvent
All Implemented Interfaces:
Serializable
public class ELContextEvent
extends EventObject

Extends: java.util.EventObject

指示已经创建了一个 ELContext 的事件。源对象是创建的 ELContext。
since | JSP 2.1
See also | javax.el.ELContext, javax.el.ELContextListener
英文文档：

An event which indicates that an ELContext has been created. The source object is the ELContext that was created.

Since:
JSP 2.1
See Also:
ELContext, ELContextListener, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ELContextEvent(ELContext source)
Constructs an ELContextEvent object to indicate that an ELContext has been created.
Method Summary
 ELContext getELContext()
Returns the ELContext that was created.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ELContextEvent(ELContext source)
构造一个 ELContextEvent 对象，以指示已经创建了一个 ELContext。
source 创建的 ELContext。
英文文档：

ELContextEvent

public ELContextEvent(ELContext source)
Constructs an ELContextEvent object to indicate that an ELContext has been created.

Parameters:
source - the ELContext that was created.
Method Detail

public ELContext getELContext()
返回创建的 ELContext。这是等效于 #getSource 方法的类型安全的方法。
return 创建的 ELContext。
英文文档：

getELContext

public ELContext getELContext()
Returns the ELContext that was created. This is a type-safe equivalent of the EventObject.getSource() method.

Returns:
the ELContext that was created.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ELResolver (Java EE 5)

javax.el
Class ELResolver

java.lang.Object
    extended by  javax.el.ELResolver
Direct Known Subclasses:
ArrayELResolver, BeanELResolver, CompositeELResolver, ImplicitObjectELResolver, ListELResolver, MapELResolver, ResourceBundleELResolver, ScopedAttributeELResolver
public abstract class ELResolver
extends Object

Extended by: ArrayELResolver, BeanELResolver, CompositeELResolver, ListELResolver, MapELResolver, ResourceBundleELResolver

能够自定义 EL 表达式求值的变量和属性解析行为。

对一个表达式进行求值时，参考与 ELContext 关联的 ELResolver，以对表达式的第一个变量进行初始解析。遇到 . 或 [] 操作符时也要参考它，但方法表达式中最后一个这样的操作符除外，因为在这种情况下解析规则是固定编码的。

例如，在 EL 表达式 ${employee.lastName} 中，ELResolver 确定 employee 引用的对象，以及获取该对象 lastName 属性的含义。

此类中的大多数方法都接受 base 和 property 参数。如果是变量解析（例如，确定 ${employee.lastName} 中 employee 引用的内容），则 base 参数将为 null，property 参数将总是为 String 类型。这种情况下，如果 property 不是 String，则 ELResolver 的行为未定义。

如果是属性解析，则 base 参数标识 base 对象，property 对象标识 base 上的属性。例如，在表达式 ${employee.lastName} 中，base 是 employee 变量解析的结果，property 是字符串 "lastName"。在表达式 ${y[x]} 中，base 是 y 变量解析的结果，property 是 x 变量解析的结果。

尽管只有一个 ELResolver 与 ELContext 关联，但对于任何给定的变量或属性解析，通常可以使用多个解析器。ELResolver 使用 CompositeELResolver 连接到一起，以定义丰富语义来计算表达式。

对于 #getValue、#getType、#setValue 和 #isReadOnly 方法，ELResolver 不负责解析所有可能的 (base, property) 对。实际上，大部分解析器将仅能处理一种类型的 base。要指示解析器成功地解析特定 (base, property) 对，它必须将 ELContext 的 propertyResolved 属性设置为 true。如果它无法处理给定对，则必须保持此属性不变。如果 propertyResolved 为 false，则调用者必须忽略该方法的返回值。

设计 #getFeatureDescriptors 和 #getCommonPropertyType 方法的主要目的是支持设计时工具，但它们也必须在运行时处理调用。可以使用 java.beans.Beans#isDesignTime 方法确定是否在设计时（或运行时）参考了解析器。

since | JSP 2.1
See also | javax.el.CompositeELResolver, getELResolver
英文文档：

Enables customization of variable and property resolution behavior for EL expression evaluation.

While evaluating an expression, the ELResolver associated with the ELContext is consulted to do the initial resolution of the first variable of an expression. It is also consulted when a . or [] operator is encountered, except for the last such operator in a method expression, in which case the resultion rules are hard coded.

For example, in the EL expression ${employee.lastName}, the ELResolver determines what object employee refers to, and what it means to get the lastName property on that object.

Most methods in this class accept a base and property parameter. In the case of variable resolution (e.g. determining what employee refers to in ${employee.lastName}), the base parameter will be null and the property parameter will always be of type String. In this case, if the property is not a String, the behavior of the ELResolver is undefined.

In the case of property resolution, the base parameter identifies the base object and the property object identifies the property on that base. For example, in the expression ${employee.lastName}, base is the result of the variable resolution for employee and property is the string "lastName". In the expression ${y[x]}, base is the result of the variable resolution for y and property is the result of the variable resolution for x.

Though only a single ELResolver is associated with an ELContext, there are usually multiple resolvers considered for any given variable or property resolution. ELResolvers are combined together using CompositeELResolvers, to define rich semantics for evaluating an expression.

For the getValue(javax.el.ELContext, java.lang.Object, java.lang.Object), getType(javax.el.ELContext, java.lang.Object, java.lang.Object), setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) and isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object) methods, an ELResolver is not responsible for resolving all possible (base, property) pairs. In fact, most resolvers will only handle a base of a single type. To indicate that a resolver has successfully resolved a particular (base, property) pair, it must set the propertyResolved property of the ELContext to true. If it could not handle the given pair, it must leave this property alone. The caller must ignore the return value of the method if propertyResolved is false.

The getFeatureDescriptors(javax.el.ELContext, java.lang.Object) and getCommonPropertyType(javax.el.ELContext, java.lang.Object) methods are primarily designed for design-time tool support, but must handle invocation at runtime as well. The Beans.isDesignTime() method can be used to determine if the resolver is being consulted at design-time or runtime.

Since:
JSP 2.1
See Also:
CompositeELResolver, ELContext.getELResolver()

Field Summary
static String | RESOLVABLE_AT_DESIGN_TIME The attribute name of the named attribute in the FeatureDescriptor that specifies whether the variable or property can be resolved at runtime.
static String | TYPE The attribute name of the named attribute in the FeatureDescriptor that specifies the runtime type of the variable or property.
Constructor Summary
ELResolver()
Method Summary
abstract  Class<?> getCommonPropertyType(ELContext context, Object base)
Returns the most general type that this resolver accepts for the property argument, given a base object.
abstract  Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
Returns information about the set of variables or properties that can be resolved for the given base object.
abstract  Class<?> getType(ELContext context, Object base, Object property)
For a given base and property, attempts to identify the most general type that is acceptable for an object to be passed as the value parameter in a future call to the setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) method.
abstract  Object getValue(ELContext context, Object base, Object property)
Attempts to resolve the given property object on the given base object.
abstract  boolean isReadOnly(ELContext context, Object base, Object property)
For a given base and property, attempts to determine whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
abstract  void setValue(ELContext context, Object base, Object property, Object value)
Attempts to set the value of the given property object on the given base object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

TYPE

public static final String TYPE

The attribute name of the named attribute in the FeatureDescriptor that specifies the runtime type of the variable or property.

See Also:
Constant Field Values

英文文档：

RESOLVABLE_AT_DESIGN_TIME

public static final String RESOLVABLE_AT_DESIGN_TIME

The attribute name of the named attribute in the FeatureDescriptor that specifies whether the variable or property can be resolved at runtime.

See Also:
Constant Field Values
Constructor Detail

public ELResolver()
英文文档：

ELResolver

public ELResolver()
Method Detail

abstract public Object getValue(ELContext context, Object base, Object property)
尝试在给定的 base 对象上解析给定的 property 对象。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

context | 此计算的上下文。
base | 将返回属性值的 base 对象；或者为 null，表示解析顶级变量。
property | 要解析的属性或变量。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回变量或属性解析的结果；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在或不可读。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public abstract Object getValue(ELContext context,
                                Object base,
                                Object property)
Attempts to resolve the given property object on the given base object.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be returned, or null to resolve a top-level variable.
property - The property or variable to be resolved.
Returns:
If the propertyResolved property of ELContext was set to true, then the result of the variable or property resolution; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist or is not readable.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

abstract public Class<T> getType(ELContext context, Object base, Object property)
对于给定的 base 和 property，尝试标识最一般的对象类型，该类型对于将来调用 #setValue 方法时作为 value 参数传递的对象而言是可接受的。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

这并非总是与 getValue().getClass() 相同。例如，如果是 ArrayELResolver，则 getType 方法将返回数组的元素类型，它可能是当前指定数组元素中的实际元素类型的超类。

context | 此计算的上下文。
base | 将分析属性值的 base 对象；或者为 null，表示分析顶级变量。
property | 要返回可接受类型的属性或变量。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回最一般的可接受类型；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在或不可读。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getType

public abstract Class<?> getType(ELContext context,
                                 Object base,
                                 Object property)
For a given base and property, attempts to identify the most general type that is acceptable for an object to be passed as the value parameter in a future call to the setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) method.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

This is not always the same as getValue().getClass(). For example, in the case of an ArrayELResolver, the getType method will return the element type of the array, which might be a superclass of the type of the actual element that is currently in the specified array element.

Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be analyzed, or null to analyze a top-level variable.
property - The property or variable to return the acceptable type for.
Returns:
If the propertyResolved property of ELContext was set to true, then the most general acceptable type; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist or is not readable.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

abstract public void setValue(ELContext context, Object base, Object property, Object value)
尝试在给定的 base 对象上设置给定的 property 对象的值。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者可以放心地假定没有设置任何值。

context | 此计算的上下文。
base | 将设置属性值的 base 对象；或者为 null，表示设置顶级变量。
property | 要设置的属性或变量。
value | 用于设置属性或变量的值。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在。
Throws | PropertyNotWritableException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定的变量或属性不可写。
Throws | ELException: 如果尝试设置属性或变量时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

setValue

public abstract void setValue(ELContext context,
                              Object base,
                              Object property,
                              Object value)
Attempts to set the value of the given property object on the given base object.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller can safely assume no value has been set.

Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be set, or null to set a top-level variable.
property - The property or variable to be set.
value - The value to set the property or variable to.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist.
PropertyNotWritableException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property is not writable.
ELException - if an exception was thrown while attempting to set the property or variable. The thrown exception must be included as the cause property of this exception, if available.

abstract public boolean isReadOnly(ELContext context, Object base, Object property)
对于给定的 base 和 property，尝试确定调用 #setValue 是否将总是失败。

如果此解析器处理给定的 (base, property) 对，则在返回前，ELContext 对象的 propertyResolved 属性必须设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

context | 此计算的上下文。
base | 将分析属性值的 base 对象；或者为 null，表示分析顶级变量。
property | 要返回只读状态的属性或变量。
return | 如果 ELContext 的 propertyResolved 属性被设置为 true，则在属性为只读的情况下返回 true，在非只读的情况下返回 false；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果此 ELResolver 处理了给定的 (base, property) 对，但指定变量或属性不存在。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

isReadOnly

public abstract boolean isReadOnly(ELContext context,
                                   Object base,
                                   Object property)
For a given base and property, attempts to determine whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.

If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be analyzed, or null to analyze a top-level variable.
property - The property or variable to return the read-only status for.
Returns:
If the propertyResolved property of ELContext was set to true, then true if the property is read-only or false if not; otherwise undefined.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if the given (base, property) pair is handled by this ELResolver but the specified variable or property does not exist.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

abstract public java.util.Iterator<E> getFeatureDescriptors(ELContext context, Object base)
返回可以针对给定 base 对象进行解析的变量或属性集的有关信息。此方法可以用于自动完成的辅助工具。

如果 base 参数为 null，则解析器必须枚举它可以解析的顶级变量列表。

返回的 Iterator 必须包含 0 个或多个 java.beans.FeatureDescriptor 实例（无固定顺序）。如果是基本类型（如 int），则必须返回值 null。这样可以防止对所有可能的原始值进行无用迭代。返回值为 null 表示此解析器没有处理给定的 base 对象，或者结果太复杂而无法用此方法表示，此时应该使用 #getCommonPropertyType 方法。

每个 FeatureDescriptor 将包含有关单个变量或属性的信息。除了标准属性之外，FeatureDescriptor 必须拥有两个指定属性（通过 setValue 方法设置）：

  • #TYPE - 此指定属性的值必须是 java.lang.Class 的实例，并且必须指定变量或属性的运行时类型。
  • #RESOLVABLE_AT_DESIGN_TIME - 此指定属性的值必须是 java.lang.Boolean 的实例，并且必须指出在设计时尝试解析此属性是否安全。例如，如果 ELResolver 需要访问仅在运行时可用的资源并且没有提供可接受的模拟值，则尝试在设计时解析是不安全的。

调用者应该注意到返回的 Iterator 可能迭代非常大甚至无限大的属性集。调用者应该注意不要陷入无限循环。

这是一个最佳列表。并非所有 ELResolver 都将返回完全精确的结果，但它们都必须可以在设计时和运行时调用（即无论 Beans.isDesignTime() 是否返回 true）且不会引起错误。

ELContext 的 propertyResolved 属性与此方法无关。如果是复合解析器，则所有 ELResolver 的结果将串联在一起。

context | 此计算的上下文。
base | 要枚举有效属性集合的 base 对象；或者为 null，表示枚举此解析器可以计算的顶级变量集合。
return | 包含 0 个或多个（可能无限多个）FeatureDescriptor 对象的 Iterator；如果此解析器不处理给定的 base 对象，或者结果太复杂而无法用此方法表示，则返回 null
See also | java.beans.FeatureDescriptor
英文文档：

getFeatureDescriptors

public abstract Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                                  Object base)
Returns information about the set of variables or properties that can be resolved for the given base object. One use for this method is to assist tools in auto-completion.

If the base parameter is null, the resolver must enumerate the list of top-level variables it can resolve.

The Iterator returned must contain zero or more instances of FeatureDescriptor, in no guaranteed order. In the case of primitive types such as int, the value null must be returned. This is to prevent the useless iteration through all possible primitive values. A return value of null indicates that this resolver does not handle the given base object or that the results are too complex to represent with this method and the getCommonPropertyType(javax.el.ELContext, java.lang.Object) method should be used instead.

Each FeatureDescriptor will contain information about a single variable or property. In addition to the standard properties, the FeatureDescriptor must have two named attributes (as set by the setValue method):

  • TYPE - The value of this named attribute must be an instance of java.lang.Class and specify the runtime type of the variable or property.
  • RESOLVABLE_AT_DESIGN_TIME - The value of this named attribute must be an instance of java.lang.Boolean and indicates whether it is safe to attempt to resolve this property at design-time. For instance, it may be unsafe to attempt a resolution at design time if the ELResolver needs access to a resource that is only available at runtime and no acceptable simulated value can be provided.

The caller should be aware that the Iterator returned might iterate through a very large or even infinitely large set of properties. Care should be taken by the caller to not get stuck in an infinite loop.

This is a "best-effort" list. Not all ELResolvers will return completely accurate results, but all must be callable at both design-time and runtime (i.e. whether or not Beans.isDesignTime() returns true), without causing errors.

The propertyResolved property of the ELContext is not relevant to this method. The results of all ELResolvers are concatenated in the case of composite resolvers.

Parameters:
context - The context of this evaluation.
base - The base object whose set of valid properties is to be enumerated, or null to enumerate the set of top-level variables that this resolver can evaluate.
Returns:
An Iterator containing zero or more (possibly infinitely more) FeatureDescriptor objects, or null if this resolver does not handle the given base object or that the results are too complex to represent with this method
See Also:
FeatureDescriptor

abstract public Class<T> getCommonPropertyType(ELContext context, Object base)
在给定 base 对象的情况下，返回对于 property 参数此解析器可以接受的最一般类型。此方法可以用于自动完成的辅助工具。

此自动完成辅助工具还提供一种表示解析器接受原始值（如数组中的整数索引）的方式。例如，ArrayELResolver 将接受任何 int 作为 property，因此返回值将为 Integer.class。

context | 此计算的上下文。
base | 要返回最一般属性类型的 base 对象；或者为 null，表示枚举此解析器可以计算的顶级变量集合。
return | 如果此 ELResolver 不了解如何处理给定的 base 对象，则返回 null；否则，如果接受任何 property 类型，则返回 Object.class；其他情况下，返回给定 base 可接受的最一般的 property 类型。
英文文档：

getCommonPropertyType

public abstract Class<?> getCommonPropertyType(ELContext context,
                                               Object base)
Returns the most general type that this resolver accepts for the property argument, given a base object. One use for this method is to assist tools in auto-completion.

This assists tools in auto-completion and also provides a way to express that the resolver accepts a primitive value, such as an integer index into an array. For example, the ArrayELResolver will accept any int as a property, so the return value would be Integer.class.

Parameters:
context - The context of this evaluation.
base - The base object to return the most general property type for, or null to enumerate the set of top-level variables that this resolver can evaluate.
Returns:
null if this ELResolver does not know how to handle the given base object; otherwise Object.class if any type of property is accepted; otherwise the most general property type accepted for the given base.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Expression (Java EE 5)

javax.el
Class Expression

java.lang.Object
    extended by  javax.el.Expression
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MethodExpression, ValueExpression
public abstract class Expression
extends Object
implements Serializable

Implements: java.io.Serializable
Extended by: MethodExpression, ValueExpression

表达式子类 ValueExpression 和 MethodExpression 的基类，它实现两者共同的特性。

所有表达式必须实现 equals() 和 hashCode() 方法，以便可以比较两个表达式的相等性。在此类中它们被重定义为抽象方法，以在子类中强制实现。

所有表达式还必须是 Serializable，以便它们可以保存和存储。

Expression 还设计为不可改变，从而只需要为任何给定的表达式 String/FunctionMapper 创建一个实例。这允许容器预创建表达式，而且无需在每次对其求值时重新解析它们。

since JSP 2.1
英文文档：

Base class for the expression subclasses ValueExpression and MethodExpression, implementing characterstics common to both.

All expressions must implement the equals() and hashCode() methods so that two expressions can be compared for equality. They are redefined abstract in this class to force their implementation in subclasses.

All expressions must also be Serializable so that they can be saved and restored.

Expressions are also designed to be immutable so that only one instance needs to be created for any given expression String / FunctionMapper. This allows a container to pre-create expressions and not have to re-parse them each time they are evaluated.

Since:
JSP 2.1
See Also:
Serialized Form

Constructor Summary
Expression()
Method Summary
abstract boolean | equals(Object obj) Determines whether the specified object is equal to this Expression.
abstract String | getExpressionString() Returns the original String used to create this Expression, unmodified.
abstract int | hashCode() Returns the hash code for this Expression.
abstract boolean | isLiteralText() Returns whether this expression was created from only literal text.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Expression()
英文文档：

Expression

public Expression()
Method Detail

abstract public String getExpressionString()
返回用于创建此 Expression 的原始 String（未经修改）。

此方法不仅仅用于调试目的，而且还用于比较（例如，为了确保配置文件中的表达式尚未更改）。

此方法没有提供重新创建表达式的足够信息。两个不同的表达式可以有完全相同的表达式字符串，不同的函数映射。应该使用序列化来保存和存储 Expression 的状态。

return 原始表达式 String。
英文文档：

getExpressionString

public abstract String getExpressionString()
Returns the original String used to create this Expression, unmodified.

This is used for debugging purposes but also for the purposes of comparison (e.g. to ensure the expression in a configuration file has not changed).

This method does not provide sufficient information to re-create an expression. Two different expressions can have exactly the same expression string but different function mappings. Serialization should be used to save and restore the state of an Expression.

Returns:
The original expression String.

abstract public boolean equals(Object obj)
确定指定的对象是否等于此 Expression。

当且仅当参数不是 null 而是相同类型（ValueExpression 或 MethodExpression）的 Expression 对象，且解析的表示形式相同时，结果为 true。

注意，即使两个表达式的表达式 String 不同，这两个表达式也可以相等。例如，如果相应的 FunctionMapper 将 fn1:foo 和 fn2:foo 映射到同一方法，则 ${fn1:foo()} 和 ${fn2:foo()} 相等。

obj | 要测试相等性的 Object。
return | 如果 obj 等于此 Expression，则返回 true；否则返回 false。
See also | java.util.Hashtable, equals(java.lang.Object)
英文文档：

equals

public abstract boolean equals(Object obj)
Determines whether the specified object is equal to this Expression.

The result is true if and only if the argument is not null, is an Expression object that is the of the same type (ValueExpression or MethodExpression), and has an identical parsed representation.

Note that two expressions can be equal if their expression Strings are different. For example, ${fn1:foo()} and ${fn2:foo()} are equal if their corresponding FunctionMappers mapped fn1:foo and fn2:foo to the same method.

Overrides:
equals in class Object
Parameters:
obj - the Object to test for equality.
Returns:
true if obj equals this Expression; false otherwise.
See Also:
Hashtable, Object.equals(java.lang.Object)

abstract public int hashCode()
返回此 Expression 的哈希码。

有关两个表达式的表达式 String 不同时如何才能相等，请参阅 #equals 方法中的说明。记住，如果根据 equals(Object) 方法，两个对象是相等的，那么对这两个对象中的每个对象调用 hashCode 方法都必须生成相同的整数结果。必须特别注意实现并且正确实现 hashCode。

return | 此 Expression 的哈希码。
See also | equals, java.util.Hashtable, hashCode()
英文文档：

hashCode

public abstract int hashCode()
Returns the hash code for this Expression.

See the note in the equals(java.lang.Object) method on how two expressions can be equal if their expression Strings are different. Recall that if two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. Implementations must take special note and implement hashCode correctly.

Overrides:
hashCode in class Object
Returns:
The hash code for this Expression.
See Also:
equals(java.lang.Object), Hashtable, Object.hashCode()

abstract public boolean isLiteralText()
返回此表达式是否仅根据字面值文本创建。

当且仅当此表达式的表达式字符串是根据不包含非转义的 EL 分隔符（${...} 或 #{...}）创建时，该方法才返回 true。

return 如果此表达式是根据字面值文本创建的，则返回 true；否则返回 false。
英文文档：

isLiteralText

public abstract boolean isLiteralText()
Returns whether this expression was created from only literal text.

This method must return true if and only if the expression string this expression was created from contained no unescaped EL delimeters (${...} or #{...}).

Returns:
true if this expression was created from only literal text; false otherwise.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExpressionFactory (Java EE 5)

javax.el
Class ExpressionFactory

java.lang.Object
    extended by  javax.el.ExpressionFactory

public abstract class ExpressionFactory
extends Object

英文文档：

Constructor Summary
ExpressionFactory()
Method Summary
abstract Object | coerceToType(Object obj, Class<?> targetType) Coerces an object to a specific type according to the EL type conversion rules.
abstract MethodExpression | createMethodExpression(ELContext context, String expression, Class<?> expectedReturnType, Class<?>[] expectedParamTypes) Parses an expression into a MethodExpression for later evaluation.
abstract ValueExpression | createValueExpression(ELContext context, String expression, Class<?> expectedType) Parses an expression into a ValueExpression for later evaluation.
abstract ValueExpression | createValueExpression(Object instance, Class<?> expectedType) Creates a ValueExpression that wraps an object instance.
static ExpressionFactory | newInstance() Creates a new instance of a ExpressionFactory.
static ExpressionFactory | newInstance(Properties properties) Create a new instance of a ExpressionFactory, with optional properties.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ExpressionFactory()
英文文档：

ExpressionFactory

public ExpressionFactory()
Method Detail

public static ExpressionFactory newInstance()
创建 ExpressionFactory 的新实例。此方法使用以下查找过程顺序来确定要加载的 ExpressionFactory 实现类：
  • 使用 Services API（在 JAR 规范中进行了详细描述）。如果存在名为 META-INF/services/javax.el.ExpressionFactory 的资源，则它的第一行（如果存在）被用作实现类的 UTF-8 编码名称。
  • 使用 JRE 目录中的属性文件 "lib/el.properties"。如果存在此文件，且可以通过 java.util.Properties.load(InputStream) 方法读取它，并且该文件包含键为 "javax.el.ExpressionFactory" 的条目，则该条目的值被用作实现类的名称。
  • 使用 javax.el.ExpressionFactory 系统属性。如果定义了此名称的系统属性，则它的值被用作实现类的名称。
  • 使用平台的默认实现。
英文文档：

newInstance

public static ExpressionFactory newInstance()
Creates a new instance of a ExpressionFactory. This method uses the following ordered lookup procedure to determine the ExpressionFactory implementation class to load:
  • Use the Services API (as detailed in the JAR specification). If a resource with the name of META-INF/services/javax.el.ExpressionFactory exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class.
  • Use the properties file "lib/el.properties" in the JRE directory. If this file exists and it is readable by the java.util.Properties.load(InputStream) method, and it contains an entry whose key is "javax.el.ExpressionFactory", then the value of that entry is used as the name of the implementation class.
  • Use the javax.el.ExpressionFactory system property. If a system property with this name is defined, then its value is used as the name of the implementation class.
  • Use a platform default implementation.

public static ExpressionFactory newInstance(java.util.Properties properties)

创建具有可选属性的新 ExpressionFactory 实例。此方法使用与 newInstance() 相同的查找过程。

如果参数 properties 不为 null，并且实现包含具有单一参数类型 java.util.Properties 的构造方法，则使用该构造方法创建实例。

属性是可选的，并且可以被实现忽略。

属性名称应该以 "javax.el" 开头。

下面是属性的一些建议名称。

  • javax.el.cacheSize

properties 传递给实现的属性。如果为 null，则没有属性。
英文文档：

newInstance

public static ExpressionFactory newInstance(Properties properties)

Create a new instance of a ExpressionFactory, with optional properties. This method uses the same lookup procedure as the one used in newInstance().

If the argument properties is not null, and if the implementation contains a constructor with a single parameter of type java.util.Properties, then the constructor is used to create the instance.

Properties are optional and can be ignored by an implementation.

The name of a property should start with "javax.el."

The following are some suggested names for properties.

  • javax.el.cacheSize

Parameters:
properties - Properties passed to the implementation. If null, then no properties.

英文文档：

createValueExpression

public abstract ValueExpression createValueExpression(ELContext context,
                                                      String expression,
                                                      Class<?> expectedType)
Parses an expression into a ValueExpression for later evaluation. Use this method for expressions that refer to values.

This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an ELException.

Parameters:
context - The EL context used to parse the expression. The FunctionMapper and VariableMapper stored in the ELContext are used to resolve functions and variables found in the expression. They can be null, in which case functions or variables are not supported for this expression. The object returned must invoke the same functions and access the same variable mappings regardless of whether the mappings in the provided FunctionMapper and VariableMapper instances change between calling ExpressionFactory.createValueExpression() and any method on ValueExpression.

Note that within the EL, the ${} and #{} syntaxes are treated identically. This includes the use of VariableMapper and FunctionMapper at expression creation time. Each is invoked if not null, independent of whether the #{} or ${} syntax is used for the expression.

expression - The expression to parse
expectedType - The type the result of the expression will be coerced to after evaluation.
Returns:
The parsed expression
Throws:
NullPointerException - Thrown if expectedType is null.
ELException - Thrown if there are syntactical errors in the provided expression.

英文文档：

createValueExpression

public abstract ValueExpression createValueExpression(Object instance,
                                                      Class<?> expectedType)
Creates a ValueExpression that wraps an object instance. This method can be used to pass any object as a ValueExpression. The wrapper ValueExpression is read only, and returns the wrapped object via its getValue() method, optionally coerced.

Parameters:
instance - The object instance to be wrapped.
expectedType - The type the result of the expression will be coerced to after evaluation. There will be no coercion if it is Object.class,
Throws:
NullPointerException - Thrown if expectedType is null.

英文文档：

createMethodExpression

public abstract MethodExpression createMethodExpression(ELContext context,
                                                        String expression,
                                                        Class<?> expectedReturnType,
                                                        Class<?>[] expectedParamTypes)
Parses an expression into a MethodExpression for later evaluation. Use this method for expressions that refer to methods.

If the expression is a String literal, a MethodExpression is created, which when invoked, returns the String literal, coerced to expectedReturnType. An ELException is thrown if expectedReturnType is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.16 Type Conversion").

This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an ELException.

Parameters:
context - The EL context used to parse the expression. The FunctionMapper and VariableMapper stored in the ELContext are used to resolve functions and variables found in the expression. They can be null, in which case functions or variables are not supported for this expression. The object returned must invoke the same functions and access the same variable mappings regardless of whether the mappings in the provided FunctionMapper and VariableMapper instances change between calling ExpressionFactory.createMethodExpression() and any method on MethodExpression.

Note that within the EL, the ${} and #{} syntaxes are treated identically. This includes the use of VariableMapper and FunctionMapper at expression creation time. Each is invoked if not null, independent of whether the #{} or ${} syntax is used for the expression.

expression - The expression to parse
expectedReturnType - The expected return type for the method to be found. After evaluating the expression, the MethodExpression must check that the return type of the actual method matches this type. Passing in a value of null indicates the caller does not care what the return type is, and the check is disabled.
expectedParamTypes - The expected parameter types for the method to be found. Must be an array with no elements if there are no parameters expected. It is illegal to pass null.
Returns:
The parsed expression
Throws:
ELException - Thrown if there are syntactical errors in the provided expression.
NullPointerException - if paramTypes is null.

英文文档：

coerceToType

public abstract Object coerceToType(Object obj,
                                    Class<?> targetType)
Coerces an object to a specific type according to the EL type conversion rules.

An ELException is thrown if an error results from applying the conversion rules.

Parameters:
obj - The object to coerce.
targetType - The target type for the coercion.
Throws:
ELException - thrown if an error results from applying the conversion rules.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FunctionMapper (Java EE 5)

javax.el
Class FunctionMapper

java.lang.Object
    extended by  javax.el.FunctionMapper

public abstract class FunctionMapper
extends Object

在 EL 函数名称和方法之间映射的接口。

FunctionMapper 将 ${prefix:name()} 样式函数映射到可以执行该函数的静态方法。

since JSP 2.1
英文文档：

The interface to a map between EL function names and methods.

A FunctionMapper maps ${prefix:name()} style functions to a static method that can execute that function.

Since:
JSP 2.1

Constructor Summary
FunctionMapper()
Method Summary
abstract  Method resolveFunction(String prefix, String localName)
Resolves the specified prefix and local name into a java.lang.Method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FunctionMapper()
英文文档：

FunctionMapper

public FunctionMapper()
Method Detail

abstract public Method resolveFunction(String prefix, String localName)
将指定的前缀和本地名称解析为 java.lang.Method。

如果找不到与给定前缀和本地名称匹配的函数，则返回 null。

prefix | 函数前缀；如果没有前缀，则为 ""。例如，${fn:method()} 中的 "fn" 或 ${method()} 中的 ""。
localName | 函数的短名称。例如，${fn:method()} 中的 "method"。
return | 要调用的静态方法；如果找不到匹配的方法，则返回 null。
英文文档：

resolveFunction

public abstract Method resolveFunction(String prefix,
                                       String localName)
Resolves the specified prefix and local name into a java.lang.Method.

Returns null if no function could be found that matches the given prefix and local name.

Parameters:
prefix - the prefix of the function, or "" if no prefix. For example, "fn" in ${fn:method()}, or "" in ${method()}.
localName - the short name of the function. For example, "method" in ${fn:method()}.
Returns:
the static method to invoke, or null if no match was found.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ListELResolver (Java EE 5)

javax.el
Class ListELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.el.ListELResolver

public class ListELResolver
extends ELResolver

Extends: ELResolver

定义 java.util.List 实例上的属性解析行为。

此解析器处理类型为 java.util.List 的 base 对象。它接受任何对象作为属性，并且将该对象强制匹配为列表中的整数索引。所得值就是列表中位于该索引处的值。

此解析器可以以只读模式构建，这意味着 #isReadOnly 将总是返回 true，#setValue 将总是抛出 PropertyNotWritableException。

ELResolver 使用 CompositeELResolver 连接到一起，以定义丰富语义来计算表达式。有关 ELResolver 的详细信息，请参阅 javadoc。

since | JSP 2.1
See also | javax.el.CompositeELResolver, javax.el.ELResolver, java.util.List
英文文档：

Defines property resolution behavior on instances of List.

This resolver handles base objects of type java.util.List. It accepts any object as a property and coerces that object into an integer index into the list. The resulting value is the value in the list at that index.

This resolver can be constructed in read-only mode, which means that isReadOnly will always return true and setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always throw PropertyNotWritableException.

ELResolvers are combined together using CompositeELResolvers, to define rich semantics for evaluating an expression. See the javadocs for ELResolver for details.

Since:
JSP 2.1
See Also:
CompositeELResolver, ELResolver, List

Field Summary
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
ListELResolver()
Creates a new read/write ListELResolver.
ListELResolver(boolean isReadOnly)
Creates a new ListELResolver whose read-only status is determined by the given parameter.
Method Summary
 Class<?> getCommonPropertyType(ELContext context, Object base)
If the base object is a list, returns the most general type that this resolver accepts for the property argument.
 Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
Always returns null, since there is no reason to iterate through set set of all integers.
 Class<?> getType(ELContext context, Object base, Object property)
If the base object is a list, returns the most general acceptable type for a value in this list.
 Object getValue(ELContext context, Object base, Object property)
If the base object is a list, returns the value at the given index.
 boolean isReadOnly(ELContext context, Object base, Object property)
If the base object is a list, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
 void setValue(ELContext context, Object base, Object property, Object val)
If the base object is a list, attempts to set the value at the given index with the given value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ListELResolver()
创建新的读/写 ListELResolver。
英文文档：

ListELResolver

public ListELResolver()
Creates a new read/write ListELResolver.

public ListELResolver(boolean isReadOnly)
创建新的 ListELResolver，其只读状态由给定的参数确定。
isReadOnly 如果该解析器无法修改列表，则为 true；否则为 false。
英文文档：

ListELResolver

public ListELResolver(boolean isReadOnly)
Creates a new ListELResolver whose read-only status is determined by the given parameter.

Parameters:
isReadOnly - true if this resolver cannot modify lists; false otherwise.
Method Detail

public Class<T> getType(ELContext context, Object base, Object property)
如果 base 对象是列表，则返回此列表中的值可以接受的最一般类型。

如果 base 为 List，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

假定 base 为 List，则此方法将总是返回 Object.class。这是因为 List 接受任何对象作为元素。

context | 此计算的上下文。
base | 要分析的列表。此解析器仅处理属于 List 类型的 base。
property | 返回可接受类型的列表元素的索引。将强制匹配为整数，其他情况下将被此解析器忽略。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回最一般的可接受类型；其他情况未定义。
Throws | PropertyNotFoundException: 如果给定索引超出此列表的范围。
Throws | NullPointerException: 如果 context 为 null
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getType

public Class<?> getType(ELContext context,
                        Object base,
                        Object property)
If the base object is a list, returns the most general acceptable type for a value in this list.

If the base is a List, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Assuming the base is a List, this method will always return Object.class. This is because Lists accept any object as an element.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The list to analyze. Only bases of type List are handled by this resolver.
property - The index of the element in the list to return the acceptable type for. Will be coerced into an integer, but otherwise ignored by this resolver.
Returns:
If the propertyResolved property of ELContext was set to true, then the most general acceptable type; otherwise undefined.
Throws:
PropertyNotFoundException - if the given index is out of bounds for this list.
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public Object getValue(ELContext context, Object base, Object property)
如果 base 对象为列表，则返回给定索引位置的值。property 参数指定的索引，强制匹配为整数。如果无法执行强制匹配，则抛出 IllegalArgumentException。如果索引超出边界，则返回 null。

如果 base 为 List，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

context | 此计算的上下文。
base | 要分析的列表。此解析器仅处理属于 List 类型的 base。
property | 要返回的值的索引。将强制匹配为整数。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回给定索引处的值；如果索引超出边界，则返回 null。其他情况未定义。
Throws | IllegalArgumentException: 如果属性无法强制匹配为整数。
Throws | NullPointerException: 如果 context 为 null。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
If the base object is a list, returns the value at the given index. The index is specified by the property argument, and coerced into an integer. If the coercion could not be performed, an IllegalArgumentException is thrown. If the index is out of bounds, null is returned.

If the base is a List, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The list to be analyzed. Only bases of type List are handled by this resolver.
property - The index of the value to be returned. Will be coerced into an integer.
Returns:
If the propertyResolved property of ELContext was set to true, then the value at the given index or null if the index was out of bounds. Otherwise, undefined.
Throws:
IllegalArgumentException - if the property could not be coerced into an integer.
NullPointerException - if context is null.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public void setValue(ELContext context, Object base, Object property, Object val)
如果 base 对象为列表，则尝试用给定的值设置给定索引位置的值。property 参数指定的索引，强制匹配为整数。如果无法执行强制匹配，则抛出 IllegalArgumentException。如果索引超出边界，则抛出 PropertyNotFoundException。

如果 base 为 List，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者可以放心地假定没有设置任何值。

如果此解析器以只读模式构造，则此方法将总是抛出 PropertyNotWritableException。

如果使用 java.util.Collections#unmodifiableList 创建 List，则此方法必须抛出 PropertyNotWritableException。不幸的是，没有任何 Collection API 方法可以检测这一点。但是，实现可以使用以下方法解决该问题：创建原型不可修改的 List，并查询其运行时类型，以确定它是否匹配 base 对象的运行时类型。

context | 此计算的上下文。
base | 要修改的列表。此解析器仅处理属于 List 类型的 base。
property | 要设置的值的索引。将强制匹配为整数。
val | 要在给定索引处设置的值。
Throws | ClassCastException: 如果指定元素的类不允许该元素添加到此列表。
Throws | NullPointerException: 如果上下文为 null，或者值为 null，并且此 List 不支持 null 元素。
Throws | IllegalArgumentException: 如果属性无法强制匹配为整数，或者指定元素的某个方面不允许该元素添加到此列表。
Throws | PropertyNotWritableException: 如果此解析器以只读模式构造，或者底层列表不支持设置操作。
Throws | PropertyNotFoundException: 如果给定索引超出此列表的范围。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object val)
If the base object is a list, attempts to set the value at the given index with the given value. The index is specified by the property argument, and coerced into an integer. If the coercion could not be performed, an IllegalArgumentException is thrown. If the index is out of bounds, a PropertyNotFoundException is thrown.

If the base is a List, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller can safely assume no value was set.

If this resolver was constructed in read-only mode, this method will always throw PropertyNotWritableException.

If a List was created using Collections.unmodifiableList(java.util.List), this method must throw PropertyNotWritableException. Unfortunately, there is no Collections API method to detect this. However, an implementation can create a prototype unmodifiable List and query its runtime type to see if it matches the runtime type of the base object as a workaround.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The list to be modified. Only bases of type List are handled by this resolver.
property - The index of the value to be set. Will be coerced into an integer.
val - The value to be set at the given index.
Throws:
ClassCastException - if the class of the specified element prevents it from being added to this list.
NullPointerException - if context is null, or if the value is null and this List does not support null elements.
IllegalArgumentException - if the property could not be coerced into an integer, or if some aspect of the specified element prevents it from being added to this list.
PropertyNotWritableException - if this resolver was constructed in read-only mode, or if the set operation is not supported by the underlying list.
PropertyNotFoundException - if the given index is out of bounds for this list.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public boolean isReadOnly(ELContext context, Object base, Object property)
如果 base 对象是列表，则返回对 #setValue 的调用是否总是失败。

如果 base 为 List，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

如果此解析器以只读模式构造，则此方法将总是返回 true。

如果使用 java.util.Collections#unmodifiableList 创建 List，则此方法必须返回 true。不幸的是，没有任何 Collection API 方法可以检测这一点。但是，实现可以使用以下方法解决该问题：创建原型不可修改的 List，并查询其运行时类型，以确定它是否匹配 base 对象的运行时类型。

context | 此计算的上下文。
base | 要分析的列表。此解析器仅处理属于 List 类型的 base。
property | 返回可接受类型的列表元素的索引。将强制匹配为整数，其他情况下将被此解析器忽略。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则调用 setValue 方法总是失败的情况下返回 true，该调用可能成功的情况下返回 false；其他情况未定义。
Throws | PropertyNotFoundException: 如果给定索引超出此列表的范围。
Throws | NullPointerException: 如果 context 为 null
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
If the base object is a list, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.

If the base is a List, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

If this resolver was constructed in read-only mode, this method will always return true.

If a List was created using Collections.unmodifiableList(java.util.List), this method must return true. Unfortunately, there is no Collections API method to detect this. However, an implementation can create a prototype unmodifiable List and query its runtime type to see if it matches the runtime type of the base object as a workaround.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - The list to analyze. Only bases of type List are handled by this resolver.
property - The index of the element in the list to return the acceptable type for. Will be coerced into an integer, but otherwise ignored by this resolver.
Returns:
If the propertyResolved property of ELContext was set to true, then true if calling the setValue method will always fail or false if it is possible that such a call may succeed; otherwise undefined.
Throws:
PropertyNotFoundException - if the given index is out of bounds for this list.
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public java.util.Iterator<E> getFeatureDescriptors(ELContext context, Object base)
总是返回 null，因为没有理由迭代所有整数集。

#getCommonPropertyType 方法返回有关此解析器接受的属性的足够信息。

context | 此计算的上下文。
base | 列表。此解析器仅处理属于 List 类型的 base。
return | null。
英文文档：

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
Always returns null, since there is no reason to iterate through set set of all integers.

The getCommonPropertyType(javax.el.ELContext, java.lang.Object) method returns sufficient information about what properties this resolver accepts.

Specified by:
getFeatureDescriptors in class ELResolver
Parameters:
context - The context of this evaluation.
base - The list. Only bases of type List are handled by this resolver.
Returns:
null.
See Also:
FeatureDescriptor

public Class<T> getCommonPropertyType(ELContext context, Object base)
如果 base 对象是列表，则返回对于 property 参数此解析器可接受的最一般类型。否则返回 null。

假定 base 为 List，则此方法将总是返回 Integer.class。这是因为 List 接受整数作为其索引。

context | 此计算的上下文。
base | 要分析的列表。此解析器仅处理属于 List 类型的 base。
return | 如果 base 不为 List，则返回 null；否则返回 Integer.class。
英文文档：

getCommonPropertyType

public Class<?> getCommonPropertyType(ELContext context,
                                      Object base)
If the base object is a list, returns the most general type that this resolver accepts for the property argument. Otherwise, returns null.

Assuming the base is a List, this method will always return Integer.class. This is because Lists accept integers as their index.

Specified by:
getCommonPropertyType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The list to analyze. Only bases of type List are handled by this resolver.
Returns:
null if base is not a List; otherwise Integer.class.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MapELResolver (Java EE 5)

javax.el
Class MapELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.el.MapELResolver

public class MapELResolver
extends ELResolver

Extends: ELResolver

在 java.util.Map 的实例上定义属性解析行为。

此解析器处理类型为 java.util.Map 的 base 对象。它接受任何对象作为属性，并且使用该对象作为映射中的键。所得值就是映射中与该键关联的值。

此解析器可以以只读模式构建，这意味着 #isReadOnly 将总是返回 true，#setValue 将总是抛出 PropertyNotWritableException。

ELResolver 使用 CompositeELResolver 连接到一起，以定义丰富语义来计算表达式。有关 ELResolver 的详细信息，请参阅 javadoc。

since | JSP 2.1
See also | javax.el.CompositeELResolver, javax.el.ELResolver, java.util.Map
英文文档：

Defines property resolution behavior on instances of Map.

This resolver handles base objects of type java.util.Map. It accepts any object as a property and uses that object as a key in the map. The resulting value is the value in the map that is associated with that key.

This resolver can be constructed in read-only mode, which means that isReadOnly will always return true and setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always throw PropertyNotWritableException.

ELResolvers are combined together using CompositeELResolvers, to define rich semantics for evaluating an expression. See the javadocs for ELResolver for details.

Since:
JSP 2.1
See Also:
CompositeELResolver, ELResolver, Map

Field Summary
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
MapELResolver()
Creates a new read/write MapELResolver.
MapELResolver(boolean isReadOnly)
Creates a new MapELResolver whose read-only status is determined by the given parameter.
Method Summary
 Class<?> getCommonPropertyType(ELContext context, Object base)
If the base object is a map, returns the most general type that this resolver accepts for the property argument.
 Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
If the base object is a map, returns an Iterator containing the set of keys available in the Map.
 Class<?> getType(ELContext context, Object base, Object property)
If the base object is a map, returns the most general acceptable type for a value in this map.
 Object getValue(ELContext context, Object base, Object property)
If the base object is a map, returns the value associated with the given key, as specified by the property argument.
 boolean isReadOnly(ELContext context, Object base, Object property)
If the base object is a map, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
 void setValue(ELContext context, Object base, Object property, Object val)
If the base object is a map, attempts to set the value associated with the given key, as specified by the property argument.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MapELResolver()
创建新的读/写 MapELResolver。
英文文档：

MapELResolver

public MapELResolver()
Creates a new read/write MapELResolver.

public MapELResolver(boolean isReadOnly)
创建新的 MapELResolver，它的只读状态由给定的参数确定。
isReadOnly 如果此解析器无法修改映射，则为 true；否则为 false。
英文文档：

MapELResolver

public MapELResolver(boolean isReadOnly)
Creates a new MapELResolver whose read-only status is determined by the given parameter.

Parameters:
isReadOnly - true if this resolver cannot modify maps; false otherwise.
Method Detail

public Class<T> getType(ELContext context, Object base, Object property)
如果 base 对象是映射，则返回此映射中的值可以接受的最一般类型。

如果 base 为 Map，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

假定 base 为 Map，则此方法将总是返回 Object.class。这是因为 Map 接受任何对象作为给定键的值。

context | 此计算的上下文。
base | 要分析的映射。此解析器仅处理属于 Map 类型的 base。
property | 要返回可接受类型的键。此解析器将忽略它。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回最一般的可接受类型；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getType

public Class<?> getType(ELContext context,
                        Object base,
                        Object property)
If the base object is a map, returns the most general acceptable type for a value in this map.

If the base is a Map, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Assuming the base is a Map, this method will always return Object.class. This is because Maps accept any object as the value for a given key.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The map to analyze. Only bases of type Map are handled by this resolver.
property - The key to return the acceptable type for. Ignored by this resolver.
Returns:
If the propertyResolved property of ELContext was set to true, then the most general acceptable type; otherwise undefined.
Throws:
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public Object getValue(ELContext context, Object base, Object property)
如果 base 对象是映射，则返回与给定键（由 property 参数指定）关联的值。如果未找到该键，则返回 null。

如果 base 为 Map，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

正如在 java.util.Map#get 中一样，返回 null 并不意味着没有该键的映射；也可能 Map 显式将该键映射为 null。

context | 此计算的上下文。
base | 要分析的映射。此解析器仅处理属于 Map 类型的 base。
property | 要返回其关联值的键。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回与给定键关联的值；如果没有找到键，则返回 null。其他情况未定义。
Throws | ClassCastException: 如果该键不是此映射的正确类型（也可由底层 Map 抛出）。
Throws | NullPointerException: 如果上下文为 null，或者键为 null 并且此映射不允许 null 键（后者也可由底层 Map 抛出）。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
If the base object is a map, returns the value associated with the given key, as specified by the property argument. If the key was not found, null is returned.

If the base is a Map, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Just as in Map.get(java.lang.Object), just because null is returned doesn't mean there is no mapping for the key; it's also possible that the Map explicitly maps the key to null.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The map to be analyzed. Only bases of type Map are handled by this resolver.
property - The key whose associated value is to be returned.
Returns:
If the propertyResolved property of ELContext was set to true, then the value associated with the given key or null if the key was not found. Otherwise, undefined.
Throws:
ClassCastException - if the key is of an inappropriate type for this map (optionally thrown by the underlying Map).
NullPointerException - if context is null, or if the key is null and this map does not permit null keys (the latter is optionally thrown by the underlying Map).
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public void setValue(ELContext context, Object base, Object property, Object val)
如果 base 对象是映射，则尝试设置与给定键（由 property 参数指定）关联的值。

如果 base 为 Map，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者可以放心地假定没有设置任何值。

如果此解析器以只读模式构造，则此方法将总是抛出 PropertyNotWritableException。

如果使用 java.util.Collections#unmodifiableMap 创建 Map，则此方法必须抛出 PropertyNotWritableException。不幸的是，没有任何 Collection API 方法可以检测这一点。但是，实现可以使用以下方法解决该问题：创建原型不可修改的 Map，并查询其运行时类型，以确定它是否匹配 base 对象的运行时类型。

context | 此计算的上下文。
base | 要修改的映射。此解析器仅处理属于 Map 类型的 base。
property | 要关联到指定值的键。
val | 要关联到指定键的值。
Throws | ClassCastException: 如果指定键或值的类不允许它存储在此映射中。
Throws | NullPointerException: 如果上下文为 null，或者此映射不允许 null 键或值并且指定的键或值为 null。
Throws | IllegalArgumentException: 如果此键或值的某个方面不允许它存储在此映射中。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
Throws | PropertyNotWritableException: 如果此解析器以只读模式构造，或者底层映射不支持放置操作。
英文文档：

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object val)
If the base object is a map, attempts to set the value associated with the given key, as specified by the property argument.

If the base is a Map, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller can safely assume no value was set.

If this resolver was constructed in read-only mode, this method will always throw PropertyNotWritableException.

If a Map was created using Collections.unmodifiableMap(java.util.Map), this method must throw PropertyNotWritableException. Unfortunately, there is no Collections API method to detect this. However, an implementation can create a prototype unmodifiable Map and query its runtime type to see if it matches the runtime type of the base object as a workaround.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The map to be modified. Only bases of type Map are handled by this resolver.
property - The key with which the specified value is to be associated.
val - The value to be associated with the specified key.
Throws:
ClassCastException - if the class of the specified key or value prevents it from being stored in this map.
NullPointerException - if context is null, or if this map does not permit null keys or values, and the specified key or value is null.
IllegalArgumentException - if some aspect of this key or value prevents it from being stored in this map.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
PropertyNotWritableException - if this resolver was constructed in read-only mode, or if the put operation is not supported by the underlying map.

public boolean isReadOnly(ELContext context, Object base, Object property)
如果 base 对象是映射，则返回对 #setValue 的调用是否总是失败。

如果 base 为 Map，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

如果此解析器以只读模式构造，则此方法将总是返回 true。

如果使用 java.util.Collections#unmodifiableMap 创建 Map，则该方法必须返回 true。不幸的是，没有任何 Collection API 方法可以检测这一点。但是，实现可以使用以下方法解决该问题：创建原型不可修改的 Map，并查询其运行时类型，以确定它是否匹配 base 对象的运行时类型。

context | 此计算的上下文。
base | 要分析的映射。此解析器仅处理属于 Map 类型的 base。
property | 要返回只读状态的键。此解析器将忽略它。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则调用 setValue 方法总是失败的情况下返回 true，该调用可能成功的情况下返回 false；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
If the base object is a map, returns whether a call to setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.

If the base is a Map, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

If this resolver was constructed in read-only mode, this method will always return true.

If a Map was created using Collections.unmodifiableMap(java.util.Map), this method must return true. Unfortunately, there is no Collections API method to detect this. However, an implementation can create a prototype unmodifiable Map and query its runtime type to see if it matches the runtime type of the base object as a workaround.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - The map to analyze. Only bases of type Map are handled by this resolver.
property - The key to return the read-only status for. Ignored by this resolver.
Returns:
If the propertyResolved property of ELContext was set to true, then true if calling the setValue method will always fail or false if it is possible that such a call may succeed; otherwise undefined.
Throws:
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public java.util.Iterator<E> getFeatureDescriptors(ELContext context, Object base)
如果 base 对象是映射，则返回一个 Iterator，它包含 Map 中可用的一组键。否则返回 null。

返回的 Iterator 必须包含 0 个或多个 java.beans.FeatureDescriptor 实例。每个 info 对象包含有关 Map 中一个键的信息，并且初始化如下：

  • displayName - 在此键上调用 toString 方法的返回值；如果该键为 null，则为 "null"。
  • name – 与 displayName 属性相同。
  • shortDescription – 空字符串
  • expert - false
  • hidden - false
  • preferred - true
    • 此外，必须在返回的 FeatureDescriptor 中设置以下指定的属性：
  • ELResolver#TYPE - 在此键上调用 getClass() 方法的返回值；如果该键为 null，则为 null。
  • ELResolver#RESOLVABLE_AT_DESIGN_TIME - true

    • context | 此计算的上下文。
base | 要迭代其键的映射。此解析器仅处理属于 Map 类型的 base。
return | 包含 0 个或多个（可能无限多个）FeatureDescriptor 对象的 Iterator，每个对象代表此映射中的一个键；如果 base 对象不是映射，则返回 null。
    英文文档：

    getFeatureDescriptors

    public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
    If the base object is a map, returns an Iterator containing the set of keys available in the Map. Otherwise, returns null.

    The Iterator returned must contain zero or more instances of FeatureDescriptor. Each info object contains information about a key in the Map, and is initialized as follows:

  • displayName - The return value of calling the toString method on this key, or "null" if the key is null.
  • name - Same as displayName property.
  • shortDescription - Empty string
  • expert - false
  • hidden - false
  • preferred - true
    • In addition, the following named attributes must be set in the returned FeatureDescriptors:
  • ELResolver.TYPE - The return value of calling the getClass() method on this key, or null if the key is null.
  • ELResolver.RESOLVABLE_AT_DESIGN_TIME - true

    • Specified by:
    getFeatureDescriptors in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - The map whose keys are to be iterated over. Only bases of type Map are handled by this resolver.
    Returns:
    An Iterator containing zero or more (possibly infinitely more) FeatureDescriptor objects, each representing a key in this map, or null if the base object is not a map.
    See Also:
    FeatureDescriptor

    public Class<T> getCommonPropertyType(ELContext context, Object base)
    如果 base 对象是映射，则返回对于 property 参数此解析器可接受的最一般类型。否则返回 null。

    假定 base 为 Map，则此方法将总是返回 Object.class。这是因为 Map 接受任何对象作为键。

    context | 此计算的上下文。
base | 要分析的映射。此解析器仅处理属于 Map 类型的 base。
return | 如果 base 不为 Map，则返回 null；否则返回 Object.class。
    英文文档：

    getCommonPropertyType

    public Class<?> getCommonPropertyType(ELContext context,
                                      Object base)
    If the base object is a map, returns the most general type that this resolver accepts for the property argument. Otherwise, returns null.

    Assuming the base is a Map, this method will always return Object.class. This is because Maps accept any object as a key.

    Specified by:
    getCommonPropertyType in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - The map to analyze. Only bases of type Map are handled by this resolver.
    Returns:
    null if base is not a Map; otherwise Object.class.
    Overview Package Class Tree Deprecated Index Help
    PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodExpression (Java EE 5)

javax.el
Class MethodExpression

java.lang.Object
    extended by  javax.el.Expression
        extended by  javax.el.MethodExpression
All Implemented Interfaces:
Serializable
public abstract class MethodExpression
extends Expression

Extends: Expression

引用对象方法的 Expression。

可以使用 ExpressionFactory#createMethodExpression 方法解析表达式字符串，并返回封装已解析表达式的 MethodExpression 的具体实例。解析时（而不是计算时）使用 FunctionMapper，所以在计算表达式时不需要它。但是，计算时需要 ELContext。

每次调用 #getMethodInfo 和 #invoke 方法时将对表达式求值。使用 ELContext 中的 ELResolver 解析顶级变量，并确定 . 和 [] 操作符的行为。对于这两个方法中的任何一个，使用 ELResolver#getValue 方法解析除最后一个属性以外的所有属性。这提供出现该方法的 base 对象。如果 base 对象为 null，则必定抛出 PropertyNotFoundException。在最后解析时，最后的 property 被强制匹配为 String，它提供要查找的方法的名称。将找到与该名称以及在解析时提供的期望参数匹配的方法，它将被查询或调用（取决于对此 MethodExpression 调用的方法）。

请参阅 Expression javadoc 中有关比较、序列化和不可变性的注释。

since | JSP 2.1
See also | javax.el.ELResolver, javax.el.Expression, javax.el.ExpressionFactory
英文文档：

An Expression that refers to a method on an object.

The ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]) method can be used to parse an expression string and return a concrete instance of MethodExpression that encapsulates the parsed expression. The FunctionMapper is used at parse time, not evaluation time, so one is not needed to evaluate an expression using this class. However, the ELContext is needed at evaluation time.

The getMethodInfo(javax.el.ELContext) and invoke(javax.el.ELContext, java.lang.Object[]) methods will evaluate the expression each time they are called. The ELResolver in the ELContext is used to resolve the top-level variables and to determine the behavior of the . and [] operators. For any of the two methods, the ELResolver.getValue(javax.el.ELContext, java.lang.Object, java.lang.Object) method is used to resolve all properties up to but excluding the last one. This provides the base object on which the method appears. If the base object is null, a PropertyNotFoundException must be thrown. At the last resolution, the final property is then coerced to a String, which provides the name of the method to be found. A method matching the name and expected parameters provided at parse time is found and it is either queried or invoked (depending on the method called on this MethodExpression).

See the notes about comparison, serialization and immutability in the Expression javadocs.

Since:
JSP 2.1
See Also:
ELResolver, Expression, ExpressionFactory, Serialized Form

Constructor Summary
MethodExpression()
Method Summary
abstract MethodInfo | getMethodInfo(ELContext context) Evaluates the expression relative to the provided context, and returns information about the actual referenced method.
abstract Object | invoke(ELContext context, Object[] params) If a String literal is specified as the expression, returns the String literal coerced to the expected return type of the method signature.
Methods inherited from class javax.el.Expression
equals, getExpressionString, hashCode, isLiteralText
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MethodExpression()
英文文档：

MethodExpression

public MethodExpression()
Method Detail

abstract public MethodInfo getMethodInfo(ELContext context)
相对于提供的上下文对表达式求值，并返回有关实际引用方法的信息。
context | 此计算的上下文
return | 一个 MethodInfo 实例，它包含有关对表达式求值的方法的信息。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果由于指定变量或属性不存在或不可读导致某个属性解析操作失败。
Throws | MethodNotFoundException: 如果不存在合适的方法。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getMethodInfo

public abstract MethodInfo getMethodInfo(ELContext context)
Evaluates the expression relative to the provided context, and returns information about the actual referenced method.

Parameters:
context - The context of this evaluation
Returns:
an instance of MethodInfo containing information about the method the expression evaluated to.
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if one of the property resolutions failed because a specified variable or property does not exist or is not readable.
MethodNotFoundException - if no suitable method can be found.
ELException - if an exception was thrown while performing property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

abstract public Object invoke(ELContext context, Object[] params)
如果字面值 String 被指定为表达式，则返回被强制匹配为方法签名的期望返回类型的字面值 String。如果 expectedReturnType 为 void 或字面值 String 强制匹配为 expectedReturnType 时产生一个错误，则抛出 ELException（请参阅 EL 规范的“1.18 类型转换”一节）。 如果不是字面值 String，则相对于提供的上下文对表达式求值，调用通过提供的参数找到的方法，并返回该方法调用的结果。 如果 isLiteralText() 为 true，则忽略传递给此方法的任何参数。
context | 此计算的上下文。
params | 传递给方法的参数；如果没有参数，则为 null。
return | 方法调用的结果（如果该方法具有一个 void 返回类型，则返回 null）。
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果由于指定变量或属性不存在或不可读导致某个属性解析操作失败。
Throws | MethodNotFoundException: 如果不存在合适的方法。
Throws | ELException: 如果指定了字面值 String 并且 MethodExpression 的 expectedReturnType 为 void，或者字面值 String 强制匹配为 expectedReturnType 时产生一个错误（请参阅“1.18 类型转换”一节）。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。如果抛出的异常为 InvocationTargetException，则提取它的 cause 并将其传递给 ELException 构造方法。
英文文档：

invoke

public abstract Object invoke(ELContext context,
                              Object[] params)
If a String literal is specified as the expression, returns the String literal coerced to the expected return type of the method signature. An ELException is thrown if expectedReturnType is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.18 Type Conversion" of the EL specification). If not a String literal, evaluates the expression relative to the provided context, invokes the method that was found using the supplied parameters, and returns the result of the method invocation. Any parameters passed to this method is ignored if isLiteralText() is true.

Parameters:
context - The context of this evaluation.
params - The parameters to pass to the method, or null if no parameters.
Returns:
the result of the method invocation (null if the method has a void return type).
Throws:
NullPointerException - if context is null
PropertyNotFoundException - if one of the property resolutions failed because a specified variable or property does not exist or is not readable.
MethodNotFoundException - if no suitable method can be found.
ELException - if a String literal is specified and expectedReturnType of the MethodExpression is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.18 Type Conversion").
ELException - if an exception was thrown while performing property or variable resolution. The thrown exception must be included as the cause property of this exception, if available. If the exception thrown is an InvocationTargetException, extract its cause and pass it to the ELException constructor.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodInfo (Java EE 5)

javax.el
Class MethodInfo

java.lang.Object
    extended by  javax.el.MethodInfo

public class MethodInfo
extends Object

包含有关 MethodExpression 求值方法的信息。
since JSP 2.1
英文文档：

Holds information about a method that a MethodExpression evaluated to.

Since:
JSP 2.1

Constructor Summary
MethodInfo(String name, Class<?> returnType, Class<?>[] paramTypes)
Creates a new instance of MethodInfo with the given information.
Method Summary
String | getName() Returns the name of the method
Class<?>[] | getParamTypes() Returns the parameter types of the method
Class<?> | getReturnType() Returns the return type of the method
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

英文文档：

MethodInfo

public MethodInfo(String name,
                  Class<?> returnType,
                  Class<?>[] paramTypes)
Creates a new instance of MethodInfo with the given information.

Parameters:
name - The name of the method
returnType - The return type of the method
paramTypes - The types of each of the method's parameters
Method Detail

public String getName()
返回方法名称
return 方法名
英文文档：

getName

public String getName()
Returns the name of the method

Returns:
the name of the method

public Class<T> getReturnType()
返回方法的返回类型
return 方法的返回类型
英文文档：

getReturnType

public Class<?> getReturnType()
Returns the return type of the method

Returns:
the return type of the method

public Class<T>[] getParamTypes()
返回方法的参数类型
return 方法的参数类型
英文文档：

getParamTypes

public Class<?>[] getParamTypes()
Returns the parameter types of the method

Returns:
the parameter types of the method
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceBundleELResolver (Java EE 5)

javax.el
Class ResourceBundleELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.el.ResourceBundleELResolver

public class ResourceBundleELResolver
extends ELResolver

Extends: ELResolver

定义 java.util.ResourceBundle 实例上的属性解析行为。

此解析器处理类型为 java.util.ResourceBundle 的 base 对象。它接受任何对象作为属性，并将其强制匹配为 java.lang.String 以便调用 getObject(java.lang.String)。

此解析器是只读的，如果调用 setValue，则抛出 PropertyNotWritableException。

ELResolver 使用 CompositeELResolver 连接到一起，以定义丰富语义来计算表达式。有关 ELResolver 的详细信息，请参阅 javadoc。

since | JSP 2.1
See also | javax.el.CompositeELResolver, javax.el.ELResolver, java.util.ResourceBundle
英文文档：

Defines property resolution behavior on instances of ResourceBundle.

This resolver handles base objects of type java.util.ResourceBundle. It accepts any object as a property and coerces it to a java.lang.String for invoking ResourceBundle.getObject(java.lang.String).

This resolver is read only and will throw a PropertyNotWritableException if setValue is called.

ELResolvers are combined together using CompositeELResolvers, to define rich semantics for evaluating an expression. See the javadocs for ELResolver for details.

Since:
JSP 2.1
See Also:
CompositeELResolver, ELResolver, ResourceBundle

Field Summary
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
ResourceBundleELResolver()
Method Summary
Class<?> | getCommonPropertyType(ELContext context, Object base) If the base object is a ResourceBundle, returns the most general type that this resolver accepts for the property argument.
Iterator | getFeatureDescriptors(ELContext context, Object base) If the base object is a ResourceBundle, returns an Iterator containing the set of keys available in the ResourceBundle.
Class<?> | getType(ELContext context, Object base, Object property) If the base object is an instance of ResourceBundle, return null, since the resolver is read only.
Object | getValue(ELContext context, Object base, Object property) If the base object is an instance of ResourceBundle, the provided property will first be coerced to a String.
boolean | isReadOnly(ELContext context, Object base, Object property) If the base object is not null and an instanceof ResourceBundle, return true.
void | setValue(ELContext context, Object base, Object property, Object value) If the base object is a ResourceBundle, throw a PropertyNotWritableException.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ResourceBundleELResolver()
英文文档：

ResourceBundleELResolver

public ResourceBundleELResolver()
Method Detail

public Object getValue(ELContext context, Object base, Object property)
如果 base 对象是 ResourceBundle 的一个实例，则提供的属性将首先被强制匹配为 String。将返回对 base ResourceBundle 调用 getObject 时所返回的 Object。

如果 base 为 ResourceBundle，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

context | 此计算的上下文。
base | 要分析的 ResourceBundle。
property | 要分析的属性名称将强制匹配为 String。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则在属性为 null 时返回 null；否则返回 ResourceBundle 中对应给定键（属性强制匹配为 String）的 Object。如果没有找到对应给定键的对象，则返回 String "?"+ key + "?"。
Throws | NullPointerException: 如果 context 为 null
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
If the base object is an instance of ResourceBundle, the provided property will first be coerced to a String. The Object returned by getObject on the base ResourceBundle will be returned.

If the base is ResourceBundle, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The ResourceBundle to analyze.
property - The name of the property to analyze. Will be coerced to a String.
Returns:
If the propertyResolved property of ELContext was set to true, then null if property is null; otherwise the Object for the given key (property coerced to String) from the ResourceBundle. If no object for the given key can be found, then the String "???" + key + "???".
Throws:
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

public Class<T> getType(ELContext context, Object base, Object property)
如果 base 对象是 ResourceBundle 的一个实例，则返回 null，因为该解析器是只读的。

如果 base 为 ResourceBundle，则在返回前，此解析器必须将 ELContext 对象的 propertyResolved 属性设置为 true。如果调用此方法后此属性不为 true，则调用者应该忽略返回值。

context | 此计算的上下文。
base | 要分析的 ResourceBundle。
property | 要分析的属性名称
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回 null；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
英文文档：

getType

public Class<?> getType(ELContext context,
                        Object base,
                        Object property)
If the base object is an instance of ResourceBundle, return null, since the resolver is read only.

If the base is ResourceBundle, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - The ResourceBundle to analyze.
property - The name of the property to analyze.
Returns:
If the propertyResolved property of ELContext was set to true, then null; otherwise undefined.
Throws:
NullPointerException - if context is null

public void setValue(ELContext context, Object base, Object property, Object value)
如果 base 对象为 ResourceBundle，则抛出 PropertyNotWritableException。
context | 此计算的上下文。
base | 要修改的 ResourceBundle。仅处理属于 ResourceBundle 类型的 base。
property | 要使用的 String 属性。
value | 要设置的值。
Throws | NullPointerException: 如果 context 为 null。
Throws | PropertyNotWritableException: 如果 base 为 ReasourceBundle 的一个实例，则总是抛出该异常。
英文文档：

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object value)
If the base object is a ResourceBundle, throw a PropertyNotWritableException.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The ResourceBundle to be modified. Only bases that are of type ResourceBundle are handled.
property - The String property to use.
value - The value to be set.
Throws:
NullPointerException - if context is null.
PropertyNotWritableException - Always thrown if base is an instance of ReasourceBundle.

public boolean isReadOnly(ELContext context, Object base, Object property)
如果 base 对象不为 null，也不为 ResourceBundle 的实例，则返回 true。
context | 此计算的上下文。
base | 要修改的 ResourceBundle。仅处理属于 ResourceBundle 类型的 base。
property | 要使用的 String 属性。
return | 如果 ELContext 的 propertyResolved 属性设置为 true，则返回 true；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null
英文文档：

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
If the base object is not null and an instanceof ResourceBundle, return true.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - The ResourceBundle to be modified. Only bases that are of type ResourceBundle are handled.
property - The String property to use.
Returns:
If the propertyResolved property of ELContext was set to true, then true; otherwise undefined.
Throws:
NullPointerException - if context is null

public java.util.Iterator<E> getFeatureDescriptors(ELContext context, Object base)
如果 base 对象为 ResourceBundle，则返回一个 Iterator，它包含 ResourceBundle 中可用的一组键。否则返回 null。

返回的 Iterator 必须包含 0 个或多个 java.beans.FeatureDescriptor 实例。每个 info 对象包含有关 ResourceBundle 中一个键的信息，并且初始化如下：

  • displayName - String 键
  • name – 与 displayName 属性相同。
  • shortDescription – 空字符串
  • expert - false
  • hidden - false
  • preferred - true
    • 此外，必须在返回的 FeatureDescriptor 中设置以下指定的属性：
  • ELResolver#TYPE - String.class
  • ELResolver#RESOLVABLE_AT_DESIGN_TIME - true

    • context | 此计算的上下文。
base | 要迭代其键的包。此解析器仅处理属于 ResourceBundle 类型的 base。
return | 包含 0 个或多个（可能无限多个）FeatureDescriptor 对象的 Iterator，每个对象代表此包中的一个键；如果 base 对象不是 ResourceBundle，则返回 null。
    英文文档：

    getFeatureDescriptors

    public Iterator getFeatureDescriptors(ELContext context,
                                      Object base)
    If the base object is a ResourceBundle, returns an Iterator containing the set of keys available in the ResourceBundle. Otherwise, returns null.

    The Iterator returned must contain zero or more instances of FeatureDescriptor. Each info object contains information about a key in the ResourceBundle, and is initialized as follows:

  • displayName - The String key
  • name - Same as displayName property.
  • shortDescription - Empty string
  • expert - false
  • hidden - false
  • preferred - true
    • In addition, the following named attributes must be set in the returned FeatureDescriptors:
  • ELResolver.TYPE - String.class
  • ELResolver.RESOLVABLE_AT_DESIGN_TIME - true

    • Specified by:
    getFeatureDescriptors in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - The bundle whose keys are to be iterated over. Only bases of type ResourceBundle are handled by this resolver.
    Returns:
    An Iterator containing zero or more (possibly infinitely more) FeatureDescriptor objects, each representing a key in this bundle, or null if the base object is not a ResourceBundle.
    See Also:
    FeatureDescriptor

    public Class<T> getCommonPropertyType(ELContext context, Object base)
    如果 base 对象是 ResourceBundle，则返回对于 property 参数此解析器可接受的最一般类型。否则返回 null。

    假定 base 为 ResourceBundle，则此方法将总是返回 String.class。

    context | 此计算的上下文。
base | 要分析的包。此解析器仅处理属于 ResourceBundle 类型的 base。
return | 如果 base 不为 ResourceBundle，则返回 null；否则返回 String.class。
    英文文档：

    getCommonPropertyType

    public Class<?> getCommonPropertyType(ELContext context,
                                      Object base)
    If the base object is a ResourceBundle, returns the most general type that this resolver accepts for the property argument. Otherwise, returns null.

    Assuming the base is a ResourceBundle, this method will always return String.class.

    Specified by:
    getCommonPropertyType in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - The bundle to analyze. Only bases of type ResourceBundle are handled by this resolver.
    Returns:
    null if base is not a ResourceBundle; otherwise String.class.
    Overview Package Class Tree Deprecated Index Help
    PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValueExpression (Java EE 5)

javax.el
Class ValueExpression

java.lang.Object
    extended by  javax.el.Expression
        extended by  javax.el.ValueExpression
All Implemented Interfaces:
Serializable
public abstract class ValueExpression
extends Expression

Extends: Expression

可以获取或设置值的 Expression。

此 API 以前的代号，只能读取表达式。ValueExpression 对象现在可以用于获取值和设置值。可以设置值的表达式称为 l-value 表达式。不能设置值的表达式称为 r-value 表达式。并非所有 r-value 表达式都可以用作 l-value 表达式（例如，"${1+1}" 或 "${firstName} ${lastName}"）。有关详细信息，请参阅 EL 规范。对不能用作 l-value 的表达式调用 isReadOnly() 必须总是返回 true。

可以使用 ExpressionFactory#createValueExpression 方法解析表达式字符串，并返回封装已解析表达式的 ValueExpression 的具体实例。解析时（而不是计算时）使用 FunctionMapper，所以在计算表达式时不需要它。但是，计算时需要 ELContext。

每次调用 #getValue、#setValue、#isReadOnly 和 #getType 方法时将对表达式求值。使用 ELContext 中的 ELResolver 解析顶级变量，并确定 . 和 [] 操作符的行为。对于这 4 个方法中的任何一个，使用 ELResolver#getValue 方法解析除最后一个属性以外的所有属性。这提供 base 对象。最后解析时，ValueExpression 将调用相应的 ELResolver#getValue、ELResolver#setValue、ELResolver#isReadOnly 或 ELResolver#getType 方法，具体情况取决于在 ValueExpression 上调用哪个方法。

请参阅 Expression javadoc 中有关比较、序列化和不可变性的注释。

since | JSP 2.1
See also | javax.el.ELResolver, javax.el.Expression, javax.el.ExpressionFactory
英文文档：

An Expression that can get or set a value.

In previous incarnations of this API, expressions could only be read. ValueExpression objects can now be used both to retrieve a value and to set a value. Expressions that can have a value set on them are referred to as l-value expressions. Those that cannot are referred to as r-value expressions. Not all r-value expressions can be used as l-value expressions (e.g. "${1+1}" or "${firstName} ${lastName}"). See the EL Specification for details. Expressions that cannot be used as l-values must always return true from isReadOnly().

The ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class) method can be used to parse an expression string and return a concrete instance of ValueExpression that encapsulates the parsed expression. The FunctionMapper is used at parse time, not evaluation time, so one is not needed to evaluate an expression using this class. However, the ELContext is needed at evaluation time.

The getValue(javax.el.ELContext), setValue(javax.el.ELContext, java.lang.Object), isReadOnly(javax.el.ELContext) and getType(javax.el.ELContext) methods will evaluate the expression each time they are called. The ELResolver in the ELContext is used to resolve the top-level variables and to determine the behavior of the . and [] operators. For any of the four methods, the ELResolver.getValue(javax.el.ELContext, java.lang.Object, java.lang.Object) method is used to resolve all properties up to but excluding the last one. This provides the base object. At the last resolution, the ValueExpression will call the corresponding ELResolver.getValue(javax.el.ELContext, java.lang.Object, java.lang.Object), ELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object), ELResolver.isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object) or ELResolver.getType(javax.el.ELContext, java.lang.Object, java.lang.Object) method, depending on which was called on the ValueExpression.

See the notes about comparison, serialization and immutability in the Expression javadocs.

Since:
JSP 2.1
See Also:
ELResolver, Expression, ExpressionFactory, Serialized Form

Constructor Summary
ValueExpression()
Method Summary
abstract Class<?> | getExpectedType() Returns the type the result of the expression will be coerced to after evaluation.
abstract Class<?> | getType(ELContext context) Evaluates the expression relative to the provided context, and returns the most general type that is acceptable for an object to be passed as the value parameter in a future call to the setValue(javax.el.ELContext, java.lang.Object) method.
abstract Object | getValue(ELContext context) Evaluates the expression relative to the provided context, and returns the resulting value.
abstract boolean | isReadOnly(ELContext context) Evaluates the expression relative to the provided context, and returns true if a call to setValue(javax.el.ELContext, java.lang.Object) will always fail.
abstract void | setValue(ELContext context, Object value) Evaluates the expression relative to the provided context, and sets the result to the provided value.
Methods inherited from class javax.el.Expression
equals, getExpressionString, hashCode, isLiteralText
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ValueExpression()
英文文档：

ValueExpression

public ValueExpression()
Method Detail

abstract public Object getValue(ELContext context)
相对于提供的上下文对表达式求值，并返回所得值。

所得值会自动强制匹配为创建此表达式时提供给 ExpressionFactory 的 getExpectedType() 所返回的类型。

context | 此计算的上下文。
return | 表达式求值的结果。
Throws | NullPointerException: 如果 context 为 null。
Throws | PropertyNotFoundException: 如果由于指定变量或属性不存在或不可读导致某个属性解析操作失败。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getValue

public abstract Object getValue(ELContext context)
Evaluates the expression relative to the provided context, and returns the resulting value.

The resulting value is automatically coerced to the type returned by getExpectedType(), which was provided to the ExpressionFactory when this expression was created.

Parameters:
context - The context of this evaluation.
Returns:
The result of the expression evaluation.
Throws:
NullPointerException - if context is null.
PropertyNotFoundException - if one of the property resolutions failed because a specified variable or property does not exist or is not readable.
ELException - if an exception was thrown while performing property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

abstract public void setValue(ELContext context, Object value)
相对于提供的上下文对表达式求值，并将结果设置为提供的值。
context | 此计算的上下文。
value | 要设置的新值。
Throws | NullPointerException: 如果 context 为 null。
Throws | PropertyNotFoundException: 如果由于指定变量或属性不存在或不可读导致某个属性解析操作失败。
Throws | PropertyNotWritableException: 如果由于指定的变量或属性不可写导致最终变量或属性解析失败。
Throws | ELException: 如果尝试设置属性或变量时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

setValue

public abstract void setValue(ELContext context,
                              Object value)
Evaluates the expression relative to the provided context, and sets the result to the provided value.

Parameters:
context - The context of this evaluation.
value - The new value to be set.
Throws:
NullPointerException - if context is null.
PropertyNotFoundException - if one of the property resolutions failed because a specified variable or property does not exist or is not readable.
PropertyNotWritableException - if the final variable or property resolution failed because the specified variable or property is not writable.
ELException - if an exception was thrown while attempting to set the property or variable. The thrown exception must be included as the cause property of this exception, if available.

abstract public boolean isReadOnly(ELContext context)
相对于提供的上下文对表达式求值，如果调用 #setValue 总是失败，则返回 true。
context | 此计算的上下文。
return | 如果表达式是只读的，则返回 true；否则返回 false。
Throws | NullPointerException: 如果 context 为 null。
Throws | PropertyNotFoundException: 如果由于指定变量或属性不存在或不可读导致某个属性解析操作失败。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。 * @throws NullPointerException 如果 context 为 null
英文文档：

isReadOnly

public abstract boolean isReadOnly(ELContext context)
Evaluates the expression relative to the provided context, and returns true if a call to setValue(javax.el.ELContext, java.lang.Object) will always fail.

Parameters:
context - The context of this evaluation.
Returns:
true if the expression is read-only or false if not.
Throws:
NullPointerException - if context is null.
PropertyNotFoundException - if one of the property resolutions failed because a specified variable or property does not exist or is not readable.
ELException - if an exception was thrown while performing property or variable resolution. The thrown exception must be included as the cause property of this exception, if available. * @throws NullPointerException if context is null

abstract public Class<T> getType(ELContext context)
相对于提供的上下文对表达式求值，并返回最一般的类型，该类型对于将来调用 #setValue 方法时作为 value 参数传递的对象而言是可接受的。

这并非总是与 getValue().getClass() 相同。例如，如果是引用数组元素的表达式，则 getType 方法将返回数组元素的类型，这可能是当前位于指定的数组元素中实际元素类型的超类。

context | 此计算的上下文。
return | 最一般可接受的类型；其他情况未定义。
Throws | NullPointerException: 如果 context 为 null。
Throws | PropertyNotFoundException: 如果由于指定变量或属性不存在或不可读导致某个属性解析操作失败。
Throws | ELException: 如果执行属性或变量解析时抛出异常。抛出的异常必须作为此异常的 cause 属性包含（如果可用）。
英文文档：

getType

public abstract Class<?> getType(ELContext context)
Evaluates the expression relative to the provided context, and returns the most general type that is acceptable for an object to be passed as the value parameter in a future call to the setValue(javax.el.ELContext, java.lang.Object) method.

This is not always the same as getValue().getClass(). For example, in the case of an expression that references an array element, the getType method will return the element type of the array, which might be a superclass of the type of the actual element that is currently in the specified array element.

Parameters:
context - The context of this evaluation.
Returns:
the most general acceptable type; otherwise undefined.
Throws:
NullPointerException - if context is null.
PropertyNotFoundException - if one of the property resolutions failed because a specified variable or property does not exist or is not readable.
ELException - if an exception was thrown while performing property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

abstract public Class<T> getExpectedType()
返回求值之后将表达式结果强制匹配的类型。
return 传递给创建了此 ValueExpression 的 ExpressionFactory.createValueExpression 方法的 expectedType。
英文文档：

getExpectedType

public abstract Class<?> getExpectedType()
Returns the type the result of the expression will be coerced to after evaluation.

Returns:
the expectedType passed to the ExpressionFactory.createValueExpression method that created this ValueExpression.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VariableMapper (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.el
Class VariableMapper

java.lang.Object
    extended by  javax.el.VariableMapper

public abstract class VariableMapper
extends Object

在 EL 变量及其关联的 EL 表达式之间进行映射的接口。
since JSP 2.1
英文文档：

The interface to a map between EL variables and the EL expressions they are associated with.

Since:
JSP 2.1

Constructor Summary
VariableMapper()
Method Summary
abstract ValueExpression | resolveVariable(String variable)
abstract ValueExpression | setVariable(String variable, ValueExpression expression) Assign a ValueExpression to an EL variable, replacing any previously assignment to the same variable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public VariableMapper()
英文文档：

VariableMapper

public VariableMapper()
Method Detail

abstract public ValueExpression resolveVariable(String variable)
variable | 变量名称
return | 分配给变量的 ValueExpression；如果此变量以前没有分配值，则返回 null。
英文文档：

resolveVariable

public abstract ValueExpression resolveVariable(String variable)
Parameters:
variable - The variable name
Returns:
the ValueExpression assigned to the variable, null if there is no previous assignment to this variable.

abstract public ValueExpression setVariable(String variable, ValueExpression expression)
将 ValueExpression 分配给 EL 变量，替换以前分配给该变量的任何值。如果表达式为 null，则删除分配给该变量的值。
variable | 变量名称
expression | 将分配给变量的 ValueExpression。
return | 以前分配给此变量的 ValueExpression；如果此变量以前没有分配值，则返回 null。
英文文档：

setVariable

public abstract ValueExpression setVariable(String variable,
                                            ValueExpression expression)
Assign a ValueExpression to an EL variable, replacing any previously assignment to the same variable. The assignment for the variable is removed if the expression is null.

Parameters:
variable - The variable name
expression - The ValueExpression to be assigned to the variable.
Returns:
The previous ValueExpression assigned to this variable, null if there is no previouse assignment to this variable.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ELException (Java EE 5)

javax.el
Class ELException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.el.ELException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MethodNotFoundException, PropertyNotFoundException, PropertyNotWritableException
public class ELException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException
Extended by: MethodNotFoundException, PropertyNotFoundException, PropertyNotWritableException

代表表达式求值期间可能出现的任何异常情况。
since JSP 2.1
英文文档：

Represents any of the exception conditions that can arise during expression evaluation.

Since:
JSP 2.1
See Also:
Serialized Form

Constructor Summary
ELException()
Creates an ELException with no detail message.
ELException(String pMessage)
Creates an ELException with the provided detail message.
ELException(String pMessage, Throwable pRootCause)
Creates an ELException with the given detail message and root cause.
ELException(Throwable pRootCause)
Creates an ELException with the given 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

public ELException()
创建不带详细消息的 ELException。
英文文档：

ELException

public ELException()
Creates an ELException with no detail message.

public ELException(String pMessage)
创建带有提供的详细消息的 ELException。
pMessage 详细信息
英文文档：

ELException

public ELException(String pMessage)
Creates an ELException with the provided detail message.

Parameters:
pMessage - the detail message

public ELException(Throwable pRootCause)
创建带有给定原因的 ELException。
pRootCause 此异常的根本原因
英文文档：

ELException

public ELException(Throwable pRootCause)
Creates an ELException with the given cause.

Parameters:
pRootCause - the originating cause of this exception

public ELException(String pMessage, Throwable pRootCause)
创建带有给定详细消息和根本原因的 ELException。
pMessage | 详细信息
pRootCause | 此异常的根本原因
英文文档：

ELException

public ELException(String pMessage,
                   Throwable pRootCause)
Creates an ELException with the given detail message and root cause.

Parameters:
pMessage - the detail message
pRootCause - the originating cause of this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodNotFoundException (Java EE 5)

javax.el
Class MethodNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.el.ELException
                    extended by  javax.el.MethodNotFoundException
All Implemented Interfaces:
Serializable
public class MethodNotFoundException
extends ELException

Extends: Throwable > Exception > RuntimeException > ELException

如果对 MethodExpression 求值时找不到方法，则抛出该异常。
since | JSP 2.1
See also | javax.el.MethodExpression
英文文档：

Thrown when a method could not be found while evaluating a MethodExpression.

Since:
JSP 2.1
See Also:
MethodExpression, Serialized Form

Constructor Summary
MethodNotFoundException()
Creates a MethodNotFoundException with no detail message.
MethodNotFoundException(String message)
Creates a MethodNotFoundException with the provided detail message.
MethodNotFoundException(String pMessage, Throwable pRootCause)
Creates a MethodNotFoundException with the given detail message and root cause.
MethodNotFoundException(Throwable exception)
Creates a MethodNotFoundException with the given root 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

public MethodNotFoundException()
创建不带详细消息的 MethodNotFoundException。
英文文档：

MethodNotFoundException

public MethodNotFoundException()
Creates a MethodNotFoundException with no detail message.

public MethodNotFoundException(String message)
创建带提供的详细消息的 MethodNotFoundException。
message 详细信息
英文文档：

MethodNotFoundException

public MethodNotFoundException(String message)
Creates a MethodNotFoundException with the provided detail message.

Parameters:
message - the detail message

public MethodNotFoundException(Throwable exception)
创建带给定的根本原因的 MethodNotFoundException。
exception 此异常的根本原因
英文文档：

MethodNotFoundException

public MethodNotFoundException(Throwable exception)
Creates a MethodNotFoundException with the given root cause.

Parameters:
exception - the originating cause of this exception

public MethodNotFoundException(String pMessage, Throwable pRootCause)
创建带给定的详细消息和根本原因的 MethodNotFoundException。
pMessage | 详细信息
pRootCause | 此异常的根本原因
英文文档：

MethodNotFoundException

public MethodNotFoundException(String pMessage,
                               Throwable pRootCause)
Creates a MethodNotFoundException with the given detail message and root cause.

Parameters:
pMessage - the detail message
pRootCause - the originating cause of this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyNotFoundException (Java EE 5)

javax.el
Class PropertyNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.el.ELException
                    extended by  javax.el.PropertyNotFoundException
All Implemented Interfaces:
Serializable
public class PropertyNotFoundException
extends ELException

Extends: Throwable > Exception > RuntimeException > ELException

如果对 ValueExpression 或 MethodExpression 求值时无法找到属性，则抛出该异常。

例如，如果设置数组值时索引超出边界，或者获取 JavaBean 属性的值时遇到不可读的属性，则可能触发此异常。

since JSP 2.1
英文文档：

Thrown when a property could not be found while evaluating a ValueExpression or MethodExpression.

For example, this could be triggered by an index out of bounds while setting an array value, or by an unreadable property while getting the value of a JavaBeans property.

Since:
JSP 2.1
See Also:
Serialized Form

Constructor Summary
PropertyNotFoundException()
Creates a PropertyNotFoundException with no detail message.
PropertyNotFoundException(String message)
Creates a PropertyNotFoundException with the provided detail message.
PropertyNotFoundException(String pMessage, Throwable pRootCause)
Creates a PropertyNotFoundException with the given detail message and root cause.
PropertyNotFoundException(Throwable exception)
Creates a PropertyNotFoundException with the given root 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

public PropertyNotFoundException()
创建不带详细消息的 PropertyNotFoundException。
英文文档：

PropertyNotFoundException

public PropertyNotFoundException()
Creates a PropertyNotFoundException with no detail message.

public PropertyNotFoundException(String message)
创建带提供的详细消息的 PropertyNotFoundException。
message 详细信息
英文文档：

PropertyNotFoundException

public PropertyNotFoundException(String message)
Creates a PropertyNotFoundException with the provided detail message.

Parameters:
message - the detail message

public PropertyNotFoundException(Throwable exception)
创建带给定根本原因的 PropertyNotFoundException。
exception 此异常的根本原因
英文文档：

PropertyNotFoundException

public PropertyNotFoundException(Throwable exception)
Creates a PropertyNotFoundException with the given root cause.

Parameters:
exception - the originating cause of this exception

public PropertyNotFoundException(String pMessage, Throwable pRootCause)
创建带给定详细消息和根本原因的 PropertyNotFoundException。
pMessage | 详细信息
pRootCause | 此异常的根本原因
英文文档：

PropertyNotFoundException

public PropertyNotFoundException(String pMessage,
                                 Throwable pRootCause)
Creates a PropertyNotFoundException with the given detail message and root cause.

Parameters:
pMessage - the detail message
pRootCause - the originating cause of this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyNotWritableException (Java EE 5)

javax.el
Class PropertyNotWritableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.el.ELException
                    extended by  javax.el.PropertyNotWritableException
All Implemented Interfaces:
Serializable
public class PropertyNotWritableException
extends ELException

Extends: Throwable > Exception > RuntimeException > ELException

如果在 ValueExpression 上设置值时无法写入属性，则抛出该异常。

例如，尝试在不可修改的映射上设置映射值可能会触发此异常。

since JSP 2.1
英文文档：

Thrown when a property could not be written to while setting the value on a ValueExpression.

For example, this could be triggered by trying to set a map value on an unmodifiable map.

Since:
JSP 2.1
See Also:
Serialized Form

Constructor Summary
PropertyNotWritableException()
Creates a PropertyNotWritableException with no detail message.
PropertyNotWritableException(String pMessage)
Creates a PropertyNotWritableException with the provided detail message.
PropertyNotWritableException(String pMessage, Throwable pRootCause)
Creates a PropertyNotWritableException with the given detail message and root cause.
PropertyNotWritableException(Throwable exception)
Creates a PropertyNotWritableException with the given root 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

public PropertyNotWritableException()
创建不带详细消息的 PropertyNotWritableException。
英文文档：

PropertyNotWritableException

public PropertyNotWritableException()
Creates a PropertyNotWritableException with no detail message.

public PropertyNotWritableException(String pMessage)
创建带有提供的详细消息的 PropertyNotWritableException。
pMessage 详细信息
英文文档：

PropertyNotWritableException

public PropertyNotWritableException(String pMessage)
Creates a PropertyNotWritableException with the provided detail message.

Parameters:
pMessage - the detail message

public PropertyNotWritableException(Throwable exception)
创建带给定的根本原因的 PropertyNotWritableException。
exception 此异常的根本原因
英文文档：

PropertyNotWritableException

public PropertyNotWritableException(Throwable exception)
Creates a PropertyNotWritableException with the given root cause.

Parameters:
exception - the originating cause of this exception

public PropertyNotWritableException(String pMessage, Throwable pRootCause)
创建带给定详细消息和根本原因的 PropertyNotWritableException。
pMessage | 详细信息
pRootCause | 此异常的根本原因
英文文档：

PropertyNotWritableException

public PropertyNotWritableException(String pMessage,
                                    Throwable pRootCause)
Creates a PropertyNotWritableException with the given detail message and root cause.

Parameters:
pMessage - the detail message
pRootCause - the originating cause of this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.enterprise.deploy.model (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.model

Provides Tool Vendor implementation classes.

See:
Description

Interface Summary
DDBean | An interface for beans that represent a fragment of a standard deployment descriptor.
DDBeanRoot | An interface that represents the root of a standard deployment descriptor.
DeployableObject | The DeployableObject interface is an abstract representation of a J2EE deployable module (JAR, WAR, RAR, EAR).
J2eeApplicationObject | J2eeApplicationObject is an interface that represents a J2EE application (EAR); it maintains a DeployableObject for each module in the archive.
XpathListener | The listener interface for receiving XpathEvents

Class Summary
XpathEvent An Event class describing ConfigBeans being added/subtracted from a server configuration.

Package javax.enterprise.deploy.model Description

Provides Tool Vendor implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.model Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.model

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.enterprise.deploy.model.XpathEvent

Interface Hierarchy

  • javax.enterprise.deploy.model.DDBean
    • javax.enterprise.deploy.model.DDBeanRoot
  • javax.enterprise.deploy.model.DeployableObject
    • javax.enterprise.deploy.model.J2eeApplicationObject
  • javax.enterprise.deploy.model.XpathListener
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DDBean (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.model
Interface DDBean

All Known Subinterfaces:
DDBeanRoot
public interface DDBean

Implemented by: DDBeanRoot

表示标准部署描述符片断的 Bean 接口。可为包含此 Bean 的 J2EE 应用程序提供链接。
英文文档：

An interface for beans that represent a fragment of a standard deployment descriptor. A link is provided to the J2EE application that includes this bean.

Method Summary
void | addXpathListener(String xpath, XpathListener xpl) Register a listener for a specific XPath.
String[] | getAttributeNames() Returns the list of attribute names associated with the XML element.
String | getAttributeValue(String attrName) Returns the string value of the named attribute.
DDBean[] | getChildBean(String xpath) Return a list of DDBeans based upon the XPath.
String | getId() Returns a tool-specific reference for attribute ID on an element in the deployment descriptor.
DDBeanRoot | getRoot() Return the root element for this DDBean.
String | getText() Returns the XML text for by this bean.
String[] | getText(String xpath) Return a list of text values for a given XPath in the deployment descriptor.
String | getXpath() Returns the original xpath string provided by the DConfigBean.
void | removeXpathListener(String xpath, XpathListener xpl) Unregister a listener for a specific XPath.

Method Detail

public String getXpath()
返回 DConfigBean 提供的原 xpath 字符串。
return 此 Bean 的 XPath。
英文文档：

getXpath

String getXpath()
Returns the original xpath string provided by the DConfigBean.

Returns:
The XPath of this Bean.

public String getText()
返回此 Bean 的 XML 文本。
return 此 Bean 的 XML 文本。
英文文档：

getText

String getText()
Returns the XML text for by this bean.

Returns:
The XML text for this Bean.

public String getId()
返回一个特定于工具的引用，它引用部署描述符中某个元素的属性 ID。此属性是为 J2EE 1.2 和 J2EE 1.3 组件定义的。
return 此 Bean 的 XML 文本；如果未使用标记指定任何属性，则返回 'null'。
英文文档：

getId

String getId()
Returns a tool-specific reference for attribute ID on an element in the deployment descriptor. This attribute is defined for J2EE 1.2 and 1.3 components.

Returns:
The XML text for this Bean or 'null' if no attribute was specifed with the tag.

public DDBeanRoot getRoot()
返回此 DDBean 的根元素。
return 此 DDBean 树根下的 DDBeanRoot。
英文文档：

getRoot

DDBeanRoot getRoot()
Return the root element for this DDBean.

Returns:
The DDBeanRoot at the root of this DDBean tree.

public DDBean[] getChildBean(String xpath)
返回基于 XPath 的 DDBeans 列表。
xpath | 引用此标准 Bean 所使用的部署描述符中某个位置的 XPath 字符串。
return | DDBeans 列表；如果未找到任何匹配的 XML 数据，则返回 'null'。
英文文档：

getChildBean

DDBean[] getChildBean(String xpath)
Return a list of DDBeans based upon the XPath.

Parameters:
xpath - An XPath string referring to a location in the same deployment descriptor as this standard bean.
Returns:
a list of DDBeans or 'null' if no matching XML data is found.

public String[] getText(String xpath)
返回部署描述符中给定 XPath 的文本值列表。
xpath | XPath。
return | 此 XPath 的文本值列表；如果未找到任何匹配的 XML 数据，则返回 'null'。
英文文档：

getText

String[] getText(String xpath)
Return a list of text values for a given XPath in the deployment descriptor.

Parameters:
xpath - An XPath.
Returns:
The list text values for this XPath or 'null' if no matching XML data is found.

public void addXpathListener(String xpath, XpathListener xpl)
为特定 XPath 注册一个侦听器。
xpath | 要注册此侦听器的 XPath。
xpl | 侦听器对象。
英文文档：

addXpathListener

void addXpathListener(String xpath,
                      XpathListener xpl)
Register a listener for a specific XPath.

Parameters:
xpath - The XPath this listener is to be registered for.
xpl - The listener object.

public void removeXpathListener(String xpath, XpathListener xpl)
取消为特定 XPath 注册的侦听器。
xpath | 要取消注册此侦听器的 XPath。
xpl | 侦听器对象。
英文文档：

removeXpathListener

void removeXpathListener(String xpath,
                         XpathListener xpl)
Unregister a listener for a specific XPath.

Parameters:
xpath - The XPath from which this listener is to be unregistered.
xpl - The listener object.

public String[] getAttributeNames()
返回与 XML 元素关联的属性名称列表。
return 此元素的属性名称列表。如果不存在任何属性，则返回 null。
英文文档：

getAttributeNames

String[] getAttributeNames()
Returns the list of attribute names associated with the XML element.

Returns:
a list of attribute names on this element. Null is returned if there are no attributes.

public String getAttributeValue(String attrName)
返回指定属性的字符串值。
return 属性的值。如果不存在这种属性，则返回 null。
英文文档：

getAttributeValue

String getAttributeValue(String attrName)
Returns the string value of the named attribute.

Returns:
a the value of the attribute. Null is returned if there is no such attribute.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DDBeanRoot (Java EE 5)

javax.enterprise.deploy.model
Interface DDBeanRoot

All Superinterfaces:
DDBean
public interface DDBeanRoot
extends DDBean

Implements: DDBean

表示标准部署描述符根的接口。DDBeanRoot 是 DDBean 的一种类型。
英文文档：

An interface that represents the root of a standard deployment descriptor. A DDBeanRoot is a type of DDBean.

Author:
gfink

Method Summary
 String getDDBeanRootVersion()
Returns the version number of an XML instance document.
 DeployableObject getDeployableObject()
Return the containing DeployableObject
 String getFilename()
Returns the filename relative to the root of the module of the XML instance document this DDBeanRoot represents.
 String getModuleDTDVersion()
Deprecated. As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()
 ModuleType getType()
Return the ModuleType of deployment descriptor.
 String getXpath()
Return the XPath for this standard bean.
Methods inherited from interface javax.enterprise.deploy.model.DDBean
addXpathListener, getAttributeNames, getAttributeValue, getChildBean, getId, getRoot, getText, getText, removeXpathListener

Method Detail

public ModuleType getType()
返回部署描述符的 ModuleType。
return 部署描述符的 ModuleType。
英文文档：

getType

ModuleType getType()
Return the ModuleType of deployment descriptor.

Returns:
The ModuleType of deployment descriptor

public DeployableObject getDeployableObject()
返回包含的 DeployableObject。
return 包含此部署描述符的 DeployableObject。
英文文档：

getDeployableObject

DeployableObject getDeployableObject()
Return the containing DeployableObject

Returns:
The DeployableObject that contains this deployment descriptor

public String getModuleDTDVersion()
返回 DTD 版本号的便捷方法。DeployableObject 拥有此信息。
return | 包含 DTD 版本号的字符串 此方法已过时。目前正在使用的 DD 数据格式有两种：DTD 和 XML Schema。应该使用 DDBeanRoot.getDDBeanRootVersion 取代此方法。
deprecated | 从 1.1 版本开始，用 DDBeanRoot.getDDBeanRootVersion() 取代
英文文档：

getModuleDTDVersion

String getModuleDTDVersion()
Deprecated. As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()

A convenience method to return the DTD version number. The DeployableObject has this information.

Returns:
a string containing the DTD version number This method is being deprecated. Two DD data formats are being used, DTD and XML Schema. DDBeanRoot.getDDBeanRootVersion should be used in its place.

public String getDDBeanRootVersion()
返回 XML 实例文档的版本号。此方法将取代 DDBeanRoot.getModuleDTDVersion 和 DeployableObject.getModuleDTDVersion 方法。此方法可返回任何 J2EE XML 实例文档的版本号。
return 表示 XML 实例文档版本号的字符串。如果找不到任何版本号，则返回 null。
英文文档：

getDDBeanRootVersion

String getDDBeanRootVersion()
Returns the version number of an XML instance document. This method is replacing the methods DDBeanRoot.getModuleDTDVersion and DeployableObject.getModuleDTDVersion. This method returns the version number of any J2EE XML instance document.

Returns:
a string that is the version number of the XML instance document. Null is returned if no version number can be found.

public String getXpath()
返回此标准 Bean 的 XPath。根 XPath 为 "/"。
return "/"，它是根标准 Bean。
英文文档：

getXpath

String getXpath()
Return the XPath for this standard bean. The root XPath is "/".

Specified by:
getXpath in interface DDBean
Returns:
"/" this is the root standard bean.

public String getFilename()
返回与此 DDBeanRoot 所表示的 XML 实例文档模块的根相对的文件名称。
return 相对于模块根的文件名称 (String)。
英文文档：

getFilename

String getFilename()
Returns the filename relative to the root of the module of the XML instance document this DDBeanRoot represents.

Returns:
String the filename relative to the root of the module
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeployableObject (Java EE 5)

javax.enterprise.deploy.model
Interface DeployableObject

All Known Subinterfaces:
J2eeApplicationObject
public interface DeployableObject

Implemented by: J2eeApplicationObject

DeployableObject 接口是 J2EE 可部署模块（JAR、WAR、RAR、EAR）的抽象表示形式。DeployableObject 提供对模块的部署描述符和类文件的访问。
version 0.1
英文文档：

The DeployableObject interface is an abstract representation of a J2EE deployable module (JAR, WAR, RAR, EAR). A DeployableObject provides access to the module's deployment descriptor and class files.

Version:
0.1
Author:
gfink

Method Summary
 Enumeration entries()
Returns an enumeration of the module file entries.
 DDBean[] getChildBean(String xpath)
Return an array of standard beans representing the XML content returned based upon the XPath.
 Class getClassFromScope(String className)
Retrieve the specified class from this deployable module.
 DDBeanRoot getDDBeanRoot()
Return the top level standard bean representing the root of the deployment descriptor.
 DDBeanRoot getDDBeanRoot(String filename)
Returns a DDBeanRoot object for the XML instance document named.
 InputStream getEntry(String name)
Returns the InputStream for the given entry name The file name must be relative to the root of the module.
 String getModuleDTDVersion()
Deprecated. As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()
 String[] getText(String xpath)
Return the XML content associated with the XPath from a deployment descriptor.
 ModuleType getType()
Return the ModuleType of deployment descriptor (i.e., EAR, JAR, WAR, RAR) this deployable object represents.

Method Detail

public ModuleType getType()
返回由此可部署对象表示的部署描述符的 ModuleType（即 EAR、JAR、WAR、RAR）。值存在于 DeploymentManager 中。
return 可部署对象的 ModuleType。
英文文档：

getType

ModuleType getType()
Return the ModuleType of deployment descriptor (i.e., EAR, JAR, WAR, RAR) this deployable object represents. Values are found in DeploymentManager.

Returns:
The ModuleType of deployable object

public DDBeanRoot getDDBeanRoot()
返回表示部署描述符的根的顶级标准 Bean。
return 表示部署描述符的标准 Bean。
英文文档：

getDDBeanRoot

DDBeanRoot getDDBeanRoot()
Return the top level standard bean representing the root of the deployment descriptor.

Returns:
A standard bean representing the deployment descriptor.

public DDBean[] getChildBean(String xpath)
返回一个标准 Bean 数组，这些 Bean 表示基于 XPath 返回的 XML 内容。
xpath | 一个 XPath 字符串，标识从部署描述符中提取的数据。
return | DDBean 数组；如果未找到任何匹配的数据，则返回 'null'。
英文文档：

getChildBean

DDBean[] getChildBean(String xpath)
Return an array of standard beans representing the XML content returned based upon the XPath.

Parameters:
xpath - An XPath string identifying the data to be extracted from the deployment descriptor.
Returns:
a array of DDBeans or 'null' if no matching data found.

public String[] getText(String xpath)
返回与部署描述符中的 XPath 关联的 XML 内容。
xpath | 引用部署描述符中某个位置的 xpath 字符串。
return | XML 内容列表；如果未找到任何匹配的数据，则返回 'null'。
英文文档：

getText

String[] getText(String xpath)
Return the XML content associated with the XPath from a deployment descriptor.

Parameters:
xpath - An xpath string referring to a location in the deployment descriptor
Returns:
a list XML content or 'null' if no matching data found.

public Class<T> getClassFromScope(String className)
从此可部署模块中获取特定的类。

用途一：获取所有来自 EJB 的查找方法。 如果工具尝试打包某个模块并从此包获取类，则类请求可能失败。可能还不能使用类。该工具应该遵守清单 cross-path 条目。

className | 要获取的类。
return | 类的表示形式 (Class)。
英文文档：

getClassFromScope

Class getClassFromScope(String className)
Retrieve the specified class from this deployable module.

One use: to get all finder methods from an EJB If the tool is attempting to package an module and retrieve a class from the package, the class request may fail. The class may not yet be available. The tool should respect the manifest cross-path entries.

Parameters:
className - Class to retrieve.
Returns:
Class representation of the class

public String getModuleDTDVersion()
返回在 XML DOCTYPE 文本中指定的 DTD 版本号，每个标准的 J2EE 模块部署描述符文件都提供了 XML DOCTYPE 文本。
return 包含 DTD 版本号的字符串
模块的部署描述符文件总是包含
文档类型标识符 DOCTYPE。DOCTYPE 语句
在语句的标签中包含模块 DTD 版本号
。

    DOCTYPE 语句的格式为：

    <!DOCTYPE root_element PUBLIC
    "-//organization//label//language" "location">

root_element - DTD 中根文档的名称。
organization - 负责创建和维护被引用的
 DTD 的组织的名称
。
label - 被引用的公共文本的唯一描述性名称
。
language - ISO 639 语言 id，
表示 DTD 的自然语言编码。
location - DTD 的 URL。

J2EE 部署描述符的 DOCTYPE 语句示例如下：

<!DOCTYPE application-client PUBLIC
"-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN"
"http://java.sun.com/dtd/application-client_1_3.dtd">

在本例中，标签为 "DTD J2EE Application Client 1.3"，
DTD 版本号是 1.3。调用 getModuleDTDVersion
将返回一个包含 "1.3" 的字符串。
此方法已过时。J2EE 1.4 除了在组件中添加了多个部署描述符之外，还使用 DDBeanRoot.getDDBeanRootVersion 取代了此方法。
deprecated 从 1.1 版本开始，用 DDBeanRoot.getDDBeanRootVersion() 取代
英文文档：

getModuleDTDVersion

String getModuleDTDVersion()
Deprecated. As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()

Returns the DTD version number given in the XML DOCTYPE text provided in every standard J2EE module's deployment descriptor file.

Returns:
a string containing the DTD version number
 A module's deployment descriptor file always contains
 a document type identifier, DOCTYPE.  The DOCTYPE statement
 contains the module DTD version number in the label of the
 statement.

        The format of the DOCTYPE statement is:

        <!DOCTYPE root_element PUBLIC
        "-//organization//label//language" "location">

 root_element - is the name of the root document in the DTD.
 organization  - is the name of the organization responsible
                 for the creation and maintenance of the DTD
                 being referenced.
 label - is a unique descriptive name for the public text being
                 referenced.
 language - is the ISO 639 language id representing the natural
                 language encoding of th DTD.
 location - is the URL of the DTD.

 An example J2EE deployment descriptor DOCTYPE statement is:

   <!DOCTYPE application-client PUBLIC
   "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN"
   "http://java.sun.com/dtd/application-client_1_3.dtd">

 In this example the label is, "DTD J2EE Application Client 1.3",
 and the DTD version number is 1.3. A call to getModuleDTDVersion
 would return a string containing, "1.3".
This method is being deprecated. With the addition of multiple deployment descritors in components for J2EE 1.4 this method is being replaced by DDBeanRoot.getDDBeanRootVersion.

public DDBeanRoot getDDBeanRoot(String filename) throws java.io.FileNotFoundException, DDBeanCreateException
返回指定 XML 实例文档的 DDBeanRoot 对象。此方法应该用于返回非部署描述符 XML 实例文档（如 WSDL 文件）的 DDBeanRoot 对象。
return | XML 数据的 DDBeanRoot 对象。
Throws | java.io.FileNotFoundException,: 如果找不到指定的文件
Throws | DDBeanCreateException: 如果在创建 DDBeanRoot 对象时遇到错误。
英文文档：

getDDBeanRoot

DDBeanRoot getDDBeanRoot(String filename)
                         throws FileNotFoundException,
                                DDBeanCreateException
Returns a DDBeanRoot object for the XML instance document named. This method should be used to return DDBeanRoot objects for non deployment descriptor XML instance documents such as WSDL files.

Returns:
a DDBeanRoot object for the XML data.
Throws:
java.io.FileNotFoundException, - if the named file can not be found
DDBeanCreateException - if an error is encountered creating the DDBeanRoot object.
FileNotFoundException

public java.util.Enumeration<E> entries()
返回模块文件条目的枚举。该枚举中的所有元素都是 String 类型。每个 String 表示一个与模块的根相对的文件名称。
return 归档文件条目的枚举。
英文文档：

entries

Enumeration entries()
Returns an enumeration of the module file entries. All elements in the enumeration are of type String. Each String represents a file name relative to the root of the module.

Returns:
an enumeration of the archive file entries.

public java.io.InputStream getEntry(String name)
返回给定条目名称的 InputStream。文件名称必须与模块的根相对。
name | 相对于模块的根的文件名称。
return | 给定条目名称的 InputStream；如果未找到，则返回 null。
英文文档：

getEntry

InputStream getEntry(String name)
Returns the InputStream for the given entry name The file name must be relative to the root of the module.

Parameters:
name - the file name relative to the root of the module.
Returns:
the InputStream for the given entry name or null if not found.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


J2eeApplicationObject (Java EE 5)

javax.enterprise.deploy.model
Interface J2eeApplicationObject

All Superinterfaces:
DeployableObject
public interface J2eeApplicationObject
extends DeployableObject

Implements: DeployableObject

J2eeApplicationObject 是表示 J2EE 应用程序 (EAR) 的接口；它维护归档文件中每个模块的 DeployableObject。
英文文档：

J2eeApplicationObject is an interface that represents a J2EE application (EAR); it maintains a DeployableObject for each module in the archive.

Method Summary
void | addXpathListener(ModuleType type, String xpath, XpathListener xpl) Register a listener for changes in XPath that are related to this deployableObject.
DDBean[] | getChildBean(ModuleType type, String xpath) Return a list of DDBean based upon an XPath; all deployment descriptors of the specified type are searched.
DeployableObject | getDeployableObject(String uri) Return the DeployableObject of the specified URI designator.
DeployableObject[] | getDeployableObjects() Return the all DeployableObjects in this application.
DeployableObject[] | getDeployableObjects(ModuleType type) Return the all DeployableObjects of the specified type.
String[] | getModuleUris() Return the list of URIs for all modules in the application.
String[] | getModuleUris(ModuleType type) Return the list of URIs of the designated module type.
String[] | getText(ModuleType type, String xpath) Return the text value from the XPath; search only the deployment descriptors of the specified type.
void | removeXpathListener(ModuleType type, String xpath, XpathListener xpl) Unregister the listener for an XPath.
Methods inherited from interface javax.enterprise.deploy.model.DeployableObject
entries, getChildBean, getClassFromScope, getDDBeanRoot, getDDBeanRoot, getEntry, getModuleDTDVersion, getText, getType

Method Detail

public DeployableObject getDeployableObject(String uri)
返回指定 URI 标志符的 DeployableObject。
uri | 描述要获取模块的位置。
return | 描述位于此 URI 的 J2EE 模块的 DeployableObject；如果无匹配值，则返回 'null'。
英文文档：

getDeployableObject

DeployableObject getDeployableObject(String uri)
Return the DeployableObject of the specified URI designator.

Parameters:
uri - Describes where to get the module from.
Returns:
the DeployableObject describing the j2ee module at this uri or 'null' if there is not match.

public DeployableObject[] getDeployableObjects(ModuleType type)
返回指定类型的所有 DeployableObject。
type | 要返回的模块的类型。
return | 描述位于此 URI 的 J2EE 模块的 DeployableObject；如果无匹配值，则返回 'null'。
英文文档：

getDeployableObjects

DeployableObject[] getDeployableObjects(ModuleType type)
Return the all DeployableObjects of the specified type.

Parameters:
type - The type of module to return.
Returns:
the list of DeployableObjects describing the j2ee module at this uri or 'null' if there are no matches.

public DeployableObject[] getDeployableObjects()
返回此应用程序中的所有 DeployableObject。
return 描述位于此 URI 的 J2EE 模块的 DeployableObject；如果无匹配值，则返回 'null'。
英文文档：

getDeployableObjects

DeployableObject[] getDeployableObjects()
Return the all DeployableObjects in this application.

Returns:
the DeployableObject describing the j2ee module at this uri or 'null' if there are no matches.

public String[] getModuleUris(ModuleType type)
返回指定模块类型的 URI 列表。
type | 要返回的模块的类型。
return | 所含模块的 URI；如果无匹配值，则返回 'null'。
英文文档：

getModuleUris

String[] getModuleUris(ModuleType type)
Return the list of URIs of the designated module type.

Parameters:
type - The type of module to return.
Returns:
the Uris of the contained modules or 'null' if there are no matches.

public String[] getModuleUris()
返回应用程序中所有模块的 URI 列表。
return 所含模块的 URI；如果无匹配值，则返回 'null'。
英文文档：

getModuleUris

String[] getModuleUris()
Return the list of URIs for all modules in the application.

Returns:
the Uris of the contained modules or 'null' if there are no matches.

public DDBean[] getChildBean(ModuleType type, String xpath)
返回基于某个 XPath 的 DDBean 列表；搜索指定类型的所有部署描述符。
type | 要查询的部署描述符的类型。
xpath | 引用部署描述符中某个位置的 XPath 字符串。
return | DDBeans 列表；如果无匹配值，则返回 'null'。
英文文档：

getChildBean

DDBean[] getChildBean(ModuleType type,
                      String xpath)
Return a list of DDBean based upon an XPath; all deployment descriptors of the specified type are searched.

Parameters:
type - The type of deployment descriptor to query.
xpath - An XPath string referring to a location in the deployment descriptor
Returns:
The list of DDBeans or 'null' of there are no matches.

public String[] getText(ModuleType type, String xpath)
返回 XPath 中的文本值；仅搜索指定类型的部署描述符。
type | 要查询的部署描述符的类型。
xpath | 引用部署描述符中某个位置的 XPath 字符串。
return | 此 XPath 的文本值；如果无匹配值，则返回 'null'。
英文文档：

getText

String[] getText(ModuleType type,
                 String xpath)
Return the text value from the XPath; search only the deployment descriptors of the specified type.

Parameters:
type - The type of deployment descriptor to query.
xpath - An xpath string referring to a location in the deployment descriptor
Returns:
The text values of this xpath or 'null' if there are no matches.

public void addXpathListener(ModuleType type, String xpath, XpathListener xpl)
注册一个侦听器，以侦听与此 deployableObject 相关的 XPath 中的更改。
type | 要查询的部署描述符的类型。
xpath | 要侦听的 XPath。
xpl | 侦听器。
英文文档：

addXpathListener

void addXpathListener(ModuleType type,
                      String xpath,
                      XpathListener xpl)
Register a listener for changes in XPath that are related to this deployableObject.

Parameters:
type - The type of deployment descriptor to query.
xpath - The xpath to listen for.
xpl - The listener.

public void removeXpathListener(ModuleType type, String xpath, XpathListener xpl)
取消为某个 XPath 注册的侦听器。
type | 要查询的部署描述符的类型。
xpath | 要侦听的 XPath。
xpl | 侦听器。
英文文档：

removeXpathListener

void removeXpathListener(ModuleType type,
                         String xpath,
                         XpathListener xpl)
Unregister the listener for an XPath.

Parameters:
type - The type of deployment descriptor to query.
xpath - he XPath to listen for
xpl - The listener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XpathListener (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.model
Interface XpathListener

public interface XpathListener

用于接收 XpathEvent 的侦听器接口。
英文文档：

The listener interface for receiving XpathEvents

Author:
gfink

Method Summary
 void fireXpathEvent(XpathEvent xpe)

Method Detail

public void fireXpathEvent(XpathEvent xpe)
英文文档：

fireXpathEvent

void fireXpathEvent(XpathEvent xpe)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


XpathEvent (Java EE 5)

javax.enterprise.deploy.model
Class XpathEvent

java.lang.Object
    extended by  javax.enterprise.deploy.model.XpathEvent

public final class XpathEvent
extends Object

描述从服务器配置中添加/减去的 ConfigBean 的事件类。
英文文档：

An Event class describing ConfigBeans being added/subtracted from a server configuration.

Field Summary
static Object | BEAN_ADDED Adding a DDBean
static Object | BEAN_CHANGED Changing a DDBean
static Object | BEAN_REMOVED Removing a DDBean
Constructor Summary
XpathEvent(DDBean bean, Object typ)
A description of a change in the ConfigBean tree.
Method Summary
DDBean | getBean() The bean being added/removed/changed.
PropertyChangeEvent | getChangeEvent()
boolean | isAddEvent() Is this an add event?
boolean | isChangeEvent() Is this a change event?
boolean | isRemoveEvent() Is this a remove event?
void | setChangeEvent(PropertyChangeEvent pce)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

BEAN_ADDED

public static final Object BEAN_ADDED
Adding a DDBean

英文文档：

BEAN_REMOVED

public static final Object BEAN_REMOVED
Removing a DDBean

英文文档：

BEAN_CHANGED

public static final Object BEAN_CHANGED
Changing a DDBean

Constructor Detail

public XpathEvent(DDBean bean, Object typ)
对 ConfigBean 树中更改的描述。
bean | 被添加或移除的 ConfigBean。
typ | 指示一个添加/移除事件。
英文文档：

XpathEvent

public XpathEvent(DDBean bean,
                  Object typ)
A description of a change in the ConfigBean tree.

Parameters:
bean - The ConfigBean being added/removed.
typ - Indicates an add/remove event.
Method Detail

public java.beans.PropertyChangeEvent getChangeEvent()
英文文档：

getChangeEvent

public PropertyChangeEvent getChangeEvent()

public void setChangeEvent(java.beans.PropertyChangeEvent pce)
英文文档：

setChangeEvent

public void setChangeEvent(PropertyChangeEvent pce)

public DDBean getBean()
被添加/移除/更改的 Bean。
return 被添加/移除/更改的 Bean。
英文文档：

getBean

public DDBean getBean()
The bean being added/removed/changed.

Returns:
The bean being added/removed/changed.

public boolean isAddEvent()
这是否为一个添加事件？
return 如果这是一个添加事件，则返回 true。
英文文档：

isAddEvent

public boolean isAddEvent()
Is this an add event?

Returns:
true if this is an add event.

public boolean isRemoveEvent()
这是否为一个移除事件？
return 如果这是一个移除事件，则返回 true。
英文文档：

isRemoveEvent

public boolean isRemoveEvent()
Is this a remove event?

Returns:
true if this is a remove event.

public boolean isChangeEvent()
这是否为一个更改事件？
return 如果这是一个更改事件，则返回 true。
英文文档：

isChangeEvent

public boolean isChangeEvent()
Is this a change event?

Returns:
true if this is a change event.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.enterprise.deploy.model.exceptions (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.model.exceptions

Provides Tool Vendor exception implementation classes.

See:
Description

Exception Summary
DDBeanCreateException This exception reports errors in generating a DDBean.

Package javax.enterprise.deploy.model.exceptions Description

Provides Tool Vendor exception implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.model.exceptions Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.model.exceptions

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.enterprise.deploy.model.exceptions.DDBeanCreateException
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DDBeanCreateException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.model.exceptions
Class DDBeanCreateException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.model.exceptions.DDBeanCreateException
All Implemented Interfaces:
Serializable
public class DDBeanCreateException
extends Exception

Extends: Throwable > Exception

此异常报告生成 DDBean 时的错误。
英文文档：

This exception reports errors in generating a DDBean.

Author:
gfink
See Also:
Serialized Form

Constructor Summary
DDBeanCreateException()
Creates new DDBeanCreateException without detail message.
DDBeanCreateException(String msg)
Constructs an DDBeanCreateException with the specified detail message.
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

public DDBeanCreateException()
创建不带详细消息的新 DDBeanCreateException。
英文文档：

DDBeanCreateException

public DDBeanCreateException()
Creates new DDBeanCreateException without detail message.

public DDBeanCreateException(String msg)
构造带指定详细消息的 DDBeanCreateException。
msg 详细消息。
英文文档：

DDBeanCreateException

public DDBeanCreateException(String msg)
Constructs an DDBeanCreateException with the specified detail message.

Parameters:
msg - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.enterprise.deploy.shared (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.shared

Provides shared objects for Tool Vendor and Product Vendor implementation classes.

See:
Description

Class Summary
ActionType | Class ActionTypes defines enumeration values for the J2EE DeploymentStatus actions.
CommandType | Class CommandTypes defines enumeration values for the DeploymentStatus object.
DConfigBeanVersionType | Class DConfigBeanVersionTypes defines enumeration values for the J2EE Platform verion number.
ModuleType | Class ModuleTypes defines enumeration values for the J2EE module types.
StateType | Class StateTypes defines enumeration values for the DeploymentStatus object.

Package javax.enterprise.deploy.shared Description

Provides shared objects for Tool Vendor and Product Vendor implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.shared Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.shared

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.enterprise.deploy.shared.ActionType
    • javax.enterprise.deploy.shared.CommandType
    • javax.enterprise.deploy.shared.DConfigBeanVersionType
    • javax.enterprise.deploy.shared.ModuleType
    • javax.enterprise.deploy.shared.StateType
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ActionType (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.shared
Class ActionType

java.lang.Object
    extended by  javax.enterprise.deploy.shared.ActionType

public class ActionType
extends Object

类 ActionType 定义 J2EE DeploymentStatus 操作的枚举值。
英文文档：

Class ActionTypes defines enumeration values for the J2EE DeploymentStatus actions.

Author:
rsearls

Field Summary
static ActionType | CANCEL A cancel operation is being preformed on the DeploymentManager action command.
static ActionType | EXECUTE The DeploymentManager action command is executing.
static ActionType | STOP A stop operation is being preformed on the DeploymentManager action command.
Constructor Summary
protected ActionType(int value)
Construct a new enumeration value with the given integer value.
Method Summary
static ActionType | getActionType(int value) Return an object of the specified value.
protected ActionType[] | getEnumValueTable() Returns the enumeration value table for class ActionType
protected int | getOffset() Returns the lowest integer value used by this enumeration value's enumeration class.
protected String[] | getStringTable() Returns the string table for class ActionType
int | getValue() Returns this enumeration value's integer value.
String | toString() Return the string name of this ActionType or the integer value if outside the bounds of the table
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

EXECUTE

public static final ActionType EXECUTE
The DeploymentManager action command is executing.

英文文档：

CANCEL

public static final ActionType CANCEL
A cancel operation is being preformed on the DeploymentManager action command.

英文文档：

STOP

public static final ActionType STOP
A stop operation is being preformed on the DeploymentManager action command.

Constructor Detail

protected ActionType(int value)
使用给定的整数值构造一个新枚举值。
value 整数值。
英文文档：

ActionType

protected ActionType(int value)
Construct a new enumeration value with the given integer value.

Parameters:
value - Integer value.
Method Detail

public int getValue()
返回此枚举值的整数值。
return 值
英文文档：

getValue

public int getValue()
Returns this enumeration value's integer value.

Returns:
the value

protected String[] getStringTable()
返回类 ActionType 的字符串表格。
英文文档：

getStringTable

protected String[] getStringTable()
Returns the string table for class ActionType

protected ActionType[] getEnumValueTable()
返回类 ActionType 的枚举值表格。
英文文档：

getEnumValueTable

protected ActionType[] getEnumValueTable()
Returns the enumeration value table for class ActionType

public static ActionType getActionType(int value)
返回指定值的对象。
value 对象的标志符。
英文文档：

getActionType

public static ActionType getActionType(int value)
Return an object of the specified value.

Parameters:
value - a designator for the object.

public String toString()
返回此 ActionType 的字符串名称；如果超出字符串表格的范围，则返回整数值。
英文文档：

toString

public String toString()
Return the string name of this ActionType or the integer value if outside the bounds of the table

Overrides:
toString in class Object

protected int getOffset()
返回此枚举值的枚举类所使用的最小整数值。

默认实现返回 0

return 最小枚举值的偏移量。
英文文档：

getOffset

protected int getOffset()
Returns the lowest integer value used by this enumeration value's enumeration class.

The default implementation returns 0.

Returns:
the offset of the lowest enumeration value.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


CommandType (Java EE 5)

javax.enterprise.deploy.shared
Class CommandType

java.lang.Object
    extended by  javax.enterprise.deploy.shared.CommandType

public class CommandType
extends Object

类 CommandType 定义 DeploymentStatus 对象的枚举值。
英文文档：

Class CommandTypes defines enumeration values for the DeploymentStatus object.

Author:
rsearls

Field Summary
static CommandType | DISTRIBUTE The DeploymentManger action operation being processed is distribute.
static CommandType | REDEPLOY The DeploymentManger action operation being processed is redeploy.
static CommandType | START The DeploymentManger action operation being processed is start.
static CommandType | STOP The DeploymentManger action operation being processed is stop.
static CommandType | UNDEPLOY The DeploymentManger action operation being processed is undeploy.
Constructor Summary
protected CommandType(int value)
Construct a new enumeration value with the given integer value.
Method Summary
static CommandType | getCommandType(int value) Return an object of the specified value.
protected CommandType[] | getEnumValueTable() Returns the enumeration value table for class CommandType
protected int | getOffset() Returns the lowest integer value used by this enumeration value's enumeration class.
protected String[] | getStringTable() Returns the string table for class CommandType
int | getValue() Returns this enumeration value's integer value.
String | toString() Return the string name of this CommandType or the integer value if outside the bounds of the table
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

DISTRIBUTE

public static final CommandType DISTRIBUTE
The DeploymentManger action operation being processed is distribute.

英文文档：

START

public static final CommandType START
The DeploymentManger action operation being processed is start.

英文文档：

STOP

public static final CommandType STOP
The DeploymentManger action operation being processed is stop.

英文文档：

UNDEPLOY

public static final CommandType UNDEPLOY
The DeploymentManger action operation being processed is undeploy.

英文文档：

REDEPLOY

public static final CommandType REDEPLOY
The DeploymentManger action operation being processed is redeploy.

Constructor Detail

protected CommandType(int value)
使用给定的整数值构造一个新枚举值。
value 整数值。
英文文档：

CommandType

protected CommandType(int value)
Construct a new enumeration value with the given integer value.

Parameters:
value - Integer value.
Method Detail

public int getValue()
返回此枚举值的整数值。
return 值
英文文档：

getValue

public int getValue()
Returns this enumeration value's integer value.

Returns:
the value

protected String[] getStringTable()
返回类 CommandType 的字符串表格。
英文文档：

getStringTable

protected String[] getStringTable()
Returns the string table for class CommandType

protected CommandType[] getEnumValueTable()
返回类 CommandType 的枚举值表格。
英文文档：

getEnumValueTable

protected CommandType[] getEnumValueTable()
Returns the enumeration value table for class CommandType

public static CommandType getCommandType(int value)
返回指定值的对象。
value 对象的标志符。
英文文档：

getCommandType

public static CommandType getCommandType(int value)
Return an object of the specified value.

Parameters:
value - a designator for the object.

public String toString()
返回此 CommandType 的字符串名称；如果超出字符串表格的范围，则返回整数值。
英文文档：

toString

public String toString()
Return the string name of this CommandType or the integer value if outside the bounds of the table

Overrides:
toString in class Object

protected int getOffset()
返回此枚举值的枚举类所使用的最小整数值。

默认实现返回 0

return 最小枚举值的偏移量。
英文文档：

getOffset

protected int getOffset()
Returns the lowest integer value used by this enumeration value's enumeration class.

The default implementation returns 0.

Returns:
the offset of the lowest enumeration value.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DConfigBeanVersionType (Java EE 5)

javax.enterprise.deploy.shared
Class DConfigBeanVersionType

java.lang.Object
    extended by  javax.enterprise.deploy.shared.DConfigBeanVersionType

public class DConfigBeanVersionType
extends Object

类 DConfigBeanVersionTypes 定义 J2EE 平台版本号的枚举值。
英文文档：

Class DConfigBeanVersionTypes defines enumeration values for the J2EE Platform verion number.

Author:
rsearls

Field Summary
static DConfigBeanVersionType | V1_3 J2EE Platform version 1.3
static DConfigBeanVersionType | V1_3_1 J2EE Platform version 1.3.1 THIS CONSTANT SHOULD NEVER BE USED.
static DConfigBeanVersionType | V1_4 J2EE Platform version 1.4
static DConfigBeanVersionType | V5 Java EE Platform version 5
Constructor Summary
protected DConfigBeanVersionType(int value)
Construct a new enumeration value with the given integer value.
Method Summary
static DConfigBeanVersionType | getDConfigBeanVersionType(int value) Return an object of the specified value.
protected DConfigBeanVersionType[] | getEnumValueTable() Returns the enumeration value table for class DConfigBeanVersionType
protected int | getOffset() Returns the lowest integer value used by this enumeration value's enumeration class.
protected String[] | getStringTable() Returns the string table for class DConfigBeanVersionType
int | getValue() Returns this enumeration value's integer value.
String | toString() Return the string name of this DConfigBeanVersionType or the integer value if outside the bounds of the table
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

V1_3

public static final DConfigBeanVersionType V1_3
J2EE Platform version 1.3

英文文档：

V1_3_1

public static final DConfigBeanVersionType V1_3_1
J2EE Platform version 1.3.1 THIS CONSTANT SHOULD NEVER BE USED. Use V1_3 instead.

英文文档：

V1_4

public static final DConfigBeanVersionType V1_4
J2EE Platform version 1.4

英文文档：

V5

public static final DConfigBeanVersionType V5
Java EE Platform version 5

Constructor Detail

protected DConfigBeanVersionType(int value)
使用给定的整数值构造一个新枚举值。
value 整数值。
英文文档：

DConfigBeanVersionType

protected DConfigBeanVersionType(int value)
Construct a new enumeration value with the given integer value.

Parameters:
value - Integer value.
Method Detail

public int getValue()
返回此枚举值的整数值。
return 值
英文文档：

getValue

public int getValue()
Returns this enumeration value's integer value.

Returns:
the value

protected String[] getStringTable()
返回类 DConfigBeanVersionType 的字符串表格。
英文文档：

getStringTable

protected String[] getStringTable()
Returns the string table for class DConfigBeanVersionType

protected DConfigBeanVersionType[] getEnumValueTable()
返回类 DConfigBeanVersionType 的枚举值表格。
英文文档：

getEnumValueTable

protected DConfigBeanVersionType[] getEnumValueTable()
Returns the enumeration value table for class DConfigBeanVersionType

public static DConfigBeanVersionType getDConfigBeanVersionType(int value)
返回指定值的对象。
value 对象的标志符。
英文文档：

getDConfigBeanVersionType

public static DConfigBeanVersionType getDConfigBeanVersionType(int value)
Return an object of the specified value.

Parameters:
value - a designator for the object.

public String toString()
返回此 DConfigBeanVersionType 的字符串名称；如果超出字符串表格的范围，则返回整数值。
英文文档：

toString

public String toString()
Return the string name of this DConfigBeanVersionType or the integer value if outside the bounds of the table

Overrides:
toString in class Object

protected int getOffset()
返回此枚举值的枚举类所使用的最小整数值。

默认实现返回 0

return 最小枚举值的偏移量。
英文文档：

getOffset

protected int getOffset()
Returns the lowest integer value used by this enumeration value's enumeration class.

The default implementation returns 0.

Returns:
the offset of the lowest enumeration value.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ModuleType (Java EE 5)

javax.enterprise.deploy.shared
Class ModuleType

java.lang.Object
    extended by  javax.enterprise.deploy.shared.ModuleType

public class ModuleType
extends Object

类 ModuleTypes 定义 J2EE 模块类型的枚举值。
英文文档：

Class ModuleTypes defines enumeration values for the J2EE module types.

Author:
Rebecca Searls

Field Summary
static ModuleType | CAR The module is an Client Application archive.
static ModuleType | EAR The module is an EAR archive.
static ModuleType | EJB The module is an Enterprise Java Bean archive.
static ModuleType | RAR The module is an Connector archive.
static ModuleType | WAR The module is an Web Application archive.
Constructor Summary
protected ModuleType(int value)
Construct a new enumeration value with the given integer value.
Method Summary
protected ModuleType[] | getEnumValueTable() Returns the enumeration value table for class ModuleType
String | getModuleExtension() Return the file extension string for this enumeration.
static ModuleType | getModuleType(int value) Return an object of the specified value.
protected int | getOffset() Returns the lowest integer value used by this enumeration value's enumeration class.
protected String[] | getStringTable() Returns the string table for class ModuleType
int | getValue() Returns this enumeration value's integer value.
String | toString() Return the string name of this ModuleType or the integer value if outside the bounds of the table
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

EAR

public static final ModuleType EAR
The module is an EAR archive.

英文文档：

EJB

public static final ModuleType EJB
The module is an Enterprise Java Bean archive.

英文文档：

CAR

public static final ModuleType CAR
The module is an Client Application archive.

英文文档：

RAR

public static final ModuleType RAR
The module is an Connector archive.

英文文档：

WAR

public static final ModuleType WAR
The module is an Web Application archive.

Constructor Detail

protected ModuleType(int value)
使用给定的整数值构造一个新枚举值。
value 整数值。
英文文档：

ModuleType

protected ModuleType(int value)
Construct a new enumeration value with the given integer value.

Parameters:
value - Integer value.
Method Detail

public int getValue()
返回此枚举值的整数值。
return 值
英文文档：

getValue

public int getValue()
Returns this enumeration value's integer value.

Returns:
the value

protected String[] getStringTable()
返回类 ModuleType 的字符串表格。
英文文档：

getStringTable

protected String[] getStringTable()
Returns the string table for class ModuleType

protected ModuleType[] getEnumValueTable()
返回类 ModuleType 的枚举值表格。
英文文档：

getEnumValueTable

protected ModuleType[] getEnumValueTable()
Returns the enumeration value table for class ModuleType

public String getModuleExtension()
返回此枚举的文件扩展名字符串。
英文文档：

getModuleExtension

public String getModuleExtension()
Return the file extension string for this enumeration.

public static ModuleType getModuleType(int value)
返回指定值的对象。
value 对象的标志符。
英文文档：

getModuleType

public static ModuleType getModuleType(int value)
Return an object of the specified value.

Parameters:
value - a designator for the object.

public String toString()
返回此 ModuleType 的字符串名称；如果超出字符串表格的范围，则返回整数值。
英文文档：

toString

public String toString()
Return the string name of this ModuleType or the integer value if outside the bounds of the table

Overrides:
toString in class Object

protected int getOffset()
返回此枚举值的枚举类使用的最小整数值。

默认实现返回 0。如果枚举类（类 EnumSyntax 的子类）以非 0 的整数值开始， 则重写子类中的此方法。

return 最小枚举值的偏移量。
英文文档：

getOffset

protected int getOffset()
Returns the lowest integer value used by this enumeration value's enumeration class.

The default implementation returns 0. If the enumeration class (a subclass of class EnumSyntax) uses integer values starting at other than 0, override this method in the subclass.

Returns:
the offset of the lowest enumeration value.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StateType (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.shared
Class StateType

java.lang.Object
    extended by  javax.enterprise.deploy.shared.StateType

public class StateType
extends Object

类 StateType 定义 DeploymentStatus 对象的枚举值。
英文文档：

Class StateTypes defines enumeration values for the DeploymentStatus object.

Author:
rsearls

Field Summary
static StateType | COMPLETED The action operation has completed normally.
static StateType | FAILED The action operation has failed.
static StateType | RELEASED The DeploymentManager is running in discommected mode.
static StateType | RUNNING The action operation is running normally.
Constructor Summary
protected StateType(int value)
Construct a new enumeration value with the given integer value.
Method Summary
protected StateType[] | getEnumValueTable() Returns the enumeration value table for class StateType
protected int | getOffset() Returns the lowest integer value used by this enumeration value's enumeration class.
static StateType | getStateType(int value) Return an object of the specified value.
protected String[] | getStringTable() Returns the string table for class StateType
int | getValue() Returns this enumeration value's integer value.
String | toString() Return the string name of this StateType or the integer value if outside the bounds of the table
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

RUNNING

public static final StateType RUNNING
The action operation is running normally.

英文文档：

COMPLETED

public static final StateType COMPLETED
The action operation has completed normally.

英文文档：

FAILED

public static final StateType FAILED
The action operation has failed.

英文文档：

RELEASED

public static final StateType RELEASED
The DeploymentManager is running in discommected mode.

Constructor Detail

protected StateType(int value)
使用给定的整数值构造一个新枚举值。
value 整数值。
英文文档：

StateType

protected StateType(int value)
Construct a new enumeration value with the given integer value.

Parameters:
value - Integer value.
Method Detail

public int getValue()
返回此枚举值的整数值。
return 值
英文文档：

getValue

public int getValue()
Returns this enumeration value's integer value.

Returns:
the value

protected String[] getStringTable()
返回类 StateType 的字符串表格。
英文文档：

getStringTable

protected String[] getStringTable()
Returns the string table for class StateType

protected StateType[] getEnumValueTable()
返回类 StateType 的枚举值表格。
英文文档：

getEnumValueTable

protected StateType[] getEnumValueTable()
Returns the enumeration value table for class StateType

public static StateType getStateType(int value)
返回指定值的对象。
value 对象的标志符。
英文文档：

getStateType

public static StateType getStateType(int value)
Return an object of the specified value.

Parameters:
value - a designator for the object.

public String toString()
返回此 StateType 的字符串名称；如果超出字符串表格的范围，则返回整数值。
英文文档：

toString

public String toString()
Return the string name of this StateType or the integer value if outside the bounds of the table

Overrides:
toString in class Object

protected int getOffset()
返回此枚举值的枚举类所使用的最小整数值。

默认实现返回 0

return 最小枚举值的偏移量。
英文文档：

getOffset

protected int getOffset()
Returns the lowest integer value used by this enumeration value's enumeration class.

The default implementation returns 0.

Returns:
the offset of the lowest enumeration value.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.enterprise.deploy.shared.factories (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.shared.factories

Provides shared factory manager object for Tool Vendor and Product Vendor implementation classes.

See:
Description

Class Summary
DeploymentFactoryManager The DeploymentFactoryManager class is a central registry for J2EE DeploymentFactory objects.

Package javax.enterprise.deploy.shared.factories Description

Provides shared factory manager object for Tool Vendor and Product Vendor implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.shared.factories Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.shared.factories

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DeploymentFactoryManager (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.shared.factories
Class DeploymentFactoryManager

java.lang.Object
    extended by  javax.enterprise.deploy.shared.factories.DeploymentFactoryManager

public final class DeploymentFactoryManager
extends Object

DeploymentFactoryManager 类是 J2EE DeploymentFactory 对象的集中注册表。DeploymentFactoryManager 保留对工具所加载的 DeploymentFactory 对象的引用。DeploymentFactory 对象提供一个对 DeploymentManager 的引用。 DeploymentFactoryManager 被作为单件实现。工具通过 getInstance 方法获取对 DeploymentFactoryManager 的引用。 DeploymentFactoryManager 可以返回两种类型的 DeploymentManager：连接的 DeploymentManager 与断开连接的 DeploymentManager。连接的 DeploymentManager 可以访问配置和部署时可能需要的任何产品资源。获取连接 DeploymentManager 的方法是 getDeploymentManager。此方法提供用户名和密码参数，产品进行用户验证时可能需要这些信息。断开连接的 DeploymentManager 不提供对运行 J2EE 产品的访问。获取断开连接 DeploymentManager 的方法是 getDisconnectedDeploymentManager。断开连接的 DeploymentManager 不需要用户验证信息。
英文文档：

The DeploymentFactoryManager class is a central registry for J2EE DeploymentFactory objects. The DeploymentFactoryManager retains references to DeploymentFactory objects loaded by a tool. A DeploymentFactory object provides a reference to a DeploymentManager. The DeploymentFactoryManager has been implemented as a singleton. A tool gets a reference to the DeploymentFactoryManager via the getInstance method. The DeploymentFactoryManager can return two types of DeploymentManagers, a connected DeploymentManager and a disconnected DeploymentManager. The connected DeploymentManager provides access to any product resources that may be required for configurations and deployment. The method to retrieve a connected DeploymentManager is getDeploymentManager. This method provides parameters for user name and password that the product may require for user authentication. A disconnected DeploymentManager does not provide access to a running J2EE product. The method to retrieve a disconnected DeploymentManager is getDisconnectedDeploymentManager. A disconnected DeploymentManager does not need user authentication information.

Method Summary
DeploymentFactory[] | getDeploymentFactories() Retrieve the lists of currently registered DeploymentFactories.
DeploymentManager | getDeploymentManager(String uri, String username, String password) Retrieves a DeploymentManager instance to use for deployment.
DeploymentManager | getDisconnectedDeploymentManager(String uri) Return a disconnected DeploymentManager instance.
static DeploymentFactoryManager | getInstance() Retrieve the Singleton DeploymentFactoryManager
void | registerDeploymentFactory(DeploymentFactory factory) Registers a DeploymentFactory so it will be able to handle requests.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

public static DeploymentFactoryManager getInstance()
获取单件 DeploymentFactoryManager。
return DeploymentFactoryManager 实例
英文文档：

getInstance

public static DeploymentFactoryManager getInstance()
Retrieve the Singleton DeploymentFactoryManager

Returns:
DeploymentFactoryManager instance

public DeploymentFactory[] getDeploymentFactories()
获取当前已注册的 DeploymentFactory 列表。
return DeploymentFactory 对象列表；如果没有，则返回一个空数组。
英文文档：

getDeploymentFactories

public DeploymentFactory[] getDeploymentFactories()
Retrieve the lists of currently registered DeploymentFactories.

Returns:
the list of DeploymentFactory objects or an empty array if there are none.

public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException
获取一个用于部署的 DeploymentManager 实例。调用者提供一个 URI 及可选的用户名和密码，所有已注册的 DeploymentFactory 都将被检查。第一个理解所给 URI 的 DeploymentFactory 将尝试启动一个服务器连接，并返回一个就绪的 DeploymentManager 实例。
uri | 要检查的 URI。
username | 可选用户名（如果此平台不需要验证，则为 null）。
password | 可选密码（如果此平台不需要验证，则为 null）。
return | 就绪的 DeploymentManager 实例。
Throws | DeploymentManagerCreationException: 当指定 URI 相应的工厂无法初始化 DeploymentManager 实例时（服务器出现故障、无法验证等等）。
英文文档：

getDeploymentManager

public DeploymentManager getDeploymentManager(String uri,
                                              String username,
                                              String password)
                                       throws DeploymentManagerCreationException
Retrieves a DeploymentManager instance to use for deployment. The caller provides a URI and optional username and password, and all registered DeploymentFactories will be checked. The first one to understand the URI provided will attempt to initiate a server connection and return a ready DeploymentManager instance.

Parameters:
uri - The uri to check
username - An optional username (may be null if no authentication is required for this platform).
password - An optional password (may be null if no authentication is required for this platform).
Returns:
A ready DeploymentManager instance.
Throws:
DeploymentManagerCreationException - Occurs when the factory appropriate to the specified URI was unable to initialize a DeploymentManager instance (server down, unable to authenticate, etc.).

public void registerDeploymentFactory(DeploymentFactory factory)
注册一个 DeploymentFactory，以便它能处理请求。
英文文档：

registerDeploymentFactory

public void registerDeploymentFactory(DeploymentFactory factory)
Registers a DeploymentFactory so it will be able to handle requests.

public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException
返回一个断开连接的 DeploymentManager 实例。
uri | 要返回的断开连接 DeploymentManager 的标识符。
return | DeploymentManager 实例。
Throws | DeploymentDriverException: 如果无法创建 DeploymentManager。
英文文档：

getDisconnectedDeploymentManager

public DeploymentManager getDisconnectedDeploymentManager(String uri)
                                                   throws DeploymentManagerCreationException
Return a disconnected DeploymentManager instance.

Parameters:
uri - identifier of the disconnected DeploymentManager to return.
Returns:
A DeploymentManager instance.
Throws:
DeploymentDriverException - occurs if the DeploymentManager could not be created.
DeploymentManagerCreationException
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.enterprise.deploy.spi (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.spi

Provides J2EE Product Vendor implementation classes.

See:
Description

Interface Summary
DConfigBean | The DConfigBean is a deployment configuration bean (DConfigBean) that is associated with one or more deployment descriptor beans, (DDBean).
DConfigBeanRoot | A J2EE component module consists of one or more deployment descriptor files and zero or more non-deployment descriptor XML instance documents.
DeploymentConfiguration | An interface that defines a container for all the server-specific configuration information for a single top-level J2EE module.
DeploymentManager | The DeploymentManager object provides the core set of functions a J2EE platform must provide for J2EE application deployment.
Target | A Target interface represents a single logical core server of one instance of a J2EE platform product.
TargetModuleID | A TargetModuleID interface represents a unique identifier for a deployed application module.

Package javax.enterprise.deploy.spi Description

Provides J2EE Product Vendor implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.spi Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.spi

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.enterprise.deploy.spi.DConfigBean
    • javax.enterprise.deploy.spi.DConfigBeanRoot
  • javax.enterprise.deploy.spi.DeploymentConfiguration
  • javax.enterprise.deploy.spi.DeploymentManager
  • javax.enterprise.deploy.spi.Target
  • javax.enterprise.deploy.spi.TargetModuleID
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DConfigBean (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.spi
Interface DConfigBean

All Known Subinterfaces:
DConfigBeanRoot
public interface DConfigBean

Implemented by: DConfigBeanRoot

DConfigBean 是一个部署配置 Bean (DConfigBean)，它与一个或多个部署描述符 Bean (DDBean) 关联。DConfigBean 表示要呈现给部署者的部署配置数据的逻辑分组。DConfigBean 提供 0 个或多个 XPath，用于标识它需要的 XML 信息。DConfigBean 可能包含其他 DConfigBean 和常规 JavaBean。最顶层的 DConfigBean 是一个 DConfigBeanRoot 对象，它表示一个 XML 实例文档。

通过调用 DConfigBean.getDConfigBean(DDBean) 方法创建 DConfigBean，其中 DConfigBean 是提供 DDBean 所表示的 XPath 的对象。

DConfigBean 是一个 JavaBean 组件，表示呈现给部署者的 J2EE 插件的动态部署配置信息。它是一个 JavaBean。选择 JavaBean 架构是因为它的多功能性，以及同时提供简单和复杂组件的能力。JavaBean 也可用于属性表和属性编辑器开发，以及复杂的自定义向导开发。

插件供应商应该提供一个可用于 DConfigBean 中任何复杂数据类型的属性编辑器，部署者需要通过属性表来编辑此 DConfigBean。根据 JavaBean API 规范 1.01 中定义的指南，该属性编辑器应该被实现并可用于工具。

英文文档：

The DConfigBean is a deployment configuration bean (DConfigBean) that is associated with one or more deployment descriptor beans, (DDBean). A DConfigBean represents a logical grouping of deployment configuration data to be presented to the Deployer. A DConfigBean provides zero or more XPaths that identifies the XML information it requires. A DConfigBean may contain other DConfigBeans and regular JavaBeans. The top most DConfigBean is a DConfigBeanRoot object which represents a single XML instance document.

A DConfigBean is created by calling DConfigBean.getDConfigBean(DDBean) method, where DConfigBean is the object that provided the XPath which the DDBean represents.

A DConfigBean is a JavaBean component that presents the dynamic deployment configuration information for a J2EE plugin to the deployer. It is a JavaBean. The JavaBean architecture was chosen because of its versatility in providing both simple and complex components. JavaBeans also enable the development of property sheets and property editors, as well as sophisticated customization wizards.

It is expected that a plugin vendor will provide a Property Editor for any complex datatype in a DConfigBean that a deployer needs to edit through a property sheet. The Property Editor should be implemented and made available to a tool according to the guidelines defined in the JavaBeans API Specification version 1.01.

Method Summary
void | addPropertyChangeListener(PropertyChangeListener pcl) Register a property listener for this bean.
DConfigBean | getDConfigBean(DDBean bean) Return the JavaBean containing the server-specific deployment configuration information based upon the XML data provided by the DDBean.
DDBean | getDDBean() Return the JavaBean containing the deployment descriptor XML text associated with this DConfigBean.
String[] | getXpaths() Return a list of XPaths designating the deployment descriptor information this DConfigBean requires.
void | notifyDDChange(XpathEvent event) A notification that the DDBean provided in the event has changed and this bean or its child beans need to reevaluate themselves.
void | removeDConfigBean(DConfigBean bean) Remove a child DConfigBean from this bean.
void | removePropertyChangeListener(PropertyChangeListener pcl) Unregister a property listener for this bean.

Method Detail

public DDBean getDDBean()
返回包含与此 DConfigBean 关联的部署描述符 XML 文本的 JavaBean。
return 包含此 DConfigBean 的 XML 文本的 Bean 类。
英文文档：

getDDBean

DDBean getDDBean()
Return the JavaBean containing the deployment descriptor XML text associated with this DConfigBean.

Returns:
The bean class containing the XML text for this DConfigBean.

public String[] getXpaths()
返回指定此 DConfigBean 所需的部署描述符信息的 XPath 列表。 给定的服务器供应商将需要指定一些特定于服务器的信息。此方法返回的每个 String 都是一个描述标准部署描述符某一部分的 XPath，标准部署描述符有相应的特定于服务器的配置。
return 表示要获取的 XML 数据的 XPath String 列表；如果没有，则返回 'null'。
英文文档：

getXpaths

String[] getXpaths()
Return a list of XPaths designating the deployment descriptor information this DConfigBean requires. A given server vendor will need to specify some server-specific information. Each String returned by this method is an XPath describing a certain portion of the standard deployment descriptor for which there is corresponding server-specific configuration.

Returns:
a list of XPath Strings representing XML data to be retrieved or 'null' if there are none.

public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException
返回包含特定于服务器的部署配置信息的 JavaBean，此信息基于 DDBean 提供的 XML 数据。
return | 显示标准 Bean 特定于服务器属性的 DConfigBean。
bean | 包含要求值的 XML 数据的 DDBean。
Throws | ConfigurationException: 报告生成配置 Bean 时的错误。解决此异常前，此 DDBean 被视为无法部署在此服务器上。用户需要合适的描述性信息才能诊断错误。
英文文档：

getDConfigBean

DConfigBean getDConfigBean(DDBean bean)
                           throws ConfigurationException
Return the JavaBean containing the server-specific deployment configuration information based upon the XML data provided by the DDBean.

Parameters:
bean - The DDBean containing the XML data to be evaluated.
Returns:
The DConfigBean to display the server-specific properties for the standard bean.
Throws:
ConfigurationException - reports errors in generating a configuration bean. This DDBean is considered undeployable to this server until this exception is resolved. A suitably descriptive message is required so the user can diagnose the error.

public void removeDConfigBean(DConfigBean bean) throws BeanNotFoundException
从此 Bean 移除一个子 DConfigBean。
bean | 要移除的子 DConfigBean。
Throws | BeanNotFoundException: 提供的 Bean 不在此 Bean 的子列表中。
英文文档：

removeDConfigBean

void removeDConfigBean(DConfigBean bean)
                       throws BeanNotFoundException
Remove a child DConfigBean from this bean.

Parameters:
bean - The child DConfigBean to be removed.
Throws:
BeanNotFoundException - the bean provided is not in the child list of this bean.

public void notifyDDChange(XpathEvent event)
DDBean 在事件中提供的通知已被更改，此 Bean 或其子 Bean 需要重新对自身求值。
event 包含对已更改 DDBean 的引用的事件。
英文文档：

notifyDDChange

void notifyDDChange(XpathEvent event)
A notification that the DDBean provided in the event has changed and this bean or its child beans need to reevaluate themselves.

Parameters:
event - an event containing a reference to the DDBean which has changed.

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
为此 Bean 注册一个属性侦听器。
pcl 要添加的 PropertyChangeListener。
英文文档：

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener pcl)
Register a property listener for this bean.

Parameters:
pcl - PropertyChangeListener to add

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
取消为此 Bean 注册的属性侦听器。
pcl 要移除的侦听器。
英文文档：

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener pcl)
Unregister a property listener for this bean.

Parameters:
pcl - Listener to remove.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DConfigBeanRoot (Java EE 5)

javax.enterprise.deploy.spi
Interface DConfigBeanRoot

All Superinterfaces:
DConfigBean
public interface DConfigBeanRoot
extends DConfigBean

Implements: DConfigBean

一个 J2EE 组件模块，由一个或多个部署描述符文件，以及 0 个或多个非部署描述符 XML 实例文档组成。模块必须包含一个特定于组件的部署描述符文件（有关详细信息，请参阅组件规范）。它可能包含一个或多个次要的部署描述符文件（用于定义组件的额外功能），以及 0 个或多个非部署描述符 XML 实例文档（请参阅 Web 服务规范）。

DConfigBeanRoot 对象是一个部署配置 Bean (DConfigBean)，与组件部署描述符的根关联。它必须通过调用 DeploymentConfiguration.getDConfigBean(DDBeanRoot) 方法创建，其中 DDBeanRoot 表示组件的部署描述符。

DConfigBean 对象与扩展组件功能的部署描述符关联。它必须通过调用 DConfigBeanRoot.getDConfigBean(DDBeanRoot) 方法创建。此 DConfigBean 对象是组件 DConfigBeanRoot 对象的子对象。DDBeanRoot 参数表示次级部署描述符。webservice.xml 和 webserviceclient.xml 之类的部署描述符文件是次级部署描述文件的示例。

服务器插件必须向 DDBeanRoot 对象请求它所需要的任何非部署描述符 XML 实例文档数据。插件必须调用 DeployableObject.getDDBeanRoot(String) 方法，其中 String 是从模块的根到所表示文件的完整路径名。WSDL 文件是非部署描述符 XML 实例文档的一个示例。

英文文档：

A J2EE component module consists of one or more deployment descriptor files and zero or more non-deployment descriptor XML instance documents. A module must contain a component-specific deployment descriptor file (see the component specification for details). It may contain one or more secondary deployment descriptor files that define extra functionality on the component and zero or more non-deployment descriptor XML instance documents (see the Web Services specification).

The DConfigBeanRoot object is a deployment configuration bean (DConfigBean) that is associated with the root of the component's deployment descriptor. It must be created by calling the DeploymentConfiguration.getDConfigBean(DDBeanRoot) method, where DDBeanRoot represents the component's deployment descriptor.

A DConfigBean object is associated with a deployment descriptor that extends a component's functionality. It must be created by calling the DConfigBeanRoot.getDConfigBean(DDBeanRoot) method. This DConfigBean object is a child of the compontent's DConfigBeanRoot object. The DDBeanRoot argument represents the secondary deployment descriptor. Deployment descriptor files such as webservice.xml and webserviceclient.xml are examples of secondary deployment descriptor files.

The server plugin must request a DDBeanRoot object for any non-deployment descriptor XML instance document data it requires. The plugin must call method DeployableObject.getDDBeanRoot(String) where String is the full path name from the root of the module to the file to be represented. A WSDL file is an example of a non-deployment descriptor XML instance document.

Author:
gfink

Method Summary
 DConfigBean getDConfigBean(DDBeanRoot ddBeanRoot)
Return a DConfigBean for a deployment descriptor that is not the module's primary deployment descriptor.
Methods inherited from interface javax.enterprise.deploy.spi.DConfigBean
addPropertyChangeListener, getDConfigBean, getDDBean, getXpaths, notifyDDChange, removeDConfigBean, removePropertyChangeListener

Method Detail

public DConfigBean getDConfigBean(DDBeanRoot ddBeanRoot)
返回部署描述符的 DConfigBean，此部署描述符不是模块的主部署描述符。除了模块的主部署描述符之外，Web 服务还提供其他部署描述符。只有这种次要部署描述符的 DDBeanRoot 才作为参数传递给此方法。 Web 服务有两个部署描述符文件：一个用于定义 Web 服务；另一个用于定义 Web 服务的客户端。有关详细信息，请参阅 Web 服务规范。
ddBeanRoot | 表示部署描述符文件的根元素。
return | 用于处理此部署描述符数据的 DConfigBean。如果此部署描述符不需要 DConfigBean，则返回 null。
英文文档：

getDConfigBean

DConfigBean getDConfigBean(DDBeanRoot ddBeanRoot)
Return a DConfigBean for a deployment descriptor that is not the module's primary deployment descriptor. Web services provides a deployment descriptor in addition to the module's primary deployment descriptor. Only the DDBeanRoot for this catagory of secondary deployment descriptors are to be passed as arguments through this method. Web service has two deployment descriptor files, one that defines the web service and one that defines a client of a web service. See the Web Service specificiation for the details.

Parameters:
ddBeanRoot - represents the root element of a deployment descriptor file.
Returns:
a DConfigBean to be used for processing this deployment descriptor data. Null may be returned if no DConfigBean is required for this deployment descriptor.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeploymentConfiguration (Java EE 5)

javax.enterprise.deploy.spi
Interface DeploymentConfiguration

public interface DeploymentConfiguration

该接口定义用于单个顶层 J2EE 模块所有特定于服务器的配置信息的容器。DeploymentConfiguration 对象可以表示一个独立的模块，也可以表示一个包含几个子模块的 EAR 文件。
version 0.1
英文文档：

An interface that defines a container for all the server-specific configuration information for a single top-level J2EE module. The DeploymentConfiguration object could represent a single stand alone module or an EAR file that contains several sub-modules.

Version:
0.1
Author:
gfink

Method Summary
DConfigBeanRoot | getDConfigBeanRoot(DDBeanRoot bean) Returns the top level configuration bean, DConfigBeanRoot, associated with the deployment descriptor represented by the designated DDBeanRoot bean.
DeployableObject | getDeployableObject() Returns an object that provides access to the deployment descriptor data and classes of a J2EE module.
void | removeDConfigBean(DConfigBeanRoot bean) Remove the root DConfigBean and all its children.
void | restore(InputStream inputArchive) Restore from disk to a full set of configuration beans previously stored.
DConfigBeanRoot | restoreDConfigBean(InputStream inputArchive, DDBeanRoot bean) Restore from disk to instantated objects all the DConfigBeans associated with a specific deployment descriptor.
void | save(OutputStream outputArchive) Save to disk the current set configuration beans created for this deployable module.
void | saveDConfigBean(OutputStream outputArchive, DConfigBeanRoot bean) Save to disk all the configuration beans associated with a particular deployment descriptor file.

Method Detail

public DeployableObject getDeployableObject()
返回可以访问部署描述符数据和 J2EE 模块类的对象。
return DeployableObject。
英文文档：

getDeployableObject

DeployableObject getDeployableObject()
Returns an object that provides access to the deployment descriptor data and classes of a J2EE module.

Returns:
DeployableObject

public DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot bean) throws ConfigurationException
返回顶层配置 Bean DConfigBeanRoot，它与指定 DDBeanRoot Bean 表示的部署描述符关联。
bean | 表示关联部署描述符的顶级 Bean。
return | 用于编辑模块所需的特定于服务器的属性的 DConfigBeanRoot。
Throws | ConfigurationException: 报告生成配置 Bean 时的错误
英文文档：

getDConfigBeanRoot

DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot bean)
                                   throws ConfigurationException
Returns the top level configuration bean, DConfigBeanRoot, associated with the deployment descriptor represented by the designated DDBeanRoot bean.

Parameters:
bean - The top level bean that represents the associated deployment descriptor.
Returns:
the DConfigBeanRoot for editing the server-specific properties required by the module.
Throws:
ConfigurationException - reports errors in generating a configuration bean

public void removeDConfigBean(DConfigBeanRoot bean) throws BeanNotFoundException
移除根 DConfigBean 及其所有子 Bean。
bean | 要移除的顶级 DConfigBean。
Throws | BeanNotFoundException: 提供的 Bean 不在此 Bean 子列表中。
英文文档：

removeDConfigBean

void removeDConfigBean(DConfigBeanRoot bean)
                       throws BeanNotFoundException
Remove the root DConfigBean and all its children.

Parameters:
bean - the top leve DConfigBean to remove.
Throws:
BeanNotFoundException - the bean provides is not in this beans child list.

public DConfigBeanRoot restoreDConfigBean(java.io.InputStream inputArchive, DDBeanRoot bean) throws ConfigurationException
从磁盘恢复初始化对象，即所有与特定部署描述符关联的 DConfigBean。这些 Bean 可能是完全或部分配置的。
inputArchive | 应该从中恢复 DConfigBean 的文件的输入流。
bean | 与部署描述符文件关联的 DDBeanRoot Bean。
return | 最顶层的父配置 Bean DConfigBeanRoot。
Throws | ConfigurationException: 报告生成配置 Bean 时的错误
英文文档：

restoreDConfigBean

DConfigBeanRoot restoreDConfigBean(InputStream inputArchive,
                                   DDBeanRoot bean)
                                   throws ConfigurationException
Restore from disk to instantated objects all the DConfigBeans associated with a specific deployment descriptor. The beans may be fully or partially configured.

Parameters:
inputArchive - The input stream for the file from which the DConfigBeans should be restored.
bean - The DDBeanRoot bean associated with the deployment descriptor file.
Returns:
The top most parent configuration bean, DConfigBeanRoot
Throws:
ConfigurationException - reports errors in generating a configuration bean

public void saveDConfigBean(java.io.OutputStream outputArchive, DConfigBeanRoot bean) throws ConfigurationException
将所有与特定部署描述符文件关联的配置 Bean 保存到磁盘。保存的数据可能是完全或部分配置的 DConfigBean。建议输出文件的格式为 XML。
outputArchive | 要向其中保存 DConfigBean 的输出流。
bean | 顶级 Bean DConfigBeanRoot，保存其中的 Bean。
Throws | ConfigurationException: 报告生成配置 Bean 时的错误
英文文档：

saveDConfigBean

void saveDConfigBean(OutputStream outputArchive,
                     DConfigBeanRoot bean)
                     throws ConfigurationException
Save to disk all the configuration beans associated with a particular deployment descriptor file. The saved data may be fully or partially configured DConfigBeans. The output file format is recommended to be XML.

Parameters:
outputArchive - The output stream to which the DConfigBeans should be saved.
bean - The top level bean, DConfigBeanRoot, from which to be save.
Throws:
ConfigurationException - reports errors in generating a configuration bean

public void restore(java.io.InputStream inputArchive) throws ConfigurationException
从磁盘恢复一个以前存储的完整配置 Bean 集合。
inputArchive | 从中恢复配置的输入流。
Throws | ConfigurationException: 报告生成配置 Bean 时的错误
英文文档：

restore

void restore(InputStream inputArchive)
             throws ConfigurationException
Restore from disk to a full set of configuration beans previously stored.

Parameters:
inputArchive - The input stream from which to restore the Configuration.
Throws:
ConfigurationException - reports errors in generating a configuration bean

public void save(java.io.OutputStream outputArchive) throws ConfigurationException
将为此可部署模块创建的当前配置 Bean 集合保存到磁盘。建议使用 XML 文件格式。
outputArchive | 要向其中保存配置的输出流。
Throws | ConfigurationException:
英文文档：

save

void save(OutputStream outputArchive)
          throws ConfigurationException
Save to disk the current set configuration beans created for this deployable module. It is recommended the file format be XML.

Parameters:
outputArchive - The output stream to which to save the Configuration.
Throws:
ConfigurationException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeploymentManager (Java EE 5)

javax.enterprise.deploy.spi
Interface DeploymentManager

public interface DeploymentManager

DeploymentManager 对象为 J2EE 应用程序部署提供 J2EE 平台所必须提供的一组核心功能。它提供与服务器相关的信息，如部署目标列表和供应商特有的运行时配置信息。
英文文档：

The DeploymentManager object provides the core set of functions a J2EE platform must provide for J2EE application deployment. It provides server related information, such as, a list of deployment targets, and vendor unique runtime configuration information.

Method Summary
 DeploymentConfiguration createConfiguration(DeployableObject dObj)
Retrieve the object that provides server-specific deployment configuration information for the J2EE deployable component.
 ProgressObject distribute(Target[] targetList, File moduleArchive, File deploymentPlan)
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.
 ProgressObject distribute(Target[] targetList, InputStream moduleArchive, InputStream deploymentPlan)
Deprecated. as of Java EE 5, replaced with distribute(Target[], ModuleType, InputStream, InputStream)
 ProgressObject distribute(Target[] targetList, ModuleType type, InputStream moduleArchive, InputStream deploymentPlan)
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.
 TargetModuleID[] getAvailableModules(ModuleType moduleType, Target[] targetList)
Retrieve the list of all J2EE application modules running or not running on the identified targets.
 Locale getCurrentLocale()
Returns the active locale this implementation of javax.enterprise.deploy.spi subpackages is running.
 DConfigBeanVersionType getDConfigBeanVersion()
Returns the J2EE platform version number for which the configuration beans are provided.
 Locale getDefaultLocale()
Returns the default locale supported by this implementation of javax.enterprise.deploy.spi subpackages.
 TargetModuleID[] getNonRunningModules(ModuleType moduleType, Target[] targetList)
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently not running on the associated server or servers.
 TargetModuleID[] getRunningModules(ModuleType moduleType, Target[] targetList)
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently running on the associated server or servers.
 Locale[] getSupportedLocales()
Returns an array of supported locales for this implementation.
 Target[] getTargets()
Retrieve the list of deployment targets supported by this DeploymentManager.
 boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version)
Returns 'true' if the configuration beans support the J2EE platform version specified.
 boolean isLocaleSupported(Locale locale)
Reports if this implementation supports the designated locale.
 boolean isRedeploySupported()
This method designates whether this platform vendor provides application redeployment functionality.
 ProgressObject redeploy(TargetModuleID[] moduleIDList, File moduleArchive, File deploymentPlan)
(optional) The redeploy method provides a means for updating currently deployed J2EE applications.
 ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan)
(optional) The redeploy method provides a means for updating currently deployed J2EE applications.
 void release()
The release method is the mechanism by which the tool signals to the DeploymentManager that the tool does not need it to continue running connected to the platform.
 void setDConfigBeanVersion(DConfigBeanVersionType version)
Set the configuration beans to be used to the J2EE platform version specificed.
 void setLocale(Locale locale)
Set the active locale for this implementation of javax.enterprise.deploy.spi subpackages to run.
 ProgressObject start(TargetModuleID[] moduleIDList)
Start the application running.
 ProgressObject stop(TargetModuleID[] moduleIDList)
Stop the application running.
 ProgressObject undeploy(TargetModuleID[] moduleIDList)
Remove the application from the target server.

Method Detail

public Target[] getTargets() throws IllegalStateException
获取此 DeploymentManager 支持的部署目标列表。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
return | 用户可以为应用程序部署选择的部署 Target 标志符列表；如果没有，则返回 'null'。
英文文档：

getTargets

Target[] getTargets()
                    throws IllegalStateException
Retrieve the list of deployment targets supported by this DeploymentManager.

Returns:
A list of deployment Target designators the user may select for application deployment or 'null' if there are none.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public TargetModuleID[] getRunningModules(ModuleType moduleType, Target[] targetList) throws TargetException, IllegalStateException
获取分发给标识目标的 J2EE 应用程序模块列表，它们当前运行在关联的服务器上。
moduleType | J2EE 模块类型的预定义标志符。
targetList | 用户想要了解模块运行状态时查看的部署 Target 标志符列表。
return | 表示运行模块的 TargetModuleID 对象数组；如果没有，则返回 'null'。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
Throws | TargetException: 遇到无效的 Target 标志符。
英文文档：

getRunningModules

TargetModuleID[] getRunningModules(ModuleType moduleType,
                                   Target[] targetList)
                                   throws TargetException,
                                          IllegalStateException
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently running on the associated server or servers.

Parameters:
moduleType - A predefined designator for a J2EE module type.
targetList - A list of deployment Target designators the user wants checked for module run status.
Returns:
An array of TargetModuleID objects representing the running modules or 'null' if there are none.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
TargetException - An invalid Target designator encountered.

public TargetModuleID[] getNonRunningModules(ModuleType moduleType, Target[] targetList) throws TargetException, IllegalStateException
获取分发给标识目标的 J2EE 应用程序模块列表，它们当前运行在关联的服务器上。
moduleType | J2EE 模块类型的预定义标志符。
targetList | 用户想要了解模块非运行状态时查看的部署 Target 标志符列表。
return | 表示非运行模块的 TargetModuleID 对象数组；如果没有，则返回 'null'。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
Throws | TargetException: 遇到无效的 Target 标志符。
英文文档：

getNonRunningModules

TargetModuleID[] getNonRunningModules(ModuleType moduleType,
                                      Target[] targetList)
                                      throws TargetException,
                                             IllegalStateException
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently not running on the associated server or servers.

Parameters:
moduleType - A predefined designator for a J2EE module type.
targetList - A list of deployment Target designators the user wants checked for module not running status.
Returns:
An array of TargetModuleID objects representing the non-running modules or 'null' if there are none.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
TargetException - An invalid Target designator encountered.

public TargetModuleID[] getAvailableModules(ModuleType moduleType, Target[] targetList) throws TargetException, IllegalStateException
获取运行或没有运行在标识目标上的所有 J2EE 应用程序模块列表。
moduleType | J2EE 模块类型的预定义标志符。
targetList | 用户想要了解模块非运行状态时查看的部署 Target 标志符列表。
return | 表示所有运行或未运行部署模块的 TargetModuleID 对象数组；如果没有部署模块，则返回 'null'。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
Throws | TargetException: 遇到无效的 Target 标志符。
英文文档：

getAvailableModules

TargetModuleID[] getAvailableModules(ModuleType moduleType,
                                     Target[] targetList)
                                     throws TargetException,
                                            IllegalStateException
Retrieve the list of all J2EE application modules running or not running on the identified targets.

Parameters:
moduleType - A predefined designator for a J2EE module type.
targetList - A list of deployment Target designators the user wants checked for module not running status.
Returns:
An array of TargetModuleID objects representing all deployed modules running or not or 'null' if there are no deployed modules.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
TargetException - An invalid Target designator encountered.

public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException
获取为 J2EE 可部署组件提供特定于服务器的部署配置信息的对象。
dObj | 表示 J2EE 可部署组件的对象。
Throws | InvalidModuleException: DeployableObject 未知或不是此配置工具支持的组件。
英文文档：

createConfiguration

DeploymentConfiguration createConfiguration(DeployableObject dObj)
                                            throws InvalidModuleException
Retrieve the object that provides server-specific deployment configuration information for the J2EE deployable component.

Parameters:
dObj - An object representing a J2EE deployable component.
Throws:
InvalidModuleException - The DeployableObject is an unknown or unsupport component for this configuration tool.

public ProgressObject distribute(Target[] targetList, java.io.File moduleArchive, java.io.File deploymentPlan) throws IllegalStateException
此分发方法执行三个任务：验证部署配置数据；生成所有特定于容器的类和接口；将完整备份的归档移动到指定的部署目标。
targetList | 用户指定将部署此应用程序的服务器目标列表。
moduleArchive | 要分发的应用程序归档文件的文件名称。
deploymentPlan | 包含与此应用程序归档文件关联的运行时配置信息的 XML 文件。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
return | ProgressObject 追踪和报告分发过程状态的对象。
英文文档：

distribute

ProgressObject distribute(Target[] targetList,
                          File moduleArchive,
                          File deploymentPlan)
                          throws IllegalStateException
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.

Parameters:
targetList - A list of server targets the user is specifying this application be deployed to.
moduleArchive - The file name of the application archive to be disrtibuted.
deploymentPlan - The XML file containing the runtime configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the distribution process.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject distribute(Target[] targetList, java.io.InputStream moduleArchive, java.io.InputStream deploymentPlan) throws IllegalStateException
此分发方法执行三个任务：验证部署配置数据；生成所有特定于容器的类和接口；将完整备份的归档移动到指定的部署目标。
targetList | 用户指定将部署此应用程序的服务器目标列表。
moduleArchive | 包含要分发的应用程序归档文件的输入流。
deploymentPlan | 包含与此应用程序归档文件关联的部署配置信息的输入流。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
return | ProgressObject 追踪和报告分发过程状态的对象。
deprecated | 从 Java EE 5 开始，由 #distribute(Target[], ModuleType, InputStream, InputStream) 取代。
英文文档：

distribute

ProgressObject distribute(Target[] targetList,
                          InputStream moduleArchive,
                          InputStream deploymentPlan)
                          throws IllegalStateException
Deprecated. as of Java EE 5, replaced with distribute(Target[], ModuleType, InputStream, InputStream)

The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.

Parameters:
targetList - A list of server targets the user is specifying this application be deployed to.
moduleArchive - The input stream containing the application archive to be disrtibuted.
deploymentPlan - The input stream containing the deployment configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the distribution process.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject distribute(Target[] targetList, ModuleType type, java.io.InputStream moduleArchive, java.io.InputStream deploymentPlan) throws IllegalStateException
此分发方法执行三个任务：验证部署配置数据；生成所有特定于容器的类和接口；将完整备份的归档移动到指定的部署目标。
targetList | 用户指定将部署此应用程序的服务器目标列表。
moduleType | 此应用程序归档文件的模块类型。
moduleArchive | 包含要分发的应用程序归档文件的输入流。
deploymentPlan | 包含与此应用程序归档文件关联的部署配置信息的输入流。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
return | ProgressObject 追踪和报告分发过程状态的对象。
英文文档：

distribute

ProgressObject distribute(Target[] targetList,
                          ModuleType type,
                          InputStream moduleArchive,
                          InputStream deploymentPlan)
                          throws IllegalStateException
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.

Parameters:
targetList - A list of server targets the user is specifying this application be deployed to.
moduleType - The module type of this application archive.
moduleArchive - The input stream containing the application archive to be disrtibuted.
deploymentPlan - The input stream containing the deployment configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the distribution process.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject start(TargetModuleID[] moduleIDList) throws IllegalStateException
启动应用程序运行。

只有表示根模块的 TargetModuleID 才能有效启动。根 TargetModuleID 没有父级。有父级的 TargetModuleID 无法单独启动。根 TargetModuleID 模块及其所有子模块都将被启动。

moduleIDList | 表示要启动的模块的 TargetModuleID 对象数组。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
return | ProgressObject 追踪和报告启动操作状态的对象。
英文文档：

start

ProgressObject start(TargetModuleID[] moduleIDList)
                     throws IllegalStateException
Start the application running.

Only the TargetModuleIDs which represent a root module are valid for being started. A root TargetModuleID has no parent. A TargetModuleID with a parent can not be individually started. A root TargetModuleID module and all its child modules will be started.

Parameters:
moduleIDList - A array of TargetModuleID objects representing the modules to be started.
Returns:
ProgressObject an object that tracks and reports the status of the start operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject stop(TargetModuleID[] moduleIDList) throws IllegalStateException
停止应用程序运行。

只有表示根模块的 TargetModuleID 才能有效停止。根 TargetModuleID 没有父级。有父级的 TargetModuleID 无法单独停止。根 TargetModuleID 模块及其所有子模块都将被停止。

moduleIDList | 表示要停止的模块的 TargetModuleID 对象数组。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
return | ProgressObject 追踪和报告停止操作状态的对象。
英文文档：

stop

ProgressObject stop(TargetModuleID[] moduleIDList)
                    throws IllegalStateException
Stop the application running.

Only the TargetModuleIDs which represent a root module are valid for being stopped. A root TargetModuleID has no parent. A TargetModuleID with a parent can not be individually stopped. A root TargetModuleID module and all its child modules will be stopped.

Parameters:
moduleIDList - A array of TargetModuleID objects representing the modules to be stopped.
Returns:
ProgressObject an object that tracks and reports the status of the stop operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public ProgressObject undeploy(TargetModuleID[] moduleIDList) throws IllegalStateException
从目标服务器移除应用程序。

只有表示根模块的 TargetModuleID 才能有效地取消部署。根 TargetModuleID 没有父级。有父级的 TargetModuleID 无法取消部署。根 TargetModuleID 模块及其所有子模块都将被取消部署。根 TargetModuleID 模块及其所有子模块都必须在取消部署之前停止。

moduleIDList | 表示要停止的根模块的 TargetModuleID 对象数组。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
return | ProgressObject 追踪和报告停止操作状态的对象。
英文文档：

undeploy

ProgressObject undeploy(TargetModuleID[] moduleIDList)
                        throws IllegalStateException
Remove the application from the target server.

Only the TargetModuleIDs which represent a root module are valid for undeployment. A root TargetModuleID has no parent. A TargetModuleID with a parent can not be undeployed. A root TargetModuleID module and all its child modules will be undeployed. The root TargetModuleID module and all its child modules must stopped before they can be undeployed.

Parameters:
moduleIDList - An array of TargetModuleID objects representing the root modules to be stopped.
Returns:
ProgressObject an object that tracks and reports the status of the stop operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.

public boolean isRedeploySupported()
此方法指定此平台供应商是否提供应用程序重新部署功能。值为 true 表示支持。为 false 表示不支持。
return 值为 true 表示此供应商的 DeploymentManager 支持重新部署。为 false 表示不支持。
英文文档：

isRedeploySupported

boolean isRedeploySupported()
This method designates whether this platform vendor provides application redeployment functionality. A value of true means it is supported. False means it is not.

Returns:
A value of true means redeployment is supported by this vendor's DeploymentManager. False means it is not.

public ProgressObject redeploy(TargetModuleID[] moduleIDList, java.io.File moduleArchive, java.io.File deploymentPlan) throws UnsupportedOperationException, IllegalStateException
（可选）此重新部署方法提供一种更新当前部署的 J2EE 应用程序的手段。对于供应商实现，这是一种可选的方法。 重新部署使用更新的版本替换当前部署的应用程序。更新应用程序的运行时配置信息必须仍然与它所更新的应用程序相同。 重新部署应用程序更新时，不得中断任何现有客户端到原运行应用程序的连接，新的客户端将连接到应用程序更新。 此操作对于表示根模块的 TargetModuleID 有效。根 TargetModuleID 没有父级。根 TargetModuleID 模块及其所有子模块都将重新部署。子 TargetModuleID 无法单独重新部署。仅当完成了所有模块的重新部署操作时，此操作才算完成。
moduleIDList | 要更新的应用程序标志符数组。
moduleArchive | 要分发的应用程序归档文件的文件名称。
deploymentPlan | 与此应用程序归档文件关联的部署配置信息。
return | ProgressObject 追踪和报告重新部署操作状态的对象。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
Throws | UnsupportedOperationException: 此实现不支持此可选命令。
英文文档：

redeploy

ProgressObject redeploy(TargetModuleID[] moduleIDList,
                        File moduleArchive,
                        File deploymentPlan)
                        throws UnsupportedOperationException,
                               IllegalStateException
(optional) The redeploy method provides a means for updating currently deployed J2EE applications. This is an optional method for vendor implementation. Redeploy replaces a currently deployed application with an updated version. The runtime configuration information for the updated application must remain identical to the application it is updating. When an application update is redeployed, all existing client connections to the original running application must not be disrupted; new clients will connect to the application update. This operation is valid for TargetModuleIDs that represent a root module. A root TargetModuleID has no parent. A root TargetModuleID module and all its child modules will be redeployed. A child TargetModuleID module cannot be individually redeployed. The redeploy operation is complete only when this action for all the modules has completed.

Parameters:
moduleIDList - An array of designators of the applications to be updated.
moduleArchive - The file name of the application archive to be disrtibuted.
deploymentPlan - The deployment configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the redeploy operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
UnsupportedOperationException - this optional command is not supported by this implementation.

public ProgressObject redeploy(TargetModuleID[] moduleIDList, java.io.InputStream moduleArchive, java.io.InputStream deploymentPlan) throws UnsupportedOperationException, IllegalStateException
（可选）此重新部署方法提供一种更新当前部署的 J2EE 应用程序的手段。对于供应商实现，这是一种可选的方法。 重新部署使用更新的版本替换当前部署的应用程序。更新应用程序的运行时配置信息必须仍然与它所更新的应用程序相同。 重新部署应用程序更新时，不得中断任何现有客户端到原运行应用程序的连接，新的客户端将连接到应用程序更新。 此操作对于表示根模块的 TargetModuleID 有效。根 TargetModuleID 没有父级。根 TargetModuleID 模块及其所有子模块都将重新部署。子 TargetModuleID 无法单独重新部署。仅当完成了所有模块的重新部署操作时，此操作才算完成。
moduleIDList | 要更新的应用程序标志符数组。
moduleArchive | 包含要分发的应用程序归档文件的输入流。
deploymentPlan | 包含与此应用程序归档文件关联的运行时配置信息的输入流。
return | ProgressObject 追踪和报告重新部署操作状态的对象。
Throws | IllegalStateException: 运行在断开连接模式下调用该方法时，抛出该异常。
Throws | UnsupportedOperationException: 此实现不支持此可选命令。
英文文档：

redeploy

ProgressObject redeploy(TargetModuleID[] moduleIDList,
                        InputStream moduleArchive,
                        InputStream deploymentPlan)
                        throws UnsupportedOperationException,
                               IllegalStateException
(optional) The redeploy method provides a means for updating currently deployed J2EE applications. This is an optional method for vendor implementation. Redeploy replaces a currently deployed application with an updated version. The runtime configuration information for the updated application must remain identical to the application it is updating. When an application update is redeployed, all existing client connections to the original running application must not be disrupted; new clients will connect to the application update. This operation is valid for TargetModuleIDs that represent a root module. A root TargetModuleID has no parent. A root TargetModuleID module and all its child modules will be redeployed. A child TargetModuleID module cannot be individually redeployed. The redeploy operation is complete only when this action for all the modules has completed.

Parameters:
moduleIDList - An array of designators of the applications to be updated.
moduleArchive - The input stream containing the application archive to be disrtibuted.
deploymentPlan - The input stream containing the runtime configuration information associated with this application archive.
Returns:
ProgressObject an object that tracks and reports the status of the redeploy operation.
Throws:
IllegalStateException - is thrown when the method is called when running in disconnected mode.
UnsupportedOperationException - this optional command is not supported by this implementation.

public void release()
release 方法是一种机制，工具采用该机制通知 DeploymentManager 无需继续连接到平台。 工具可以发出通知表示它要在断开连接模式下运行，或者它计划关闭。 调用 release 方法时，DeploymentManager 会关闭部署配置时连接的所有 J2EE 资源，并释放其他相关资源。它将不会接受任何新的操作请求（即分发、启动、停止、取消部署、重新部署）。它将完成所有当前正在处理的操作。每个与运行操作关联的 ProgressObject 都将标记为已释放（请参阅 ProgressObject）。
英文文档：

release

void release()
The release method is the mechanism by which the tool signals to the DeploymentManager that the tool does not need it to continue running connected to the platform. The tool may be signaling it wants to run in a disconnected mode or it is planning to shutdown. When release is called the DeploymentManager may close any J2EE resource connections it had for deployment configuration and perform other related resource cleanup. It should not accept any new operation requests (i.e., distribute, start stop, undeploy, redeploy. It should finish any operations that are currently in process. Each ProgressObject associated with a running operation should be marked as released (see the ProgressObject).

public java.util.Locale getDefaultLocale()
返回此 javax.enterprise.deploy.spi 子包实现所支持的默认语言环境。
return 此实现的默认语言环境 (Locale)。
英文文档：

getDefaultLocale

Locale getDefaultLocale()
Returns the default locale supported by this implementation of javax.enterprise.deploy.spi subpackages.

Returns:
Locale the default locale for this implementation.

public java.util.Locale getCurrentLocale()
返回此 javax.enterprise.deploy.spi 子包实现运行的活动语言环境。
return 此实现的活动语言环境 (Locale)。
英文文档：

getCurrentLocale

Locale getCurrentLocale()
Returns the active locale this implementation of javax.enterprise.deploy.spi subpackages is running.

Returns:
Locale the active locale of this implementation.

public void setLocale(java.util.Locale locale) throws UnsupportedOperationException
为要运行的此 javax.enterprise.deploy.spi 子包实现设置活动语言环境。
Throws UnsupportedOperationException: 提供的语言环境不受支持。
英文文档：

setLocale

void setLocale(Locale locale)
               throws UnsupportedOperationException
Set the active locale for this implementation of javax.enterprise.deploy.spi subpackages to run.

Throws:
UnsupportedOperationException - the provide locale is not supported.

public java.util.Locale[] getSupportedLocales()
返回此实现支持的语言环境数组。
return 支持的语言环境列表 (Locale[])。
英文文档：

getSupportedLocales

Locale[] getSupportedLocales()
Returns an array of supported locales for this implementation.

Returns:
Locale[] the list of supported locales.

public boolean isLocaleSupported(java.util.Locale locale)
报告此实现是否支持指定的语言环境。
return 值为 'true' 表示它支持；为 'false' 表示不支持。
英文文档：

isLocaleSupported

boolean isLocaleSupported(Locale locale)
Reports if this implementation supports the designated locale.

Returns:
A value of 'true' means it is support and 'false' it is not.

public DConfigBeanVersionType getDConfigBeanVersion()
返回提供配置 Bean 的 J2EE 平台版本号。这些 Bean 必须使用 J2EE 平台要求的 J2SE 版本进行了编译。
return 表示提供这些 Bean 的平台版本号的 DConfigBeanVersionType 对象。
英文文档：

getDConfigBeanVersion

DConfigBeanVersionType getDConfigBeanVersion()
Returns the J2EE platform version number for which the configuration beans are provided. The beans must have been compiled with the J2SE version required by the J2EE platform.

Returns:
a DConfigBeanVersionType object representing the platform version number for which these beans are provided.

public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version)
如果配置 Bean 支持指定的 J2EE 平台版本，则返回 'true'。如果版本不受支持，则返回 'false'。
version | 表示请求支持的 J2EE 平台版本的 DConfigBeanVersionType 对象。
return | 如果版本受支持，则返回 'true'；如果不受支持，则返回 'false'。
英文文档：

isDConfigBeanVersionSupported

boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version)
Returns 'true' if the configuration beans support the J2EE platform version specified. It returns 'false' if the version is not supported.

Parameters:
version - a DConfigBeanVersionType object representing the J2EE platform version for which support is requested.
Returns:
'true' if the version is supported and 'false if not.

public void setDConfigBeanVersion(DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException
设置要用于指定 J2EE 平台版本的配置 Bean。
version | 表示请求支持的 J2EE 平台版本的 DConfigBeanVersionType 对象。
Throws | DConfigBeanVersionUnsupportedException: 如果不支持请求的 Bean 版本。
英文文档：

setDConfigBeanVersion

void setDConfigBeanVersion(DConfigBeanVersionType version)
                           throws DConfigBeanVersionUnsupportedException
Set the configuration beans to be used to the J2EE platform version specificed.

Parameters:
version - a DConfigBeanVersionType object representing the J2EE platform version for which support is requested.
Throws:
DConfigBeanVersionUnsupportedException - when the requested bean version is not supported.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Target (Java EE 5)

javax.enterprise.deploy.spi
Interface Target

public interface Target

Target 接口表示一个 J2EE 平台产品实例的单个逻辑核心服务器。它是一个标志符，标识一个服务器和用于复制配置应用程序以供服务器访问的隐含位置。
英文文档：

A Target interface represents a single logical core server of one instance of a J2EE platform product. It is a designator for a server and the implied location to copy a configured application for the server to access.

Method Summary
String | getDescription() Retrieve other descriptive information about the target.
String | getName() Retrieve the name of the target server.

Method Detail

public String getName()
获取目标服务器的名称。
英文文档：

getName

String getName()
Retrieve the name of the target server.

public String getDescription()
获取关于此目标的其他描述性信息。
英文文档：

getDescription

String getDescription()
Retrieve other descriptive information about the target.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TargetModuleID (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.spi
Interface TargetModuleID

public interface TargetModuleID

TargetModuleID 接口表示已部署的应用程序模块的唯一标识符。可部署的应用程序模块可以是一个 EAR、JAR、WAR 或 RAR 文件。 TargetModuleID 可以表示一个根模块或子模块。根模块 TargetModuleID 没有父模块。它表示一个已部署的 EAR 文件或独立模块。子模块 TargetModuleID 表示一个 J2EE 应用程序的已部署次级模块。 一个子 TargetModuleID 只有一个父模块，就是绑定或部署它的超模块。 标识符由目标名称和已部署应用程序模块的唯一标识符组成。
英文文档：

A TargetModuleID interface represents a unique identifier for a deployed application module. A deployable application module can be an EAR, JAR, WAR or RAR file. A TargetModuleID can represent a root module or a child module. A root module TargetModuleID has no parent. It represents a deployed EAR file or stand alone module. A child module TargetModuleID represents a deployed sub module of a J2EE application. A child TargetModuleID has only one parent, the super module it was bundled and deployed with. The identifier consists of the target name and the unique identifier for the deployed application module.

Method Summary
TargetModuleID[] | getChildTargetModuleID() Retrieve a list of identifiers of the children of this deployed module.
String | getModuleID() Retrieve the id assigned to represent the deployed module.
TargetModuleID | getParentTargetModuleID() Retrieve the identifier of the parent object of this deployed module.
Target | getTarget() Retrieve the name of the target server.
String | getWebURL() If this TargetModulID represents a web module retrieve the URL for it.
String | toString() Retrieve the identifier representing the deployed module.

Method Detail

public Target getTarget()
获取部署此模块的目标服务器名称。
return Target 表示服务器目标的对象。
英文文档：

getTarget

Target getTarget()
Retrieve the name of the target server. this module was deployed to.

Returns:
Target an object representing a server target.

public String getModuleID()
获取表示已部署模块的 ID。
英文文档：

getModuleID

String getModuleID()
Retrieve the id assigned to represent the deployed module.

public String getWebURL()
如果此 TargetModulID 表示一个 Web 模块，则获取它的 URL。
return Web 模块的 URL；如果该模块不是 Web 模块，则返回 null。
英文文档：

getWebURL

String getWebURL()
If this TargetModulID represents a web module retrieve the URL for it.

Returns:
the URL of a web module or null if the module is not a web module.

public String toString()
获取表示已部署模块的标识符。
英文文档：

toString

String toString()
Retrieve the identifier representing the deployed module.

Overrides:
toString in class Object

public TargetModuleID getParentTargetModuleID()
获取此已部署模块父对象的标识符。如果不存在父对象，则为已部署的根对象。根对象可以表示一个 EAR 文件，也可能是一个已部署的独立模块。
return 此对象的父对象的 TargetModuleID。null 值表示此模块是部署的根对象。
英文文档：

getParentTargetModuleID

TargetModuleID getParentTargetModuleID()
Retrieve the identifier of the parent object of this deployed module. If there is no parent then this is the root object deployed. The root could represent an EAR file or it could be a stand alone module that was deployed.

Returns:
the TargetModuleID of the parent of this object. A null value means this module is the root object deployed.

public TargetModuleID[] getChildTargetModuleID()
获取此已部署模块子对象的标识符列表。
return 标识此对象的子对象的 TargetModuleID 列表。null 值表示此模块没有子对象。
英文文档：

getChildTargetModuleID

TargetModuleID[] getChildTargetModuleID()
Retrieve a list of identifiers of the children of this deployed module.

Returns:
a list of TargetModuleIDs identifying the childern of this object. A null value means this module has no childern
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.enterprise.deploy.spi.exceptions (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.spi.exceptions

Provides J2EE Product Vendor deployment exception implementation classes.

See:
Description

Exception Summary
BeanNotFoundException | This exception is to report that the bean is not a child of the parent bean.
ClientExecuteException | This exception reports errors in setting up an application client for execution.
ConfigurationException | This exception reports errors in generating a configuration bean.
DConfigBeanVersionUnsupportedException | This exception is to report that there is no support for the DConfigBean version requested.
DeploymentManagerCreationException | This exception is to report problems in returning a DeploymentManager object cause by such things as server down, unable to authenticate and the like.
InvalidModuleException | This exception is to report an invalid J2EE deployment module type.
OperationUnsupportedException | This exception is to report that the method called is not supported by this implementation.
TargetException | This exception is to report bad target designators.

Package javax.enterprise.deploy.spi.exceptions Description

Provides J2EE Product Vendor deployment exception implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.spi.exceptions Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.spi.exceptions

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.enterprise.deploy.spi.exceptions.BeanNotFoundException
        • javax.enterprise.deploy.spi.exceptions.ClientExecuteException
        • javax.enterprise.deploy.spi.exceptions.ConfigurationException
        • javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException
        • javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
        • javax.enterprise.deploy.spi.exceptions.InvalidModuleException
        • javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
        • javax.enterprise.deploy.spi.exceptions.TargetException
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


BeanNotFoundException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.spi.exceptions
Class BeanNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.BeanNotFoundException
All Implemented Interfaces:
Serializable
public class BeanNotFoundException
extends Exception

Extends: Throwable > Exception

此异常报告该 Bean 不是父 Bean 的子 Bean。
英文文档：

This exception is to report that the bean is not a child of the parent bean.

See Also:
Serialized Form

Constructor Summary
BeanNotFoundException(String s)
Creates an new BeanNotFoundException object.
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

public BeanNotFoundException(String s)
创建新的 BeanNotFoundException 对象。
s 指示目标问题的字符串。
英文文档：

BeanNotFoundException

public BeanNotFoundException(String s)
Creates an new BeanNotFoundException object.

Parameters:
s - a string indicating what was wrong with the target.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ClientExecuteException (Java EE 5)

javax.enterprise.deploy.spi.exceptions
Class ClientExecuteException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.ClientExecuteException
All Implemented Interfaces:
Serializable
public class ClientExecuteException
extends Exception

Extends: Throwable > Exception

此异常报告设置要执行的应用程序客户端时的错误。
英文文档：

This exception reports errors in setting up an application client for execution.

Author:
gfink
See Also:
Serialized Form

Constructor Summary
ClientExecuteException()
Creates new ClientExecuteException without detail message.
ClientExecuteException(String msg)
Constructs an ClientExecuteException with the specified detail message.
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

public ClientExecuteException()
创建不带详细消息的新 ClientExecuteException。
英文文档：

ClientExecuteException

public ClientExecuteException()
Creates new ClientExecuteException without detail message.

public ClientExecuteException(String msg)
构造带指定详细消息的 ClientExecuteException。
msg 详细消息。
英文文档：

ClientExecuteException

public ClientExecuteException(String msg)
Constructs an ClientExecuteException with the specified detail message.

Parameters:
msg - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConfigurationException (Java EE 5)

javax.enterprise.deploy.spi.exceptions
Class ConfigurationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.ConfigurationException
All Implemented Interfaces:
Serializable
public class ConfigurationException
extends Exception

Extends: Throwable > Exception

此异常报告生成配置 Bean 时的错误。
英文文档：

This exception reports errors in generating a configuration bean.

Author:
gfink
See Also:
Serialized Form

Constructor Summary
ConfigurationException()
Creates new ConfigurationException without detail message.
ConfigurationException(String msg)
Constructs an ConfigurationException with the specified detail message.
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

public ConfigurationException()
创建不带详细消息的新 ConfigurationException。
英文文档：

ConfigurationException

public ConfigurationException()
Creates new ConfigurationException without detail message.

public ConfigurationException(String msg)
构造带指定详细消息的 ConfigurationException。
msg 详细消息。
英文文档：

ConfigurationException

public ConfigurationException(String msg)
Constructs an ConfigurationException with the specified detail message.

Parameters:
msg - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DConfigBeanVersionUnsupportedException (Java EE 5)

javax.enterprise.deploy.spi.exceptions
Class DConfigBeanVersionUnsupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException
All Implemented Interfaces:
Serializable
public class DConfigBeanVersionUnsupportedException
extends Exception

Extends: Throwable > Exception

此异常报告不支持请求的 DConfigBean 版本。
英文文档：

This exception is to report that there is no support for the DConfigBean version requested.

See Also:
Serialized Form

Constructor Summary
DConfigBeanVersionUnsupportedException(String s)
Creates an new DConfigBeanVersionUnsupportedException object.
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

public DConfigBeanVersionUnsupportedException(String s)
创建新的 DConfigBeanVersionUnsupportedException 对象。
s 指示所请求版本问题的字符串。
英文文档：

DConfigBeanVersionUnsupportedException

public DConfigBeanVersionUnsupportedException(String s)
Creates an new DConfigBeanVersionUnsupportedException object.

Parameters:
s - a string indicating what was wrong with the version request.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeploymentManagerCreationException (Java EE 5)

javax.enterprise.deploy.spi.exceptions
Class DeploymentManagerCreationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
All Implemented Interfaces:
Serializable
public class DeploymentManagerCreationException
extends Exception

Extends: Throwable > Exception

此异常报告在返回 DeploymentManager 对象时由于服务器关闭、无法进行验证等原因导致的问题。
英文文档：

This exception is to report problems in returning a DeploymentManager object cause by such things as server down, unable to authenticate and the like.

See Also:
Serialized Form

Constructor Summary
DeploymentManagerCreationException(String s)
Creates an new DeploymentManagerCreationException object.
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

public DeploymentManagerCreationException(String s)
创建新的 DeploymentManagerCreationException 对象。
s 提供关于此问题的更多信息的字符串。
英文文档：

DeploymentManagerCreationException

public DeploymentManagerCreationException(String s)
Creates an new DeploymentManagerCreationException object.

Parameters:
s - a string providing more information about the problem.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidModuleException (Java EE 5)

javax.enterprise.deploy.spi.exceptions
Class InvalidModuleException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.InvalidModuleException
All Implemented Interfaces:
Serializable
public class InvalidModuleException
extends Exception

Extends: Throwable > Exception

此异常报告无效的 J2EE 部署模块类型。
英文文档：

This exception is to report an invalid J2EE deployment module type.

See Also:
Serialized Form

Constructor Summary
InvalidModuleException(String s)
Creates an new InvalidModuleException object.
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

public InvalidModuleException(String s)
创建新的 InvalidModuleException 对象。
s 指示模块类型问题的字符串。
英文文档：

InvalidModuleException

public InvalidModuleException(String s)
Creates an new InvalidModuleException object.

Parameters:
s - a string indicating what was wrong with the module type.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OperationUnsupportedException (Java EE 5)

javax.enterprise.deploy.spi.exceptions
Class OperationUnsupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
All Implemented Interfaces:
Serializable
public class OperationUnsupportedException
extends Exception

Extends: Throwable > Exception

此异常报告此实现不支持调用的方法。
英文文档：

This exception is to report that the method called is not supported by this implementation.

See Also:
Serialized Form

Constructor Summary
OperationUnsupportedException(String s)
Creates an new OperationUnsupportedException object.
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

public OperationUnsupportedException(String s)
创建新的 OperationUnsupportedException 对象。
s 指示目标问题的字符串。
英文文档：

OperationUnsupportedException

public OperationUnsupportedException(String s)
Creates an new OperationUnsupportedException object.

Parameters:
s - a string indicating what was wrong with the target.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TargetException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.spi.exceptions
Class TargetException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.enterprise.deploy.spi.exceptions.TargetException
All Implemented Interfaces:
Serializable
public class TargetException
extends Exception

Extends: Throwable > Exception

此异常报告无效的目标标志符。
英文文档：

This exception is to report bad target designators.

See Also:
Serialized Form

Constructor Summary
TargetException(String s)
Creates an new TargetException object.
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

public TargetException(String s)
创建新的 TargetException 对象。
s 指示目标问题的字符串。
英文文档：

TargetException

public TargetException(String s)
Creates an new TargetException object.

Parameters:
s - a string indicating what was wrong with the target.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.enterprise.deploy.spi.factories (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.spi.factories

Provides J2EE Product Vendor deployment factory implementation classes.

See:
Description

Interface Summary
DeploymentFactory The DeploymentFactory interface is a deployment driver for a J2EE plaform product.

Package javax.enterprise.deploy.spi.factories Description

Provides J2EE Product Vendor deployment factory implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.spi.factories Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.spi.factories

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.enterprise.deploy.spi.factories.DeploymentFactory
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DeploymentFactory (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.spi.factories
Interface DeploymentFactory

public interface DeploymentFactory

DeploymentFactory 接口是 J2EE 平台产品的部署驱动程序。它返回一个 DeploymentManager 对象，该对象表示一个到特定 J2EE 平台产品的连接。

每个应用服务器供应商都必须提供此类的实现，以便 J2EE Deployment API 处理他们的产品。

实现此接口的类应该有一个公共的无参数构造方法，并且应该是无状态的（该类的两个实例的行为应该始终相同）。建议该类拥有一个静态初始化程序（但这不是必需的），该程序可向 DeploymentFactoryManager 类注册一个类实例。

可以请求一个连接或断开的 DeploymentManager。在连接平台的情况下运行的 DeploymentManager 能够访问 J2EE 资源。在断开连接的情况下运行的 DeploymentManager 仅提供模块部署配置支持。

See also javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
英文文档：

The DeploymentFactory interface is a deployment driver for a J2EE plaform product. It returns a DeploymentManager object which represents a connection to a specific J2EE platform product.

Each application server vendor must provide an implementation of this class in order for the J2EE Deployment API to work with their product.

The class implementing this interface should have a public no-argument constructor, and it should be stateless (two instances of the class should always behave the same). It is suggested but not required that the class have a static initializer that registers an instance of the class with the DeploymentFactoryManager class.

A connected or disconnected DeploymentManager can be requested. A DeploymentManager that runs connected to the platform can provide access to J2EE resources. A DeploymentManager that runs disconnected only provides module deployment configuration support.

See Also:
DeploymentFactoryManager

Method Summary
DeploymentManager | getDeploymentManager(String uri, String username, String password) Return a connected DeploymentManager instance.
DeploymentManager | getDisconnectedDeploymentManager(String uri) Return a disconnected DeploymentManager instance.
String | getDisplayName() Provide a string with the name of this vendor's DeploymentManager.
String | getProductVersion() Provide a string identifying version of this vendor's DeploymentManager.
boolean | handlesURI(String uri) Tests whether this factory can create a DeploymentManager object based on the specificed URI.

Method Detail

public boolean handlesURI(String uri)
测试此工厂是否能够根据指定的 URI 创建 DeploymentManager 对象。此方法并不能指出这种尝试能否成功，仅能指出工厂能否处理该 URI。
uri | 要检查的 URI。
return | 如果工厂能够处理该 URI，则返回 true。
英文文档：

handlesURI

boolean handlesURI(String uri)
Tests whether this factory can create a DeploymentManager object based on the specificed URI. This does not indicate whether such an attempt will be successful, only whether the factory can handle the uri.

Parameters:
uri - The uri to check
Returns:
true if the factory can handle the uri.

public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException
返回一个连接的 DeploymentManager 实例。
uri | 表示连接参数的 URI
username | 可选用户名（如果此平台不需要验证，则为 null）。
password | 可选密码（如果此平台不需要验证，则为 null）。
return | 就绪的 DeploymentManager 实例。
Throws | DeploymentManagerCreationException: 无法返回 DeploymentManager 时（服务器关闭、无法进行验证等）发生。
英文文档：

getDeploymentManager

DeploymentManager getDeploymentManager(String uri,
                                       String username,
                                       String password)
                                       throws DeploymentManagerCreationException
Return a connected DeploymentManager instance.

Parameters:
uri - The URI that specifies the connection parameters
username - An optional username (may be null if no authentication is required for this platform).
password - An optional password (may be null if no authentication is required for this platform).
Returns:
A ready DeploymentManager instance.
Throws:
DeploymentManagerCreationException - occurs when a DeploymentManager could not be returned (server down, unable to authenticate, etc).

public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException
返回一个断开连接的 DeploymentManager 实例。
uri | 要返回的 DeploymentManager 的 URI。
return | DeploymentManager 断开的实例。
Throws | DeploymentManagerCreationException: 无法创建 DeploymentManager 时发生。
英文文档：

getDisconnectedDeploymentManager

DeploymentManager getDisconnectedDeploymentManager(String uri)
                                                   throws DeploymentManagerCreationException
Return a disconnected DeploymentManager instance.

Parameters:
uri - the uri of the DeploymentManager to return.
Returns:
A DeploymentManager disconnected instance.
Throws:
DeploymentManagerCreationException - occurs if the DeploymentManager could not be created.

public String getDisplayName()
提供包含此供应商 DeploymentManager 的名称的字符串。
return 供应商 DeploymentManager 的名称。
英文文档：

getDisplayName

String getDisplayName()
Provide a string with the name of this vendor's DeploymentManager.

Returns:
the name of the vendor's DeploymentManager.

public String getProductVersion()
提供标识此供应商 DeploymentManager 的版本的字符串。
return 供应商 DeploymentManager 的名称。
英文文档：

getProductVersion

String getProductVersion()
Provide a string identifying version of this vendor's DeploymentManager.

Returns:
the name of the vendor's DeploymentManager.
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.enterprise.deploy.spi.status (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.enterprise.deploy.spi.status

Provides J2EE Product Vendor deployment status implementation classes.

See:
Description

Interface Summary
ClientConfiguration | The ClientConfiguration object installs, configures and executes an Application Client.
DeploymentStatus | The DeploymentStatus interface provides information about the progress status of a deployment action.
ProgressListener | The listener interface for receiving deployment progress events.
ProgressObject | The ProgressObject interface tracks and reports the progress of the deployment activities, distribute, start, stop, undeploy.

Class Summary
ProgressEvent An event which indicates that a deployment status change has occurred.

Package javax.enterprise.deploy.spi.status Description

Provides J2EE Product Vendor deployment status implementation classes.

Package Specification

  • JSR 88, J2EE Application Deployment

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.enterprise.deploy.spi.status Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.enterprise.deploy.spi.status

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.EventObject (implements java.io.Serializable)
      • javax.enterprise.deploy.spi.status.ProgressEvent

Interface Hierarchy

  • javax.enterprise.deploy.spi.status.DeploymentStatus
  • java.util.EventListener
    • javax.enterprise.deploy.spi.status.ProgressListener
  • javax.enterprise.deploy.spi.status.ProgressObject
  • java.io.Serializable
    • javax.enterprise.deploy.spi.status.ClientConfiguration
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ClientConfiguration (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.spi.status
Interface ClientConfiguration

All Superinterfaces:
Serializable
public interface ClientConfiguration
extends Serializable

Implements: java.io.Serializable

ClientConfiguration 对象安装、配置并执行一个应用程序客户端。此类对应用程序客户端的安装和运行进行设置。
英文文档：

The ClientConfiguration object installs, configures and executes an Application Client. This class resolves the settings for installing and running the application client.

Method Summary
 void execute()
This method performs an exec and starts the application client running in another process.

Method Detail

public void execute() throws ClientExecuteException
此方法执行 exec 并启动在另一个进程中运行的应用程序客户端。
Throws ClientExecuteException: 如果配置未完成。
英文文档：

execute

void execute()
             throws ClientExecuteException
This method performs an exec and starts the application client running in another process.

Throws:
ClientExecuteException - when the configuration is incomplete.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DeploymentStatus (Java EE 5)

javax.enterprise.deploy.spi.status
Interface DeploymentStatus

public interface DeploymentStatus

DeploymentStatus 接口提供关于部署操作进度状态的信息。
英文文档：

The DeploymentStatus interface provides information about the progress status of a deployment action.

Method Summary
ActionType | getAction() Retrieve the deployment ActionType for this event.
CommandType | getCommand() Retrieve the deployment CommandType of this event.
String | getMessage() Retrieve any additional information about the status of this event.
StateType | getState() Retrieve the StateType value.
boolean | isCompleted() A convience method to report if the operation is in the completed state.
boolean | isFailed() A convience method to report if the operation is in the failed state.
boolean | isRunning() A convience method to report if the operation is in the running state.

Method Detail

public StateType getState()
获取 StateType 值。
return StateType 对象
英文文档：

getState

StateType getState()
Retrieve the StateType value.

Returns:
the StateType object

public CommandType getCommand()
获取此事件的部署 CommandType。
return CommandType 对象。
英文文档：

getCommand

CommandType getCommand()
Retrieve the deployment CommandType of this event.

Returns:
the CommandType Object

public ActionType getAction()
获取此事件的部署 ActionType。
return ActionType 对象。
英文文档：

getAction

ActionType getAction()
Retrieve the deployment ActionType for this event.

Returns:
the ActionType Object

public String getMessage()
获取有关此事件状态的任何附加信息。
return 消息文本
英文文档：

getMessage

String getMessage()
Retrieve any additional information about the status of this event.

Returns:
message text

public boolean isCompleted()
报告操作是否处于完成状态的便捷方法。
return 如果此命令成功完成，则返回 true。
英文文档：

isCompleted

boolean isCompleted()
A convience method to report if the operation is in the completed state.

Returns:
true if this command has completed successfully

public boolean isFailed()
报告操作是否处于失败状态的便捷方法。
return 如果此命令失败，则返回 true。
英文文档：

isFailed

boolean isFailed()
A convience method to report if the operation is in the failed state.

Returns:
true if this command has failed

public boolean isRunning()
报告操作是否处于运行状态的便捷方法。
return 如果此命令仍在运行，则返回 true。
英文文档：

isRunning

boolean isRunning()
A convience method to report if the operation is in the running state.

Returns:
true if this command is still running
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProgressListener (Java EE 5)

javax.enterprise.deploy.spi.status
Interface ProgressListener

All Superinterfaces:
EventListener
public interface ProgressListener
extends EventListener

Implements: java.util.EventListener

用于接收部署进度事件的侦听器接口。
英文文档：

The listener interface for receiving deployment progress events.

Method Summary
 void handleProgressEvent(ProgressEvent event)
Invoked when a deployment progress event occurs.

Method Detail

public void handleProgressEvent(ProgressEvent event)
在部署进度事件发生时调用。
event 进度状态事件。
英文文档：

handleProgressEvent

void handleProgressEvent(ProgressEvent event)
Invoked when a deployment progress event occurs.

Parameters:
event - the progress status event.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProgressObject (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.enterprise.deploy.spi.status
Interface ProgressObject

public interface ProgressObject

ProgressObject 接口跟踪并报告部署活动、分发、启动、停止和取消部署的进度。

此类有一个可选的 cancel 方法。可以通过 isCancelSupported 方法测试是否支持 cancel 功能。

ProgressObject 结构允许用户选择轮询状态或者提供回调。

英文文档：

The ProgressObject interface tracks and reports the progress of the deployment activities, distribute, start, stop, undeploy.

This class has an optional cancel method. The support of the cancel function can be tested by the isCancelSupported method.

The ProgressObject structure allows the user the option of polling for status or to provide a callback.

Method Summary
void | addProgressListener(ProgressListener pol) Add a listener to receive Progress events on deployment actions.
void | cancel() (optional) A cancel request on an in-process operation stops all further processing of the operation and returns the environment to it original state before the operation was executed.
ClientConfiguration | getClientConfiguration(TargetModuleID id) Return the ClientConfiguration object associated with the TargetModuleID.
DeploymentStatus | getDeploymentStatus() Retrieve the status of this activity.
TargetModuleID[] | getResultTargetModuleIDs() Retrieve the list of TargetModuleIDs successfully processed or created by the associated DeploymentManager operation.
boolean | isCancelSupported() Tests whether the vendor supports a cancel opertation for deployment activities.
boolean | isStopSupported() Tests whether the vendor supports a stop opertation for deployment activities.
void | removeProgressListener(ProgressListener pol) Remove a ProgressObject listener.
void | stop() (optional) A stop request on an in-process operation allows the operation on the current TargetModuleID to run to completion but does not process any of the remaining unprocessed TargetModuleID objects.

Method Detail

public DeploymentStatus getDeploymentStatus()
获取此活动的状态。
return 包含状态信息的对象。
英文文档：

getDeploymentStatus

DeploymentStatus getDeploymentStatus()
Retrieve the status of this activity.

Returns:
An object containing the status information.

public TargetModuleID[] getResultTargetModuleIDs()
获取成功处理或由关联 DeploymentManager 操作创建的 TargetModuleID 所组成的列表。
return TargetModuleID 列表。
英文文档：

getResultTargetModuleIDs

TargetModuleID[] getResultTargetModuleIDs()
Retrieve the list of TargetModuleIDs successfully processed or created by the associated DeploymentManager operation.

Returns:
a list of TargetModuleIDs.

public ClientConfiguration getClientConfiguration(TargetModuleID id)
返回与 TargetModuleID 关联的 ClientConfiguration 对象。
return 返回给定 TargetModuleID 的 ClientConfiguration；如果不存在，则返回 null。
英文文档：

getClientConfiguration

ClientConfiguration getClientConfiguration(TargetModuleID id)
Return the ClientConfiguration object associated with the TargetModuleID.

Returns:
ClientConfiguration for a given TargetModuleID or null if none exists.

public boolean isCancelSupported()
测试供应商是否支持部署活动的取消操作。
return 如果此平台支持取消活动，则返回 true。
英文文档：

isCancelSupported

boolean isCancelSupported()
Tests whether the vendor supports a cancel opertation for deployment activities.

Returns:
true if canceling an activity is supported by this platform.

public void cancel() throws OperationUnsupportedException
（可选）对处理中的操作的取消请求，请求停止所有正在处理的操作，并将环境返回到操作执行前的原始状态。已经运行完成的操作无法取消。
Throws OperationUnsupportedException: 此实现不支持此可选命令。
英文文档：

cancel

void cancel()
            throws OperationUnsupportedException
(optional) A cancel request on an in-process operation stops all further processing of the operation and returns the environment to it original state before the operation was executed. An operation that has run to completion cannot be cancelled.

Throws:
OperationUnsupportedException - this optional command is not supported by this implementation.

public boolean isStopSupported()
测试供应商是否支持部署活动的停止操作。
return 如果此平台支持取消活动，则返回 true。
英文文档：

isStopSupported

boolean isStopSupported()
Tests whether the vendor supports a stop opertation for deployment activities.

Returns:
true if canceling an activity is supported by this platform.

public void stop() throws OperationUnsupportedException
（可选）对处理中的操作的停止请求，允许对当前 TargetModuleID 的操作运行完成，但停止处理尚未处理的 TargetModuleID 对象。getResultTargetModuleIDs 方法必须返回经过处理的 TargetModuleID。
Throws OperationUnsupportedException: 此实现不支持此可选命令。
英文文档：

stop

void stop()
          throws OperationUnsupportedException
(optional) A stop request on an in-process operation allows the operation on the current TargetModuleID to run to completion but does not process any of the remaining unprocessed TargetModuleID objects. The processed TargetModuleIDs must be returned by the method getResultTargetModuleIDs.

Throws:
OperationUnsupportedException - this optional command is not supported by this implementation.

public void addProgressListener(ProgressListener pol)
添加一个侦听器，以接收部署操作的 Progress 事件。
pol | 接受事件的侦听器
See also | javax.enterprise.deploy.spi.status.ProgressEvent
英文文档：

addProgressListener

void addProgressListener(ProgressListener pol)
Add a listener to receive Progress events on deployment actions.

Parameters:
pol - the listener to receive events
See Also:
ProgressEvent

public void removeProgressListener(ProgressListener pol)
移除 ProgressObject 侦听器。
pol | 正移除的侦听器
See also | javax.enterprise.deploy.spi.status.ProgressEvent
英文文档：

removeProgressListener

void removeProgressListener(ProgressListener pol)
Remove a ProgressObject listener.

Parameters:
pol - the listener being removed
See Also:
ProgressEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ProgressEvent (Java EE 5)

javax.enterprise.deploy.spi.status
Class ProgressEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.enterprise.deploy.spi.status.ProgressEvent
All Implemented Interfaces:
Serializable
public class ProgressEvent
extends EventObject

Extends: java.util.EventObject

指示部署状态发生了更改的事件。
See also javax.enterprise.deploy.spi.status.ProgressListener, javax.enterprise.deploy.spi.status.ProgressObject
英文文档：

An event which indicates that a deployment status change has occurred.

See Also:
ProgressListener, ProgressObject, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ProgressEvent(Object source, TargetModuleID targetModuleID, DeploymentStatus sCode)
Creates a new object representing a deployment progress event.
Method Summary
DeploymentStatus | getDeploymentStatus() Retrieve the status information.
TargetModuleID | getTargetModuleID() Retrieve the TargetModuleID for this event
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ProgressEvent(Object source, TargetModuleID targetModuleID, DeploymentStatus sCode)
创建一个表示部署进度事件的新对象。
source | 最初发生 Event 的对象。
sCode | 包含状态信息的对象。
英文文档：

ProgressEvent

public ProgressEvent(Object source,
                     TargetModuleID targetModuleID,
                     DeploymentStatus sCode)
Creates a new object representing a deployment progress event.

Parameters:
source - the object on which the Event initially occurred.
sCode - the object containing the status information.
Method Detail

public TargetModuleID getTargetModuleID()
获取此事件的 TargetModuleID。
return 包含 TargetModuleID 的对象
英文文档：

getTargetModuleID

public TargetModuleID getTargetModuleID()
Retrieve the TargetModuleID for this event

Returns:
the object containing the TargetModuleID

public DeploymentStatus getDeploymentStatus()
获取状态信息。
return 包含状态信息的对象。
英文文档：

getDeploymentStatus

public DeploymentStatus getDeploymentStatus()
Retrieve the status information.

Returns:
the object containing the status information.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.faces (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces

Top level classes for the JavaServer(tm) Faces API.

See:
Description

Class Summary
FactoryFinder FactoryFinder implements the standard discovery algorithm for all factory objects specified in the JavaServer Faces APIs.

Exception Summary
FacesException This class encapsulates general JavaServer Faces exceptions.

Package javax.faces Description

Top level classes for the JavaServer(tm) Faces API. The most important class in the package is FactoryFinder, which is the mechanism by which users can override many of the key pieces of the implementation with their own.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.FactoryFinder
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.faces.FacesException
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


FactoryFinder (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces
Class FactoryFinder

java.lang.Object
    extended by  javax.faces.FactoryFinder

public final class FactoryFinder
extends Object

FactoryFinder 实现 JavaServer Faces API 中指定的所有工厂对象的标准发现算法。对于给定的工厂类名，将根据以下算法搜索相应的实现类。各条目以递减的搜索优先顺序列出：

  • 如果 JavaServer Faces 配置文件（绑定到 Web 应用程序的 WEB-INF 目录）包含具有给定工厂类名称的 factory 条目，则使用该工厂。
  • 如果 javax.faces.CONFIG_FILES ServletContext init 参数指定的 JavaServer Faces 配置文件包含任何具有给定工厂类名称的 factory 条目，则使用这些工厂（最后一个优先使用）。
  • 如果有任何 JavaServer Faces 配置文件绑定到 ServletContext 的资源路径上的任何 jar 文件的 META-INF 目录，则使用这些文件中具有给定工厂类名称的 factory 条目（最后一个优先使用）。
  • 如果 META-INF/services/{factory-class-name} 资源对于调用它的应用程序的 Web 应用程序类加载器是可见的（通常是因为出现在一个 JAR 文件的清单中），则将读取第一行并将其视为要使用的工厂实现类的名称。
  • 如果以上步骤都没有得到匹配项，则使用 JavaServer Faces 实现特有的类。

如果以上任何步骤中发现的任何工厂碰巧拥有单参数的构造方法，并且参数类型为抽象工厂类，则调用该构造方法，并将前面的匹配项传递给该构造方法。例如，假设容器供应商提供了 javax.faces.context.FacesContextFactory 实现，并在 Web 应用程序 ClassLoader 的 jar 文件的 META-INF/services/javax.faces.context.FacesContextFactory 中标识。同时假设容器供应商提供的这个实现拥有单参数的构造方法，并且该方法接受 FacesContextFactory 实例。那么 FactoryFinder 系统将调用这个单参数构造方法，同时传递 JavaServer Faces 实现提供的 FacesContextFactory 实现。

如果 Factory 实现没有提供相应的单参数构造方法，则它必须提供无参数构造方法，以便成功进行实例化。

找到工厂实现类的名称后，将请求调用它的应用程序的 Web 应用程序类加载器加载此类，然后创建该类的相应实例。此规则的副作用是，不管 JavaServer Faces 实现是包含在 Web 应用程序中还是通过容器的共享库工具变得可见，每个 Web 应用程序都将收到各自的工厂类实例。

英文文档：

FactoryFinder implements the standard discovery algorithm for all factory objects specified in the JavaServer Faces APIs. For a given factory class name, a corresponding implementation class is searched for based on the following algorithm. Items are listed in order of decreasing search precedence:

  • If the JavaServer Faces configuration file bundled into the WEB-INF directory of the webapp contains a factory entry of the given factory class name, that factory is used.
  • If the JavaServer Faces configuration files named by the javax.faces.CONFIG_FILES ServletContext init parameter contain any factory entries of the given factory class name, those factories are used, with the last one taking precedence.
  • If there are any JavaServer Faces configuration files bundled into the META-INF directory of any jars on the ServletContext's resource paths, the factory entries of the given factory class name in those files are used, with the last one taking precedence.
  • If a META-INF/services/{factory-class-name} resource is visible to the web application class loader for the calling application (typically as a result of being present in the manifest of a JAR file), its first line is read and assumed to be the name of the factory implementation class to use.
  • If none of the above steps yield a match, the JavaServer Faces implementation specific class is used.

If any of the factories found on any of the steps above happen to have a one-argument constructor, with argument the type being the abstract factory class, that constructor is invoked, and the previous match is passed to the constructor. For example, say the container vendor provided an implementation of FacesContextFactory, and identified it in META-INF/services/javax.faces.context.FacesContextFactory in a jar on the webapp ClassLoader. Also say this implementation provided by the container vendor had a one argument constructor that took a FacesContextFactory instance. The FactoryFinder system would call that one-argument constructor, passing the implementation of FacesContextFactory provided by the JavaServer Faces implementation.

If a Factory implementation does not provide a proper one-argument constructor, it must provide a zero-arguments constructor in order to be successfully instantiated.

Once the name of the factory implementation class is located, the web application class loader for the calling application is requested to load this class, and a corresponding instance of the class will be created. A side effect of this rule is that each web application will receive its own instance of each factory class, whether the JavaServer Faces implementation is included within the web application or is made visible through the container's facilities for shared libraries.

Field Summary
static String | APPLICATION_FACTORY The property name for the ApplicationFactory class name.
static String | FACES_CONTEXT_FACTORY The property name for the FacesContextFactory class name.
static String | LIFECYCLE_FACTORY The property name for the LifecycleFactory class name.
static String | RENDER_KIT_FACTORY The property name for the RenderKitFactory class name.
Method Summary
static Object getFactory(String factoryName)
Create (if necessary) and return a per-web-application instance of the appropriate implementation class for the specified JavaServer Faces factory class, based on the discovery algorithm described in the class description.
static void releaseFactories()
Release any references to factory instances associated with the class loader for the calling web application.
static void setFactory(String factoryName, String implName)
This method will store the argument factoryName/implName mapping in such a way that getFactory(java.lang.String) will find this mapping when searching for a match.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

APPLICATION_FACTORY

public static final String APPLICATION_FACTORY

The property name for the ApplicationFactory class name.

See Also:
Constant Field Values

英文文档：

FACES_CONTEXT_FACTORY

public static final String FACES_CONTEXT_FACTORY

The property name for the FacesContextFactory class name.

See Also:
Constant Field Values

英文文档：

LIFECYCLE_FACTORY

public static final String LIFECYCLE_FACTORY

The property name for the LifecycleFactory class name.

See Also:
Constant Field Values

英文文档：

RENDER_KIT_FACTORY

public static final String RENDER_KIT_FACTORY

The property name for the RenderKitFactory class name.

See Also:
Constant Field Values
Method Detail

public static Object getFactory(String factoryName) throws FacesException

根据指定 JavaServer Faces 工厂类相应的实现类描述中所述的发现算法，创建（如有必要）并返回该类的实例（每个 Web 应用程序一个实例）。

factoryName | 请求实现实例的 JavaServer Faces 工厂的完全限定名
Throws | FacesException: 如果无法识别 Web 应用程序类加载器
Throws | FacesException: 如果无法加载配置的工厂实现类的实例
Throws | FacesException: 如果无法初始化配置的工厂实现类的实例
Throws | IllegalArgumentException: 如果 factoryName 无法识别标准的 JavaServer Faces 工厂名
Throws | IllegalStateException: 如果指定的工厂名称没有配置工厂实现类
Throws | NullPointerException: 如果 factoryname 为 null
英文文档：

getFactory

public static Object getFactory(String factoryName)
                         throws FacesException

Create (if necessary) and return a per-web-application instance of the appropriate implementation class for the specified JavaServer Faces factory class, based on the discovery algorithm described in the class description.

Parameters:
factoryName - Fully qualified name of the JavaServer Faces factory for which an implementation instance is requested
Throws:
FacesException - if the web application class loader cannot be identified
FacesException - if an instance of the configured factory implementation class cannot be loaded
FacesException - if an instance of the configured factory implementation class cannot be instantiated
IllegalArgumentException - if factoryName does not identify a standard JavaServer Faces factory name
IllegalStateException - if there is no configured factory implementation class for the specified factory name
NullPointerException - if factoryname is null

public static void setFactory(String factoryName, String implName)

此方法将以便于 #getFactory 搜索匹配项时发现该映射的方式存储参数 factoryName/implName 映射。

如果已调用 getFactory() 查找此 factoryName 对应的工厂，则此方法没有任何效果。

此方法可以被实现用来在解析 Faces 配置文件时存储工厂映射。

Throws | IllegalArgumentException: 如果 factoryName 无法识别标准的 JavaServer Faces 工厂名
Throws | NullPointerException: 如果 factoryname 为 null
英文文档：

setFactory

public static void setFactory(String factoryName,
                              String implName)

This method will store the argument factoryName/implName mapping in such a way that getFactory(java.lang.String) will find this mapping when searching for a match.

This method has no effect if getFactory() has already been called looking for a factory for this factoryName.

This method can be used by implementations to store a factory mapping while parsing the Faces configuration file

Throws:
IllegalArgumentException - if factoryName does not identify a standard JavaServer Faces factory name
NullPointerException - if factoryname is null

public static void releaseFactories() throws FacesException

释放所有对调用它的 Web 应用程序的类加载器所关联的工厂实例的引用。如果容器中的 JavaServer Faces API 类是容器本身的一部分，而不是包含在 Web 应用程序内部，则调用此方法应该是 Web 应用程序终止过程的一部分。

Throws FacesException: 如果无法识别 Web 应用程序类加载器
英文文档：

releaseFactories

public static void releaseFactories()
                             throws FacesException

Release any references to factory instances associated with the class loader for the calling web application. This method should be called as apart of web application shutdown in a container where the JavaServer Faces API classes are part of the container itself, rather than being included inside the web application.

Throws:
FacesException - if the web application class loader cannot be identified
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FacesException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces
Class FacesException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbortProcessingException, ConverterException, EvaluationException, ValidatorException, ViewExpiredException
public class FacesException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException
Extended by: AbortProcessingException, ConverterException, EvaluationException, ValidatorException, ViewExpiredException

此类封装常规的 JavaServer Faces 异常。

英文文档：

This class encapsulates general JavaServer Faces exceptions.

See Also:
Serialized Form

Constructor Summary
FacesException()
Construct a new exception with no detail message or root cause.
FacesException(String message)
Construct a new exception with the specified detail message and no root cause.
FacesException(String message, Throwable cause)
Construct a new exception with the specified detail message and root cause.
FacesException(Throwable cause)
Construct a new exception with the specified root cause.
Method Summary
 Throwable getCause()
Return the cause of this exception, or null if the cause is nonexistent or unknown.
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public FacesException()

构造不带详细消息或根本原因的新异常。

英文文档：

FacesException

public FacesException()

Construct a new exception with no detail message or root cause.

public FacesException(String message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

FacesException

public FacesException(String message)

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public FacesException(Throwable cause)

构造带指定根本原因的新异常。详细消息将被设置为 (cause == null ? null :cause.toString()

cause 此异常的根本原因
英文文档：

FacesException

public FacesException(Throwable cause)

Construct a new exception with the specified root cause. The detail message will be set to (cause == null ? null : cause.toString()

Parameters:
cause - The root cause for this exception

public FacesException(String message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

FacesException

public FacesException(String message,
                      Throwable cause)

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Method Detail

public Throwable getCause()

返回此异常的 cause，如果 cause 不存在或未知，则返回 null。

英文文档：

getCause

public Throwable getCause()

Return the cause of this exception, or null if the cause is nonexistent or unknown.

Overrides:
getCause in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.application (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.application

APIs that are used to link an application's business logic objects to JavaServer Faces, as well as convenient pluggable mechanisms to manage the execution of an application that is based on JavaServer Faces.

See:
Description

Class Summary
Application | Application represents a per-web-application singleton object where applications based on JavaServer Faces (or implementations wishing to provide extended functionality) can register application-wide singletons that provide functionality required by JavaServer Faces.
ApplicationFactory | ApplicationFactory is a factory object that creates (if needed) and returns Application instances.
FacesMessage | FacesMessage represents a single validation (or other) message, which is typically associated with a particular component in the view.
FacesMessage.Severity | Class used to represent message severity levels in a typesafe enumeration.
NavigationHandler | A NavigationHandler is passed the outcome string returned by an application action invoked for this application, and will use this (along with related state information) to choose the view to be displayed next.
StateManager | StateManager directs the process of saving and restoring the view between requests.
StateManagerWrapper | Provides a simple implementation of StateManager that can be subclassed by developers wishing to provide specialized behavior to an existing StateManager instance.
ViewHandler | ViewHandler is the pluggablity mechanism for allowing implementations of or applications using the JavaServer Faces specification to provide their own handling of the activities in the Render Response and Restore View phases of the request processing lifecycle.
ViewHandlerWrapper | Provides a simple implementation of ViewHandler that can be subclassed by developers wishing to provide specialized behavior to an existing ViewHandler instance.

Exception Summary
ViewExpiredException Implementations must throw this FacesException when attempting to restore the view StateManager.restoreView(javax.faces.context.FacesContext, String, String) results in failure on postback.

Package javax.faces.application Description

APIs that are used to link an application's business logic objects to JavaServer Faces, as well as convenient pluggable mechanisms to manage the execution of an application that is based on JavaServer Faces. The main class in this package is Application.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.application Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.application

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.application.Application
    • javax.faces.application.ApplicationFactory
    • javax.faces.application.FacesMessage (implements java.io.Serializable)
    • javax.faces.application.FacesMessage.Severity (implements java.lang.Comparable<T>)
    • javax.faces.application.NavigationHandler
    • javax.faces.application.StateManager
      • javax.faces.application.StateManagerWrapper
    • javax.faces.application.StateManager.SerializedView
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.faces.FacesException
            • javax.faces.application.ViewExpiredException
    • javax.faces.application.ViewHandler
      • javax.faces.application.ViewHandlerWrapper
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Application (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.application
Class Application

java.lang.Object
    extended by  javax.faces.application.Application

public abstract class Application
extends Object

Application 表示每个 Web 应用程序单件对象，在这里基于 JavaServer Faces 的应用程序（或要提供扩展功能的实现）可以注册提供 JavaServer Faces 所需功能的应用程序级单件。在应用程序不选择自定义行为的情况下，提供每个对象的默认实现。

通过调用 ApplicationFactory 的 getApplication() 方法创建 Application 的实例。因为此实例是共享的，所以必须以线程安全的方式实现此实例。

该应用程序还作为在 Faces 配置文件中指定的若干个 Object 类型的工厂。请参见 Application#createComponent、Application#createConverter 和 Application#createValidator。

英文文档：

Application represents a per-web-application singleton object where applications based on JavaServer Faces (or implementations wishing to provide extended functionality) can register application-wide singletons that provide functionality required by JavaServer Faces. Default implementations of each object are provided for cases where the application does not choose to customize the behavior.

The instance of Application is created by calling the getApplication() method of ApplicationFactory. Because this instance is shared, it must be implemented in a thread-safe manner.

The application also acts as a factory for several types of Objects specified in the Faces Configuration file. Please see createComponent(java.lang.String), createConverter(java.lang.String), and createValidator(java.lang.String).

Constructor Summary
Application()
Method Summary
abstract  void addComponent(String componentType, String componentClass)
Register a new mapping of component type to the name of the corresponding UIComponent class.
abstract  void addConverter(Class targetClass, String converterClass)
Register a new converter class that is capable of performing conversions for the specified target class.
abstract  void addConverter(String converterId, String converterClass)
Register a new mapping of converter id to the name of the corresponding Converter class.
 void addELContextListener(ELContextListener listener)
Provide a way for Faces applications to register an ELContextListener that will be notified on creation of ELContext instances.
 void addELResolver(ELResolver resolver)
Cause an the argument resolver to be added to the resolver chain as specified in section 5.5.1 of the JavaServer Faces Specification.
abstract  void addValidator(String validatorId, String validatorClass)
Register a new mapping of validator id to the name of the corresponding Validator class.
abstract  UIComponent createComponent(String componentType)
Instantiate and return a new UIComponent instance of the class specified by a previous call to addComponent() for the specified component type.
abstract  UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType)
Deprecated. This has been replaced by createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String).
 UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType)
Call the getValue() method on the specified ValueExpression.
abstract  Converter createConverter(Class targetClass)
Instantiate and return a new Converter instance of the class that has registered itself as capable of performing conversions for objects of the specified type.
abstract  Converter createConverter(String converterId)
Instantiate and return a new Converter instance of the class specified by a previous call to addConverter() for the specified converter id.
abstract  MethodBinding createMethodBinding(String ref, Class[] params)
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]).
abstract  Validator createValidator(String validatorId)
Instantiate and return a new Validator instance of the class specified by a previous call to addValidator() for the specified validator id.
abstract  ValueBinding createValueBinding(String ref)
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class).
 Object evaluateExpressionGet(FacesContext context, String expression, Class expectedType)
Get a value by evaluating an expression.
abstract  ActionListener getActionListener()
Return the default ActionListener to be registered for all ActionSource components in this appication.
abstract  Iterator<String> getComponentTypes()
Return an Iterator over the set of currently defined component types for this Application.
abstract  Iterator<String> getConverterIds()
Return an Iterator over the set of currently registered converter ids for this Application.
abstract  Iterator<Class> getConverterTypes()
Return an Iterator over the set of Class instances for which Converter classes have been explicitly registered.
abstract  Locale getDefaultLocale()
Return the default Locale for this application.
abstract  String getDefaultRenderKitId()
Return the renderKitId to be used for rendering this application.
 ELContextListener[] getELContextListeners()
If no calls have been made to addELContextListener(javax.el.ELContextListener), this method must return an empty array.
 ELResolver getELResolver()
Return the singleton ELResolver instance to be used for all EL resolution.
 ExpressionFactory getExpressionFactory()
Return the ExpressionFactory instance for this application.
abstract  String getMessageBundle()
Return the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application.
abstract  NavigationHandler getNavigationHandler()
Return the NavigationHandler instance that will be passed the outcome returned by any invoked application action for this web application.
abstract  PropertyResolver getPropertyResolver()
Deprecated. This has been replaced by getELResolver().
 ResourceBundle getResourceBundle(FacesContext ctx, String name)
Find a ResourceBundle as defined in the application configuration resources under the specified name.
abstract  StateManager getStateManager()
Return the StateManager instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
abstract  Iterator<Locale> getSupportedLocales()
Return an Iterator over the supported Locales for this appication.
abstract  Iterator<String> getValidatorIds()
Return an Iterator over the set of currently registered validator ids for this Application.
abstract  VariableResolver getVariableResolver()
Deprecated. This has been replaced by getELResolver().
abstract  ViewHandler getViewHandler()
Return the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
 void removeELContextListener(ELContextListener listener)
Remove the argument listener from the list of ELContextListeners.
abstract  void setActionListener(ActionListener listener)
Set the default ActionListener to be registered for all ActionSource components.
abstract  void setDefaultLocale(Locale locale)
Set the default Locale for this application.
abstract  void setDefaultRenderKitId(String renderKitId)
Set the renderKitId to be used to render this application.
abstract  void setMessageBundle(String bundle)
Set the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application.
abstract  void setNavigationHandler(NavigationHandler handler)
Set the NavigationHandler instance that will be passed the outcome returned by any invoked application action for this web application.
abstract  void setPropertyResolver(PropertyResolver resolver)
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called addELResolver(javax.el.ELResolver).
abstract  void setStateManager(StateManager manager)
Set the StateManager instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
abstract  void setSupportedLocales(Collection<Locale> locales)
Set the Locale instances representing the supported Locales for this application.
abstract  void setVariableResolver(VariableResolver resolver)
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called addELResolver(javax.el.ELResolver).
abstract  void setViewHandler(ViewHandler handler)
Set the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Application()
英文文档：

Application

public Application()
Method Detail

abstract public ActionListener getActionListener()

返回要为此应用程序中所有 javax.faces.component.ActionSource 组件注册的默认 ActionListener。如果没有显式设置，则必须提供执行以下函数的默认实现 ：

  • processAction() 方法必须首先调用 FacesContext.renderResponse()，以便在该方法返回后，绕过任何干扰生命周期阶段。
  • processAction() 方法接着必须确定此事件的逻辑结果，如下所示：
    • 如果发起组件有非 null action 属性，则从属性中获取 MethodBinding 并对其调用 invoke()。将返回值（如果有）转换为 String，并将其用作逻辑结果。
    • 否则，逻辑结果为 null。
  • processAction() 方法最后必须获取此应用程序的 NavigationHandler 实例并调用 NavigationHandler#handleNavigation ，同时传递：
    • 当前请求的 FacesContext
    • 如果此组件的 action 属性具有 MethodBinding 实例，则传递对其调用 MethodBinding#getExpressionString 的结果，否则传递 null
    • 上面确定的逻辑结果

注意，默认 ActionListener 的规范继续要求使用过时的属性 (action) 和类 (MethodBinding)。不幸的是，这是必需的，因为默认 ActionListener 必须继续与没有实现 javax.faces.component.ActionSource2 而仅实现了 javax.faces.component.ActionSource 的组件一起使用。

英文文档：

getActionListener

public abstract ActionListener getActionListener()

Return the default ActionListener to be registered for all ActionSource components in this appication. If not explicitly set, a default implementation must be provided that performs the following functions:

  • The processAction() method must first call FacesContext.renderResponse() in order to bypass any intervening lifecycle phases, once the method returns.
  • The processAction() method must next determine the logical outcome of this event, as follows:
    • If the originating component has a non-null action property, retrieve the MethodBinding from the property, and call invoke() on it. Convert the returned value (if any) to a String, and use it as the logical outcome.
    • Otherwise, the logical outcome is null.
  • The processAction() method must finally retrieve the NavigationHandler instance for this application and call NavigationHandler.handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String) passing:
    • the FacesContext for the current request
    • If there is a MethodBinding instance for the action property of this component, the result of calling MethodBinding.getExpressionString() on it, null otherwise
    • the logical outcome as determined above

Note that the specification for the default ActionListener contiues to call for the use of a deprecated property (action) and class (MethodBinding). Unfortunately, this is necessary because the default ActionListener must continue to work with components that do not implement ActionSource2, and only implement ActionSource.

abstract public void setActionListener(ActionListener listener)

设置要为所有 javax.faces.component.ActionSource 组件注册的默认 ActionListener。

listener | 新的默认 ActionListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

setActionListener

public abstract void setActionListener(ActionListener listener)

Set the default ActionListener to be registered for all ActionSource components.

Parameters:
listener - The new default ActionListener
Throws:
NullPointerException - if listener is null

abstract public java.util.Locale getDefaultLocale()

返回此应用程序的默认 Locale。如果没有显式设置，则返回 null。

英文文档：

getDefaultLocale

public abstract Locale getDefaultLocale()

Return the default Locale for this application. If not explicitly set, null is returned.

abstract public void setDefaultLocale(java.util.Locale locale)

设置此应用程序的默认 Locale。

locale | 新的默认 Locale
Throws | NullPointerException: 如果 locale 为 null
英文文档：

setDefaultLocale

public abstract void setDefaultLocale(Locale locale)

Set the default Locale for this application.

Parameters:
locale - The new default Locale
Throws:
NullPointerException - if locale is null

abstract public String getDefaultRenderKitId()

返回要用于呈现此应用程序的 renderKitId。如果没有显式设置，则返回 null。

英文文档：

getDefaultRenderKitId

public abstract String getDefaultRenderKitId()

Return the renderKitId to be used for rendering this application. If not explicitly set, null is returned.

abstract public void setDefaultRenderKitId(String renderKitId)

设置要用于呈现此应用程序的 renderKitId。除非客户端已提供支持在同一应用程序中使用多个 javax.faces.render.RenderKit 实例的自定义 ViewHandler，否则只能在应用程序启动时，在处理任何 Faces 请求之前，调用此方法。这是当前规范的局限性，可能在以后的版本中得到改进。

英文文档：

setDefaultRenderKitId

public abstract void setDefaultRenderKitId(String renderKitId)

Set the renderKitId to be used to render this application. Unless the client has provided a custom ViewHandler that supports the use of multiple RenderKit instances in the same application, this method must only be called at application startup, before any Faces requests have been processed. This is a limitation of the current Specification, and may be lifted in a future release.

abstract public String getMessageBundle()

返回要用于此应用程序的 JavaServer Faces 消息的 ResourceBundle 的完全限定类名。如果没有显式设置，则返回 null。

英文文档：

getMessageBundle

public abstract String getMessageBundle()

Return the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application. If not explicitly set, null is returned.

abstract public void setMessageBundle(String bundle)

设置要用于此应用程序的 JavaServer Faces 消息的 ResourceBundle 的完全限定类名。有关资源包名称语法的更多信息，请参见 java.util.ResourceBundle 类的 JavaDocs。

bundle | 要使用的资源包的基本名称
Throws | NullPointerException: 如果 bundle 为 null
英文文档：

setMessageBundle

public abstract void setMessageBundle(String bundle)

Set the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application. See the JavaDocs for the java.util.ResourceBundle class for more information about the syntax for resource bundle names.

Parameters:
bundle - Base name of the resource bundle to be used
Throws:
NullPointerException - if bundle is null

abstract public NavigationHandler getNavigationHandler()

返回 NavigationHandler 实例，将向该实例传递此 Web 应用程序任何调用的应用程序操作返回的结果。如果没有显式设置，则必须提供执行 NavigationHandler 类描述中所述函数的默认实现。

英文文档：

getNavigationHandler

public abstract NavigationHandler getNavigationHandler()

Return the NavigationHandler instance that will be passed the outcome returned by any invoked application action for this web application. If not explicitly set, a default implementation must be provided that performs the functions described in the NavigationHandler class description.

abstract public void setNavigationHandler(NavigationHandler handler)

设置 NavigationHandler 实例，将向该实例传递此 Web 应用程序任何调用的应用程序操作返回的结果。

handler | 新 NavigationHandler 实例
Throws | NullPointerException: 如果 handler 为 null
英文文档：

setNavigationHandler

public abstract void setNavigationHandler(NavigationHandler handler)

Set the NavigationHandler instance that will be passed the outcome returned by any invoked application action for this web application.

Parameters:
handler - The new NavigationHandler instance
Throws:
NullPointerException - if handler is null

abstract public PropertyResolver getPropertyResolver()

返回包装 ELResolver 实例的 PropertyResolver 实例，Faces 将 ELResolver 实例提供给统一 EL，用于解析应用程序中以编程方式出现的表达式。

注意，这种情况不再返回默认 PropertyResolver，因为该类现在是帮助使自定义 PropertyResolver 影响 EL 解析过程的无操作 (no-op)。

deprecated 此方法已由 #getELResolver 替代。
英文文档：

getPropertyResolver

public abstract PropertyResolver getPropertyResolver()
Deprecated. This has been replaced by getELResolver().

Return a PropertyResolver instance that wraps the ELResolver instance that Faces provides to the unified EL for the resolution of expressions that appear programmatically in an application.

Note that this no longer returns the default PropertyResolver since that class is now a no-op that aids in allowing custom PropertyResolvers to affect the EL resolution process.

abstract public void setPropertyResolver(PropertyResolver resolver)

设置将用于解析方法和值绑定的 PropertyResolver 实例。

此方法现在已过时，但其实现必须使参数设置为遗留 PropertyResolver 链的头，替换在应用程序配置资源中设置的任何现有值。

应用程序从客户端收到请求后调用此方法是非法的。如果尝试在此之后注册侦听器，则没有任何效果。

resolver | 新 PropertyResolver 实例
Throws | NullPointerException: 如果 resolver 为 null
deprecated | 影响 EL 执行的建议方法是，在应用程序配置资源的正确位置提供 <el-resolver> 元素，这些资源将在正常的表达式求值过程中予以考虑。此方法现在将导致在 ELResolver 的实现中包装参数 resolver 并向 EL 解析系统公开，就像用户已调用 #addELResolver 一样。
Throws | IllegalStateException: 如果在处理了第一个对 javax.faces.webapp.FacesServlet 的请求之后调用。
英文文档：

setPropertyResolver

public abstract void setPropertyResolver(PropertyResolver resolver)
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called addELResolver(javax.el.ELResolver).

Set the PropertyResolver instance that will be utilized to resolve method and value bindings.

This method is now deprecated but the implementation must cause the argument to be set as the head of the legacy PropertyResolver chain, replacing any existing value that was set from the application configuration resources.

It is illegal to call this method after the application has received any requests from the client. If an attempt is made to register a listener after that time it must have no effect.

Parameters:
resolver - The new PropertyResolver instance
Throws:
NullPointerException - if resolver is null
IllegalStateException - if called after the first request to the FacesServlet has been serviced.

public java.util.ResourceBundle getResourceBundle(FacesContext ctx, String name)

查找在应用程序配置资源中以指定名称定义的 ResourceBundle。如果定义了该名称的 ResourceBundle，则返回使用当前 javax.faces.component.UIViewRoot 的语言环境的实例。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

return | 当前 UIViewRoot 的 ResourceBundle，否则返回 null
Throws | FacesException: 如果定义了包，但该包不可解析
Throws | NullPointerException: 如果 ctx == null || name == null
since | 1.2
英文文档：

getResourceBundle

public ResourceBundle getResourceBundle(FacesContext ctx,
                                        String name)

Find a ResourceBundle as defined in the application configuration resources under the specified name. If a ResourceBundle was defined for the name, return an instance that uses the locale of the current UIViewRoot.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Returns:
ResourceBundle for the current UIViewRoot, otherwise null
Throws:
FacesException - if a bundle was defined, but not resolvable
NullPointerException - if ctx == null || name == null
Since:
1.2

abstract public VariableResolver getVariableResolver()

返回包装 ELResolver 实例的 VariableResolver，Faces 将 ELResolver 实例提供给统一 EL，用于解析应用程序中以编程方式出现的表达式。VariableResolver 的实现必须将 null 作为基参数传递给在底层 ELResolver 上调用的任何方法。

注意，此方法不再返回默认 VariableResolver，因为该类现在是帮助使自定义 VariableResolver 影响 EL 解析过程的无操作。

deprecated 此方法已由 #getELResolver 替代。
英文文档：

getVariableResolver

public abstract VariableResolver getVariableResolver()
Deprecated. This has been replaced by getELResolver().

Return the VariableResolver that wraps the ELResolver instance that Faces provides to the unified EL for the resolution of expressions that appear programmatically in an application. The implementation of the VariableResolvermust pass null as the base argument for any methods invoked on the underlying ELResolver.

Note that this method no longer returns the default VariableResolver, since that class now is a no-op that aids in allowing custom VariableResolvers to affect the EL resolution process.

abstract public void setVariableResolver(VariableResolver resolver)

设置将用于解析方法和值绑定的 VariableResolver 实例。

此方法现在已过时，但其实现必须使参数设置为遗留 VariableResolver 链的头，替换在应用程序配置资源中设置的任何现有值。

应用程序从客户端收到请求后调用此方法是非法的。如果尝试在此之后注册侦听器，则没有任何效果。

resolver | 新 VariableResolver 实例
Throws | NullPointerException: 如果 resolver 为 null
deprecated | 影响 EL 执行的建议方法是，在应用程序配置资源的正确位置提供 <el-resolver> 元素， 这些资源将在正常的表达式求值过程中予以考虑。此方法现在将导致在 ELResolver 的实现中包装参数 resolver 并向 EL 解析系统公开，就像用户已调用 #addELResolver 一样。
Throws | IllegalStateException: 如果在处理了第一个对 javax.faces.webapp.FacesServlet 的请求之后调用。
英文文档：

setVariableResolver

public abstract void setVariableResolver(VariableResolver resolver)
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called addELResolver(javax.el.ELResolver).

Set the VariableResolver instance that will be consulted to resolve method and value bindings.

This method is now deprecated but the implementation must cause the argument to be set as the head of the legacy VariableResolver chain, replacing any existing value that was set from the application configuration resources.

It is illegal to call this method after the application has received any requests from the client. If an attempt is made to register a listener after that time it must have no effect.

Parameters:
resolver - The new VariableResolver instance
Throws:
NullPointerException - if resolver is null
IllegalStateException - if called after the first request to the FacesServlet has been serviced.

public void addELResolver(ELResolver resolver)

使参数 resolver 被添加到 JavaServer Faces 规范的 5.5.1 节中指定的解析器链。

在注册了 ELResolver 后，无法移除使用此方法注册的 ELResolver。

应用程序从客户端收到请求后注册 ELResolver 是非法的。如果尝试在此之后注册侦听器，则必定抛出 IllegalStateException。在链中除标准 ELResolver 外没有其他 ELResolver 的一般情况下，此限制可适当地使 JSP 容器得到优化。允许在初始化链中已存在的 CompositeELResolver 之前或之后添加 ELResolver。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展 Application 的现有应用程序。

since 1.2
英文文档：

addELResolver

public void addELResolver(ELResolver resolver)

Cause an the argument resolver to be added to the resolver chain as specified in section 5.5.1 of the JavaServer Faces Specification.

It is not possible to remove an ELResolver registered with this method, once it has been registered.

It is illegal to register an ELResolver after the application has received any requests from the client. If an attempt is made to register a listener after that time, an IllegalStateException must be thrown. This restriction is in place to allow the JSP container to optimize for the common case where no additional ELResolvers are in the chain, aside from the standard ones. It is permissible to add ELResolvers before or after initialization to a CompositeELResolver that is already in the chain.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend Application.

Since:
1.2

public ELResolver getELResolver()

返回要用于所有 EL 解析的单件 ELResolver 实例。这实际上是一个 javax.el.CompositeELResolver 实例，它必须按以下顺序包含下列 ELResolver 实例：

  1. 在应用程序配置资源中使用 <el-resolver> 元素声明的 ELResolver 实例。

  2. 根据规范文档第 5 章 VariableResolver ChainWrapper 一节所述，包装遗留 VariableResolver 链头的 implementation。

  3. 根据规范文档第 5 章 PropertyResolver ChainWrapper 一节所述，包装遗留 PropertyResolver 链头的 implementation。

  4. 通过调用 #addELResolver 添加的任何 ELResolver 实例。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展 Application 的现有应用程序。

since 1.2
英文文档：

getELResolver

public ELResolver getELResolver()

Return the singleton ELResolver instance to be used for all EL resolution. This is actually an instance of CompositeELResolver that must contain the following ELResolver instances in the following order:

  1. ELResolver instances declared using the <el-resolver> element in the application configuration resources.

  2. An implementation that wraps the head of the legacy VariableResolver chain, as per section VariableResolver ChainWrapper in Chapter 5 in the spec document.

  3. An implementation that wraps the head of the legacy PropertyResolver chain, as per section PropertyResolver ChainWrapper in Chapter 5 in the spec document.

  4. Any ELResolver instances added by calls to addELResolver(javax.el.ELResolver).

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend Application.

Since:
1.2

abstract public ViewHandler getViewHandler()

返回将在请求处理生命周期的恢复视图 和呈现响应 阶段使用的 ViewHandler 实例。如果没有显式设置，则必须提供执行 JavaServer Faces 规范中 ViewHandler 描述中所述函数的默认实现。

英文文档：

getViewHandler

public abstract ViewHandler getViewHandler()

Return the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle. If not explicitly set, a default implementation must be provided that performs the functions described in the ViewHandler description in the JavaServer Faces Specification.

abstract public void setViewHandler(ViewHandler handler)

设置将在请求处理生命周期的恢复视图 和呈现响应 阶段使用的 ViewHandler 实例。

handler | 新 ViewHandler 实例
Throws | IllegalStateException: 如果此应用程序的 Lifecycle 实例至少处理了一个请求后调用此方法。
Throws | NullPointerException: 如果 handler 为 null
英文文档：

setViewHandler

public abstract void setViewHandler(ViewHandler handler)

Set the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.

Parameters:
handler - The new ViewHandler instance
Throws:
IllegalStateException - if this method is called after at least one request has been processed by the Lifecycle instance for this application.
NullPointerException - if handler is null

abstract public StateManager getStateManager()

返回将在请求处理生命周期的恢复视图 和呈现响应 阶段使用的 StateManager 实例。如果没有显式设置，则必须提供执行 JavaServer Faces 规范中 StateManager 描述中所述函数的默认实现。

英文文档：

getStateManager

public abstract StateManager getStateManager()

Return the StateManager instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle. If not explicitly set, a default implementation must be provided that performs the functions described in the StateManager description in the JavaServer Faces Specification.

abstract public void setStateManager(StateManager manager)

设置将在请求处理生命周期的恢复视图 和呈现响应 阶段使用的 StateManager 实例。

manager | 新 StateManager 实例
Throws | IllegalStateException: 如果此应用程序的 Lifecycle 实例至少处理了一个请求后调用此方法。
Throws | NullPointerException: 如果 manager 为 null
英文文档：

setStateManager

public abstract void setStateManager(StateManager manager)

Set the StateManager instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.

Parameters:
manager - The new StateManager instance
Throws:
IllegalStateException - if this method is called after at least one request has been processed by the Lifecycle instance for this application.
NullPointerException - if manager is null

abstract public void addComponent(String componentType, String componentClass)

注册组件类型到相应 UIComponent 类名称的新映射。这使得后续对 createComponent() 的调用可作为 UIComponent 实例的工厂。

componentType | 要注册的组件类型
componentClass | 相应 UIComponent 实现的完全限定类名
Throws | NullPointerException: 如果 componentType 或 componentClass 为 null
英文文档：

addComponent

public abstract void addComponent(String componentType,
                                  String componentClass)

Register a new mapping of component type to the name of the corresponding UIComponent class. This allows subsequent calls to createComponent() to serve as a factory for UIComponent instances.

Parameters:
componentType - The component type to be registered
componentClass - The fully qualified class name of the corresponding UIComponent implementation
Throws:
NullPointerException - if componentType or componentClass is null

abstract public UIComponent createComponent(String componentType) throws FacesException

实例化并返回类的新 UIComponent 实例，该类是通过以前为指定组件类型调用 addComponent() 指定的。

componentType | 要为其创建并返回新 UIComponent 实例的组件类型
Throws | FacesException: 如果无法创建指定类型的 UIComponent
Throws | NullPointerException: 如果 componentType 为 null
英文文档：

createComponent

public abstract UIComponent createComponent(String componentType)
                                     throws FacesException

Instantiate and return a new UIComponent instance of the class specified by a previous call to addComponent() for the specified component type.

Parameters:
componentType - The component type for which to create and return a new UIComponent instance
Throws:
FacesException - if a UIComponent of the specified type cannot be created
NullPointerException - if componentType is null

abstract public UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType) throws FacesException

在 ValueExpression 的实现中包装参数 componentBinding 并调用 #createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String)。

componentBinding | 表示组件值绑定表达式（通常由自定义标记的 component 属性指定）的 ValueBinding
context | 当前请求的 FacesContext
componentType | 要创建的组件类型（如果 ValueBinding 没有返回组件实例）
Throws | FacesException: 如果无法创建 UIComponent
Throws | NullPointerException: 如果有参数为 null
deprecated | 此方法已由 #createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String) 替代。
英文文档：

createComponent

public abstract UIComponent createComponent(ValueBinding componentBinding,
                                            FacesContext context,
                                            String componentType)
                                     throws FacesException
Deprecated. This has been replaced by createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String).

Wrap the argument componentBinding in an implementation of ValueExpression and call through to createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String).

Parameters:
componentBinding - ValueBinding representing a component value binding expression (typically specified by the component attribute of a custom tag)
context - FacesContext for the current request
componentType - Component type to create if the ValueBinding does not return a component instance
Throws:
FacesException - if a UIComponent cannot be created
NullPointerException - if any parameter is null

public UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException

对指定的 ValueExpression 调用 getValue() 方法。如果它返回 UIComponent 实例，则将其作为此方法的值返回。如果它没有返回 UIComponent 实例，则实例化指定组件类型的新 UIComponent 实例，将新组件传递给指定 ValueExpression 的 setValue() 方法，然后将其作为此方法的值返回。

componentExpression | 表示组件值表达式（通常由自定义标记的 component 属性指定）的 ValueExpression
context | 当前请求的 FacesContext
componentType | 要创建的组件类型（如果 ValueExpression 没有返回组件实例）
Throws | FacesException: 如果无法创建 UIComponent
Throws | NullPointerException: 如果有参数为 null 提供一个抛出 UnsupportedOperationException 的默认实现，以便装饰 Application 的用户能够继续工作。 .
since | 1.2
英文文档：

createComponent

public UIComponent createComponent(ValueExpression componentExpression,
                                   FacesContext context,
                                   String componentType)
                            throws FacesException

Call the getValue() method on the specified ValueExpression. If it returns a UIComponent instance, return it as the value of this method. If it does not, instantiate a new UIComponent instance of the specified component type, pass the new component to the setValue() method of the specified ValueExpression, and return it.

Parameters:
componentExpression - ValueExpression representing a component value expression (typically specified by the component attribute of a custom tag)
context - FacesContext for the current request
componentType - Component type to create if the ValueExpression does not return a component instance
Throws:
FacesException - if a UIComponent cannot be created
NullPointerException - if any parameter is null

A default implementation is provided that throws UnsupportedOperationException so that users that decorate Application can continue to function

.
Since:
1.2

abstract public java.util.Iterator<E> getComponentTypes()

返回此 Application 当前定义的组件类型集合上的 Iterator。

英文文档：

getComponentTypes

public abstract Iterator<String> getComponentTypes()

Return an Iterator over the set of currently defined component types for this Application.

abstract public void addConverter(String converterId, String converterClass)

注册转换器 ID 到相应 Converter 类名称的新映射。这使得后续对 createConverter() 的调用可作为 Converter 实例的工厂。

converterId | 要注册的转换器 ID
converterClass | 相应 Converter 实现的完全限定类名
Throws | NullPointerException: 如果 converterId 或 converterClass 为 null
英文文档：

addConverter

public abstract void addConverter(String converterId,
                                  String converterClass)

Register a new mapping of converter id to the name of the corresponding Converter class. This allows subsequent calls to createConverter() to serve as a factory for Converter instances.

Parameters:
converterId - The converter id to be registered
converterClass - The fully qualified class name of the corresponding Converter implementation
Throws:
NullPointerException - if converterId or converterClass is null

abstract public void addConverter(Class<T> targetClass, String converterClass)

注册能够对指定目标类执行转换的新转换器类。

targetClass | 为其注册此转换器的类
converterClass | 相应 Converter 实现的完全限定类名
Throws | NullPointerException: 如果 targetClass 或 converterClass 为 null
英文文档：

addConverter

public abstract void addConverter(Class targetClass,
                                  String converterClass)

Register a new converter class that is capable of performing conversions for the specified target class.

Parameters:
targetClass - The class for which this converter is registered
converterClass - The fully qualified class name of the corresponding Converter implementation
Throws:
NullPointerException - if targetClass or converterClass is null

abstract public Converter createConverter(String converterId)

实例化并返回类的新 Converter 实例，该类是通过以前为指定转换器 ID 调用 addConverter() 指定的。如果此转换器 ID 没有这样的注册，则返回 null。

converterId | 要为其创建并返回新 Converter 实例的转换器 ID
Throws | FacesException: 如果无法创建 Converter
Throws | NullPointerException: 如果 converterId 为 null
英文文档：

createConverter

public abstract Converter createConverter(String converterId)

Instantiate and return a new Converter instance of the class specified by a previous call to addConverter() for the specified converter id. If there is no such registration for this converter id, return null.

Parameters:
converterId - The converter id for which to create and return a new Converter instance
Throws:
FacesException - if the Converter cannot be created
NullPointerException - if converterId is null

abstract public Converter createConverter(Class<T> targetClass)

实例化并返回类的新 Converter 实例，该类已将自身注册为可以为指定类型的对象执行转换。如果不能识别这样的 Converter 类，则返回 null。

要定位到适当的 Converter 类，执行以下算法，在找到适当的 Converter 类后停止：

  • 定位到为目标类本身注册的 Converter。
  • 定位到为目标类（直接或间接）实现的接口注册的 Converter。
  • 在继承层次结构中以递归方式定位到为目标类的超类（如果有）注册的 Converter。

如果 Converter 有一个接受 Class 的参数构造方法，则使用该构造方法实例化 Converter，同时将参数 targetClass 作为唯一参数传递。否则，只需使用不带参数的构造方法即可。

targetClass | 要为其返回 Converter 的目标类
Throws | FacesException: 如果无法创建 Converter
Throws | NullPointerException: 如果 targetClass 为 null
英文文档：

createConverter

public abstract Converter createConverter(Class targetClass)

Instantiate and return a new Converter instance of the class that has registered itself as capable of performing conversions for objects of the specified type. If no such Converter class can be identified, return null.

To locate an appropriate Converter class, the following algorithm is performed, stopping as soon as an appropriate Converter class is found:

  • Locate a Converter registered for the target class itself.
  • Locate a Converter registered for interfaces that are implemented by the target class (directly or indirectly).
  • Locate a Converter registered for the superclass (if any) of the target class, recursively working up the inheritance hierarchy.

If the Converter has a single argument constructor that accepts a Class, instantiate the Converter using that constructor, passing the argument targetClass as the sole argument. Otherwise, simply use the zero-argument constructor.

Parameters:
targetClass - Target class for which to return a Converter
Throws:
FacesException - if the Converter cannot be created
NullPointerException - if targetClass is null

abstract public java.util.Iterator<E> getConverterIds()

返回此 Application 当前注册的转换器 ID 集合上的 Iterator。

英文文档：

getConverterIds

public abstract Iterator<String> getConverterIds()

Return an Iterator over the set of currently registered converter ids for this Application.

abstract public java.util.Iterator<E> getConverterTypes()

返回已为其显式注册 Converter 类的 Class 实例集合上的 Iterator。

英文文档：

getConverterTypes

public abstract Iterator<Class> getConverterTypes()

Return an Iterator over the set of Class instances for which Converter classes have been explicitly registered.

public ExpressionFactory getExpressionFactory()

返回此应用程序的 ExpressionFactory 实例。此实例由便捷方法 #evaluateExpressionGet 使用。

此实现必须通过调用 JspFactory.getDefaultFactory().getJspApplicationContext(servletContext).getExpressionFactory() 从 JSP 容器返回 ExpressionFactory。

提供一个抛出 UnsupportedOperationException 的实现，以便装饰 Application 的用户能够继续工作。

since 1.2
英文文档：

getExpressionFactory

public ExpressionFactory getExpressionFactory()

Return the ExpressionFactory instance for this application. This instance is used by the convenience method evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class).

The implementation must return the ExpressionFactory from the JSP container by calling JspFactory.getDefaultFactory().getJspApplicationContext(servletContext).getExpressionFactory().

An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

Since:
1.2

public Object evaluateExpressionGet(FacesContext context, String expression, Class<T> expectedType) throws ELException

通过求表达式的值来获取值。

调用 #getExpressionFactory，然后调用 ExpressionFactory#createValueExpression，同时传递参数 expression 和 expectedType。调用 FacesContext#getELContext 并将其传递给 ValueExpression#getValue，同时返回结果。

提供一个抛出 UnsupportedOperationException 的实现，以便装饰 Application 的用户能够继续工作。

英文文档：

evaluateExpressionGet

public Object evaluateExpressionGet(FacesContext context,
                                    String expression,
                                    Class expectedType)
                             throws ELException

Get a value by evaluating an expression.

Call getExpressionFactory() then call ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class) passing the argument expression and expectedType. Call FacesContext.getELContext() and pass it to ValueExpression.getValue(javax.el.ELContext), returning the result.

An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

Throws:
ELException

abstract public MethodBinding createMethodBinding(String ref, Class<T>[] params) throws ReferenceSyntaxException

调用 #getExpressionFactory，然后调用 ExpressionFactory#createMethodExpression，同时传递给定参数，然后在 MethodBinding 实现中包装结果，同时返回结果。

ref | 为其返回 MethodBinding 实例的方法绑定表达式
params | 必须与要调用的方法的那些参数签名兼容的参数签名，或者对不带参数的方法而言，为长度为 0 的数组或 null
Throws | NullPointerException: 如果 ref 为 null
Throws | ReferenceSyntaxException: 如果指定的 ref 存在无效的语法
deprecated | 此方法已通过调用 #getExpressionFactory，然后调用 ExpressionFactory#createMethodExpression 替代。
英文文档：

createMethodBinding

public abstract MethodBinding createMethodBinding(String ref,
                                                  Class[] params)
                                           throws ReferenceSyntaxException
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]).

Call getExpressionFactory() then call ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]), passing the given arguments, and wrap the result in a MethodBinding implementation, returning it.

Parameters:
ref - Method binding expression for which to return a MethodBinding instance
params - Parameter signatures that must be compatible with those of the method to be invoked, or a zero-length array or null for a method that takes no parameters
Throws:
NullPointerException - if ref is null
ReferenceSyntaxException - if the specified ref has invalid syntax

abstract public java.util.Iterator<E> getSupportedLocales()

返回此应用程序支持的 Locale 上的 Iterator。

英文文档：

getSupportedLocales

public abstract Iterator<Locale> getSupportedLocales()

Return an Iterator over the supported Locales for this appication.

英文文档：

setSupportedLocales

public abstract void setSupportedLocales(Collection<Locale> locales)

Set the Locale instances representing the supported Locales for this application.

Parameters:
locales - The set of supported Locales for this application
Throws:
NullPointerException - if the argument newLocales is null.

public void addELContextListener(ELContextListener listener)

为 Faces 应用程序提供注册 ELContextListener 的方法，在创建 ELContext 实例时将通知此侦听器。每个请求只应调用此侦听器一次。

提供一个抛出 UnsupportedOperationException 的实现，以便装饰 Application 的用户能够继续工作。

since 1.2
英文文档：

addELContextListener

public void addELContextListener(ELContextListener listener)

Provide a way for Faces applications to register an ELContextListener that will be notified on creation of ELContext instances. This listener will be called once per request.

An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

Since:
1.2

public void removeELContextListener(ELContextListener listener)

从 ELContextListener 列表中移除参数 listener。如果 listener 为 null，则不抛出任何异常并且不执行任何操作。如果 listener 不在列表中，则不抛出任何异常并且不执行任何操作。

提供一个抛出 UnsupportedOperationException 的实现，以便装饰 Application 的用户能够继续工作。

since 1.2
英文文档：

removeELContextListener

public void removeELContextListener(ELContextListener listener)

Remove the argument listener from the list of ELContextListeners. If listener is null, no exception is thrown and no action is performed. If listener is not in the list, no exception is thrown and no action is performed.

An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

Since:
1.2

public ELContextListener[] getELContextListeners()

如果没有调用过 #addELContextListener，则此方法必须返回空数组。

否则，返回表示通过调用 #addELContextListener 添加的侦听器列表的数组。

提供一个抛出 UnsupportedOperationException 的实现，以便装饰 Application 的用户能够继续工作。

since 1.2
英文文档：

getELContextListeners

public ELContextListener[] getELContextListeners()

If no calls have been made to addELContextListener(javax.el.ELContextListener), this method must return an empty array.

Otherwise, return an array representing the list of listeners added by calls to addELContextListener(javax.el.ELContextListener).

An implementation is provided that throws UnsupportedOperationException so that users that decorate the Application continue to work.

Since:
1.2

abstract public void addValidator(String validatorId, String validatorClass)

注册验证器 ID 到相应 Validator 类名称的新映射。这使得后续对 createValidator() 的调用可作为 Validator 实例的工厂。

validatorId | 要注册的验证器 ID
validatorClass | 相应 Validator 实现的完全限定类名
Throws | NullPointerException: 如果 validatorId 或 validatorClass 为 null
英文文档：

addValidator

public abstract void addValidator(String validatorId,
                                  String validatorClass)

Register a new mapping of validator id to the name of the corresponding Validator class. This allows subsequent calls to createValidator() to serve as a factory for Validator instances.

Parameters:
validatorId - The validator id to be registered
validatorClass - The fully qualified class name of the corresponding Validator implementation
Throws:
NullPointerException - if validatorId or validatorClass is null

abstract public Validator createValidator(String validatorId) throws FacesException

实例化并返回类的新 Validator 实例，该类是通过以前为指定验证器 ID 调用 addValidator() 指定的。

validatorId | 要为其创建并返回新 Validator 实例的验证器 ID
Throws | FacesException: 如果无法创建指定 ID 的 Validator
Throws | NullPointerException: 如果 validatorId 为 null
英文文档：

createValidator

public abstract Validator createValidator(String validatorId)
                                   throws FacesException

Instantiate and return a new Validator instance of the class specified by a previous call to addValidator() for the specified validator id.

Parameters:
validatorId - The validator id for which to create and return a new Validator instance
Throws:
FacesException - if a Validator of the specified id cannot be created
NullPointerException - if validatorId is null

abstract public java.util.Iterator<E> getValidatorIds()

返回此 Application 当前注册的验证器 ID 集合上的 Iterator。

英文文档：

getValidatorIds

public abstract Iterator<String> getValidatorIds()

Return an Iterator over the set of currently registered validator ids for this Application.

abstract public ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException

调用 #getExpressionFactory，然后调用 ExpressionFactory#createValueExpression，同时传递参数 ref（为 expectedType 传递 Object.class，为 fnMapper 传递 null）。

ref | 要为其返回 ValueBinding 实例的值绑定表达式
Throws | NullPointerException: 如果 ref 为 null
Throws | ReferenceSyntaxException: 如果指定的 ref 存在无效的语法
deprecated | 此方法已通过调用 #getExpressionFactory，然后调用 ExpressionFactory#createValueExpression 替代。
英文文档：

createValueBinding

public abstract ValueBinding createValueBinding(String ref)
                                         throws ReferenceSyntaxException
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class).

Call getExpressionFactory() then call ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class), passing the argument ref, Object.class for the expectedType, and null, for the fnMapper.

Parameters:
ref - Value binding expression for which to return a ValueBinding instance
Throws:
NullPointerException - if ref is null
ReferenceSyntaxException - if the specified ref has invalid syntax
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ApplicationFactory (Java EE 5)

javax.faces.application
Class ApplicationFactory

java.lang.Object
    extended by  javax.faces.application.ApplicationFactory

public abstract class ApplicationFactory
extends Object

ApplicationFactory 是创建（如果需要）并返回 Application 实例的工厂对象。JavaServer Faces 的实现必须至少提供一个 Application 的默认实现。

使用 JavaServer Faces 的每个 Web 应用程序都必须有一个 ApplicationFactory 实例。可以通过可移植的方式获取此实例，即调用：

ApplicationFactory factory = (ApplicationFactory)
FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
英文文档：

ApplicationFactory is a factory object that creates (if needed) and returns Application instances. Implementations of JavaServer Faces must provide at least a default implementation of Application.

There must be one ApplicationFactory instance per web application that is utilizing JavaServer Faces. This instance can be acquired, in a portable manner, by calling:

   ApplicationFactory factory = (ApplicationFactory)
    FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);

Constructor Summary
ApplicationFactory()
Method Summary
abstract Application | getApplication() Create (if needed) and return an Application instance for this web application.
abstract void | setApplication(Application application) Replace the Application instance that will be returned for this web application.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ApplicationFactory()
英文文档：

ApplicationFactory

public ApplicationFactory()
Method Detail

abstract public Application getApplication()

创建（如果需要）并返回此 Web 应用程序的 Application 实例。

英文文档：

getApplication

public abstract Application getApplication()

Create (if needed) and return an Application instance for this web application.

abstract public void setApplication(Application application)

替换将为此 Web 应用程序返回的 Application 实例。

Throws | NullPointerException: 如果 application 为 null。
application | 替换 Application 实例
英文文档：

setApplication

public abstract void setApplication(Application application)

Replace the Application instance that will be returned for this web application.

Parameters:
application - The replacement Application instance
Throws:
NullPointerException - if application is null.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesMessage (Java EE 5)

javax.faces.application
Class FacesMessage

java.lang.Object
    extended by  javax.faces.application.FacesMessage
All Implemented Interfaces:
Serializable
public class FacesMessage
extends Object
implements Serializable

Implements: java.io.Serializable
Inner classes: FacesMessage.Severity

FacesMessage 表示单个验证（或其他）消息，通常与视图中的特定组件关联。可以基于特定的 messageId 创建 javax.faces.application.FacesMessage 实例。该规范定义必须有 javax.faces.application.FacesMessage 实例的 messageId 的集合。

创建给定 messageId 的 FacesMessage 实例时，该实现必须采用下列步骤：

    调用 Application#getMessageBundle。如果为非 null，则定位到命名的 ResourceBundle 同时使用当前 javax.faces.component.UIViewRoot 中的 Locale，并查看该 ResourceBundle 是否有参数 messageId 的值。如果有，则将该值视为 FacesMessage 的 summary。如果没有，或者 Application#getMessageBundle 返回了 null，则查找按常量 #FACES_MESSAGES 的值命名的 ResourceBundle，并查看它是否有参数 messageId 的值。如果有，则将该值视为 FacesMessage 的 summary。如果没有，则该 FacesMessage 实例没有初始化信息。

    在所有情况下，如果找到了该 {messageId} 的 ResourceBundle，则可以进一步在键 {messageId}_detail 下查找相应的 ResourceBundle。将此值（如果存在）用作返回的 FacesMessage 的 detail。

    确保执行 FacesMessage 的 summary 和 detail 所需的任何参数替换。

英文文档：

FacesMessage represents a single validation (or other) message, which is typically associated with a particular component in the view. A FacesMessage instance may be created based on a specific messageId. The specification defines the set of messageIds for which there must be FacesMessage instances.

The implementation must take the following steps when creating FacesMessage instances given a messageId:

    Call Application.getMessageBundle(). If non-null, locate the named ResourceBundle, using the Locale from the current UIViewRoot and see if it has a value for the argument messageId. If it does, treat the value as the summary of the FacesMessage. If it does not, or if Application.getMessageBundle() returned null, look in the ResourceBundle named by the value of the constant FACES_MESSAGES and see if it has a value for the argument messageId. If it does, treat the value as the summary of the FacesMessage. If it does not, there is no initialization information for the FacesMessage instance.

    In all cases, if a ResourceBundle hit is found for the {messageId}, look for further hits under the key {messageId}_detail. Use this value, if present, as the detail for the returned FacesMessage.

    Make sure to perform any parameter substitution required for the summary and detail of the FacesMessage.

See Also:
Serialized Form

Nested Class Summary
static class FacesMessage.Severity
Class used to represent message severity levels in a typesafe enumeration.
Field Summary
static String | FACES_MESSAGES ResourceBundle identifier for messages whose message identifiers are defined in the JavaServer Faces specification.
static FacesMessage.Severity | SEVERITY_ERROR Message severity level indicating that an error has occurred.
static FacesMessage.Severity | SEVERITY_FATAL Message severity level indicating that a serious error has occurred.
static FacesMessage.Severity | SEVERITY_INFO Message severity level indicating an informational message rather than an error.
static FacesMessage.Severity | SEVERITY_WARN Message severity level indicating that an error might have occurred.
static List | VALUES Immutable List of valid FacesMessage.Severity instances, in ascending order of their ordinal value.
static Map | VALUES_MAP Immutable Map of valid FacesMessage.Severity instances, keyed by name.
Constructor Summary
FacesMessage()
Construct a new FacesMessage with no initial values.
FacesMessage(FacesMessage.Severity severity, String summary, String detail)
Construct a new FacesMessage with the specified initial values.
FacesMessage(String summary)
Construct a new FacesMessage with just a summary.
FacesMessage(String summary, String detail)
Construct a new FacesMessage with the specified initial values.
Method Summary
String | getDetail() Return the localized detail text.
FacesMessage.Severity | getSeverity() Return the severity level.
String | getSummary() Return the localized summary text.
void | setDetail(String detail) Set the localized detail text.
void | setSeverity(FacesMessage.Severity severity) Set the severity level.
void | setSummary(String summary) Set the localized summary text.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

FACES_MESSAGES

public static final String FACES_MESSAGES

ResourceBundle identifier for messages whose message identifiers are defined in the JavaServer Faces specification.

See Also:
Constant Field Values

英文文档：

SEVERITY_INFO

public static final FacesMessage.Severity SEVERITY_INFO

Message severity level indicating an informational message rather than an error.

英文文档：

SEVERITY_WARN

public static final FacesMessage.Severity SEVERITY_WARN

Message severity level indicating that an error might have occurred.

英文文档：

SEVERITY_ERROR

public static final FacesMessage.Severity SEVERITY_ERROR

Message severity level indicating that an error has occurred.

英文文档：

SEVERITY_FATAL

public static final FacesMessage.Severity SEVERITY_FATAL

Message severity level indicating that a serious error has occurred.

英文文档：

VALUES

public static final List VALUES

Immutable List of valid FacesMessage.Severity instances, in ascending order of their ordinal value.

英文文档：

VALUES_MAP

public static final Map VALUES_MAP

Immutable Map of valid FacesMessage.Severity instances, keyed by name.

Constructor Detail

public FacesMessage()

构造无初始值的新 javax.faces.application.FacesMessage。严重性设置为 Severity.INFO。

英文文档：

FacesMessage

public FacesMessage()

Construct a new FacesMessage with no initial values. The severity is set to Severity.INFO.

public FacesMessage(String summary)

构造只有一个摘要的新 javax.faces.application.FacesMessage。详细信息为 null，严重性设置为 Severity.INFO。

英文文档：

FacesMessage

public FacesMessage(String summary)

Construct a new FacesMessage with just a summary. The detail is null, the severity is set to Severity.INFO.

public FacesMessage(String summary, String detail)

构造带指定初始值的新 javax.faces.application.FacesMessage。严重性设置为 Severity.INFO。

summary | 已本地化的摘要消息文本
detail | 已本地化的详细消息文本
Throws | IllegalArgumentException: 如果指定的严重性级别不是支持的值之一
英文文档：

FacesMessage

public FacesMessage(String summary,
                    String detail)

Construct a new FacesMessage with the specified initial values. The severity is set to Severity.INFO.

Parameters:
summary - Localized summary message text
detail - Localized detail message text
Throws:
IllegalArgumentException - if the specified severity level is not one of the supported values

public FacesMessage(FacesMessage.Severity severity, String summary, String detail)

构造带指定初始值的新 FacesMessage。

severity | 严重性
summary | 已本地化的摘要消息文本
detail | 已本地化的详细消息文本
Throws | IllegalArgumentException: 如果指定的严重性级别不是支持的值之一
英文文档：

FacesMessage

public FacesMessage(FacesMessage.Severity severity,
                    String summary,
                    String detail)

Construct a new FacesMessage with the specified initial values.

Parameters:
severity - the severity
summary - Localized summary message text
detail - Localized detail message text
Throws:
IllegalArgumentException - if the specified severity level is not one of the supported values
Method Detail

public String getDetail()

返回已本地化的详细文本。如果没有为此消息定义已本地化的详细文本，则返回已本地化的摘要文本。

英文文档：

getDetail

public String getDetail()

Return the localized detail text. If no localized detail text has been defined for this message, return the localized summary text instead.

public void setDetail(String detail)

设置已本地化的详细文本。

detail 新的已本地化的详细文本
英文文档：

setDetail

public void setDetail(String detail)

Set the localized detail text.

Parameters:
detail - The new localized detail text

public FacesMessage.Severity getSeverity()

返回严重性级别。

英文文档：

getSeverity

public FacesMessage.Severity getSeverity()

Return the severity level.

public void setSeverity(FacesMessage.Severity severity)

设置严重性级别。

severity | 新的严重性级别
Throws | IllegalArgumentException: 如果指定的严重性级别不是支持的值之一
英文文档：

setSeverity

public void setSeverity(FacesMessage.Severity severity)

Set the severity level.

Parameters:
severity - The new severity level
Throws:
IllegalArgumentException - if the specified severity level is not one of the supported values

public String getSummary()

返回已本地化的摘要文本。

英文文档：

getSummary

public String getSummary()

Return the localized summary text.

public void setSummary(String summary)

设置已本地化的摘要文本。

summary 新的已本地化的摘要文本
英文文档：

setSummary

public void setSummary(String summary)

Set the localized summary text.

Parameters:
summary - The new localized summary text
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesMessage.Severity (Java EE 5)

javax.faces.application
Class FacesMessage.Severity

java.lang.Object
    extended by  javax.faces.application.FacesMessage.Severity
All Implemented Interfaces:
Comparable
Enclosing class:
FacesMessage
public static class FacesMessage.Severity
extends Object
implements Comparable

Implements: Comparable<T>
Contained within: FacesMessage

用于在类型安全枚举中表示消息严重性级别的类。

英文文档：

Class used to represent message severity levels in a typesafe enumeration.

Method Summary
int | compareTo(Object other) Compare this FacesMessage.Severity instance to the specified one.
int | getOrdinal() Return the ordinal value of this FacesMessage.Severity instance.
String | toString() Return a String representation of this FacesMessage.Severity instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

public int compareTo(Object other)

将此 javax.faces.application.FacesMessage.Severity 实例与指定的实例进行比较。如果此对象小于、等于或大于指定对象，则返回负整数、0 或正整数。

other 要比较的另一个对象
英文文档：

compareTo

public int compareTo(Object other)

Compare this FacesMessage.Severity instance to the specified one. Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface Comparable
Parameters:
other - The other object to be compared to

public int getOrdinal()

返回此 FacesMessage.Severity 实例的序数值。

英文文档：

getOrdinal

public int getOrdinal()

Return the ordinal value of this FacesMessage.Severity instance.

public String toString()

返回此 FacesMessage.Severity 实例的 String 表示形式。

英文文档：

toString

public String toString()

Return a String representation of this FacesMessage.Severity instance.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NavigationHandler (Java EE 5)

javax.faces.application
Class NavigationHandler

java.lang.Object
    extended by  javax.faces.application.NavigationHandler

public abstract class NavigationHandler
extends Object

此应用程序调用的应用程序操作返回的结果字符串会传递给 NavigationHandler，它将使用此结果（以及相关的状态信息）选择接着显示的视图。

NavigationHandler 的默认实现必须由 JSF 实现提供，将一直使用此方法，除非调用 setNavigationHandler() 建立不同的实现。此默认实例将当前视图的视图标识符、指定的操作绑定和指定结果与 faces-config.xml 文件中提供的任何导航规则进行比较。如果有导航情况匹配，则将通过调用 FacesContext.setViewRoot() 更改当前视图。注意，null 结果值永远不会匹配任何导航规则，因此它可以用作指示符，指示应重新显示当前视图。

英文文档：

A NavigationHandler is passed the outcome string returned by an application action invoked for this application, and will use this (along with related state information) to choose the view to be displayed next.

A default implementation of NavigationHandler must be provided by the JSF implementation, which will be utilized unless setNavigationHandler() is called to establish a different one. This default instance will compare the view identifier of the current view, the specified action binding, and the specified outcome against any navigation rules provided in faces-config.xml file(s). If a navigation case matches, the current view will be changed by a call to FacesContext.setViewRoot(). Note that a null outcome value will never match any navigation rule, so it can be used as an indicator that the current view should be redisplayed.

Constructor Summary
NavigationHandler()
Method Summary
abstract  void handleNavigation(FacesContext context, String fromAction, String outcome)
Perform navigation processing based on the state information in the specified FacesContext, plus the outcome string returned by an executed application action.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public NavigationHandler()
英文文档：

NavigationHandler

public NavigationHandler()
Method Detail

abstract public void handleNavigation(FacesContext context, String fromAction, String outcome)

根据指定 FacesContext 中的状态信息以及已执行的应用程序操作返回的结果字符串执行导航处理。

context | 当前请求的 FacesContext
fromAction | 对其求值以获取指定结果的操作绑定表达式；如果通过其他方法获得结果，则为 null
outcome | 以前调用的应用程序操作返回的逻辑结果（可以为 null）
Throws | NullPointerException: 如果 context 为 null
英文文档：

handleNavigation

public abstract void handleNavigation(FacesContext context,
                                      String fromAction,
                                      String outcome)

Perform navigation processing based on the state information in the specified FacesContext, plus the outcome string returned by an executed application action.

Parameters:
context - The FacesContext for the current request
fromAction - The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means
outcome - The logical outcome returned by a previous invoked application action (which may be null)
Throws:
NullPointerException - if context is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StateManager (Java EE 5)

javax.faces.application
Class StateManager

java.lang.Object
    extended by  javax.faces.application.StateManager
Direct Known Subclasses:
StateManagerWrapper
public abstract class StateManager
extends Object

Inner classes: StateManager.SerializedView
Extended by: StateManagerWrapper

StateManager 指示在请求之间保存和恢复视图的过程。应用程序的 StateManager 实例是从 Application 实例中获取出的，因此无法了解用于呈现视图的 RenderKit 创建的标记语言的任何详细信息。StateManager 使用了帮助对象 (ResponseStateManager)，该帮助对象由 RenderKit 实现提供，因此知道标记语言的详细信息。

英文文档：

StateManager directs the process of saving and restoring the view between requests. The StateManager instance for an application is retrieved from the Application instance, and thus cannot know any details of the markup language created by the RenderKit being used to render a view. The StateManager utilizes a helper object (ResponseStateManager), that is provided by the RenderKit implementation and is therefore aware of the markup language details.

Nested Class Summary
 class StateManager.SerializedView
Deprecated. This class was not marked Serializable in the 1.0 version of the spec. It was also not a static inner class, so it can't be made to be Serializable. Therefore, it is being deprecated in version 1.2 of the spec. The replacement is to use an implementation dependent Object.
Field Summary
static String | STATE_SAVING_METHOD_CLIENT Constant value for the initialization parameter named by the STATE_SAVING_METHOD_PARAM_NAME that indicates state saving should take place on the client.
static String | STATE_SAVING_METHOD_PARAM_NAME The ServletContext init parameter consulted by the StateManager to tell where the state should be saved.
static String | STATE_SAVING_METHOD_SERVER Constant value for the initialization parameter named by the STATE_SAVING_METHOD_PARAM_NAME that indicates state saving should take place on the server.
Constructor Summary
StateManager()
Method Summary
protected  Object getComponentStateToSave(FacesContext context)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
protected  Object getTreeStructureToSave(FacesContext context)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
 boolean isSavingStateInClient(FacesContext context)
protected  void restoreComponentState(FacesContext context, UIViewRoot viewRoot, String renderKitId)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation does nothing.
protected  UIViewRoot restoreTreeStructure(FacesContext context, String viewId, String renderKitId)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
abstract  UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId)
Restore the tree structure and the component state of the view for the specified viewId, in an implementation dependent manner, and return the restored UIViewRoot.
 StateManager.SerializedView saveSerializedView(FacesContext context)
Deprecated. this has been replaced by saveView(javax.faces.context.FacesContext). The default implementation returns null.
 Object saveView(FacesContext context)
Return an opaque Object containing sufficient information for this same instance to restore the state of the current UIViewRoot on a subsequent request.
 void writeState(FacesContext context, Object state)
Save the state represented in the specified state Object instance, in an implementation dependent manner.
 void writeState(FacesContext context, StateManager.SerializedView state)
Deprecated. This method has been replaced by writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

STATE_SAVING_METHOD_PARAM_NAME

public static final String STATE_SAVING_METHOD_PARAM_NAME

The ServletContext init parameter consulted by the StateManager to tell where the state should be saved. Valid values are given as the values of the constants: STATE_SAVING_METHOD_CLIENT or STATE_SAVING_METHOD_SERVER.

If this parameter is not specified, the default value is the value of the constant STATE_SAVING_METHOD_CLIENT.

See Also:
Constant Field Values

英文文档：

STATE_SAVING_METHOD_CLIENT

public static final String STATE_SAVING_METHOD_CLIENT

Constant value for the initialization parameter named by the STATE_SAVING_METHOD_PARAM_NAME that indicates state saving should take place on the client.

See Also:
Constant Field Values

英文文档：

STATE_SAVING_METHOD_SERVER

public static final String STATE_SAVING_METHOD_SERVER

Constant value for the initialization parameter named by the STATE_SAVING_METHOD_PARAM_NAME that indicates state saving should take place on the server.

See Also:
Constant Field Values
Constructor Detail

public StateManager()
英文文档：

StateManager

public StateManager()
Method Detail

public StateManager.SerializedView saveSerializedView(FacesContext context)

将指定 FacesContext 实例中包含的视图的树结构和组件状态信息作为类型为 StateManager.SerializedView 的对象返回。如果没有保存任何状态信息，则返回 null。

通过将其 transient 属性设置为 true，组件可以选择不被包含在序列化视图中。这将导致在保存的树结构和组件状态信息中省略组件本身以及该组件的所有子组件和 facet。

此方法还必须执行以下规则：对于带有非 null id 的组件，所有属于最接近的相同 NamingContainer 的后代的组件都必须具有唯一的标识符。

context | 当前请求的 FacesContext
Throws | IllegalStateException: 如果此视图中的相同 NamingContainer 内的多个组件或 facet 具有相同的非 null 组件 ID
deprecated | 此方法已由 #saveView 替代。默认实现返回 null。
英文文档：

saveSerializedView

public StateManager.SerializedView saveSerializedView(FacesContext context)
Deprecated. this has been replaced by saveView(javax.faces.context.FacesContext). The default implementation returns null.

Return the tree structure and component state information for the view contained in the specified FacesContext instance as an object of type StateManager.SerializedView. If there is no state information to be saved, return null instead.

Components may opt out of being included in the serialized view by setting their transient property to true. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved tree structure and component state information.

This method must also enforce the rule that, for components with non-null ids, all components that are descendants of the same nearest NamingContainer must have unique identifiers.

Parameters:
context - FacesContext for the current request
Throws:
IllegalStateException - if more than one component or facet within the same NamingContainer in this view has the same non-null component id

public Object saveView(FacesContext context)

返回包含此相同实例的足够信息的透明 Object，以便在后续请求中恢复当前 UIViewRoot 的状态。返回的对象必须实现 java.io.Serializable。如果没有保存任何状态信息，则返回 null。

通过将其 transient 属性设置为 true，组件可以选择不被包含在序列化视图中。这将导致在保存的树结构和组件状态信息中省略组件本身以及该组件的所有子组件和 facet。

此方法还必须执行以下规则：对于带有非 null id 的组件，所有属于最接近的相同 NamingContainer 的后代的组件都必须具有唯一的标识符。

为与现有的 StateManager 实现向后兼容，此方法的默认实现调用 #saveSerializedView，并创建和返回包含两个元素的 Object 数组，其中元素 0 包含 structure 属性，而元素 1 包含 SerializedView 的 state 属性。

context | 当前请求的 FacesContext
Throws | IllegalStateException: 如果此视图中的相同 NamingContainer 内的多个组件或 facet 具有相同的非 null 组件 ID
since | 1.2
英文文档：

saveView

public Object saveView(FacesContext context)

Return an opaque Object containing sufficient information for this same instance to restore the state of the current UIViewRoot on a subsequent request. The returned object must implement java.io.Serializable. If there is no state information to be saved, return null instead.

Components may opt out of being included in the serialized view by setting their transient property to true. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved tree structure and component state information.

This method must also enforce the rule that, for components with non-null ids, all components that are descendants of the same nearest NamingContainer must have unique identifiers.

For backwards compatability with existing StateManager implementations, the default implementation of this method calls saveSerializedView(javax.faces.context.FacesContext) and creates and returns a two element Object array with element zero containing the structure property and element one containing the state property of the SerializedView.

Parameters:
context - FacesContext for the current request
Throws:
IllegalStateException - if more than one component or facet within the same NamingContainer in this view has the same non-null component id
Since:
1.2

protected Object getTreeStructureToSave(FacesContext context)

必须由 saveSerializedView() 调用的便捷方法构造并返回 Serializable 对象，该对象表示此视图的整个组件树（包括子组件和 facet）的结构。

通过将其 transient 属性设置为 true，组件可以选择不被包含在树结构中。这必将导致在保存的树结构信息中省略组件本身以及该组件的所有子组件和 facet。

context | 当前请求的 FacesContext
deprecated | 树结构和组件状态的区别现在属于实现详细信息。默认实现返回 null。
英文文档：

getTreeStructureToSave

protected Object getTreeStructureToSave(FacesContext context)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.

Convenience method, which must be called by saveSerializedView(), to construct and return a Serializable object that represents the structure of the entire component tree (including children and facets) of this view.

Components may opt-out of being included in the tree structure by setting their transient property to true. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved tree structure information.

Parameters:
context - FacesContext for the current request

protected Object getComponentStateToSave(FacesContext context)

必须由 saveSerializedView() 调用的便捷方法构造并返回 Serializable 对象，该对象表示此视图的整个组件树（包括子组件和 facet）的所有组件属性和连接对象的状态。

通过将其 transient 属性设置为 true，组件可以选择不被包含在组件状态中。这必将导致在保存的组件状态信息中省略组件本身以及该组件的所有子组件和 facet。

context | 当前请求的 FacesContext
deprecated | 树结构和组件状态的区别现在属于实现详细信息。默认实现返回 null。
英文文档：

getComponentStateToSave

protected Object getComponentStateToSave(FacesContext context)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.

Convenience method, which must be called by saveSerializedView(), to construct and return a Serializable object that represents the state of all component properties, attributes, and attached objects, for the entire component tree (including children and facets) of this view.

Components may opt-out of being included in the component state by setting their transient property to true. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved component state information.

Parameters:
context - FacesContext for the current request

public void writeState(FacesContext context, Object state) throws java.io.IOException

以与实现相关的方式保存指定状态 Object 实例中表示的状态。

此方法通常只将实际写入操作委托给 ResponseStateManager 实例的 writeState() 方法，该实例由用于呈现此视图的 RenderKit 提供。此方法假设调用者已经将 ResponseWriter 放在正确的地方，以写入保存的状态。

为与现有的 StateManager 实现向后兼容，此方法的默认实现会检查参数是否是长度超过或等于二的 Object [] 的实例。如果是，它将创建一个 SerializedView 实例，其中树结构来自元素 0，而组件状态来自元素 1，并调用 #writeState(javax.faces.context.FacesContext,javax.faces.application.StateManager.SerializedView)。如果不是，则不执行任何操作。

context | 当前请求的 FacesContext
state | 要写入的 Serializable 状态，由 #saveSerializedView 返回
since | 1.2
英文文档：

writeState

public void writeState(FacesContext context,
                       Object state)
                throws IOException

Save the state represented in the specified state Object instance, in an implementation dependent manner.

This method will typically simply delegate the actual writing to the writeState() method of the ResponseStateManager instance provided by the RenderKit being used to render this view. This method assumes that the caller has positioned the ResponseWriter at the correct position for the saved state to be written.

For backwards compatability with existing StateManager implementations, the default implementation of this method checks if the argument is an instance of Object [] of length greater than or equal to two. If so, it creates a SerializedView instance with the tree structure coming from element zero and the component state coming from element one and calls through to writeState(javax.faces.context.FacesContext,javax.faces.application.StateManager.SerializedView). If not, does nothing.

Parameters:
context - FacesContext for the current request
state - the Serializable state to be written, as returned by saveSerializedView(javax.faces.context.FacesContext)
Throws:
IOException
Since:
1.2

public void writeState(FacesContext context, StateManager.SerializedView state) throws java.io.IOException

以与实现相关的方式保存指定 SerializedView 实例中表示的状态。

此方法必须参考符号常量 StateManager.STATE_SAVING_METHOD_PARAMETER_NAME 指定的上下文初始化参数来确定状态应保存在客户端还是服务器上。如果不存在，则假定为客户端状态保存。

如果 init 参数指示应使用客户端状态保存，则此方法必须将实际写入操作委托给 ResponseStateManager 实例的 writeState() 方法，该实例由用于呈现此视图的 RenderKit 提供。此方法假设调用者已经将 ResponseWriter 放在正确的地方，以写入保存的状态。

context | 当前请求的 FacesContext
state | 要写入的序列化状态
deprecated | 此方法已由 #writeState(javax.faces.context.FacesContext,java.lang.Object) 替代。此方法的默认实现不执行任何操作。
英文文档：

writeState

public void writeState(FacesContext context,
                       StateManager.SerializedView state)
                throws IOException
Deprecated. This method has been replaced by writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.

Save the state represented in the specified SerializedView isntance, in an implementation dependent manner.

This method must consult the context initialization parameter named by the symbolic constant StateManager.STATE_SAVING_METHOD_PARAMETER_NAME to determine whether state should be saved on the client or the server. If not present, client side state saving is assumed.

If the init parameter indicates that client side state saving should be used, this method must delegate the actual writing to the writeState() method of the ResponseStateManager instance provided by the RenderKit being used to render this view. This method assumes that the caller has positioned the ResponseWriter at the correct position for the saved state to be written.

Parameters:
context - FacesContext for the current request
state - the serialized state to be written
Throws:
IOException

abstract public UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId)

以与实现相关的方式恢复指定 viewId 的视图的树结构和组件状态，并返回已恢复的 UIViewRoot。如果此 viewId 没有可用的保存的状态信息，则返回 null。

此方法必须参考符号常量 StateManager.STATE_SAVING_METHOD_PARAMETER_NAME 指定的上下文初始化参数来确定状态应保存在客户端还是服务器上。如果不存在，则假定为客户端状态保存。

如果 init 参数指示应使用客户端状态保存，则此方法必须调用 ResponseStateManager 实例的 getTreeStructureToRestore() 和（如果以前的方法调用返回了非 null 值）getComponentStateToRestore() 方法，该实例由负责此视图的 RenderKit 提供。

context | 当前请求的 FacesContext
viewId | 要恢复的视图的视图标识符
renderKitId | 用于呈现此响应的 renderKitId。不得为 null。
Throws | IllegalArgumentException: 如果 renderKitId 为 null。
英文文档：

restoreView

public abstract UIViewRoot restoreView(FacesContext context,
                                       String viewId,
                                       String renderKitId)

Restore the tree structure and the component state of the view for the specified viewId, in an implementation dependent manner, and return the restored UIViewRoot. If there is no saved state information available for this viewId, return null instead.

This method must consult the context initialization parameter named by the symbolic constant StateManager.STATE_SAVING_METHOD_PARAMETER_NAME to determine whether state should be saved on the client or the server. If not present, client side state saving is assumed.

If the init parameter indicates that client side state saving should be used, this method must call the getTreeStructureToRestore() and (if the previous method call returned a non-null value) getComponentStateToRestore() methods of the ResponseStateManager instance provided by the RenderKit responsible for this view.

Parameters:
context - FacesContext for the current request
viewId - View identifier of the view to be restored
renderKitId - the renderKitId used to render this response. Must not be null.
Throws:
IllegalArgumentException - if renderKitId is null.

protected UIViewRoot restoreTreeStructure(FacesContext context, String viewId, String renderKitId)

必须由 restoreView() 调用的便捷方法，用于构造和返回 UIViewRoot 实例（填充有子实例和 facet），该实例表示正在恢复的组件树的树结构。如果没有可用的保存的状态信息，则返回 null。

context | 当前请求的 FacesContext
viewId | 要恢复的视图的视图标识符
renderKitId | 用于呈现此响应的 renderKitId。不得为 null。
Throws | IllegalArgumentException: 如果 renderKitId 为 null。
deprecated | 树结构和组件状态的区别现在属于实现详细信息。默认实现返回 null。
英文文档：

restoreTreeStructure

protected UIViewRoot restoreTreeStructure(FacesContext context,
                                          String viewId,
                                          String renderKitId)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.

Convenience method, which must be called by restoreView(), to construct and return a UIViewRoot instance (populated with children and facets) representing the tree structure of the component tree being restored. If no saved state information is available, return null instead.

Parameters:
context - FacesContext for the current request
viewId - View identifier of the view to be restored
renderKitId - the renderKitId used to render this response. Must not be null.
Throws:
IllegalArgumentException - if renderKitId is null.

protected void restoreComponentState(FacesContext context, UIViewRoot viewRoot, String renderKitId)

必须由 restoreView() 调用的便捷方法，用于恢复已恢复组件树中所有组件的属性和连接对象。

context | 当前请求的 FacesContext
viewRoot | 以前调用 restoreTreeStructure() 返回的 UIViewRoot
renderKitId | 用于呈现此响应的 renderKitId。不得为 null。
Throws | IllegalArgumentException: 如果 renderKitId 为 null。
deprecated | 树结构和组件状态的区别现在属于实现详细信息。默认实现不执行任何操作。
英文文档：

restoreComponentState

protected void restoreComponentState(FacesContext context,
                                     UIViewRoot viewRoot,
                                     String renderKitId)
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation does nothing.

Convenience method, which must be called by restoreView(), to restore the attributes, properties, and attached objects of all components in the restored component tree.

Parameters:
context - FacesContext for the current request
viewRoot - UIViewRoot returned by a previous call to restoreTreeStructure()
renderKitId - the renderKitId used to render this response. Must not be null.
Throws:
IllegalArgumentException - if renderKitId is null.

public boolean isSavingStateInClient(FacesContext context)
return | 当且仅当常量 #STATE_SAVING_METHOD_PARAM_NAME 的值指定的 ServletContext init 参数的值等于常量 #STATE_SAVING_METHOD_CLIENT 的值时，返回 true。否则，返回 false。
Throws | NullPointerException: 如果 context 为 null。
英文文档：

isSavingStateInClient

public boolean isSavingStateInClient(FacesContext context)
Returns:
true if and only if the value of the ServletContext init parameter named by the value of the constant STATE_SAVING_METHOD_PARAM_NAME is equal to the value of the constant STATE_SAVING_METHOD_CLIENT. false otherwise.
Throws:
NullPointerException - if context is null.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StateManager.SerializedView (Java EE 5)

javax.faces.application
Class StateManager.SerializedView

java.lang.Object
    extended by  javax.faces.application.StateManager.SerializedView
Enclosing class:
StateManager
Deprecated. This class was not marked Serializable in the 1.0 version of the spec. It was also not a static inner class, so it can't be made to be Serializable. Therefore, it is being deprecated in version 1.2 of the spec. The replacement is to use an implementation dependent Object.

Contained within: StateManager

封装树结构和组件状态的便捷 struct。这对于 API 能够足够灵活地适应 JSP 和非 JSP 环境非常必要。

deprecated 此类在规范 1.0 版中没有标记为 Serializable。它也不是静态内部类，因此它不能成为 Serializable。因此，它在规范 1.2 版中已过时。已使用与实现相关的 Object 将其替代。
英文文档：

public class StateManager.SerializedView
extends Object

Convenience struct for encapsulating tree structure and component state. This is necessary to allow the API to be flexible enough to work in JSP and non-JSP environments.

Constructor Summary
StateManager.SerializedView(Object newStructure, Object newState)
Deprecated.
Method Summary
Object | getState() Deprecated.
Object | getStructure() Deprecated.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public StateManager.SerializedView(Object newStructure, Object newState)
英文文档：

StateManager.SerializedView

public StateManager.SerializedView(Object newStructure,
                                   Object newState)
Deprecated.
Method Detail

public Object getStructure()
英文文档：

getStructure

public Object getStructure()
Deprecated.

public Object getState()
英文文档：

getState

public Object getState()
Deprecated.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StateManagerWrapper (Java EE 5)

javax.faces.application
Class StateManagerWrapper

java.lang.Object
    extended by  javax.faces.application.StateManager
        extended by  javax.faces.application.StateManagerWrapper

public abstract class StateManagerWrapper
extends StateManager

Extends: StateManager

提供 StateManager 的简单实现，开发人员可为其创建子类为现有 StateManager 实例提供专门行为。所有方法的默认实现是调用包装的 StateManager。

用法：扩展此类并重写 #getWrapped，以返回正在包装的实例。

since 1.2
英文文档：

Provides a simple implementation of StateManager that can be subclassed by developers wishing to provide specialized behavior to an existing StateManager instance. The default implementation of all methods is to call through to the wrapped StateManager.

Usage: extend this class and override getWrapped() to return the instance we are wrapping.

Since:
1.2

Nested Class Summary
Nested classes/interfaces inherited from class javax.faces.application.StateManager
StateManager.SerializedView
Field Summary
Fields inherited from class javax.faces.application.StateManager
STATE_SAVING_METHOD_CLIENT, STATE_SAVING_METHOD_PARAM_NAME, STATE_SAVING_METHOD_SERVER
Constructor Summary
StateManagerWrapper()
Method Summary
protected  Object getComponentStateToSave(FacesContext context)
The default behavior of this method is to call StateManager.getComponentStateToSave(javax.faces.context.FacesContext) on the wrapped StateManager object.
protected  Object getTreeStructureToSave(FacesContext context)
The default behavior of this method is to call StateManager.getTreeStructureToSave(javax.faces.context.FacesContext) on the wrapped StateManager object.
protected abstract  StateManager getWrapped()
 boolean isSavingStateInClient(FacesContext context)
The default behavior of this method is to call StateManager.isSavingStateInClient(javax.faces.context.FacesContext) on the wrapped StateManager object.
protected  void restoreComponentState(FacesContext context, UIViewRoot viewRoot, String renderKitId)
The default behavior of this method is to call StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String) on the wrapped StateManager object.
protected  UIViewRoot restoreTreeStructure(FacesContext context, String viewId, String renderKitId)
The default behavior of this method is to call StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String) on the wrapped StateManager object.
 UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId)
The default behavior of this method is to call StateManager.restoreView(javax.faces.context.FacesContext, String, String) on the wrapped StateManager object.
 StateManager.SerializedView saveSerializedView(FacesContext context)
The default behavior of this method is to call StateManager.saveSerializedView(javax.faces.context.FacesContext) on the wrapped StateManager object.
 Object saveView(FacesContext context)
The default behavior of this method is to call StateManager.saveView(javax.faces.context.FacesContext) on the wrapped StateManager object.
 void writeState(FacesContext context, Object state)
The default behavior of this method is to call StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object) on the wrapped StateManager object.
 void writeState(FacesContext context, StateManager.SerializedView state)
The default behavior of this method is to call StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView) on the wrapped StateManager object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public StateManagerWrapper()
英文文档：

StateManagerWrapper

public StateManagerWrapper()
Method Detail

abstract protected StateManager getWrapped()
return 正在包装的实例。
英文文档：

getWrapped

protected abstract StateManager getWrapped()
Returns:
the instance that we are wrapping.

public StateManager.SerializedView saveSerializedView(FacesContext context)

此方法的默认行为是调用包装的 StateManager 对象上的 saveSerializedView(javax.faces.context.FacesContext)。

since | 1.2
See also | saveSerializedView(javax.faces.context.FacesContext)
英文文档：

saveSerializedView

public StateManager.SerializedView saveSerializedView(FacesContext context)

The default behavior of this method is to call StateManager.saveSerializedView(javax.faces.context.FacesContext) on the wrapped StateManager object.

Overrides:
saveSerializedView in class StateManager
Parameters:
context - FacesContext for the current request
Since:
1.2
See Also:
StateManager.saveSerializedView(javax.faces.context.FacesContext)

public Object saveView(FacesContext context)

此方法的默认行为是调用包装的 StateManager 对象上的 saveView(javax.faces.context.FacesContext)。

since | 1.2
See also | saveView(javax.faces.context.FacesContext)
英文文档：

saveView

public Object saveView(FacesContext context)

The default behavior of this method is to call StateManager.saveView(javax.faces.context.FacesContext) on the wrapped StateManager object.

Overrides:
saveView in class StateManager
Parameters:
context - FacesContext for the current request
Since:
1.2
See Also:
StateManager.saveView(javax.faces.context.FacesContext)

protected Object getTreeStructureToSave(FacesContext context)

此方法的默认行为是调用包装的 StateManager 对象上的 getTreeStructureToSave(javax.faces.context.FacesContext)。

since | 1.2
See also | getTreeStructureToSave(javax.faces.context.FacesContext)
英文文档：

getTreeStructureToSave

protected Object getTreeStructureToSave(FacesContext context)

The default behavior of this method is to call StateManager.getTreeStructureToSave(javax.faces.context.FacesContext) on the wrapped StateManager object.

Overrides:
getTreeStructureToSave in class StateManager
Parameters:
context - FacesContext for the current request
Since:
1.2
See Also:
StateManager.getTreeStructureToSave(javax.faces.context.FacesContext)

protected Object getComponentStateToSave(FacesContext context)

此方法的默认行为是调用包装的 StateManager 对象上的 getComponentStateToSave(javax.faces.context.FacesContext)。

since | 1.2
See also | getComponentStateToSave(javax.faces.context.FacesContext)
英文文档：

getComponentStateToSave

protected Object getComponentStateToSave(FacesContext context)

The default behavior of this method is to call StateManager.getComponentStateToSave(javax.faces.context.FacesContext) on the wrapped StateManager object.

Overrides:
getComponentStateToSave in class StateManager
Parameters:
context - FacesContext for the current request
Since:
1.2
See Also:
StateManager.getComponentStateToSave(javax.faces.context.FacesContext)

public void writeState(FacesContext context, Object state) throws java.io.IOException

此方法的默认行为是调用包装的 StateManager 对象上的 writeState(javax.faces.context.FacesContext, java.lang.Object)。

since | 1.2
See also | writeState(javax.faces.context.FacesContext, java.lang.Object)
英文文档：

writeState

public void writeState(FacesContext context,
                       Object state)
                throws IOException

The default behavior of this method is to call StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object) on the wrapped StateManager object.

Overrides:
writeState in class StateManager
Parameters:
context - FacesContext for the current request
state - the Serializable state to be written, as returned by StateManager.saveSerializedView(javax.faces.context.FacesContext)
Throws:
IOException
Since:
1.2
See Also:
StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)

public void writeState(FacesContext context, StateManager.SerializedView state) throws java.io.IOException

此方法的默认行为是调用包装的 StateManager 对象上的 writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)。

since | 1.2
See also | writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)
英文文档：

writeState

public void writeState(FacesContext context,
                       StateManager.SerializedView state)
                throws IOException

The default behavior of this method is to call StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView) on the wrapped StateManager object.

Overrides:
writeState in class StateManager
Parameters:
context - FacesContext for the current request
state - the serialized state to be written
Throws:
IOException
Since:
1.2
See Also:
StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)

public UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId)

此方法的默认行为是调用包装的 StateManager 对象上的 restoreView(javax.faces.context.FacesContext, String, String)。

since | 1.2
See also | restoreView(javax.faces.context.FacesContext, String, String)
英文文档：

restoreView

public UIViewRoot restoreView(FacesContext context,
                              String viewId,
                              String renderKitId)

The default behavior of this method is to call StateManager.restoreView(javax.faces.context.FacesContext, String, String) on the wrapped StateManager object.

Specified by:
restoreView in class StateManager
Parameters:
context - FacesContext for the current request
viewId - View identifier of the view to be restored
renderKitId - the renderKitId used to render this response. Must not be null.
Since:
1.2
See Also:
StateManager.restoreView(javax.faces.context.FacesContext, String, String)

protected UIViewRoot restoreTreeStructure(FacesContext context, String viewId, String renderKitId)

此方法的默认行为是调用包装的 StateManager 对象上的 restoreTreeStructure(javax.faces.context.FacesContext, String, String)。

since | 1.2
See also | restoreTreeStructure(javax.faces.context.FacesContext, String, String)
英文文档：

restoreTreeStructure

protected UIViewRoot restoreTreeStructure(FacesContext context,
                                          String viewId,
                                          String renderKitId)

The default behavior of this method is to call StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String) on the wrapped StateManager object.

Overrides:
restoreTreeStructure in class StateManager
Parameters:
context - FacesContext for the current request
viewId - View identifier of the view to be restored
renderKitId - the renderKitId used to render this response. Must not be null.
Since:
1.2
See Also:
StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String)

protected void restoreComponentState(FacesContext context, UIViewRoot viewRoot, String renderKitId)

此方法的默认行为是调用包装的 StateManager 对象上的 restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)}。

since | 1.2
See also | restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)
英文文档：

restoreComponentState

protected void restoreComponentState(FacesContext context,
                                     UIViewRoot viewRoot,
                                     String renderKitId)

The default behavior of this method is to call StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String) on the wrapped StateManager object.

Overrides:
restoreComponentState in class StateManager
Parameters:
context - FacesContext for the current request
viewRoot - UIViewRoot returned by a previous call to restoreTreeStructure()
renderKitId - the renderKitId used to render this response. Must not be null.
Since:
1.2
See Also:
StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)

public boolean isSavingStateInClient(FacesContext context)

此方法的默认行为是调用包装的 StateManager 对象上的 isSavingStateInClient(javax.faces.context.FacesContext)。

since | 1.2
See also | isSavingStateInClient(javax.faces.context.FacesContext)
英文文档：

isSavingStateInClient

public boolean isSavingStateInClient(FacesContext context)

The default behavior of this method is to call StateManager.isSavingStateInClient(javax.faces.context.FacesContext) on the wrapped StateManager object.

Overrides:
isSavingStateInClient in class StateManager
Returns:
true if and only if the value of the ServletContext init parameter named by the value of the constant StateManager.STATE_SAVING_METHOD_PARAM_NAME is equal to the value of the constant StateManager.STATE_SAVING_METHOD_CLIENT. false otherwise.
Since:
1.2
See Also:
StateManager.isSavingStateInClient(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ViewHandler (Java EE 5)

javax.faces.application
Class ViewHandler

java.lang.Object
    extended by  javax.faces.application.ViewHandler
Direct Known Subclasses:
ViewHandlerWrapper
public abstract class ViewHandler
extends Object

Extended by: ViewHandlerWrapper

ViewHandler 提供一种可插入机制，允许使用 JavaServer Faces 规范的实现或应用程序提供它们自己对请求处理生命周期的呈现响应 和恢复视图 阶段活动的处理。这使实现可以支持不同的响应生成技术，以及保存和恢复每个视图状态的备用策略。

有关 ViewHandler 如何与 StateManager 交互的信息，请参见 StateManager。

英文文档：

ViewHandler is the pluggablity mechanism for allowing implementations of or applications using the JavaServer Faces specification to provide their own handling of the activities in the Render Response and Restore View phases of the request processing lifecycle. This allows for implementations to support different response generation technologies, as well as alternative strategies for saving and restoring the state of each view.

Please see StateManager for information on how the ViewHandler interacts the StateManager.

Field Summary
static String | CHARACTER_ENCODING_KEY The key, in the session's attribute set, under which the response character encoding may be stored and retrieved.
static String | DEFAULT_SUFFIX The value to use for the default extension if the webapp is using url extension mapping.
static String | DEFAULT_SUFFIX_PARAM_NAME Allow the web application to define an alternate suffix for pages containing JSF content.
Constructor Summary
ViewHandler()
Method Summary
 String calculateCharacterEncoding(FacesContext context)
Returns the correct character encoding to be used for this request.
abstract  Locale calculateLocale(FacesContext context)
Returns an appropriate Locale to use for this and subsequent requests for the current client.
abstract  String calculateRenderKitId(FacesContext context)
Return an appropriate renderKitId for this and subsequent requests from the current client.
abstract  UIViewRoot createView(FacesContext context, String viewId)
Create and return a new UIViewRoot instance initialized with information from the argument FacesContext and viewId.
abstract  String getActionURL(FacesContext context, String viewId)
Return a URL suitable for rendering (after optional encoding performed by the encodeActionURL() method of ExternalContext) that selects the specified view identifier.
abstract  String getResourceURL(FacesContext context, String path)
Return a URL suitable for rendering (after optional encoding perfomed by the encodeResourceURL() method of ExternalContext) that selects the specifed web application resource.
 void initView(FacesContext context)
Initialize the view for the request processing lifecycle.
abstract  void renderView(FacesContext context, UIViewRoot viewToRender)
Perform whatever actions are required to render the response view to the response object associated with the current FacesContext.
abstract  UIViewRoot restoreView(FacesContext context, String viewId)
Perform whatever actions are required to restore the view associated with the specified FacesContext and viewId.
abstract  void writeState(FacesContext context)
Take any appropriate action to either immediately write out the current state information (by calling StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object), or noting where state information should later be written.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CHARACTER_ENCODING_KEY

public static final String CHARACTER_ENCODING_KEY

The key, in the session's attribute set, under which the response character encoding may be stored and retrieved.

See Also:
Constant Field Values

英文文档：

DEFAULT_SUFFIX_PARAM_NAME

public static final String DEFAULT_SUFFIX_PARAM_NAME

Allow the web application to define an alternate suffix for pages containing JSF content. If this init parameter is not specified, the default value is taken from the value of the constant DEFAULT_SUFFIX.

See Also:
Constant Field Values

英文文档：

DEFAULT_SUFFIX

public static final String DEFAULT_SUFFIX

The value to use for the default extension if the webapp is using url extension mapping.

See Also:
Constant Field Values
Constructor Detail

public ViewHandler()
英文文档：

ViewHandler

public ViewHandler()
Method Detail

abstract public java.util.Locale calculateLocale(FacesContext context)

返回用于当前客户端该请求和后续请求的相应 Locale。

context | 当前请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

calculateLocale

public abstract Locale calculateLocale(FacesContext context)

Returns an appropriate Locale to use for this and subsequent requests for the current client.

Parameters:
context - FacesContext for the current request
Throws:
NullPointerException - if context is null

public String calculateCharacterEncoding(FacesContext context)

返回用于此请求的正确字符编码。

使用以下算法。

  • 检查 Content-Type 请求头。如果它有 charset 参数，则将其提取并作为编码返回。

  • 如果未找到 charset 参数，则通过调用 getSession(boolean) 同时将 false 作为参数传递来检查会话是否存在。如果该方法返回 true，则通过调用 ExternalContext#getSessionMap 获取会话 Map，并查找符号常量 ViewHandler#CHARACTER_ENCODING_KEY 的值给定的该键下的值。如果存在，则返回该值（该值已转换为 String）。

  • 否则，返回 null。

英文文档：

calculateCharacterEncoding

public String calculateCharacterEncoding(FacesContext context)

Returns the correct character encoding to be used for this request.

The following algorithm is employed.

  • Examine the Content-Type request header. If it has a charset parameter, extract it and return that as the encoding.

  • If no charset parameter was found, check for the existence of a session by calling ExternalContext.getSession(boolean) passing false as the argument. If that method returns true, get the session Map by calling ExternalContext.getSessionMap() and look for a value under the key given by the value of the symbolic constant CHARACTER_ENCODING_KEY. If present, return the value, converted to String.

  • Otherwise, return null

abstract public String calculateRenderKitId(FacesContext context)

返回当前客户端的该请求和后续请求的相应 renderKitId。此方法返回 null 是错误的。

默认返回值为 javax.faces.render.RenderKitFactory#HTML_BASIC_RENDER_KIT。

context | 当前请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

calculateRenderKitId

public abstract String calculateRenderKitId(FacesContext context)

Return an appropriate renderKitId for this and subsequent requests from the current client. It is an error for this method to return null.

The default return value is RenderKitFactory.HTML_BASIC_RENDER_KIT.

Parameters:
context - FacesContext for the current request
Throws:
NullPointerException - if context is null

abstract public UIViewRoot createView(FacesContext context, String viewId)

创建并返回使用参数 FacesContext 和 viewId 中的信息初始化的新 UIViewRoot 实例。

如果该 FacesContext 中存在现有的 ViewRoot，则此方法必须将其 locale 和 renderKitId 复制到此新视图根。如果不存在，则此方法必须调用 #calculateLocale 和 #calculateRenderKitId，并将结果分别存储为新建的 UIViewRoot 的 locale 和 renderKitId 属性的值。

Throws NullPointerException: 如果 context 为 null
英文文档：

createView

public abstract UIViewRoot createView(FacesContext context,
                                      String viewId)

Create and return a new UIViewRoot instance initialized with information from the argument FacesContext and viewId.

If there is an existing ViewRoot available on the FacesContext, this method must copy its locale and renderKitId to this new view root. If not, this method must call calculateLocale(javax.faces.context.FacesContext) and calculateRenderKitId(javax.faces.context.FacesContext), and store the results as the values of the locale and renderKitId, proeprties, respectively, of the newly created UIViewRoot.

Throws:
NullPointerException - if context is null

abstract public String getActionURL(FacesContext context, String viewId)

返回选择指定视图标识符且适于呈现的 URL（ExternalContext 的 encodeActionURL() 方法执行可选编码后）。

context | 此请求的 FacesContext
viewId | 所需视图的视图标识符
Throws | IllegalArgumentException: 如果 viewId 对此 ViewHandler 无效。
Throws | NullPointerException: 如果 context 或 viewId 为 null。
英文文档：

getActionURL

public abstract String getActionURL(FacesContext context,
                                    String viewId)

Return a URL suitable for rendering (after optional encoding performed by the encodeActionURL() method of ExternalContext) that selects the specified view identifier.

Parameters:
context - FacesContext for this request
viewId - View identifier of the desired view
Throws:
IllegalArgumentException - if viewId is not valid for this ViewHandler.
NullPointerException - if context or viewId is null.

abstract public String getResourceURL(FacesContext context, String path)

返回选择指定 Web 应用程序资源且适于呈现的 URL（ExternalContext 的 encodeResourceURL() 方法执行可选编码后）。如果指定的路径以斜杠开头，则必须将其视作上下文相关；否则，必须将其视作与当前视图的操作 URL 相关。

context | 当前请求的 FacesContext
path | 要转换为 URL 的资源路径
Throws | IllegalArgumentException: 如果 viewId 对此 ViewHandler 无效。
Throws | NullPointerException: 如果 context 或 path 为 null。
英文文档：

getResourceURL

public abstract String getResourceURL(FacesContext context,
                                      String path)

Return a URL suitable for rendering (after optional encoding perfomed by the encodeResourceURL() method of ExternalContext) that selects the specifed web application resource. If the specified path starts with a slash, it must be treated as context relative; otherwise, it must be treated as relative to the action URL of the current view.

Parameters:
context - FacesContext for the current request
path - Resource path to convert to a URL
Throws:
IllegalArgumentException - if viewId is not valid for this ViewHandler.
NullPointerException - if context or path is null.

public void initView(FacesContext context) throws FacesException

初始化请求处理生命周期的视图。

此方法必须在请求处理生命周期的恢复视图阶段 的开始调用。它负责执行任何对生命周期操作必要的每个请求的初始化。

默认实现调用 #calculateCharacterEncoding 并将结果（如果为非 null）传入 ExternalContext#setRequestCharacterEncoding 方法。

Throws FacesException: 如果设置编码时发生问题，例如编码不受支持时，底层 Servlet 或 Portlet 技术抛出的 UnsupportedEncodingException。
英文文档：

initView

public void initView(FacesContext context)
              throws FacesException

Initialize the view for the request processing lifecycle.

This method must be called at the beginning of the Restore View Phase of the Request Processing Lifecycle. It is responsible for performing any per-request initialization necessary to the operation of the lifycecle.

The default implementation calls calculateCharacterEncoding(javax.faces.context.FacesContext) and passes the result, if non-null into the ExternalContext.setRequestCharacterEncoding(java.lang.String) method.

Throws:
FacesException - if a problem occurs setting the encoding, such as the UnsupportedEncodingException thrown by the underlying Servlet or Portlet technology when the encoding is not supported.

abstract public void renderView(FacesContext context, UIViewRoot viewToRender) throws java.io.IOException, FacesException

执行所需的任何操作以将响应视图呈现给与当前 FacesContext 关联的响应对象。

context | 当前请求的 FacesContext
viewToRender | 要呈现的视图
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 context 或 viewToRender 为 null
Throws | FacesException: 如果发生 servlet 错误
英文文档：

renderView

public abstract void renderView(FacesContext context,
                                UIViewRoot viewToRender)
                         throws IOException,
                                FacesException

Perform whatever actions are required to render the response view to the response object associated with the current FacesContext.

Parameters:
context - FacesContext for the current request
viewToRender - the view to render
Throws:
IOException - if an input/output error occurs
NullPointerException - if context or viewToRender is null
FacesException - if a servlet error occurs

abstract public UIViewRoot restoreView(FacesContext context, String viewId)

执行所需的任何操作以恢复与指定 FacesContext 和 viewId 关联的视图。可以委托给关联的 StateManager 的 restoreView 来执行恢复视图的实际工作。如果没有可用的指定 viewId 的状态，则返回 null。

context | 当前请求的 FacesContext
viewId | 当前请求的视图标识符
Throws | NullPointerException: 如果 context 为 null
Throws | FacesException: 如果发生 servlet 错误
英文文档：

restoreView

public abstract UIViewRoot restoreView(FacesContext context,
                                       String viewId)

Perform whatever actions are required to restore the view associated with the specified FacesContext and viewId. It may delegate to the restoreView of the associated StateManager to do the actual work of restoring the view. If there is no available state for the specified viewId, return null.

Parameters:
context - FacesContext for the current request
viewId - the view identifier for the current request
Throws:
NullPointerException - if context is null
FacesException - if a servlet error occurs

abstract public void writeState(FacesContext context) throws java.io.IOException

采取任何适当的操作立即写出当前的状态信息（通过调用 StateManager#writeState），或注明稍后应写出状态信息的位置。

context | 当前请求的 FacesContext
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 context 为 null
英文文档：

writeState

public abstract void writeState(FacesContext context)
                         throws IOException

Take any appropriate action to either immediately write out the current state information (by calling StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object), or noting where state information should later be written.

Parameters:
context - FacesContext for the current request
Throws:
IOException - if an input/output error occurs
NullPointerException - if context is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ViewHandlerWrapper (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.application
Class ViewHandlerWrapper

java.lang.Object
    extended by  javax.faces.application.ViewHandler
        extended by  javax.faces.application.ViewHandlerWrapper

public abstract class ViewHandlerWrapper
extends ViewHandler

Extends: ViewHandler

提供 ViewHandler 的简单实现，开发人员可为其创建子类为现有 ViewHandler 实例提供专门行为。所有方法的默认实现是调用包装的 ViewHandler。

用法：扩展此类并重写 #getWrapped，以返回正在包装的实例。

since 1.2
英文文档：

Provides a simple implementation of ViewHandler that can be subclassed by developers wishing to provide specialized behavior to an existing ViewHandler instance. The default implementation of all methods is to call through to the wrapped ViewHandler.

Usage: extend this class and override getWrapped() to return the instance we are wrapping.

Since:
1.2

Field Summary
Fields inherited from class javax.faces.application.ViewHandler
CHARACTER_ENCODING_KEY, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME
Constructor Summary
ViewHandlerWrapper()
Method Summary
 String calculateCharacterEncoding(FacesContext context)
The default behavior of this method is to call ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
 Locale calculateLocale(FacesContext context)
The default behavior of this method is to call ViewHandler.calculateLocale(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
 String calculateRenderKitId(FacesContext context)
The default behavior of this method is to call ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
 UIViewRoot createView(FacesContext context, String viewId)
The default behavior of this method is to call ViewHandler.createView(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
 String getActionURL(FacesContext context, String viewId)
The default behavior of this method is to call ViewHandler.getActionURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
 String getResourceURL(FacesContext context, String path)
The default behavior of this method is to call ViewHandler.getResourceURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
protected abstract  ViewHandler getWrapped()
 void initView(FacesContext context)
The default behavior of this method is to call ViewHandler.initView(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
 void renderView(FacesContext context, UIViewRoot viewToRender)
The default behavior of this method is to call ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot) on the wrapped ViewHandler object.
 UIViewRoot restoreView(FacesContext context, String viewId)
The default behavior of this method is to call ViewHandler.restoreView(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
 void writeState(FacesContext context)
The default behavior of this method is to call ViewHandler.writeState(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ViewHandlerWrapper()
英文文档：

ViewHandlerWrapper

public ViewHandlerWrapper()
Method Detail

abstract protected ViewHandler getWrapped()
return 正在包装的实例。
英文文档：

getWrapped

protected abstract ViewHandler getWrapped()
Returns:
the instance that we are wrapping.

public String calculateCharacterEncoding(FacesContext context)

此方法的默认行为是调用包装的 ViewHandler 对象上的 calculateCharacterEncoding(javax.faces.context.FacesContext)。

since | 1.2
See also | calculateCharacterEncoding(javax.faces.context.FacesContext)
英文文档：

calculateCharacterEncoding

public String calculateCharacterEncoding(FacesContext context)

The default behavior of this method is to call ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext) on the wrapped ViewHandler object.

Overrides:
calculateCharacterEncoding in class ViewHandler
Since:
1.2
See Also:
ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext)

public java.util.Locale calculateLocale(FacesContext context)

此方法的默认行为是调用包装的 ViewHandler 对象上的 calculateLocale(javax.faces.context.FacesContext)。

since | 1.2
See also | calculateLocale(javax.faces.context.FacesContext)
英文文档：

calculateLocale

public Locale calculateLocale(FacesContext context)

The default behavior of this method is to call ViewHandler.calculateLocale(javax.faces.context.FacesContext) on the wrapped ViewHandler object.

Specified by:
calculateLocale in class ViewHandler
Parameters:
context - FacesContext for the current request
Since:
1.2
See Also:
ViewHandler.calculateLocale(javax.faces.context.FacesContext)

public String calculateRenderKitId(FacesContext context)

此方法的默认行为是调用包装的 ViewHandler 对象上的 calculateRenderKitId(javax.faces.context.FacesContext)。

since | 1.2
See also | calculateRenderKitId(javax.faces.context.FacesContext)
英文文档：

calculateRenderKitId

public String calculateRenderKitId(FacesContext context)

The default behavior of this method is to call ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext) on the wrapped ViewHandler object.

Specified by:
calculateRenderKitId in class ViewHandler
Parameters:
context - FacesContext for the current request
Since:
1.2
See Also:
ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext)

public UIViewRoot createView(FacesContext context, String viewId)

此方法的默认行为是调用包装的 ViewHandler 对象上的 createView(javax.faces.context.FacesContext, String)。

since | 1.2
See also | createView(javax.faces.context.FacesContext, String)
英文文档：

createView

public UIViewRoot createView(FacesContext context,
                             String viewId)

The default behavior of this method is to call ViewHandler.createView(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.

Specified by:
createView in class ViewHandler
Since:
1.2
See Also:
ViewHandler.createView(javax.faces.context.FacesContext, String)

public String getActionURL(FacesContext context, String viewId)

此方法的默认行为是调用包装的 ViewHandler 对象上的 getActionURL(javax.faces.context.FacesContext, String)。

since | 1.2
See also | getActionURL(javax.faces.context.FacesContext, String)
英文文档：

getActionURL

public String getActionURL(FacesContext context,
                           String viewId)

The default behavior of this method is to call ViewHandler.getActionURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.

Specified by:
getActionURL in class ViewHandler
Parameters:
context - FacesContext for this request
viewId - View identifier of the desired view
Since:
1.2
See Also:
ViewHandler.getActionURL(javax.faces.context.FacesContext, String)

public String getResourceURL(FacesContext context, String path)

此方法的默认行为是调用包装的 ViewHandler 对象上的 getResourceURL(javax.faces.context.FacesContext, String)。

since | 1.2
See also | getResourceURL(javax.faces.context.FacesContext, String)
英文文档：

getResourceURL

public String getResourceURL(FacesContext context,
                             String path)

The default behavior of this method is to call ViewHandler.getResourceURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.

Specified by:
getResourceURL in class ViewHandler
Parameters:
context - FacesContext for the current request
path - Resource path to convert to a URL
Since:
1.2
See Also:
ViewHandler.getResourceURL(javax.faces.context.FacesContext, String)

public void initView(FacesContext context) throws FacesException

此方法的默认行为是调用包装的 ViewHandler 对象上的 ViewHandler#initView。

since | 1.2
See also | initView
英文文档：

initView

public void initView(FacesContext context)
              throws FacesException

The default behavior of this method is to call ViewHandler.initView(javax.faces.context.FacesContext) on the wrapped ViewHandler object.

Overrides:
initView in class ViewHandler
Throws:
FacesException - if a problem occurs setting the encoding, such as the UnsupportedEncodingException thrown by the underlying Servlet or Portlet technology when the encoding is not supported.
Since:
1.2
See Also:
ViewHandler.initView(javax.faces.context.FacesContext)

public void renderView(FacesContext context, UIViewRoot viewToRender) throws java.io.IOException, FacesException

此方法的默认行为是调用包装的 ViewHandler 对象上的 renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)。

since | 1.2
See also | renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
英文文档：

renderView

public void renderView(FacesContext context,
                       UIViewRoot viewToRender)
                throws IOException,
                       FacesException

The default behavior of this method is to call ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot) on the wrapped ViewHandler object.

Specified by:
renderView in class ViewHandler
Parameters:
context - FacesContext for the current request
viewToRender - the view to render
Throws:
IOException - if an input/output error occurs
FacesException - if a servlet error occurs
Since:
1.2
See Also:
ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)

public UIViewRoot restoreView(FacesContext context, String viewId)

此方法的默认行为是调用包装的 ViewHandler 对象上的 restoreView(javax.faces.context.FacesContext, String)。

since | 1.2
See also | restoreView(javax.faces.context.FacesContext, String)
英文文档：

restoreView

public UIViewRoot restoreView(FacesContext context,
                              String viewId)

The default behavior of this method is to call ViewHandler.restoreView(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.

Specified by:
restoreView in class ViewHandler
Parameters:
context - FacesContext for the current request
viewId - the view identifier for the current request
Since:
1.2
See Also:
ViewHandler.restoreView(javax.faces.context.FacesContext, String)

public void writeState(FacesContext context) throws java.io.IOException

此方法的默认行为是调用包装的 ViewHandler 对象上的 writeState(javax.faces.context.FacesContext)。

since | 1.2
See also | writeState(javax.faces.context.FacesContext)
英文文档：

writeState

public void writeState(FacesContext context)
                throws IOException

The default behavior of this method is to call ViewHandler.writeState(javax.faces.context.FacesContext) on the wrapped ViewHandler object.

Specified by:
writeState in class ViewHandler
Parameters:
context - FacesContext for the current request
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ViewHandler.writeState(javax.faces.context.FacesContext)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ViewExpiredException (Java EE 5)

javax.faces.application
Class ViewExpiredException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.application.ViewExpiredException
All Implemented Interfaces:
Serializable
public class ViewExpiredException
extends FacesException

Extends: Throwable > Exception > RuntimeException > FacesException

当尝试恢复视图 restoreView(javax.faces.context.FacesContext, String, String) 导致回发失败时，实现必须抛出此 FacesException。

since 1.2
英文文档：

Implementations must throw this FacesException when attempting to restore the view StateManager.restoreView(javax.faces.context.FacesContext, String, String) results in failure on postback.

Since:
1.2
See Also:
Serialized Form

Constructor Summary
ViewExpiredException()
Construct a new exception with no detail message or root cause.
ViewExpiredException(String viewId)
Construct a new exception with the specified view identifier.
ViewExpiredException(String message, String viewId)
Construct a new exception with the specified detail message and no root cause.
ViewExpiredException(String message, Throwable cause, String viewId)
Construct a new exception with the specified detail message and root cause.
ViewExpiredException(Throwable cause, String viewId)
Construct a new exception with the specified root cause.
Method Summary
String | getMessage() Return the message for this exception prepended with the view identifier if the view identifier is not null, otherwise, return the message.
String | getViewId() Return the view identifier of this exception, or null if the view identifier is nonexistent or unknown.
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, 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

public ViewExpiredException()

构造不带详细消息或根本原因的新异常。

英文文档：

ViewExpiredException

public ViewExpiredException()

Construct a new exception with no detail message or root cause.

public ViewExpiredException(String viewId)

构造带指定视图标识符的新异常。

viewId 此异常的视图标识符
英文文档：

ViewExpiredException

public ViewExpiredException(String viewId)

Construct a new exception with the specified view identifier.

Parameters:
viewId - The view identifier for this exception

public ViewExpiredException(String message, String viewId)

构造带指定详细消息但不带根本原因的新异常。

message | 此异常的详细消息
viewId | 此异常的视图标识符
英文文档：

ViewExpiredException

public ViewExpiredException(String message,
                            String viewId)

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception
viewId - The view identifier for this exception

public ViewExpiredException(Throwable cause, String viewId)

构造带指定根本原因的新异常。详细消息将被设置为 (cause == null ? null :cause.toString()

cause | 此异常的根本原因
viewId | 此异常的视图标识符
英文文档：

ViewExpiredException

public ViewExpiredException(Throwable cause,
                            String viewId)

Construct a new exception with the specified root cause. The detail message will be set to (cause == null ? null : cause.toString()

Parameters:
cause - The root cause for this exception
viewId - The view identifier for this exception

public ViewExpiredException(String message, Throwable cause, String viewId)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
viewId | 此异常的视图标识符
英文文档：

ViewExpiredException

public ViewExpiredException(String message,
                            Throwable cause,
                            String viewId)

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
viewId - The view identifier for this exception
Method Detail

public String getViewId()

返回此异常的视图标识符；如果视图标识符不存在或未知，则返回 null。

英文文档：

getViewId

public String getViewId()

Return the view identifier of this exception, or null if the view identifier is nonexistent or unknown.

public String getMessage()

如果视图标识符不为 null，则返回此异常的消息并在前面加上视图标识符，否则，返回此消息。

英文文档：

getMessage

public String getMessage()

Return the message for this exception prepended with the view identifier if the view identifier is not null, otherwise, return the message.

Overrides:
getMessage in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.faces.component (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.component

Fundamental APIs for user interface components.

See:
Description

Interface Summary
ActionSource | ActionSource is an interface that may be implemented by any concrete UIComponent that wishes to be a source of ActionEvents, including the ability to invoke application actions via the default ActionListener mechanism.
ActionSource2 | ActionSource2 extends ActionSource and provides a JavaBeans property analogous to the "action" property on ActionSource.
ContextCallback | A simple callback interace that enables taking action on a specific UIComponent (either facet or child) in the view while preserving any contextual state for that component instance in the view.
EditableValueHolder | EditableValueHolder is an extension of ValueHolder that describes additional features supported by editable components, including ValueChangeEvents and Validators.
NamingContainer | NamingContainer is an interface that must be implemented by any UIComponent that wants to be a naming container.
StateHolder | This interface is implemented by classes that need to save their state between requests.
ValueHolder | ValueHolder is an interface that may be implemented by any concrete UIComponent that wishes to support a local value, as well as access data in the model tier via a value expression, and support conversion between String and the model tier data's native data type.

Class Summary
UIColumn | UIColumn is a UIComponent that represents a single column of data within a parent UIData component.
UICommand | UICommand is a UIComponent that represents a user interface component which, when activated by the user, triggers an application specific "command" or "action".
UIComponent | UIComponent is the base class for all user interface components in JavaServer Faces.
UIComponentBase | UIComponentBase is a convenience base class that implements the default concrete behavior of all methods defined by UIComponent.
UIData | UIData is a UIComponent that supports data binding to a collection of data objects represented by a DataModel instance, which is the current value of this component itself (typically established via a ValueExpression).
UIForm | UIForm is a UIComponent that represents an input form to be presented to the user, and whose child components represent (among other things) the input fields to be included when the form is submitted.
UIGraphic | UIGraphic is a UIComponent that displays a graphical image to the user.
UIInput | UIInput is a UIComponent that represents a component that both displays output to the user (like UIOutput components do) and processes request parameters on the subsequent request that need to be decoded.
UIMessage | This component is responsible for displaying messages for a specific UIComponent, identified by a clientId.
UIMessages | The renderer for this component is responsible for obtaining the messages from the FacesContext and displaying them to the user.
UINamingContainer | UINamingContainer is a convenience base class for components that wish to implement NamingContainer functionality.
UIOutput | UIOutput is a UIComponent that has a value, optionally retrieved from a model tier bean via a value expression, that is displayed to the user.
UIPanel | UIPanel is a UIComponent that manages the layout of its child components.
UIParameter | UIParameter is a UIComponent that represents an optionally named configuration parameter for a parent component.
UISelectBoolean | UISelectBoolean is a UIComponent that represents a single boolean (true or false) value.
UISelectItem | UISelectItem is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of a SelectItem instance to the list of available options for the parent component.
UISelectItems | UISelectItems is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of one or more SelectItem instances to the list of available options in the parent component.
UISelectMany | UISelectMany is a UIComponent that represents the user's choice of a zero or more items from among a discrete set of available options.
UISelectOne | UISelectOne is a UIComponent that represents the user's choice of zero or one items from among a discrete set of available options.
UIViewRoot | UIViewRoot is the UIComponent that represents the root of the UIComponent tree.

Package javax.faces.component Description

Fundamental APIs for user interface components.

For your convenience here is a UML class diagram of the classes in this package.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.component Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.component

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.component.UIComponent (implements javax.faces.component.StateHolder)
      • javax.faces.component.UIComponentBase
        • javax.faces.component.UIColumn
        • javax.faces.component.UICommand (implements javax.faces.component.ActionSource2)
        • javax.faces.component.UIData (implements javax.faces.component.NamingContainer)
        • javax.faces.component.UIForm (implements javax.faces.component.NamingContainer)
        • javax.faces.component.UIGraphic
        • javax.faces.component.UIMessage
        • javax.faces.component.UIMessages
        • javax.faces.component.UINamingContainer (implements javax.faces.component.NamingContainer)
        • javax.faces.component.UIOutput (implements javax.faces.component.ValueHolder)
          • javax.faces.component.UIInput (implements javax.faces.component.EditableValueHolder)
            • javax.faces.component.UISelectBoolean
            • javax.faces.component.UISelectMany
            • javax.faces.component.UISelectOne
        • javax.faces.component.UIPanel
        • javax.faces.component.UIParameter
        • javax.faces.component.UISelectItem
        • javax.faces.component.UISelectItems
        • javax.faces.component.UIViewRoot

Interface Hierarchy

  • javax.faces.component.ActionSource
    • javax.faces.component.ActionSource2
  • javax.faces.component.ContextCallback
  • javax.faces.component.NamingContainer
  • javax.faces.component.StateHolder
  • javax.faces.component.ValueHolder
    • javax.faces.component.EditableValueHolder
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ActionSource (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.component
Interface ActionSource

All Known Subinterfaces:
ActionSource2
All Known Implementing Classes:
HtmlCommandButton, HtmlCommandLink, UICommand
public interface ActionSource

Implemented by: ActionSource2

ActionSource 是一个接口，可以由要作为 ActionEvent 源（包括要具有通过默认 ActionListener 机制调用应用程序操作的能力）的任何具体 UIComponent 实现。

英文文档：

ActionSource is an interface that may be implemented by any concrete UIComponent that wishes to be a source of ActionEvents, including the ability to invoke application actions via the default ActionListener mechanism.

Method Summary
 void addActionListener(ActionListener listener)
Add a new ActionListener to the set of listeners interested in being notified when ActionEvents occur.
 MethodBinding getAction()
Deprecated. This has been replaced by ActionSource2.getActionExpression().
 MethodBinding getActionListener()
Deprecated. Use getActionListeners() instead.
 ActionListener[] getActionListeners()
Return the set of registered ActionListeners for this ActionSource instance.
 boolean isImmediate()
Return a flag indicating that the default ActionListener provided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase.
 void removeActionListener(ActionListener listener)
Remove an existing ActionListener (if any) from the set of listeners interested in being notified when ActionEvents occur.
 void setAction(MethodBinding action)
Deprecated. This has been replaced by ActionSource2.setActionExpression(javax.el.MethodExpression).
 void setActionListener(MethodBinding actionListener)
Deprecated. This has been replaced by addActionListener(javax.faces.event.ActionListener).
 void setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent.

Method Detail

public MethodBinding getAction()

如果实现类还实现了 ActionSource2，则此方法的实现必须调用 ActionSource2#getActionExpression 并检查该结果。如果结果来自以前对 #setAction 的调用，则从结果中提取 MethodBinding 并将其返回。否则，包装返回的 MethodBinding 实现中的 javax.el.MethodExpression 并将其返回。

如果实现类没有实现 ActionSource2，则返回一个 MethodBinding，该 MethodBinding 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用的应用程序操作。

deprecated 此方法已由 ActionSource2#getActionExpression 取代。
英文文档：

getAction

MethodBinding getAction()
Deprecated. This has been replaced by ActionSource2.getActionExpression().

If the implementing class also implements ActionSource2, the implementation of this method must call through to ActionSource2.getActionExpression() and examine the result. If the result came from a previous call to setAction(javax.faces.el.MethodBinding), extract the MethodBinding from it and return it. Otherwise, wrap the returned MethodExpression in a MethodBinding implementation, and return it.

If the implementing class does not implement ActionSource2, return the MethodBindingpointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

public void setAction(MethodBinding action)

如果实现类还实现了 ActionSource2，则此方法的实现必须在实现 javax.el.MethodExpression 的类中包装参数 action，并调用 ActionSource2#setActionExpression，同时传递包装的 action。

如果实现类没有实现 ActionSource2，则设置一个 MethodBinding，该 MethodBinding 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用的应用程序操作。

此表达式所引用的任何方法都必须是公共的，返回类型为 String，并且不接受任何参数。

action | 新的 MethodBinding 表达式
deprecated | 此方法已由 setActionExpression(javax.el.MethodExpression) 替代。
英文文档：

setAction

void setAction(MethodBinding action)
Deprecated. This has been replaced by ActionSource2.setActionExpression(javax.el.MethodExpression).

If the implementing class also implements ActionSource2, the implementation of this method must wrap the argument action in a class that implements MethodExpression and call through to ActionSource2.setActionExpression(javax.el.MethodExpression), passing the wrapped action.

If the implementing class does not implement ActionSource2, set the MethodBinding pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

Parameters:
action - The new MethodBinding expression

public MethodBinding getActionListener()

如果以前没有为此实例调用过 #setActionListener，则此方法必须返回 null。如果调用过 #setActionListener，则此方法必须返回原先传递给 #setActionListener 的那个 MethodBinding 实例。

用户激活此 UIComponent 时要调用的方法将在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用。

deprecated 请改用 #getActionListeners。
英文文档：

getActionListener

MethodBinding getActionListener()
Deprecated. Use getActionListeners() instead.

If setActionListener(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setActionListener(javax.faces.el.MethodBinding).

The method to be invoked, if this UIComponent is activated by the user, will be called during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending upon the value of the immediate property.

public void setActionListener(MethodBinding actionListener)

在 ActionListener 的实现中包装参数 actionListener，并将其存储在支持 #getActionListeners 方法的内部数据结构中，小心地重写通过以前调用 setActionListener 存储的任何实例。

此表达式所引用的任何方法都必须是公共的，返回类型为 void，并接受类型为 ActionEvent 的单个参数。

actionListener | 新的方法绑定表达式
deprecated | 此方法已由 #addActionListener(javax.faces.event.ActionListener) 替代。
英文文档：

setActionListener

void setActionListener(MethodBinding actionListener)
Deprecated. This has been replaced by addActionListener(javax.faces.event.ActionListener).

Wrap the argument actionListener in an implementation of ActionListener and store it in the internal data structure that backs the getActionListeners() method, taking care to over-write any instance that was stored by a previous call to setActionListener.

Any method referenced by such an expression must be public, with a return type of void, and accept a single parameter of type ActionEvent.

Parameters:
actionListener - The new method binding expression

public boolean isImmediate()

返回一个标志，指示 JavaServer Faces 实现提供的默认 ActionListener 应立即执行（即在请求处理生命周期的应用请求值 阶段），而不是等到调用应用程序 阶段执行。此属性的默认值必须为 false。

英文文档：

isImmediate

boolean isImmediate()

Return a flag indicating that the default ActionListener provided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase. The default value for this property must be false.

public void setImmediate(boolean immediate)

设置此 UIComponent 的 "immediate execution" 标志。

immediate 新的立即执行标志
英文文档：

setImmediate

void setImmediate(boolean immediate)

Set the "immediate execution" flag for this UIComponent.

Parameters:
immediate - The new immediate execution flag

public void addActionListener(ActionListener listener)

向希望在发生 ActionEvent 时获得通知的侦听器集合中添加一个新的 ActionListener。

listener | 要添加的 ActionListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

addActionListener

void addActionListener(ActionListener listener)

Add a new ActionListener to the set of listeners interested in being notified when ActionEvents occur.

Parameters:
listener - The ActionListener to be added
Throws:
NullPointerException - if listener is null

public ActionListener[] getActionListeners()

返回此 ActionSource 实例已注册的 ActionListener 的集合。如果不存在任何已注册侦听器，则返回一个长度为 0 的数组。

英文文档：

getActionListeners

ActionListener[] getActionListeners()

Return the set of registered ActionListeners for this ActionSource instance. If there are no registered listeners, a zero-length array is returned.

public void removeActionListener(ActionListener listener)

从希望在发生 ActionEvent 时获得通知的侦听器集合中移除现有的 ActionListener（如果有）。

listener | 要移除的 ActionListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

removeActionListener

void removeActionListener(ActionListener listener)

Remove an existing ActionListener (if any) from the set of listeners interested in being notified when ActionEvents occur.

Parameters:
listener - The ActionListener to be removed
Throws:
NullPointerException - if listener is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ActionSource2 (Java EE 5)

javax.faces.component
Interface ActionSource2

All Superinterfaces:
ActionSource
All Known Implementing Classes:
HtmlCommandButton, HtmlCommandLink, UICommand
public interface ActionSource2
extends ActionSource

Implements: ActionSource
Implemented by: UICommand

ActionSource2 扩展 ActionSource，并提供与 ActionSource 上的 "action" 属性类似的 JavaBeans 属性。不同之处在于，此属性的类型是 MethodExpression 而不是 MethodBinding。这就允许 ActionSource 概念利用新的统一 EL API。

since 1.2
英文文档：

ActionSource2 extends ActionSource and provides a JavaBeans property analogous to the "action" property on ActionSource. The difference is the type of this property is a MethodExpression rather than a MethodBinding. This allows the ActionSource concept to leverage the new Unified EL API.

Since:
1.2

Method Summary
MethodExpression | getActionExpression() Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.
void | setActionExpression(MethodExpression action) Set the MethodExpression pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.
Methods inherited from interface javax.faces.component.ActionSource
addActionListener, getAction, getActionListener, getActionListeners, isImmediate, removeActionListener, setAction, setActionListener, setImmediate

Method Detail

public MethodExpression getActionExpression()

返回一个 MethodExpression，该 MethodExpression 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用的应用程序操作。

注意，返回的 MethodExpression 有可能仅是通过调用 ActionSource#setAction 设置的 MethodBinding 实例周围的包装器。这使得默认 ActionListener 有可能继续与旧的组件一起正常工作。

英文文档：

getActionExpression

MethodExpression getActionExpression()

Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Note that it's possible that the returned MethodExpression is just a wrapper around a MethodBinding instance whith was set by a call to ActionSource.setAction(javax.faces.el.MethodBinding). This makes it possible for the default ActionListener to continue to work properly with older components.

public void setActionExpression(MethodExpression action)

设置一个 MethodExpression，该 MethodExpression 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用的应用程序操作。

此表达式所引用的任何方法都必须是公共的，返回类型为 String，并且不接受任何参数。

action 新的方法表达式
英文文档：

setActionExpression

void setActionExpression(MethodExpression action)

Set the MethodExpression pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

Parameters:
action - The new method expression
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContextCallback (Java EE 5)

javax.faces.component
Interface ContextCallback

public interface ContextCallback

一个简单的回调接口，支持在视图中对特定 UIComponent（facet 或子组件）采取操作，同时保留视图中该组件实例的任何上下文状态。

英文文档：

A simple callback interace that enables taking action on a specific UIComponent (either facet or child) in the view while preserving any contextual state for that component instance in the view.

Method Summary
 void invokeContextCallback(FacesContext context, UIComponent target)
This method will be called by an implementation of UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback) and must be passed the component with the clientId given as an argument to invokeOnComponent.

Method Detail

public void invokeContextCallback(FacesContext context, UIComponent target)

此方法将通过 UIComponent#invokeOnComponent 的实现调用，而且必须向此方法传递带有 clientId 的组件，该 clientId 作为 invokeOnComponent 的参数给定。调用此方法的时候，参数 target 对于视图中其祖先而言，保证处于恰当的状态。

context | 此请求的 FacesContext。
target | 通过 clientId 定位的 UIComponent，该 clientId 通过调用 UIComponent#invokeOnComponent 给定。
英文文档：

invokeContextCallback

void invokeContextCallback(FacesContext context,
                           UIComponent target)

This method will be called by an implementation of UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback) and must be passed the component with the clientId given as an argument to invokeOnComponent. At the point in time when this method is called, the argument target is guaranteed to be in the proper state with respect to its ancestors in the View.

Parameters:
context - the FacesContext for this request.
target - the UIComponent that was located by clientId by a call to UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback).
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EditableValueHolder (Java EE 5)

javax.faces.component
Interface EditableValueHolder

All Superinterfaces:
ValueHolder
All Known Implementing Classes:
HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio, UIInput, UISelectBoolean, UISelectMany, UISelectOne
public interface EditableValueHolder
extends ValueHolder

Implements: ValueHolder
Implemented by: UIInput

EditableValueHolder 是描述可编辑组件（包括 ValueChangeEvent 和 Validator）支持的额外功能的 ValueHolder 的扩展。

英文文档：

EditableValueHolder is an extension of ValueHolder that describes additional features supported by editable components, including ValueChangeEvents and Validators.

Method Summary
 void addValidator(Validator validator)
Add a Validator instance to the set associated with this component.
 void addValueChangeListener(ValueChangeListener listener)
Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.
 Object getSubmittedValue()
Return the submittedValue value of this component.
 MethodBinding getValidator()
Deprecated. getValidators() should be used instead.
 Validator[] getValidators()
Return the set of registered Validators for this component instance.
 MethodBinding getValueChangeListener()
Deprecated. Use getValueChangeListeners() instead.
 ValueChangeListener[] getValueChangeListeners()
Return the set of registered ValueChangeListeners for this component instance.
 boolean isImmediate()
Return the "immediate" state for this component.
 boolean isLocalValueSet()
Return the "local value set" state for this component.
 boolean isRequired()
Return the "required field" state for this component.
 boolean isValid()
Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).
 void removeValidator(Validator validator)
Remove a Validator instance from the set associated with this component, if it was previously associated.
 void removeValueChangeListener(ValueChangeListener listener)
Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.
 void setImmediate(boolean immediate)
Set the "immediate" state for this component.
 void setLocalValueSet(boolean localValueSet)
Sets the "local value set" state for this component.
 void setRequired(boolean required)
Set the "required field" state for this component.
 void setSubmittedValue(Object submittedValue)
Set the submittedValue value of this component.
 void setValid(boolean valid)
Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).
 void setValidator(MethodBinding validatorBinding)
Deprecated. Use addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.
 void setValueChangeListener(MethodBinding valueChangeMethod)
Deprecated. Use addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter, setValue

Method Detail

public Object getSubmittedValue()

返回此组件的 submittedValue 值。此方法仅供此组件或其相应 Renderer 的 encodeBegin() 和/或 encodeEnd() 方法使用。

英文文档：

getSubmittedValue

Object getSubmittedValue()

Return the submittedValue value of this component. This method should only be used by the encodeBegin() and/or encodeEnd() methods of this component, or its corresponding Renderer.

public void setSubmittedValue(Object submittedValue)

设置此组件的 submittedValue 值。此方法仅供此组件或其相应 Renderer 的 decode() 和 validate() 方法使用。

submittedValue 新提交的值
英文文档：

setSubmittedValue

void setSubmittedValue(Object submittedValue)

Set the submittedValue value of this component. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer.

Parameters:
submittedValue - The new submitted value

public boolean isLocalValueSet()
返回此组件的 "local value set" 状态。调用 setValue() 自动将此属性重置为 true。
英文文档：

isLocalValueSet

boolean isLocalValueSet()
Return the "local value set" state for this component. Calls to setValue() automatically reset this property to true.

public void setLocalValueSet(boolean localValueSet)
设置此组件的 "local value set" 状态。
英文文档：

setLocalValueSet

void setLocalValueSet(boolean localValueSet)
Sets the "local value set" state for this component.

public boolean isValid()

返回一个标志，指示此组件的本地值是否有效（没有发生转换错误）。

英文文档：

isValid

boolean isValid()

Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).

public void setValid(boolean valid)

设置一个标志，指示此组件的本地值是否有效（没有发生转换错误）。

valid 新的有效标志
英文文档：

setValid

void setValid(boolean valid)

Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).

Parameters:
valid - The new valid flag

public boolean isRequired()

返回此组件的 "required field" 状态。

英文文档：

isRequired

boolean isRequired()

Return the "required field" state for this component.

public void setRequired(boolean required)

设置此组件的 "required field" 状态。

required 新的 "required field" 状态
英文文档：

setRequired

void setRequired(boolean required)

Set the "required field" state for this component.

Parameters:
required - The new "required field" state

public boolean isImmediate()

返回此组件的 "immediate" 状态。

英文文档：

isImmediate

boolean isImmediate()

Return the "immediate" state for this component.

public void setImmediate(boolean immediate)

设置此组件的 "immediate" 状态。设置为 true 时，将在应用请求值 阶段立即转换和验证组件的值，并且 ValueChangeEvent 也将在该阶段提供。此属性的默认值必须为 false。

immediate 新的 "immediate" 状态
英文文档：

setImmediate

void setImmediate(boolean immediate)

Set the "immediate" state for this component. When set to true, the component's value will be converted and validated immediately in the Apply Request Values phase, and ValueChangeEvents will be delivered in that phase as well. The default value for this property must be false.

Parameters:
immediate - The new "immediate" state

public MethodBinding getValidator()

如果以前没有为此实例调用过 #setValidator，则此方法必须返回 null。如果调用过 #setValidator，则此方法必须返回原先传递给 #setValidator 的那个 MethodBinding 实例。

此方法将在处理验证 或应用请求值 阶段（取决于 immediate 属性的值）调用。

deprecated 应改用 #getValidators。
英文文档：

getValidator

MethodBinding getValidator()
Deprecated. getValidators() should be used instead.

If setValidator(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setValidator(javax.faces.el.MethodBinding).

This method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

public void setValidator(MethodBinding validatorBinding)

在 javax.faces.validator.Validator 的实现中包装参数 validatorBinding，并将其存储在支持 #getValidators 方法的内部数据结构中，小心地重写通过以前调用 setValidator 存储的任何实例。

此参数方法将在处理验证 或应用请求值 阶段（取决于 immediate 属性的值）调用。

此表达式所引用的任何方法都必须是公共的，返回类型为 void，并接受类型为 javax.faces.context.FacesContext、UIComponent 和 Object 的参数。

validatorBinding | 新的 MethodBinding 实例
deprecated | 请改用 #addValidator，通过创建 javax.faces.validator.MethodExpressionValidator 的实例获取参数 Validator。
英文文档：

setValidator

void setValidator(MethodBinding validatorBinding)
Deprecated. Use addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.

Wrap the argument validatorBinding in an implementation of Validator and store it in the internal data structure that backs the getValidators() method, taking care to over-write any instance that was stored by a previous call to setValidator.

The argument method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Any method referenced by such an expression must be public, with a return type of void, and accept parameters of type FacesContext, UIComponent, and Object.

Parameters:
validatorBinding - The new MethodBinding instance

public MethodBinding getValueChangeListener()

如果以前没有为此实例调用过 #setValueChangeListener，则此方法必须返回 null。如果调用过 #setValueChangeListener，则此方法必须返回原先传递给 #setValueChangeListener 的那个 MethodBinding 实例。

deprecated 请改用 #getValueChangeListeners。
英文文档：

getValueChangeListener

MethodBinding getValueChangeListener()
Deprecated. Use getValueChangeListeners() instead.

If setValueChangeListener(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setValueChangeListener(javax.faces.el.MethodBinding).

public void setValueChangeListener(MethodBinding valueChangeMethod)

在 ValueChangeListener 的实现中包装参数 valueChangeMethod，并将其存储在支持 #getValueChangeListeners 方法的内部数据结构中，小心地重写通过以前调用 setValueChangeListener 存储的任何实例。

此参数方法将在处理验证 或应用请求值 阶段（取决于 immediate 属性的值）调用。

此表达式所引用的任何方法都必须是公共的，返回类型为 void，并接受类型为 javax.faces.event.ValueChangeEvent 的参数。

valueChangeMethod | 新的方法绑定实例
deprecated | 请改用 #addValueChangeListener，通过创建 javax.faces.event.MethodExpressionValueChangeListener 的实例获取参数 ValueChangeListener。
英文文档：

setValueChangeListener

void setValueChangeListener(MethodBinding valueChangeMethod)
Deprecated. Use addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.

Wrap the argument valueChangeMethod in an implementation of ValueChangeListener and store it in the internal data structure that backs the getValueChangeListeners() method, taking care to over-write any instance that was stored by a previous call to setValueChangeListener.

This argument method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Any method referenced by such an expression must be public, with a return type of void, and accept a parameter of type ValueChangeEvent.

Parameters:
valueChangeMethod - The new method binding instance

public void addValidator(Validator validator)

将 Validator 实例添加到与此组件关联的集合。

validator | 要添加的 Validator
Throws | NullPointerException: 如果 validator 为 null
英文文档：

addValidator

void addValidator(Validator validator)

Add a Validator instance to the set associated with this component.

Parameters:
validator - The Validator to add
Throws:
NullPointerException - if validator is null

public Validator[] getValidators()

返回此组件实例已注册的 Validator 的集合。如果不存在任何已注册验证器，则返回一个长度为 0 的数组。

英文文档：

getValidators

Validator[] getValidators()

Return the set of registered Validators for this component instance. If there are no registered validators, a zero-length array is returned.

public void removeValidator(Validator validator)

从与此组件关联的集合中移除 Validator 实例（如果以前将它们关联过）。否则，不执行任何操作。

validator 要移除的 Validator
英文文档：

removeValidator

void removeValidator(Validator validator)

Remove a Validator instance from the set associated with this component, if it was previously associated. Otherwise, do nothing.

Parameters:
validator - The Validator to remove

public void addValueChangeListener(ValueChangeListener listener)

向希望在发生 ValueChangeEvent 时获得通知的侦听器集合中添加一个新的 ValueChangeListener。

listener | 要添加的 ValueChangeListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

addValueChangeListener

void addValueChangeListener(ValueChangeListener listener)

Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.

Parameters:
listener - The ValueChangeListener to be added
Throws:
NullPointerException - if listener is null

public ValueChangeListener[] getValueChangeListeners()

返回此组件实例已注册的 ValueChangeListener 的集合。如果不存在任何已注册侦听器，则返回一个长度为 0 的数组。

英文文档：

getValueChangeListeners

ValueChangeListener[] getValueChangeListeners()

Return the set of registered ValueChangeListeners for this component instance. If there are no registered listeners, a zero-length array is returned.

public void removeValueChangeListener(ValueChangeListener listener)

从希望在发生 ValueChangeEvent 时获得通知的侦听器集合中移除一个现有的 ValueChangeListener（如果有）。

listener | 要移除的 ValueChangeListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

removeValueChangeListener

void removeValueChangeListener(ValueChangeListener listener)

Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.

Parameters:
listener - The ValueChangeListener to be removed
Throws:
NullPointerException - if listener is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NamingContainer (Java EE 5)

javax.faces.component
Interface NamingContainer

All Known Implementing Classes:
HtmlDataTable, HtmlForm, UIData, UIForm, UINamingContainer
public interface NamingContainer

Implemented by: UIData, UIForm, UINamingContainer

NamingContainer 是一个必须由任何要成为命名容器的 UIComponent 实现的接口。命名容器影响 UIComponent#findComponent 和 UIComponent#getClientId 方法的行为；有关更多信息，请参见这些方法。

英文文档：

NamingContainer is an interface that must be implemented by any UIComponent that wants to be a naming container. Naming containers affect the behavior of the UIComponent.findComponent(java.lang.String) and UIComponent.getClientId(javax.faces.context.FacesContext) methods; see those methods for further information.

Field Summary
static char SEPARATOR_CHAR
The separator character used in component identifiers to demarcate navigation to a child naming container.

Field Detail

英文文档：

SEPARATOR_CHAR

static final char SEPARATOR_CHAR

The separator character used in component identifiers to demarcate navigation to a child naming container.

See Also:
Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StateHolder (Java EE 5)

javax.faces.component
Interface StateHolder

All Known Implementing Classes:
DateTimeConverter, DoubleRangeValidator, EnumConverter, HtmlColumn, HtmlCommandButton, HtmlCommandLink, HtmlDataTable, HtmlForm, HtmlGraphicImage, HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlMessage, HtmlMessages, HtmlOutputFormat, HtmlOutputLabel, HtmlOutputLink, HtmlOutputText, HtmlPanelGrid, HtmlPanelGroup, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio, LengthValidator, LongRangeValidator, MethodExpressionActionListener, MethodExpressionValidator, MethodExpressionValueChangeListener, NumberConverter, UIColumn, UICommand, UIComponent, UIComponentBase, UIData, UIForm, UIGraphic, UIInput, UIMessage, UIMessages, UINamingContainer, UIOutput, UIPanel, UIParameter, UISelectBoolean, UISelectItem, UISelectItems, UISelectMany, UISelectOne, UIViewRoot
public interface StateHolder

Implemented by: DateTimeConverter, DoubleRangeValidator, EnumConverter, LengthValidator, LongRangeValidator, MethodExpressionActionListener, MethodExpressionValidator, MethodExpressionValueChangeListener, NumberConverter, UIComponent

此接口由需要在请求之间保存其状态的类实现。

实现者必须实现此类中的 #saveState 和 #restoreState 方法，因为这两个方法之间有紧密耦合的协定。换句话说，如果有继承层次结构，则不允许使 #saveState 和 #restoreState 方法驻留在不同的层次结构级别。

实现者必须具有不带参数的公共构造方法。

英文文档：

This interface is implemented by classes that need to save their state between requests.

An implementor must implement both saveState(javax.faces.context.FacesContext) and restoreState(javax.faces.context.FacesContext, java.lang.Object) methods in this class, since these two methods have a tightly coupled contract between themselves. In other words, if there is an ineritance hierarchy, it is not permissable to have the saveState(javax.faces.context.FacesContext) and restoreState(javax.faces.context.FacesContext, java.lang.Object) methods reside at different levels of the hierarchy.

An implementor must have a public no-args constructor.

Method Summary
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setTransient(boolean newTransientValue) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Method Detail

public Object saveState(FacesContext context)

获取作为 Serializable 对象的实例状态。

如果实现此接口的类包含指向实现 StateHolder 的实例的引用（例如带有事件处理程序、验证器等的 UIComponent），则此方法还必须调用所有这些实例上的 #saveState 方法。此方法不能保存子组件和 facet 的状态。通过 javax.faces.application.StateManager 可做到这一点

此方法不能修改实现对象的状态。换句话说，在执行此代码后：

Object state = component.saveState(facesContext);

component 应与执行前相同。

此方法的返回值必须是 Serializable

Throws NullPointerException: 如果 context 为 null
英文文档：

saveState

Object saveState(FacesContext context)

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Throws:
NullPointerException - if context is null

public void restoreState(FacesContext context, Object state)

执行从状态 Object 中的条目恢复状态所需的任何处理。

如果实现此接口的类包含指向也实现了 StateHolder 的实例的引用（例如带有事件处理程序、验证器等的 UIComponent），则此方法还必须调用所有这些实例上的 #restoreState 方法。

Throws NullPointerException: 如果 context 或 state 为 null
英文文档：

restoreState

void restoreState(FacesContext context,
                  Object state)

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Throws:
NullPointerException - if either context or state are null

public boolean isTransient()

如果为 true，则实现此接口的 Object 不得参与状态保存或恢复。

英文文档：

isTransient

boolean isTransient()

If true, the Object implementing this interface must not participate in state saving or restoring.

public void setTransient(boolean newTransientValue)

表示实现此接口的 Object 必须或不得参与状态保存或恢复。

newTransientValue 如果此 Object 将参与状态保存或恢复，则 boolean 传递 true，否则传递 false。
英文文档：

setTransient

void setTransient(boolean newTransientValue)

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Parameters:
newTransientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValueHolder (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.component
Interface ValueHolder

All Known Subinterfaces:
EditableValueHolder
All Known Implementing Classes:
HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlOutputFormat, HtmlOutputLabel, HtmlOutputLink, HtmlOutputText, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio, UIInput, UIOutput, UISelectBoolean, UISelectMany, UISelectOne
public interface ValueHolder

Implemented by: EditableValueHolder, UIOutput

ValueHolder 是可以由任何希望支持本地值以及通过值表达式 访问模型层中的数据，并支持在 String 和模型层数据的本机数据类型之间转换的具体 UIComponent 实现的接口。

英文文档：

ValueHolder is an interface that may be implemented by any concrete UIComponent that wishes to support a local value, as well as access data in the model tier via a value expression, and support conversion between String and the model tier data's native data type.

Method Summary
Converter | getConverter() Return the Converter (if any) that is registered for this UIComponent.
Object | getLocalValue() Return the local value of this UIComponent (if any), without evaluating any associated ValueExpression.
Object | getValue() Gets the value of this UIComponent.
void | setConverter(Converter converter) Set the Converter (if any) that is registered for this UIComponent.
void | setValue(Object value) Set the value of this UIComponent (if any).

Method Detail

public Object getLocalValue()

返回此 UIComponent 的本地值（如果有），不用对任何关联的 ValueExpression 求值。

英文文档：

getLocalValue

Object getLocalValue()

Return the local value of this UIComponent (if any), without evaluating any associated ValueExpression.

public Object getValue()

获取此 UIComponent 的值。首先，参考此组件的本地值属性。如果为非 null，则将其返回。如果为 null，则查看我们是否有 value 属性的 ValueExpression。如果有，则返回对属性求值的结果，否则返回 null。请注意，因为 UIComponent#setValueBinding 规范要求调用 UIComponent#setValueExpression，所以遗留标记将继续起作用。

英文文档：

getValue

Object getValue()

Gets the value of this UIComponent. First, consult the local value property of this component. If non-null return it. If null, see if we have a ValueExpression for the value property. If so, return the result of evaluating the property, otherwise return null. Note that because the specification for UIComponent.setValueBinding(java.lang.String, javax.faces.el.ValueBinding) requires a call through to UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression), legacy tags will continue to work.

public void setValue(Object value)

设置此 UIComponent 的值（如果有）。

value 新的本地值
英文文档：

setValue

void setValue(Object value)

Set the value of this UIComponent (if any).

Parameters:
value - The new local value

public Converter getConverter()

返回为此 UIComponent 注册的 Converter（如果有）。

英文文档：

getConverter

Converter getConverter()

Return the Converter (if any) that is registered for this UIComponent.

public void setConverter(Converter converter)

设置为此 UIComponent 注册的 Converter（如果有）。

converter 新的 Converter（或 null）
英文文档：

setConverter

void setConverter(Converter converter)

Set the Converter (if any) that is registered for this UIComponent.

Parameters:
converter - New Converter (or null)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


UIColumn (Java EE 5)

javax.faces.component
Class UIColumn

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIColumn
All Implemented Interfaces:
StateHolder
Direct Known Subclasses:
HtmlColumn
public class UIColumn
extends UIComponentBase

Extends: UIComponent > UIComponentBase
Extended by: HtmlColumn

UIColumn 是表示父 UIData 组件内单个数据列的 UIComponent。

英文文档：

UIColumn is a UIComponent that represents a single column of data within a parent UIData component.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIColumn()
Create a new UIColumn instance with default property values.
Method Summary
String | getFamily() Return the identifier of the component family to which this component belongs.
UIComponent | getFooter() Return the footer facet of the column (if any).
UIComponent | getHeader() Return the header facet of the column (if any).
void | setFooter(UIComponent footer) Set the footer facet of the column.
void | setHeader(UIComponent header) Set the header facet of the column.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIColumn()

使用默认属性值创建新的 UIColumn 实例。

英文文档：

UIColumn

public UIColumn()

Create a new UIColumn instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public UIComponent getFooter()

返回列的脚注 facet（如果有）。getFacet("footer") 的便捷方法。

英文文档：

getFooter

public UIComponent getFooter()

Return the footer facet of the column (if any). A convenience method for getFacet("footer").

public void setFooter(UIComponent footer)

设置列的脚注 facet。getFacets().put("footer", footer) 的便捷方法。

footer | 新的脚注 facet
Throws | NullPointerException: 如果 footer 为 null
英文文档：

setFooter

public void setFooter(UIComponent footer)

Set the footer facet of the column. A convenience method for getFacets().put("footer", footer).

Parameters:
footer - the new footer facet
Throws:
NullPointerException - if footer is null

public UIComponent getHeader()

返回列的头 facet（如果有）。getFacet("header") 的便捷方法。

英文文档：

getHeader

public UIComponent getHeader()

Return the header facet of the column (if any). A convenience method for getFacet("header").

public void setHeader(UIComponent header)

设置列的头 facet。getFacets().put("header", header) 的便捷方法。

header | 新的头 facet
Throws | NullPointerException: 如果 header 为 null
英文文档：

setHeader

public void setHeader(UIComponent header)

Set the header facet of the column. A convenience method for getFacets().put("header", header).

Parameters:
header - the new header facet
Throws:
NullPointerException - if header is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UICommand (Java EE 5)

javax.faces.component
Class UICommand

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UICommand
All Implemented Interfaces:
ActionSource, ActionSource2, StateHolder
Direct Known Subclasses:
HtmlCommandButton, HtmlCommandLink
public class UICommand
extends UIComponentBase
implements ActionSource2

Extends: UIComponent > UIComponentBase
Implements: ActionSource2
Extended by: HtmlCommandButton, HtmlCommandLink

UICommand 是一个 UIComponent，它表示当用户将其激活时，将触发特定于应用程序的 "command" 或 "action" 的用户界面组件。此类组件通常呈现为按钮开关、菜单项或超链接。

当此 UICommand 的 decode() 方法或其相应的 Renderer 检测到此控件已被激活，它将把一个 ActionEvent 加入队列。之后，broadcast() 方法将确保此事件广播到所有感兴趣的侦听器。

将按以下顺序调用侦听器：

  1. ActionListener，按它们注册的顺序。
  2. "actionListener" MethodExpression（它将覆盖设置为 MethodBinding 的 "actionListener"）。
  3. 从 Application 中获取到的默认 ActionListener - 并且因此包含任何连接的 "action" MethodExpression。

默认情况下，rendererType 属性必须设置为 "javax.faces.Button"。可以调用 setRendererType() 方法更改此值。

英文文档：

UICommand is a UIComponent that represents a user interface component which, when activated by the user, triggers an application specific "command" or "action". Such a component is typically rendered as a push button, a menu item, or a hyperlink.

When the decode() method of this UICommand, or its corresponding Renderer, detects that this control has been activated, it will queue an ActionEvent. Later on, the broadcast() method will ensure that this event is broadcast to all interested listeners.

Listeners will be invoked in the following order:

  1. ActionListeners, in the order in which they were registered.
  2. The "actionListener" MethodExpression (which will cover the "actionListener" that was set as a MethodBinding).
  3. The default ActionListener, retrieved from the Application - and therefore, any attached "action" MethodExpression.

By default, the rendererType property must be set to "javax.faces.Button". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UICommand()
Create a new UICommand instance with default property values.
Method Summary
 void addActionListener(ActionListener listener)
Add a new ActionListener to the set of listeners interested in being notified when ActionEvents occur.
 void broadcast(FacesEvent event)
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent) processing, pass the ActionEvent being broadcast to the method referenced by actionListener (if any), and to the default ActionListener registered on the Application.
 MethodBinding getAction()
Deprecated. This has been replaced by getActionExpression().
 MethodExpression getActionExpression()
Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.
 MethodBinding getActionListener()
Deprecated. Use getActionListeners() instead.
 ActionListener[] getActionListeners()
Return the set of registered ActionListeners for this ActionSource instance.
 String getFamily()
Return the identifier of the component family to which this component belongs.
 Object getValue()
Returns the value property of the UICommand.
 boolean isImmediate()
Return a flag indicating that the default ActionListener provided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase.
 void queueEvent(FacesEvent e)
Intercept queueEvent and, for ActionEvents, mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise.
 void removeActionListener(ActionListener listener)
Remove an existing ActionListener (if any) from the set of listeners interested in being notified when ActionEvents occur.
 void restoreState(FacesContext context, Object state)
Perform any processing required to restore the state from the entries in the state Object.
 Object saveState(FacesContext context)
Gets the state of the instance as a Serializable Object.
 void setAction(MethodBinding action)
Deprecated. This has been replaced by setActionExpression(javax.el.MethodExpression).
 void setActionExpression(MethodExpression actionExpression)
Set the MethodExpression pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.
 void setActionListener(MethodBinding actionListener)
Deprecated. This has been replaced by addActionListener(javax.faces.event.ActionListener).
 void setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent.
 void setValue(Object value)
Sets the value property of the UICommand.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UICommand()

使用默认属性值创建新的 UICommand 实例。

英文文档：

UICommand

public UICommand()

Create a new UICommand instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public MethodBinding getAction()
NullPointerException

如果实现类还实现了 ActionSource2，则此方法的实现必须调用 ActionSource2#getActionExpression 并检查该结果。如果结果来自以前对 #setAction 的调用，则从结果中提取 MethodBinding 并将其返回。否则，包装返回的 MethodBinding 实现中的 javax.el.MethodExpression 并将其返回。

如果实现类没有实现 ActionSource2，则返回一个 MethodBinding，该 MethodBinding 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用的应用程序操作。

deprecated 此方法已由 #getActionExpression 替代。
英文文档：

getAction

public MethodBinding getAction()
Deprecated. This has been replaced by getActionExpression().

If the implementing class also implements ActionSource2, the implementation of this method must call through to ActionSource2.getActionExpression() and examine the result. If the result came from a previous call to ActionSource.setAction(javax.faces.el.MethodBinding), extract the MethodBinding from it and return it. Otherwise, wrap the returned MethodExpression in a MethodBinding implementation, and return it.

If the implementing class does not implement ActionSource2, return the MethodBindingpointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Specified by:
getAction in interface ActionSource

public void setAction(MethodBinding action)
NullPointerException

如果实现类还实现了 ActionSource2，则此方法的实现必须在实现 javax.el.MethodExpression 的类中包装参数 action，并调用 ActionSource2#setActionExpression，同时传递包装的 action。

如果实现类没有实现 ActionSource2，则设置一个 MethodBinding，该 MethodBinding 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用的应用程序操作。

此表达式所引用的任何方法都必须是公共的，返回类型为 String，并且不接受任何参数。

deprecated 此方法已由 #setActionExpression(javax.el.MethodExpression) 替代。
英文文档：

setAction

public void setAction(MethodBinding action)
Deprecated. This has been replaced by setActionExpression(javax.el.MethodExpression).

If the implementing class also implements ActionSource2, the implementation of this method must wrap the argument action in a class that implements MethodExpression and call through to ActionSource2.setActionExpression(javax.el.MethodExpression), passing the wrapped action.

If the implementing class does not implement ActionSource2, set the MethodBinding pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

Specified by:
setAction in interface ActionSource
Parameters:
action - The new MethodBinding expression

public MethodBinding getActionListener()
NullPointerException

如果以前没有为此实例调用过 #setActionListener，则此方法必须返回 null。如果调用过 #setActionListener，则此方法必须返回原先传递给 #setActionListener 的那个 MethodBinding 实例。

用户激活此 UIComponent 时要调用的方法将在请求处理生命周期的应用请求值 或调用应用程序 阶段（取决于 immediate 属性的值）调用。

deprecated 请改用 #getActionListeners。
英文文档：

getActionListener

public MethodBinding getActionListener()
Deprecated. Use getActionListeners() instead.

If ActionSource.setActionListener(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to ActionSource.setActionListener(javax.faces.el.MethodBinding).

The method to be invoked, if this UIComponent is activated by the user, will be called during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending upon the value of the immediate property.

Specified by:
getActionListener in interface ActionSource

public void setActionListener(MethodBinding actionListener)
NullPointerException

在 ActionListener 的实现中包装参数 actionListener，并将其存储在支持 #getActionListeners 方法的内部数据结构中，小心地重写通过以前调用 setActionListener 存储的任何实例。

此表达式所引用的任何方法都必须是公共的，返回类型为 void，并接受类型为 ActionEvent 的单个参数。

deprecated 此方法已由 #addActionListener(javax.faces.event.ActionListener) 替代。
英文文档：

setActionListener

public void setActionListener(MethodBinding actionListener)
Deprecated. This has been replaced by addActionListener(javax.faces.event.ActionListener).

Wrap the argument actionListener in an implementation of ActionListener and store it in the internal data structure that backs the ActionSource.getActionListeners() method, taking care to over-write any instance that was stored by a previous call to setActionListener.

Any method referenced by such an expression must be public, with a return type of void, and accept a single parameter of type ActionEvent.

Specified by:
setActionListener in interface ActionSource
Parameters:
actionListener - The new method binding expression

public boolean isImmediate()
英文文档：

isImmediate

public boolean isImmediate()
Description copied from interface: ActionSource

Return a flag indicating that the default ActionListener provided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase. The default value for this property must be false.

Specified by:
isImmediate in interface ActionSource

public void setImmediate(boolean immediate)
英文文档：

setImmediate

public void setImmediate(boolean immediate)
Description copied from interface: ActionSource

Set the "immediate execution" flag for this UIComponent.

Specified by:
setImmediate in interface ActionSource
Parameters:
immediate - The new immediate execution flag

public Object getValue()

返回 UICommand 的 value 属性。这通常呈现为一个标签。

英文文档：

getValue

public Object getValue()

Returns the value property of the UICommand. This is most often rendered as a label.

public void setValue(Object value)

设置 UICommand 的 value 属性。这通常呈现为一个标签。

value 新值
英文文档：

setValue

public void setValue(Object value)

Sets the value property of the UICommand. This is most often rendered as a label.

Parameters:
value - the new value

public MethodExpression getActionExpression()
英文文档：

getActionExpression

public MethodExpression getActionExpression()
Description copied from interface: ActionSource2

Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Note that it's possible that the returned MethodExpression is just a wrapper around a MethodBinding instance whith was set by a call to ActionSource.setAction(javax.faces.el.MethodBinding). This makes it possible for the default ActionListener to continue to work properly with older components.

Specified by:
getActionExpression in interface ActionSource2

public void setActionExpression(MethodExpression actionExpression)
英文文档：

setActionExpression

public void setActionExpression(MethodExpression actionExpression)
Description copied from interface: ActionSource2

Set the MethodExpression pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

Specified by:
setActionExpression in interface ActionSource2
Parameters:
actionExpression - The new method expression

public void addActionListener(ActionListener listener)
Throws NullPointerException: NullPointerException 如果 listener 为 null
英文文档：

addActionListener

public void addActionListener(ActionListener listener)
Description copied from interface: ActionSource

Add a new ActionListener to the set of listeners interested in being notified when ActionEvents occur.

Specified by:
addActionListener in interface ActionSource
Parameters:
listener - The ActionListener to be added
Throws:
NullPointerException - if listener is null

public ActionListener[] getActionListeners()
英文文档：

getActionListeners

public ActionListener[] getActionListeners()
Description copied from interface: ActionSource

Return the set of registered ActionListeners for this ActionSource instance. If there are no registered listeners, a zero-length array is returned.

Specified by:
getActionListeners in interface ActionSource

public void removeActionListener(ActionListener listener)
Throws NullPointerException: NullPointerException 如果 listener 为 null
英文文档：

removeActionListener

public void removeActionListener(ActionListener listener)
Description copied from interface: ActionSource

Remove an existing ActionListener (if any) from the set of listeners interested in being notified when ActionEvents occur.

Specified by:
removeActionListener in interface ActionSource
Parameters:
listener - The ActionListener to be removed
Throws:
NullPointerException - if listener is null

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase

public void broadcast(FacesEvent event) throws AbortProcessingException

除了默认的 UIComponent#broadcast 处理外，将要广播的 ActionEvent 传递给 actionListener 引用的方法（如果有），以及传递给 javax.faces.application.Application 上注册的默认 ActionListener。

event | 要广播的 FacesEvent
Throws | AbortProcessingException: 通知 JavaServer Face 实现不应该继续处理当前事件
Throws | IllegalArgumentException: 如果此组件不支持此 FacesEvent 的实现类
Throws | NullPointerException: 如果 event 为 null
英文文档：

broadcast

public void broadcast(FacesEvent event)
               throws AbortProcessingException

In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent) processing, pass the ActionEvent being broadcast to the method referenced by actionListener (if any), and to the default ActionListener registered on the Application.

Overrides:
broadcast in class UIComponentBase
Parameters:
event - FacesEvent to be broadcast
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
IllegalArgumentException - if the implementation class of this FacesEvent is not supported by this component
NullPointerException - if event is null

public void queueEvent(FacesEvent e)

截取 ActionEvent 的 queueEvent，且如果 immediate 标志为 true，则将事件的 phaseId 标记为 PhaseId.APPLY_REQUEST_VALUES，否则标记为 PhaseId.INVOKE_APPLICATION。

英文文档：

queueEvent

public void queueEvent(FacesEvent e)

Intercept queueEvent and, for ActionEvents, mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise.

Overrides:
queueEvent in class UIComponentBase
Parameters:
e - FacesEvent to be queued
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIComponent (Java EE 5)

javax.faces.component
Class UIComponent

java.lang.Object
    extended by  javax.faces.component.UIComponent
All Implemented Interfaces:
StateHolder
Direct Known Subclasses:
UIComponentBase
public abstract class UIComponent
extends Object
implements StateHolder

Implements: StateHolder
Extended by: UIComponentBase

UIComponent 是 JavaServer Faces 中所有用户界面组件的基类。与特定请求和响应关联的 UIComponent 实例集合被组织成表示整个请求或响应内容的 UIViewRoot 下的组件树。

为了方便组件开发人员使用，UIComponentBase 提供了为 UIComponent 指定的默认行为，并且是所有具体 UIComponent“基本”实现的基类。鼓励组件编写者为 UIComponentBase 创建子类，而不是直接实现此抽象类，以减少将来更改方法签名所带来的影响。

英文文档：

UIComponent is the base class for all user interface components in JavaServer Faces. The set of UIComponent instances associated with a particular request and response are organized into a component tree under a UIViewRoot that represents the entire content of the request or response.

For the convenience of component developers, UIComponentBase provides the default behavior that is specified for a UIComponent, and is the base class for all of the concrete UIComponent "base" implementations. Component writers are encouraged to subclass UIComponentBase, instead of directly implementing this abstract class, to reduce the impact of any future changes to the method signatures.

Field Summary
protected  Map<String,ValueExpression> bindings
Constructor Summary
UIComponent()
Method Summary
protected abstract  void addFacesListener(FacesListener listener)
Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent.
abstract  void broadcast(FacesEvent event)
Broadcast the specified FacesEvent to all registered event listeners who have expressed an interest in events of this type.
abstract  void decode(FacesContext context)
Decode any new state of this UIComponent from the request contained in the specified FacesContext, and store this state as needed.
 void encodeAll(FacesContext context)
If this component returns true from isRendered(), render this component and all its children that return true from isRendered(), regardless of the value of the getRendersChildren() flag.
abstract  void encodeBegin(FacesContext context)
If our rendered property is true, render the beginning of the current state of this UIComponent to the response contained in the specified FacesContext.
abstract  void encodeChildren(FacesContext context)
If our rendered property is true, render the child UIComponents of this UIComponent.
abstract  void encodeEnd(FacesContext context)
If our rendered property is true, render the ending of the current state of this UIComponent.
abstract  UIComponent findComponent(String expr)
Search for and return the UIComponent with an id that matches the specified search expression (if any), according to the algorithm described below.
abstract  Map<String,Object> getAttributes()
Return a mutable Map representing the attributes (and properties, see below) associated wth this UIComponent, keyed by attribute name (which must be a String).
abstract  int getChildCount()
Return the number of child UIComponents that are associated with this UIComponent.
abstract  List<UIComponent> getChildren()
Return a mutable List representing the child UIComponents associated with this component.
abstract  String getClientId(FacesContext context)
Return a client-side identifier for this component, generating one if necessary.
 String getContainerClientId(FacesContext context)
Allow components that implement NamingContainer to selectively disable prepending their clientId to their descendent's clientIds by breaking the prepending logic into a seperately callable method.
protected abstract  FacesContext getFacesContext()
Convenience method to return the FacesContext instance for the current request.
protected abstract  FacesListener[] getFacesListeners(Class clazz)
Return an array of registered FacesListeners that are instances of the specified class.
abstract  UIComponent getFacet(String name)
Convenience method to return the named facet, if it exists, or null otherwise.
 int getFacetCount()
Return the number of facet UIComponents that are associated with this UIComponent.
abstract  Map<String,UIComponent> getFacets()
Return a mutable Map representing the facet UIComponents associated with this UIComponent, keyed by facet name (which must be a String).
abstract  Iterator<UIComponent> getFacetsAndChildren()
Return an Iterator over the facet followed by child UIComponents of this UIComponent.
abstract  String getFamily()
Return the identifier of the component family to which this component belongs.
abstract  String getId()
Return the component identifier of this UIComponent.
abstract  UIComponent getParent()
Return the parent UIComponent of this UIComponent, if any.
protected abstract  Renderer getRenderer(FacesContext context)
Convenience method to return the Renderer instance associated with this component, if any; otherwise, return null.
abstract  String getRendererType()
Return the Renderer type for this UIComponent (if any).
abstract  boolean getRendersChildren()
Return a flag indicating whether this component is responsible for rendering its child components.
abstract  ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by getValueExpression(java.lang.String).
 ValueExpression getValueExpression(String name)
Return the ValueExpression used to calculate the value for the specified attribute or property name, if any.
 boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback)
Starting at this component in the View hierarchy, search for a component with a clientId equal to the argument clientId and, if found, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing the current FacesContext and the found component as arguments.
abstract  boolean isRendered()
Return true if this component (and its children) should be rendered during the Render Response phase of the request processing lifecycle.
abstract  void processDecodes(FacesContext context)
Perform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
abstract  void processRestoreState(FacesContext context, Object state)
Perform the component tree processing required by the Restore View phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
abstract  Object processSaveState(FacesContext context)
Perform the component tree processing required by the state saving portion of the Render Response phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
abstract  void processUpdates(FacesContext context)
Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
abstract  void processValidators(FacesContext context)
Perform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
abstract  void queueEvent(FacesEvent event)
Queue an event for broadcast at the end of the current request processing lifecycle phase.
protected abstract  void removeFacesListener(FacesListener listener)
Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent.
abstract  void setId(String id)
Set the component identifier of this UIComponent (if any).
abstract  void setParent(UIComponent parent)
Set the parent UIComponent of this UIComponent.
abstract  void setRendered(boolean rendered)
Set the rendered property of this UIComponent.
abstract  void setRendererType(String rendererType)
Set the Renderer type for this UIComponent, or null for components that render themselves.
abstract  void setValueBinding(String name, ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).
 void setValueExpression(String name, ValueExpression binding)
Set the ValueExpression used to calculate the value for the specified attribute or property name, if any.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.StateHolder
isTransient, restoreState, saveState, setTransient

Field Detail

英文文档：

bindings

protected Map<String,ValueExpression> bindings
Constructor Detail

public UIComponent()
英文文档：

UIComponent

public UIComponent()
Method Detail

abstract public java.util.Map<K, V> getAttributes()

返回表示与此 UIComponent 关联的属性（以及特性，参见下文）的可变 Map，以属性名称（必须是 String）作为键。返回的实现必须支持所有标准的和可选的 Map 方法，并支持以下附加要求：

  • Map 实现必须实现 java.io.Serializable 接口。
  • 任何添加 null 键或值的尝试都必定抛出 NullPointerException。
  • 任何添加非 String 键的尝试都必定抛出 ClassCastException。
  • 如果指定为键的属性名称与此 UIComponent 实现类的某个属性相匹配，则下列方法将具有特殊行为：
    • containsKey - 返回 false。
    • get() - 如果属性是可读的，则调用获取方法并返回已返回的值（在其相应的包装器类中包装基本值）；否则抛出 IllegalArgumentException。
    • put() - 如果属性是可写的，则调用设置方法以设置相应的值（在其相应包装器类中对基本值解包）。如果属性是不可写的，或尝试将基本类型的属性设置为 null，则抛出 IllegalArgumentException。
    • remove - 抛出 IllegalArgumentException。
英文文档：

getAttributes

public abstract Map<String,Object> getAttributes()

Return a mutable Map representing the attributes (and properties, see below) associated wth this UIComponent, keyed by attribute name (which must be a String). The returned implementation must support all of the standard and optional Map methods, plus support the following additional requirements:

  • The Map implementation must implement the java.io.Serializable interface.
  • Any attempt to add a null key or value must throw a NullPointerException.
  • Any attempt to add a key that is not a String must throw a ClassCastException.
  • If the attribute name specified as a key matches a property of this UIComponent's implementation class, the following methods will have special behavior:
    • containsKey - Return false.
    • get() - If the property is readable, call the getter method and return the returned value (wrapping primitive values in their corresponding wrapper classes); otherwise throw IllegalArgumentException.
    • put() - If the property is writeable, call the setter method to set the corresponding value (unwrapping primitive values in their corresponding wrapper classes). If the property is not writeable, or an attempt is made to set a property of primitive type to null, throw IllegalArgumentException.
    • remove - Throw IllegalArgumentException.

abstract public ValueBinding getValueBinding(String name)

调用 #getValueExpression 并检查结果。如果结果是 #setValueBinding 中规定的包装器类的实例，则提取 ValueBinding 实例并将其返回。否则，在 ValueBinding 的实现中包装结果，并将其返回。

name | 要为其获取 ValueBinding 的属性的名称
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #getValueExpression 替代。
英文文档：

getValueBinding

public abstract ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by getValueExpression(java.lang.String).

Call through to getValueExpression(java.lang.String) and examine the result. If the result is an instance of the wrapper class mandated in setValueBinding(java.lang.String, javax.faces.el.ValueBinding), extract the ValueBinding instance and return it. Otherwise, wrap the result in an implementation of ValueBinding, and return it.

Parameters:
name - Name of the attribute or property for which to retrieve a ValueBinding
Throws:
NullPointerException - if name is null

abstract public void setValueBinding(String name, ValueBinding binding)

在 ValueExpression 的实现中包装参数 binding 并调用 #setValueExpression。

name | 将为其设置 ValueBinding 的属性的名称
binding | 要设置的 ValueBinding，或为 null 以移除任何当前设置的 ValueBinding
Throws | IllegalArgumentException: 如果 name 是 id 或 parent 之一
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #setValueExpression 替代。
英文文档：

setValueBinding

public abstract void setValueBinding(String name,
                                     ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).

Wrap the argument binding in an implementation of ValueExpression and call through to setValueExpression(java.lang.String, javax.el.ValueExpression).

Parameters:
name - Name of the attribute or property for which to set a ValueBinding
binding - The ValueBinding to set, or null to remove any currently set ValueBinding
Throws:
IllegalArgumentException - if name is one of id or parent
NullPointerException - if name is null

public ValueExpression getValueExpression(String name)

返回用于计算指定属性名称值的 ValueExpression（如果有）。

必须为遵守 JSF 1.2 及以后规范的组件重写并实现此方法。

since | 1.2
name | 要为其获取 ValueExpression 的属性的名称
Throws | NullPointerException: 如果 name 为 null
英文文档：

getValueExpression

public ValueExpression getValueExpression(String name)

Return the ValueExpression used to calculate the value for the specified attribute or property name, if any.

This method must be overridden and implemented for components that comply with JSF 1.2 and later.

Parameters:
name - Name of the attribute or property for which to retrieve a ValueExpression
Throws:
NullPointerException - if name is null
Since:
1.2

public void setValueExpression(String name, ValueExpression binding)

设置用于计算指定属性名称值的 ValueExpression（如果有）。

实现必须以参数 expression 调用 ValueExpression#isLiteralText。如果 isLiteralText() 返回 true，则以参数 expression 调用 ValueExpression#getValue，并将结果作为 value 参数传入对 this.#getAttributes().put(name, value) 的调用，其中 name 是参数 name。如果调用 ValueExpression#getValue 时抛出异常，则在 javax.faces.FacesException 中包装它并将其重新抛出。如果 isLiteralText() 返回 false，则仅将未求值的 expression 参数存储在参数 name 给定的键下的 ValueExpression 集合中。

必须为遵守 JSF 1.2 及以后规范的组件重写并实现此方法。

since | 1.2
name | 要为其设置 ValueExpression 的属性的名称
binding | 要设置的 ValueExpression，或为 null 以移除任何当前设置的 ValueExpression
Throws | IllegalArgumentException: 如果 name 是 id 或 parent 之一
Throws | NullPointerException: 如果 name 为 null
英文文档：

setValueExpression

public void setValueExpression(String name,
                               ValueExpression binding)

Set the ValueExpression used to calculate the value for the specified attribute or property name, if any.

The implementation must call Expression.isLiteralText() on the argument expression. If isLiteralText() returns true, invoke ValueExpression.getValue(javax.el.ELContext) on the argument expression and pass the result as the value parameter in a call to this.getAttributes().put(name, value) where name is the argument name. If an exception is thrown as a result of calling ValueExpression.getValue(javax.el.ELContext), wrap it in a FacesException and re-throw it. If isLiteralText() returns false, simply store the un-evaluated expression argument in the collection of ValueExpressions under the key given by the argument name.

This method must be overridden and implemented for components that comply with JSF 1.2 and later.

Parameters:
name - Name of the attribute or property for which to set a ValueExpression
binding - The ValueExpression to set, or null to remove any currently set ValueExpression
Throws:
IllegalArgumentException - if name is one of id or parent
NullPointerException - if name is null
Since:
1.2

abstract public String getClientId(FacesContext context)

返回此组件的客户端标识符，如果需要可以生成一个标识符。将会请求关联的 Renderer（如果有）将 clientId 转换为适合传送给客户端的形式。

此方法的返回值必须在实例的整个生命周期中保持一致，除非组件的 id 属性发生改变，或此组件所在的 NamingContainer 的客户端 ID 发生改变（例如，UIData）。但是，即使在这些情况下，对此方法的连续调用也必须总是返回相同的值。实现必须按照以下步骤确定 clientId：

在实现 NamingContainer 的视图层次结构中找到离此组件最近的祖先。调用它的 getContainerClientId() 并将结果保存为局部变量 parentId。调用此组件的 #getId，并将结果保存为局部变量 myId。如果 myId 为 null，则调用 context.getViewRoot().createUniqueId()，并将结果分配给 myId。如果 parentId 为非 null，则使 myId 等于 parentId + NamingContainer.SEPARATOR_CHAR + myId。调用 Renderer#convertClientId，同时传递 myId，并返回结果。

context | 当前请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

getClientId

public abstract String getClientId(FacesContext context)

Return a client-side identifier for this component, generating one if necessary. The associated Renderer, if any, will be asked to convert the clientId to a form suitable for transmission to the client.

The return from this method must be the same value throughout the lifetime of the instance, unless the id property of the component is changed, or the component is placed in a NamingContainer whose client ID changes (for example, UIData). However, even in these cases, consecutive calls to this method must always return the same value. The implementation must follow these steps in determining the clientId:

Find the closest ancestor to this component in the view hierarchy that implements NamingContainer. Call getContainerClientId() on it and save the result as the parentId local variable. Call getId() on this component and save the result as the myId local variable. If myId is null, call context.getViewRoot().createUniqueId() and assign the result to myId. If parentId is non-null, let myId equal parentId + NamingContainer.SEPARATOR_CHAR + myId. Call Renderer.convertClientId(javax.faces.context.FacesContext, java.lang.String), passing myId, and return the result.

Parameters:
context - The FacesContext for the current request
Throws:
NullPointerException - if context is null

public String getContainerClientId(FacesContext context)

通过将前置逻辑分离到一个单独的可调用方法，使实现 NamingContainer 的组件能够有选择地禁用将其 clientId 放到其后代的 clientId 前面的行为。有关用法，请参见 #getClientId。

默认情况下，此方法将调用 #getClientId 并返回结果。

since | 1.2
Throws | NullPointerException: 如果 context 为 null
英文文档：

getContainerClientId

public String getContainerClientId(FacesContext context)

Allow components that implement NamingContainer to selectively disable prepending their clientId to their descendent's clientIds by breaking the prepending logic into a seperately callable method. See getClientId(javax.faces.context.FacesContext) for usage.

By default, this method will call through to getClientId(javax.faces.context.FacesContext) and return the result.

Throws:
NullPointerException - if context is null
Since:
1.2

abstract public String getFamily()

返回此组件所属的组件家族的标识符。此标识符（结合 rendererType 属性的值）可用于为此组件实例选择合适的 Renderer。

英文文档：

getFamily

public abstract String getFamily()

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

abstract public String getId()

返回此 UIComponent 的组件标识符。

英文文档：

getId

public abstract String getId()

Return the component identifier of this UIComponent.

abstract public void setId(String id)

设置此 UIComponent 的组件标识符（如果有）。组件标识符必须符合以下语法限制：

  • 不得为长度为 0 的 String。
  • 第一个字符必须为字母或下划线 ('_')。
  • 后续字符必须为字母、数字、下划线 ('_') 或短划线 ('-')。

组件标识符还必须遵守下列语义限制（请注意，setId() 实现不执行此限制）：

  • 指定的标识符必须在所有组件（包括 facet）之间是唯一的，这些组件是距离最近的 NamingContainer 祖先 UIComponent 的后代；如果不存在这样一个 NamingContainer 祖先，则它必须在整个组件树范围内是唯一的。
id | 新组件标识符，或为 null 以指示此 UIComponent 没有组件标识符
Throws | IllegalArgumentException: 如果 id 语法无效
英文文档：

setId

public abstract void setId(String id)

Set the component identifier of this UIComponent (if any). Component identifiers must obey the following syntax restrictions:

  • Must not be a zero-length String.
  • First character must be a letter or an underscore ('_').
  • Subsequent characters must be a letter, a digit, an underscore ('_'), or a dash ('-').

Component identifiers must also obey the following semantic restrictions (note that this restriction is NOT enforced by the setId() implementation):

  • The specified identifier must be unique among all the components (including facets) that are descendents of the nearest ancestor UIComponent that is a NamingContainer, or within the scope of the entire component tree if there is no such ancestor that is a NamingContainer.

Parameters:
id - The new component identifier, or null to indicate that this UIComponent does not have a component identifier
Throws:
IllegalArgumentException - if id is not syntactically valid

abstract public UIComponent getParent()

返回此 UIComponent 的父 UIComponent（如果有）。组件必须允许将子组件添加到此组件的子组件列表中，或从该列表中将其移除，即使子组件从 getParent( ) 返回 null。

英文文档：

getParent

public abstract UIComponent getParent()

Return the parent UIComponent of this UIComponent, if any. A component must allow child components to be added to and removed from the list of children of this component, even though the child component returns null from getParent( ).

abstract public void setParent(UIComponent parent)

设置此 UIComponent 的父 UIComponent。此方法绝不能由开发人员调用；在将组件添加到父组件的子 List 或 facet Map 中，或从中移除组件时，UIComponent 的内部实现会调用它。

parent 新父组件，或对于组件树的根节点而言，为 null
英文文档：

setParent

public abstract void setParent(UIComponent parent)

Set the parent UIComponent of this UIComponent. This method must never be called by developers; a UIComponent's internal implementation will call it as components are added to or removed from a parent's child List or facet Map.

Parameters:
parent - The new parent, or null for the root node of a component tree

abstract public boolean isRendered()

如果应在请求处理生命周期的呈现响应 阶段呈现此组件（及其子组件），则返回 true。

英文文档：

isRendered

public abstract boolean isRendered()

Return true if this component (and its children) should be rendered during the Render Response phase of the request processing lifecycle.

abstract public void setRendered(boolean rendered)

设置此 UIComponent 的 rendered 属性。

rendered 如果为 true，则呈现此组件；否则不呈现此组件。
英文文档：

setRendered

public abstract void setRendered(boolean rendered)

Set the rendered property of this UIComponent.

Parameters:
rendered - If true render this component; otherwise, do not render this component

abstract public String getRendererType()

返回此 UIComponent 的 Renderer 类型（如果有）。

英文文档：

getRendererType

public abstract String getRendererType()

Return the Renderer type for this UIComponent (if any).

abstract public void setRendererType(String rendererType)

设置此 UIComponent 的 Renderer 类型，或对于自呈现组件而言，为 null。

rendererType 要使用的 Renderer 类型的逻辑标识符，或对于自呈现组件而言，为 null
英文文档：

setRendererType

public abstract void setRendererType(String rendererType)

Set the Renderer type for this UIComponent, or null for components that render themselves.

Parameters:
rendererType - Logical identifier of the type of Renderer to use, or null for components that render themselves

abstract public boolean getRendersChildren()

返回一个标志，指示此组件是否负责呈现其子组件。UIComponentBase#getRendersChildren 的默认实现会尝试查找此组件的 renderer。如果找到，它将调用 Renderer#getRendersChildren 并返回结果。如果未找到，它将返回 false。自 JavaServer Faces 规范 1.2 版起，鼓励组件编写者通过此方法返回 true，并依靠 UIComponentBase#encodeChildren。

英文文档：

getRendersChildren

public abstract boolean getRendersChildren()

Return a flag indicating whether this component is responsible for rendering its child components. The default implementation in UIComponentBase.getRendersChildren() tries to find the renderer for this component. If it does, it calls Renderer.getRendersChildren() and returns the result. If it doesn't, it returns false. As of version 1.2 of the JavaServer Faces Specification, component authors are encouraged to return true from this method and rely on UIComponentBase.encodeChildren(javax.faces.context.FacesContext).

abstract public java.util.List<E> getChildren()

返回表示与此组件关联的子 UIComponent 的可变 List。返回的实现必须支持所有标准的和可选的 List 方法，并支持以下附加要求：

  • List 实现必须实现 java.io.Serializable 接口。
  • 任何添加 null 的尝试都必定抛出 NullPointerException。
  • 任何添加未实现 UIComponent 的对象的尝试都必定抛出 ClassCastException。
  • 只要添加新的子组件，该子组件的 parent 属性就必须设置为此组件实例。如果子组件的 parent 属性已经是非 null，则必须首先从此组件以前的父组件中移除此子组件（在该父组件中它可能已经是子组件或 facet）。
  • 只要移除现有的子组件，该子组件的 parent 属性就必须设置为 null。
英文文档：

getChildren

public abstract List<UIComponent> getChildren()

Return a mutable List representing the child UIComponents associated with this component. The returned implementation must support all of the standard and optional List methods, plus support the following additional requirements:

  • The List implementation must implement the java.io.Serializable interface.
  • Any attempt to add a null must throw a NullPointerException
  • Any attempt to add an object that does not implement UIComponent must throw a ClassCastException.
  • Whenever a new child component is added, the parent property of the child must be set to this component instance. If the parent property of the child was already non-null, the child must first be removed from its previous parent (where it may have been either a child or a facet).
  • Whenever an existing child component is removed, the parent property of the child must be set to null.

abstract public int getChildCount()

返回与此 UIComponent 关联的子 UIComponent 的数量。如果不存在子组件，则此方法必须返回 0。此方法不得导致创建子组件列表。

英文文档：

getChildCount

public abstract int getChildCount()

Return the number of child UIComponents that are associated with this UIComponent. If there are no children, this method must return 0. The method must not cause the creation of a child component list.

abstract public UIComponent findComponent(String expr)

按照如下所述的算法，搜索并返回带有与指定搜索表达式相匹配的 id 的 UIComponent（如果有）。

有关给定一个简单的 clientId 查找组件的方法，请参见 #invokeOnComponent。

要求组件标识符在包含此组件的距离最近的祖先 NamingContainer （可能是此组件本身）范围内是唯一的。如果此组件的祖先中不存在 NamingContainer 组件，则树的根组件将被视为 NamingContainer，不论其类是否实际实现 NamingContainer 接口。

搜索表达式 由一个标识符（该标识符与 UIComponent 的 id 属性完全匹配），或者一组通过 NamingContainer#SEPARATOR_CHAR 字符值链接的此类标识符组成。搜索算法应按照下列过程操作，尽管只要最终结果相同，也可以使用备用算法：

  • 标识作为搜索基本组件的 UIComponent，当满足下列条件之一时停止：
    • 如果搜索表达式以分隔符字符开头（称为“绝对”搜索表达式），基本组件将是组件树的根 UIComponent。前导分隔符字符将会被去掉，搜索表达式的其余部分将被视为下文所述的“相对”搜索表达式。
    • 否则，如果此 UIComponent 是 NamingContainer，它将作为基本组件。
    • 否则，向上搜索此组件的父组件。如果遇到 NamingContainer，它将作为基本组件。
    • 否则（如果没有遇到 NamingContainer），则将根 UIComponent 作为基本组件。
  • 现在搜索表达式（可能在前面的步骤中修改过）是“相对”搜索表达式，将用于在基本组件范围内查找具有匹配 id 的组件（如果有）。匹配按照以下过程操作：
    • 如果搜索表达式是简单标识符，则将该值与 id 属性比较，然后在基本 UIComponent 的 facet 和子组件中递归（除非找到了后代 NamingContainer 才不搜索其自身的 facet 和子组件）。
    • 如果搜索表达式包含由分隔符字符分隔的多个标识符，则使用第一个标识符按上一条规则来查找 NamingContainer。然后，将调用此 NamingContainer 的 findComponent() 方法，同时传递搜索表达式的其余部分。
expr | 标识要返回的 UIComponent 的搜索表达式
return | 找到的 UIComponent；如果未找到组件，则返回 null。
Throws | IllegalArgumentException: 如果搜索表达式的中间标识符标识了非 NamingContainer 的 UIComponent
Throws | NullPointerException: 如果 expr 为 null
英文文档：

findComponent

public abstract UIComponent findComponent(String expr)

Search for and return the UIComponent with an id that matches the specified search expression (if any), according to the algorithm described below.

For a method to find a component given a simple clientId, see invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback).

Component identifiers are required to be unique within the scope of the closest ancestor NamingContainer that encloses this component (which might be this component itself). If there are no NamingContainer components in the ancestry of this component, the root component in the tree is treated as if it were a NamingContainer, whether or not its class actually implements the NamingContainer interface.

A search expression consists of either an identifier (which is matched exactly against the id property of a UIComponent, or a series of such identifiers linked by the NamingContainer.SEPARATOR_CHAR character value. The search algorithm should operates as follows, though alternate alogrithms may be used as long as the end result is the same:

  • Identify the UIComponent that will be the base for searching, by stopping as soon as one of the following conditions is met:
    • If the search expression begins with the the separator character (called an "absolute" search expression), the base will be the root UIComponent of the component tree. The leading separator character will be stripped off, and the remainder of the search expression will be treated as a "relative" search expression as described below.
    • Otherwise, if this UIComponent is a NamingContainer it will serve as the basis.
    • Otherwise, search up the parents of this component. If a NamingContainer is encountered, it will be the base.
    • Otherwise (if no NamingContainer is encountered) the root UIComponent will be the base.
  • The search expression (possibly modified in the previous step) is now a "relative" search expression that will be used to locate the component (if any) that has an id that matches, within the scope of the base component. The match is performed as follows:
    • If the search expression is a simple identifier, this value is compared to the id property, and then recursively through the facets and children of the base UIComponent (except that if a descendant NamingContainer is found, its own facets and children are not searched).
    • If the search expression includes more than one identifier separated by the separator character, the first identifier is used to locate a NamingContainer by the rules in the previous bullet point. Then, the findComponent() method of this NamingContainer will be called, passing the remainder of the search expression.

Parameters:
expr - Search expression identifying the UIComponent to be returned
Returns:
the found UIComponent, or null if the component was not found.
Throws:
IllegalArgumentException - if an intermediate identifier in a search expression identifies a UIComponent that is not a NamingContainer
NullPointerException - if expr is null

public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException

在视图层次结构中从此组件开始，搜索 clientId 等于参数 clientId 的组件；如果找到，则以参数 callback 调用 ContextCallback#invokeContextCallback 方法，同时将当前 FacesContext 和找到的组件作为参数传递。此方法与 #findComponent 类似，但它不支持前导 NamingContainer#SEPARATOR_CHAR 语法用于从视图的根进行搜索。

默认实现将首先检查 this.getClientId() 是否等于参数 clientId。如果等于，以参数 callback 调用 ContextCallback#invokeContextCallback 方法，同时传递 FacesContext 参数并将此 clientId 作为组件参数传递。如果回调抛出 Exception，则在 FacesException 中包装它并将其重新抛出。否则，返回 true。

否则，对 #getFacetsAndChildren 返回的每个组件，调用 invokeOnComponent()，同时按顺序将参数传递给此方法。invokeOnComponent() 首次返回 true 时，将中止遍历 Iterator 的其余部分并返回 true。

对于在参数 clientId 中找到的任何状态，当调用 ContextCallback#invokeContextCallback 时，此方法的实现必须保证传递给回调的组件状态正确反映组件在视图层次结构中的位置。例如，像 UIData 之类的迭代组件将需要设置其行索引，以正确反映参数 clientId，然后再查找正确行支持的相应子组件。当回调正常返回或抛出 Exception 时，此方法的实现必须将视图状态恢复到调用回调前的状态。

如果 #getFacetsAndChildren 的任何一个元素都没有从 invokeOnComponent() 中返回 true，则返回 false。

一个简单的用法示例是通过 clientId 查找组件。

private UIComponent found = null;

private void doFind(FacesContext context, String clientId) {
  context.getViewRoot().invokeOnComponent(context, clientId,
      new ContextCallback() {
         public void invokeOnComponent(FacesContext context,
                                       UIComponent component) {
           found = component;
         }
      });
}

since | 1.2
context | 当前请求的 FacesContext
clientId | 要传递给参数 callback 的组件的客户端标识符。
callback | Callback 接口的实现。
Throws | NullPointerException: 如果任何参数为 null
Throws | FacesException: 如果参数 Callback 抛出 Exception，则将在 FacesException 中包装它并将其重新抛出。
return | 如果找到了具有给定 clientId 的组件，成功调用了回调方法，同时将该组件作为参数传递，而且未抛出 Exception，则返回 true。如果未找到具有给定 clientId 的组件，则返回 false。
英文文档：

invokeOnComponent

public boolean invokeOnComponent(FacesContext context,
                                 String clientId,
                                 ContextCallback callback)
                          throws FacesException

Starting at this component in the View hierarchy, search for a component with a clientId equal to the argument clientId and, if found, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing the current FacesContext and the found component as arguments. This method is similar to findComponent(java.lang.String) but it does not support the leading NamingContainer.SEPARATOR_CHAR syntax for searching from the root of the View.

The default implementation will first check if this.getClientId() is equal to the argument clientId. If so, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing through the FacesContext argument and passing this as the component argument. If an Exception is thrown by the callback, wrap it in a FacesException and re-throw it. Otherwise, return true.

Otherwise, for each component returned by getFacetsAndChildren(), call invokeOnComponent() passing the arguments to this method, in order. The first time invokeOnComponent() returns true, abort traversing the rest of the Iterator and return true.

When calling ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) the implementation of this method must guarantee that the state of the component passed to the callback correctly reflects the component's position in the View hierarchy with respect to any state found in the argument clientId. For example, an iterating component such as UIData will need to set its row index to correctly reflect the argument clientId before finding the appropriate child component backed by the correct row. When the callback returns, either normally or by throwing an Exception the implementation of this method must restore the state of the view to the way it was before invoking the callback.

If none of the elements from getFacetsAndChildren() returned true from invokeOnComponent(), return false.

Simple usage example to find a component by clientId.

private UIComponent found = null;

private void doFind(FacesContext context, String clientId) {
  context.getViewRoot().invokeOnComponent(context, clientId,
      new ContextCallback() {
         public void invokeOnComponent(FacesContext context,
                                       UIComponent component) {
           found = component;
         }
      });
}

Parameters:
context - the FacesContext for the current request
clientId - the client identifier of the component to be passed to the argument callback.
callback - an implementation of the Callback interface.
Returns:
true if the a component with the given clientId is found, the callback method was successfully invoked passing that component as an argument, and no Exception was thrown. Returns false if no component with the given clientId is found.
Throws:
NullPointerException - if any of the arguments are null
FacesException - if the argument Callback throws an Exception, it is wrapped in a FacesException and re-thrown.
Since:
1.2

abstract public java.util.Map<K, V> getFacets()

返回表示与此 UIComponent 关联的 facet UIComponent 的可变 Map，以 facet 名称（必须是 String）作为键。返回的实现必须支持所有标准的和可选的 Map 方法，并支持以下附加要求：

  • Map 实现必须实现 java.io.Serializable 接口。
  • 任何添加 null 键或值的尝试都必定抛出 NullPointerException。
  • 任何添加非 String 键的尝试都必定抛出 ClassCastException。
  • 任何添加非 UIComponent 的尝试都必定抛出 ClassCastException。
  • 只要添加新 facet UIComponent：
    • 组件的 parent 属性就必须设置为此组件实例。
    • 如果组件的 parent 属性已经是非 null，则必须首先从此组件以前的父组件中移除此组件（在该父组件中它可能已经是子组件或 facet）。
  • 只要移除现有的 facet UIComponent：
    • facet 的 parent 属性就必须设置为 null。
英文文档：

getFacets

public abstract Map<String,UIComponent> getFacets()

Return a mutable Map representing the facet UIComponents associated with this UIComponent, keyed by facet name (which must be a String). The returned implementation must support all of the standard and optional Map methods, plus support the following additional requirements:

  • The Map implementation must implement the java.io.Serializable interface.
  • Any attempt to add a null key or value must throw a NullPointerException.
  • Any attempt to add a key that is not a String must throw a ClassCastException.
  • Any attempt to add a value that is not a UIComponent must throw a ClassCastException.
  • Whenever a new facet UIComponent is added:
    • The parent property of the component must be set to this component instance.
    • If the parent property of the component was already non-null, the component must first be removed from its previous parent (where it may have been either a child or a facet).
  • Whenever an existing facet UIComponent is removed:
    • The parent property of the facet must be set to null.

public int getFacetCount()

返回与此 UIComponent 关联的 facet UIComponent 的数量。如果不存在 facet，则此方法必须返回 0。此方法不得导致创建 facet 组件映射。

为了与直接扩展 UIComponent 的类向后兼容，提供了默认实现，只需调用 #getFacets，然后对返回的 Map 调用 size() 方法即可。UIComponentBase#getFacetCount 中提供了此方法的更优化版本。

since 1.2
英文文档：

getFacetCount

public int getFacetCount()

Return the number of facet UIComponents that are associated with this UIComponent. If there are no facets, this method must return 0. The method must not cause the creation of a facet component map.

For backwards compatability with classes that extend UIComponent directly, a default implementation is provided that simply calls getFacets() and then calls the size() method on the returned Map. A more optimized version of this method is provided in UIComponentBase.getFacetCount().

Since:
1.2

abstract public UIComponent getFacet(String name)

一个便捷方法，如果指定的 facet 存在，则返回指定的 facet，否则返回 null。如果请求的 facet 不存在，则不得创建 facet Map。

name 所需 facet 的名称
英文文档：

getFacet

public abstract UIComponent getFacet(String name)

Convenience method to return the named facet, if it exists, or null otherwise. If the requested facet does not exist, the facets Map must not be created.

Parameters:
name - Name of the desired facet

abstract public java.util.Iterator<E> getFacetsAndChildren()

返回 facet 上的 Iterator，该 facet 后跟此 UIComponent 的子 UIComponent。返回的 facet 没有固定的顺序，所有子组件按其在子组件列表中存储的顺序跟在 facet 后面。如果此组件没有 facet 或子组件，则返回空 Iterator。

返回的 Iterator 不得支持 remove() 操作。

英文文档：

getFacetsAndChildren

public abstract Iterator<UIComponent> getFacetsAndChildren()

Return an Iterator over the facet followed by child UIComponents of this UIComponent. Facets are returned in an undefined order, followed by all the children in the order they are stored in the child list. If this component has no facets or children, an empty Iterator is returned.

The returned Iterator must not support the remove() operation.

abstract public void broadcast(FacesEvent event) throws AbortProcessingException

将指定的 FacesEvent 广播到表示关注此类型事件的所有注册的事件侦听器。侦听器按其添加的顺序调用。

event | 要广播的 FacesEvent
Throws | AbortProcessingException: 通知 JavaServer Face 实现不应该继续处理当前事件
Throws | IllegalArgumentException: 如果此组件不支持此 FacesEvent 的实现类
Throws | NullPointerException: 如果 event 为 null
英文文档：

broadcast

public abstract void broadcast(FacesEvent event)
                        throws AbortProcessingException

Broadcast the specified FacesEvent to all registered event listeners who have expressed an interest in events of this type. Listeners are called in the order in which they were added.

Parameters:
event - The FacesEvent to be broadcast
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
IllegalArgumentException - if the implementation class of this FacesEvent is not supported by this component
NullPointerException - if event is null

abstract public void decode(FacesContext context)

从指定 FacesContext 包含的请求中对此 UIComponent 的任何新状态解码，并在需要时存储此状态。

在解码过程中，通过调用 queueEvent()，可将事件排队，以便稍后处理（由已注册关注此事件的事件侦听器处理）。

context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

decode

public abstract void decode(FacesContext context)

Decode any new state of this UIComponent from the request contained in the specified FacesContext, and store this state as needed.

During decoding, events may be enqueued for later processing (by event listeners who have registered an interest), by calling queueEvent().

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

abstract public void encodeBegin(FacesContext context) throws java.io.IOException

如果 rendered 属性为 true，则将此 UIComponent 的当前状态的开头呈现给指定 FacesContext 中包含的响应。

如果 Renderer 与此 UIComponent 关联，则实际编码操作将委托给 encodeBegin(FacesContext, UIComponent)。

context | 要创建的响应的 FacesContext
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 为 null
英文文档：

encodeBegin

public abstract void encodeBegin(FacesContext context)
                          throws IOException

If our rendered property is true, render the beginning of the current state of this UIComponent to the response contained in the specified FacesContext.

If a Renderer is associated with this UIComponent, the actual encoding will be delegated to Renderer.encodeBegin(FacesContext, UIComponent).

Parameters:
context - FacesContext for the response we are creating
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context is null

abstract public void encodeChildren(FacesContext context) throws java.io.IOException

如果 rendered 属性为 true，则呈现此 UIComponent 的子 UIComponent。仅当 rendersChildren 属性为 true 时才调用此方法。

如果 Renderer 与此 UIComponent 关联，则实际编码操作将委托给 encodeChildren(FacesContext, UIComponent)。

context | 要创建的响应的 FacesContext
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 为 null
英文文档：

encodeChildren

public abstract void encodeChildren(FacesContext context)
                             throws IOException

If our rendered property is true, render the child UIComponents of this UIComponent. This method will only be called if the rendersChildren property is true.

If a Renderer is associated with this UIComponent, the actual encoding will be delegated to Renderer.encodeChildren(FacesContext, UIComponent).

Parameters:
context - FacesContext for the response we are creating
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context is null

abstract public void encodeEnd(FacesContext context) throws java.io.IOException

如果 rendered 属性为 true，则呈现此 UIComponent 的当前状态的末尾。

如果 Renderer 与此 UIComponent 关联，则实际编码操作将委托给 encodeEnd(FacesContext, UIComponent)。

context | 要创建的响应的 FacesContext
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 为 null
英文文档：

encodeEnd

public abstract void encodeEnd(FacesContext context)
                        throws IOException

If our rendered property is true, render the ending of the current state of this UIComponent.

If a Renderer is associated with this UIComponent, the actual encoding will be delegated to Renderer.encodeEnd(FacesContext, UIComponent).

Parameters:
context - FacesContext for the response we are creating
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context is null

public void encodeAll(FacesContext context) throws java.io.IOException

如果此组件从 #isRendered 返回 true，则呈现此组件及其从 isRendered() 返回 true 的所有子组件，不考虑 #getRendersChildren 标志的值。

since | 1.2
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 为 null
英文文档：

encodeAll

public void encodeAll(FacesContext context)
               throws IOException

If this component returns true from isRendered(), render this component and all its children that return true from isRendered(), regardless of the value of the getRendersChildren() flag.

Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context is null
Since:
1.2

abstract protected void addFacesListener(FacesListener listener)

将指定的 FacesListener 添加到注册了接收此 UIComponent 事件通知的侦听器集合。预计作为事件源的 UIComponent 类将具有相应的类型安全 API 用于注册所需类型的侦听器，并且这些注册方法的实现将委托给此方法。例如：

public class FooEvent extends FacesEvent { ... }

public interface FooListener extends FacesListener {
public void processFoo(FooEvent event);
 }

public class FooComponent extends UIComponentBase {
   ...
public void addFooListener(FooListener listener) {
addFacesListener(listener);
   }
public void removeFooListener(FooListener listener) {
removeFacesListener(listener);
   }
   ...
 }

listener | 要注册的 FacesListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

addFacesListener

protected abstract void addFacesListener(FacesListener listener)

Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent. It is expected that UIComponent classes acting as event sources will have corresponding typesafe APIs for registering listeners of the required type, and the implementation of those registration methods will delegate to this method. For example:

 public class FooEvent extends FacesEvent { ... }

 public interface FooListener extends FacesListener {
   public void processFoo(FooEvent event);
 }

 public class FooComponent extends UIComponentBase {
   ...
   public void addFooListener(FooListener listener) {
     addFacesListener(listener);
   }
   public void removeFooListener(FooListener listener) {
     removeFacesListener(listener);
   }
   ...
 }

Parameters:
listener - The FacesListener to be registered
Throws:
NullPointerException - if listener is null

abstract protected FacesListener[] getFacesListeners(Class<T> clazz)

返回作为指定类实例的已注册 FacesListener 的数组。如果不存在此类已注册侦听器，则返回一个长度为 0 的数组。返回的数组可以安全地强制转换为 clazz 元素类型的强制类型数组。

clazz | 必须由其要返回的 FacesListener 实现的类
Throws | IllegalArgumentException: 如果 clazz 不是 FacesListener 并且未实现 FacesListener
Throws | NullPointerException: 如果 clazz 为 null
英文文档：

getFacesListeners

protected abstract FacesListener[] getFacesListeners(Class clazz)

Return an array of registered FacesListeners that are instances of the specified class. If there are no such registered listeners, a zero-length array is returned. The returned array can be safely be cast to an array strongly typed to an element type of clazz.

Parameters:
clazz - Class that must be implemented by a FacesListener for it to be returned
Throws:
IllegalArgumentException - if class is not, and does not implement, FacesListener
NullPointerException - if clazz is null

abstract protected void removeFacesListener(FacesListener listener)

从注册接收此 UIComponent 事件通知的侦听器集合中移除指定的 FacesListener。

listener | 要取消注册的 FacesListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

removeFacesListener

protected abstract void removeFacesListener(FacesListener listener)

Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent.

Parameters:
listener - The FacesListener to be deregistered
Throws:
NullPointerException - if listener is null

abstract public void queueEvent(FacesEvent event)

将事件排队，以便在当前请求处理生命周期阶段结束时广播。UIComponentBase 中的默认实现必须将此调用委托给父 UIComponent 的 queueEvent() 方法。

event | 要排队的 FacesEvent
Throws | IllegalStateException: 如果此组件不是 UIViewRoot 的后代
Throws | NullPointerException: 如果 event 为 null
英文文档：

queueEvent

public abstract void queueEvent(FacesEvent event)

Queue an event for broadcast at the end of the current request processing lifecycle phase. The default implementation in UIComponentBase must delegate this call to the queueEvent() method of the parent UIComponent.

Parameters:
event - FacesEvent to be queued
Throws:
IllegalStateException - if this component is not a descendant of a UIViewRoot
NullPointerException - if event is null

abstract public void processRestoreState(FacesContext context, Object state)

按如下操作，对此组件的所有 facet、此组件的所有子组件和此组件本身执行请求处理生命周期的恢复视图 阶段所需的组件树处理。

  • 按照调用 getFacetsAndChildren() 所确定的顺序，调用此 UIComponent 的所有 facet 和子组件的 processRestoreState() 方法。
  • 调用此组件的 restoreState() 方法。

如果状态保存方法被设置为服务器，则可能不能调用此方法。

context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processRestoreState

public abstract void processRestoreState(FacesContext context,
                                         Object state)

Perform the component tree processing required by the Restore View phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • Call the processRestoreState() method of all facets and children of this UIComponent in the order determined by a call to getFacetsAndChildren().
  • Call the restoreState() method of this component.

This method may not be called if the state saving method is set to server.

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

abstract public void processDecodes(FacesContext context)

按如下操作，对此组件的所有 facet、此组件的所有子组件和此组件本身执行请求处理生命周期的应用请求值 阶段所需的组件树处理。

  • 如果此 UIComponent 的 rendered 属性为 false，则跳过进一步的处理。
  • 按照调用 getFacetsAndChildren() 所确定的顺序，调用此 UIComponent 的所有 facet 和子组件的 processDecodes() 方法。
  • 调用此组件的 decode() 方法。
  • 如果在解码处理期间抛出 RuntimeException，则调用 FacesContext#renderResponse 并重新抛出该异常。
context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processDecodes

public abstract void processDecodes(FacesContext context)

Perform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Call the processDecodes() method of all facets and children of this UIComponent, in the order determined by a call to getFacetsAndChildren().
  • Call the decode() method of this component.
  • If a RuntimeException is thrown during decode processing, call FacesContext.renderResponse() and re-throw the exception.

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

abstract public void processValidators(FacesContext context)

按如下操作，对此组件的所有 facet、此组件的所有子组件和此组件本身执行请求处理生命周期的处理验证 阶段所需的组件树处理。

  • 如果此 UIComponent 的 rendered 属性为 false，则跳过进一步的处理。
  • 按照调用 getFacetsAndChildren() 所确定的顺序，调用此 UIComponent 的所有 facet 和子组件的 processValidators() 方法。
context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processValidators

public abstract void processValidators(FacesContext context)

Perform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Call the processValidators() method of all facets and children of this UIComponent, in the order determined by a call to getFacetsAndChildren().

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

abstract public void processUpdates(FacesContext context)

按如下操作，对此组件的所有 facet、此组件的所有子组件和此组件本身执行请求处理生命周期的更新模型值 阶段所需的组件树处理。

  • 如果此 UIComponent 的 rendered 属性为 false，则跳过进一步的处理。
  • 按照调用 getFacetsAndChildren() 所确定的顺序，调用此 UIComponent 的所有 facet 和子组件的 processUpdates() 方法。
context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processUpdates

public abstract void processUpdates(FacesContext context)

Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Call the processUpdates() method of all facets and children of this UIComponent, in the order determined by a call to getFacetsAndChildren().

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

abstract public Object processSaveState(FacesContext context)

按如下操作，对此组件的所有 facet、此组件的所有子组件和此组件本身执行请求处理生命周期的呈现响应 阶段的状态保存部分所需的组件树处理。

  • 参考此组件的 transient 属性。如果为 true，则仅返回 null。
  • 按照调用 getFacetsAndChildren() 所确定的顺序，调用此 UIComponent 的所有 facet 和子组件的 processSaveState() 方法，跳过瞬态的子组件和 facet。
  • 调用此组件的 saveState() 方法。
  • 将子状态和所处状态封装到 Serializable Object 中并将其返回。

如果状态保存方法被设置为服务器，则可能不能调用此方法。

context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processSaveState

public abstract Object processSaveState(FacesContext context)

Perform the component tree processing required by the state saving portion of the Render Response phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • consult the transient property of this component. If true, just return null.
  • Call the processSaveState() method of all facets and children of this UIComponent in the order determined by a call to getFacetsAndChildren(), skipping children and facets that are transient.
  • Call the saveState() method of this component.
  • Encapsulate the child state and your state into a Serializable Object and return it.

This method may not be called if the state saving method is set to server.

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

abstract protected FacesContext getFacesContext()

一个便捷方法，返回当前请求的 FacesContext 实例。

英文文档：

getFacesContext

protected abstract FacesContext getFacesContext()

Convenience method to return the FacesContext instance for the current request.

abstract protected Renderer getRenderer(FacesContext context)

一个便捷方法，返回与此组件关联的 Renderer 实例（如果有）；否则返回 null。

context 当前请求的 FacesContext
英文文档：

getRenderer

protected abstract Renderer getRenderer(FacesContext context)

Convenience method to return the Renderer instance associated with this component, if any; otherwise, return null.

Parameters:
context - FacesContext for the current request
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIComponentBase (Java EE 5)

javax.faces.component
Class UIComponentBase

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
All Implemented Interfaces:
StateHolder
Direct Known Subclasses:
UIColumn, UICommand, UIData, UIForm, UIGraphic, UIMessage, UIMessages, UINamingContainer, UIOutput, UIPanel, UIParameter, UISelectItem, UISelectItems, UIViewRoot
public abstract class UIComponentBase
extends UIComponent

Extends: UIComponent
Extended by: UIColumn, UICommand, UIData, UIForm, UIGraphic, UIMessage, UIMessages, UINamingContainer, UIOutput, UIPanel, UIParameter, UISelectItem, UISelectItems, UIViewRoot

UIComponentBase 是一个便捷基类，实现 UIComponent 定义的所有方法的默认具体行为。

默认情况下，此类定义 getRendersChildren() 以查找此组件的 renderer 并调用其 getRendersChildren() 方法。Renderer 上的默认实现返回 false。自 JavaServer Faces 规范 1.2 版起，鼓励组件编写者从此方法返回 true，并依赖于此类和 Renderer 中的 #encodeChildren 的实现 (Renderer#encodeChildren)。相反，要管理其子组件呈现的子类应重写此方法以返回 true。

英文文档：

UIComponentBase is a convenience base class that implements the default concrete behavior of all methods defined by UIComponent.

By default, this class defines getRendersChildren() to find the renderer for this component and call its getRendersChildren() method. The default implementation on the Renderer returns false. As of version 1.2 of the JavaServer Faces Specification, component authors are encouraged to return true from this method and rely on the implementation of encodeChildren(javax.faces.context.FacesContext) in this class and in the Renderer (Renderer.encodeChildren(javax.faces.context.FacesContext, javax.faces.component.UIComponent)). Subclasses that wish to manage the rendering of their children should override this method to return true instead.

Field Summary
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIComponentBase()
Method Summary
protected  void addFacesListener(FacesListener listener)
Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent.
 void broadcast(FacesEvent event)
Broadcast the specified FacesEvent to all registered event listeners who have expressed an interest in events of this type.
 void decode(FacesContext context)
Decode any new state of this UIComponent from the request contained in the specified FacesContext, and store this state as needed.
 void encodeBegin(FacesContext context)
If our rendered property is true, render the beginning of the current state of this UIComponent to the response contained in the specified FacesContext.
 void encodeChildren(FacesContext context)
If our rendered property is true, render the child UIComponents of this UIComponent.
 void encodeEnd(FacesContext context)
If our rendered property is true, render the ending of the current state of this UIComponent.
 UIComponent findComponent(String expr)
Search for and return the UIComponent with an id that matches the specified search expression (if any), according to the algorithm described below.
 Map<String,Object> getAttributes()
Return a mutable Map representing the attributes (and properties, see below) associated wth this UIComponent, keyed by attribute name (which must be a String).
 int getChildCount()
Return the number of child UIComponents that are associated with this UIComponent.
 List<UIComponent> getChildren()
Return a mutable List representing the child UIComponents associated with this component.
 String getClientId(FacesContext context)
Return a client-side identifier for this component, generating one if necessary.
protected  FacesContext getFacesContext()
Convenience method to return the FacesContext instance for the current request.
protected  FacesListener[] getFacesListeners(Class clazz)
Return an array of registered FacesListeners that are instances of the specified class.
 UIComponent getFacet(String name)
Convenience method to return the named facet, if it exists, or null otherwise.
 int getFacetCount()
Return the number of facet UIComponents that are associated with this UIComponent.
 Map<String,UIComponent> getFacets()
Return a mutable Map representing the facet UIComponents associated with this UIComponent, keyed by facet name (which must be a String).
 Iterator<UIComponent> getFacetsAndChildren()
Return an Iterator over the facet followed by child UIComponents of this UIComponent.
 String getId()
Return the component identifier of this UIComponent.
 UIComponent getParent()
Return the parent UIComponent of this UIComponent, if any.
protected  Renderer getRenderer(FacesContext context)
Convenience method to return the Renderer instance associated with this component, if any; otherwise, return null.
 String getRendererType()
Return the Renderer type for this UIComponent (if any).
 boolean getRendersChildren()
Return a flag indicating whether this component is responsible for rendering its child components.
 ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by UIComponent.getValueExpression(java.lang.String).
 boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback)

Starting at this component in the View hierarchy, search for a component with a clientId equal to the argument clientId and, if found, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing the current FacesContext and the found component as arguments.

 boolean isRendered()
Return true if this component (and its children) should be rendered during the Render Response phase of the request processing lifecycle.
 boolean isTransient()
If true, the Object implementing this interface must not participate in state saving or restoring.
 void processDecodes(FacesContext context)
Perform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
 void processRestoreState(FacesContext context, Object state)
Perform the component tree processing required by the Restore View phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
 Object processSaveState(FacesContext context)
Perform the component tree processing required by the state saving portion of the Render Response phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
 void processUpdates(FacesContext context)
Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
 void processValidators(FacesContext context)
Perform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
 void queueEvent(FacesEvent event)
Queue an event for broadcast at the end of the current request processing lifecycle phase.
protected  void removeFacesListener(FacesListener listener)
Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent.
static Object restoreAttachedState(FacesContext context, Object stateObj)
This method is called by UIComponent subclasses that need to restore the objects they saved using saveAttachedState(javax.faces.context.FacesContext, java.lang.Object).
 void restoreState(FacesContext context, Object state)
Perform any processing required to restore the state from the entries in the state Object.
static Object saveAttachedState(FacesContext context, Object attachedObject)
This method is called by UIComponent subclasses that want to save one or more attached objects.
 Object saveState(FacesContext context)
Gets the state of the instance as a Serializable Object.
 void setId(String id)
Set the component identifier of this UIComponent (if any).
 void setParent(UIComponent parent)
Set the parent UIComponent of this UIComponent.
 void setRendered(boolean rendered)
Set the rendered property of this UIComponent.
 void setRendererType(String rendererType)
Set the Renderer type for this UIComponent, or null for components that render themselves.
 void setTransient(boolean transientFlag)
Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
 void setValueBinding(String name, ValueBinding binding)
Deprecated. This has been replaced by UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression).
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getFamily, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public UIComponentBase()
英文文档：

UIComponentBase

public UIComponentBase()
Method Detail

public java.util.Map<K, V> getAttributes()
英文文档：

getAttributes

public Map<String,Object> getAttributes()
Description copied from class: UIComponent

Return a mutable Map representing the attributes (and properties, see below) associated wth this UIComponent, keyed by attribute name (which must be a String). The returned implementation must support all of the standard and optional Map methods, plus support the following additional requirements:

  • The Map implementation must implement the java.io.Serializable interface.
  • Any attempt to add a null key or value must throw a NullPointerException.
  • Any attempt to add a key that is not a String must throw a ClassCastException.
  • If the attribute name specified as a key matches a property of this UIComponent's implementation class, the following methods will have special behavior:
    • containsKey - Return false.
    • get() - If the property is readable, call the getter method and return the returned value (wrapping primitive values in their corresponding wrapper classes); otherwise throw IllegalArgumentException.
    • put() - If the property is writeable, call the setter method to set the corresponding value (unwrapping primitive values in their corresponding wrapper classes). If the property is not writeable, or an attempt is made to set a property of primitive type to null, throw IllegalArgumentException.
    • remove - Throw IllegalArgumentException.

Specified by:
getAttributes in class UIComponent

public ValueBinding getValueBinding(String name)
NullPointerException

调用 #getValueExpression 并检查结果。如果结果是 #setValueBinding 中规定的包装器类的实例，则提取 ValueBinding 实例并将其返回。否则，在 ValueBinding 的实现中包装结果，并将其返回。

Throws | NullPointerException: NullPointerException 如果 name 为 null
deprecated | 此方法已由 #getValueExpression 替代。
英文文档：

getValueBinding

public ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by UIComponent.getValueExpression(java.lang.String).

Call through to UIComponent.getValueExpression(java.lang.String) and examine the result. If the result is an instance of the wrapper class mandated in UIComponent.setValueBinding(java.lang.String, javax.faces.el.ValueBinding), extract the ValueBinding instance and return it. Otherwise, wrap the result in an implementation of ValueBinding, and return it.

Specified by:
getValueBinding in class UIComponent
Parameters:
name - Name of the attribute or property for which to retrieve a ValueBinding
Throws:
NullPointerException - if name is null

public void setValueBinding(String name, ValueBinding binding)
NullPointerException

在 ValueExpression 的实现中包装参数 binding 并调用 #setValueExpression。

Throws | IllegalArgumentException: NullPointerException 如果 name 是 id 或 parent 之一
Throws | NullPointerException: NullPointerException 如果 name 为 null
deprecated | 此方法已由 #setValueExpression 替代。
英文文档：

setValueBinding

public void setValueBinding(String name,
                            ValueBinding binding)
Deprecated. This has been replaced by UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression).

Wrap the argument binding in an implementation of ValueExpression and call through to UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression).

Specified by:
setValueBinding in class UIComponent
Parameters:
name - Name of the attribute or property for which to set a ValueBinding
binding - The ValueBinding to set, or null to remove any currently set ValueBinding
Throws:
IllegalArgumentException - if name is one of id or parent
NullPointerException - if name is null

public String getClientId(FacesContext context)
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

getClientId

public String getClientId(FacesContext context)
Description copied from class: UIComponent

Return a client-side identifier for this component, generating one if necessary. The associated Renderer, if any, will be asked to convert the clientId to a form suitable for transmission to the client.

The return from this method must be the same value throughout the lifetime of the instance, unless the id property of the component is changed, or the component is placed in a NamingContainer whose client ID changes (for example, UIData). However, even in these cases, consecutive calls to this method must always return the same value. The implementation must follow these steps in determining the clientId:

Find the closest ancestor to this component in the view hierarchy that implements NamingContainer. Call getContainerClientId() on it and save the result as the parentId local variable. Call UIComponent.getId() on this component and save the result as the myId local variable. If myId is null, call context.getViewRoot().createUniqueId() and assign the result to myId. If parentId is non-null, let myId equal parentId + NamingContainer.SEPARATOR_CHAR + myId. Call Renderer.convertClientId(javax.faces.context.FacesContext, java.lang.String), passing myId, and return the result.

Specified by:
getClientId in class UIComponent
Parameters:
context - The FacesContext for the current request
Throws:
NullPointerException - if context is null

public String getId()
英文文档：

getId

public String getId()
Description copied from class: UIComponent

Return the component identifier of this UIComponent.

Specified by:
getId in class UIComponent

public void setId(String id)
Throws | IllegalArgumentException: NullPointerException 如果 id 语法无效
Throws | IllegalStateException: NullPointerException
英文文档：

setId

public void setId(String id)
Description copied from class: UIComponent

Set the component identifier of this UIComponent (if any). Component identifiers must obey the following syntax restrictions:

  • Must not be a zero-length String.
  • First character must be a letter or an underscore ('_').
  • Subsequent characters must be a letter, a digit, an underscore ('_'), or a dash ('-').

Component identifiers must also obey the following semantic restrictions (note that this restriction is NOT enforced by the setId() implementation):

  • The specified identifier must be unique among all the components (including facets) that are descendents of the nearest ancestor UIComponent that is a NamingContainer, or within the scope of the entire component tree if there is no such ancestor that is a NamingContainer.

Specified by:
setId in class UIComponent
Parameters:
id - The new component identifier, or null to indicate that this UIComponent does not have a component identifier
Throws:
IllegalArgumentException - if id is not syntactically valid
IllegalStateException

public UIComponent getParent()
英文文档：

getParent

public UIComponent getParent()
Description copied from class: UIComponent

Return the parent UIComponent of this UIComponent, if any. A component must allow child components to be added to and removed from the list of children of this component, even though the child component returns null from getParent( ).

Specified by:
getParent in class UIComponent

public void setParent(UIComponent parent)
英文文档：

setParent

public void setParent(UIComponent parent)
Description copied from class: UIComponent

Set the parent UIComponent of this UIComponent. This method must never be called by developers; a UIComponent's internal implementation will call it as components are added to or removed from a parent's child List or facet Map.

Specified by:
setParent in class UIComponent
Parameters:
parent - The new parent, or null for the root node of a component tree

public boolean isRendered()
英文文档：

isRendered

public boolean isRendered()
Description copied from class: UIComponent

Return true if this component (and its children) should be rendered during the Render Response phase of the request processing lifecycle.

Specified by:
isRendered in class UIComponent

public void setRendered(boolean rendered)
英文文档：

setRendered

public void setRendered(boolean rendered)
Description copied from class: UIComponent

Set the rendered property of this UIComponent.

Specified by:
setRendered in class UIComponent
Parameters:
rendered - If true render this component; otherwise, do not render this component

public String getRendererType()
英文文档：

getRendererType

public String getRendererType()
Description copied from class: UIComponent

Return the Renderer type for this UIComponent (if any).

Specified by:
getRendererType in class UIComponent

public void setRendererType(String rendererType)
英文文档：

setRendererType

public void setRendererType(String rendererType)
Description copied from class: UIComponent

Set the Renderer type for this UIComponent, or null for components that render themselves.

Specified by:
setRendererType in class UIComponent
Parameters:
rendererType - Logical identifier of the type of Renderer to use, or null for components that render themselves

public boolean getRendersChildren()
英文文档：

getRendersChildren

public boolean getRendersChildren()
Description copied from class: UIComponent

Return a flag indicating whether this component is responsible for rendering its child components. The default implementation in getRendersChildren() tries to find the renderer for this component. If it does, it calls Renderer.getRendersChildren() and returns the result. If it doesn't, it returns false. As of version 1.2 of the JavaServer Faces Specification, component authors are encouraged to return true from this method and rely on encodeChildren(javax.faces.context.FacesContext).

Specified by:
getRendersChildren in class UIComponent

public java.util.List<E> getChildren()
英文文档：

getChildren

public List<UIComponent> getChildren()
Description copied from class: UIComponent

Return a mutable List representing the child UIComponents associated with this component. The returned implementation must support all of the standard and optional List methods, plus support the following additional requirements:

  • The List implementation must implement the java.io.Serializable interface.
  • Any attempt to add a null must throw a NullPointerException
  • Any attempt to add an object that does not implement UIComponent must throw a ClassCastException.
  • Whenever a new child component is added, the parent property of the child must be set to this component instance. If the parent property of the child was already non-null, the child must first be removed from its previous parent (where it may have been either a child or a facet).
  • Whenever an existing child component is removed, the parent property of the child must be set to null.

Specified by:
getChildren in class UIComponent

public int getChildCount()
英文文档：

getChildCount

public int getChildCount()
Description copied from class: UIComponent

Return the number of child UIComponents that are associated with this UIComponent. If there are no children, this method must return 0. The method must not cause the creation of a child component list.

Specified by:
getChildCount in class UIComponent

public UIComponent findComponent(String expr)
Throws NullPointerException: NullPointerException 如果 expr 为 null
英文文档：

findComponent

public UIComponent findComponent(String expr)
Description copied from class: UIComponent

Search for and return the UIComponent with an id that matches the specified search expression (if any), according to the algorithm described below.

For a method to find a component given a simple clientId, see UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback).

Component identifiers are required to be unique within the scope of the closest ancestor NamingContainer that encloses this component (which might be this component itself). If there are no NamingContainer components in the ancestry of this component, the root component in the tree is treated as if it were a NamingContainer, whether or not its class actually implements the NamingContainer interface.

A search expression consists of either an identifier (which is matched exactly against the id property of a UIComponent, or a series of such identifiers linked by the NamingContainer.SEPARATOR_CHAR character value. The search algorithm should operates as follows, though alternate alogrithms may be used as long as the end result is the same:

  • Identify the UIComponent that will be the base for searching, by stopping as soon as one of the following conditions is met:
    • If the search expression begins with the the separator character (called an "absolute" search expression), the base will be the root UIComponent of the component tree. The leading separator character will be stripped off, and the remainder of the search expression will be treated as a "relative" search expression as described below.
    • Otherwise, if this UIComponent is a NamingContainer it will serve as the basis.
    • Otherwise, search up the parents of this component. If a NamingContainer is encountered, it will be the base.
    • Otherwise (if no NamingContainer is encountered) the root UIComponent will be the base.
  • The search expression (possibly modified in the previous step) is now a "relative" search expression that will be used to locate the component (if any) that has an id that matches, within the scope of the base component. The match is performed as follows:
    • If the search expression is a simple identifier, this value is compared to the id property, and then recursively through the facets and children of the base UIComponent (except that if a descendant NamingContainer is found, its own facets and children are not searched).
    • If the search expression includes more than one identifier separated by the separator character, the first identifier is used to locate a NamingContainer by the rules in the previous bullet point. Then, the findComponent() method of this NamingContainer will be called, passing the remainder of the search expression.

Specified by:
findComponent in class UIComponent
Parameters:
expr - Search expression identifying the UIComponent to be returned
Returns:
the found UIComponent, or null if the component was not found.
Throws:
NullPointerException - if expr is null

public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException
NullPointerException

在视图层次结构中从此组件开始，搜索 clientId 等于参数 clientId 的组件；如果找到，则以参数 callback 调用 ContextCallback#invokeContextCallback 方法，同时将当前 FacesContext 和找到的组件作为参数传递。此方法与 #findComponent 类似，但它不支持前导 NamingContainer#SEPARATOR_CHAR 语法用于从视图的根进行搜索。

默认实现将首先检查 this.getClientId() 是否等于参数 clientId。如果等于，以参数 callback 调用 ContextCallback#invokeContextCallback 方法，同时传递 FacesContext 参数并将此 clientId 作为组件参数传递。如果回调抛出 Exception，则在 FacesException 中包装它并将其重新抛出。否则，返回 true。

否则，对 #getFacetsAndChildren 返回的每个组件，调用 invokeOnComponent()，同时按顺序将参数传递给此方法。invokeOnComponent() 首次返回 true 时，将中止遍历 Iterator 的其余部分并返回 true。

对于在参数 clientId 中找到的任何状态，当调用 ContextCallback#invokeContextCallback 时，此方法的实现必须保证传递给回调的组件状态正确反映组件在视图层次结构中的位置。例如，像 UIData 之类的迭代组件将需要设置其行索引，以正确反映参数 clientId，然后再查找正确行支持的相应子组件。当回调正常返回或抛出 Exception 时，此方法的实现必须将视图状态恢复到调用回调前的状态。

如果 #getFacetsAndChildren 的任何一个元素都没有从 invokeOnComponent() 中返回 true，则返回 false。

一个简单的用法示例是通过 clientId 查找组件。

private UIComponent found = null;

private void doFind(FacesContext context, String clientId) {
  context.getViewRoot().invokeOnComponent(context, clientId,
      new ContextCallback() {
         public void invokeOnComponent(FacesContext context,
                                       UIComponent component) {
           found = component;
         }
      });
}

since | 1.2
Throws | NullPointerException: NullPointerException 如果任何参数为 null
Throws | FacesException: NullPointerException 如果参数 Callback 抛出 Exception，则将在 FacesException 中包装它并将其重新抛出。
英文文档：

invokeOnComponent

public boolean invokeOnComponent(FacesContext context,
                                 String clientId,
                                 ContextCallback callback)
                          throws FacesException

Starting at this component in the View hierarchy, search for a component with a clientId equal to the argument clientId and, if found, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing the current FacesContext and the found component as arguments. This method is similar to UIComponent.findComponent(java.lang.String) but it does not support the leading NamingContainer.SEPARATOR_CHAR syntax for searching from the root of the View.

The default implementation will first check if this.getClientId() is equal to the argument clientId. If so, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing through the FacesContext argument and passing this as the component argument. If an Exception is thrown by the callback, wrap it in a FacesException and re-throw it. Otherwise, return true.

Otherwise, for each component returned by UIComponent.getFacetsAndChildren(), call invokeOnComponent() passing the arguments to this method, in order. The first time invokeOnComponent() returns true, abort traversing the rest of the Iterator and return true.

When calling ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) the implementation of this method must guarantee that the state of the component passed to the callback correctly reflects the component's position in the View hierarchy with respect to any state found in the argument clientId. For example, an iterating component such as UIData will need to set its row index to correctly reflect the argument clientId before finding the appropriate child component backed by the correct row. When the callback returns, either normally or by throwing an Exception the implementation of this method must restore the state of the view to the way it was before invoking the callback.

If none of the elements from UIComponent.getFacetsAndChildren() returned true from invokeOnComponent(), return false.

Simple usage example to find a component by clientId.

private UIComponent found = null;

private void doFind(FacesContext context, String clientId) {
  context.getViewRoot().invokeOnComponent(context, clientId,
      new ContextCallback() {
         public void invokeOnComponent(FacesContext context,
                                       UIComponent component) {
           found = component;
         }
      });
}

Overrides:
invokeOnComponent in class UIComponent
Parameters:
context - the FacesContext for the current request
clientId - the client identifier of the component to be passed to the argument callback.
callback - an implementation of the Callback interface.
Returns:
true if the a component with the given clientId is found, the callback method was successfully invoked passing that component as an argument, and no Exception was thrown. Returns false if no component with the given clientId is found.
Throws:
NullPointerException - if any of the arguments are null
FacesException - if the argument Callback throws an Exception, it is wrapped in a FacesException and re-thrown.
Since:
1.2

public java.util.Map<K, V> getFacets()
英文文档：

getFacets

public Map<String,UIComponent> getFacets()
Description copied from class: UIComponent

Return a mutable Map representing the facet UIComponents associated with this UIComponent, keyed by facet name (which must be a String). The returned implementation must support all of the standard and optional Map methods, plus support the following additional requirements:

  • The Map implementation must implement the java.io.Serializable interface.
  • Any attempt to add a null key or value must throw a NullPointerException.
  • Any attempt to add a key that is not a String must throw a ClassCastException.
  • Any attempt to add a value that is not a UIComponent must throw a ClassCastException.
  • Whenever a new facet UIComponent is added:
    • The parent property of the component must be set to this component instance.
    • If the parent property of the component was already non-null, the component must first be removed from its previous parent (where it may have been either a child or a facet).
  • Whenever an existing facet UIComponent is removed:
    • The parent property of the facet must be set to null.

Specified by:
getFacets in class UIComponent

public int getFacetCount()
英文文档：

getFacetCount

public int getFacetCount()
Description copied from class: UIComponent

Return the number of facet UIComponents that are associated with this UIComponent. If there are no facets, this method must return 0. The method must not cause the creation of a facet component map.

For backwards compatability with classes that extend UIComponent directly, a default implementation is provided that simply calls UIComponent.getFacets() and then calls the size() method on the returned Map. A more optimized version of this method is provided in getFacetCount().

Overrides:
getFacetCount in class UIComponent

public UIComponent getFacet(String name)
英文文档：

getFacet

public UIComponent getFacet(String name)
Description copied from class: UIComponent

Convenience method to return the named facet, if it exists, or null otherwise. If the requested facet does not exist, the facets Map must not be created.

Specified by:
getFacet in class UIComponent
Parameters:
name - Name of the desired facet

public java.util.Iterator<E> getFacetsAndChildren()
英文文档：

getFacetsAndChildren

public Iterator<UIComponent> getFacetsAndChildren()
Description copied from class: UIComponent

Return an Iterator over the facet followed by child UIComponents of this UIComponent. Facets are returned in an undefined order, followed by all the children in the order they are stored in the child list. If this component has no facets or children, an empty Iterator is returned.

The returned Iterator must not support the remove() operation.

Specified by:
getFacetsAndChildren in class UIComponent

public void broadcast(FacesEvent event) throws AbortProcessingException
Throws | AbortProcessingException: NullPointerException 通知 JavaServer Face 实现不应该继续处理当前事件
Throws | IllegalStateException: NullPointerException
Throws | NullPointerException: NullPointerException 如果 event 为 null
英文文档：

broadcast

public void broadcast(FacesEvent event)
               throws AbortProcessingException
Description copied from class: UIComponent

Broadcast the specified FacesEvent to all registered event listeners who have expressed an interest in events of this type. Listeners are called in the order in which they were added.

Specified by:
broadcast in class UIComponent
Parameters:
event - The FacesEvent to be broadcast
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
IllegalStateException
NullPointerException - if event is null

public void decode(FacesContext context)
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

decode

public void decode(FacesContext context)
Description copied from class: UIComponent

Decode any new state of this UIComponent from the request contained in the specified FacesContext, and store this state as needed.

During decoding, events may be enqueued for later processing (by event listeners who have registered an interest), by calling queueEvent().

Specified by:
decode in class UIComponent
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void encodeBegin(FacesContext context) throws java.io.IOException
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

encodeBegin

public void encodeBegin(FacesContext context)
                 throws IOException
Description copied from class: UIComponent

If our rendered property is true, render the beginning of the current state of this UIComponent to the response contained in the specified FacesContext.

If a Renderer is associated with this UIComponent, the actual encoding will be delegated to Renderer.encodeBegin(FacesContext, UIComponent).

Specified by:
encodeBegin in class UIComponent
Parameters:
context - FacesContext for the response we are creating
Throws:
NullPointerException - if context is null
IOException - if an input/output error occurs while rendering

public void encodeChildren(FacesContext context) throws java.io.IOException
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

encodeChildren

public void encodeChildren(FacesContext context)
                    throws IOException
Description copied from class: UIComponent

If our rendered property is true, render the child UIComponents of this UIComponent. This method will only be called if the rendersChildren property is true.

If a Renderer is associated with this UIComponent, the actual encoding will be delegated to Renderer.encodeChildren(FacesContext, UIComponent).

Specified by:
encodeChildren in class UIComponent
Parameters:
context - FacesContext for the response we are creating
Throws:
NullPointerException - if context is null
IOException - if an input/output error occurs while rendering

public void encodeEnd(FacesContext context) throws java.io.IOException
Throws | java.io.IOException: NullPointerException 如果呈现期间发生输入/输出错误
Throws | NullPointerException: NullPointerException 如果 context 为 null
英文文档：

encodeEnd

public void encodeEnd(FacesContext context)
               throws IOException
Description copied from class: UIComponent

If our rendered property is true, render the ending of the current state of this UIComponent.

If a Renderer is associated with this UIComponent, the actual encoding will be delegated to Renderer.encodeEnd(FacesContext, UIComponent).

Specified by:
encodeEnd in class UIComponent
Parameters:
context - FacesContext for the response we are creating
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context is null

protected void addFacesListener(FacesListener listener)

将指定的 FacesListener 添加到注册了接收此 UIComponent 事件通知的侦听器集合。预计作为事件源的 UIComponent 类将具有相应的类型安全 API 用于注册所需类型的侦听器，并且这些注册方法的实现将委托给此方法。例如：

public class FooEvent extends FacesEvent {
   ...
protected boolean isAppropriateListener(FacesListener listener) {
return (listener instanceof FooListener);
   }
protected void processListener(FacesListener listener) {
((FooListener) listener).processFoo(this);
   }
   ...
 }

public interface FooListener extends FacesListener {
public void processFoo(FooEvent event);
 }

public class FooComponent extends UIComponentBase {
   ...
public void addFooListener(FooListener listener) {
addFacesListener(listener);
   }
public void removeFooListener(FooListener listener) {
removeFacesListener(listener);
   }
   ...
 }

listener | 要注册的 FacesListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

addFacesListener

protected void addFacesListener(FacesListener listener)

Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent. It is expected that UIComponent classes acting as event sources will have corresponding typesafe APIs for registering listeners of the required type, and the implementation of those registration methods will delegate to this method. For example:

 public class FooEvent extends FacesEvent {
   ...
   protected boolean isAppropriateListener(FacesListener listener) {
     return (listener instanceof FooListener);
   }
   protected void processListener(FacesListener listener) {
     ((FooListener) listener).processFoo(this);
   }
   ...
 }

 public interface FooListener extends FacesListener {
   public void processFoo(FooEvent event);
 }

 public class FooComponent extends UIComponentBase {
   ...
   public void addFooListener(FooListener listener) {
     addFacesListener(listener);
   }
   public void removeFooListener(FooListener listener) {
     removeFacesListener(listener);
   }
   ...
 }

Specified by:
addFacesListener in class UIComponent
Parameters:
listener - The FacesListener to be registered
Throws:
NullPointerException - if listener is null

protected FacesListener[] getFacesListeners(Class<T> clazz)
Throws | IllegalArgumentException: NullPointerException 如果 clazz 不是 FacesListener 并且未实现 FacesListener
Throws | NullPointerException: NullPointerException 如果 clazz 为 null
英文文档：

getFacesListeners

protected FacesListener[] getFacesListeners(Class clazz)
Description copied from class: UIComponent

Return an array of registered FacesListeners that are instances of the specified class. If there are no such registered listeners, a zero-length array is returned. The returned array can be safely be cast to an array strongly typed to an element type of clazz.

Specified by:
getFacesListeners in class UIComponent
Parameters:
clazz - Class that must be implemented by a FacesListener for it to be returned
Throws:
IllegalArgumentException - if class is not, and does not implement, FacesListener
NullPointerException - if clazz is null

protected void removeFacesListener(FacesListener listener)

从注册接收此 UIComponent 事件通知的侦听器集合中移除指定的 FacesListener。

listener | 要取消注册的 FacesListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

removeFacesListener

protected void removeFacesListener(FacesListener listener)

Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent.

Specified by:
removeFacesListener in class UIComponent
Parameters:
listener - The FacesListener to be deregistered
Throws:
NullPointerException - if listener is null

public void queueEvent(FacesEvent event)
Throws | IllegalStateException: NullPointerException 如果此组件不是 UIViewRoot 的后代
Throws | NullPointerException: NullPointerException 如果 event 为 null
英文文档：

queueEvent

public void queueEvent(FacesEvent event)
Description copied from class: UIComponent

Queue an event for broadcast at the end of the current request processing lifecycle phase. The default implementation in UIComponentBase must delegate this call to the queueEvent() method of the parent UIComponent.

Specified by:
queueEvent in class UIComponent
Parameters:
event - FacesEvent to be queued
Throws:
IllegalStateException - if this component is not a descendant of a UIViewRoot
NullPointerException - if event is null

public void processDecodes(FacesContext context)
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

processDecodes

public void processDecodes(FacesContext context)
Description copied from class: UIComponent

Perform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Call the processDecodes() method of all facets and children of this UIComponent, in the order determined by a call to getFacetsAndChildren().
  • Call the decode() method of this component.
  • If a RuntimeException is thrown during decode processing, call FacesContext.renderResponse() and re-throw the exception.

Specified by:
processDecodes in class UIComponent
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processValidators(FacesContext context)
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

processValidators

public void processValidators(FacesContext context)
Description copied from class: UIComponent

Perform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Call the processValidators() method of all facets and children of this UIComponent, in the order determined by a call to getFacetsAndChildren().

Specified by:
processValidators in class UIComponent
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processUpdates(FacesContext context)
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

processUpdates

public void processUpdates(FacesContext context)
Description copied from class: UIComponent

Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Call the processUpdates() method of all facets and children of this UIComponent, in the order determined by a call to getFacetsAndChildren().

Specified by:
processUpdates in class UIComponent
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public Object processSaveState(FacesContext context)
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

processSaveState

public Object processSaveState(FacesContext context)
Description copied from class: UIComponent

Perform the component tree processing required by the state saving portion of the Render Response phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • consult the transient property of this component. If true, just return null.
  • Call the processSaveState() method of all facets and children of this UIComponent in the order determined by a call to getFacetsAndChildren(), skipping children and facets that are transient.
  • Call the saveState() method of this component.
  • Encapsulate the child state and your state into a Serializable Object and return it.

This method may not be called if the state saving method is set to server.

Specified by:
processSaveState in class UIComponent
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processRestoreState(FacesContext context, Object state)
Throws NullPointerException: NullPointerException 如果 context 为 null
英文文档：

processRestoreState

public void processRestoreState(FacesContext context,
                                Object state)
Description copied from class: UIComponent

Perform the component tree processing required by the Restore View phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

  • Call the processRestoreState() method of all facets and children of this UIComponent in the order determined by a call to getFacetsAndChildren().
  • Call the restoreState() method of this component.

This method may not be called if the state saving method is set to server.

Specified by:
processRestoreState in class UIComponent
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

protected FacesContext getFacesContext()
英文文档：

getFacesContext

protected FacesContext getFacesContext()
Description copied from class: UIComponent

Convenience method to return the FacesContext instance for the current request.

Specified by:
getFacesContext in class UIComponent

protected Renderer getRenderer(FacesContext context)
英文文档：

getRenderer

protected Renderer getRenderer(FacesContext context)
Description copied from class: UIComponent

Convenience method to return the Renderer instance associated with this component, if any; otherwise, return null.

Specified by:
getRenderer in class UIComponent
Parameters:
context - FacesContext for the current request

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

public void setTransient(boolean transientFlag)
英文文档：

setTransient

public void setTransient(boolean transientFlag)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Parameters:
transientFlag - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.

public static Object saveAttachedState(FacesContext context, Object attachedObject)

此方法由要保存一个或多个连接对象的 UIComponent 子类调用。这是个便捷方法，完成保存可能实现也可能不实现 StateHolder 接口的连接对象的工作。使用此方法意味着使用 #restoreAttachedState 恢复连接对象。

此方法支持保存下列类型的连接对象：这些对象的 Object、null 值和 Lists。如果任何包含的对象不是 Lists 且没有实现 StateHolder，则它们必须有不带参数的公共构造方法。返回对象的确切结构是未定义和透明的，但可进行序列化。

context | 此请求的 FacesContext。
attachedObject | 对象，可能是 List 实例或 Object。attachedObject（或包含 attachedObject 的元素）可以实现 StateHolder。
Throws | NullPointerException: 如果上下文参数为 null。
英文文档：

saveAttachedState

public static Object saveAttachedState(FacesContext context,
                                       Object attachedObject)

This method is called by UIComponent subclasses that want to save one or more attached objects. It is a convenience method that does the work of saving attached objects that may or may not implement the StateHolder interface. Using this method implies the use of restoreAttachedState(javax.faces.context.FacesContext, java.lang.Object) to restore the attached objects.

This method supports saving attached objects of the following type: Objects, null values, and Lists of these objects. If any contained objects are not Lists and do not implement StateHolder, they must have zero-argument public constructors. The exact structure of the returned object is undefined and opaque, but will be serializable.

Parameters:
context - the FacesContext for this request.
attachedObject - the object, which may be a List instance, or an Object. The attachedObject (or the elements that comprise attachedObject may implement StateHolder.
Throws:
NullPointerException - if the context argument is null.

public static Object restoreAttachedState(FacesContext context, Object stateObj) throws IllegalStateException

此方法由 UIComponent 子类调用，该子类需要恢复它们使用 #saveAttachedState 保存的对象。此方法与 #saveAttachedState 紧密耦合。

此方法支持恢复 #saveAttachedState 支持的所有连接对象类型。

context | 此请求的 FacesContext
stateObj | 从 #saveAttachedState 返回的透明对象
Throws | NullPointerException: 如果 context 为 null。
Throws | IllegalStateException: 如果该对象不是以前由 #saveAttachedState 返回的。
英文文档：

restoreAttachedState

public static Object restoreAttachedState(FacesContext context,
                                          Object stateObj)
                                   throws IllegalStateException

This method is called by UIComponent subclasses that need to restore the objects they saved using saveAttachedState(javax.faces.context.FacesContext, java.lang.Object). This method is tightly coupled with saveAttachedState(javax.faces.context.FacesContext, java.lang.Object).

This method supports restoring all attached objects types supported by saveAttachedState(javax.faces.context.FacesContext, java.lang.Object).

Parameters:
context - the FacesContext for this request
stateObj - the opaque object returned from saveAttachedState(javax.faces.context.FacesContext, java.lang.Object)
Throws:
NullPointerException - if context is null.
IllegalStateException - if the object is not previously returned by saveAttachedState(javax.faces.context.FacesContext, java.lang.Object).
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIData (Java EE 5)

javax.faces.component
Class UIData

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIData
All Implemented Interfaces:
NamingContainer, StateHolder
Direct Known Subclasses:
HtmlDataTable
public class UIData
extends UIComponentBase
implements NamingContainer

Extends: UIComponent > UIComponentBase
Implements: NamingContainer
Extended by: HtmlDataTable

UIData 是支持将数据绑定到由 DataModel 实例表示的数据对象 Collection 的 UIComponent，该实例是此组件本身的当前值（通常通过 ValueExpression 建立）。在对数据模型的数据行进行迭代处理的过程中，当前行的对象作为 var 属性指定的键下的请求属性公开。

只有类型为 UIColumn 的子组件应该由与此组件关联的 renderer 处理。

默认情况下，rendererType 属性被设置为 javax.faces.Table。可以调用 setRendererType() 方法更改此值。

英文文档：

UIData is a UIComponent that supports data binding to a collection of data objects represented by a DataModel instance, which is the current value of this component itself (typically established via a ValueExpression). During iterative processing over the rows of data in the data model, the object for the current row is exposed as a request attribute under the key specified by the var property.

Only children of type UIColumn should be processed by renderers associated with this component.

By default, the rendererType property is set to javax.faces.Table. This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
Constructor Summary
UIData()
Create a new UIData instance with default property values.
Method Summary
 void broadcast(FacesEvent event)
Override the default UIComponentBase.broadcast(javax.faces.event.FacesEvent) processing to unwrap any wrapped FacesEvent and reset the current row index, before the event is actually broadcast.
 void encodeBegin(FacesContext context)
In addition to the default behavior, ensure that any saved per-row state for our child input components is discarded unless it is needed to rerender the current page with errors.
 String getClientId(FacesContext context)
Return a client identifier for this component that includes the current value of the rowIndex property, if it is not set to -1.
protected  DataModel getDataModel()
Return the internal DataModel object representing the data objects that we will iterate over in this component's rendering.
 String getFamily()
Return the identifier of the component family to which this component belongs.
 int getFirst()
Return the zero-relative row number of the first row to be displayed.
 UIComponent getFooter()
Return the footer facet of this component (if any).
 UIComponent getHeader()
Return the header facet of this component (if any).
 int getRowCount()
Return the number of rows in the underlying data model.
 Object getRowData()
Return the data object representing the data for the currently selected row index, if any.
 int getRowIndex()
Return the zero-relative index of the currently selected row.
 int getRows()
Return the number of rows to be displayed, or zero for all remaining rows in the table.
 Object getValue()
Return the value of the UIData.
 String getVar()
Return the request-scope attribute under which the data object for the current row will be exposed when iterating.
 boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback)
Override behavior from UIComponentBase.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback) to provide special care for positioning the data properly before finding the component and invoking the callback on it.
 boolean isRowAvailable()
Return a flag indicating whether there is rowData available at the current rowIndex.
 void processDecodes(FacesContext context)
Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext) processing to perform the following steps.
 void processUpdates(FacesContext context)
Override the default UIComponentBase.processUpdates(javax.faces.context.FacesContext) processing to perform the following steps.
 void processValidators(FacesContext context)
Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext) processing to perform the following steps.
 void queueEvent(FacesEvent event)
Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent) processing to wrap any queued events in a wrapper so that we can reset the current row index in broadcast().
 void restoreState(FacesContext context, Object state)
Perform any processing required to restore the state from the entries in the state Object.
 Object saveState(FacesContext context)
Gets the state of the instance as a Serializable Object.
protected  void setDataModel(DataModel dataModel)
Set the internal DataModel.
 void setFirst(int first)
Set the zero-relative row number of the first row to be displayed.
 void setFooter(UIComponent footer)
Set the footer facet of this component.
 void setHeader(UIComponent header)
Set the header facet of this component.
 void setRowIndex(int rowIndex)
Set the zero relative index of the current row, or -1 to indicate that no row is currently selected, by implementing the following algorithm.
 void setRows(int rows)
Set the number of rows to be displayed, or zero for all remaining rows in the table.
 void setValue(Object value)
Set the value of the UIData.
 void setValueBinding(String name, ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).
 void setValueExpression(String name, ValueExpression binding)
Set the ValueExpression used to calculate the value for the specified attribute or property name, if any.
 void setVar(String var)
Set the request-scope attribute under which the data object for the current row wil be exposed when iterating.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIData()

使用默认属性值创建新的 UIData 实例。

英文文档：

UIData

public UIData()

Create a new UIData instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public int getFirst()

返回要显示的第一行的相对于 0 的行号。

英文文档：

getFirst

public int getFirst()

Return the zero-relative row number of the first row to be displayed.

public void setFirst(int first)

设置要显示的第一行的相对于 0 的行号。

first | 新的第一行行号
Throws | IllegalArgumentException: 如果 first 为负
英文文档：

setFirst

public void setFirst(int first)

Set the zero-relative row number of the first row to be displayed.

Parameters:
first - New first row number
Throws:
IllegalArgumentException - if first is negative

public UIComponent getFooter()

返回此组件的脚注 facet（如果有）。getFacet("footer") 的便捷方法。

英文文档：

getFooter

public UIComponent getFooter()

Return the footer facet of this component (if any). A convenience method for getFacet("footer").

public void setFooter(UIComponent footer)

设置此组件的脚注 facet。getFacets().put("footer", footer) 的便捷方法。

footer | 新的脚注 facet
Throws | NullPointerException: 如果 footer 为 null
英文文档：

setFooter

public void setFooter(UIComponent footer)

Set the footer facet of this component. A convenience method for getFacets().put("footer", footer).

Parameters:
footer - the new footer facet
Throws:
NullPointerException - if footer is null

public UIComponent getHeader()

返回此组件的头 facet（如果有）。getFacet("header") 的便捷方法。

英文文档：

getHeader

public UIComponent getHeader()

Return the header facet of this component (if any). A convenience method for getFacet("header").

public void setHeader(UIComponent header)

设置此组件的头 facet。getFacets().put("header", header) 的便捷方法。

header | 新的头 facet
Throws | NullPointerException: 如果 header 为 null
英文文档：

setHeader

public void setHeader(UIComponent header)

Set the header facet of this component. A convenience method for getFacets().put("header", header).

Parameters:
header - the new header facet
Throws:
NullPointerException - if header is null

public boolean isRowAvailable()

返回一个指示当前 rowIndex 是否有可用的 rowData 的标志。如果没有任何 wrappedData 可用，则返回 false。

Throws FacesException: 如果检测行可用性时发生错误
英文文档：

isRowAvailable

public boolean isRowAvailable()

Return a flag indicating whether there is rowData available at the current rowIndex. If no wrappedData is available, return false.

Throws:
FacesException - if an error occurs getting the row availability

public int getRowCount()

返回底层数据模型中的行数。如果可用行数未知，则返回 -1。

Throws FacesException: 如果获取行数时发生错误
英文文档：

getRowCount

public int getRowCount()

Return the number of rows in the underlying data model. If the number of available rows is unknown, return -1.

Throws:
FacesException - if an error occurs getting the row count

public Object getRowData()

返回表示当前选定行索引的数据的数据对象（如果有）。

Throws | FacesException: 如果获取行数据时发生错误
Throws | IllegalArgumentException: 如果当前指定行索引处的行数据目前可用
英文文档：

getRowData

public Object getRowData()

Return the data object representing the data for the currently selected row index, if any.

Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index

public int getRowIndex()

返回当前选定行相对于 0 的索引。如果我们当前没有位于行上，则返回 -1。没有为值绑定表达式启用此属性。

Throws FacesException: 如果获取行索引时发生错误
英文文档：

getRowIndex

public int getRowIndex()

Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, return -1. This property is not enabled for value binding expressions.

Throws:
FacesException - if an error occurs getting the row index

public void setRowIndex(int rowIndex)

通过实现下列算法设置当前行相对于 0 的索引，或者设置为 -1 指示当前没有选定任何行。可以将行索引设置为某个值，在该值处底层数据 Collection 不包含任何行数据。因此，调用者可以使用 isRowAvailable() 方法检测是否可以通过 getRowData() 方法获得行数据。

  • 保存所有后代组件的当前状态信息（如下所述）。
  • 存储新的行索引，并将其传递给与此 UIData 实例关联的 DataModel。
  • 如果新的 rowIndex 值为 -1：
    • 如果 var 属性不为 null，则移除相应的请求范围属性（如果有）。
    • 重置所有后代组件的状态信息（如下所述）。
  • 如果新的 rowIndex 值不为 -1：
    • 如果 var 属性不为 null，则调用 getRowData()，并将得到的数据对象作为其键为 var 属性值的请求范围属性公开。
    • 重置所有后代组件的状态信息（如下所述）。

要保存所有后代组件的当前状态信息，UIData 必须维护每个后代的每行信息，如下所示：

  • 如果后代是 EditableValueHolder 的实例，则保存其 localValue 属性的状态。
  • 如果后代是 EditableValueHolder 的实例，则保存 localValueSet 属性的状态。
  • 如果后代是 EditableValueHolder 的实例，则保存 valid 属性的状态。
  • 如果后代是 EditableValueHolder 的实例，则保存 submittedValue 属性的状态。

要恢复所有后代组件的当前状态信息，UIData 必须引用它以前为当前 rowIndex 存储的信息，并为每个后代调用设置方法，如下所示：

  • 如果后代是 EditableValueHolder 的实例，则恢复 value 属性。
  • 如果后代是 EditableValueHolder 的实例，则恢复 localValueSet 属性的状态。
  • 如果后代是 EditableValueHolder 的实例，则恢复 valid 属性的状态。
  • 如果后代是 EditableValueHolder 的实例，则恢复 submittedValue 属性的状态。
rowIndex | 新的行索引值，或在无关联行时为 -1
Throws | FacesException: 如果设置行索引时发生错误
Throws | IllegalArgumentException: 如果 rowIndex 小于 -1
英文文档：

setRowIndex

public void setRowIndex(int rowIndex)

Set the zero relative index of the current row, or -1 to indicate that no row is currently selected, by implementing the following algorithm. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available for use by the getRowData() method.

  • Save current state information for all descendant components (as described below).
  • Store the new row index, and pass it on to the DataModel associated with this UIData instance.
  • If the new rowIndex value is -1:
    • If the var property is not null, remove the corresponding request scope attribute (if any).
    • Reset the state information for all descendant components (as described below).
  • If the new rowIndex value is not -1:
    • If the var property is not null, call getRowData() and expose the resulting data object as a request scope attribute whose key is the var property value.
    • Reset the state information for all descendant components (as described below).

To save current state information for all descendant components, UIData must maintain per-row information for each descendant as follows:

  • If the descendant is an instance of EditableValueHolder, save the state of its localValue property.
  • If the descendant is an instance of EditableValueHolder, save the state of the localValueSet property.
  • If the descendant is an instance of EditableValueHolder, save the state of the valid property.
  • If the descendant is an instance of EditableValueHolder, save the state of the submittedValue property.

To restore current state information for all descendant components, UIData must reference its previously stored information for the current rowIndex and call setters for each descendant as follows:

  • If the descendant is an instance of EditableValueHolder, restore the value property.
  • If the descendant is an instance of EditableValueHolder, restore the state of the localValueSet property.
  • If the descendant is an instance of EditableValueHolder, restore the state of the valid property.
  • If the descendant is an instance of EditableValueHolder, restore the state of the submittedValue property.

Parameters:
rowIndex - The new row index value, or -1 for no associated row
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1

public int getRows()

返回要显示的行数，或为表中所有其余行返回 0。此属性的默认值为 0。

英文文档：

getRows

public int getRows()

Return the number of rows to be displayed, or zero for all remaining rows in the table. The default value of this property is zero.

public void setRows(int rows)

设置要显示的行数，或为表中所有其余行设置为 0。

rows | 新的行数
Throws | IllegalArgumentException: 如果 rows 为负
英文文档：

setRows

public void setRows(int rows)

Set the number of rows to be displayed, or zero for all remaining rows in the table.

Parameters:
rows - New number of rows
Throws:
IllegalArgumentException - if rows is negative

public String getVar()

返回请求范围属性，在迭代时，将在此属性下公开当前行的数据对象。没有为值绑定表达式启用此属性。

英文文档：

getVar

public String getVar()

Return the request-scope attribute under which the data object for the current row will be exposed when iterating. This property is not enabled for value binding expressions.

public void setVar(String var)

设置请求范围属性，在迭代时，将在此属性下公开当前行的数据对象。

var 新请求范围属性名称
英文文档：

setVar

public void setVar(String var)

Set the request-scope attribute under which the data object for the current row wil be exposed when iterating.

Parameters:
var - The new request-scope attribute name

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase

public Object getValue()

返回 UIData 的值。此值必须为 DataModel 类型，或者可以适配到 DataModel 中的类型。UIData 将自动适配以下类型：

  • 数组
  • java.util.List
  • java.sql.ResultSet
  • javax.servlet.jsp.jstl.sql.Result

所有其他类型将使用 ScalarDataModel 类适配，该类将对象视作单个数据行。

英文文档：

getValue

public Object getValue()

Return the value of the UIData. This value must either be be of type DataModel, or a type that can be adapted into a DataModel. UIData will automatically adapt the following types:

  • Arrays
  • java.util.List
  • java.sql.ResultSet
  • javax.servlet.jsp.jstl.sql.Result

All other types will be adapted using the ScalarDataModel class, which will treat the object as a single row of data.

public void setValue(Object value)

设置 UIData 的值。此值必须为 DataModel 类型，或者可以适配到 DataModel 中的类型。

value 新值
英文文档：

setValue

public void setValue(Object value)

Set the value of the UIData. This value must either be be of type DataModel, or a type that can be adapted into a DataModel.

Parameters:
value - the new value

public void setValueBinding(String name, ValueBinding binding)

如果 "name" 为 "value"、"var" 或 "rowIndex" 之外的项目，则依赖超类将 ValueBinding 转换为 ValueExpression。

name | 将为其设置 ValueBinding 的属性的名称
binding | 要设置的 ValueBinding，或为 null 以移除任何当前设置的 ValueBinding
Throws | IllegalArgumentException: 如果 name 为 id、parent、var 或 rowIndex 之一
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #setValueExpression(java.lang.String, javax.el.ValueExpression) 替代。
英文文档：

setValueBinding

public void setValueBinding(String name,
                            ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).

If "name" is something other than "value", "var", or "rowIndex", rely on the superclass conversion from ValueBinding to ValueExpression.

Overrides:
setValueBinding in class UIComponentBase
Parameters:
name - Name of the attribute or property for which to set a ValueBinding
binding - The ValueBinding to set, or null to remove any currently set ValueBinding
Throws:
IllegalArgumentException - if name is one of id, parent, var, or rowIndex
NullPointerException - if name is null

public void setValueExpression(String name, ValueExpression binding)

设置用于计算指定属性名称值的 ValueExpression（如果有）。此外，如果为 value 属性设置了 ValueExpression，则移除以前绑定到此组件的数据的任何合成 DataModel。

name | 要为其设置 ValueExpression 的属性的名称
binding | 要设置的 ValueExpression，或为 null 以移除任何当前设置的 ValueExpression
Throws | IllegalArgumentException: 如果 name 为 id、parent、var 或 rowIndex 之一
Throws | NullPointerException: 如果 name 为 null
since | 1.2
英文文档：

setValueExpression

public void setValueExpression(String name,
                               ValueExpression binding)

Set the ValueExpression used to calculate the value for the specified attribute or property name, if any. In addition, if a ValueExpression is set for the value property, remove any synthesized DataModel for the data previously bound to this component.

Overrides:
setValueExpression in class UIComponent
Parameters:
name - Name of the attribute or property for which to set a ValueExpression
binding - The ValueExpression to set, or null to remove any currently set ValueExpression
Throws:
IllegalArgumentException - if name is one of id, parent, var, or rowIndex
NullPointerException - if name is null
Since:
1.2

public String getClientId(FacesContext context)

如果 rowIndex 属性的当前值未设置为 -1，则返回包含其当前值的此组件的客户端标识符。这意味着对 getClientId() 的多次调用可能会返回不同的结果，但这会确保该子组件本身能够生成特定于行的客户端标识符（因为 UIData 是 NamingContainer）。

Throws NullPointerException: 如果 context 为 null
英文文档：

getClientId

public String getClientId(FacesContext context)

Return a client identifier for this component that includes the current value of the rowIndex property, if it is not set to -1. This implies that multiple calls to getClientId() may return different results, but ensures that child components can themselves generate row-specific client identifiers (since UIData is a NamingContainer).

Overrides:
getClientId in class UIComponentBase
Parameters:
context - The FacesContext for the current request
Throws:
NullPointerException - if context is null

public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException

重写 UIComponentBase#invokeOnComponent 中的行为，以便在找到组件并调用其上的回调之前，对正确定位数据予以特别关注。如果参数 clientId 等于 this.getClientId()，则只需调用 contextCallback 同时将 context 参数和 this 作为参数传递即可，然后返回 true。否则，尝试从 clientId 中提取 rowIndex。例如，如果参数 clientId 为 form:data:3:customerHeader，则 rowIndex 将为 3。使此值称为 newIndex。在所有情况下，都必须保存此实例的当前 rowIndex 并在返回之前将其恢复，无论搜索结果如何或是否在此过程中抛出任何异常。

如果将此实例的 rowIndex 设置为等于 newIndex 导致此实例从 #isRowAvailable 返回 false，则此方法的实现绝不会返回 true。

since | 1.2
Throws | NullPointerException: NullPointerException NullPointerException 如果任何参数为 null
Throws | FacesException: NullPointerException 如果参数 Callback 抛出 Exception，则将在 FacesException 中包装它并将其重新抛出。 如果在从参数 clientId 派生 rowIndex 时有任何异常抛出，则还抛出 FacesException。
英文文档：

invokeOnComponent

public boolean invokeOnComponent(FacesContext context,
                                 String clientId,
                                 ContextCallback callback)
                          throws FacesException

Override behavior from UIComponentBase.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback) to provide special care for positioning the data properly before finding the component and invoking the callback on it. If the argument clientId is equal to this.getClientId() simply invoke the contextCallback, passing the context argument and this as arguments, and return true. Otherwise, attempt to extract a rowIndex from the clientId. For example, if the argument clientId was form:data:3:customerHeader the rowIndex would be 3. Let this value be called newIndex. The current rowIndex of this instance must be saved aside and restored before returning in all cases, regardless of the outcome of the search or if any exceptions are thrown in the process.

The implementation of this method must never return true if setting the rowIndex of this instance to be equal to newIndex causes this instance to return false from isRowAvailable().

Overrides:
invokeOnComponent in class UIComponentBase
Parameters:
context - the FacesContext for the current request
clientId - the client identifier of the component to be passed to the argument callback.
callback - an implementation of the Callback interface.
Returns:
true if the a component with the given clientId is found, the callback method was successfully invoked passing that component as an argument, and no Exception was thrown. Returns false if no component with the given clientId is found.
Throws:
NullPointerException - if any of the arguments are null
FacesException - if the argument Callback throws an Exception, it is wrapped in a FacesException and re-thrown. Also throws FacesException if any exception is thrown when deriving the rowIndex from the argument clientId.
Since:
1.2

public void queueEvent(FacesEvent event)

重写默认的 UIComponentBase#queueEvent 处理以在包装器中包装任何排队事件，以便可以在 broadcast() 中重置当前的行索引。

event | 要排队的 FacesEvent
Throws | IllegalStateException: 如果此组件不是 UIViewRoot 的后代
Throws | NullPointerException: 如果 event 为 null
英文文档：

queueEvent

public void queueEvent(FacesEvent event)

Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent) processing to wrap any queued events in a wrapper so that we can reset the current row index in broadcast().

Overrides:
queueEvent in class UIComponentBase
Parameters:
event - FacesEvent to be queued
Throws:
IllegalStateException - if this component is not a descendant of a UIViewRoot
NullPointerException - if event is null

public void broadcast(FacesEvent event) throws AbortProcessingException

重写默认的 UIComponentBase#broadcast 处理以便在实际广播事件之前，对任何已包装的 FacesEvent 解包，并重置当前行索引。对于未包装的事件（在 queueEvent() 中），将执行默认处理。

event | 要广播的 FacesEvent
Throws | AbortProcessingException: 通知 JavaServer Face 实现不应该继续处理当前事件
Throws | IllegalArgumentException: 如果此组件不支持此 FacesEvent 的实现类
Throws | NullPointerException: 如果 event 为 null
英文文档：

broadcast

public void broadcast(FacesEvent event)
               throws AbortProcessingException

Override the default UIComponentBase.broadcast(javax.faces.event.FacesEvent) processing to unwrap any wrapped FacesEvent and reset the current row index, before the event is actually broadcast. For events that we did not wrap (in queueEvent()), default processing will occur.

Overrides:
broadcast in class UIComponentBase
Parameters:
event - The FacesEvent to be broadcast
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
IllegalArgumentException - if the implementation class of this FacesEvent is not supported by this component
NullPointerException - if event is null

public void encodeBegin(FacesContext context) throws java.io.IOException

除默认行为外，确保子输入组件的任何已保存的每行状态都被丢弃，除非需要它来呈现当前带有错误的页面。

context | 当前请求的 FacesContext
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 为 null
英文文档：

encodeBegin

public void encodeBegin(FacesContext context)
                 throws IOException

In addition to the default behavior, ensure that any saved per-row state for our child input components is discarded unless it is needed to rerender the current page with errors.

Overrides:
encodeBegin in class UIComponentBase
Parameters:
context - FacesContext for the current request
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context is null

public void processDecodes(FacesContext context)

重写默认的 UIComponentBase#processDecodes 处理以执行下列步骤。

  • 如果此 UIComponent 的 rendered 属性为 false，则跳过进一步的处理。
  • 将当前 rowIndex 设置为 -1。
  • 按照调用 getFacets().keySet().iterator() 所确定的顺序，调用此 UIData 所有 facet 的 processDecodes() 方法。
  • 调用此 UIData 的 UIColumn 子组件的所有 facet 的 processDecodes() 方法。
  • 迭代呈现此组件时包含的行集合（即通过 first 和 rows 属性定义的那些行），对每个行执行以下处理：
    • 将当前 rowIndex 设置为此行的相应值。
    • 如果 isRowAvailable() 返回 true，则在此 UIData 组件的每个 UIColumn 子组件的子组件上迭代，同时为每个此类子组件调用 processDecodes() 方法。
  • 将当前 rowIndex 设置为 -1。
  • 调用此组件的 decode() 方法。
  • 如果在解码处理期间抛出 RuntimeException，则调用 FacesContext#renderResponse 并重新抛出该异常。
context | 当前请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processDecodes

public void processDecodes(FacesContext context)

Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext) processing to perform the following steps.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Set the current rowIndex to -1.
  • Call the processDecodes() method of all facets of this UIData, in the order determined by a call to getFacets().keySet().iterator().
  • Call the processDecodes() method of all facets of the UIColumn children of this UIData.
  • Iterate over the set of rows that were included when this component was rendered (i.e. those defined by the first and rows properties), performing the following processing for each row:
    • Set the current rowIndex to the appropriate value for this row.
    • If isRowAvailable() returns true, iterate over the children components of each UIColumn child of this UIData component, calling the processDecodes() method for each such child.
  • Set the current rowIndex to -1.
  • Call the decode() method of this component.
  • If a RuntimeException is thrown during decode processing, call FacesContext.renderResponse() and re-throw the exception.

Overrides:
processDecodes in class UIComponentBase
Parameters:
context - FacesContext for the current request
Throws:
NullPointerException - if context is null

public void processValidators(FacesContext context)

重写默认的 UIComponentBase#processValidators 处理以执行下列步骤。

  • 如果此 UIComponent 的 rendered 属性为 false，则跳过进一步的处理。
  • 将当前 rowIndex 设置为 -1。
  • 按照调用 getFacets().keySet().iterator() 所确定的顺序，调用此 UIData 所有 facet 的 processValidators() 方法。
  • 调用此 UIData 的 UIColumn 子组件的所有 facet 的 processValidators() 方法。
  • 迭代呈现此组件时包含的行集合（即通过 first 和 rows 属性定义的那些行），对每个行执行以下处理：
    • 将当前 rowIndex 设置为此行的相应值。
    • 如果 isRowAvailable() 返回 true，则在此 UIData 组件的每个 UIColumn 子组件的子组件上迭代，同时为每个此类子组件调用 processValidators() 方法。
  • 将当前 rowIndex 设置为 -1。
context | 当前请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processValidators

public void processValidators(FacesContext context)

Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext) processing to perform the following steps.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Set the current rowIndex to -1.
  • Call the processValidators() method of all facets of this UIData, in the order determined by a call to getFacets().keySet().iterator().
  • Call the processValidators() method of all facets of the UIColumn children of this UIData.
  • Iterate over the set of rows that were included when this component was rendered (i.e. those defined by the first and rows properties), performing the following processing for each row:
    • Set the current rowIndex to the appropriate value for this row.
    • If isRowAvailable() returns true, iterate over the children components of each UIColumn child of this UIData component, calling the processValidators() method for each such child.
  • Set the current rowIndex to -1.

Overrides:
processValidators in class UIComponentBase
Parameters:
context - FacesContext for the current request
Throws:
NullPointerException - if context is null

public void processUpdates(FacesContext context)

重写默认的 UIComponentBase#processUpdates 处理以执行下列步骤。

  • 如果此 UIComponent 的 rendered 属性为 false，则跳过进一步的处理。
  • 将当前 rowIndex 设置为 -1。
  • 按照调用 getFacets().keySet().iterator() 所确定的顺序，调用此 UIData 所有 facet 的 processUpdates() 方法。
  • 调用此 UIData 的 UIColumn 子组件的所有 facet 的 processUpdates() 方法。
  • 迭代呈现此组件时包含的行集合（即通过 first 和 rows 属性定义的那些行），对每个行执行以下处理：
    • 将当前 rowIndex 设置为此行的相应值。
    • 如果 isRowAvailable() 返回 true，则在此 UIData 组件的每个 UIColumn 子组件的子组件上迭代，同时为每个此类子组件调用 processUpdates() 方法。
  • 将当前 rowIndex 设置为 -1。
context | 当前请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processUpdates

public void processUpdates(FacesContext context)

Override the default UIComponentBase.processUpdates(javax.faces.context.FacesContext) processing to perform the following steps.

  • If the rendered property of this UIComponent is false, skip further processing.
  • Set the current rowIndex to -1.
  • Call the processUpdates() method of all facets of this UIData, in the order determined by a call to getFacets().keySet().iterator().
  • Call the processUpdates() method of all facets of the UIColumn children of this UIData.
  • Iterate over the set of rows that were included when this component was rendered (i.e. those defined by the first and rows properties), performing the following processing for each row:
    • Set the current rowIndex to the appropriate value for this row.
    • If isRowAvailable() returns true, iterate over the children components of each UIColumn child of this UIData component, calling the processUpdates() method for each such child.
  • Set the current rowIndex to -1.

Overrides:
processUpdates in class UIComponentBase
Parameters:
context - FacesContext for the current request
Throws:
NullPointerException - if context is null

protected DataModel getDataModel()

返回表示将在此组件的呈现中迭代的数据对象的内部 DataModel 对象。

如果通过以前调用 #setDataModel 缓存过该模型，则将其返回。否则调用 #getValue。如果结果为 null，则创建空的 ListDataModel 并将其返回。如果结果是 DataModel 的实例，则将其返回。否则，适配 #getValue 中所述的结果，并将其返回。

英文文档：

getDataModel

protected DataModel getDataModel()

Return the internal DataModel object representing the data objects that we will iterate over in this component's rendering.

If the model has been cached by a previous call to setDataModel(javax.faces.model.DataModel), return it. Otherwise call getValue(). If the result is null, create an empty ListDataModel and return it. If the result is an instance of DataModel, return it. Otherwise, adapt the result as described in getValue() and return it.

protected void setDataModel(DataModel dataModel)

设置内部 DataModel。从现在开始，此 UIData 实例必须使用给定的 DataModel 作为其内部值表示形式，直到下次调用 setDataModel。如果给定的 DataModel 为 null，则必须以某种方式重置内部 DataModel，这样下次调用 #getDataModel 会导致新刷新的 DataModel 的延迟实例化。

如果子类要在恢复视图 阶段恢复内部 DataModel，或如果这些子类要在呈现响应 阶段显式刷新当前的 DataModel，则子类可能会调用此方法。

dataModel 新的 DataModel 或 null 以使模型被刷新。
英文文档：

setDataModel

protected void setDataModel(DataModel dataModel)

Set the internal DataModel. This UIData instance must use the given DataModel as its internal value representation from now until the next call to setDataModel. If the given DataModel is null, the internal DataModel must be reset in a manner so that the next call to getDataModel() causes lazy instantion of a newly refreshed DataModel.

Subclasses might call this method if they either want to restore the internal DataModel during the Restore View phase or if they want to explicitly refresh the current DataModel for the Render Response phase.

Parameters:
dataModel - the new DataModel or null to cause the model to be refreshed.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIForm (Java EE 5)

javax.faces.component
Class UIForm

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIForm
All Implemented Interfaces:
NamingContainer, StateHolder
Direct Known Subclasses:
HtmlForm
public class UIForm
extends UIComponentBase
implements NamingContainer

Extends: UIComponent > UIComponentBase
Implements: NamingContainer
Extended by: HtmlForm

UIForm 是一个 UIComponent，表示要提供给用户的输入表单，而其子组件表示（除其他功能之外）提交表单时要包含的输入字段。

默认情况下，rendererType 属性必须设置为 "javax.faces.Form"。可以调用 setRendererType() 方法更改此值。

英文文档：

UIForm is a UIComponent that represents an input form to be presented to the user, and whose child components represent (among other things) the input fields to be included when the form is submitted.

By default, the rendererType property must be set to "javax.faces.Form". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
Constructor Summary
UIForm()
Create a new UIForm instance with default property values.
Method Summary
String | getContainerClientId(FacesContext context) Override the UIComponent.getContainerClientId(javax.faces.context.FacesContext) to allow users to disable this form from prepending its clientId to its descendent's clientIds depending on the value of this form's isPrependId() property.
String | getFamily() Return the identifier of the component family to which this component belongs.
boolean | isPrependId()
boolean | isSubmitted() Returns the current value of the submitted property.
void | processDecodes(FacesContext context) Override UIComponent.processDecodes(javax.faces.context.FacesContext) to ensure that the form is decoded before its children.
void | processUpdates(FacesContext context) Override UIComponent.processUpdates(javax.faces.context.FacesContext) to ensure that the children of this UIForm instance are only processed if isSubmitted() returns true.
void | processValidators(FacesContext context) Override UIComponent.processValidators(javax.faces.context.FacesContext) to ensure that the children of this UIForm instance are only processed if isSubmitted() returns true.
void | setPrependId(boolean prependId)
void | setSubmitted(boolean submitted) If this UIForm instance (as opposed to other forms in the page) is experiencing a submit during this request processing lifecycle, this method must be called, with true as the argument, during the UIComponent.decode(javax.faces.context.FacesContext) for this UIForm instance.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIForm()

使用默认属性值创建新的 UIForm 实例。

英文文档：

UIForm

public UIForm()

Create a new UIForm instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public boolean isSubmitted()

返回 submitted 属性的当前值。默认值为 false。有关详细信息，请参见 #setSubmitted。

英文文档：

isSubmitted

public boolean isSubmitted()

Returns the current value of the submitted property. The default value is false. See setSubmitted(boolean) for details.

public void setSubmitted(boolean submitted)

如果在此请求处理生命周期中此 UIForm 实例（与页面中的其他表单相对）遇到提交操作，则必须在此 UIForm 实例的 UIComponent#decode 期间，使用 true 作为参数调用此方法。如果此 UIForm 实例没有遇到提交操作，则在此 UIForm 实例的 UIComponent#decode 期间，必须使用 false 作为参数调用此方法。

UIForm 的已提交属性的值不得作为其状态的一部分保存。

英文文档：

setSubmitted

public void setSubmitted(boolean submitted)

If this UIForm instance (as opposed to other forms in the page) is experiencing a submit during this request processing lifecycle, this method must be called, with true as the argument, during the UIComponent.decode(javax.faces.context.FacesContext) for this UIForm instance. If this UIForm instance is not experiencing a submit, this method must be called, with false as the argument, during the UIComponent.decode(javax.faces.context.FacesContext) for this UIForm instance.

The value of a UIForm's submitted property must not be saved as part of its state.

public boolean isPrependId()
英文文档：

isPrependId

public boolean isPrependId()

public void setPrependId(boolean prependId)
英文文档：

setPrependId

public void setPrependId(boolean prependId)

public void processDecodes(FacesContext context)

重写 UIComponent#processDecodes 以确保表单在其子表单之前解码。使 submitted 属性得到正确设置是很有必要的。

Throws NullPointerException: NullPointerException NullPointerException 如果 context 为 null
英文文档：

processDecodes

public void processDecodes(FacesContext context)

Override UIComponent.processDecodes(javax.faces.context.FacesContext) to ensure that the form is decoded before its children. This is necessary to allow the submitted property to be correctly set.

Overrides:
processDecodes in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processValidators(FacesContext context)

重写 UIComponent#processValidators 以确保只有在 #isSubmitted 返回 true 的情况下，处理此 UIForm 实例的子实例。

Throws NullPointerException: NullPointerException NullPointerException 如果 context 为 null
英文文档：

processValidators

public void processValidators(FacesContext context)

Override UIComponent.processValidators(javax.faces.context.FacesContext) to ensure that the children of this UIForm instance are only processed if isSubmitted() returns true.

Overrides:
processValidators in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processUpdates(FacesContext context)

重写 UIComponent#processUpdates 以确保只有在 #isSubmitted 返回 true 的情况下，处理此 UIForm 实例的子实例。

Throws NullPointerException: NullPointerException NullPointerException 如果 context 为 null
英文文档：

processUpdates

public void processUpdates(FacesContext context)

Override UIComponent.processUpdates(javax.faces.context.FacesContext) to ensure that the children of this UIForm instance are only processed if isSubmitted() returns true.

Overrides:
processUpdates in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public String getContainerClientId(FacesContext context)

重写 UIComponent#getContainerClientId，以允许用户根据此表单的 #isPrependId 属性的值，禁止此表单将其 clientId 放到其后代的 clientIds 前面。

英文文档：

getContainerClientId

public String getContainerClientId(FacesContext context)

Override the UIComponent.getContainerClientId(javax.faces.context.FacesContext) to allow users to disable this form from prepending its clientId to its descendent's clientIds depending on the value of this form's isPrependId() property.

Overrides:
getContainerClientId in class UIComponent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIGraphic (Java EE 5)

javax.faces.component
Class UIGraphic

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIGraphic
All Implemented Interfaces:
StateHolder
Direct Known Subclasses:
HtmlGraphicImage
public class UIGraphic
extends UIComponentBase

Extends: UIComponent > UIComponentBase
Extended by: HtmlGraphicImage

UIGraphic 是将图形图像显示给用户的 UIComponent。用户无法操作此组件；它仅用于显示目的。

默认情况下，rendererType 属性必须设置为 "javax.faces.Image"。可以调用 setRendererType() 方法更改此值。

英文文档：

UIGraphic is a UIComponent that displays a graphical image to the user. The user cannot manipulate this component; it is for display purposes only.

By default, the rendererType property must be set to "javax.faces.Image". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIGraphic()
Create a new UIGraphic instance with default property values.
Method Summary
 String getFamily()
Return the identifier of the component family to which this component belongs.
 String getUrl()
Return the image URL for this UIGraphic.
 Object getValue()
Returns the value property of the UIGraphic.
 ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by getValueExpression(java.lang.String).
 ValueExpression getValueExpression(String name)
Return any ValueExpression set for value if a ValueExpression for url is requested; otherwise, perform the default superclass processing for this method.
 void restoreState(FacesContext context, Object state)
Perform any processing required to restore the state from the entries in the state Object.
 Object saveState(FacesContext context)
Gets the state of the instance as a Serializable Object.
 void setUrl(String url)
Set the image URL for this UIGraphic.
 void setValue(Object value)
Sets the value property of the UIGraphic.
 void setValueBinding(String name, ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).
 void setValueExpression(String name, ValueExpression binding)
Store any ValueExpression specified for url under value instead; otherwise, perform the default superclass processing for this method.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIGraphic()

使用默认属性值创建新的 UIGraphic 实例。

英文文档：

UIGraphic

public UIGraphic()

Create a new UIGraphic instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public String getUrl()

返回此 UIGraphic 的图像 URL。此方法是 getValue() 的一个类型安全别名。

英文文档：

getUrl

public String getUrl()

Return the image URL for this UIGraphic. This method is a typesafe alias for getValue().

public void setUrl(String url)

设置此 UIGraphic 的图像 URL。此方法是 setValue() 的一个类型安全别名。

url 新的图像 URL
英文文档：

setUrl

public void setUrl(String url)

Set the image URL for this UIGraphic. This method is a typesafe alias for setValue().

Parameters:
url - The new image URL

public Object getValue()

返回 UIGraphic 的 value 属性。这通常呈现为一个 URL。

英文文档：

getValue

public Object getValue()

Returns the value property of the UIGraphic. This will typically be rendered as an URL.

public void setValue(Object value)

设置 UIGraphic 的 value 属性。这通常呈现为一个 URL。

value 新值
英文文档：

setValue

public void setValue(Object value)

Sets the value property of the UIGraphic. This will typically be rendered as an URL.

Parameters:
value - the new value

public ValueBinding getValueBinding(String name)

如果请求 url 的 ValueBinding，则返回任何为 value 设置的 ValueBinding；否则，执行此方法的默认超类处理。

name | 要为其获取 ValueBinding 的属性的名称
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #getValueExpression(java.lang.String) 替代。
英文文档：

getValueBinding

public ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by getValueExpression(java.lang.String).

Return any ValueBinding set for value if a ValueBinding for url is requested; otherwise, perform the default superclass processing for this method.

Overrides:
getValueBinding in class UIComponentBase
Parameters:
name - Name of the attribute or property for which to retrieve a ValueBinding
Throws:
NullPointerException - if name is null

public void setValueBinding(String name, ValueBinding binding)

改为存储 value 下为 url 指定的任何 ValueBinding；否则，执行此方法的默认超类处理。在任何情况下，都要依赖超类将 ValueBinding 转换为 ValueExpression。

name | 要为其设置 ValueBinding 的属性的名称
binding | 要设置的 ValueBinding，或为 null 以移除任何当前设置的 ValueBinding
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #setValueExpression 替代。
英文文档：

setValueBinding

public void setValueBinding(String name,
                            ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).

Store any ValueBinding specified for url under value instead; otherwise, perform the default superclass processing for this method. In all cases, the superclass is relied on to convert the ValueBinding to a ValueExpression.

Overrides:
setValueBinding in class UIComponentBase
Parameters:
name - Name of the attribute or property for which to set a ValueBinding
binding - The ValueBinding to set, or null to remove any currently set ValueBinding
Throws:
NullPointerException - if name is null

public ValueExpression getValueExpression(String name)

如果请求 url 的 ValueExpression，则返回任何为 value 设置的 ValueExpression；否则，执行此方法的默认超类处理。

name | 要为其获取 ValueExpression 的属性的名称
Throws | NullPointerException: 如果 name 为 null
since | 1.2
英文文档：

getValueExpression

public ValueExpression getValueExpression(String name)

Return any ValueExpression set for value if a ValueExpression for url is requested; otherwise, perform the default superclass processing for this method.

Overrides:
getValueExpression in class UIComponent
Parameters:
name - Name of the attribute or property for which to retrieve a ValueExpression
Throws:
NullPointerException - if name is null
Since:
1.2

public void setValueExpression(String name, ValueExpression binding)

改为存储 value 下为 url 指定的任何 ValueExpression；否则，执行此方法的默认超类处理。

name | 要为其设置 ValueExpression 的属性的名称
binding | 要设置的 ValueExpression，或为 null 以移除任何当前设置的 ValueExpression
Throws | NullPointerException: 如果 name 为 null
since | 1.2
英文文档：

setValueExpression

public void setValueExpression(String name,
                               ValueExpression binding)

Store any ValueExpression specified for url under value instead; otherwise, perform the default superclass processing for this method.

Overrides:
setValueExpression in class UIComponent
Parameters:
name - Name of the attribute or property for which to set a ValueExpression
binding - The ValueExpression to set, or null to remove any currently set ValueExpression
Throws:
NullPointerException - if name is null
Since:
1.2

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIInput (Java EE 5)

javax.faces.component
Class UIInput

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
Direct Known Subclasses:
HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, UISelectBoolean, UISelectMany, UISelectOne
public class UIInput
extends UIOutput
implements EditableValueHolder

Extends: UIComponent > UIComponentBase > UIOutput
Implements: EditableValueHolder
Extended by: HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, UISelectBoolean, UISelectMany, UISelectOne

UIInput 是表示某个组件的 UIComponent，该组件既向用户显示输出（就像 UIOutput 组件所做的），又处理需要解码的后续请求的请求参数。对本地值的数据类型或值绑定表达式引用的对象（如果有）没有限制；但是，各 javax.faces.render.Renderer 通常会对其知道如何显示的数据类型施加限制。

在请求处理生命周期的应用请求值 阶段，必须使用 setSubmittedValue() 存储（但尚未转换）此组件的解码值（通常但并非一定为 String）。如果该组件要指示没有提交过特定的值，则它可以不执行任何操作，也可以将提交的值设置为 null。

默认情况下，在请求处理生命周期的处理验证器 阶段，提交的值将被转换为类型安全对象，而且如果验证成功，则使用 setValue() 将其存储为本地值。但是，如果 immediate 属性设置为 true，则此处理将会改在应用请求值 阶段的末尾进行。

在请求处理生命周期的呈现响应 阶段，进行输出转换，这与 UIOutput 相同。

当此 UIInput 的 validate() 方法检测到实际已发生值更改，而且已成功通过所有验证，它会将 ValueChangeEvent 排队。之后，broadcast() 方法将确保此事件广播到所有感兴趣的侦听器。默认情况下，此事件将在处理验证器 阶段传送，但如果 immediate 属性设置为 true，也可改在应用请求值 阶段传送。

默认情况下，rendererType 属性必须设置为 "Text"。可以调用 setRendererType() 方法更改此值。

英文文档：

UIInput is a UIComponent that represents a component that both displays output to the user (like UIOutput components do) and processes request parameters on the subsequent request that need to be decoded. There are no restrictions on the data type of the local value, or the object referenced by the value binding expression (if any); however, individual Renderers will generally impose restrictions on the type of data they know how to display.

During the Apply Request Values phase of the request processing lifecycle, the decoded value of this component, usually but not necessarily a String, must be stored - but not yet converted - using setSubmittedValue(). If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null.

By default, during the Process Validators phase of the request processing lifecycle, the submitted value will be converted to a typesafe object, and, if validation succeeds, stored as a local value using setValue(). However, if the immediate property is set to true, this processing will occur instead at the end of the Apply Request Values phase.

During the Render Response phase of the request processing lifecycle, conversion for output occurs as for UIOutput.

When the validate() method of this UIInput detects that a value change has actually occurred, and that all validations have been successfully passed, it will queue a ValueChangeEvent. Later on, the broadcast() method will ensure that this event is broadcast to all interested listeners. This event will be delivered by default in the Process Validators phase, but can be delivered instead during Apply Request Values if the immediate property is set to true.

By default, the rendererType property must be set to "Text". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
static String | CONVERSION_MESSAGE_ID The message identifier of the FacesMessage to be created if a conversion error occurs, and neither the page author nor the ConverterException provides a message.
static String | REQUIRED_MESSAGE_ID The message identifier of the FacesMessage to be created if a required check fails.
static String | UPDATE_MESSAGE_ID The message identifier of the FacesMessage to be created if a model update error occurs, and the thrown exception has no message.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIInput()
Create a new UIInput instance with default property values.
Method Summary
 void addValidator(Validator validator)
Add a Validator instance to the set associated with this UIInput.
 void addValueChangeListener(ValueChangeListener listener)
Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.
protected  boolean compareValues(Object previous, Object value)
Return true if the new value is different from the previous value.
 void decode(FacesContext context)
Decode any new state of this UIComponent from the request contained in the specified FacesContext, and store this state as needed.
protected  Object getConvertedValue(FacesContext context, Object newSubmittedValue)
Convert the submitted value into a "local value" of the appropriate data type, if necessary.
 String getConverterMessage()
If there has been a call to setConverterMessage(java.lang.String) on this instance, return the message.
 String getFamily()
Return the identifier of the component family to which this component belongs.
 String getRequiredMessage()
If there has been a call to setRequiredMessage(java.lang.String) on this instance, return the message.
 Object getSubmittedValue()
Return the submittedValue value of this UIInput component.
 MethodBinding getValidator()
Deprecated. getValidators() should be used instead.
 String getValidatorMessage()
If there has been a call to setRequiredMessage(java.lang.String) on this instance, return the message.
 Validator[] getValidators()
Return the set of registered Validators for this UIInput instance.
 MethodBinding getValueChangeListener()
If EditableValueHolder.setValueChangeListener(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null.
 ValueChangeListener[] getValueChangeListeners()
Return the set of registered ValueChangeListeners for this UIInput instance.
 boolean isImmediate()
Return the "immediate" state for this component.
 boolean isLocalValueSet()
Return the "local value set" state for this component.
 boolean isRequired()
Return the "required field" state for this component.
 boolean isValid()
Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).
 void processDecodes(FacesContext context)
Specialized decode behavior on top of that provided by the superclass.
 void processUpdates(FacesContext context)
In addition to the standard processUpdates behavior inherited from UIComponentBase, calls updateModel().
 void processValidators(FacesContext context)
In addition to the standard processValidators behavior inherited from UIComponentBase, calls validate() if the immediate property is false (which is the default); if the component is invalid afterwards, calls FacesContext.renderResponse().
 void removeValidator(Validator validator)
Remove a Validator instance from the set associated with this UIInput, if it was previously associated.
 void removeValueChangeListener(ValueChangeListener listener)
Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.
 void resetValue()
Convenience method to reset this component's value to the un-initialized state.
 void restoreState(FacesContext context, Object state)
Perform any processing required to restore the state from the entries in the state Object.
 Object saveState(FacesContext context)
Gets the state of the instance as a Serializable Object.
 void setConverterMessage(String message)
Override any ValueExpression set for the "converterMessage" with the literal argument provided to this method.
 void setImmediate(boolean immediate)
Set the "immediate" state for this component.
 void setLocalValueSet(boolean localValueSet)
Sets the "local value set" state for this component.
 void setRequired(boolean required)
Set the "required field" state for this component.
 void setRequiredMessage(String message)
Override any ValueExpression set for the "requiredMessage" with the literal argument provided to this method.
 void setSubmittedValue(Object submittedValue)
Set the submittedValue value of this UIInput component.
 void setValid(boolean valid)
Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).
 void setValidator(MethodBinding validatorBinding)
Deprecated. Use addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.
 void setValidatorMessage(String message)
Override any ValueExpression set for the "validatorMessage" with the literal argument provided to this method.
 void setValue(Object value)
Set the value of this UIComponent (if any).
 void setValueChangeListener(MethodBinding valueChangeListener)
Deprecated. Use addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.
 void updateModel(FacesContext context)
Perform the following algorithm to update the model data associated with this UIInput, if any, as appropriate.
 void validate(FacesContext context)
Perform the following algorithm to validate the local value of this UIInput.
protected  void validateValue(FacesContext context, Object newValue)
Set the "valid" property according to the below algorithm.
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values

英文文档：

CONVERSION_MESSAGE_ID

public static final String CONVERSION_MESSAGE_ID

The message identifier of the FacesMessage to be created if a conversion error occurs, and neither the page author nor the ConverterException provides a message.

See Also:
Constant Field Values

英文文档：

REQUIRED_MESSAGE_ID

public static final String REQUIRED_MESSAGE_ID

The message identifier of the FacesMessage to be created if a required check fails.

See Also:
Constant Field Values

英文文档：

UPDATE_MESSAGE_ID

public static final String UPDATE_MESSAGE_ID

The message identifier of the FacesMessage to be created if a model update error occurs, and the thrown exception has no message.

See Also:
Constant Field Values
Constructor Detail

public UIInput()

使用默认属性值创建新的 UIInput 实例。

英文文档：

UIInput

public UIInput()

Create a new UIInput instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Overrides:
getFamily in class UIOutput

public Object getSubmittedValue()

返回此 UIInput 组件的 submittedValue 值。此方法仅供此组件或其相应 Renderer 的 decode() 和 validate() 方法使用。

英文文档：

getSubmittedValue

public Object getSubmittedValue()

Return the submittedValue value of this UIInput component. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer.

Specified by:
getSubmittedValue in interface EditableValueHolder

public void setSubmittedValue(Object submittedValue)

设置此 UIInput 组件的 submittedValue 值。此方法仅供此组件或其相应 Renderer 的 decode() 和 validate() 方法使用。

submittedValue 新提交的值
英文文档：

setSubmittedValue

public void setSubmittedValue(Object submittedValue)

Set the submittedValue value of this UIInput component. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer.

Specified by:
setSubmittedValue in interface EditableValueHolder
Parameters:
submittedValue - The new submitted value

public void setValue(Object value)
英文文档：

setValue

public void setValue(Object value)
Description copied from interface: ValueHolder

Set the value of this UIComponent (if any).

Specified by:
setValue in interface ValueHolder
Overrides:
setValue in class UIOutput
Parameters:
value - The new local value

public void resetValue()

将此组件的值重置为非初始化状态的便捷方法。此方法执行以下步骤：

调用 #setValue，同时传递 null。

调用 #setSubmittedValue，同时传递 null。

调用 #setLocalValueSet，同时传递 false。

调用 #setValid，同时传递 true。

从此调用返回时，如果该实例的 "value" 属性有与其关联的 ValueBinding，则调用 UIOutput#getValue 时对此绑定求值。否则，从 getValue() 返回 null。

英文文档：

resetValue

public void resetValue()

Convenience method to reset this component's value to the un-initialized state. This method does the following:

Call setValue(java.lang.Object) passing null.

Call setSubmittedValue(java.lang.Object) passing null.

Call setLocalValueSet(boolean) passing false.

Call setValid(boolean) passing true.

Upon return from this call if the instance had a ValueBinding associated with it for the "value" property, this binding is evaluated when UIOutput.getValue() is called. Otherwise, null is returned from getValue().

public boolean isLocalValueSet()
返回此组件的 "local value set" 状态。调用 setValue() 自动将此属性重置为 true。
英文文档：

isLocalValueSet

public boolean isLocalValueSet()
Return the "local value set" state for this component. Calls to setValue() automatically reset this property to true.

Specified by:
isLocalValueSet in interface EditableValueHolder

public void setLocalValueSet(boolean localValueSet)
设置此组件的 "local value set" 状态。
英文文档：

setLocalValueSet

public void setLocalValueSet(boolean localValueSet)
Sets the "local value set" state for this component.

Specified by:
setLocalValueSet in interface EditableValueHolder

public boolean isRequired()

返回此组件的 "required field" 状态。

英文文档：

isRequired

public boolean isRequired()

Return the "required field" state for this component.

Specified by:
isRequired in interface EditableValueHolder

public String getRequiredMessage()

如果曾调用过此实例的 #setRequiredMessage，则返回该消息。否则，调用 #getValueExpression，同时传递键 "requiredMessage"，获取该表达式的结果并将其返回。任何在调用 getValue() 期间抛出的 ELException 都必须在 FacesException 中包装并重新抛出。

英文文档：

getRequiredMessage

public String getRequiredMessage()

If there has been a call to setRequiredMessage(java.lang.String) on this instance, return the message. Otherwise, call UIComponent.getValueExpression(java.lang.String) passing the key "requiredMessage", get the result of the expression, and return it. Any ELExceptions thrown during the call to getValue() must be wrapped in a FacesException and rethrown.

public void setRequiredMessage(String message)

使用提供给此方法的字面值参数重写任何为 "requiredMessage" 设置的 ValueExpression。随后调用 #getRequiredMessage 将返回此值；

message 要在用户尚未提供值，而又必需一个值时显示的字面消息值。
英文文档：

setRequiredMessage

public void setRequiredMessage(String message)

Override any ValueExpression set for the "requiredMessage" with the literal argument provided to this method. Subsequent calls to getRequiredMessage() will return this value;

Parameters:
message - the literal message value to be displayed in the event the user hasn't supplied a value and one is required.

public String getConverterMessage()

如果曾调用过此实例的 #setConverterMessage，则返回该消息。否则，调用 #getValueExpression，同时传递键 "converterMessage"，获取该表达式的结果并将其返回。任何在调用 getValue() 期间抛出的 ELException 都必须在 FacesException 中包装并重新抛出。

英文文档：

getConverterMessage

public String getConverterMessage()

If there has been a call to setConverterMessage(java.lang.String) on this instance, return the message. Otherwise, call UIComponent.getValueExpression(java.lang.String) passing the key "converterMessage", get the result of the expression, and return it. Any ELExceptions thrown during the call to getValue() must be wrapped in a FacesException and rethrown.

public void setConverterMessage(String message)

使用提供给此方法的字面值参数重写任何为 "converterMessage" 设置的 ValueExpression。随后调用 #getConverterMessage 将返回此值；

message 要在转换失败时显示的字面消息值。
英文文档：

setConverterMessage

public void setConverterMessage(String message)

Override any ValueExpression set for the "converterMessage" with the literal argument provided to this method. Subsequent calls to getConverterMessage() will return this value;

Parameters:
message - the literal message value to be displayed in the event conversion fails.

public String getValidatorMessage()

如果曾调用过此实例的 #setRequiredMessage，则返回该消息。否则，调用 #getValueExpression，同时传递键 "requiredMessage"，获取该表达式的结果并将其返回。任何在调用 getValue() 期间抛出的 ELException 都必须在 FacesException 中包装并重新抛出。

英文文档：

getValidatorMessage

public String getValidatorMessage()

If there has been a call to setRequiredMessage(java.lang.String) on this instance, return the message. Otherwise, call UIComponent.getValueExpression(java.lang.String) passing the key "requiredMessage", get the result of the expression, and return it. Any ELExceptions thrown during the call to getValue() must be wrapped in a FacesException and rethrown.

public void setValidatorMessage(String message)

使用提供给此方法的字面值参数重写任何为 "validatorMessage" 设置的 ValueExpression。随后调用 #getValidatorMessage 将返回此值；

message 要在验证失败时显示的字面消息值。
英文文档：

setValidatorMessage

public void setValidatorMessage(String message)

Override any ValueExpression set for the "validatorMessage" with the literal argument provided to this method. Subsequent calls to getValidatorMessage() will return this value;

Parameters:
message - the literal message value to be displayed in the event validation fails.

public boolean isValid()
英文文档：

isValid

public boolean isValid()
Description copied from interface: EditableValueHolder

Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).

Specified by:
isValid in interface EditableValueHolder

public void setValid(boolean valid)
英文文档：

setValid

public void setValid(boolean valid)
Description copied from interface: EditableValueHolder

Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).

Specified by:
setValid in interface EditableValueHolder
Parameters:
valid - The new valid flag

public void setRequired(boolean required)

设置此组件的 "required field" 状态。

required 新的 "required field" 状态
英文文档：

setRequired

public void setRequired(boolean required)

Set the "required field" state for this component.

Specified by:
setRequired in interface EditableValueHolder
Parameters:
required - The new "required field" state

public boolean isImmediate()
英文文档：

isImmediate

public boolean isImmediate()
Description copied from interface: EditableValueHolder

Return the "immediate" state for this component.

Specified by:
isImmediate in interface EditableValueHolder

public void setImmediate(boolean immediate)
英文文档：

setImmediate

public void setImmediate(boolean immediate)
Description copied from interface: EditableValueHolder

Set the "immediate" state for this component. When set to true, the component's value will be converted and validated immediately in the Apply Request Values phase, and ValueChangeEvents will be delivered in that phase as well. The default value for this property must be false.

Specified by:
setImmediate in interface EditableValueHolder
Parameters:
immediate - The new "immediate" state

public MethodBinding getValidator()

返回指向将在请求处理生命周期的处理验证 阶段调用的方法的 MethodBinding，以验证此组件的当前值。

deprecated 应改用 #getValidators。
英文文档：

getValidator

public MethodBinding getValidator()
Deprecated. getValidators() should be used instead.

Return a MethodBinding pointing at a method that will be called during Process Validations phase of the request processing lifecycle, to validate the current value of this component.

Specified by:
getValidator in interface EditableValueHolder

public void setValidator(MethodBinding validatorBinding)

设置指向将在请求处理生命周期的处理验证 阶段调用的方法的 MethodBinding，以验证此组件的当前值。

此表达式所引用的任何方法都必须是公共的，返回类型为 void，并接受类型为 FacesContext、UIComponent 和 Object 的参数。

validatorBinding | 新的 MethodBinding 实例
deprecated | 请改用 #addValidator，通过创建 javax.faces.validator.MethodExpressionValidator 的实例获取参数 Validator。
英文文档：

setValidator

public void setValidator(MethodBinding validatorBinding)
Deprecated. Use addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.

Set a MethodBinding pointing at a method that will be called during Process Validations phase of the request processing lifecycle, to validate the current value of this component.

Any method referenced by such an expression must be public, with a return type of void, and accept parameters of type FacesContext, UIComponent, and Object.

Specified by:
setValidator in interface EditableValueHolder
Parameters:
validatorBinding - The new MethodBinding instance

public MethodBinding getValueChangeListener()
英文文档：

getValueChangeListener

public MethodBinding getValueChangeListener()
Description copied from interface: EditableValueHolder

If EditableValueHolder.setValueChangeListener(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to EditableValueHolder.setValueChangeListener(javax.faces.el.MethodBinding).

Specified by:
getValueChangeListener in interface EditableValueHolder

public void setValueChangeListener(MethodBinding valueChangeListener)
NullPointerException

在 ValueChangeListener 的实现中包装参数 valueChangeMethod，并将其存储在支持 #getValueChangeListeners 方法的内部数据结构中，小心地重写通过以前调用 setValueChangeListener 存储的任何实例。

此参数方法将在处理验证 或应用请求值 阶段（取决于 immediate 属性的值）调用。

此表达式所引用的任何方法都必须是公共的，返回类型为 void，并接受类型为 javax.faces.event.ValueChangeEvent 的参数。

deprecated 请改用 #addValueChangeListener，通过创建 javax.faces.event.MethodExpressionValueChangeListener 的实例获取参数 ValueChangeListener。
英文文档：

setValueChangeListener

public void setValueChangeListener(MethodBinding valueChangeListener)
Deprecated. Use addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.

Wrap the argument valueChangeMethod in an implementation of ValueChangeListener and store it in the internal data structure that backs the EditableValueHolder.getValueChangeListeners() method, taking care to over-write any instance that was stored by a previous call to setValueChangeListener.

This argument method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Any method referenced by such an expression must be public, with a return type of void, and accept a parameter of type ValueChangeEvent.

Specified by:
setValueChangeListener in interface EditableValueHolder
Parameters:
valueChangeListener - The new method binding instance

public void processDecodes(FacesContext context)

在超类提供的解码行为之上的专门解码行为。除继承自 UIComponentBase 的标准 processDecodes 行为外，如果 immediate 属性为 true，则还调用 validate()；之后，如果组件无效，或抛出 RuntimeException，则调用 FacesContext#renderResponse。

Throws NullPointerException: NullPointerException NullPointerException 如果 context 为 null
英文文档：

processDecodes

public void processDecodes(FacesContext context)

Specialized decode behavior on top of that provided by the superclass. In addition to the standard processDecodes behavior inherited from UIComponentBase, calls validate() if the the immediate property is true; if the component is invalid afterwards or a RuntimeException is thrown, calls FacesContext.renderResponse().

Overrides:
processDecodes in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processValidators(FacesContext context)

除继承自 UIComponentBase 的标准 processValidators 行为外，如果 immediate 属性为 false（默认值），则还调用 validate()；之后，如果组件无效，则调用 FacesContext#renderResponse。如果在验证处理期间抛出 RuntimeException，则调用 FacesContext#renderResponse 并重新抛出该异常。

Throws NullPointerException: NullPointerException NullPointerException 如果 context 为 null
英文文档：

processValidators

public void processValidators(FacesContext context)

In addition to the standard processValidators behavior inherited from UIComponentBase, calls validate() if the immediate property is false (which is the default); if the component is invalid afterwards, calls FacesContext.renderResponse(). If a RuntimeException is thrown during validation processing, calls FacesContext.renderResponse() and re-throw the exception.

Overrides:
processValidators in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processUpdates(FacesContext context)

除继承自 UIComponentBase 的标准 processUpdates 行为外，还调用 updateModel()。之后，如果组件无效，则调用 FacesContext#renderResponse。如果在更新处理期间抛出 RuntimeException，则调用 FacesContext#renderResponse 并重新抛出该异常。

Throws NullPointerException: NullPointerException NullPointerException 如果 context 为 null
英文文档：

processUpdates

public void processUpdates(FacesContext context)

In addition to the standard processUpdates behavior inherited from UIComponentBase, calls updateModel(). If the component is invalid afterwards, calls FacesContext.renderResponse(). If a RuntimeException is thrown during update processing, calls FacesContext.renderResponse() and re-throw the exception.

Overrides:
processUpdates in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void decode(FacesContext context)
Throws NullPointerException: NullPointerException NullPointerException 如果 context 为 null
英文文档：

decode

public void decode(FacesContext context)
Description copied from class: UIComponent

Decode any new state of this UIComponent from the request contained in the specified FacesContext, and store this state as needed.

During decoding, events may be enqueued for later processing (by event listeners who have registered an interest), by calling queueEvent().

Overrides:
decode in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void updateModel(FacesContext context)

根据需要，执行下面的算法来更新与此 UIInput 关联的模型数据（如果有）。

  • 如果此组件的 valid 属性为 false，则不采取进一步操作。
  • 如果此组件的 localValueSet 属性为 false，则不采取进一步操作。
  • 如果不存在 value 的 ValueExpression，则不采取进一步操作。
  • 调用 ValueExpression 的 setValue() 方法以更新 ValueExpression 指向的值。
  • 如果 setValue() 方法成功返回：
    • 清除此 UIInput 的本地值。
    • 将此 UIInput 的 localValueSet 属性设置为 false。
  • 如果 setValue() 方法调用失败：
    • 通过调用指定 FacesContext 实例的 addMessage()，将错误消息加入队列。
    • 将此 UIInput 的 valid 属性设置为 false。
context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

updateModel

public void updateModel(FacesContext context)

Perform the following algorithm to update the model data associated with this UIInput, if any, as appropriate.

  • If the valid property of this component is false, take no further action.
  • If the localValueSet property of this component is false, take no further action.
  • If no ValueExpression for value exists, take no further action.
  • Call setValue() method of the ValueExpression to update the value that the ValueExpression points at.
  • If the setValue() method returns successfully:
    • Clear the local value of this UIInput.
    • Set the localValueSet property of this UIInput to false.
  • If the setValue() method call fails:
    • Enqueue an error message by calling addMessage() on the specified FacesContext instance.
    • Set the valid property of this UIInput to false.

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void validate(FacesContext context)

执行下面的算法来验证此 UIInput 的本地值。

  • 通过 getSubmittedValue() 获取提交的值。如果此方法返回 null，则退出而不做进一步处理。（这指示没有为此组件提交任何值。）
  • 通过调用 #getConvertedValue 将提交的值转换为相应数据类型的 "local value"。
  • 通过调用 #validateValue 验证该属性。
  • 如果此组件的 valid 属性仍为 true，则获取该组件以前的值（使用 getValue())，使用 setValue() 存储新本地值，并将提交的值重置为 null。如果本地值与此组件以前的值不同，则触发 ValueChangeEvent 以广播到所有感兴趣的侦听器。

要使用组件中嵌入的逻辑执行验证的实现 UIInput 的应用程序组件应执行其自己的正确性检查，然后调用 super.validate() 方法执行上述标准处理。

context | 当前请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

validate

public void validate(FacesContext context)

Perform the following algorithm to validate the local value of this UIInput.

  • Retrieve the submitted value with getSubmittedValue(). If this returns null, exit without further processing. (This indicates that no value was submitted for this component.)
  • Convert the submitted value into a "local value" of the appropriate data type by calling getConvertedValue(javax.faces.context.FacesContext, java.lang.Object).
  • Validate the property by calling validateValue(javax.faces.context.FacesContext, java.lang.Object).
  • If the valid property of this component is still true, retrieve the previous value of the component (with getValue()), store the new local value using setValue(), and reset the submitted value to null. If the local value is different from the previous value of this component, fire a ValueChangeEvent to be broadcast to all interested listeners.

Application components implementing UIInput that wish to perform validation with logic embedded in the component should perform their own correctness checks, and then call the super.validate() method to perform the standard processing described above.

Parameters:
context - The FacesContext for the current request
Throws:
NullPointerException - if context is null

protected Object getConvertedValue(FacesContext context, Object newSubmittedValue) throws ConverterException

如有必要，将提交的值转换为相应数据类型的 "local value"。可以使用下面的算法做到这一点：

  • 如果存在 Renderer，则调用 getConvertedValue() 转换提交的值。
  • 如果不存在 Renderer，且提交的值为 String，则定位到 Converter，如下所示：
    • 如果 getConverter() 返回非 null Converter，请使用该实例。
    • 否则，如果存在 value 的值绑定，则调用其上的 getType()。
      • 如果此调用返回 null，则假定输出类型是 String 且不执行转换。
      • 否则，调用 Application.createConverter(Class) 定位到可转换指定类型的数据值的任何已注册 Converter。
  • 如果已定位到 Converter 实例，则调用其 getAsObject() 方法来执行转换。如果转换失败：
    • 通过调用 FacesContext 上的 addMessage() 方法将相应的错误消息加入队列。
    • 将此组件的 valid 属性设置为 false。
  • 否则，使用提交的值，而不进行任何转换。

子类可以重写此方法得到更具体的行为。

英文文档：

getConvertedValue

protected Object getConvertedValue(FacesContext context,
                                   Object newSubmittedValue)
                            throws ConverterException

Convert the submitted value into a "local value" of the appropriate data type, if necessary. Employ the following algorithm to do so:

  • If a Renderer is present, call getConvertedValue() to convert the submitted value.
  • If no Renderer is present, and the submitted value is a String, locate a Converter as follows:
    • If getConverter() returns a non-null Converter, use that instance.
    • Otherwise, if a value binding for value exists, call getType() on it.
      • If this call returns null, assume the output type is String and perform no conversion.
      • Otherwise, call Application.createConverter(Class) to locate any registered Converter capable of converting data values of the specified type.
  • If a Converter instance was located, call its getAsObject() method to perform the conversion. If conversion fails:
    • Enqueue an appropriate error message by calling the addMessage() method on the FacesContext.
    • Set the valid property on this component to false
  • Otherwise, use the submitted value without any conversion

This method can be overridden by subclasses for more specific behavior.

Throws:
ConverterException

protected void validateValue(FacesContext context, Object newValue)

根据下面的算法设置 "valid" 属性。

  • 如果此组件的 valid 属性仍为 true，且 required 属性也为 true，则确保本地值不为空（其中，"empty" 定义为 null 或长度为 0 的 String）。如果本地值为空：
    • 通过调用当前请求的 FacesContext 实例上的 addMessage() 方法，将相应的错误消息加入队列。如果 #getRequiredMessage 返回非 null，则将该值用作在 FacesContext 中排队的 FacesMessage 中的 summary 和 detail，否则使用 #REQUIRED_MESSAGE_ID 的消息。
    • 将此组件的 valid 属性设置为 false。
  • 如果此组件的 valid 属性仍为 true，且本地值不为空，则调用每个为此 UIInput 注册的 Validator 的 validate() 方法，接着调用 validatorBinding 属性指向的方法（如果有）。如果这些验证器中的任何一个或该方法抛出 ValidatorException，则捕获该异常，并将其消息（如果有）添加到 FacesContext，然后将此组件的 valid 属性设置为 false。
英文文档：

validateValue

protected void validateValue(FacesContext context,
                             Object newValue)

Set the "valid" property according to the below algorithm.

  • If the valid property on this component is still true, and the required property is also true, ensure that the local value is not empty (where "empty" is defined as null or a zero-length String. If the local value is empty:
    • Enqueue an appropriate error message by calling the addMessage() method on the FacesContext instance for the current request. If the getRequiredMessage() returns non-null, use the value as the summary and detail in the FacesMessage that is enqueued on the FacesContext, otherwise use the message for the REQUIRED_MESSAGE_ID.
    • Set the valid property on this component to false.
  • If the valid property on this component is still true, and the local value is not empty, call the validate() method of each Validator registered for this UIInput, followed by the method pointed at by the validatorBinding property (if any). If any of these validators or the method throws a ValidatorException, catch the exception, add its message (if any) to the FacesContext, and set the valid property of this component to false.

protected boolean compareValues(Object previous, Object value)

如果新值与以前的值不同，则返回 true。

previous | 此组件以前的值（如果有）
value | 此组件的新值（如果有）
英文文档：

compareValues

protected boolean compareValues(Object previous,
                                Object value)

Return true if the new value is different from the previous value.

Parameters:
previous - old value of this component (if any)
value - new value of this component (if any)

public void addValidator(Validator validator)

将 Validator 实例添加到与此 UIInput 关联的集合。

validator | 要添加的 Validator
Throws | NullPointerException: 如果 validator 为 null
英文文档：

addValidator

public void addValidator(Validator validator)

Add a Validator instance to the set associated with this UIInput.

Specified by:
addValidator in interface EditableValueHolder
Parameters:
validator - The Validator to add
Throws:
NullPointerException - if validator is null

public Validator[] getValidators()

返回为此 UIInput 实例注册的 Validator 集合。如果不存在任何已注册验证器，则返回一个长度为 0 的数组。

英文文档：

getValidators

public Validator[] getValidators()

Return the set of registered Validators for this UIInput instance. If there are no registered validators, a zero-length array is returned.

Specified by:
getValidators in interface EditableValueHolder

public void removeValidator(Validator validator)

从与此 UIInput 关联的集合中移除 Validator 实例（如果以前将它们关联过）。其他情况下不执行任何操作。

validator 要移除的 Validator
英文文档：

removeValidator

public void removeValidator(Validator validator)

Remove a Validator instance from the set associated with this UIInput, if it was previously associated. Otherwise, do nothing.

Specified by:
removeValidator in interface EditableValueHolder
Parameters:
validator - The Validator to remove

public void addValueChangeListener(ValueChangeListener listener)

向希望在发生 ValueChangeEvent 时获得通知的侦听器集合中添加一个新的 ValueChangeListener。

listener | 要添加的 ValueChangeListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

addValueChangeListener

public void addValueChangeListener(ValueChangeListener listener)

Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.

Specified by:
addValueChangeListener in interface EditableValueHolder
Parameters:
listener - The ValueChangeListener to be added
Throws:
NullPointerException - if listener is null

public ValueChangeListener[] getValueChangeListeners()

返回为此 UIInput 实例注册的 ValueChangeListener 集合。如果不存在任何已注册侦听器，则返回一个长度为 0 的数组。

英文文档：

getValueChangeListeners

public ValueChangeListener[] getValueChangeListeners()

Return the set of registered ValueChangeListeners for this UIInput instance. If there are no registered listeners, a zero-length array is returned.

Specified by:
getValueChangeListeners in interface EditableValueHolder

public void removeValueChangeListener(ValueChangeListener listener)

从希望在发生 ValueChangeEvent 时获得通知的侦听器集合中移除一个现有的 ValueChangeListener（如果有）。

listener | 要移除的 ValueChangeListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

removeValueChangeListener

public void removeValueChangeListener(ValueChangeListener listener)

Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.

Specified by:
removeValueChangeListener in interface EditableValueHolder
Parameters:
listener - The ValueChangeListener to be removed
Throws:
NullPointerException - if listener is null

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIOutput

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIOutput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIMessage (Java EE 5)

javax.faces.component
Class UIMessage

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIMessage
All Implemented Interfaces:
StateHolder
Direct Known Subclasses:
HtmlMessage
public class UIMessage
extends UIComponentBase

Extends: UIComponent > UIComponentBase
Extended by: HtmlMessage

此组件负责显示由 clientId 标识的特定 UIComponent 的消息。该组件获取来自 FacesContext 的消息。

默认情况下，rendererType 属性必须设置为 "javax.faces.Message"。可以调用 setRendererType() 方法更改此值。

英文文档：

This component is responsible for displaying messages for a specific UIComponent, identified by a clientId. The component obtains the messages from the FacesContext.

By default, the rendererType property must be set to "javax.faces.Message". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIMessage()
Create a new UIMessage instance with default property values.
Method Summary
String | getFamily() Return the identifier of the component family to which this component belongs.
String | getFor() Return the client identifier of the component for which this component represents associated message(s) (if any).
boolean | isShowDetail() Return the flag indicating whether the detail property of the associated message(s) should be displayed.
boolean | isShowSummary() Return the flag indicating whether the summary property of the associated message(s) should be displayed.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setFor(String newFor) Set the client identifier of the component for which this component represents associated message(s) (if any).
void | setShowDetail(boolean showDetail) Set the flag indicating whether the detail property of the associated message(s) should be displayed.
void | setShowSummary(boolean showSummary) Set the flag indicating whether the summary property of the associated message(s) should be displayed.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIMessage()

使用默认属性值创建新的 UIMessage 实例。

英文文档：

UIMessage

public UIMessage()

Create a new UIMessage instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public String getFor()

返回此组件为其表示关联消息（如果有）的组件的客户端标识符。

英文文档：

getFor

public String getFor()

Return the client identifier of the component for which this component represents associated message(s) (if any).

public void setFor(String newFor)

设置此组件为其表示关联消息（如果有）的组件的客户端标识符。必须在显示该消息前设置此属性。

newFor 新的客户端 ID
英文文档：

setFor

public void setFor(String newFor)

Set the client identifier of the component for which this component represents associated message(s) (if any). This property must be set before the message is displayed.

Parameters:
newFor - The new client id

public boolean isShowDetail()

返回指示是否应该显示关联消息的 detail 属性的标志。默认值为 true。

英文文档：

isShowDetail

public boolean isShowDetail()

Return the flag indicating whether the detail property of the associated message(s) should be displayed. Defaults to true.

public void setShowDetail(boolean showDetail)

设置指示是否应该显示关联消息的 detail 属性的标志。

showDetail 新的标志
英文文档：

setShowDetail

public void setShowDetail(boolean showDetail)

Set the flag indicating whether the detail property of the associated message(s) should be displayed.

Parameters:
showDetail - The new flag

public boolean isShowSummary()

返回指示是否应该显示关联消息的 summary 属性的标志。默认值为 false。

英文文档：

isShowSummary

public boolean isShowSummary()

Return the flag indicating whether the summary property of the associated message(s) should be displayed. Defaults to false.

public void setShowSummary(boolean showSummary)

设置指示是否应该显示关联消息的 summary 属性的标志。

showSummary 新的标志值
英文文档：

setShowSummary

public void setShowSummary(boolean showSummary)

Set the flag indicating whether the summary property of the associated message(s) should be displayed.

Parameters:
showSummary - The new flag value

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIMessages (Java EE 5)

javax.faces.component
Class UIMessages

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIMessages
All Implemented Interfaces:
StateHolder
Direct Known Subclasses:
HtmlMessages
public class UIMessages
extends UIComponentBase

Extends: UIComponent > UIComponentBase
Extended by: HtmlMessages

此组件的 renderer 负责获取来自 FacesContext 的消息并将其显示给用户。

此组件支持 Messages renderer 类型。

默认情况下，rendererType 属性必须设置为 "javax.faces.Messages"。可以调用 setRendererType() 方法更改此值。

英文文档：

The renderer for this component is responsible for obtaining the messages from the FacesContext and displaying them to the user.

This component supports the Messages renderer-type.

By default, the rendererType property must be set to "javax.faces.Messages". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIMessages()
Create a new UIMessages instance with default property values.
Method Summary
String | getFamily() Return the identifier of the component family to which this component belongs.
boolean | isGlobalOnly() Return the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.
boolean | isShowDetail() Return the flag indicating whether the detail property of the associated message(s) should be displayed.
boolean | isShowSummary() Return the flag indicating whether the summary property of the associated message(s) should be displayed.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setGlobalOnly(boolean globalOnly) Set the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.
void | setShowDetail(boolean showDetail) Set the flag indicating whether the detail property of the associated message(s) should be displayed.
void | setShowSummary(boolean showSummary) Set the flag indicating whether the summary property of the associated message(s) should be displayed.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIMessages()

使用默认属性值创建新的 UIMessages 实例。

英文文档：

UIMessages

public UIMessages()

Create a new UIMessages instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public boolean isGlobalOnly()

返回指示是否仅应呈现全局消息（即没有关联客户端标识符的消息）的标志。默认值为 false。

英文文档：

isGlobalOnly

public boolean isGlobalOnly()

Return the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered. Defaults to false.

public void setGlobalOnly(boolean globalOnly)

设置指示是否仅应呈现全局消息（即没有关联客户端标识符的消息）的标志。

globalOnly 新的标志值
英文文档：

setGlobalOnly

public void setGlobalOnly(boolean globalOnly)

Set the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.

Parameters:
globalOnly - The new flag value

public boolean isShowDetail()

返回指示是否应该显示关联消息的 detail 属性的标志。默认值为 false。

英文文档：

isShowDetail

public boolean isShowDetail()

Return the flag indicating whether the detail property of the associated message(s) should be displayed. Defaults to false.

public void setShowDetail(boolean showDetail)

设置指示是否应该显示关联消息的 detail 属性的标志。

showDetail 新的标志
英文文档：

setShowDetail

public void setShowDetail(boolean showDetail)

Set the flag indicating whether the detail property of the associated message(s) should be displayed.

Parameters:
showDetail - The new flag

public boolean isShowSummary()

返回指示是否应该显示关联消息的 summary 属性的标志。默认值为 true。

英文文档：

isShowSummary

public boolean isShowSummary()

Return the flag indicating whether the summary property of the associated message(s) should be displayed. Defaults to true.

public void setShowSummary(boolean showSummary)

设置指示是否应该显示关联消息的 summary 属性的标志。

showSummary 新的标志值
英文文档：

setShowSummary

public void setShowSummary(boolean showSummary)

Set the flag indicating whether the summary property of the associated message(s) should be displayed.

Parameters:
showSummary - The new flag value

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UINamingContainer (Java EE 5)

javax.faces.component
Class UINamingContainer

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UINamingContainer
All Implemented Interfaces:
NamingContainer, StateHolder
public class UINamingContainer
extends UIComponentBase
implements NamingContainer

Extends: UIComponent > UIComponentBase
Implements: NamingContainer

UINamingContainer 是要实现 NamingContainer 功能的组件的便捷基类。

英文文档：

UINamingContainer is a convenience base class for components that wish to implement NamingContainer functionality.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
Constructor Summary
UINamingContainer()
Create a new UINamingContainer instance with default property values.
Method Summary
 String getFamily()
Return the identifier of the component family to which this component belongs.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UINamingContainer()

使用默认属性值创建新的 UINamingContainer 实例。

英文文档：

UINamingContainer

public UINamingContainer()

Create a new UINamingContainer instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIOutput (Java EE 5)

javax.faces.component
Class UIOutput

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
All Implemented Interfaces:
StateHolder, ValueHolder
Direct Known Subclasses:
HtmlOutputFormat, HtmlOutputLabel, HtmlOutputLink, HtmlOutputText, UIInput
public class UIOutput
extends UIComponentBase
implements ValueHolder

Extends: UIComponent > UIComponentBase
Implements: ValueHolder
Extended by: HtmlOutputFormat, HtmlOutputLabel, HtmlOutputLink, HtmlOutputText, UIInput

UIOutput 是包含一个要显示给用户的值的 UIComponent，可以选择通过值表达式从模型层 Bean 中获取该值。用户无法直接修改呈现的值；它仅用于显示目的。

在请求处理生命周期的呈现响应 阶段，必须根据以下规则，将此组件的当前值转换为 String（如果它还不是 String 的话）：

  • 如果当前值不为 null，而且也不是 String，定位用于转换的 Converter（如果有），如下所示：
    • 如果 getConverter() 返回非 null Converter，则使用该 Converter，否则，
    • 如果将当前值的类传递给 Application.createConverter(Class) 而它返回非 null Converter，则使用该 Converter。
  • 如果当前值不是 null 且找到了 Converter，则调用其 getAsString() 方法执行转换。
  • 如果当前值不是 null，但未找到 Converter，则调用当前值的 toString() 来执行转换。

默认情况下，rendererType 属性必须设置为 "javax.faces.Text"。可以调用 setRendererType() 方法更改此值。

英文文档：

UIOutput is a UIComponent that has a value, optionally retrieved from a model tier bean via a value expression, that is displayed to the user. The user cannot directly modify the rendered value; it is for display purposes only.

During the Render Response phase of the request processing lifecycle, the current value of this component must be converted to a String (if it is not already), according to the following rules:

  • If the current value is not null, and is not already a String, locate a Converter (if any) to use for the conversion, as follows:
    • If getConverter() returns a non-null Converter, use that one, otherwise
    • If Application.createConverter(Class), passing the current value's class, returns a non-null Converter, use that one.
  • If the current value is not null and a Converter was located, call its getAsString() method to perform the conversion.
  • If the current value is not null but no Converter was located, call toString() on the current value to perform the conversion.

By default, the rendererType property must be set to "javax.faces.Text". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIOutput()
Create a new UIOutput instance with default property values.
Method Summary
Converter | getConverter() Return the Converter (if any) that is registered for this UIComponent.
String | getFamily() Return the identifier of the component family to which this component belongs.
Object | getLocalValue() Return the local value of this UIComponent (if any), without evaluating any associated ValueExpression.
Object | getValue() Gets the value of this UIComponent.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setConverter(Converter converter) Set the Converter (if any) that is registered for this UIComponent.
void | setValue(Object value) Set the value of this UIComponent (if any).
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIOutput()

使用默认属性值创建新的 UIOutput 实例。

英文文档：

UIOutput

public UIOutput()

Create a new UIOutput instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public Converter getConverter()
英文文档：

getConverter

public Converter getConverter()
Description copied from interface: ValueHolder

Return the Converter (if any) that is registered for this UIComponent.

Specified by:
getConverter in interface ValueHolder

public void setConverter(Converter converter)
英文文档：

setConverter

public void setConverter(Converter converter)
Description copied from interface: ValueHolder

Set the Converter (if any) that is registered for this UIComponent.

Specified by:
setConverter in interface ValueHolder
Parameters:
converter - New Converter (or null)

public Object getLocalValue()
英文文档：

getLocalValue

public Object getLocalValue()
Description copied from interface: ValueHolder

Return the local value of this UIComponent (if any), without evaluating any associated ValueExpression.

Specified by:
getLocalValue in interface ValueHolder

public Object getValue()
英文文档：

getValue

public Object getValue()
Description copied from interface: ValueHolder

Gets the value of this UIComponent. First, consult the local value property of this component. If non-null return it. If null, see if we have a ValueExpression for the value property. If so, return the result of evaluating the property, otherwise return null. Note that because the specification for UIComponent.setValueBinding(java.lang.String, javax.faces.el.ValueBinding) requires a call through to UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression), legacy tags will continue to work.

Specified by:
getValue in interface ValueHolder

public void setValue(Object value)
英文文档：

setValue

public void setValue(Object value)
Description copied from interface: ValueHolder

Set the value of this UIComponent (if any).

Specified by:
setValue in interface ValueHolder
Parameters:
value - The new local value

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIPanel (Java EE 5)

javax.faces.component
Class UIPanel

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIPanel
All Implemented Interfaces:
StateHolder
Direct Known Subclasses:
HtmlPanelGrid, HtmlPanelGroup
public class UIPanel
extends UIComponentBase

Extends: UIComponent > UIComponentBase
Extended by: HtmlPanelGrid, HtmlPanelGroup

UIPanel 是管理其子组件布局的 UIComponent。

英文文档：

UIPanel is a UIComponent that manages the layout of its child components.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIPanel()
Create a new UIPanel instance with default property values.
Method Summary
 String getFamily()
Return the identifier of the component family to which this component belongs.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIPanel()

使用默认属性值创建新的 UIPanel 实例。

英文文档：

UIPanel

public UIPanel()

Create a new UIPanel instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIParameter (Java EE 5)

javax.faces.component
Class UIParameter

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIParameter
All Implemented Interfaces:
StateHolder
public class UIParameter
extends UIComponentBase

Extends: UIComponent > UIComponentBase

UIParameter 是表示父组件配置参数的 UIComponent,可以选择命名参数。

父组件应通过调用 getValue() 来获取参数的值。通过这种方法，可以直接在组件上设置参数值（通过 setValue()），也可以通过值绑定表达式间接获取。

在某些情况下，除了提供通过 getValue() 方法访问的参数值外，还要提供参数名称。支持其嵌入 UIParameter 子组件上的参数名称的 javax.faces.render.Renderer 应记录此属性的使用。

英文文档：

UIParameter is a UIComponent that represents an optionally named configuration parameter for a parent component.

Parent components should retrieve the value of a parameter by calling getValue(). In this way, the parameter value can be set directly on the component (via setValue()), or retrieved indirectly via the value binding expression.

In some scenarios, it is necessary to provide a parameter name, in addition to the parameter value that is accessible via the getValue() method. Renderers that support parameter names on their nested UIParameter child components should document their use of this property.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIParameter()
Create a new UIParameter instance with default property values.
Method Summary
String | getFamily() Return the identifier of the component family to which this component belongs.
String | getName() Return the optional parameter name for this parameter.
Object | getValue() Returns the value property of the UIParameter.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setName(String name) Set the optional parameter name for this parameter.
void | setValue(Object value) Sets the value property of the\ UIParameter.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UIParameter()

使用默认属性值创建新的 UIParameter 实例。

英文文档：

UIParameter

public UIParameter()

Create a new UIParameter instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public String getName()

返回此参数的可选参数名称。

英文文档：

getName

public String getName()

Return the optional parameter name for this parameter.

public void setName(String name)

设置此参数的可选参数名称。

name 新的参数名称，或如果没有名称，则为 null
英文文档：

setName

public void setName(String name)

Set the optional parameter name for this parameter.

Parameters:
name - The new parameter name, or null for no name

public Object getValue()

返回 UIParameter 的 value 属性。

英文文档：

getValue

public Object getValue()

Returns the value property of the UIParameter.

public void setValue(Object value)

设置 UIParameter 的 value 属性。

value 新值
英文文档：

setValue

public void setValue(Object value)

Sets the value property of the\ UIParameter.

Parameters:
value - the new value

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UISelectBoolean (Java EE 5)

javax.faces.component
Class UISelectBoolean

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectBoolean
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
Direct Known Subclasses:
HtmlSelectBooleanCheckbox
public class UISelectBoolean
extends UIInput

Extends: UIComponent > UIComponentBase > UIOutput > UIInput
Extended by: HtmlSelectBooleanCheckbox

UISelectBoolean 是表示单个 boolean 值（true 或 false）的 UIComponent。它最常呈现为一个复选框。

默认情况下，rendererType 属性必须设置为 "javax.faces.Checkbox"。可以调用 setRendererType() 方法更改此值。

英文文档：

UISelectBoolean is a UIComponent that represents a single boolean (true or false) value. It is most commonly rendered as a checkbox.

By default, the rendererType property must be set to "javax.faces.Checkbox". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UISelectBoolean()
Create a new UISelectBoolean instance with default property values.
Method Summary
 String getFamily()
Return the identifier of the component family to which this component belongs.
 ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by getValueExpression(java.lang.String).
 ValueExpression getValueExpression(String name)
Return any ValueExpression set for value if a ValueExpression for selected is requested; otherwise, perform the default superclass processing for this method.
 boolean isSelected()
Return the local value of the selected state of this component.
 void setSelected(boolean selected)
Set the local value of the selected state of this component.
 void setValueBinding(String name, ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).
 void setValueExpression(String name, ValueExpression binding)
Store any ValueExpression specified for selected under value instead; otherwise, perform the default superclass processing for this method.
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UISelectBoolean()

使用默认属性值创建新的 UISelectBoolean 实例。

英文文档：

UISelectBoolean

public UISelectBoolean()

Create a new UISelectBoolean instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Overrides:
getFamily in class UIInput

public boolean isSelected()

返回此组件选定状态的本地值。此方法是 getValue() 的一个类型安全别名。

英文文档：

isSelected

public boolean isSelected()

Return the local value of the selected state of this component. This method is a typesafe alias for getValue().

public void setSelected(boolean selected)

设置此组件选定状态的本地值。此方法是 setValue() 的一个类型安全别名。

selected 新的选定状态
英文文档：

setSelected

public void setSelected(boolean selected)

Set the local value of the selected state of this component. This method is a typesafe alias for setValue().

Parameters:
selected - The new selected state

public ValueBinding getValueBinding(String name)

如果请求 selected 的 ValueBinding，则返回任何为 value 设置的 ValueBinding；否则，执行此方法的默认超类处理。

依赖于超类实现来包装 ValueBinding 中返回的 ValueExpression。

name | 要为其获取 ValueBinding 的属性的名称
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #getValueExpression 替代。
英文文档：

getValueBinding

public ValueBinding getValueBinding(String name)
Deprecated. This has been replaced by getValueExpression(java.lang.String).

Return any ValueBinding set for value if a ValueBinding for selected is requested; otherwise, perform the default superclass processing for this method.

Rely on the superclass implementation to wrap the returned ValueExpression in a ValueBinding.

Overrides:
getValueBinding in class UIComponentBase
Parameters:
name - Name of the attribute or property for which to retrieve a ValueBinding
Throws:
NullPointerException - if name is null

public void setValueBinding(String name, ValueBinding binding)

存储 value 下为 selected 指定的任何 ValueBinding；否则，执行此方法的默认超类处理。

依赖于超类实现来包装 ValueExpression 中的参数 ValueBinding。

name | 要为其设置 ValueBinding 的属性的名称
binding | 要设置的 ValueBinding，或为 null 以移除任何当前设置的 ValueBinding
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #setValueExpression 替代。
英文文档：

setValueBinding

public void setValueBinding(String name,
                            ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).

Store any ValueBinding specified for selected under value instead; otherwise, perform the default superclass processing for this method.

Rely on the superclass implementation to wrap the argument ValueBinding in a ValueExpression.

Overrides:
setValueBinding in class UIComponentBase
Parameters:
name - Name of the attribute or property for which to set a ValueBinding
binding - The ValueBinding to set, or null to remove any currently set ValueBinding
Throws:
NullPointerException - if name is null

public ValueExpression getValueExpression(String name)

如果请求 selected 的 ValueExpression，则返回任何为 value 设置的 ValueExpression；否则，执行此方法的默认超类处理。

name | 要为其获取 ValueExpression 的属性的名称
Throws | NullPointerException: 如果 name 为 null
since | 1.2
英文文档：

getValueExpression

public ValueExpression getValueExpression(String name)

Return any ValueExpression set for value if a ValueExpression for selected is requested; otherwise, perform the default superclass processing for this method.

Overrides:
getValueExpression in class UIComponent
Parameters:
name - Name of the attribute or property for which to retrieve a ValueExpression
Throws:
NullPointerException - if name is null
Since:
1.2

public void setValueExpression(String name, ValueExpression binding)

存储 value 下为 selected 指定的任何 ValueExpression；否则，执行此方法的默认超类处理。

name | 要为其设置 ValueExpression 的属性的名称
binding | 要设置的 ValueExpression，或为 null 以移除任何当前设置的 ValueExpression
Throws | NullPointerException: 如果 name 为 null
since | 1.2
英文文档：

setValueExpression

public void setValueExpression(String name,
                               ValueExpression binding)

Store any ValueExpression specified for selected under value instead; otherwise, perform the default superclass processing for this method.

Overrides:
setValueExpression in class UIComponent
Parameters:
name - Name of the attribute or property for which to set a ValueExpression
binding - The ValueExpression to set, or null to remove any currently set ValueExpression
Throws:
NullPointerException - if name is null
Since:
1.2
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UISelectItem (Java EE 5)

javax.faces.component
Class UISelectItem

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UISelectItem
All Implemented Interfaces:
StateHolder
public class UISelectItem
extends UIComponentBase

Extends: UIComponent > UIComponentBase

UISelectItem 是可以嵌入 UISelectMany 或 UISelectOne 组件内部的组件，并且会导致将 SelectItem 实例添加到父组件的可用选项列表。可以通过以下方式之一指定 SelectItem 的内容：

  • value 属性的值是 SelectItem 的实例。
  • 关联的 javax.el.ValueExpression 指向类型为 SelectItem 的模型数据项。
  • 根据 itemDescription、itemDisabled、itemLabel 和 itemValue 属性的值合成新的 SelectItem 实例。
英文文档：

UISelectItem is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of a SelectItem instance to the list of available options for the parent component. The contents of the SelectItem can be specified in one of the following ways:

  • The value attribute's value is an instance of SelectItem.
  • The associated ValueExpression points at a model data item of type SelectItem.
  • A new SelectItem instance is synthesized from the values of the itemDescription, itemDisabled, itemLabel, and itemValue attributes.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UISelectItem()
Create a new UISelectItem instance with default property values.
Method Summary
String | getFamily() Return the identifier of the component family to which this component belongs.
String | getItemDescription() Return the description for this selection item.
String | getItemLabel() Return the localized label for this selection item.
Object | getItemValue() Return the server value for this selection item.
Object | getValue() Returns the value property of the UISelectItem.
boolean | isItemDisabled() Return the disabled setting for this selection item.
boolean | isItemEscaped() Return the escape setting for the label of this selection item.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setItemDescription(String itemDescription) Set the description for this selection item.
void | setItemDisabled(boolean itemDisabled) Set the disabled value for this selection item.
void | setItemEscaped(boolean itemEscaped) Set the escape value for the label of this selection item.
void | setItemLabel(String itemLabel) Set the localized label for this selection item.
void | setItemValue(Object itemValue) Set the server value for this selection item.
void | setValue(Object value) Sets the value property of the UISelectItem.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UISelectItem()

使用默认属性值创建新的 UISelectItem 实例。

英文文档：

UISelectItem

public UISelectItem()

Create a new UISelectItem instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public String getItemDescription()

返回此选定项的描述。

英文文档：

getItemDescription

public String getItemDescription()

Return the description for this selection item.

public void setItemDescription(String itemDescription)

设置此选定项的描述。

itemDescription 新的描述
英文文档：

setItemDescription

public void setItemDescription(String itemDescription)

Set the description for this selection item.

Parameters:
itemDescription - The new description

public boolean isItemDisabled()

返回此选定项的禁用设置。

英文文档：

isItemDisabled

public boolean isItemDisabled()

Return the disabled setting for this selection item.

public void setItemDisabled(boolean itemDisabled)

设置此选定项的禁用值。

itemDisabled 新的禁用标志
英文文档：

setItemDisabled

public void setItemDisabled(boolean itemDisabled)

Set the disabled value for this selection item.

Parameters:
itemDisabled - The new disabled flag

public boolean isItemEscaped()

选择此选定项标签的转义设置。

英文文档：

isItemEscaped

public boolean isItemEscaped()

Return the escape setting for the label of this selection item.

public void setItemEscaped(boolean itemEscaped)

设置此选定项标签的转义值。

itemEscaped 新的禁用标志
英文文档：

setItemEscaped

public void setItemEscaped(boolean itemEscaped)

Set the escape value for the label of this selection item.

Parameters:
itemEscaped - The new disabled flag

public String getItemLabel()

返回此选定项的本地化标签。

英文文档：

getItemLabel

public String getItemLabel()

Return the localized label for this selection item.

public void setItemLabel(String itemLabel)

设置此选定项的本地化标签。

itemLabel 新的本地化标签
英文文档：

setItemLabel

public void setItemLabel(String itemLabel)

Set the localized label for this selection item.

Parameters:
itemLabel - The new localized label

public Object getItemValue()

返回此选定项的服务器值。

英文文档：

getItemValue

public Object getItemValue()

Return the server value for this selection item.

public void setItemValue(Object itemValue)

设置此选定项的服务器值。

itemValue 新的服务器值
英文文档：

setItemValue

public void setItemValue(Object itemValue)

Set the server value for this selection item.

Parameters:
itemValue - The new server value

public Object getValue()

返回 UISelectItem 的 value 属性。

英文文档：

getValue

public Object getValue()

Returns the value property of the UISelectItem.

public void setValue(Object value)

设置 UISelectItem 的 value 属性。

value 新值
英文文档：

setValue

public void setValue(Object value)

Sets the value property of the UISelectItem.

Parameters:
value - the new value

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UISelectItems (Java EE 5)

javax.faces.component
Class UISelectItems

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UISelectItems
All Implemented Interfaces:
StateHolder
public class UISelectItems
extends UIComponentBase

Extends: UIComponent > UIComponentBase

UISelectItems 是可以嵌入 UISelectMany 或 UISelectOne 组件内部的组件，并且会导致将一个或多个 SelectItem 实例添加到父组件的可用选项列表。此组件的 value（直接设置，或通过 javax.el.ValueExpression 间接获得）可以为以下任一类型：

  • SelectItem 的单个实例 - 此实例被添加到父标记的可用选项集合。
  • SelectItem 的数组 - 此实例集合按下标升序顺序被添加到父组件的可用选项集合。
  • SelectItem Collection - 此实例集合按其上迭代器提供的顺序被添加到父组件的可用选项集合。
  • Map - 此对象的键（转换为 String 后）假定为标签，而此对象的值（转换为 String 后）假定为 SelectItem 实例的值，可以动态构造这些实例，并按这些键上迭代器提供的顺序，将其添加到父组件的可用选项集合。
英文文档：

UISelectItems is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of one or more SelectItem instances to the list of available options in the parent component. The value of this component (set either directly, or acquired indirectly a ValueExpression, can be of any of the following types:

  • Single instance of SelectItem - This instance is added to the set of available options for the parent tag.
  • Array of SelectItem - This set of instances is added to the set of available options for the parent component, in ascending subscript order.
  • Collection of SelectItem - This set of instances is added to the set of available options for the parent component, in the order provided by an iterator over them.
  • Map - The keys of this object (once converted to Strings) are assumed to be labels, and the values of this object (once converted to Strings) are assumed to be values, of SelectItem instances that will be constructed dynamically and added to the set of available options for the parent component, in the order provided by an iterator over the keys.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UISelectItems()
Create a new UISelectItems instance with default property values.
Method Summary
String | getFamily() Return the identifier of the component family to which this component belongs.
Object | getValue() Returns the value property of the UISelectItems.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setValue(Object value) Sets the value property of the UISelectItems.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values
Constructor Detail

public UISelectItems()

使用默认属性值创建新的 UISelectItems 实例。

英文文档：

UISelectItems

public UISelectItems()

Create a new UISelectItems instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public Object getValue()

返回 UISelectItems 的 value 属性。

英文文档：

getValue

public Object getValue()

Returns the value property of the UISelectItems.

public void setValue(Object value)

设置 UISelectItems 的 value 属性。

value 新值
英文文档：

setValue

public void setValue(Object value)

Sets the value property of the UISelectItems.

Parameters:
value - the new value

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UISelectMany (Java EE 5)

javax.faces.component
Class UISelectMany

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectMany
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
Direct Known Subclasses:
HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu
public class UISelectMany
extends UIInput

Extends: UIComponent > UIComponentBase > UIOutput > UIInput
Extended by: HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu

UISelectMany 是表示用户从离散的可用选项集合中选择 0 或多个项的 UIComponent。用户可以修改选定的值。（可选）通过将 0 或多个当前选定项存储为该组件的 value 属性中的数组，可以使用它们预配置组件。

此组件通常呈现为一个选择框或一组复选框。

默认情况下，rendererType 属性必须设置为 "javax.faces.Listbox"。可以调用 setRendererType() 方法更改此值。

此组件的 javax.faces.render.Renderer 必须在 getConvertedValue() 上执行以下逻辑：

    使用下面的算法获取 javax.faces.convert.Converter：

      如果组件有连接的 javax.faces.convert.Converter，则使用它。

      如果没有，则查找 value 的 ValueExpression（如果有）。ValueExpression 必须指向以下各项：

      • 基本类型数组（如 int[]）。查找为此基本类型注册的按类转换的 javax.faces.convert.Converter。
      • 对象数组（如 Integer[] 或 String[]）。查找为底层元素类型注册的按类转换的 javax.faces.convert.Converter。
      • java.util.List。假定该元素类型为 java.lang.String，因此不需要转换。

      如果由于任何原因无法找到 Converter，则假定类型为 String 数组。

    使用选定的 javax.faces.convert.Converter（如果有）将请求中的值数组或列表中的每个元素转换为正确的类型。如果组件的 value 有 ValueBinding，则创建所需类型的数组来存放转换的值。如果组件的 value 没有 ValueBinding，则创建类型为 Object 的数组。将创建的数组存储为组件的本地值，将组件的 valid 状态设置为 true，然后返回。

英文文档：

UISelectMany is a UIComponent that represents the user's choice of a zero or more items from among a discrete set of available options. The user can modify the selected values. Optionally, the component can be preconfigured with zero or more currently selected items, by storing them as an array in the value property of the component.

This component is generally rendered as a select box or a group of checkboxes.

By default, the rendererType property must be set to "javax.faces.Listbox". This value can be changed by calling the setRendererType() method.

The Renderer for this component must perform the following logic on getConvertedValue():

    Obtain the Converter using the following algorithm:

      If the component has an attached Converter, use it.

      If not, look for a ValueExpression for value (if any). The ValueExpression must point to something that is:

      • An array of primitives (such as int[]). Look up the registered by-class Converter for this primitive type.
      • An array of objects (such as Integer[] or String[]). Look up the registered by-class Converter for the underlying element type.
      • A java.util.List. Assume that the element type is java.lang.String, so no conversion is required.

      If for any reason a Converter cannot be found, assume the type to be a String array.

    Use the selected Converter (if any) to convert each element in the values array or list from the request to the proper type. If the component has a ValueBinding for value, create an array of the expected type to hold the converted values. If the component does not have a ValueBinding for value, create an array of type Object. Store the created array as the local value of the component, set the component's valid state to true and return.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
static String | INVALID_MESSAGE_ID The message identifier of the FacesMessage to be created if a value not matching the available options is specified.
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UISelectMany()
Create a new UISelectMany instance with default property values.
Method Summary
protected  boolean compareValues(Object previous, Object value)
Return true if the new value is different from the previous value.
 String getFamily()
Return the identifier of the component family to which this component belongs.
 Object[] getSelectedValues()
Return the currently selected values, or null if there are no currently selected values.
 ValueBinding getValueBinding(String name)
Deprecated. this has been replaced by getValueExpression(java.lang.String).
 ValueExpression getValueExpression(String name)
Return any ValueExpression set for value if a ValueExpression for selectedValues is requested; otherwise, perform the default superclass processing for this method.
 void setSelectedValues(Object[] selectedValues)
Set the currently selected values, or null to indicate that there are no currently selected values.
 void setValueBinding(String name, ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).
 void setValueExpression(String name, ValueExpression binding)
Store any ValueExpression specified for selectedValues under value instead; otherwise, perform the default superclass processing for this method.
protected  void validateValue(FacesContext context, Object value)
In addition to the standard validation behavior inherited from UIInput, ensure that any specified values are equal to one of the available options.
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values

英文文档：

INVALID_MESSAGE_ID

public static final String INVALID_MESSAGE_ID

The message identifier of the FacesMessage to be created if a value not matching the available options is specified.

See Also:
Constant Field Values
Constructor Detail

public UISelectMany()

使用默认属性值创建新的 UISelectMany 实例。

英文文档：

UISelectMany

public UISelectMany()

Create a new UISelectMany instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Overrides:
getFamily in class UIInput

public Object[] getSelectedValues()

返回当前选定的值，或如果没有当前选定的值，则返回 null。这是 getValue() 的类型安全别名。

英文文档：

getSelectedValues

public Object[] getSelectedValues()

Return the currently selected values, or null if there are no currently selected values. This is a typesafe alias for getValue().

public void setSelectedValues(Object[] selectedValues)

设置当前选定的值，或为 null 以指示没有当前选定的值。这是 setValue() 的类型安全别名。

selectedValues 新的选定值（如果有）
英文文档：

setSelectedValues

public void setSelectedValues(Object[] selectedValues)

Set the currently selected values, or null to indicate that there are no currently selected values. This is a typesafe alias for setValue().

Parameters:
selectedValues - The new selected values (if any)

public ValueBinding getValueBinding(String name)

如果请求 selectedValues 的 ValueBinding，则返回任何为 value 设置的 ValueBinding；否则，执行此方法的默认超类处理。

此方法依赖于超类将 ValueExpression 提供给 ValueBinding 包装。

name | 要为其获取 ValueBinding 的属性的名称
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #getValueExpression(java.lang.String) 替代。
英文文档：

getValueBinding

public ValueBinding getValueBinding(String name)
Deprecated. this has been replaced by getValueExpression(java.lang.String).

Return any ValueBinding set for value if a ValueBinding for selectedValues is requested; otherwise, perform the default superclass processing for this method.

This method relies on the superclass to provide the ValueExpression to ValueBinding wrapping.

Overrides:
getValueBinding in class UIComponentBase
Parameters:
name - Name of the attribute or property for which to retrieve a ValueBinding
Throws:
NullPointerException - if name is null

public void setValueBinding(String name, ValueBinding binding)

存储 value 下为 selectedValues 指定的任何 ValueBinding；否则，执行此方法的默认超类处理。

此方法依赖于超类来包装 ValueExpression 中的参数 ValueBinding。

name | 要为其设置 ValueBinding 的属性的名称
binding | 要设置的 ValueBinding，或为 null 以移除任何当前设置的 ValueBinding
Throws | NullPointerException: 如果 name 为 null
deprecated | 此方法已由 #setValueExpression(java.lang.String, javax.el.ValueExpression) 替代。
英文文档：

setValueBinding

public void setValueBinding(String name,
                            ValueBinding binding)
Deprecated. This has been replaced by setValueExpression(java.lang.String, javax.el.ValueExpression).

Store any ValueBinding specified for selectedValues under value instead; otherwise, perform the default superclass processing for this method.

This method relies on the superclass to wrap the argument ValueBinding in a ValueExpression.

Overrides:
setValueBinding in class UIComponentBase
Parameters:
name - Name of the attribute or property for which to set a ValueBinding
binding - The ValueBinding to set, or null to remove any currently set ValueBinding
Throws:
NullPointerException - if name is null

public ValueExpression getValueExpression(String name)

如果请求 selectedValues 的 ValueExpression，则返回任何为 value 设置的 ValueExpression；否则，执行此方法的默认超类处理。

name | 要为其获取 ValueExpression 的属性的名称
Throws | NullPointerException: 如果 name 为 null
since | 1.2
英文文档：

getValueExpression

public ValueExpression getValueExpression(String name)

Return any ValueExpression set for value if a ValueExpression for selectedValues is requested; otherwise, perform the default superclass processing for this method.

Overrides:
getValueExpression in class UIComponent
Parameters:
name - Name of the attribute or property for which to retrieve a ValueExpression
Throws:
NullPointerException - if name is null
Since:
1.2

public void setValueExpression(String name, ValueExpression binding)

存储 value 下为 selectedValues 指定的任何 ValueExpression；否则，执行此方法的默认超类处理。

name | 要为其设置 ValueExpression 的属性的名称
binding | 要设置的 ValueExpression，或为 null 以移除任何当前设置的 ValueExpression
Throws | NullPointerException: 如果 name 为 null
since | 1.2
英文文档：

setValueExpression

public void setValueExpression(String name,
                               ValueExpression binding)

Store any ValueExpression specified for selectedValues under value instead; otherwise, perform the default superclass processing for this method.

Overrides:
setValueExpression in class UIComponent
Parameters:
name - Name of the attribute or property for which to set a ValueExpression
binding - The ValueExpression to set, or null to remove any currently set ValueExpression
Throws:
NullPointerException - if name is null
Since:
1.2

protected boolean compareValues(Object previous, Object value)

如果新值与以前的值不同，则返回 true。值比较不能对元素顺序敏感。

previous | 此组件以前的值
value | 此组件的新值
英文文档：

compareValues

protected boolean compareValues(Object previous,
                                Object value)

Return true if the new value is different from the previous value. Value comparison must not be sensitive to element order.

Overrides:
compareValues in class UIInput
Parameters:
previous - old value of this component
value - new value of this component

protected void validateValue(FacesContext context, Object value)

除继承自 UIInput 的标准验证行为外，还确保任何指定的值等于可用选项之一。在比较每个选项前，将根据 Expression 语言强制匹配规则强制匹配选项值类型与此组件值的类型。如果指定的值不等于任何选项，则将错误消息加入队列并将 valid 属性设置为 false。

context | 当前请求的 FacesContext
value | 要测试成员关系的转换值。
Throws | NullPointerException: 如果 context 为 null
英文文档：

validateValue

protected void validateValue(FacesContext context,
                             Object value)

In addition to the standard validation behavior inherited from UIInput, ensure that any specified values are equal to one of the available options. Before comparing each option, coerce the option value type to the type of this component's value following the Expression Language coercion rules. If the specified value is not equal to any of the options, enqueue an error message and set the valid property to false.

Overrides:
validateValue in class UIInput
Parameters:
context - The FacesContext for the current request
value - The converted value to test for membership.
Throws:
NullPointerException - if context is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UISelectOne (Java EE 5)

javax.faces.component
Class UISelectOne

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectOne
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
Direct Known Subclasses:
HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio
public class UISelectOne
extends UIInput

Extends: UIComponent > UIComponentBase > UIOutput > UIInput
Extended by: HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio

UISelectOne 是表示用户从离散的可用选项集合中选择 0 或 1 个项的 UIComponent。用户可以修改选定的值。（可选）通过将当前选定项存储为该组件的 value 属性，可以使用它预配置组件。

此组件通常呈现为一个选择框或一组单选按钮。

默认情况下，rendererType 属性被设置为 "javax.faces.Menu"。可以调用 setRendererType() 方法更改此值。

英文文档：

UISelectOne is a UIComponent that represents the user's choice of zero or one items from among a discrete set of available options. The user can modify the selected value. Optionally, the component can be preconfigured with a currently selected item, by storing it as the value property of the component.

This component is generally rendered as a select box or a group of radio buttons.

By default, the rendererType property is set to "javax.faces.Menu". This value can be changed by calling the setRendererType() method.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
static String | INVALID_MESSAGE_ID The message identifier of the FacesMessage to be created if a value not matching the available options is specified.
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UISelectOne()
Create a new UISelectOne instance with default property values.
Method Summary
String | getFamily() Return the identifier of the component family to which this component belongs.
protected void | validateValue(FacesContext context, Object value) In addition to the standard validation behavior inherited from UIInput, ensure that any specified value is equal to one of the available options.
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values

英文文档：

INVALID_MESSAGE_ID

public static final String INVALID_MESSAGE_ID

The message identifier of the FacesMessage to be created if a value not matching the available options is specified.

See Also:
Constant Field Values
Constructor Detail

public UISelectOne()

使用默认属性值创建新的 UISelectOne 实例。

英文文档：

UISelectOne

public UISelectOne()

Create a new UISelectOne instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Overrides:
getFamily in class UIInput

protected void validateValue(FacesContext context, Object value)

除继承自 UIInput 的标准验证行为外，还确保任何指定的值等于可用选项之一。在比较每个选项前，将根据 Expression 语言强制匹配规则强制匹配选项值类型与此组件值的类型。如果指定的值不等于任何选项，则将错误消息加入队列并将 valid 属性设置为 false。

context | 当前请求的 FacesContext
value | 要测试成员关系的转换值。
Throws | NullPointerException: 如果 context 为 null
英文文档：

validateValue

protected void validateValue(FacesContext context,
                             Object value)

In addition to the standard validation behavior inherited from UIInput, ensure that any specified value is equal to one of the available options. Before comparing each option, coerce the option value type to the type of this component's value following the Expression Language coercion rules. If the specified value is not equal to any of the options, enqueue an error message and set the valid property to false.

Overrides:
validateValue in class UIInput
Parameters:
context - The FacesContext for the current request
value - The converted value to test for membership.
Throws:
NullPointerException - if context is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIViewRoot (Java EE 5)

javax.faces.component
Class UIViewRoot

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIViewRoot
All Implemented Interfaces:
StateHolder
public class UIViewRoot
extends UIComponentBase

Extends: UIComponent > UIComponentBase

UIViewRoot 是表示 UIComponent 树的根的 UIComponent。此组件没有呈现，它仅作为组件树的根，并作为挂起每个视图 PhaseListener 的地方。

对于下面每个生命周期阶段方法：

  • #processDecodes

  • #processValidators

  • #processUpdates

  • #processApplication

  • RenderResponse（通过 #encodeBegin 和 #encodeEnd 调用）

采取以下与 PhaseListener 有关的操作。

    将状态标志初始化为 false。

    如果 #getBeforePhaseListener 返回非 null，则调用该侦听器，同时传入正确的此阶段相应的 PhaseId。

    从该侦听器返回时，调用 FacesContext#getResponseComplete 和 FacesContext#getRenderResponse。如果返回 true，则将内部状态标志设置为 true。

    如果已通过调用 #addPhaseListener 添加了一个或多个侦听器，则调用其 PhaseListener#getPhaseId 匹配当前 phaseId 的每个侦听器上的 beforePhase 方法，同时传入与上一个步骤中相同的 PhaseId。

    从每个侦听器返回时，调用 FacesContext#getResponseComplete 和 FacesContext#getRenderResponse。如果返回 true，则将内部状态标志设置为 true。

    如果未设置内部状态标志，则执行此阶段的任何处理。

    如果 #getAfterPhaseListener 返回非 null，则调用该侦听器，同时传入正确的此阶段相应的 PhaseId。

    如果已通过调用 #addPhaseListener 添加了一个或多个侦听器，则调用其 PhaseListener#getPhaseId 匹配当前 phaseId 的每个侦听器上的 afterPhase 方法，同时传入与上一个步骤中相同的 PhaseId。

英文文档：

UIViewRoot is the UIComponent that represents the root of the UIComponent tree. This component has no rendering, it just serves as the root of the component tree, and as a place to hang per-view PhaseListeners.

For each of the following lifecycle phase methods:

  • processDecodes(javax.faces.context.FacesContext)

  • processValidators(javax.faces.context.FacesContext)

  • processUpdates(javax.faces.context.FacesContext)

  • processApplication(javax.faces.context.FacesContext)

  • RenderResponse, via encodeBegin(javax.faces.context.FacesContext) and encodeEnd(javax.faces.context.FacesContext)

Take the following action regarding PhaseListeners.

    Initialize a state flag to false.

    If getBeforePhaseListener() returns non-null, invoke the listener, passing in the correct corresponding PhaseId for this phase.

    Upon return from the listener, call FacesContext.getResponseComplete() and FacesContext.getRenderResponse(). If either return true set the internal state flag to true.

    If or one or more listeners have been added by a call to addPhaseListener(javax.faces.event.PhaseListener), invoke the beforePhase method on each one whose PhaseListener.getPhaseId() matches the current phaseId, passing in the same PhaseId as in the previous step.

    Upon return from each listener, call FacesContext.getResponseComplete() and FacesContext.getRenderResponse(). If either return true set the internal state flag to true.

    Execute any processing for this phase if the internal state flag was not set.

    If getAfterPhaseListener() returns non-null, invoke the listener, passing in the correct corresponding PhaseId for this phase.

    If or one or more listeners have been added by a call to addPhaseListener(javax.faces.event.PhaseListener), invoke the afterPhase method on each one whose PhaseListener.getPhaseId() matches the current phaseId, passing in the same PhaseId as in the previous step.

Field Summary
static String | COMPONENT_FAMILY The standard component family for this component.
static String | COMPONENT_TYPE The standard component type for this component.
static String | UNIQUE_ID_PREFIX The prefix that will be used for identifiers generated by the createUniqueId() method.
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
UIViewRoot()
Create a new UIViewRoot instance with default property values.
Method Summary
void | addPhaseListener(PhaseListener newPhaseListener)
String | createUniqueId() Generate an identifier for a component.
void | encodeBegin(FacesContext context) Override the default UIComponentBase.encodeBegin(javax.faces.context.FacesContext) behavior.
void | encodeEnd(FacesContext context) Override the default UIComponentBase.encodeEnd(javax.faces.context.FacesContext) behavior.
MethodExpression | getAfterPhaseListener()
MethodExpression | getBeforePhaseListener()
String | getFamily() Return the identifier of the component family to which this component belongs.
Locale | getLocale() Return the Locale to be used in localizing the response being created for this view.
String | getRenderKitId() Return the render kit identifier of the RenderKit associated with this view.
String | getViewId() Return the view identifier for this view.
void | processApplication(FacesContext context) Broadcast any events that have been queued for the Invoke Application phase of the request processing lifecycle and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
void | processDecodes(FacesContext context) Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext) behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
void | processUpdates(FacesContext context) Override the default UIComponentBase behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
void | processValidators(FacesContext context) Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext) behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
void | queueEvent(FacesEvent event) Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent) behavior to accumulate the queued events for later broadcasting.
void | removePhaseListener(PhaseListener toRemove)
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setAfterPhaseListener(MethodExpression newAfterPhase) Allow an arbitrary method to be called for the "afterPhase" event as the UIViewRoot runs through its lifecycle.
void | setBeforePhaseListener(MethodExpression newBeforePhase) Allow an arbitrary method to be called for the "beforePhase" event as the UIViewRoot runs through its lifecycle.
void | setLocale(Locale locale) Set the Locale to be used in localizing the response being created for this view.
void | setRenderKitId(String renderKitId) Set the render kit identifier of the RenderKit associated with this view.
void | setViewId(String viewId) Set the view identifier for this view.
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

英文文档：

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values

英文文档：

UNIQUE_ID_PREFIX

public static final String UNIQUE_ID_PREFIX

The prefix that will be used for identifiers generated by the createUniqueId() method.

See Also:
Constant Field Values
Constructor Detail

public UIViewRoot()

使用默认属性值创建新的 UIViewRoot 实例。

英文文档：

UIViewRoot

public UIViewRoot()

Create a new UIViewRoot instance with default property values.

Method Detail

public String getFamily()
英文文档：

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public String getRenderKitId()

返回与此视图关联的 RenderKit 的呈现工具包标识符。除非显式设置（如在 javax.faces.application.ViewHandler#createView 中），否则返回的值将为 null。

英文文档：

getRenderKitId

public String getRenderKitId()

Return the render kit identifier of the RenderKit associated with this view. Unless explicitly set, as in ViewHandler.createView(javax.faces.context.FacesContext, java.lang.String), the returned value will be null.

public void setRenderKitId(String renderKitId)

设置与此视图关联的 RenderKit 的呈现工具包标识符。可以随时在请求处理生命周期的应用请求值 阶段的末尾（即事件被广播时）和呈现响应 阶段的开始之间调用此方法。

renderKitId 新的 RenderKit 标识符，或为 null 以取消此视图与任何特定 RenderKit 实例的关联
英文文档：

setRenderKitId

public void setRenderKitId(String renderKitId)

Set the render kit identifier of the RenderKit associated with this view. This method may be called at any time between the end of Apply Request Values phase of the request processing lifecycle (i.e. when events are being broadcast) and the beginning of the Render Response phase.

Parameters:
renderKitId - The new RenderKit identifier, or null to disassociate this view with any specific RenderKit instance

public String getViewId()

返回此视图的视图标识符。

英文文档：

getViewId

public String getViewId()

Return the view identifier for this view.

public void setViewId(String viewId)

设置此视图的视图标识符。

viewId 新的视图标识符
英文文档：

setViewId

public void setViewId(String viewId)

Set the view identifier for this view.

Parameters:
viewId - The new view identifier

public MethodExpression getBeforePhaseListener()
return 在呈现此视图前将调用的 MethodExpression。
英文文档：

getBeforePhaseListener

public MethodExpression getBeforePhaseListener()
Returns:
the MethodExpression that will be invoked before this view is rendered.

public void setBeforePhaseListener(MethodExpression newBeforePhase)

当 UIViewRoot 在其生命周期中运行时，允许为 "beforePhase" 事件调用任意方法。将为所有除 PhaseId#RESTORE_VIEW 以外的阶段调用此方法。与实际的 PhaseListener 不同，此方法不允许仅为给定的阶段接收 PhaseEvent。

此方法必须符合 PhaseListener#beforePhase 的签名。

newBeforePhase 在呈现此视图前将调用的 MethodExpression。
英文文档：

setBeforePhaseListener

public void setBeforePhaseListener(MethodExpression newBeforePhase)

Allow an arbitrary method to be called for the "beforePhase" event as the UIViewRoot runs through its lifecycle. This method will be called for all phases except PhaseId.RESTORE_VIEW. Unlike a true PhaseListener, this approach doesn't allow for only receiving PhaseEvents for a given phase.

The method must conform to the signature of PhaseListener.beforePhase(javax.faces.event.PhaseEvent).

Parameters:
newBeforePhase - the MethodExpression that will be invoked before this view is rendered.

public MethodExpression getAfterPhaseListener()
return 在呈现此视图后将调用的 MethodExpression。
英文文档：

getAfterPhaseListener

public MethodExpression getAfterPhaseListener()
Returns:
the MethodExpression that will be invoked after this view is rendered.

public void setAfterPhaseListener(MethodExpression newAfterPhase)

当 UIViewRoot 在其生命周期中运行时，允许为 "afterPhase" 事件调用任意方法。将为所有除 PhaseId#RESTORE_VIEW 以外的阶段调用此方法。与实际的 PhaseListener 不同，此方法不允许仅为给定的阶段接收 PhaseEvent。

此方法必须符合 PhaseListener#afterPhase 的签名。

newAfterPhase 在呈现此视图后将调用的 MethodExpression。
英文文档：

setAfterPhaseListener

public void setAfterPhaseListener(MethodExpression newAfterPhase)

Allow an arbitrary method to be called for the "afterPhase" event as the UIViewRoot runs through its lifecycle. This method will be called for all phases except PhaseId.RESTORE_VIEW. Unlike a true PhaseListener, this approach doesn't allow for only receiving PhaseEvents for a given phase.

The method must conform to the signature of PhaseListener.afterPhase(javax.faces.event.PhaseEvent).

Parameters:
newAfterPhase - the MethodExpression that will be invoked after this view is rendered.

public void removePhaseListener(PhaseListener toRemove)
英文文档：

removePhaseListener

public void removePhaseListener(PhaseListener toRemove)

public void addPhaseListener(PhaseListener newPhaseListener)
英文文档：

addPhaseListener

public void addPhaseListener(PhaseListener newPhaseListener)

public void queueEvent(FacesEvent event)

重写默认的 UIComponentBase#queueEvent 行为以累积排队事件供以后广播。

event | 要排队的 FacesEvent
Throws | IllegalStateException: 如果此组件不是 UIViewRoot 的后代
Throws | NullPointerException: 如果 event 为 null
英文文档：

queueEvent

public void queueEvent(FacesEvent event)

Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent) behavior to accumulate the queued events for later broadcasting.

Overrides:
queueEvent in class UIComponentBase
Parameters:
event - FacesEvent to be queued
Throws:
IllegalStateException - if this component is not a descendant of a UIViewRoot
NullPointerException - if event is null

public void processDecodes(FacesContext context)

如果此阶段的事件处理导致调用了 FacesContext#renderResponse 或 FacesContext#responseComplete，则重写默认的 UIComponentBase#processDecodes 行为，以便在默认处理完成后广播任何排队事件，并清除后面阶段的任何事件。

context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processDecodes

public void processDecodes(FacesContext context)

Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext) behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.

Overrides:
processDecodes in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void encodeBegin(FacesContext context) throws java.io.IOException

重写默认的 UIComponentBase#encodeBegin 行为。如果 #getBeforePhaseListener 返回非 null，则调用它，同时传递 PhaseId#RENDER_RESPONSE 阶段的 PhaseEvent。如果通过调用 #addPhaseListener 填充的内部列表为非空，则该列表中的任何侦听器都必须调用其 PhaseListener#beforePhase 方法，同时传递 PhaseEvent。调用任何 beforePhase 侦听器期间发生的任何错误都必须被记录和抑制。调用侦听器后，调用超类处理。

英文文档：

encodeBegin

public void encodeBegin(FacesContext context)
                 throws IOException

Override the default UIComponentBase.encodeBegin(javax.faces.context.FacesContext) behavior. If getBeforePhaseListener() returns non-null, invoke it, passing a PhaseEvent for the PhaseId.RENDER_RESPONSE phase. If the internal list populated by calls to addPhaseListener(javax.faces.event.PhaseListener) is non-empty, any listeners in that list must have their PhaseListener.beforePhase(javax.faces.event.PhaseEvent) method called, passing the PhaseEvent. Any errors that occur during invocation of any of the the beforePhase listeners must be logged and swallowed. After listeners are invoked call superclass processing.

Overrides:
encodeBegin in class UIComponentBase
Parameters:
context - FacesContext for the response we are creating
Throws:
IOException - if an input/output error occurs while rendering

public void encodeEnd(FacesContext context) throws java.io.IOException

重写默认的 UIComponentBase#encodeEnd 行为。如果 #getAfterPhaseListener 返回非 null，则调用它，同时传递 PhaseId#RENDER_RESPONSE 阶段的 PhaseEvent。调用 afterPhase 侦听器期间发生的任何错误都必须被记录和抑制。

英文文档：

encodeEnd

public void encodeEnd(FacesContext context)
               throws IOException

Override the default UIComponentBase.encodeEnd(javax.faces.context.FacesContext) behavior. If getAfterPhaseListener() returns non-null, invoke it, passing a PhaseEvent for the PhaseId.RENDER_RESPONSE phase. Any errors that occur during invocation of the afterPhase listener must be logged and swallowed.

Overrides:
encodeEnd in class UIComponentBase
Parameters:
context - FacesContext for the response we are creating
Throws:
IOException - if an input/output error occurs while rendering

public void processValidators(FacesContext context)

如果此阶段的事件处理导致调用了 FacesContext#renderResponse 或 FacesContext#responseComplete，则重写默认的 UIComponentBase#processValidators 行为，以便在默认处理完成后广播任何排队事件，并清除后面阶段的任何事件。

context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processValidators

public void processValidators(FacesContext context)

Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext) behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.

Overrides:
processValidators in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processUpdates(FacesContext context)

如果此阶段的事件处理导致调用了 FacesContext#renderResponse 或 FacesContext#responseComplete，则重写默认的 UIComponentBase 行为，以便在默认处理完成后广播任何排队事件，并清除后面阶段的任何事件。

context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processUpdates

public void processUpdates(FacesContext context)

Override the default UIComponentBase behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.

Overrides:
processUpdates in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processApplication(FacesContext context)

如果此阶段的事件处理导致调用了 FacesContext#renderResponse 或 FacesContext#responseComplete，则广播任何已为请求处理生命周期的调用应用程序 阶段排队的事件并清除后面阶段的任何事件。

context | 要处理的请求的 FacesContext
Throws | NullPointerException: 如果 context 为 null
英文文档：

processApplication

public void processApplication(FacesContext context)

Broadcast any events that have been queued for the Invoke Application phase of the request processing lifecycle and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.

Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public String createUniqueId()

生成组件的标识符。该标识符将带有前缀 UNIQUE_ID_PREFIX，且在此 UIViewRoot 内是唯一的。

英文文档：

createUniqueId

public String createUniqueId()

Generate an identifier for a component. The identifier will be prefixed with UNIQUE_ID_PREFIX, and will be unique within this UIViewRoot.

public java.util.Locale getLocale()

返回在本地化为此视图创建的响应中使用的 Locale。

算法：

如果有 locale ivar，则将其返回。如果有 "locale" 的值表达式，则获取其值。如果该值为 null，则返回调用 javax.faces.application.ViewHandler#calculateLocale 的结果。如果值是 java.util.Locale 的实例，则将其返回。如果该值是 String，则将其转换为 java.util.Locale 并将其返回。如果没有 "locale" 的值表达式，则返回调用 javax.faces.application.ViewHandler#calculateLocale 的结果。

return 通过执行上述算法获取的当前 Locale。
英文文档：

getLocale

public Locale getLocale()

Return the Locale to be used in localizing the response being created for this view.

Algorithm:

If we have a locale ivar, return it. If we have a value expression for "locale", get its value. If the value is null, return the result of calling ViewHandler.calculateLocale(javax.faces.context.FacesContext). If the value is an instance of java.util.Locale return it. If the value is a String, convert it to a java.util.Locale and return it. If there is no value expression for "locale", return the result of calling ViewHandler.calculateLocale(javax.faces.context.FacesContext).

Returns:
The current Locale obtained by executing the above algorithm.

public void setLocale(java.util.Locale locale)

设置在本地化为此视图创建的响应中使用的 Locale。

locale 新的本地化 Locale
英文文档：

setLocale

public void setLocale(Locale locale)

Set the Locale to be used in localizing the response being created for this view.

Parameters:
locale - The new localization Locale

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.faces.component.html (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.component.html

Specialized user interface component classes for HTML.

See:
Description

Class Summary
HtmlColumn | Represents a column that will be rendered in an HTML table element.
HtmlCommandButton | Represents an HTML input element for a button of type submit or reset.
HtmlCommandLink | Represents an HTML a element for a hyperlink that acts like a submit button.
HtmlDataTable | Represents a set of repeating data (segregated into columns by child UIColumn components) that will be rendered in an HTML table element.
HtmlForm | Represents an HTML form element.
HtmlGraphicImage | Represents an HTML img element, used to retrieve and render a graphical image.
HtmlInputHidden | Represents an HTML input element of type hidden.
HtmlInputSecret | Represents an HTML input element of type password.
HtmlInputText | Represents an HTML input element of type text.
HtmlInputTextarea | Represents an HTML textarea element.
HtmlMessage | By default, the rendererType property must be set to "javax.faces.Message".
HtmlMessages | By default, the rendererType property must be set to "javax.faces.Messages".
HtmlOutputFormat | Represents a component that looks up a localized message in a resource bundle, optionally uses it as a MessageFormat pattern string and substitutes in parameter values from nested UIParameter components, and renders the result.
HtmlOutputLabel | Represents an HTML label element, used to define an accessible label for a corresponding input element.
HtmlOutputLink | Represents an HTML a (hyperlink) element that may be used to link to an arbitrary URL defined by the value property.
HtmlOutputText | Renders the component value as text, optionally wrapping in a span element if I18N attributes, CSS styles or style classes are specified.
HtmlPanelGrid | Renders child components in a table, starting a new row after the specified number of columns.
HtmlPanelGroup | Causes all child components of this component to be rendered.
HtmlSelectBooleanCheckbox | Represents an HTML input element of type checkbox.
HtmlSelectManyCheckbox | Represents a multiple-selection component that is rendered as a set of HTML input elements of type checkbox.
HtmlSelectManyListbox | Represents a multiple-selection component that is rendered as an HTML select element, showing either all available options or the specified number of options.
HtmlSelectManyMenu | Represents a multiple-selection component that is rendered as an HTML select element, showing a single available option at a time.
HtmlSelectOneListbox | Represents a single-selection component that is rendered as an HTML select element, showing either all available options or the specified number of options.
HtmlSelectOneMenu | Represents a single-selection component that is rendered as an HTML select element, showing a single available option at a time.
HtmlSelectOneRadio | Represents a single-selection component that is rendered as a set of HTML input elements of type radio.

Package javax.faces.component.html Description

Specialized user interface component classes for HTML.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.component.html Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.component.html

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.component.UIComponent (implements javax.faces.component.StateHolder)
      • javax.faces.component.UIComponentBase
        • javax.faces.component.UIColumn
          • javax.faces.component.html.HtmlColumn
        • javax.faces.component.UICommand (implements javax.faces.component.ActionSource2)
          • javax.faces.component.html.HtmlCommandButton
          • javax.faces.component.html.HtmlCommandLink
        • javax.faces.component.UIData (implements javax.faces.component.NamingContainer)
          • javax.faces.component.html.HtmlDataTable
        • javax.faces.component.UIForm (implements javax.faces.component.NamingContainer)
          • javax.faces.component.html.HtmlForm
        • javax.faces.component.UIGraphic
          • javax.faces.component.html.HtmlGraphicImage
        • javax.faces.component.UIMessage
          • javax.faces.component.html.HtmlMessage
        • javax.faces.component.UIMessages
          • javax.faces.component.html.HtmlMessages
        • javax.faces.component.UIOutput (implements javax.faces.component.ValueHolder)
          • javax.faces.component.html.HtmlOutputFormat
          • javax.faces.component.html.HtmlOutputLabel
          • javax.faces.component.html.HtmlOutputLink
          • javax.faces.component.html.HtmlOutputText
          • javax.faces.component.UIInput (implements javax.faces.component.EditableValueHolder)
            • javax.faces.component.html.HtmlInputHidden
            • javax.faces.component.html.HtmlInputSecret
            • javax.faces.component.html.HtmlInputText
            • javax.faces.component.html.HtmlInputTextarea
            • javax.faces.component.UISelectBoolean
              • javax.faces.component.html.HtmlSelectBooleanCheckbox
            • javax.faces.component.UISelectMany
              • javax.faces.component.html.HtmlSelectManyCheckbox
              • javax.faces.component.html.HtmlSelectManyListbox
              • javax.faces.component.html.HtmlSelectManyMenu
            • javax.faces.component.UISelectOne
              • javax.faces.component.html.HtmlSelectOneListbox
              • javax.faces.component.html.HtmlSelectOneMenu
              • javax.faces.component.html.HtmlSelectOneRadio
        • javax.faces.component.UIPanel
          • javax.faces.component.html.HtmlPanelGrid
          • javax.faces.component.html.HtmlPanelGroup
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


HtmlColumn (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.component.html
Class HtmlColumn

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIColumn
                extended by  javax.faces.component.html.HtmlColumn
All Implemented Interfaces:
StateHolder
public class HtmlColumn
extends UIColumn

Extends: UIComponent > UIComponentBase > UIColumn

表示将在 HTML table 元素中呈现的列。

英文文档：

Represents a column that will be rendered in an HTML table element.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIColumn
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlColumn()
Method Summary
String | getFooterClass() Return the value of the footerClass property.
String | getHeaderClass() Return the value of the headerClass property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setFooterClass(String footerClass) Set the value of the footerClass property.
void | setHeaderClass(String headerClass) Set the value of the headerClass property.
Methods inherited from class javax.faces.component.UIColumn
getFamily, getFooter, getHeader, setFooter, setHeader
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlColumn()
英文文档：

HtmlColumn

public HtmlColumn()
Method Detail

public String getFooterClass()

返回 footerClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此列生成的任何脚注。

英文文档：

getFooterClass

public String getFooterClass()

Return the value of the footerClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any footer generated for this column.

public void setFooterClass(String footerClass)

设置 footerClass 属性的值。

英文文档：

setFooterClass

public void setFooterClass(String footerClass)

Set the value of the footerClass property.

public String getHeaderClass()

返回 headerClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此列生成的任何头。

英文文档：

getHeaderClass

public String getHeaderClass()

Return the value of the headerClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any header generated for this column.

public void setHeaderClass(String headerClass)

设置 headerClass 属性的值。

英文文档：

setHeaderClass

public void setHeaderClass(String headerClass)

Set the value of the headerClass property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HtmlCommandButton (Java EE 5)

javax.faces.component.html
Class HtmlCommandButton

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UICommand
                extended by  javax.faces.component.html.HtmlCommandButton
All Implemented Interfaces:
ActionSource, ActionSource2, StateHolder
public class HtmlCommandButton
extends UICommand

Extends: UIComponent > UIComponentBase > UICommand

表示类型为 submit 或 reset 的按钮的 HTML input 元素。标签文本由该组件值指定。

默认情况下，rendererType 属性必须设置为 "javax.faces.Button"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML input element for a button of type submit or reset. The label text is specified by the component value.

By default, the rendererType property must be set to "javax.faces.Button". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UICommand
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlCommandButton()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getAlt() Return the value of the alt property.
String | getDir() Return the value of the dir property.
String | getImage() Return the value of the image property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
String | getType() Return the value of the type property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setAlt(String alt) Set the value of the alt property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setImage(String image) Set the value of the image property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
void | setType(String type) Set the value of the type property.
Methods inherited from class javax.faces.component.UICommand
addActionListener, broadcast, getAction, getActionExpression, getActionListener, getActionListeners, getFamily, getValue, isImmediate, queueEvent, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlCommandButton()
英文文档：

HtmlCommandButton

public HtmlCommandButton()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getAlt()

返回 alt 属性的值。

内容：此组件所呈现元素的可替换文本描述。

英文文档：

getAlt

public String getAlt()

Return the value of the alt property.

Contents: Alternate textual description of the element rendered by this component.

public void setAlt(String alt)

设置 alt 属性的值。

英文文档：

setAlt

public void setAlt(String alt)

Set the value of the alt property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getImage()

返回 image 属性的值。

内容：要为此按钮显示的图像的绝对 URL 或相对 URL。如果指定，则此 "input" 元素将是 "image" 类型。否则，它将是 "type" 属性指定的类型并带有 "value" 属性指定的标签。

英文文档：

getImage

public String getImage()

Return the value of the image property.

Contents: Absolute or relative URL of the image to be displayed for this button. If specified, this "input" element will be of type "image". Otherwise, it will be of the type specified by the "type" property with a label specified by the "value" property.

public void setImage(String image)

设置 image 属性的值。

英文文档：

setImage

public void setImage(String image)

Set the value of the image property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public String getType()

返回 type 属性的值。

内容：要创建的按钮的类型。有效值为 "submit" 和 "reset"。如果未指定，或不是有效值，则默认值为 "submit"。

英文文档：

getType

public String getType()

Return the value of the type property.

Contents: Type of button to create. Valid values are "submit" and "reset". If not specified, or not a valid value, the default value is "submit".

public void setType(String type)

设置 type 属性的值。

英文文档：

setType

public void setType(String type)

Set the value of the type property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UICommand

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UICommand
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlCommandLink (Java EE 5)

javax.faces.component.html
Class HtmlCommandLink

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UICommand
                extended by  javax.faces.component.html.HtmlCommandLink
All Implemented Interfaces:
ActionSource, ActionSource2, StateHolder
public class HtmlCommandLink
extends UICommand

Extends: UIComponent > UIComponentBase > UICommand

表示作用与提交按钮类似的超链接的 HTML a 元素。此组件必须放在表单内部，并且要求在客户端启用 JavaScript。

默认情况下，rendererType 属性必须设置为 "javax.faces.Link"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML a element for a hyperlink that acts like a submit button. This component must be placed inside a form, and requires JavaScript to be enabled in the client.

By default, the rendererType property must be set to "javax.faces.Link". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UICommand
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlCommandLink()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getCharset() Return the value of the charset property.
String | getCoords() Return the value of the coords property.
String | getDir() Return the value of the dir property.
String | getHreflang() Return the value of the hreflang property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getRel() Return the value of the rel property.
String | getRev() Return the value of the rev property.
String | getShape() Return the value of the shape property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTarget() Return the value of the target property.
String | getTitle() Return the value of the title property.
String | getType() Return the value of the type property.
boolean | isDisabled() Return the value of the disabled property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setCharset(String charset) Set the value of the charset property.
void | setCoords(String coords) Set the value of the coords property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setHreflang(String hreflang) Set the value of the hreflang property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setRel(String rel) Set the value of the rel property.
void | setRev(String rev) Set the value of the rev property.
void | setShape(String shape) Set the value of the shape property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTarget(String target) Set the value of the target property.
void | setTitle(String title) Set the value of the title property.
void | setType(String type) Set the value of the type property.
Methods inherited from class javax.faces.component.UICommand
addActionListener, broadcast, getAction, getActionExpression, getActionListener, getActionListeners, getFamily, getValue, isImmediate, queueEvent, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlCommandLink()
英文文档：

HtmlCommandLink

public HtmlCommandLink()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getCharset()

返回 charset 属性的值。

内容：此超链接指定的资源的字符编码。

英文文档：

getCharset

public String getCharset()

Return the value of the charset property.

Contents: The character encoding of the resource designated by this hyperlink.

public void setCharset(String charset)

设置 charset 属性的值。

英文文档：

setCharset

public void setCharset(String charset)

Set the value of the charset property.

public String getCoords()

返回 coords 属性的值。

内容：热点在屏幕上的位置和形状（用于客户端图像映射）。

英文文档：

getCoords

public String getCoords()

Return the value of the coords property.

Contents: The position and shape of the hot spot on the screen (for use in client-side image maps).

public void setCoords(String coords)

设置 coords 属性的值。

英文文档：

setCoords

public void setCoords(String coords)

Set the value of the coords property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit.

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getHreflang()

返回 hreflang 属性的值。

内容：此超链接指定的资源的语言代码。

英文文档：

getHreflang

public String getHreflang()

Return the value of the hreflang property.

Contents: The language code of the resource designated by this hyperlink.

public void setHreflang(String hreflang)

设置 hreflang 属性的值。

英文文档：

setHreflang

public void setHreflang(String hreflang)

Set the value of the hreflang property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getRel()

返回 rel 属性的值。

内容：从当前文档到此超链接指定的锚点的关系。此属性的值是以空格分隔的链接类型列表。

英文文档：

getRel

public String getRel()

Return the value of the rel property.

Contents: The relationship from the current document to the anchor specified by this hyperlink. The value of this attribute is a space-separated list of link types.

public void setRel(String rel)

设置 rel 属性的值。

英文文档：

setRel

public void setRel(String rel)

Set the value of the rel property.

public String getRev()

返回 rev 属性的值。

内容：从此超链接指定的锚点到当前文档的反向链接。此属性的值是以空格分隔的链接类型列表。

英文文档：

getRev

public String getRev()

Return the value of the rev property.

Contents: A reverse link from the anchor specified by this hyperlink to the current document. The value of this attribute is a space-separated list of link types.

public void setRev(String rev)

设置 rev 属性的值。

英文文档：

setRev

public void setRev(String rev)

Set the value of the rev property.

public String getShape()

返回 shape 属性的值。

内容：热点在屏幕上的形状（用于客户端图像映射）。有效值有：default（整个区域）；rect（矩形区域）；circle（圆形区域）；poly（多边形区域）。

英文文档：

getShape

public String getShape()

Return the value of the shape property.

Contents: The shape of the hot spot on the screen (for use in client-side image maps). Valid values are: default (entire region); rect (rectangular region); circle (circular region); and poly (polygonal region).

public void setShape(String shape)

设置 shape 属性的值。

英文文档：

setShape

public void setShape(String shape)

Set the value of the shape property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTarget()

返回 target 属性的值。

内容：窗体名称，该窗体中将显示此超链接获取到的资源。

英文文档：

getTarget

public String getTarget()

Return the value of the target property.

Contents: Name of a frame where the resource retrieved via this hyperlink is to be displayed.

public void setTarget(String target)

设置 target 属性的值。

英文文档：

setTarget

public void setTarget(String target)

Set the value of the target property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public String getType()

返回 type 属性的值

内容：此超链接指定的资源的内容类型。

英文文档：

getType

public String getType()

Return the value of the type property.

Contents: The content type of the resource designated by this hyperlink.

public void setType(String type)

设置 type 属性的值。

英文文档：

setType

public void setType(String type)

Set the value of the type property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UICommand

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UICommand
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlDataTable (Java EE 5)

javax.faces.component.html
Class HtmlDataTable

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIData
                extended by  javax.faces.component.html.HtmlDataTable
All Implemented Interfaces:
NamingContainer, StateHolder
public class HtmlDataTable
extends UIData

Extends: UIComponent > UIComponentBase > UIData

表示将在 HTML table 元素中呈现的重复数据的集合（由 UIColumn 子组件划分为列）。

默认情况下，rendererType 属性必须设置为 "javax.faces.Table"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents a set of repeating data (segregated into columns by child UIColumn components) that will be rendered in an HTML table element.

By default, the rendererType property must be set to "javax.faces.Table". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIData
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
Constructor Summary
HtmlDataTable()
Method Summary
String | getBgcolor() Return the value of the bgcolor property.
int | getBorder() Return the value of the border property.
String | getCaptionClass() Return the value of the captionClass property.
String | getCaptionStyle() Return the value of the captionStyle property.
String | getCellpadding() Return the value of the cellpadding property.
String | getCellspacing() Return the value of the cellspacing property.
String | getColumnClasses() Return the value of the columnClasses property.
String | getDir() Return the value of the dir property.
String | getFooterClass() Return the value of the footerClass property.
String | getFrame() Return the value of the frame property.
String | getHeaderClass() Return the value of the headerClass property.
String | getLang() Return the value of the lang property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getRowClasses() Return the value of the rowClasses property.
String | getRules() Return the value of the rules property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getSummary() Return the value of the summary property.
String | getTitle() Return the value of the title property.
String | getWidth() Return the value of the width property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setBgcolor(String bgcolor) Set the value of the bgcolor property.
void | setBorder(int border) Set the value of the border property.
void | setCaptionClass(String captionClass) Set the value of the captionClass property.
void | setCaptionStyle(String captionStyle) Set the value of the captionStyle property.
void | setCellpadding(String cellpadding) Set the value of the cellpadding property.
void | setCellspacing(String cellspacing) Set the value of the cellspacing property.
void | setColumnClasses(String columnClasses) Set the value of the columnClasses property.
void | setDir(String dir) Set the value of the dir property.
void | setFooterClass(String footerClass) Set the value of the footerClass property.
void | setFrame(String frame) Set the value of the frame property.
void | setHeaderClass(String headerClass) Set the value of the headerClass property.
void | setLang(String lang) Set the value of the lang property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setRowClasses(String rowClasses) Set the value of the rowClasses property.
void | setRules(String rules) Set the value of the rules property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setSummary(String summary) Set the value of the summary property.
void | setTitle(String title) Set the value of the title property.
void | setWidth(String width) Set the value of the width property.
Methods inherited from class javax.faces.component.UIData
broadcast, encodeBegin, getClientId, getDataModel, getFamily, getFirst, getFooter, getHeader, getRowCount, getRowData, getRowIndex, getRows, getValue, getVar, invokeOnComponent, isRowAvailable, processDecodes, processUpdates, processValidators, queueEvent, setDataModel, setFirst, setFooter, setHeader, setRowIndex, setRows, setValue, setValueBinding, setValueExpression, setVar
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlDataTable()
英文文档：

HtmlDataTable

public HtmlDataTable()
Method Detail

public String getBgcolor()

返回 bgcolor 属性的值。

内容：此表格背景颜色的名称或代码。

英文文档：

getBgcolor

public String getBgcolor()

Return the value of the bgcolor property.

Contents: Name or code of the background color for this table.

public void setBgcolor(String bgcolor)

设置 bgcolor 属性的值。

英文文档：

setBgcolor

public void setBgcolor(String bgcolor)

Set the value of the bgcolor property.

public int getBorder()

返回 border 属性的值。

内容：此表格周围将绘制的边框的宽度（以像素为单位）。

英文文档：

getBorder

public int getBorder()

Return the value of the border property.

Contents: Width (in pixels) of the border to be drawn around this table.

public void setBorder(int border)

设置 border 属性的值。

英文文档：

setBorder

public void setBorder(int border)

Set the value of the border property.

public String getCaptionClass()

返回 captionClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此表格生成的任何标题。

英文文档：

getCaptionClass

public String getCaptionClass()

Return the value of the captionClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any caption generated for this table.

public void setCaptionClass(String captionClass)

设置 captionClass 属性的值。

英文文档：

setCaptionClass

public void setCaptionClass(String captionClass)

Set the value of the captionClass property.

public String getCaptionStyle()

返回 captionStyle 属性的值。

内容：呈现此标题时应用的 CSS 样式。

英文文档：

getCaptionStyle

public String getCaptionStyle()

Return the value of the captionStyle property.

Contents: CSS style(s) to be applied when this caption is rendered.

public void setCaptionStyle(String captionStyle)

设置 captionStyle 属性的值。

英文文档：

setCaptionStyle

public void setCaptionStyle(String captionStyle)

Set the value of the captionStyle property.

public String getCellpadding()

返回 cellpadding 属性的值。

内容：有关用户代理应该在每个单元格的边框及其内容之间留下多少空间的定义。

英文文档：

getCellpadding

public String getCellpadding()

Return the value of the cellpadding property.

Contents: Definition of how much space the user agent should leave between the border of each cell and its contents.

public void setCellpadding(String cellpadding)

设置 cellpadding 属性的值。

英文文档：

setCellpadding

public void setCellpadding(String cellpadding)

Set the value of the cellpadding property.

public String getCellspacing()

返回 cellspacing 属性的值。

内容：有关用户代理应该在表格左边缘和最左边的列之间、表格顶端和最上方的行的上边缘之间，以及依此类推的表格右边和底部，留下多少空间的定义。它还指定单元格之间留下的空间大小。

英文文档：

getCellspacing

public String getCellspacing()

Return the value of the cellspacing property.

Contents: Definition of how much space the user agent should leave between the left side of the table and the leftmost column, the top of the table and the top of the top side of the topmost row, and so on for the right and bottom of the table. It also specifies the amount of space to leave between cells.

public void setCellspacing(String cellspacing)

设置 cellspacing 属性的值。

英文文档：

setCellspacing

public void setCellspacing(String cellspacing)

Set the value of the cellspacing property.

public String getColumnClasses()

返回 columnClasses 属性的值。

内容：以逗号分隔的 CSS 样式类列表，将应用于此表格的列。也可以为任何单个列指定以空格分隔的类列表。如果此列表中的元素数少于 "columns" 属性中指定的列数，则对于大于列表中元素数的每个列，将不会输出任何 "class" 属性。如果列表中的元素数大于 "columns" 属性中指定的列数，则将忽略列表中位于 "columns" 属性值之后的元素。

英文文档：

getColumnClasses

public String getColumnClasses()

Return the value of the columnClasses property.

Contents: Comma-delimited list of CSS style classes that will be applied to the columns of this table. A space separated list of classes may also be specified for any individual column. If the number of elements in this list is less than the number of columns specified in the "columns" attribute, no "class" attribute is output for each column greater than the number of elements in the list. If the number of elements in the list is greater than the number of columns specified in the "columns" attribute, the elements at the posisiton in the list after the value of the "columns" attribute are ignored.

public void setColumnClasses(String columnClasses)

设置 columnClasses 属性的值。

英文文档：

setColumnClasses

public void setColumnClasses(String columnClasses)

Set the value of the columnClasses property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public String getFooterClass()

返回 footerClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此表格生成的任何脚注。

英文文档：

getFooterClass

public String getFooterClass()

Return the value of the footerClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any footer generated for this table.

public void setFooterClass(String footerClass)

设置 footerClass 属性的值。

英文文档：

setFooterClass

public void setFooterClass(String footerClass)

Set the value of the footerClass property.

public String getFrame()

返回 frame 属性的值。

内容：指定围绕此表格的窗体的哪些边可见的代码。有效值有：none（任何边均不可见，默认值）；above（仅顶部的边可见）；below（仅底部的边可见）；hsides（仅顶部和底部的边可见）；vsides（仅右侧和左侧的边可见）；lhs（仅左侧的边可见）；rhs（仅右侧的边可见）；box（四边均可见）；border（四边均可见）。

英文文档：

getFrame

public String getFrame()

Return the value of the frame property.

Contents: Code specifying which sides of the frame surrounding this table will be visible. Valid values are: none (no sides, default value); above (top side only); below (bottom side only); hsides (top and bottom sides only); vsides (right and left sides only); lhs (left hand side only); rhs (right hand side only); box (all four sides); and border (all four sides).

public void setFrame(String frame)

设置 frame 属性的值。

英文文档：

setFrame

public void setFrame(String frame)

Set the value of the frame property.

public String getHeaderClass()

返回 headerClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此表格生成的任何头。

英文文档：

getHeaderClass

public String getHeaderClass()

Return the value of the headerClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any header generated for this table.

public void setHeaderClass(String headerClass)

设置 headerClass 属性的值。

英文文档：

setHeaderClass

public void setHeaderClass(String headerClass)

Set the value of the headerClass property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getRowClasses()

返回 rowClasses 属性的值。

内容：以逗号分隔的 CSS 样式类列表，将应用于此表格的行。也可以为任何单个行指定以空格分隔的类列表。这些样式将依次应用于表格的每一行。例如，如果列表有两个元素，则列表中的第一个样式类将应用于第一行，第二个应用于第二行，第一个应用于第三行，第二个应用于第四行，依此类推。换句话说，我们将一直在列表中迭代直到到达末尾，然后再从头开始。

英文文档：

getRowClasses

public String getRowClasses()

Return the value of the rowClasses property.

Contents: Comma-delimited list of CSS style classes that will be applied to the rows of this table. A space separated list of classes may also be specified for any individual row. Thes styles are applied, in turn, to each row in the table. For example, if the list has two elements, the first style class in the list is applied to the first row, the second to the second row, the first to the third row, the second to the fourth row, etc. In other words, we keep iterating through the list until we reach the end, and then we start at the beginning again.

public void setRowClasses(String rowClasses)

设置 rowClasses 属性的值。

英文文档：

setRowClasses

public void setRowClasses(String rowClasses)

Set the value of the rowClasses property.

public String getRules()

返回 rules 属性的值。

内容：指定此表格内的单元格之间将出现哪些标尺的代码。有效值有：none（没有标尺，默认值）；groups（行组之间）；rows（仅行之间）；cols（仅列之间）；all（所有行和列之间）。

英文文档：

getRules

public String getRules()

Return the value of the rules property.

Contents: Code specifying which rules will appear between cells within this table. Valid values are: none (no rules, default value); groups (between row groups); rows (between rows only); cols (between columns only); and all (between all rows and columns).

public void setRules(String rules)

设置 rules 属性的值。

英文文档：

setRules

public void setRules(String rules)

Set the value of the rules property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getSummary()

返回 summary 属性的值。

内容：此表格作用和结构的摘要，用于用户代理呈现非可视媒体，比如语音和 Braille。

英文文档：

getSummary

public String getSummary()

Return the value of the summary property.

Contents: Summary of this table's purpose and structure, for user agents rendering to non-visual media such as speech and Braille.

public void setSummary(String summary)

设置 summary 属性的值。

英文文档：

setSummary

public void setSummary(String summary)

Set the value of the summary property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public String getWidth()

返回 width 属性的值。

内容：整个表格的宽度，用于可视用户代理。

英文文档：

getWidth

public String getWidth()

Return the value of the width property.

Contents: Width of the entire table, for visual user agents.

public void setWidth(String width)

设置 width 属性的值。

英文文档：

setWidth

public void setWidth(String width)

Set the value of the width property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIData

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIData
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlForm (Java EE 5)

javax.faces.component.html
Class HtmlForm

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIForm
                extended by  javax.faces.component.html.HtmlForm
All Implemented Interfaces:
NamingContainer, StateHolder
public class HtmlForm
extends UIForm

Extends: UIComponent > UIComponentBase > UIForm

表示 HTML form 元素。将提交 input 子组件，除非已禁用它们。

默认情况下，rendererType 属性必须设置为 "javax.faces.Form"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML form element. Child input components will be submitted unless they have been disabled.

By default, the rendererType property must be set to "javax.faces.Form". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIForm
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
Constructor Summary
HtmlForm()
Method Summary
String | getAccept() Return the value of the accept property.
String | getAcceptcharset() Return the value of the acceptcharset property.
String | getDir() Return the value of the dir property.
String | getEnctype() Return the value of the enctype property.
String | getLang() Return the value of the lang property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnreset() Return the value of the onreset property.
String | getOnsubmit() Return the value of the onsubmit property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTarget() Return the value of the target property.
String | getTitle() Return the value of the title property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccept(String accept) Set the value of the accept property.
void | setAcceptcharset(String acceptcharset) Set the value of the acceptcharset property.
void | setDir(String dir) Set the value of the dir property.
void | setEnctype(String enctype) Set the value of the enctype property.
void | setLang(String lang) Set the value of the lang property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnreset(String onreset) Set the value of the onreset property.
void | setOnsubmit(String onsubmit) Set the value of the onsubmit property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTarget(String target) Set the value of the target property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UIForm
getContainerClientId, getFamily, isPrependId, isSubmitted, processDecodes, processUpdates, processValidators, setPrependId, setSubmitted
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlForm()
英文文档：

HtmlForm

public HtmlForm()
Method Detail

public String getAccept()

返回 accept 属性的值。

内容：处理此表单的服务器将正确处理的内容类型列表。

英文文档：

getAccept

public String getAccept()

Return the value of the accept property.

Contents: List of content types that a server processing this form will handle correctly

public void setAccept(String accept)

设置 accept 属性的值。

英文文档：

setAccept

public void setAccept(String accept)

Set the value of the accept property.

public String getAcceptcharset()

返回 acceptcharset 属性的值。

内容：处理此表单的服务器接受的输入数据的字符编码列表。

英文文档：

getAcceptcharset

public String getAcceptcharset()

Return the value of the acceptcharset property.

Contents: List of character encodings for input data that are accepted by the server processing this form.

public void setAcceptcharset(String acceptcharset)

设置 acceptcharset 属性的值。

英文文档：

setAcceptcharset

public void setAcceptcharset(String acceptcharset)

Set the value of the acceptcharset property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public String getEnctype()

返回 enctype 属性的值。

内容：用于将表单提交给服务器的内容类型。如果未指定，则默认值为 "application/x-www-form-urlencoded"。

英文文档：

getEnctype

public String getEnctype()

Return the value of the enctype property.

Contents: Content type used to submit the form to the server. If not specified, the default value is "application/x-www-form-urlencoded".

public void setEnctype(String enctype)

设置 enctype 属性的值。

英文文档：

setEnctype

public void setEnctype(String enctype)

Set the value of the enctype property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnreset()

返回 onreset 属性的值。

内容：重置此表单时执行的 Javascript 代码。

英文文档：

getOnreset

public String getOnreset()

Return the value of the onreset property.

Contents: Javascript code executed when this form is reset.

public void setOnreset(String onreset)

设置 onreset 属性的值。

英文文档：

setOnreset

public void setOnreset(String onreset)

Set the value of the onreset property.

public String getOnsubmit()

返回 onsubmit 属性的值。

内容：提交此表单时执行的 Javascript 代码。

英文文档：

getOnsubmit

public String getOnsubmit()

Return the value of the onsubmit property.

Contents: Javascript code executed when this form is submitted.

public void setOnsubmit(String onsubmit)

设置 onsubmit 属性的值。

英文文档：

setOnsubmit

public void setOnsubmit(String onsubmit)

Set the value of the onsubmit property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTarget()

返回 target 属性的值。

内容：窗体名称，该窗体中将显示此表单提交后获取到的响应。

英文文档：

getTarget

public String getTarget()

Return the value of the target property.

Contents: Name of a frame where the response retrieved after this form submit is to be displayed.

public void setTarget(String target)

设置 target 属性的值。

英文文档：

setTarget

public void setTarget(String target)

Set the value of the target property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlGraphicImage (Java EE 5)

javax.faces.component.html
Class HtmlGraphicImage

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIGraphic
                extended by  javax.faces.component.html.HtmlGraphicImage
All Implemented Interfaces:
StateHolder
public class HtmlGraphicImage
extends UIGraphic

Extends: UIComponent > UIComponentBase > UIGraphic

表示 HTML img 元素，用于获取和呈现图形图像。

默认情况下，rendererType 属性必须设置为 "javax.faces.Image"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML img element, used to retrieve and render a graphical image.

By default, the rendererType property must be set to "javax.faces.Image". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIGraphic
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlGraphicImage()
Method Summary
String | getAlt() Return the value of the alt property.
String | getDir() Return the value of the dir property.
String | getHeight() Return the value of the height property.
String | getLang() Return the value of the lang property.
String | getLongdesc() Return the value of the longdesc property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTitle() Return the value of the title property.
String | getUsemap() Return the value of the usemap property.
String | getWidth() Return the value of the width property.
boolean | isIsmap() Return the value of the ismap property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAlt(String alt) Set the value of the alt property.
void | setDir(String dir) Set the value of the dir property.
void | setHeight(String height) Set the value of the height property.
void | setIsmap(boolean ismap) Set the value of the ismap property.
void | setLang(String lang) Set the value of the lang property.
void | setLongdesc(String longdesc) Set the value of the longdesc property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTitle(String title) Set the value of the title property.
void | setUsemap(String usemap) Set the value of the usemap property.
void | setWidth(String width) Set the value of the width property.
Methods inherited from class javax.faces.component.UIGraphic
getFamily, getUrl, getValue, getValueBinding, getValueExpression, setUrl, setValue, setValueBinding, setValueExpression
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlGraphicImage()
英文文档：

HtmlGraphicImage

public HtmlGraphicImage()
Method Detail

public String getAlt()

返回 alt 属性的值。

内容：此组件所呈现元素的可替换文本描述。

英文文档：

getAlt

public String getAlt()

Return the value of the alt property.

Contents: Alternate textual description of the element rendered by this component.

public void setAlt(String alt)

设置 alt 属性的值。

英文文档：

setAlt

public void setAlt(String alt)

Set the value of the alt property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public String getHeight()

返回 height 属性的值。

内容：重写此图像的高度。

英文文档：

getHeight

public String getHeight()

Return the value of the height property.

Contents: Override for the height of this image.

public void setHeight(String height)

设置 height 属性的值。

英文文档：

setHeight

public void setHeight(String height)

Set the value of the height property.

public boolean isIsmap()

返回 ismap 属性的值。

内容：指示此图像将用作服务器端图像映射的标志。这样的图像必须包括在超链接 ("a") 内。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 ismap="ismap" 的情况相同。

英文文档：

isIsmap

public boolean isIsmap()

Return the value of the ismap property.

Contents: Flag indicating that this image is to be used as a server side image map. Such an image must be enclosed within a hyperlink ("a"). A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as ismap="ismap".

public void setIsmap(boolean ismap)

设置 ismap 属性的值。

英文文档：

setIsmap

public void setIsmap(boolean ismap)

Set the value of the ismap property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getLongdesc()

返回 longdesc 属性的值。

内容：指向此元素表示的图像的详细描述的 URI。

英文文档：

getLongdesc

public String getLongdesc()

Return the value of the longdesc property.

Contents: URI to a long description of the image represented by this element.

public void setLongdesc(String longdesc)

设置 longdesc 属性的值。

英文文档：

setLongdesc

public void setLongdesc(String longdesc)

Set the value of the longdesc property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public String getUsemap()

返回 usemap 属性的值。

内容：此元素为其提供图像的客户端图像映射（HTML "map" 元素）的名称。

英文文档：

getUsemap

public String getUsemap()

Return the value of the usemap property.

Contents: The name of a client side image map (an HTML "map" element) for which this element provides the image.

public void setUsemap(String usemap)

设置 usemap 属性的值。

英文文档：

setUsemap

public void setUsemap(String usemap)

Set the value of the usemap property.

public String getWidth()

返回 width 属性的值。

内容：重写此图像的宽度。

英文文档：

getWidth

public String getWidth()

Return the value of the width property.

Contents: Override for the width of this image.

public void setWidth(String width)

设置 width 属性的值。

英文文档：

setWidth

public void setWidth(String width)

Set the value of the width property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIGraphic

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIGraphic
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlInputHidden (Java EE 5)

javax.faces.component.html
Class HtmlInputHidden

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.html.HtmlInputHidden
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlInputHidden
extends UIInput

Extends: UIComponent > UIComponentBase > UIOutput > UIInput

表示类型为 hidden 的 HTML input 元素。

默认情况下，rendererType 属性必须设置为 "javax.faces.Hidden"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML input element of type hidden.

By default, the rendererType property must be set to "javax.faces.Hidden". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlInputHidden()
Method Summary
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getFamily, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlInputHidden()
英文文档：

HtmlInputHidden

public HtmlInputHidden()
Method Detail

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlInputSecret (Java EE 5)

javax.faces.component.html
Class HtmlInputSecret

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.html.HtmlInputSecret
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlInputSecret
extends UIInput

Extends: UIComponent > UIComponentBase > UIOutput > UIInput

表示类型为 password 的 HTML input 元素。重新显示时，以前输入的任何值将不会 被呈现（出于安全原因），除非 redisplay 属性设置为 true。

默认情况下，rendererType 属性必须设置为 "javax.faces.Secret"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML input element of type password. On a redisplay, any previously entered value will not be rendered (for security reasons) unless the redisplay property is set to true.

By default, the rendererType property must be set to "javax.faces.Secret". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlInputSecret()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getAlt() Return the value of the alt property.
String | getAutocomplete() Return the value of the autocomplete property.
String | getDir() Return the value of the dir property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
int | getMaxlength() Return the value of the maxlength property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
int | getSize() Return the value of the size property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
boolean | isRedisplay() Return the value of the redisplay property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setAlt(String alt) Set the value of the alt property.
void | setAutocomplete(String autocomplete) Set the value of the autocomplete property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setMaxlength(int maxlength) Set the value of the maxlength property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setRedisplay(boolean redisplay) Set the value of the redisplay property.
void | setSize(int size) Set the value of the size property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getFamily, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlInputSecret()
英文文档：

HtmlInputSecret

public HtmlInputSecret()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getAlt()

返回 alt 属性的值。

内容：此组件所呈现元素的可替换文本描述。

英文文档：

getAlt

public String getAlt()

Return the value of the alt property.

Contents: Alternate textual description of the element rendered by this component.

public void setAlt(String alt)

设置 alt 属性的值。

英文文档：

setAlt

public void setAlt(String alt)

Set the value of the alt property.

public String getAutocomplete()

返回 autocomplete 属性的值。

内容：如果此属性的值为 "off"，则呈现 "off" 作为属性值。这指示浏览器应该禁用此组件的自动完成功能。这对于能执行自动完成又不希望浏览器干预的组件非常有用。如果没有设置此属性或者该值为 "on"，则不呈现任何内容。

英文文档：

getAutocomplete

public String getAutocomplete()

Return the value of the autocomplete property.

Contents: If the value of this attribute is "off", render "off" as the value of the attribute. This indicates that the browser should disable its autocomplete feature for this component. This is useful for components that perform autocompletion and do not want the browser interfering. If this attribute is not set or the value is "on", render nothing.

public void setAutocomplete(String autocomplete)

设置 autocomplete 属性的值。

英文文档：

setAutocomplete

public void setAutocomplete(String autocomplete)

Set the value of the autocomplete property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public int getMaxlength()

返回 maxlength 属性的值。

内容：可以在此字段中输入的最大字符数。

英文文档：

getMaxlength

public int getMaxlength()

Return the value of the maxlength property.

Contents: The maximum number of characters that may be entered in this field.

public void setMaxlength(int maxlength)

设置 maxlength 属性的值。

英文文档：

setMaxlength

public void setMaxlength(int maxlength)

Set the value of the maxlength property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public boolean isRedisplay()

返回 redisplay 属性的值。

内容：指示创建表单时应呈现此字段中的任何现有值的标志。因为这存在潜在的安全风险，所以默认情况下不显示密码值。

英文文档：

isRedisplay

public boolean isRedisplay()

Return the value of the redisplay property.

Contents: Flag indicating that any existing value in this field should be rendered when the form is created. Because this is a potential security risk, password values are not displayed by default.

public void setRedisplay(boolean redisplay)

设置 redisplay 属性的值。

英文文档：

setRedisplay

public void setRedisplay(boolean redisplay)

Set the value of the redisplay property.

public int getSize()

返回 size 属性的值。

内容：用于确定此字段宽度的字符数。

英文文档：

getSize

public int getSize()

Return the value of the size property.

Contents: The number of characters used to determine the width of this field.

public void setSize(int size)

设置 size 属性的值。

英文文档：

setSize

public void setSize(int size)

Set the value of the size property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlInputText (Java EE 5)

javax.faces.component.html
Class HtmlInputText

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.html.HtmlInputText
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlInputText
extends UIInput

Extends: UIComponent > UIComponentBase > UIOutput > UIInput

表示类型为 text 的 HTML input 元素。

默认情况下，rendererType 属性必须设置为 "javax.faces.Text"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML input element of type text.

By default, the rendererType property must be set to "javax.faces.Text". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlInputText()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getAlt() Return the value of the alt property.
String | getAutocomplete() Return the value of the autocomplete property.
String | getDir() Return the value of the dir property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
int | getMaxlength() Return the value of the maxlength property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
int | getSize() Return the value of the size property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setAlt(String alt) Set the value of the alt property.
void | setAutocomplete(String autocomplete) Set the value of the autocomplete property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setMaxlength(int maxlength) Set the value of the maxlength property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setSize(int size) Set the value of the size property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getFamily, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlInputText()
英文文档：

HtmlInputText

public HtmlInputText()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getAlt()

返回 alt 属性的值。

内容：此组件所呈现元素的可替换文本描述。

英文文档：

getAlt

public String getAlt()

Return the value of the alt property.

Contents: Alternate textual description of the element rendered by this component.

public void setAlt(String alt)

设置 alt 属性的值。

英文文档：

setAlt

public void setAlt(String alt)

Set the value of the alt property.

public String getAutocomplete()

返回 autocomplete 属性的值。

内容：如果此属性的值为 "off"，则呈现 "off" 作为属性值。这指示浏览器应该禁用此组件的自动完成功能。这对于能执行自动完成又不希望浏览器干预的组件非常有用。如果没有设置此属性或者该值为 "on"，则不呈现任何内容。

英文文档：

getAutocomplete

public String getAutocomplete()

Return the value of the autocomplete property.

Contents: If the value of this attribute is "off", render "off" as the value of the attribute. This indicates that the browser should disable its autocomplete feature for this component. This is useful for components that perform autocompletion and do not want the browser interfering. If this attribute is not set or the value is "on", render nothing.

public void setAutocomplete(String autocomplete)

设置 autocomplete 属性的值。

英文文档：

setAutocomplete

public void setAutocomplete(String autocomplete)

Set the value of the autocomplete property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public int getMaxlength()

返回 maxlength 属性的值。

内容：可以在此字段中输入的最大字符数。

英文文档：

getMaxlength

public int getMaxlength()

Return the value of the maxlength property.

Contents: The maximum number of characters that may be entered in this field.

public void setMaxlength(int maxlength)

设置 maxlength 属性的值。

英文文档：

setMaxlength

public void setMaxlength(int maxlength)

Set the value of the maxlength property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public int getSize()

返回 size 属性的值。

内容：用于确定此字段宽度的字符数。

英文文档：

getSize

public int getSize()

Return the value of the size property.

Contents: The number of characters used to determine the width of this field.

public void setSize(int size)

设置 size 属性的值。

英文文档：

setSize

public void setSize(int size)

Set the value of the size property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlInputTextarea (Java EE 5)

javax.faces.component.html
Class HtmlInputTextarea

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.html.HtmlInputTextarea
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlInputTextarea
extends UIInput

Extends: UIComponent > UIComponentBase > UIOutput > UIInput

表示 HTML textarea 元素。

默认情况下，rendererType 属性必须设置为 "javax.faces.Textarea"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML textarea element.

By default, the rendererType property must be set to "javax.faces.Textarea". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlInputTextarea()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
int | getCols() Return the value of the cols property.
String | getDir() Return the value of the dir property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
int | getRows() Return the value of the rows property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setCols(int cols) Set the value of the cols property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setRows(int rows) Set the value of the rows property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getFamily, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlInputTextarea()
英文文档：

HtmlInputTextarea

public HtmlInputTextarea()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public int getCols()

返回 cols 属性的值。

内容：要显示的列数。

英文文档：

getCols

public int getCols()

Return the value of the cols property.

Contents: The number of columns to be displayed.

public void setCols(int cols)

设置 cols 属性的值。

英文文档：

setCols

public void setCols(int cols)

Set the value of the cols property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public int getRows()

返回 rows 属性的值。

内容：要显示的行数。

英文文档：

getRows

public int getRows()

Return the value of the rows property.

Contents: The number of rows to be displayed.

public void setRows(int rows)

设置 rows 属性的值。

英文文档：

setRows

public void setRows(int rows)

Set the value of the rows property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlMessage (Java EE 5)

javax.faces.component.html
Class HtmlMessage

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIMessage
                extended by  javax.faces.component.html.HtmlMessage
All Implemented Interfaces:
StateHolder
public class HtmlMessage
extends UIMessage

Extends: UIComponent > UIComponentBase > UIMessage

默认情况下，rendererType 属性必须设置为 "javax.faces.Message"。可以调用 setRendererType() 方法更改此值。

英文文档：

By default, the rendererType property must be set to "javax.faces.Message". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIMessage
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlMessage()
Method Summary
String | getDir() Return the value of the dir property.
String | getErrorClass() Return the value of the errorClass property.
String | getErrorStyle() Return the value of the errorStyle property.
String | getFatalClass() Return the value of the fatalClass property.
String | getFatalStyle() Return the value of the fatalStyle property.
String | getInfoClass() Return the value of the infoClass property.
String | getInfoStyle() Return the value of the infoStyle property.
String | getLang() Return the value of the lang property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTitle() Return the value of the title property.
String | getWarnClass() Return the value of the warnClass property.
String | getWarnStyle() Return the value of the warnStyle property.
boolean | isTooltip() Return the value of the tooltip property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setDir(String dir) Set the value of the dir property.
void | setErrorClass(String errorClass) Set the value of the errorClass property.
void | setErrorStyle(String errorStyle) Set the value of the errorStyle property.
void | setFatalClass(String fatalClass) Set the value of the fatalClass property.
void | setFatalStyle(String fatalStyle) Set the value of the fatalStyle property.
void | setInfoClass(String infoClass) Set the value of the infoClass property.
void | setInfoStyle(String infoStyle) Set the value of the infoStyle property.
void | setLang(String lang) Set the value of the lang property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTitle(String title) Set the value of the title property.
void | setTooltip(boolean tooltip) Set the value of the tooltip property.
void | setWarnClass(String warnClass) Set the value of the warnClass property.
void | setWarnStyle(String warnStyle) Set the value of the warnStyle property.
Methods inherited from class javax.faces.component.UIMessage
getFamily, getFor, isShowDetail, isShowSummary, setFor, setShowDetail, setShowSummary
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlMessage()
英文文档：

HtmlMessage

public HtmlMessage()
Method Detail

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public String getErrorClass()

返回 errorClass 属性的值。

内容：应用于任何严重性为 "ERROR" 类的消息的 CSS 样式类。

英文文档：

getErrorClass

public String getErrorClass()

Return the value of the errorClass property.

Contents: CSS style class to apply to any message with a severity class of "ERROR".

public void setErrorClass(String errorClass)

设置 errorClass 属性的值。

英文文档：

setErrorClass

public void setErrorClass(String errorClass)

Set the value of the errorClass property.

public String getErrorStyle()

返回 errorStyle 属性的值。

内容：应用于任何严重性为 "ERROR" 类的消息的 CSS 样式。

英文文档：

getErrorStyle

public String getErrorStyle()

Return the value of the errorStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "ERROR".

public void setErrorStyle(String errorStyle)

设置 errorStyle 属性的值。

英文文档：

setErrorStyle

public void setErrorStyle(String errorStyle)

Set the value of the errorStyle property.

public String getFatalClass()

返回 fatalClass 属性的值。

内容：应用于任何严重性为 "FATAL" 类的消息的 CSS 样式类。

英文文档：

getFatalClass

public String getFatalClass()

Return the value of the fatalClass property.

Contents: CSS style class to apply to any message with a severity class of "FATAL".

public void setFatalClass(String fatalClass)

设置 fatalClass 属性的值。

英文文档：

setFatalClass

public void setFatalClass(String fatalClass)

Set the value of the fatalClass property.

public String getFatalStyle()

返回 fatalStyle 属性的值。

内容：应用于任何严重性为 "FATAL" 类的消息的 CSS 样式。

英文文档：

getFatalStyle

public String getFatalStyle()

Return the value of the fatalStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "FATAL".

public void setFatalStyle(String fatalStyle)

设置 fatalStyle 属性的值。

英文文档：

setFatalStyle

public void setFatalStyle(String fatalStyle)

Set the value of the fatalStyle property.

public String getInfoClass()

返回 infoClass 属性的值。

内容：应用于任何严重性为 "INFO" 类的消息的 CSS 样式类。

英文文档：

getInfoClass

public String getInfoClass()

Return the value of the infoClass property.

Contents: CSS style class to apply to any message with a severity class of "INFO".

public void setInfoClass(String infoClass)

设置 infoClass 属性的值。

英文文档：

setInfoClass

public void setInfoClass(String infoClass)

Set the value of the infoClass property.

public String getInfoStyle()

返回 infoStyle 属性的值。

内容：应用于任何严重性为 "INFO" 类的消息的 CSS 样式。

英文文档：

getInfoStyle

public String getInfoStyle()

Return the value of the infoStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "INFO".

public void setInfoStyle(String infoStyle)

设置 infoStyle 属性的值。

英文文档：

setInfoStyle

public void setInfoStyle(String infoStyle)

Set the value of the infoStyle property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public boolean isTooltip()

返回 tooltip 属性的值。

内容：指示是否应该将消息的详细部分显示为工具提示的标志。

英文文档：

isTooltip

public boolean isTooltip()

Return the value of the tooltip property.

Contents: Flag indicating whether the detail portion of the message should be displayed as a tooltip.

public void setTooltip(boolean tooltip)

设置 tooltip 属性的值。

英文文档：

setTooltip

public void setTooltip(boolean tooltip)

Set the value of the tooltip property.

public String getWarnClass()

返回 warnClass 属性的值。

内容：应用于任何严重性为 "WARN" 类的消息的 CSS 样式类。

英文文档：

getWarnClass

public String getWarnClass()

Return the value of the warnClass property.

Contents: CSS style class to apply to any message with a severity class of "WARN".

public void setWarnClass(String warnClass)

设置 warnClass 属性的值。

英文文档：

setWarnClass

public void setWarnClass(String warnClass)

Set the value of the warnClass property.

public String getWarnStyle()

返回 warnStyle 属性的值。

内容：应用于任何严重性为 "WARN" 类的消息的 CSS 样式。

英文文档：

getWarnStyle

public String getWarnStyle()

Return the value of the warnStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "WARN".

public void setWarnStyle(String warnStyle)

设置 warnStyle 属性的值。

英文文档：

setWarnStyle

public void setWarnStyle(String warnStyle)

Set the value of the warnStyle property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIMessage

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIMessage
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlMessages (Java EE 5)

javax.faces.component.html
Class HtmlMessages

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIMessages
                extended by  javax.faces.component.html.HtmlMessages
All Implemented Interfaces:
StateHolder
public class HtmlMessages
extends UIMessages

Extends: UIComponent > UIComponentBase > UIMessages

默认情况下，rendererType 属性必须设置为 "javax.faces.Messages"。可以调用 setRendererType() 方法更改此值。

英文文档：

By default, the rendererType property must be set to "javax.faces.Messages". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIMessages
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlMessages()
Method Summary
String | getDir() Return the value of the dir property.
String | getErrorClass() Return the value of the errorClass property.
String | getErrorStyle() Return the value of the errorStyle property.
String | getFatalClass() Return the value of the fatalClass property.
String | getFatalStyle() Return the value of the fatalStyle property.
String | getInfoClass() Return the value of the infoClass property.
String | getInfoStyle() Return the value of the infoStyle property.
String | getLang() Return the value of the lang property.
String | getLayout() Return the value of the layout property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTitle() Return the value of the title property.
String | getWarnClass() Return the value of the warnClass property.
String | getWarnStyle() Return the value of the warnStyle property.
boolean | isTooltip() Return the value of the tooltip property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setDir(String dir) Set the value of the dir property.
void | setErrorClass(String errorClass) Set the value of the errorClass property.
void | setErrorStyle(String errorStyle) Set the value of the errorStyle property.
void | setFatalClass(String fatalClass) Set the value of the fatalClass property.
void | setFatalStyle(String fatalStyle) Set the value of the fatalStyle property.
void | setInfoClass(String infoClass) Set the value of the infoClass property.
void | setInfoStyle(String infoStyle) Set the value of the infoStyle property.
void | setLang(String lang) Set the value of the lang property.
void | setLayout(String layout) Set the value of the layout property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTitle(String title) Set the value of the title property.
void | setTooltip(boolean tooltip) Set the value of the tooltip property.
void | setWarnClass(String warnClass) Set the value of the warnClass property.
void | setWarnStyle(String warnStyle) Set the value of the warnStyle property.
Methods inherited from class javax.faces.component.UIMessages
getFamily, isGlobalOnly, isShowDetail, isShowSummary, setGlobalOnly, setShowDetail, setShowSummary
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlMessages()
英文文档：

HtmlMessages

public HtmlMessages()
Method Detail

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public String getErrorClass()

返回 errorClass 属性的值。

内容：应用于任何严重性为 "ERROR" 类的消息的 CSS 样式类。

英文文档：

getErrorClass

public String getErrorClass()

Return the value of the errorClass property.

Contents: CSS style class to apply to any message with a severity class of "ERROR".

public void setErrorClass(String errorClass)

设置 errorClass 属性的值。

英文文档：

setErrorClass

public void setErrorClass(String errorClass)

Set the value of the errorClass property.

public String getErrorStyle()

返回 errorStyle 属性的值。

内容：应用于任何严重性为 "ERROR" 类的消息的 CSS 样式。

英文文档：

getErrorStyle

public String getErrorStyle()

Return the value of the errorStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "ERROR".

public void setErrorStyle(String errorStyle)

设置 errorStyle 属性的值。

英文文档：

setErrorStyle

public void setErrorStyle(String errorStyle)

Set the value of the errorStyle property.

public String getFatalClass()

返回 fatalClass 属性的值。

内容：应用于任何严重性为 "FATAL" 类的消息的 CSS 样式类。

英文文档：

getFatalClass

public String getFatalClass()

Return the value of the fatalClass property.

Contents: CSS style class to apply to any message with a severity class of "FATAL".

public void setFatalClass(String fatalClass)

设置 fatalClass 属性的值。

英文文档：

setFatalClass

public void setFatalClass(String fatalClass)

Set the value of the fatalClass property.

public String getFatalStyle()

返回 fatalStyle 属性的值。

内容：应用于任何严重性为 "FATAL" 类的消息的 CSS 样式。

英文文档：

getFatalStyle

public String getFatalStyle()

Return the value of the fatalStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "FATAL".

public void setFatalStyle(String fatalStyle)

设置 fatalStyle 属性的值。

英文文档：

setFatalStyle

public void setFatalStyle(String fatalStyle)

Set the value of the fatalStyle property.

public String getInfoClass()

返回 infoClass 属性的值。

内容：应用于任何严重性为 "INFO" 类的消息的 CSS 样式类。

英文文档：

getInfoClass

public String getInfoClass()

Return the value of the infoClass property.

Contents: CSS style class to apply to any message with a severity class of "INFO".

public void setInfoClass(String infoClass)

设置 infoClass 属性的值。

英文文档：

setInfoClass

public void setInfoClass(String infoClass)

Set the value of the infoClass property.

public String getInfoStyle()

返回 infoStyle 属性的值。

内容：应用于任何严重性为 "INFO" 类的消息的 CSS 样式。

英文文档：

getInfoStyle

public String getInfoStyle()

Return the value of the infoStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "INFO".

public void setInfoStyle(String infoStyle)

设置 infoStyle 属性的值。

英文文档：

setInfoStyle

public void setInfoStyle(String infoStyle)

Set the value of the infoStyle property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getLayout()

返回 layout 属性的值。

内容：呈现错误消息时要使用的布局标记的类型。有效值为 "table"（HTML 表格）和 "list"（HTML 列表）。如果未指定，默认值为 "list"。

英文文档：

getLayout

public String getLayout()

Return the value of the layout property.

Contents: The type of layout markup to use when rendering error messages. Valid values are "table" (an HTML table) and "list" (an HTML list). If not specified, the default value is "list".

public void setLayout(String layout)

设置 layout 属性的值。

英文文档：

setLayout

public void setLayout(String layout)

Set the value of the layout property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public boolean isTooltip()

返回 tooltip 属性的值。

内容：指示是否应该将消息的详细部分显示为工具提示的标志。

英文文档：

isTooltip

public boolean isTooltip()

Return the value of the tooltip property.

Contents: Flag indicating whether the detail portion of the message should be displayed as a tooltip.

public void setTooltip(boolean tooltip)

设置 tooltip 属性的值。

英文文档：

setTooltip

public void setTooltip(boolean tooltip)

Set the value of the tooltip property.

public String getWarnClass()

返回 warnClass 属性的值。

内容：应用于任何严重性为 "WARN" 类的消息的 CSS 样式类。

英文文档：

getWarnClass

public String getWarnClass()

Return the value of the warnClass property.

Contents: CSS style class to apply to any message with a severity class of "WARN".

public void setWarnClass(String warnClass)

设置 warnClass 属性的值。

英文文档：

setWarnClass

public void setWarnClass(String warnClass)

Set the value of the warnClass property.

public String getWarnStyle()

返回 warnStyle 属性的值。

内容：应用于任何严重性为 "WARN" 类的消息的 CSS 样式。

英文文档：

getWarnStyle

public String getWarnStyle()

Return the value of the warnStyle property.

Contents: CSS style(s) to apply to any message with a severity class of "WARN".

public void setWarnStyle(String warnStyle)

设置 warnStyle 属性的值。

英文文档：

setWarnStyle

public void setWarnStyle(String warnStyle)

Set the value of the warnStyle property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIMessages

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIMessages
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlOutputFormat (Java EE 5)

javax.faces.component.html
Class HtmlOutputFormat

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.html.HtmlOutputFormat
All Implemented Interfaces:
StateHolder, ValueHolder
public class HtmlOutputFormat
extends UIOutput

Extends: UIComponent > UIComponentBase > UIOutput

表示查找资源包中已本地化消息的组件，可选择将其用作 MessageFormat 模式字符串，并用来自嵌入 UIParameter 组件的参数值替换，然后呈现结果。如果存在 "dir" 或 "lang" 属性，则呈现 span 元素，并将其作为 span 中的属性传递。

默认情况下，rendererType 属性必须设置为 "javax.faces.Format"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents a component that looks up a localized message in a resource bundle, optionally uses it as a MessageFormat pattern string and substitutes in parameter values from nested UIParameter components, and renders the result. If the "dir" or "lang" attributes are present, render a span element and pass them through as attributes on the span.

By default, the rendererType property must be set to "javax.faces.Format". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlOutputFormat()
Method Summary
String | getDir() Return the value of the dir property.
String | getLang() Return the value of the lang property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTitle() Return the value of the title property.
boolean | isEscape() Return the value of the escape property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setDir(String dir) Set the value of the dir property.
void | setEscape(boolean escape) Set the value of the escape property.
void | setLang(String lang) Set the value of the lang property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UIOutput
getConverter, getFamily, getLocalValue, getValue, setConverter, setValue
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlOutputFormat()
英文文档：

HtmlOutputFormat

public HtmlOutputFormat()
Method Detail

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isEscape()

返回 escape 属性的值。

内容：指示在 HTML 和 XML 标记中敏感的字符必须被转义的标志。默认情况下此标志设置为 "true"。

英文文档：

isEscape

public boolean isEscape()

Return the value of the escape property.

Contents: Flag indicating that characters that are sensitive in HTML and XML markup must be escaped. This flag is set to "true" by default.

public void setEscape(boolean escape)

设置 escape 属性的值。

英文文档：

setEscape

public void setEscape(boolean escape)

Set the value of the escape property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIOutput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIOutput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlOutputLabel (Java EE 5)

javax.faces.component.html
Class HtmlOutputLabel

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.html.HtmlOutputLabel
All Implemented Interfaces:
StateHolder, ValueHolder
public class HtmlOutputLabel
extends UIOutput

Extends: UIComponent > UIComponentBase > UIOutput

表示 HTML label 元素，用于定义相应输入元素的可访问标签。

默认情况下，rendererType 属性必须设置为 "javax.faces.Label"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML label element, used to define an accessible label for a corresponding input element.

By default, the rendererType property must be set to "javax.faces.Label". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlOutputLabel()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getDir() Return the value of the dir property.
String | getFor() Return the value of the for property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isEscape() Return the value of the escape property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setDir(String dir) Set the value of the dir property.
void | setEscape(boolean escape) Set the value of the escape property.
void | setFor(String _for) Set the value of the for property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UIOutput
getConverter, getFamily, getLocalValue, getValue, setConverter, setValue
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlOutputLabel()
英文文档：

HtmlOutputLabel

public HtmlOutputLabel()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isEscape()

返回 escape 属性的值。

内容：指示在 HTML 和 XML 标记中敏感的字符必须被转义的标志。如果省略，则假定此标志为 "true"。

英文文档：

isEscape

public boolean isEscape()

Return the value of the escape property.

Contents: Flag indicating that characters that are sensitive in HTML and XML markup must be escaped. If omitted, this flag is assumed to be "true".

public void setEscape(boolean escape)

设置 escape 属性的值。

英文文档：

setEscape

public void setEscape(boolean escape)

Set the value of the escape property.

public String getFor()

返回 for 属性的值。

内容：此元素作为其标签的组件的客户端标识符。

英文文档：

getFor

public String getFor()

Return the value of the for property.

Contents: Client identifier of the component for which this element is a label.

public void setFor(String _for)

设置 for 属性的值。

英文文档：

setFor

public void setFor(String _for)

Set the value of the for property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIOutput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIOutput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlOutputLink (Java EE 5)

javax.faces.component.html
Class HtmlOutputLink

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.html.HtmlOutputLink
All Implemented Interfaces:
StateHolder, ValueHolder
public class HtmlOutputLink
extends UIOutput

Extends: UIComponent > UIComponentBase > UIOutput

表示 HTML a（超链接）元素，可用于链接到 value 属性定义的任意 URL。

默认情况下，rendererType 属性必须设置为 "javax.faces.Link"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML a (hyperlink) element that may be used to link to an arbitrary URL defined by the value property.

By default, the rendererType property must be set to "javax.faces.Link". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlOutputLink()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getCharset() Return the value of the charset property.
String | getCoords() Return the value of the coords property.
String | getDir() Return the value of the dir property.
String | getHreflang() Return the value of the hreflang property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getRel() Return the value of the rel property.
String | getRev() Return the value of the rev property.
String | getShape() Return the value of the shape property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTarget() Return the value of the target property.
String | getTitle() Return the value of the title property.
String | getType() Return the value of the type property.
boolean | isDisabled() Return the value of the disabled property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setCharset(String charset) Set the value of the charset property.
void | setCoords(String coords) Set the value of the coords property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setHreflang(String hreflang) Set the value of the hreflang property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setRel(String rel) Set the value of the rel property.
void | setRev(String rev) Set the value of the rev property.
void | setShape(String shape) Set the value of the shape property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTarget(String target) Set the value of the target property.
void | setTitle(String title) Set the value of the title property.
void | setType(String type) Set the value of the type property.
Methods inherited from class javax.faces.component.UIOutput
getConverter, getFamily, getLocalValue, getValue, setConverter, setValue
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlOutputLink()
英文文档：

HtmlOutputLink

public HtmlOutputLink()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getCharset()

返回 charset 属性的值。

内容：此超链接指定的资源的字符编码。

英文文档：

getCharset

public String getCharset()

Return the value of the charset property.

Contents: The character encoding of the resource designated by this hyperlink.

public void setCharset(String charset)

设置 charset 属性的值。

英文文档：

setCharset

public void setCharset(String charset)

Set the value of the charset property.

public String getCoords()

返回 coords 属性的值。

内容：热点在屏幕上的位置和形状（用于客户端图像映射）。

英文文档：

getCoords

public String getCoords()

Return the value of the coords property.

Contents: The position and shape of the hot spot on the screen (for use in client-side image maps).

public void setCoords(String coords)

设置 coords 属性的值。

英文文档：

setCoords

public void setCoords(String coords)

Set the value of the coords property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit.

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getHreflang()

返回 hreflang 属性的值。

内容：此超链接指定的资源的语言代码。

英文文档：

getHreflang

public String getHreflang()

Return the value of the hreflang property.

Contents: The language code of the resource designated by this hyperlink.

public void setHreflang(String hreflang)

设置 hreflang 属性的值。

英文文档：

setHreflang

public void setHreflang(String hreflang)

Set the value of the hreflang property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getRel()

返回 rel 属性的值。

内容：从当前文档到此超链接指定的锚点的关系。此属性的值是以空格分隔的链接类型列表。

英文文档：

getRel

public String getRel()

Return the value of the rel property.

Contents: The relationship from the current document to the anchor specified by this hyperlink. The value of this attribute is a space-separated list of link types.

public void setRel(String rel)

设置 rel 属性的值。

英文文档：

setRel

public void setRel(String rel)

Set the value of the rel property.

public String getRev()

返回 rev 属性的值。

内容：从此超链接指定的锚点到当前文档的反向链接。此属性的值是以空格分隔的链接类型列表。

英文文档：

getRev

public String getRev()

Return the value of the rev property.

Contents: A reverse link from the anchor specified by this hyperlink to the current document. The value of this attribute is a space-separated list of link types.

public void setRev(String rev)

设置 rev 属性的值。

英文文档：

setRev

public void setRev(String rev)

Set the value of the rev property.

public String getShape()

返回 shape 属性的值。

内容：热点在屏幕上的形状（用于客户端图像映射）。有效值有：default（整个区域）；rect（矩形区域）；circle（圆形区域）；poly（多边形区域）。

英文文档：

getShape

public String getShape()

Return the value of the shape property.

Contents: The shape of the hot spot on the screen (for use in client-side image maps). Valid values are: default (entire region); rect (rectangular region); circle (circular region); and poly (polygonal region).

public void setShape(String shape)

设置 shape 属性的值。

英文文档：

setShape

public void setShape(String shape)

Set the value of the shape property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTarget()

返回 target 属性的值。

内容：窗体名称，该窗体中将显示此超链接获取到的资源。

英文文档：

getTarget

public String getTarget()

Return the value of the target property.

Contents: Name of a frame where the resource retrieved via this hyperlink is to be displayed.

public void setTarget(String target)

设置 target 属性的值。

英文文档：

setTarget

public void setTarget(String target)

Set the value of the target property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public String getType()

返回 type 属性的值。

内容：此超链接指定的资源的内容类型。

英文文档：

getType

public String getType()

Return the value of the type property.

Contents: The content type of the resource designated by this hyperlink.

public void setType(String type)

设置 type 属性的值。

英文文档：

setType

public void setType(String type)

Set the value of the type property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIOutput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIOutput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlOutputText (Java EE 5)

javax.faces.component.html
Class HtmlOutputText

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.html.HtmlOutputText
All Implemented Interfaces:
StateHolder, ValueHolder
public class HtmlOutputText
extends UIOutput

Extends: UIComponent > UIComponentBase > UIOutput

以文本形式呈现组件值，如果指定了 I18N 属性、CSS 样式或样式类，可选择包装在 span 元素中。

默认情况下，rendererType 属性必须设置为 "javax.faces.Text"。可以调用 setRendererType() 方法更改此值。

英文文档：

Renders the component value as text, optionally wrapping in a span element if I18N attributes, CSS styles or style classes are specified.

By default, the rendererType property must be set to "javax.faces.Text". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIOutput
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlOutputText()
Method Summary
String | getDir() Return the value of the dir property.
String | getLang() Return the value of the lang property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTitle() Return the value of the title property.
boolean | isEscape() Return the value of the escape property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setDir(String dir) Set the value of the dir property.
void | setEscape(boolean escape) Set the value of the escape property.
void | setLang(String lang) Set the value of the lang property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UIOutput
getConverter, getFamily, getLocalValue, getValue, setConverter, setValue
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlOutputText()
英文文档：

HtmlOutputText

public HtmlOutputText()
Method Detail

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isEscape()

返回 escape 属性的值。

内容：指示在 HTML 和 XML 标记中敏感的字符必须被转义的标志。默认情况下此标志设置为 "true"。

英文文档：

isEscape

public boolean isEscape()

Return the value of the escape property.

Contents: Flag indicating that characters that are sensitive in HTML and XML markup must be escaped. This flag is set to "true" by default.

public void setEscape(boolean escape)

设置 escape 属性的值。

英文文档：

setEscape

public void setEscape(boolean escape)

Set the value of the escape property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIOutput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIOutput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlPanelGrid (Java EE 5)

javax.faces.component.html
Class HtmlPanelGrid

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIPanel
                extended by  javax.faces.component.html.HtmlPanelGrid
All Implemented Interfaces:
StateHolder
public class HtmlPanelGrid
extends UIPanel

Extends: UIComponent > UIComponentBase > UIPanel

呈现表格中的子组件，同时在指定的列数后开始新行。

默认情况下，rendererType 属性必须设置为 "javax.faces.Grid"。可以调用 setRendererType() 方法更改此值。

英文文档：

Renders child components in a table, starting a new row after the specified number of columns.

By default, the rendererType property must be set to "javax.faces.Grid". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIPanel
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlPanelGrid()
Method Summary
String | getBgcolor() Return the value of the bgcolor property.
int | getBorder() Return the value of the border property.
String | getCaptionClass() Return the value of the captionClass property.
String | getCaptionStyle() Return the value of the captionStyle property.
String | getCellpadding() Return the value of the cellpadding property.
String | getCellspacing() Return the value of the cellspacing property.
String | getColumnClasses() Return the value of the columnClasses property.
int | getColumns() Return the value of the columns property.
String | getDir() Return the value of the dir property.
String | getFooterClass() Return the value of the footerClass property.
String | getFrame() Return the value of the frame property.
String | getHeaderClass() Return the value of the headerClass property.
String | getLang() Return the value of the lang property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getRowClasses() Return the value of the rowClasses property.
String | getRules() Return the value of the rules property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getSummary() Return the value of the summary property.
String | getTitle() Return the value of the title property.
String | getWidth() Return the value of the width property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setBgcolor(String bgcolor) Set the value of the bgcolor property.
void | setBorder(int border) Set the value of the border property.
void | setCaptionClass(String captionClass) Set the value of the captionClass property.
void | setCaptionStyle(String captionStyle) Set the value of the captionStyle property.
void | setCellpadding(String cellpadding) Set the value of the cellpadding property.
void | setCellspacing(String cellspacing) Set the value of the cellspacing property.
void | setColumnClasses(String columnClasses) Set the value of the columnClasses property.
void | setColumns(int columns) Set the value of the columns property.
void | setDir(String dir) Set the value of the dir property.
void | setFooterClass(String footerClass) Set the value of the footerClass property.
void | setFrame(String frame) Set the value of the frame property.
void | setHeaderClass(String headerClass) Set the value of the headerClass property.
void | setLang(String lang) Set the value of the lang property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setRowClasses(String rowClasses) Set the value of the rowClasses property.
void | setRules(String rules) Set the value of the rules property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setSummary(String summary) Set the value of the summary property.
void | setTitle(String title) Set the value of the title property.
void | setWidth(String width) Set the value of the width property.
Methods inherited from class javax.faces.component.UIPanel
getFamily
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlPanelGrid()
英文文档：

HtmlPanelGrid

public HtmlPanelGrid()
Method Detail

public String getBgcolor()

返回 bgcolor 属性的值。

内容：此表格背景颜色的名称或代码。

英文文档：

getBgcolor

public String getBgcolor()

Return the value of the bgcolor property.

Contents: Name or code of the background color for this table.

public void setBgcolor(String bgcolor)

设置 bgcolor 属性的值。

英文文档：

setBgcolor

public void setBgcolor(String bgcolor)

Set the value of the bgcolor property.

public int getBorder()

返回 border 属性的值。

内容：此表格周围将绘制的边框的宽度（以像素为单位）。

英文文档：

getBorder

public int getBorder()

Return the value of the border property.

Contents: Width (in pixels) of the border to be drawn around this table.

public void setBorder(int border)

设置 border 属性的值。

英文文档：

setBorder

public void setBorder(int border)

Set the value of the border property.

public String getCaptionClass()

返回 captionClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此表格生成的任何标题。

英文文档：

getCaptionClass

public String getCaptionClass()

Return the value of the captionClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any caption generated for this table.

public void setCaptionClass(String captionClass)

设置 captionClass 属性的值。

英文文档：

setCaptionClass

public void setCaptionClass(String captionClass)

Set the value of the captionClass property.

public String getCaptionStyle()

返回 captionStyle 属性的值。

内容：呈现此标题时应用的 CSS 样式。

英文文档：

getCaptionStyle

public String getCaptionStyle()

Return the value of the captionStyle property.

Contents: CSS style(s) to be applied when this caption is rendered.

public void setCaptionStyle(String captionStyle)

设置 captionStyle 属性的值。

英文文档：

setCaptionStyle

public void setCaptionStyle(String captionStyle)

Set the value of the captionStyle property.

public String getCellpadding()

返回 cellpadding 属性的值。

内容：有关用户代理应该在每个单元格的边框及其内容之间留下多少空间的定义。

英文文档：

getCellpadding

public String getCellpadding()

Return the value of the cellpadding property.

Contents: Definition of how much space the user agent should leave between the border of each cell and its contents.

public void setCellpadding(String cellpadding)

设置 cellpadding 属性的值。

英文文档：

setCellpadding

public void setCellpadding(String cellpadding)

Set the value of the cellpadding property.

public String getCellspacing()

返回 cellspacing 属性的值。

内容：有关用户代理应该在表格左边缘和最左边的列之间、表格顶端和最上方的行的上边缘之间，以及依此类推的表格右边和底部，留下多少空间的定义。它还指定单元格之间留下的空间大小。

英文文档：

getCellspacing

public String getCellspacing()

Return the value of the cellspacing property.

Contents: Definition of how much space the user agent should leave between the left side of the table and the leftmost column, the top of the table and the top of the top side of the topmost row, and so on for the right and bottom of the table. It also specifies the amount of space to leave between cells.

public void setCellspacing(String cellspacing)

设置 cellspacing 属性的值。

英文文档：

setCellspacing

public void setCellspacing(String cellspacing)

Set the value of the cellspacing property.

public String getColumnClasses()

返回 columnClasses 属性的值。

内容：以逗号分隔的 CSS 样式类列表，将应用于此表格的列。也可以为任何单个列指定以空格分隔的类列表。如果此列表中的元素数少于 "columns" 属性中指定的列数，则对于大于列表中元素数的每个列，将不会输出任何 "class" 属性。如果列表中的元素数大于 "columns" 属性中指定的列数，则将忽略列表中位于 "columns" 属性值之后的元素。

英文文档：

getColumnClasses

public String getColumnClasses()

Return the value of the columnClasses property.

Contents: Comma-delimited list of CSS style classes that will be applied to the columns of this table. A space separated list of classes may also be specified for any individual column. If the number of elements in this list is less than the number of columns specified in the "columns" attribute, no "class" attribute is output for each column greater than the number of elements in the list. If the number of elements in the list is greater than the number of columns specified in the "columns" attribute, the elements at the posisiton in the list after the value of the "columns" attribute are ignored.

public void setColumnClasses(String columnClasses)

设置 columnClasses 属性的值。

英文文档：

setColumnClasses

public void setColumnClasses(String columnClasses)

Set the value of the columnClasses property.

public int getColumns()

返回 columns 属性的值。

内容：开始新行之前要呈现的列数。

英文文档：

getColumns

public int getColumns()

Return the value of the columns property.

Contents: The number of columns to render before starting a new row.

public void setColumns(int columns)

设置 columns 属性的值。

英文文档：

setColumns

public void setColumns(int columns)

Set the value of the columns property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public String getFooterClass()

返回 footerClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此表格生成的任何脚注。

英文文档：

getFooterClass

public String getFooterClass()

Return the value of the footerClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any footer generated for this table.

public void setFooterClass(String footerClass)

设置 footerClass 属性的值。

英文文档：

setFooterClass

public void setFooterClass(String footerClass)

Set the value of the footerClass property.

public String getFrame()

返回 frame 属性的值。

内容：指定围绕此表格的窗体的哪些边可见的代码。有效值有：none（任何边均不可见，默认值）；above（仅顶部的边可见）；below（仅底部的边可见）；hsides（仅顶部和底部的边可见）；vsides（仅右侧和左侧的边可见）；lhs（仅左侧的边可见）；rhs（仅右侧的边可见）；box（四边均可见）；border（四边均可见）。

英文文档：

getFrame

public String getFrame()

Return the value of the frame property.

Contents: Code specifying which sides of the frame surrounding this table will be visible. Valid values are: none (no sides, default value); above (top side only); below (bottom side only); hsides (top and bottom sides only); vsides (right and left sides only); lhs (left hand side only); rhs (right hand side only); box (all four sides); and border (all four sides).

public void setFrame(String frame)

设置 frame 属性的值。

英文文档：

setFrame

public void setFrame(String frame)

Set the value of the frame property.

public String getHeaderClass()

返回 headerClass 属性的值。

内容：以空格分隔的 CSS 样式类列表，将应用于为此表格生成的任何头。

英文文档：

getHeaderClass

public String getHeaderClass()

Return the value of the headerClass property.

Contents: Space-separated list of CSS style class(es) that will be applied to any header generated for this table.

public void setHeaderClass(String headerClass)

设置 headerClass 属性的值。

英文文档：

setHeaderClass

public void setHeaderClass(String headerClass)

Set the value of the headerClass property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getRowClasses()

返回 rowClasses 属性的值。

内容：以逗号分隔的 CSS 样式类列表，将应用于此表格的行。也可以为任何单个行指定以空格分隔的类列表。这些样式将依次应用于表格的每一行。例如，如果列表有两个元素，则列表中的第一个样式类将应用于第一行，第二个应用于第二行，第一个应用于第三行，第二个应用于第四行，依此类推。换句话说，我们将一直在列表中迭代直到到达末尾，然后再从头开始。

英文文档：

getRowClasses

public String getRowClasses()

Return the value of the rowClasses property.

Contents: Comma-delimited list of CSS style classes that will be applied to the rows of this table. A space separated list of classes may also be specified for any individual row. Thes styles are applied, in turn, to each row in the table. For example, if the list has two elements, the first style class in the list is applied to the first row, the second to the second row, the first to the third row, the second to the fourth row, etc. In other words, we keep iterating through the list until we reach the end, and then we start at the beginning again.

public void setRowClasses(String rowClasses)

设置 rowClasses 属性的值。

英文文档：

setRowClasses

public void setRowClasses(String rowClasses)

Set the value of the rowClasses property.

public String getRules()

返回 rules 属性的值。

内容：指定此表格内的单元格之间将出现哪些标尺的代码。有效值有：none（没有标尺，默认值）；groups（行组之间）；rows（仅行之间）；cols（仅列之间）；all（所有行和列之间）。

英文文档：

getRules

public String getRules()

Return the value of the rules property.

Contents: Code specifying which rules will appear between cells within this table. Valid values are: none (no rules, default value); groups (between row groups); rows (between rows only); cols (between columns only); and all (between all rows and columns).

public void setRules(String rules)

设置 rules 属性的值。

英文文档：

setRules

public void setRules(String rules)

Set the value of the rules property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getSummary()

返回 summary 属性的值。

内容：此表格作用和结构的摘要，用于用户代理呈现非可视媒体，比如语音和 Braille。

英文文档：

getSummary

public String getSummary()

Return the value of the summary property.

Contents: Summary of this table's purpose and structure, for user agents rendering to non-visual media such as speech and Braille.

public void setSummary(String summary)

设置 summary 属性的值。

英文文档：

setSummary

public void setSummary(String summary)

Set the value of the summary property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public String getWidth()

返回 width 属性的值。

内容：整个表格的宽度，用于可视用户代理。

英文文档：

getWidth

public String getWidth()

Return the value of the width property.

Contents: Width of the entire table, for visual user agents.

public void setWidth(String width)

设置 width 属性的值。

英文文档：

setWidth

public void setWidth(String width)

Set the value of the width property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlPanelGroup (Java EE 5)

javax.faces.component.html
Class HtmlPanelGroup

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIPanel
                extended by  javax.faces.component.html.HtmlPanelGroup
All Implemented Interfaces:
StateHolder
public class HtmlPanelGroup
extends UIPanel

Extends: UIComponent > UIComponentBase > UIPanel

使此组件的所有子组件被呈现。在父组件期望出现单个组件，但应用程序要呈现多个组件的情况下，此类很有用。

默认情况下，rendererType 属性必须设置为 "javax.faces.Group"。可以调用 setRendererType() 方法更改此值。

英文文档：

Causes all child components of this component to be rendered. This is useful in scenarios where a parent component is expecting a single component to be present, but the application wishes to render more than one.

By default, the rendererType property must be set to "javax.faces.Group". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UIPanel
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlPanelGroup()
Method Summary
String | getLayout() Return the value of the layout property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setLayout(String layout) Set the value of the layout property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
Methods inherited from class javax.faces.component.UIPanel
getFamily
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlPanelGroup()
英文文档：

HtmlPanelGroup

public HtmlPanelGroup()
Method Detail

public String getLayout()

返回 layout 属性的值。

内容：呈现此组时要使用的布局标记的类型。如果值为 "block"，则 renderer 必须生成 HTML "div" 元素。否则，必须生成 HTML "span" 元素。

英文文档：

getLayout

public String getLayout()

Return the value of the layout property.

Contents: The type of layout markup to use when rendering this group. If the value is "block" the renderer must produce an HTML "div" element. Otherwise HTML "span" element must be produced.

public void setLayout(String layout)

设置 layout 属性的值。

英文文档：

setLayout

public void setLayout(String layout)

Set the value of the layout property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" property on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlSelectBooleanCheckbox (Java EE 5)

javax.faces.component.html
Class HtmlSelectBooleanCheckbox

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectBoolean
                        extended by  javax.faces.component.html.HtmlSelectBooleanCheckbox
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlSelectBooleanCheckbox
extends UISelectBoolean

Extends: UIComponent > UIComponentBase > UIOutput > UIInput > UISelectBoolean

表示类型为 checkbox 的 HTML input 元素。根据 value 属性的值，复选框将呈现为选中或未选中。

默认情况下，rendererType 属性必须设置为 "javax.faces.Checkbox"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents an HTML input element of type checkbox. The checkbox will be rendered as checked, or not, based on the value of the value property.

By default, the rendererType property must be set to "javax.faces.Checkbox". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UISelectBoolean
COMPONENT_FAMILY
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlSelectBooleanCheckbox()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getDir() Return the value of the dir property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UISelectBoolean
getFamily, getValueBinding, getValueExpression, isSelected, setSelected, setValueBinding, setValueExpression
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlSelectBooleanCheckbox()
英文文档：

HtmlSelectBooleanCheckbox

public HtmlSelectBooleanCheckbox()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlSelectManyCheckbox (Java EE 5)

javax.faces.component.html
Class HtmlSelectManyCheckbox

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectMany
                        extended by  javax.faces.component.html.HtmlSelectManyCheckbox
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlSelectManyCheckbox
extends UISelectMany

Extends: UIComponent > UIComponentBase > UIOutput > UIInput > UISelectMany

表示作为一组类型为 checkbox 的 HTML input 元素呈现的多项选择组件。

默认情况下，rendererType 属性必须设置为 "javax.faces.Checkbox"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents a multiple-selection component that is rendered as a set of HTML input elements of type checkbox.

By default, the rendererType property must be set to "javax.faces.Checkbox". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UISelectMany
COMPONENT_FAMILY, INVALID_MESSAGE_ID
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlSelectManyCheckbox()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
int | getBorder() Return the value of the border property.
String | getDir() Return the value of the dir property.
String | getDisabledClass() Return the value of the disabledClass property.
String | getEnabledClass() Return the value of the enabledClass property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getLayout() Return the value of the layout property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setBorder(int border) Set the value of the border property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setDisabledClass(String disabledClass) Set the value of the disabledClass property.
void | setEnabledClass(String enabledClass) Set the value of the enabledClass property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setLayout(String layout) Set the value of the layout property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UISelectMany
compareValues, getFamily, getSelectedValues, getValueBinding, getValueExpression, setSelectedValues, setValueBinding, setValueExpression, validateValue
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlSelectManyCheckbox()
英文文档：

HtmlSelectManyCheckbox

public HtmlSelectManyCheckbox()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public int getBorder()

返回 border 属性的值。

内容：包含选项列表的表格周围将绘制的边框的宽度（以像素为单位）。

英文文档：

getBorder

public int getBorder()

Return the value of the border property.

Contents: Width (in pixels) of the border to be drawn around the table containing the options list.

public void setBorder(int border)

设置 border 属性的值。

英文文档：

setBorder

public void setBorder(int border)

Set the value of the border property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getDisabledClass()

返回 disabledClass 属性的值。

内容：应用于禁用选项呈现标签的 CSS 样式类。

英文文档：

getDisabledClass

public String getDisabledClass()

Return the value of the disabledClass property.

Contents: CSS style class to apply to the rendered label on disabled options.

public void setDisabledClass(String disabledClass)

设置 disabledClass 属性的值。

英文文档：

setDisabledClass

public void setDisabledClass(String disabledClass)

Set the value of the disabledClass property.

public String getEnabledClass()

返回 enabledClass 属性的值。

内容：应用于启用选项呈现标签的 CSS 样式类。

英文文档：

getEnabledClass

public String getEnabledClass()

Return the value of the enabledClass property.

Contents: CSS style class to apply to the rendered label on enabled options.

public void setEnabledClass(String enabledClass)

设置 enabledClass 属性的值。

英文文档：

setEnabledClass

public void setEnabledClass(String enabledClass)

Set the value of the enabledClass property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getLayout()

返回 layout 属性的值。

内容：要创建的选项列表的方向。有效值有 "pageDirection"（列表垂直排列）或者 "lineDirection"（列表水平排列）。如果未指定，默认值为 "lineDirection"。

英文文档：

getLayout

public String getLayout()

Return the value of the layout property.

Contents: Orientation of the options list to be created. Valid values are "pageDirection" (list is laid out vertically), or "lineDirection" (list is laid out horizontally). If not specified, the default value is "lineDirection".

public void setLayout(String layout)

设置 layout 属性的值。

英文文档：

setLayout

public void setLayout(String layout)

Set the value of the layout property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlSelectManyListbox (Java EE 5)

javax.faces.component.html
Class HtmlSelectManyListbox

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectMany
                        extended by  javax.faces.component.html.HtmlSelectManyListbox
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlSelectManyListbox
extends UISelectMany

Extends: UIComponent > UIComponentBase > UIOutput > UIInput > UISelectMany

表示作为 HTML select 元素呈现的多项选择组件，显示所有可用选项或指定数量的选项。

默认情况下，rendererType 属性必须设置为 "javax.faces.Listbox"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents a multiple-selection component that is rendered as an HTML select element, showing either all available options or the specified number of options.

By default, the rendererType property must be set to "javax.faces.Listbox". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UISelectMany
COMPONENT_FAMILY, INVALID_MESSAGE_ID
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlSelectManyListbox()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getDir() Return the value of the dir property.
String | getDisabledClass() Return the value of the disabledClass property.
String | getEnabledClass() Return the value of the enabledClass property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
int | getSize() Return the value of the size property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setDisabledClass(String disabledClass) Set the value of the disabledClass property.
void | setEnabledClass(String enabledClass) Set the value of the enabledClass property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setSize(int size) Set the value of the size property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UISelectMany
compareValues, getFamily, getSelectedValues, getValueBinding, getValueExpression, setSelectedValues, setValueBinding, setValueExpression, validateValue
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlSelectManyListbox()
英文文档：

HtmlSelectManyListbox

public HtmlSelectManyListbox()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getDisabledClass()

返回 disabledClass 属性的值。

内容：应用于禁用选项呈现标签的 CSS 样式类。

英文文档：

getDisabledClass

public String getDisabledClass()

Return the value of the disabledClass property.

Contents: CSS style class to apply to the rendered label on disabled options.

public void setDisabledClass(String disabledClass)

设置 disabledClass 属性的值。

英文文档：

setDisabledClass

public void setDisabledClass(String disabledClass)

Set the value of the disabledClass property.

public String getEnabledClass()

返回 enabledClass 属性的值。

内容：应用于启用选项呈现标签的 CSS 样式类。

英文文档：

getEnabledClass

public String getEnabledClass()

Return the value of the enabledClass property.

Contents: CSS style class to apply to the rendered label on enabled options.

public void setEnabledClass(String enabledClass)

设置 enabledClass 属性的值。

英文文档：

setEnabledClass

public void setEnabledClass(String enabledClass)

Set the value of the enabledClass property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public int getSize()

返回 size 属性的值。

内容：随时显示的可用选项数量。如果未指定，则显示所有可用选项。

英文文档：

getSize

public int getSize()

Return the value of the size property.

Contents: Number of available options to be shown at all times. If not specified, all available options are shown.

public void setSize(int size)

设置 size 属性的值。

英文文档：

setSize

public void setSize(int size)

Set the value of the size property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlSelectManyMenu (Java EE 5)

javax.faces.component.html
Class HtmlSelectManyMenu

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectMany
                        extended by  javax.faces.component.html.HtmlSelectManyMenu
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlSelectManyMenu
extends UISelectMany

Extends: UIComponent > UIComponentBase > UIOutput > UIInput > UISelectMany

表示作为 HTML select 元素呈现的多项选择组件，一次显示一个可用选项。

默认情况下，rendererType 属性必须设置为 "javax.faces.Menu"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents a multiple-selection component that is rendered as an HTML select element, showing a single available option at a time.

By default, the rendererType property must be set to "javax.faces.Menu". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UISelectMany
COMPONENT_FAMILY, INVALID_MESSAGE_ID
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlSelectManyMenu()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getDir() Return the value of the dir property.
String | getDisabledClass() Return the value of the disabledClass property.
String | getEnabledClass() Return the value of the enabledClass property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setDisabledClass(String disabledClass) Set the value of the disabledClass property.
void | setEnabledClass(String enabledClass) Set the value of the enabledClass property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UISelectMany
compareValues, getFamily, getSelectedValues, getValueBinding, getValueExpression, setSelectedValues, setValueBinding, setValueExpression, validateValue
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlSelectManyMenu()
英文文档：

HtmlSelectManyMenu

public HtmlSelectManyMenu()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getDisabledClass()

返回 disabledClass 属性的值。

内容：应用于禁用选项呈现标签的 CSS 样式类。

英文文档：

getDisabledClass

public String getDisabledClass()

Return the value of the disabledClass property.

Contents: CSS style class to apply to the rendered label on disabled options.

public void setDisabledClass(String disabledClass)

设置 disabledClass 属性的值。

英文文档：

setDisabledClass

public void setDisabledClass(String disabledClass)

Set the value of the disabledClass property.

public String getEnabledClass()

返回 enabledClass 属性的值。

内容：应用于启用选项呈现标签的 CSS 样式类。

英文文档：

getEnabledClass

public String getEnabledClass()

Return the value of the enabledClass property.

Contents: CSS style class to apply to the rendered label on enabled options.

public void setEnabledClass(String enabledClass)

设置 enabledClass 属性的值。

英文文档：

setEnabledClass

public void setEnabledClass(String enabledClass)

Set the value of the enabledClass property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlSelectOneListbox (Java EE 5)

javax.faces.component.html
Class HtmlSelectOneListbox

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectOne
                        extended by  javax.faces.component.html.HtmlSelectOneListbox
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlSelectOneListbox
extends UISelectOne

Extends: UIComponent > UIComponentBase > UIOutput > UIInput > UISelectOne

表示作为 HTML select 元素呈现的单项选择组件，显示所有可用选项或指定数量的选项。

默认情况下，rendererType 属性必须设置为 "javax.faces.Listbox"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents a single-selection component that is rendered as an HTML select element, showing either all available options or the specified number of options.

By default, the rendererType property must be set to "javax.faces.Listbox". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UISelectOne
COMPONENT_FAMILY, INVALID_MESSAGE_ID
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlSelectOneListbox()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getDir() Return the value of the dir property.
String | getDisabledClass() Return the value of the disabledClass property.
String | getEnabledClass() Return the value of the enabledClass property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
int | getSize() Return the value of the size property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setDisabledClass(String disabledClass) Set the value of the disabledClass property.
void | setEnabledClass(String enabledClass) Set the value of the enabledClass property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setSize(int size) Set the value of the size property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UISelectOne
getFamily, validateValue
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlSelectOneListbox()
英文文档：

HtmlSelectOneListbox

public HtmlSelectOneListbox()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getDisabledClass()

返回 disabledClass 属性的值。

内容：应用于禁用选项呈现标签的 CSS 样式类。

英文文档：

getDisabledClass

public String getDisabledClass()

Return the value of the disabledClass property.

Contents: CSS style class to apply to the rendered label on disabled options.

public void setDisabledClass(String disabledClass)

设置 disabledClass 属性的值。

英文文档：

setDisabledClass

public void setDisabledClass(String disabledClass)

Set the value of the disabledClass property.

public String getEnabledClass()

返回 enabledClass 属性的值。

内容：应用于启用选项呈现标签的 CSS 样式类。

英文文档：

getEnabledClass

public String getEnabledClass()

Return the value of the enabledClass property.

Contents: CSS style class to apply to the rendered label on enabled options.

public void setEnabledClass(String enabledClass)

设置 enabledClass 属性的值。

英文文档：

setEnabledClass

public void setEnabledClass(String enabledClass)

Set the value of the enabledClass property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public int getSize()

返回 size 属性的值。

内容：随时显示的可用选项数量。如果未指定，则显示所有可用选项。

英文文档：

getSize

public int getSize()

Return the value of the size property.

Contents: Number of available options to be shown at all times. If not specified, all available options are shown.

public void setSize(int size)

设置 size 属性的值。

英文文档：

setSize

public void setSize(int size)

Set the value of the size property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HtmlSelectOneMenu (Java EE 5)

javax.faces.component.html
Class HtmlSelectOneMenu

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectOne
                        extended by  javax.faces.component.html.HtmlSelectOneMenu
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlSelectOneMenu
extends UISelectOne

Represents a single-selection component that is rendered as an HTML select element, showing a single available option at a time.

By default, the rendererType property must be set to "javax.faces.Menu". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UISelectOne
COMPONENT_FAMILY, INVALID_MESSAGE_ID
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlSelectOneMenu()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
String | getDir() Return the value of the dir property.
String | getDisabledClass() Return the value of the disabledClass property.
String | getEnabledClass() Return the value of the enabledClass property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setDisabledClass(String disabledClass) Set the value of the disabledClass property.
void | setEnabledClass(String enabledClass) Set the value of the enabledClass property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UISelectOne
getFamily, validateValue
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

HtmlSelectOneMenu

public HtmlSelectOneMenu()
Method Detail

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

setDir

public void setDir(String dir)

Set the value of the dir property.

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

getDisabledClass

public String getDisabledClass()

Return the value of the disabledClass property.

Contents: CSS style class to apply to the rendered label on disabled options.

setDisabledClass

public void setDisabledClass(String disabledClass)

Set the value of the disabledClass property.

getEnabledClass

public String getEnabledClass()

Return the value of the enabledClass property.

Contents: CSS style class to apply to the rendered label on enabled options.

setEnabledClass

public void setEnabledClass(String enabledClass)

Set the value of the enabledClass property.

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

setLabel

public void setLabel(String label)

Set the value of the label property.

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

setLang

public void setLang(String lang)

Set the value of the lang property.

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

setStyle

public void setStyle(String style)

Set the value of the style property.

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

setTitle

public void setTitle(String title)

Set the value of the title property.

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature

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


HtmlSelectOneRadio (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.component.html
Class HtmlSelectOneRadio

java.lang.Object
    extended by  javax.faces.component.UIComponent
        extended by  javax.faces.component.UIComponentBase
            extended by  javax.faces.component.UIOutput
                extended by  javax.faces.component.UIInput
                    extended by  javax.faces.component.UISelectOne
                        extended by  javax.faces.component.html.HtmlSelectOneRadio
All Implemented Interfaces:
EditableValueHolder, StateHolder, ValueHolder
public class HtmlSelectOneRadio
extends UISelectOne

Extends: UIComponent > UIComponentBase > UIOutput > UIInput > UISelectOne

表示作为一组类型为 radio 的 HTML input 元素呈现的单项选择组件。

默认情况下，rendererType 属性必须设置为 "javax.faces.Radio"。可以调用 setRendererType() 方法更改此值。

英文文档：

Represents a single-selection component that is rendered as a set of HTML input elements of type radio.

By default, the rendererType property must be set to "javax.faces.Radio". This value can be changed by calling the setRendererType() method.

Field Summary
static String COMPONENT_TYPE
The standard component type for this component.
Fields inherited from class javax.faces.component.UISelectOne
COMPONENT_FAMILY, INVALID_MESSAGE_ID
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
Fields inherited from class javax.faces.component.UIComponent
bindings
Constructor Summary
HtmlSelectOneRadio()
Method Summary
String | getAccesskey() Return the value of the accesskey property.
int | getBorder() Return the value of the border property.
String | getDir() Return the value of the dir property.
String | getDisabledClass() Return the value of the disabledClass property.
String | getEnabledClass() Return the value of the enabledClass property.
String | getLabel() Return the value of the label property.
String | getLang() Return the value of the lang property.
String | getLayout() Return the value of the layout property.
String | getOnblur() Return the value of the onblur property.
String | getOnchange() Return the value of the onchange property.
String | getOnclick() Return the value of the onclick property.
String | getOndblclick() Return the value of the ondblclick property.
String | getOnfocus() Return the value of the onfocus property.
String | getOnkeydown() Return the value of the onkeydown property.
String | getOnkeypress() Return the value of the onkeypress property.
String | getOnkeyup() Return the value of the onkeyup property.
String | getOnmousedown() Return the value of the onmousedown property.
String | getOnmousemove() Return the value of the onmousemove property.
String | getOnmouseout() Return the value of the onmouseout property.
String | getOnmouseover() Return the value of the onmouseover property.
String | getOnmouseup() Return the value of the onmouseup property.
String | getOnselect() Return the value of the onselect property.
String | getStyle() Return the value of the style property.
String | getStyleClass() Return the value of the styleClass property.
String | getTabindex() Return the value of the tabindex property.
String | getTitle() Return the value of the title property.
boolean | isDisabled() Return the value of the disabled property.
boolean | isReadonly() Return the value of the readonly property.
void | restoreState(FacesContext _context, Object _state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext _context) Gets the state of the instance as a Serializable Object.
void | setAccesskey(String accesskey) Set the value of the accesskey property.
void | setBorder(int border) Set the value of the border property.
void | setDir(String dir) Set the value of the dir property.
void | setDisabled(boolean disabled) Set the value of the disabled property.
void | setDisabledClass(String disabledClass) Set the value of the disabledClass property.
void | setEnabledClass(String enabledClass) Set the value of the enabledClass property.
void | setLabel(String label) Set the value of the label property.
void | setLang(String lang) Set the value of the lang property.
void | setLayout(String layout) Set the value of the layout property.
void | setOnblur(String onblur) Set the value of the onblur property.
void | setOnchange(String onchange) Set the value of the onchange property.
void | setOnclick(String onclick) Set the value of the onclick property.
void | setOndblclick(String ondblclick) Set the value of the ondblclick property.
void | setOnfocus(String onfocus) Set the value of the onfocus property.
void | setOnkeydown(String onkeydown) Set the value of the onkeydown property.
void | setOnkeypress(String onkeypress) Set the value of the onkeypress property.
void | setOnkeyup(String onkeyup) Set the value of the onkeyup property.
void | setOnmousedown(String onmousedown) Set the value of the onmousedown property.
void | setOnmousemove(String onmousemove) Set the value of the onmousemove property.
void | setOnmouseout(String onmouseout) Set the value of the onmouseout property.
void | setOnmouseover(String onmouseover) Set the value of the onmouseover property.
void | setOnmouseup(String onmouseup) Set the value of the onmouseup property.
void | setOnselect(String onselect) Set the value of the onselect property.
void | setReadonly(boolean readonly) Set the value of the readonly property.
void | setStyle(String style) Set the value of the style property.
void | setStyleClass(String styleClass) Set the value of the styleClass property.
void | setTabindex(String tabindex) Set the value of the tabindex property.
void | setTitle(String title) Set the value of the title property.
Methods inherited from class javax.faces.component.UISelectOne
getFamily, validateValue
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter

Field Detail

英文文档：

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

public HtmlSelectOneRadio()
英文文档：

HtmlSelectOneRadio

public HtmlSelectOneRadio()
Method Detail

public String getAccesskey()

返回 accesskey 属性的值。

内容：当按下存取键时，焦点将转移到此元素。

英文文档：

getAccesskey

public String getAccesskey()

Return the value of the accesskey property.

Contents: Access key that, when pressed, transfers focus to this element.

public void setAccesskey(String accesskey)

设置 accesskey 属性的值。

英文文档：

setAccesskey

public void setAccesskey(String accesskey)

Set the value of the accesskey property.

public int getBorder()

返回 border 属性的值。

内容：包含选项列表的表格周围将绘制的边框的宽度（以像素为单位）。

英文文档：

getBorder

public int getBorder()

Return the value of the border property.

Contents: Width (in pixels) of the border to be drawn around the table containing the options list.

public void setBorder(int border)

设置 border 属性的值。

英文文档：

setBorder

public void setBorder(int border)

Set the value of the border property.

public String getDir()

返回 dir 属性的值。

内容：未继承方向性的文本的方向指示。有效值有 "LTR"（left-to-right，从左到右）和 "RTL"（right-to-left，从右到左）。

英文文档：

getDir

public String getDir()

Return the value of the dir property.

Contents: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).

public void setDir(String dir)

设置 dir 属性的值。

英文文档：

setDir

public void setDir(String dir)

Set the value of the dir property.

public boolean isDisabled()

返回 disabled 属性的值。

内容：指示此元素永远不会接收焦点或被包含在后续提交中的标志。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 disabled="disabled" 的情况相同。

英文文档：

isDisabled

public boolean isDisabled()

Return the value of the disabled property.

Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".

public void setDisabled(boolean disabled)

设置 disabled 属性的值。

英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the value of the disabled property.

public String getDisabledClass()

返回 disabledClass 属性的值。

内容：应用于禁用选项呈现标签的 CSS 样式类。

英文文档：

getDisabledClass

public String getDisabledClass()

Return the value of the disabledClass property.

Contents: CSS style class to apply to the rendered label on disabled options.

public void setDisabledClass(String disabledClass)

设置 disabledClass 属性的值。

英文文档：

setDisabledClass

public void setDisabledClass(String disabledClass)

Set the value of the disabledClass property.

public String getEnabledClass()

返回 enabledClass 属性的值。

内容：应用于启用选项呈现标签的 CSS 样式类。

英文文档：

getEnabledClass

public String getEnabledClass()

Return the value of the enabledClass property.

Contents: CSS style class to apply to the rendered label on enabled options.

public void setEnabledClass(String enabledClass)

设置 enabledClass 属性的值。

英文文档：

setEnabledClass

public void setEnabledClass(String enabledClass)

Set the value of the enabledClass property.

public String getLabel()

返回 label 属性的值。

内容：此组件的可向本地化用户显示的名称。

英文文档：

getLabel

public String getLabel()

Return the value of the label property.

Contents: A localized user presentable name for this component.

public void setLabel(String label)

设置 label 属性的值。

英文文档：

setLabel

public void setLabel(String label)

Set the value of the label property.

public String getLang()

返回 lang 属性的值。

内容：描述为此组件生成的标记中所用语言的代码。

英文文档：

getLang

public String getLang()

Return the value of the lang property.

Contents: Code describing the language used in the generated markup for this component.

public void setLang(String lang)

设置 lang 属性的值。

英文文档：

setLang

public void setLang(String lang)

Set the value of the lang property.

public String getLayout()

返回 layout 属性的值。

内容：要创建的选项列表的方向。有效值有 "pageDirection"（列表垂直排列）或者 "lineDirection"（列表水平排列）。如果未指定，默认值为 "lineDirection"。

英文文档：

getLayout

public String getLayout()

Return the value of the layout property.

Contents: Orientation of the options list to be created. Valid values are "pageDirection" (list is laid out vertically), or "lineDirection" (list is laid out horizontally). If not specified, the default value is "lineDirection".

public void setLayout(String layout)

设置 layout 属性的值。

英文文档：

setLayout

public void setLayout(String layout)

Set the value of the layout property.

public String getOnblur()

返回 onblur 属性的值。

内容：此元素失去焦点时执行的 Javascript 代码。

英文文档：

getOnblur

public String getOnblur()

Return the value of the onblur property.

Contents: Javascript code executed when this element loses focus.

public void setOnblur(String onblur)

设置 onblur 属性的值。

英文文档：

setOnblur

public void setOnblur(String onblur)

Set the value of the onblur property.

public String getOnchange()

返回 onchange 属性的值。

内容：此元素失去焦点以及获得焦点后修改了其值时执行的 Javascript 代码。

英文文档：

getOnchange

public String getOnchange()

Return the value of the onchange property.

Contents: Javascript code executed when this element loses focus and its value has been modified since gaining focus.

public void setOnchange(String onchange)

设置 onchange 属性的值。

英文文档：

setOnchange

public void setOnchange(String onchange)

Set the value of the onchange property.

public String getOnclick()

返回 onclick 属性的值。

内容：在此元素上单击指针按钮时执行的 Javascript 代码。

英文文档：

getOnclick

public String getOnclick()

Return the value of the onclick property.

Contents: Javascript code executed when a pointer button is clicked over this element.

public void setOnclick(String onclick)

设置 onclick 属性的值。

英文文档：

setOnclick

public void setOnclick(String onclick)

Set the value of the onclick property.

public String getOndblclick()

返回 ondblclick 属性的值。

内容：在此元素上双击指针按钮时执行的 Javascript 代码。

英文文档：

getOndblclick

public String getOndblclick()

Return the value of the ondblclick property.

Contents: Javascript code executed when a pointer button is double clicked over this element.

public void setOndblclick(String ondblclick)

设置 ondblclick 属性的值。

英文文档：

setOndblclick

public void setOndblclick(String ondblclick)

Set the value of the ondblclick property.

public String getOnfocus()

返回 onfocus 属性的值。

内容：此元素接收焦点时执行的 Javascript 代码。

英文文档：

getOnfocus

public String getOnfocus()

Return the value of the onfocus property.

Contents: Javascript code executed when this element receives focus.

public void setOnfocus(String onfocus)

设置 onfocus 属性的值。

英文文档：

setOnfocus

public void setOnfocus(String onfocus)

Set the value of the onfocus property.

public String getOnkeydown()

返回 onkeydown 属性的值。

内容：在此元素上按下键时执行的 Javascript 代码。

英文文档：

getOnkeydown

public String getOnkeydown()

Return the value of the onkeydown property.

Contents: Javascript code executed when a key is pressed down over this element.

public void setOnkeydown(String onkeydown)

设置 onkeydown 属性的值。

英文文档：

setOnkeydown

public void setOnkeydown(String onkeydown)

Set the value of the onkeydown property.

public String getOnkeypress()

返回 onkeypress 属性的值。

内容：在此元素上按下并释放键时执行的 Javascript 代码。

英文文档：

getOnkeypress

public String getOnkeypress()

Return the value of the onkeypress property.

Contents: Javascript code executed when a key is pressed and released over this element.

public void setOnkeypress(String onkeypress)

设置 onkeypress 属性的值。

英文文档：

setOnkeypress

public void setOnkeypress(String onkeypress)

Set the value of the onkeypress property.

public String getOnkeyup()

返回 onkeyup 属性的值。

内容：在此元素上释放键时执行的 Javascript 代码。

英文文档：

getOnkeyup

public String getOnkeyup()

Return the value of the onkeyup property.

Contents: Javascript code executed when a key is released over this element.

public void setOnkeyup(String onkeyup)

设置 onkeyup 属性的值。

英文文档：

setOnkeyup

public void setOnkeyup(String onkeyup)

Set the value of the onkeyup property.

public String getOnmousedown()

返回 onmousedown 属性的值。

内容：在此元素上按下指针按钮时执行的 Javascript 代码。

英文文档：

getOnmousedown

public String getOnmousedown()

Return the value of the onmousedown property.

Contents: Javascript code executed when a pointer button is pressed down over this element.

public void setOnmousedown(String onmousedown)

设置 onmousedown 属性的值。

英文文档：

setOnmousedown

public void setOnmousedown(String onmousedown)

Set the value of the onmousedown property.

public String getOnmousemove()

返回 onmousemove 属性的值。

内容：当指针按钮移动到此元素内时执行的 Javascript 代码。

英文文档：

getOnmousemove

public String getOnmousemove()

Return the value of the onmousemove property.

Contents: Javascript code executed when a pointer button is moved within this element.

public void setOnmousemove(String onmousemove)

设置 onmousemove 属性的值。

英文文档：

setOnmousemove

public void setOnmousemove(String onmousemove)

Set the value of the onmousemove property.

public String getOnmouseout()

返回 onmouseout 属性的值。

内容：当指针按钮移出此元素时执行的 Javascript 代码。

英文文档：

getOnmouseout

public String getOnmouseout()

Return the value of the onmouseout property.

Contents: Javascript code executed when a pointer button is moved away from this element.

public void setOnmouseout(String onmouseout)

设置 onmouseout 属性的值。

英文文档：

setOnmouseout

public void setOnmouseout(String onmouseout)

Set the value of the onmouseout property.

public String getOnmouseover()

返回 onmouseover 属性的值。

内容：当指针按钮移动到此元素上时执行的 Javascript 代码。

英文文档：

getOnmouseover

public String getOnmouseover()

Return the value of the onmouseover property.

Contents: Javascript code executed when a pointer button is moved onto this element.

public void setOnmouseover(String onmouseover)

设置 onmouseover 属性的值。

英文文档：

setOnmouseover

public void setOnmouseover(String onmouseover)

Set the value of the onmouseover property.

public String getOnmouseup()

返回 onmouseup 属性的值。

内容：在此元素上释放指针按钮时执行的 Javascript 代码。

英文文档：

getOnmouseup

public String getOnmouseup()

Return the value of the onmouseup property.

Contents: Javascript code executed when a pointer button is released over this element.

public void setOnmouseup(String onmouseup)

设置 onmouseup 属性的值。

英文文档：

setOnmouseup

public void setOnmouseup(String onmouseup)

Set the value of the onmouseup property.

public String getOnselect()

返回 onselect 属性的值。

内容：当用户选择此元素内的文本时执行的 Javascript 代码。

英文文档：

getOnselect

public String getOnselect()

Return the value of the onselect property.

Contents: Javascript code executed when text within this element is selected by the user.

public void setOnselect(String onselect)

设置 onselect 属性的值。

英文文档：

setOnselect

public void setOnselect(String onselect)

Set the value of the onselect property.

public boolean isReadonly()

返回 readonly 属性的值。

内容：指示此组件将禁止用户进行更改的标志。该元素可以接收焦点，除非它也被禁用。值为 false 将不呈现任何属性，而值为 true 呈现属性的方式与 readonly="readonly" 的情况相同。

英文文档：

isReadonly

public boolean isReadonly()

Return the value of the readonly property.

Contents: Flag indicating that this component will prohibit changes by the user. The element may receive focus unless it has also been disabled. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as readonly="readonly".

public void setReadonly(boolean readonly)

设置 readonly 属性的值。

英文文档：

setReadonly

public void setReadonly(boolean readonly)

Set the value of the readonly property.

public String getStyle()

返回 style 属性的值。

内容：呈现此组件时应用的 CSS 样式。

英文文档：

getStyle

public String getStyle()

Return the value of the style property.

Contents: CSS style(s) to be applied when this component is rendered.

public void setStyle(String style)

设置 style 属性的值。

英文文档：

setStyle

public void setStyle(String style)

Set the value of the style property.

public String getStyleClass()

返回 styleClass 属性的值。

内容：呈现此元素时应用的以空格分隔的 CSS 样式类列表。此值必须作为生成标记上的 "class" 属性传递。

英文文档：

getStyleClass

public String getStyleClass()

Return the value of the styleClass property.

Contents: Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup.

public void setStyleClass(String styleClass)

设置 styleClass 属性的值。

英文文档：

setStyleClass

public void setStyleClass(String styleClass)

Set the value of the styleClass property.

public String getTabindex()

返回 tabindex 属性的值。

内容：此元素在当前文档的 Tab 切换顺序中的位置。此值必须为 0 到 32767 之间的整数。

英文文档：

getTabindex

public String getTabindex()

Return the value of the tabindex property.

Contents: Position of this element in the tabbing order for the current document. This value must be an integer between 0 and 32767.

public void setTabindex(String tabindex)

设置 tabindex 属性的值。

英文文档：

setTabindex

public void setTabindex(String tabindex)

Set the value of the tabindex property.

public String getTitle()

返回 title 属性的值。

内容：关于为此组件生成的标记元素的建议性标题信息。

英文文档：

getTitle

public String getTitle()

Return the value of the title property.

Contents: Advisory title information about markup elements generated for this component.

public void setTitle(String title)

设置 title 属性的值。

英文文档：

setTitle

public void setTitle(String title)

Set the value of the title property.

public Object saveState(FacesContext _context)
英文文档：

saveState

public Object saveState(FacesContext _context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

public void restoreState(FacesContext _context, Object _state)
英文文档：

restoreState

public void restoreState(FacesContext _context,
                         Object _state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.context (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.context

Classes and interfaces defining per-request state information.

See:
Description

Class Summary
ExternalContext | This class allows the Faces API to be unaware of the nature of its containing application environment.
FacesContext | FacesContext contains all of the per-request state information related to the processing of a single JavaServer Faces request, and the rendering of the corresponding response.
FacesContextFactory | FacesContextFactory is a factory object that creates (if needed) and returns new FacesContext instances, initialized for the processing of the specified request and response objects.
ResponseStream | ResponseStream is an interface describing an adapter to an underlying output mechanism for binary output.
ResponseWriter | ResponseWriter is an abstract class describing an adapter to an underlying output mechanism for character-based output.
ResponseWriterWrapper | Provides a simple implementation of ResponseWriter that can be subclassed by developers wishing to provide specialized behavior to an existing ResponseWriter instance.

Package javax.faces.context Description

Classes and interfaces defining per-request state information. The main class in this package is FacesContext, which is the access point for all per-request information, as well as the gateway to several other helper classes.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.context Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.context

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.context.ExternalContext
    • javax.faces.context.FacesContext
    • javax.faces.context.FacesContextFactory
    • java.io.OutputStream (implements java.io.Closeable, java.io.Flushable)
      • javax.faces.context.ResponseStream
    • java.io.Writer (implements java.lang.Appendable, java.io.Closeable, java.io.Flushable)
      • javax.faces.context.ResponseWriter
        • javax.faces.context.ResponseWriterWrapper
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ExternalContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.context
Class ExternalContext

java.lang.Object
    extended by  javax.faces.context.ExternalContext

public abstract class ExternalContext
extends Object

此类使 Faces API 能够忽略所含应用程序环境的特性。具体来说，此类使基于 JavaServer Faces 的应用程序能够在 Servlet 或 Portlet 环境中运行。

在下文的方法描述中，以 Servlet：和 Portlet： 开头的段落表示针对该特定环境的行为。

英文文档：

This class allows the Faces API to be unaware of the nature of its containing application environment. In particular, this class allows JavaServer Faces based appications to run in either a Servlet or a Portlet environment.

In the method descriptions below, paragraphs starting with Servlet: and Portlet: denote behavior that is specific to that particular environment.

Field Summary
static String | BASIC_AUTH String identifier for BASIC authentication.
static String | CLIENT_CERT_AUTH String identifier for CLIENT_CERT authentication.
static String | DIGEST_AUTH String identifier for DIGEST authentication.
static String | FORM_AUTH String identifier for FORM authentication.
Constructor Summary
ExternalContext()
Method Summary
abstract void | dispatch(String path) Dispatch a request to the specified resource to create output for this response.
abstract String | encodeActionURL(String url) Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable action in the current application.
abstract String | encodeNamespace(String name) Return the specified name, after prefixing it with a namespace that ensures that it will be unique within the context of a particular page.
abstract String | encodeResourceURL(String url) Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable resource in the current application.
abstract Map<String,Object> | getApplicationMap() Return a mutable Map representing the application scope attributes for the current application.
abstract String | getAuthType() Return the name of the authentication scheme used to authenticate the current user, if any; otherwise, return null.
abstract Object | getContext() Return the application environment object instance for the current appication.
abstract String | getInitParameter(String name) Return the value of the specified application initialization parameter (if any).
abstract Map | getInitParameterMap() Return an immutable Map whose keys are the set of application initialization parameter names configured for this application, and whose values are the corresponding parameter values.
abstract String | getRemoteUser() Return the login name of the user making the current request if any; otherwise, return null.
abstract Object | getRequest() Return the environment-specific object instance for the current request.
String | getRequestCharacterEncoding() Return the character encoding currently being used to interpret this request.
String | getRequestContentType() Return the MIME Content-Type for this request.
abstract String | getRequestContextPath() Return the portion of the request URI that identifies the web application context for this request.
abstract Map<String,Object> | getRequestCookieMap() Return an immutable Map whose keys are the set of cookie names included in the current request, and whose values (of type javax.servlet.http.Cookie) are the first (or only) cookie for each cookie name returned by the underlying request.
abstract Map<String,String> | getRequestHeaderMap() Return an immutable Map whose keys are the set of request header names included in the current request, and whose values (of type String) are the first (or only) value for each header name returned by the underlying request.
abstract Map<String,String[]> | getRequestHeaderValuesMap() Return an immutable Map whose keys are the set of request header names included in the current request, and whose values (of type String[]) are all of the value for each header name returned by the underlying request.
abstract Locale | getRequestLocale() Return the preferred Locale in which the client will accept content.
abstract Iterator<Locale> | getRequestLocales() Return an Iterator over the preferred Locales specified in the request, in decreasing order of preference.
abstract Map<String,Object> | getRequestMap() Return a mutable Map representing the request scope attributes for the current application.
abstract Map<String,String> | getRequestParameterMap() Return an immutable Map whose keys are the set of request parameters names included in the current request, and whose values (of type String) are the first (or only) value for each parameter name returned by the underlying request.
abstract Iterator<String> | getRequestParameterNames() Return an Iterator over the names of all request parameters included in the current request.
abstract Map<String,String[]> | getRequestParameterValuesMap() Return an immutable Map whose keys are the set of request parameters names included in the current request, and whose values (of type String[]) are all of the values for each parameter name returned by the underlying request.
abstract String | getRequestPathInfo() Return the extra path information (if any) included in the request URI; otherwise, return null.
abstract String | getRequestServletPath() Return the servlet path information (if any) included in the request URI; otherwise, return null.
abstract URL | getResource(String path) Return a URL for the application resource mapped to the specified path, if it exists; otherwise, return null.
abstract InputStream | getResourceAsStream(String path) Return an InputStream for an application resource mapped to the specified path, if it exists; otherwise, return null.
abstract Set<String> | getResourcePaths(String path) Return the Set of resource paths for all application resources whose resource path starts with the specified argument.
abstract Object | getResponse() Return the environment-specific object instance for the current response.
String | getResponseCharacterEncoding() Returns the name of the character encoding (MIME charset) used for the body sent in this response.
String | getResponseContentType() Return the MIME Content-Type for this response.
abstract Object | getSession(boolean create) If the create parameter is true, create (if necessary) and return a session instance associated with the current request.
abstract Map<String,Object> | getSessionMap() Return a mutable Map representing the session scope attributes for the current application.
abstract Principal | getUserPrincipal() Return the Principal object containing the name of the current authenticated user, if any; otherwise, return null.
abstract boolean | isUserInRole(String role) Return true if the currently authenticated user is included in the specified role.
abstract void | log(String message) Log the specified message to the application object.
abstract void | log(String message, Throwable exception) Log the specified message and exception to the application object.
abstract void | redirect(String url) Redirect a request to the specified URL, and cause the responseComplete() method to be called on the FacesContext instance for the current request.
void | setRequest(Object request) Set the environment-specific request to be returned by subsequent calls to getRequest().
void | setRequestCharacterEncoding(String encoding) Overrides the name of the character encoding used in the body of this request.
void | setResponse(Object response) Set the environment-specific response to be returned by subsequent calls to getResponse().
void | setResponseCharacterEncoding(String encoding) Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

BASIC_AUTH

public static final String BASIC_AUTH

String identifier for BASIC authentication.

See Also:
Constant Field Values

英文文档：

CLIENT_CERT_AUTH

public static final String CLIENT_CERT_AUTH

String identifier for CLIENT_CERT authentication.

See Also:
Constant Field Values

英文文档：

DIGEST_AUTH

public static final String DIGEST_AUTH

String identifier for DIGEST authentication.

See Also:
Constant Field Values

英文文档：

FORM_AUTH

public static final String FORM_AUTH

String identifier for FORM authentication.

See Also:
Constant Field Values
Constructor Detail

public ExternalContext()
英文文档：

ExternalContext

public ExternalContext()
Method Detail

abstract public void dispatch(String path) throws java.io.IOException

将请求分发给指定的资源，以为此响应创建输出。

Servlet：要完成此方法，必须首先调用 javax.servlet.ServletContext 方法 getRequestDispatcher(path)，然后对所得对象调用 forward() 方法。

Portlet：要完成此方法，必须首先调用 javax.portlet.PortletContext 方法 getRequestDispatcher()，然后对所得对象调用 include() 方法。

path | 指向指定资源的上下文相对路径，必须以斜杠 ("/") 字符开头
Throws | FacesException: 如果发生 ServletException 或 PortletException，则抛出该异常
Throws | IllegalArgumentException: 如果无法为指定的路径创建请求分发程序
Throws | IllegalStateException: 如果在 portlet 环境中调用此方法，并且当前请求为 ActionRequest，而不是 RenderRequest
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 path 为 null
英文文档：

dispatch

public abstract void dispatch(String path)
                       throws IOException

Dispatch a request to the specified resource to create output for this response.

Servlet: This must be accomplished by calling the javax.servlet.ServletContext method getRequestDispatcher(path), and calling the forward() method on the resulting object.

Portlet: This must be accomplished by calling the javax.portlet.PortletContext method getRequestDispatcher(), and calling the include() method on the resulting object.

Parameters:
path - Context relative path to the specified resource, which must start with a slash ("/") character
Throws:
FacesException - thrown if a ServletException or PortletException occurs
IllegalArgumentException - if no request dispatcher can be created for the specified path
IllegalStateException - if this method is called in a portlet environment, and the current request is an ActionRequest instead of a RenderRequest
IOException - if an input/output error occurs
NullPointerException - if path is null

abstract public String encodeActionURL(String url)

执行了任何为确保正确标识当前应用程序中的可寻址操作所需的重写操作之后，返回输入 URL。

Servlet：这必须是 javax.servlet.http.HttpServletResponse 方法 encodeURL(url) 返回的值。

Portlet：这必须是 javax.portlet.PortletResponse 方法 encodeURL(url) 返回的值。

url | 要编码的输入 URL
Throws | NullPointerException: 如果 url 为 null
英文文档：

encodeActionURL

public abstract String encodeActionURL(String url)

Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable action in the current application.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletResponse method encodeURL(url).

Portlet: This must be the value returned by the javax.portlet.PortletResponse method encodeURL(url).

Parameters:
url - The input URL to be encoded
Throws:
NullPointerException - if url is null

abstract public String encodeNamespace(String name)

用名称空间作为其前缀以确保它在特定页面上下文中的唯一性之后，返回指定的名称。

Servlet：必须返回未更改的输入值。

Portlet：返回值必须是以 javax.portlet.RenderResponse 方法 getNamespace() 返回的值为前缀的输入值。

name | 要编码的名称
Throws | IllegalStateException: 如果在 portlet 环境中调用此方法，并且当前的响应为 ActionResponse，而不是 RenderResponse
Throws | NullPointerException: 如果 name 为 null
英文文档：

encodeNamespace

public abstract String encodeNamespace(String name)

Return the specified name, after prefixing it with a namespace that ensures that it will be unique within the context of a particular page.

Servlet: The input value must be returned unchanged.

Portlet: The returned value must be the input value prefixed by the value returned by the javax.portlet.RenderResponse method getNamespace().

Parameters:
name - Name to be encoded
Throws:
IllegalStateException - if this method is called in a portlet environment, and the current response is an ActionResponse instead of a RenderResponse
NullPointerException - if name is null

abstract public String encodeResourceURL(String url)

执行了任何为确保正确标识当前应用程序中的可寻址资源所需的重写操作之后，返回输入 URL。

Servlet：这必须是 javax.servlet.http.HttpServletResponse 方法 encodeURL(url) 返回的值。

Portlet：这必须是 javax.portlet.PortletResponse 方法 encodeURL(url) 返回的值。

url | 要编码的输入 URL
Throws | NullPointerException: 如果 url 为 null
英文文档：

encodeResourceURL

public abstract String encodeResourceURL(String url)

Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable resource in the current application.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletResponse method encodeURL(url).

Portlet: This must be the value returned by the javax.portlet.PortletResponse method encodeURL(url).

Parameters:
url - The input URL to be encoded
Throws:
NullPointerException - if url is null

abstract public java.util.Map<K, V> getApplicationMap()

返回一个可变的 Map，它代表当前应用程序的应用程序作用域属性。返回的 Map 必须实现可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。在 Map 中所进行的修改一定会导致在应用程序作用域属性集中进行相应更改。特别是 clear()、remove()、put()、putAll() 和 get() 操作必须对底层数据库结构采取相应的操作。

对于任何导致元素从底层数据结构中删除的 Map 方法，必须采取以下与托管 Bean 有关的操作。如果移除的元素是托管 Bean，并且它有一个或多个使用 javax.annotation.PreDestroy 注释的公共无参数 void 返回方法，则从底层数据结构移除该元素前，必须调用所有这些方法。对于非托管 Bean，但恰好含有使用该注释的方法的元素，移除时不得调用这些方法。PreDestroy 注释的方法所抛出的任何异常都必须被捕获并重新抛出。可以记录异常。

Servlet：这必须是通过 javax.servlet.ServletContext 方法 getAttribute()、getAttributeNames()、removeAttribute() 和 setAttribute() 获得的属性集。

Portlet：这必须是通过 javax.portlet.PortletContext 方法 getAttribute()、getAttributeNames()、removeAttribute() 和 setAttribute() 获得的属性集。

英文文档：

getApplicationMap

public abstract Map<String,Object> getApplicationMap()

Return a mutable Map representing the application scope attributes for the current application. The returned Map must implement the entire contract for a modifiable map as described in the JavaDocs for java.util.Map. Modifications made in the Map must cause the corresponding changes in the set of application scope attributes. Particularly the clear(), remove(), put(), putAll(), and get() operations must take the appropriate action on the underlying data structure.

For any of the Map methods that cause an element to be removed from the underlying data structure, the following action regarding managed-beans must be taken. If the element to be removed is a managed-bean, and it has one or more public no-argument void return methods annotated with javax.annotation.PreDestroy, each such method must be called before the element is removed from the underlying data structure. Elements that are not managed-beans, but do happen to have methods with that annotation must not have those methods called on removal. Any exception thrown by the PreDestroy annotated methods must by caught and not rethrown. The exception may be logged.

Servlet: This must be the set of attributes available via the javax.servlet.ServletContext methods getAttribute(), getAttributeNames(), removeAttribute(), and setAttribute().

Portlet: This must be the set of attributes available via the javax.portlet.PortletContext methods getAttribute(), getAttributeNames(), removeAttribute(), and setAttribute().

abstract public String getAuthType()

返回用于验证当前用户的验证方案的名称（如果有）；否则返回 null。对于标准验证方案，返回值将是以下常量之一：BASIC_AUTH、CLIENT_CERT_AUTH、DIGEST_AUTH 或 FORM_AUTH。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 getAuthType() 返回的值。

Portlet：这必须是 javax.portlet.http.PortletRequest 方法 getAuthType() 返回的值。

英文文档：

getAuthType

public abstract String getAuthType()

Return the name of the authentication scheme used to authenticate the current user, if any; otherwise, return null. For standard authentication schemes, the returned value will match one of the following constants: BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, or FORM_AUTH.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getAuthType().

Portlet: This must be the value returned by the javax.portlet.http.PortletRequest method getAuthType().

abstract public Object getContext()

返回当前应用程序的应用程序环境对象实例。

Servlet：这必须是当前应用程序的 javax.servlet.ServletContext 实例。

Portlet：这必须是当前应用程序的 javax.portlet.PortletContext 实例。

英文文档：

getContext

public abstract Object getContext()

Return the application environment object instance for the current appication.

Servlet: This must be the current application's javax.servlet.ServletContext instance.

Portlet: This must be the current application's javax.portlet.PortletContext instance.

abstract public String getInitParameter(String name)

返回指定应用程序初始化参数的值（如果有）。

Servlet：这必须是 javax.servlet.ServletContext 方法 getInitParameter(name) 的结果。

Portlet：这必须是 javax.portlet.PortletContext 方法 getInitParameter(name) 的结果。

name | 请求的初始化参数的名称
Throws | NullPointerException: 如果 name 为 null
英文文档：

getInitParameter

public abstract String getInitParameter(String name)

Return the value of the specified application initialization parameter (if any).

Servlet: This must be the result of the javax.servlet.ServletContext method getInitParameter(name).

Portlet: This must be the result of the javax.portlet.PortletContext method getInitParameter(name).

Parameters:
name - Name of the requested initialization parameter
Throws:
NullPointerException - if name is null

abstract public java.util.Map<K, V> getInitParameterMap()

返回一个不可变的 Map，其键是为此应用程序配置的应用程序初始化参数名称集，其值是相应的参数值。返回的 Map 必须实现不可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。

Servlet：此方法的结果必须等同于先调用 javax.servlet.ServletContext 方法 getInitParameterNames，然后在结果中放入配置的所有参数名称/值对。

Portlet：此方法的结果必须等同于先调用 javax.portlet.PortletContext 方法 getInitParameterNames，然后在结果中放入配置的所有参数名称/值对。

英文文档：

getInitParameterMap

public abstract Map getInitParameterMap()

Return an immutable Map whose keys are the set of application initialization parameter names configured for this application, and whose values are the corresponding parameter values. The returned Map must implement the entire contract for an unmodifiable map as described in the JavaDocs for java.util.Map.

Servlet: This result must be as if it were synthesized by calling the javax.servlet.ServletContext method getInitParameterNames, and putting each configured parameter name/value pair into the result.

Portlet: This result must be as if it were synthesized by calling the javax.portlet.PortletContext method getInitParameterNames, and putting each configured parameter name/value pair into the result.

abstract public String getRemoteUser()

返回作出当前请求的用户的登录名（如果有）；否则返回 null。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 getRemoteUser() 返回的值。

Portlet：这必须是 javax.portlet.http.PortletRequest 方法 getRemoteUser() 返回的值。

英文文档：

getRemoteUser

public abstract String getRemoteUser()

Return the login name of the user making the current request if any; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getRemoteUser().

Portlet: This must be the value returned by the javax.portlet.http.PortletRequest method getRemoteUser().

abstract public Object getRequest()

返回当前请求的特定于环境的对象实例。

Servlet：这必须是当前请求的 javax.servlet.http.HttpServletRequest 实例。

Portlet：这必须是当前请求的 javax.portlet.PortletRequest 实例 ActionRequest 或 RenderRequest，具体取决于调用此方法的时间。

英文文档：

getRequest

public abstract Object getRequest()

Return the environment-specific object instance for the current request.

Servlet: This must be the current request's javax.servlet.http.HttpServletRequest instance.

Portlet: This must be the current request's javax.portlet.PortletRequest instance, which will be either an ActionRequest or a RenderRequest depending upon when this method is called.

public void setRequest(Object request)

设置后续调用 #getRequest 所返回的特定于环境的请求。此方法可以用来安装用于请求的包装器。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

since 1.2
英文文档：

setRequest

public void setRequest(Object request)

Set the environment-specific request to be returned by subsequent calls to getRequest(). This may be used to install a wrapper for the request.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Since:
1.2

public void setRequestCharacterEncoding(String encoding) throws java.io.UnsupportedEncodingException

重写在此请求的正文中使用的字符编码的名称。

访问请求之后调用此方法无效，除非已经从请求中获得了 Reader 或 Stream，这种情况下抛出 IllegalStateException。

Servlet：此方法必须接通 javax.servlet.ServletRequest 方法 setCharacterEncoding()。

Portlet： 此方法必须接通 javax.portlet.ActionRequest 方法 setCharacterEncoding()。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

Throws | java.io.UnsupportedEncodingException: 如果这不是有效的编码
since | 1.2
英文文档：

setRequestCharacterEncoding

public void setRequestCharacterEncoding(String encoding)
                                 throws UnsupportedEncodingException

Overrides the name of the character encoding used in the body of this request.

Calling this method after the request has been accessed will have no no effect, unless a Reader or Stream has been obtained from the request, in which case an IllegalStateException is thrown.

Servlet: This must call through to the javax.servlet.ServletRequest method setCharacterEncoding().

Portlet: This must call through to the javax.portlet.ActionRequest method setCharacterEncoding().

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Throws:
UnsupportedEncodingException - if this is not a valid encoding
Since:
1.2

abstract public String getRequestContextPath()

返回标识此请求的 Web 应用程序上下文的请求 URI 的一部分。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 getContextPath() 返回的值。

Portlet：这必须是 javax.portlet.PortletRequest 方法 getContextPath() 返回的值。

英文文档：

getRequestContextPath

public abstract String getRequestContextPath()

Return the portion of the request URI that identifies the web application context for this request.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getContextPath().

Portlet: This must be the value returned by the javax.portlet.PortletRequest method getContextPath().

abstract public java.util.Map<K, V> getRequestCookieMap()

返回一个不可变的 Map，其键是包含于当前请求的 cookie 名称集，其值（类型为 javax.servlet.http.Cookie）是第一个（或唯一一个）对应于底层请求所返回的每个 cookie 名称的 cookie。返回的 Map 必须实现不可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 getCookies() 返回的值，除非返回 null，这种情况下必须是长度为 0 的数组。

Portlet：这必须是空 Map。

英文文档：

getRequestCookieMap

public abstract Map<String,Object> getRequestCookieMap()

Return an immutable Map whose keys are the set of cookie names included in the current request, and whose values (of type javax.servlet.http.Cookie) are the first (or only) cookie for each cookie name returned by the underlying request. The returned Map must implement the entire contract for an unmodifiable map as described in the JavaDocs for java.util.Map.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getCookies(), unless null was returned, in which case this must be a zero-length array.

Portlet: Ths must be an empty Map.

abstract public java.util.Map<K, V> getRequestHeaderMap()

返回一个不可变的 Map，其键是包含于当前请求的请求头名称集，其值（类型为 String）是第一个（或唯一一个）对应于底层请求所返回的每个头名称的值。返回的 Map 必须实现不可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。此外，必须以大小写无关的方式执行键比较。

Servlet：这必须是通过 javax.servlet.http.HttpServletRequest 方法 getHeader() 和 getHeaderNames() 获得的头集合。

Portlet：这必须是通过 javax.portlet.PortletRequest 方法 getProperty() 和 getPropertyNames() 获得的属性集。因此，将仅包含 HTTP 头（如果 portlet 容器提供了头）和 portlet 容器提供的其他属性。

英文文档：

getRequestHeaderMap

public abstract Map<String,String> getRequestHeaderMap()

Return an immutable Map whose keys are the set of request header names included in the current request, and whose values (of type String) are the first (or only) value for each header name returned by the underlying request. The returned Map must implement the entire contract for an unmodifiable map as described in the JavaDocs for java.util.Map. In addition, key comparisons must be performed in a case insensitive manner.

Servlet: This must be the set of headers available via the javax.servlet.http.HttpServletRequest methods getHeader() and getHeaderNames().

Portlet: This must be the set of properties available via the javax.portlet.PortletRequest methods getProperty() and getPropertyNames(). As such, HTTP headers will only be included if they were provided by the portlet container, and additional properties provided by the portlet container may also be included.

abstract public java.util.Map<K, V> getRequestHeaderValuesMap()

返回一个不可变的 Map，其键是包含于当前请求的请求头名称集，其值（类型为 String[]）是对应于底层请求所返回的每个头名称的所有值。返回的 Map 必须实现不可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。此外，必须以大小写无关的方式执行键比较。

Servlet：这必须是通过 javax.servlet.http.HttpServletRequest 方法 getHeaders() 和 getHeaderNames() 获得的头集合。

Portlet：这必须是通过 javax.portlet.PortletRequest 方法 getProperties() 和 getPropertyNames() 获得的属性集。因此，将仅包含 HTTP 头（如果 portlet 容器提供了头）和 portlet 容器提供的其他属性。

英文文档：

getRequestHeaderValuesMap

public abstract Map<String,String[]> getRequestHeaderValuesMap()

Return an immutable Map whose keys are the set of request header names included in the current request, and whose values (of type String[]) are all of the value for each header name returned by the underlying request. The returned Map must implement the entire contract for an unmodifiable map as described in the JavaDocs for java.util.Map. In addition, key comparisons must be performed in a case insensitive manner.

Servlet: This must be the set of headers available via the javax.servlet.http.HttpServletRequest methods getHeaders() and getHeaderNames().

Portlet: This must be the set of properties available via the javax.portlet.PortletRequest methods getProperties() and getPropertyNames(). As such, HTTP headers will only be included if they were provided by the portlet container, and additional properties provided by the portlet container may also be included.

abstract public java.util.Locale getRequestLocale()

返回客户端将用于接收内容的首选 Locale。

Servlet：这必须是 javax.servlet.ServletRequest 方法 getLocale() 返回的值。

Portlet：这必须是 javax.portlet.PortletRequest 方法 getLocale() 返回的值。

英文文档：

getRequestLocale

public abstract Locale getRequestLocale()

Return the preferred Locale in which the client will accept content.

Servlet: This must be the value returned by the javax.servlet.ServletRequest method getLocale().

Portlet: This must be the value returned by the javax.portlet.PortletRequest method getLocale().

abstract public java.util.Iterator<E> getRequestLocales()

返回迭代请求中指定首选 Locale 的 Iterator，以递减顺序对首选项进行排序。

Servlet：这必须是一个迭代 javax.servlet.ServletRequest 方法 getLocales() 所返回值的 Iterator。

Portlet：这必须是一个迭代 javax.portlet.PortletRequest 方法 getLocales() 所返回值的 Iterator。

英文文档：

getRequestLocales

public abstract Iterator<Locale> getRequestLocales()

Return an Iterator over the preferred Locales specified in the request, in decreasing order of preference.

Servlet: This must be an Iterator over the values returned by the javax.servlet.ServletRequest method getLocales().

Portlet: This must be an Iterator over the values returned by the javax.portlet.PortletRequest method getLocales().

abstract public java.util.Map<K, V> getRequestMap()

返回一个可变的 Map，它代表当前应用程序的请求作用域属性。返回的 Map 必须实现可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。在 Map 中所进行的修改一定会导致在请求作用域属性集中进行相应更改。特别是 clear()、remove()、put()、putAll() 和 get() 操作必须对底层数据库结构采取相应的操作。

对于任何导致元素从底层数据结构中删除的 Map 方法，必须采取以下与托管 Bean 有关的操作。如果移除的元素是托管 Bean，并且它有一个或多个使用 javax.annotation.PreDestroy 注释的公共无参数 void 返回方法，则从底层数据结构移除该元素前，必须调用所有这些方法。对于非托管 Bean，但恰好含有使用该注释的方法的元素，移除时不得调用这些方法。PreDestroy 注释的方法所抛出的任何异常都必须被捕获并重新抛出。可以记录异常。

Servlet：这必须是通过 javax.servlet.ServletRequest 方法 getAttribute()、getAttributeNames()、removeAttribute() 和 setAttribute() 获得的属性集。

Portlet：这必须是通过 javax.portlet.PortletRequest 方法 getAttribute()、getAttributeNames()、removeAttribute() 和 setAttribute() 获得的属性集。

英文文档：

getRequestMap

public abstract Map<String,Object> getRequestMap()

Return a mutable Map representing the request scope attributes for the current application. The returned Map must implement the entire contract for a modifiable map as described in the JavaDocs for java.util.Map. Modifications made in the Map must cause the corresponding changes in the set of request scope attributes. Particularly the clear(), remove(), put(), putAll(), and get() operations must take the appropriate action on the underlying data structure.

For any of the Map methods that cause an element to be removed from the underlying data structure, the following action regarding managed-beans must be taken. If the element to be removed is a managed-bean, and it has one or more public no-argument void return methods annotated with javax.annotation.PreDestroy, each such method must be called before the element is removed from the underlying data structure. Elements that are not managed-beans, but do happen to have methods with that annotation must not have those methods called on removal. Any exception thrown by the PreDestroy annotated methods must by caught and not rethrown. The exception may be logged.

Servlet: This must be the set of attributes available via the javax.servlet.ServletRequest methods getAttribute(), getAttributeNames(), removeAttribute(), and setAttribute().

Portlet: This must be the set of attributes available via the javax.portlet.PortletRequest methods getAttribute(), getAttributeNames(), removeAttribute(), and setAttribute().

abstract public java.util.Map<K, V> getRequestParameterMap()

返回一个不可变的 Map，其键是包含于当前请求的请求参数名称集，其值（类型为 String）是第一个（或唯一一个）对应于底层请求所返回的每个参数名称的值。返回的 Map 必须实现不可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。

Servlet：这必须是通过 javax.servlet.ServletRequest 方法 getParameter() 和 getParameterNames() 获得的参数集。

Portlet：这必须是通过 javax.portlet.PortletRequest 方法 getParameter() 和 getParameterNames() 获得的参数集。

英文文档：

getRequestParameterMap

public abstract Map<String,String> getRequestParameterMap()

Return an immutable Map whose keys are the set of request parameters names included in the current request, and whose values (of type String) are the first (or only) value for each parameter name returned by the underlying request. The returned Map must implement the entire contract for an unmodifiable map as described in the JavaDocs for java.util.Map.

Servlet: This must be the set of parameters available via the javax.servlet.ServletRequest methods getParameter() and getParameterNames().

Portlet: This must be the set of parameters available via the javax.portlet.PortletRequest methods getParameter() and getParameterNames().

abstract public java.util.Iterator<E> getRequestParameterNames()

返回迭代当前请求中所含所有请求参数名称的 Iterator。

Servlet：这必须是一个迭代 javax.servlet.ServletRequest 方法 getParameterNames() 所返回值的 Iterator。

Portlet：这必须是一个迭代 javax.portlet.PortletRequest 方法 getParameterNames() 所返回值的 Iterator。

英文文档：

getRequestParameterNames

public abstract Iterator<String> getRequestParameterNames()

Return an Iterator over the names of all request parameters included in the current request.

Servlet: This must be an Iterator over the values returned by the javax.servlet.ServletRequest method getParameterNames().

Portlet: This must be an Iterator over the values returned by the javax.portlet.PortletRequest method getParameterNames().

abstract public java.util.Map<K, V> getRequestParameterValuesMap()

返回一个不可变的 Map，其键是包含于当前请求的请求参数名称集，其值（类型为 String[]）是对应于底层请求所返回的每个参数名称的所有值。返回的 Map 必须实现不可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。

Servlet：这必须是通过 javax.servlet.ServletRequest 方法 getParameterValues() 和 getParameterNames() 获得的参数集。

Portlet：这必须是通过 javax.portlet.PortletRequest 方法 getParameterValues() 和 getParameterNames() 获得的参数集。

英文文档：

getRequestParameterValuesMap

public abstract Map<String,String[]> getRequestParameterValuesMap()

Return an immutable Map whose keys are the set of request parameters names included in the current request, and whose values (of type String[]) are all of the values for each parameter name returned by the underlying request. The returned Map must implement the entire contract for an unmodifiable map as described in the JavaDocs for java.util.Map.

Servlet: This must be the set of parameters available via the javax.servlet.ServletRequest methods getParameterValues() and getParameterNames().

Portlet: This must be the set of parameters available via the javax.portlet.PortletRequest methods getParameterValues() and getParameterNames().

abstract public String getRequestPathInfo()

返回包含于请求 URI 的额外路径信息（如果有）；否则返回 null。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 getPathInfo() 返回的值。

Portlet：这必须为 null。

英文文档：

getRequestPathInfo

public abstract String getRequestPathInfo()

Return the extra path information (if any) included in the request URI; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getPathInfo().

Portlet: This must be null.

abstract public String getRequestServletPath()

返回包含于请求 URI 的 servlet 路径信息（如果有）；否则返回 null。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 getServletPath() 返回的值。

Portlet：这必须为 null。

英文文档：

getRequestServletPath

public abstract String getRequestServletPath()

Return the servlet path information (if any) included in the request URI; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getServletPath().

Portlet: This must be null.

public String getRequestCharacterEncoding()

返回当前用来解释此请求的字符编码。

Servlet：此方法必须返回 javax.servlet.ServletRequest 方法 getCharacterEncoding() 返回的值。

Portlet：此方法必须返回 javax.portlet.ActionRequest 方法 getCharacterEncoding() 返回的值。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

since 1.2
英文文档：

getRequestCharacterEncoding

public String getRequestCharacterEncoding()

Return the character encoding currently being used to interpret this request.

Servlet: This must return the value returned by the javax.servlet.ServletRequest method getCharacterEncoding().

Portlet: This must return the value returned by the javax.portlet.ActionRequest method getCharacterEncoding().

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Since:
1.2

public String getRequestContentType()

返回此请求的 MIME 内容类型。如果不可用，则返回 null。

Servlet：此方法必须返回 javax.servlet.ServletRequest 方法 getContentType() 返回的值。

Portlet：此方法必须返回 null。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

since 1.2
英文文档：

getRequestContentType

public String getRequestContentType()

Return the MIME Content-Type for this request. If not available, return null.

Servlet: This must return the value returned by the javax.servlet.ServletRequest method getContentType().

Portlet: This must return null.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Since:
1.2

public String getResponseCharacterEncoding()

返回用于此响应中发送的正文的字符编码（MIME 字符集）名称。

Servlet：此方法必须返回 javax.servlet.ServletResponse 方法 getCharacterEncoding() 返回的值。

Portlet：此方法必须返回 null。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

since 1.2
英文文档：

getResponseCharacterEncoding

public String getResponseCharacterEncoding()

Returns the name of the character encoding (MIME charset) used for the body sent in this response.

Servlet: This must return the value returned by the javax.servlet.ServletResponse method getCharacterEncoding().

Portlet: This must return null.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Since:
1.2

public String getResponseContentType()

返回此响应的 MIME 内容类型。如果不可用，则返回 null。

Servlet：此方法必须返回 javax.servlet.ServletResponse 方法 getContentType() 返回的值。

Portlet：此方法必须返回 null。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

since 1.2
英文文档：

getResponseContentType

public String getResponseContentType()

Return the MIME Content-Type for this response. If not available, return null.

Servlet: This must return the value returned by the javax.servlet.ServletResponse method getContentType().

Portlet: This must return null.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Since:
1.2

abstract public java.net.URL getResource(String path) throws java.net.MalformedURLException

返回映射到指定路径的应用程序资源的 URL（如果存在）；否则返回 null。

Servlet：这必须是 javax.servlet.ServletContext 方法 getResource(path) 返回的值。

Portlet：这必须是 javax.portlet.PortletContext 方法 getResource(path) 返回的值。

path | 指向请求资源的路径，必须以斜杠 ("/") 字符开始
Throws | java.net.MalformedURLException: 如果指定路径的格式不正确
Throws | NullPointerException: 如果 path 为 null
英文文档：

getResource

public abstract URL getResource(String path)
                         throws MalformedURLException

Return a URL for the application resource mapped to the specified path, if it exists; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.ServletContext method getResource(path).

Portlet: This must be the value returned by the javax.portlet.PortletContext method getResource(path).

Parameters:
path - The path to the requested resource, which must start with a slash ("/" character
Throws:
MalformedURLException - if the specified path is not in the correct form
NullPointerException - if path is null

abstract public java.io.InputStream getResourceAsStream(String path)

返回映射到指定路径的应用程序资源的 InputStream（如果存在）；否则返回 null。

Servlet：这必须是 javax.servlet.ServletContext 方法 getResourceAsStream(path) 返回的值。

Portlet：这必须是 javax.portlet.PortletContext 方法 getResourceAsStream(path) 返回的值。

path | 指向请求资源的路径，必须以斜杠 ("/") 字符开始
Throws | NullPointerException: 如果 path 为 null
英文文档：

getResourceAsStream

public abstract InputStream getResourceAsStream(String path)

Return an InputStream for an application resource mapped to the specified path, if it exists; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.ServletContext method getResourceAsStream(path).

Portlet: This must be the value returned by the javax.portlet.PortletContext method getResourceAsStream(path).

Parameters:
path - The path to the requested resource, which must start with a slash ("/" character
Throws:
NullPointerException - if path is null

abstract public java.util.Set<E> getResourcePaths(String path)

返回资源路径以指定参数开头的所有应用程序资源的资源路径所组成的 Set。

Servlet：这必须是 javax.servlet.ServletContext 方法 getResourcePaths(path) 返回的值。

Portlet：这必须是 javax.portlet.PortletContext 方法 getResourcePaths(path) 返回的值。

path | 用于匹配资源的部分路径，必须以斜杠 ("/") 字符开头
Throws | NullPointerException: 如果 path 为 null
英文文档：

getResourcePaths

public abstract Set<String> getResourcePaths(String path)

Return the Set of resource paths for all application resources whose resource path starts with the specified argument.

Servlet: This must be the value returned by the javax.servlet.ServletContext method getResourcePaths(path).

Portlet: This must be the value returned by the javax.portlet.PortletContext method getResourcePaths(path).

Parameters:
path - Partial path used to match resources, which must start with a slash ("/") character
Throws:
NullPointerException - if path is null

abstract public Object getResponse()

返回当前响应的特定于环境的对象实例。

Servlet：这是当前请求的 javax.servlet.http.HttpServletResponse 实例。

Portlet：这是当前请求的 javax.portlet.PortletResponse 实例 ActionResponse 或 RenderResponse，具体取决于调用此方法的时间。

英文文档：

getResponse

public abstract Object getResponse()

Return the environment-specific object instance for the current response.

Servlet: This is the current request's javax.servlet.http.HttpServletResponse instance.

Portlet: This is the current request's javax.portlet.PortletResponse instance, which will be either an ActionResponse or a RenderResponse depending upon when this method is called.

public void setResponse(Object response)

设置后续调用 #getResponse 所返回的特定于环境的响应。此方法可以用于安装响应的包装器。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

since 1.2
英文文档：

setResponse

public void setResponse(Object response)

Set the environment-specific response to be returned by subsequent calls to getResponse(). This may be used to install a wrapper for the response.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Since:
1.2

public void setResponseCharacterEncoding(String encoding)

设置将发送到客户端的响应的字符编码（MIME 字符集），例如，设置为 UTF-8。

Servlet：此方法必须接通 javax.servlet.ServletResponse 方法 setCharacterEncoding()。

Portlet：此方法不得执行任何操作。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

since 1.2
英文文档：

setResponseCharacterEncoding

public void setResponseCharacterEncoding(String encoding)

Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.

Servlet: This must call through to the javax.servlet.ServletResponse method setCharacterEncoding().

Portlet: This method must take no action.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Since:
1.2

abstract public Object getSession(boolean create)

如果 create 参数为 true，则创建（如有必要）并返回一个与当前请求关联的会话实例。如果 create 参数为 false，则返回与当前请求关联的任何现有会话实例；如果没有这样的会话，则返回 null。

Servlet：此方法必须返回对底层 javax.servlet.http.HttpServletRequest 实例调用 getSession(create) 的结果。

Portlet：此方法必须返回对底层 javax.portlet.PortletRequest 实例调用 getPortletSession(create) 的结果。

create 指出没有会话与当前请求关联时是否应该创建一个新会话的标志。
英文文档：

getSession

public abstract Object getSession(boolean create)

If the create parameter is true, create (if necessary) and return a session instance associated with the current request. If the create parameter is false return any existing session instance associated with the current request, or return null if there is no such session.

Servlet: This must return the result of calling getSession(create) on the underlying javax.servlet.http.HttpServletRequest instance.

em>Portlet: This must return the result of calling getPortletSession(create) on the underlying javax.portlet.PortletRequest instance.

Parameters:
create - Flag indicating whether or not a new session should be created if there is no session associated with the current request

abstract public java.util.Map<K, V> getSessionMap()

返回一个可变的 Map，它代表当前应用程序的会话作用域属性。返回的 Map 必须实现可修改映射的整个协定，这在 java.util.Map 的 JavaDoc 中有详细说明。在 Map 中所进行的修改一定会导致在会话作用域属性集中进行相应更改。特别是 clear()、remove()、put() 和 get() 操作必须对底层数据库结构采取相应的操作。通过此 Map 访问属性必定导致创建与当前请求关联的会话（如果不存在这样的会话）。

对于任何导致元素从底层数据结构中删除的 Map 方法，必须采取以下与托管 Bean 有关的操作。如果移除的元素是托管 Bean，并且它有一个或多个使用 javax.annotation.PreDestroy 注释的公共无参数 void 返回方法，则从底层数据结构移除该元素前，必须调用所有这些方法。对于非托管 Bean，但恰好含有使用该注释的方法的元素，移除时不得调用这些方法。PreDestroy 注释的方法所抛出的任何异常都必须被捕获并重新抛出。可以记录异常。

Servlet：这必须是通过 javax.servlet.http.HttpServletSession 方法 getAttribute()、getAttributeNames()、removeAttribute() 和 setAttribute() 获得的属性集。

Portlet：这必须是通过 javax.portlet.PortletSession 方法 getAttribute()、getAttributeNames()、removeAttribute() 和 setAttribute() 获得的属性集。所有会话属性访问必须出现在会话的 PORTLET_SCOPE 作用域。

英文文档：

getSessionMap

public abstract Map<String,Object> getSessionMap()

Return a mutable Map representing the session scope attributes for the current application. The returned Map must implement the entire contract for a modifiable map as described in the JavaDocs for java.util.Map. Modifications made in the Map must cause the corresponding changes in the set of session scope attributes. Particularly the clear(), remove(), put(), and get() operations must take the appropriate action on the underlying data structure. Accessing attributes via this Map must cause the creation of a session associated with the current request, if such a session does not already exist.

For any of the Map methods that cause an element to be removed from the underlying data structure, the following action regarding managed-beans must be taken. If the element to be removed is a managed-bean, and it has one or more public no-argument void return methods annotated with javax.annotation.PreDestroy, each such method must be called before the element is removed from the underlying data structure. Elements that are not managed-beans, but do happen to have methods with that annotation must not have those methods called on removal. Any exception thrown by the PreDestroy annotated methods must by caught and not rethrown. The exception may be logged.

Servlet: This must be the set of attributes available via the javax.servlet.http.HttpServletSession methods getAttribute(), getAttributeNames(), removeAttribute(), and setAttribute().

Portlet: This must be the set of attributes available via the javax.portlet.PortletSession methods getAttribute(), getAttributeNames(), removeAttribute(), and setAttribute(). All session attribute access must occur in PORTLET_SCOPE scope within the session.

abstract public java.security.Principal getUserPrincipal()

返回包含当前验证的用户名称的 Principal 对象（如果有）；否则返回 null。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 getUserPrincipal() 返回的值。

Portlet：这必须是 javax.portlet.http.PortletRequest 方法 getUserPrincipal() 返回的值。

英文文档：

getUserPrincipal

public abstract Principal getUserPrincipal()

Return the Principal object containing the name of the current authenticated user, if any; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getUserPrincipal().

Portlet: This must be the value returned by the javax.portlet.http.PortletRequest method getUserPrincipal().

abstract public boolean isUserInRole(String role)

如果当前验证的用户包含在指定的角色中，则返回 true。否则返回 false。

Servlet：这必须是 javax.servlet.http.HttpServletRequest 方法 isUserInRole(role) 返回的值。

Portlet：这必须是 javax.portlet.http.PortletRequest 方法 isUserInRole(role) 返回的值。

role | 要检查的逻辑角色名称
Throws | NullPointerException: 如果 role 为 null
英文文档：

isUserInRole

public abstract boolean isUserInRole(String role)

Return true if the currently authenticated user is included in the specified role. Otherwise, return false.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method isUserInRole(role).

Portlet: This must be the value returned by the javax.portlet.http.PortletRequest method isUserInRole(role).

Parameters:
role - Logical role name to be checked
Throws:
NullPointerException - if role is null

abstract public void log(String message)

将指定的消息记录到应用程序对象。

Servlet：此方法必须通过调用 javax.servlet.ServletContext 方法 log(String) 来执行。

Portlet：此方法必须通过调用 javax.portlet.PortletContext 方法 log(String) 来执行。

message | 要记录的消息
Throws | NullPointerException: 如果 message 为 null
英文文档：

log

public abstract void log(String message)

Log the specified message to the application object.

Servlet: This must be performed by calling the javax.servlet.ServletContext method log(String).

Portlet: This must be performed by calling the javax.portlet.PortletContext method log(String).

Parameters:
message - Message to be logged
Throws:
NullPointerException - if message is null

abstract public void log(String message, Throwable exception)

将指定的消息和异常记录到应用程序对象。

Servlet：此方法必须通过调用 javax.servlet.ServletContext 方法 log(String,Throwable) 来执行。

Portlet：此方法必须通过调用 javax.portlet.PortletContext 方法 log(String,Throwable) 来执行。

message | 要记录的消息
exception | 要记录的异常
Throws | NullPointerException: 如果 message 或 exception 为 null
英文文档：

log

public abstract void log(String message,
                         Throwable exception)

Log the specified message and exception to the application object.

Servlet: This must be performed by calling the javax.servlet.ServletContext method log(String,Throwable).

Portlet: This must be performed by calling the javax.portlet.PortletContext method log(String,Throwable).

Parameters:
message - Message to be logged
exception - Exception to be logged
Throws:
NullPointerException - if message or exception is null

abstract public void redirect(String url) throws java.io.IOException

将请求重定向到指定的 URL，并导致对当前请求的 FacesContext 实例调用 responseComplete() 方法。

Servlet：此方法必须通过调用 javax.servlet.http.HttpServletResponse 方法 sendRedirect() 来完成。

Portlet：此方法必须通过调用 javax.portlet.ActionResponse 方法 sendRedirect() 来完成。

url | 客户端应该重定向到的绝对 URL
Throws | IllegalArgumentException: 如果指定的 url 是相对的
Throws | IllegalStateException: 如果当前对象是 RenderResponse，而不是 ActionResponse（在 portlet 环境中）
Throws | IllegalStateException: 如果当前响应已被提交（在 servlet 环境中）
Throws | java.io.IOException: 如果发生输入/输出错误
英文文档：

redirect

public abstract void redirect(String url)
                       throws IOException

Redirect a request to the specified URL, and cause the responseComplete() method to be called on the FacesContext instance for the current request.

Servlet: This must be accomplished by calling the javax.servlet.http.HttpServletResponse method sendRedirect().

Portlet: This must be accomplished by calling the javax.portlet.ActionResponse method sendRedirect().

Parameters:
url - Absolute URL to which the client should be redirected
Throws:
IllegalArgumentException - if the specified url is relative
IllegalStateException - if, in a portlet environment, the current response object is a RenderResponse instead of an ActionResponse
IllegalStateException - if, in a servlet environment, the current response has already been committed
IOException - if an input/output error occurs
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FacesContext (Java EE 5)

javax.faces.context
Class FacesContext

java.lang.Object
    extended by  javax.faces.context.FacesContext

public abstract class FacesContext
extends Object

FacesContext 包含与单个 JavaServer Faces 请求的处理以及相应响应的呈现相关的所有每个请求的状态信息。它传递给请求处理生命周期的每个阶段，并且可能被修改。

在请求处理的初始阶段，通过调用与当前 Web 应用程序关联的 FacesContextFactory 实例的 getFacesContext() 方法，可以将 FacesContext 实例与特定请求相关联。在调用其 release() 方法之前，该实例将一直保持活动状态，调用该方法之后将不能再引用此实例。当 FacesContext 实例处于活动状态时，只能从执行此 Web 应用程序的 servlet 容器用来处理此请求的线程中引用该实例。

英文文档：

FacesContext contains all of the per-request state information related to the processing of a single JavaServer Faces request, and the rendering of the corresponding response. It is passed to, and potentially modified by, each phase of the request processing lifecycle.

A FacesContext instance is associated with a particular request at the beginning of request processing, by a call to the getFacesContext() method of the FacesContextFactory instance associated with the current web application. The instance remains active until its release() method is called, after which no further references to this instance are allowed. While a FacesContext instance is active, it must not be referenced from any thread other than the one upon which the servlet container executing this web application utilizes for the processing of this request.

Constructor Summary
FacesContext()
Method Summary
abstract  void addMessage(String clientId, FacesMessage message)
Append a FacesMessage to the set of messages associated with the specified client identifier, if clientId is not null.
abstract  Application getApplication()
Return the Application instance associated with this web application.
abstract  Iterator<String> getClientIdsWithMessages()
Return an Iterator over the client identifiers for which at least one FacesMessage has been queued.
static FacesContext getCurrentInstance()
Return the FacesContext instance for the request that is being processed by the current thread, if any.
 ELContext getELContext()
Return the ELContext instance for this FacesContext instance.
abstract  ExternalContext getExternalContext()
Return the ExternalContext instance for this FacesContext instance.
abstract  FacesMessage.Severity getMaximumSeverity()
Return the maximum severity level recorded on any FacesMessages that has been queued, whether or not they are associated with any specific UIComponent.
abstract  Iterator<FacesMessage> getMessages()
Return an Iterator over the FacesMessages that have been queued, whether or not they are associated with any specific client identifier.
abstract  Iterator<FacesMessage> getMessages(String clientId)
Return an Iterator over the FacesMessages that have been queued that are associated with the specified client identifier (if clientId is not null), or over the FacesMessages that have been queued that are not associated with any specific client identifier (if clientId is null).
abstract  RenderKit getRenderKit()
Return the RenderKit instance for the render kit identifier specified on our UIViewRoot, if there is one.
abstract  boolean getRenderResponse()
Return true if the renderResponse() method has been called for the current request.
abstract  boolean getResponseComplete()
Return true if the responseComplete() method has been called for the current request.
abstract  ResponseStream getResponseStream()
Return the ResponseStream to which components should direct their binary output.
abstract  ResponseWriter getResponseWriter()
Return the ResponseWriter to which components should direct their character-based output.
abstract  UIViewRoot getViewRoot()
Return the root component that is associated with the this request.
abstract  void release()
Release any resources associated with this FacesContext instance.
abstract  void renderResponse()
Signal the JavaServer faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet.
abstract  void responseComplete()
Signal the JavaServer Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed.
protected static void setCurrentInstance(FacesContext context)
Set the FacesContext instance for the request that is being processed by the current thread.
abstract  void setResponseStream(ResponseStream responseStream)
Set the ResponseStream to which components should direct their binary output.
abstract  void setResponseWriter(ResponseWriter responseWriter)
Set the ResponseWriter to which components should direct their character-based output.
abstract  void setViewRoot(UIViewRoot root)
Set the root component that is associated with this request.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FacesContext()
英文文档：

FacesContext

public FacesContext()
Method Detail

abstract public Application getApplication()

返回与此 Web 应用程序关联的 Application 实例。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getApplication

public abstract Application getApplication()

Return the Application instance associated with this web application.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public java.util.Iterator<E> getClientIdsWithMessages()

返回一个迭代客户端标识符（至少有一个 javax.faces.application.FacesMessage 加入其队列）的 Iterator。如果不存在这样的客户端标识符，则返回一个空的 Iterator。如果与任何特定客户端标识符无关联的消息加入了队列，则迭代值中将包含一个 null 值。Iterator 中的元素必须按照使用 #addMessage 添加的顺序返回。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getClientIdsWithMessages

public abstract Iterator<String> getClientIdsWithMessages()

Return an Iterator over the client identifiers for which at least one FacesMessage has been queued. If there are no such client identifiers, an empty Iterator is returned. If any messages have been queued that were not associated with any specific client identifier, a null value will be included in the iterated values. The elements in the Iterator must be returned in the order in which they were added with addMessage(java.lang.String, javax.faces.application.FacesMessage).

Throws:
IllegalStateException - if this method is called after this instance has been released

public ELContext getELContext()

返回此 FacesContext 实例的 ELContext 实例。此 ELContext 实例与其关联的 FacesContext 实例具有相同的生命周期和作用域，可以在第一次对给定 FacesContext 实例调用此方法时以延迟方式创建该实例。创建 ELContext 实例时，实现必须执行以下操作：

  • 对实例调用 ELContext#putContext 方法，传入 FacesContext.class 以及对 FacesContext 实例本身的 this 引用。

  • 如果 javax.faces.application.Application#getELContextListeners 返回的 Collection 非空，则创建 javax.el.ELContextEvent 的一个实例并通过调用 javax.el.ELContextListener#contextCreated 方法将其传递给 Collection 中的每个 javax.el.ELContextListener 实例。

默认实现抛出 UnsupportedOperationException，提供它只有一个目的，即不破坏扩展此类的现有应用程序。

Throws | IllegalStateException: 如果释放此实例后调用此方法
since | 1.2
英文文档：

getELContext

public ELContext getELContext()

Return the ELContext instance for this FacesContext instance. This ELContext instance has the same lifetime and scope as the FacesContext instance with which it is associated, and may be created lazily the first time this method is called for a given FacesContext instance. Upon creation of the ELContext instance, the implementation must take the following action:

  • Call the ELContext.putContext(java.lang.Class, java.lang.Object) method on the instance, passing in FacesContext.class and the this reference for the FacesContext instance itself.

  • If the Collection returned by Application.getELContextListeners() is non-empty, create an instance of ELContextEvent and pass it to each ELContextListener instance in the Collection by calling the ELContextListener.contextCreated(javax.el.ELContextEvent) method.

The default implementation throws UnsupportedOperationException and is provided for the sole purpose of not breaking existing applications that extend this class.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
1.2

abstract public ExternalContext getExternalContext()

返回此 FacesContext 实例的 ExternalContext 实例。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getExternalContext

public abstract ExternalContext getExternalContext()

Return the ExternalContext instance for this FacesContext instance.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public FacesMessage.Severity getMaximumSeverity()

返回已加入队列的所有 javax.faces.application.FacesMessage（无论它们是否与某个特定的 UIComponent 关联）上记录的最大严重性级别。如果队列中不存在这样的消息，则返回 null。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getMaximumSeverity

public abstract FacesMessage.Severity getMaximumSeverity()

Return the maximum severity level recorded on any FacesMessages that has been queued, whether or not they are associated with any specific UIComponent. If no such messages have been queued, return null.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public java.util.Iterator<E> getMessages()

返回迭代已加入队列的 javax.faces.application.FacesMessage（无论它们是否与某个特定的客户端标识符关联）的 Iterator。如果队列中不存在这样的消息，则返回空 Iterator。Iterator 的元素必须按照使用 #addMessage 调用添加的顺序返回。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getMessages

public abstract Iterator<FacesMessage> getMessages()

Return an Iterator over the FacesMessages that have been queued, whether or not they are associated with any specific client identifier. If no such messages have been queued, return an empty Iterator. The elements of the Iterator must be returned in the order in which they were added with calls to addMessage(java.lang.String, javax.faces.application.FacesMessage).

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public java.util.Iterator<E> getMessages(String clientId)

返回迭代已经加入队列且与指定客户端标识符关联（如果 clientId 不为 null）的 javax.faces.application.FacesMessage，或者迭代已经加入队列且不与任何特定客户端标识符关联（如果 clientId 为 null）的 javax.faces.application.FacesMessage 的 Iterator。如果队列中不存在这样的消息，则返回空 Iterator。Iterator 的元素必须按照使用 #addMessage 调用添加的顺序返回。

clientId | 请求的消息的客户端标识符；如果消息不与任何客户端标识符关联，则为 null
Throws | IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getMessages

public abstract Iterator<FacesMessage> getMessages(String clientId)

Return an Iterator over the FacesMessages that have been queued that are associated with the specified client identifier (if clientId is not null), or over the FacesMessages that have been queued that are not associated with any specific client identifier (if clientId is null). If no such messages have been queued, return an empty Iterator. The elements of the Iterator must be returned in the order in which they were added with calls to addMessage(java.lang.String, javax.faces.application.FacesMessage).

Parameters:
clientId - The client identifier for which messages are requested, or null for messages not associated with any client identifier
Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public RenderKit getRenderKit()

返回在我们的 UIViewRoot 上指定的呈现工具包标识符的 RenderKit 实例（如果有）。如果没有当前的 UIViewRoot，或者 UIViewRoot 没有指定的 renderKitId，或者指定的标识符没有 RenderKit，则返回 null。

英文文档：

getRenderKit

public abstract RenderKit getRenderKit()

Return the RenderKit instance for the render kit identifier specified on our UIViewRoot, if there is one. If there is no current UIViewRoot, if the UIViewRoot does not have a specified renderKitId, or if there is no RenderKit for the specified identifier, return null instead.

abstract public boolean getRenderResponse()

如果已经对当前请求调用了 renderResponse() 方法，则返回 true。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getRenderResponse

public abstract boolean getRenderResponse()

Return true if the renderResponse() method has been called for the current request.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public boolean getResponseComplete()

如果已经对当前请求调用了 responseComplete() 方法，则返回 true。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getResponseComplete

public abstract boolean getResponseComplete()

Return true if the responseComplete() method has been called for the current request.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public ResponseStream getResponseStream()

返回应该接收组件二进制输出的 ResponseStream。在给定的响应中，组件可以使用 ResponseStream 或 ResponseWriter，但不能同时使用两者。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getResponseStream

public abstract ResponseStream getResponseStream()

Return the ResponseStream to which components should direct their binary output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public void setResponseStream(ResponseStream responseStream)

设置应该接收组件二进制输出的 ResponseStream。

responseStream | 此响应的新 ResponseStream
Throws | NullPointerException: 如果 responseStream 为 null
Throws | IllegalStateException: 如果释放此实例后调用此方法
英文文档：

setResponseStream

public abstract void setResponseStream(ResponseStream responseStream)

Set the ResponseStream to which components should direct their binary output.

Parameters:
responseStream - The new ResponseStream for this response
Throws:
NullPointerException - if responseStream is null
IllegalStateException - if this method is called after this instance has been released

abstract public ResponseWriter getResponseWriter()

返回应该接收组件基于字符的输出的 ResponseWriter。在给定的响应中，组件可以使用 ResponseStream 或 ResponseWriter，但不能同时使用两者。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getResponseWriter

public abstract ResponseWriter getResponseWriter()

Return the ResponseWriter to which components should direct their character-based output. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public void setResponseWriter(ResponseWriter responseWriter)

设置应该接收组件基于字符的输出的 ResponseWriter。

responseWriter | 此响应的新 ResponseWriter
Throws | IllegalStateException: 如果释放此实例后调用此方法
Throws | NullPointerException: 如果 responseWriter 为 null
英文文档：

setResponseWriter

public abstract void setResponseWriter(ResponseWriter responseWriter)

Set the ResponseWriter to which components should direct their character-based output.

Parameters:
responseWriter - The new ResponseWriter for this response
Throws:
IllegalStateException - if this method is called after this instance has been released
NullPointerException - if responseWriter is null

abstract public UIViewRoot getViewRoot()

返回与此请求关联的根组件。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

getViewRoot

public abstract UIViewRoot getViewRoot()

Return the root component that is associated with the this request.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public void setViewRoot(UIViewRoot root)

设置与此请求关联的根组件。此方法只能由应用程序处理程序（或处理程序调用的类）在请求处理生命周期的调用应用程序 阶段调用。

root | 新的 UIViewRoot 组件
Throws | IllegalStateException: 如果释放此实例后调用此方法
Throws | NullPointerException: 如果 root 为 null
英文文档：

setViewRoot

public abstract void setViewRoot(UIViewRoot root)

Set the root component that is associated with this request. This method can only be called by the application handler (or a class that the handler calls), and only during the Invoke Application phase of the request processing lifecycle.

Parameters:
root - The new component UIViewRoot component
Throws:
IllegalStateException - if this method is called after this instance has been released
NullPointerException - if root is null

abstract public void addMessage(String clientId, FacesMessage message)

如果 clientId 不为 null，则向与指定客户端标识符关联的消息集添加一个 javax.faces.application.FacesMessage。如果 clientId 为 null，则认为此 javax.faces.application.FacesMessage 不与任何特定组件实例关联。

clientId | 与此消息关联的客户端标识符（如果有）
message | 将添加的消息
Throws | IllegalStateException: 如果释放此实例后调用此方法
Throws | NullPointerException: 如果 message 为 null
英文文档：

addMessage

public abstract void addMessage(String clientId,
                                FacesMessage message)

Append a FacesMessage to the set of messages associated with the specified client identifier, if clientId is not null. If clientId is null, this FacesMessage is assumed to not be associated with any specific component instance.

Parameters:
clientId - The client identifier with which this message is associated (if any)
message - The message to be appended
Throws:
IllegalStateException - if this method is called after this instance has been released
NullPointerException - if message is null

abstract public void release()

释放与此 FacesContext 实例关联的所有资源。Faces 实现可以选择在关联的 FacesContextFactory 中将实例入池，以避免重复创建对象和垃圾回收。对 FacesContext 实例调用 release() 之后（直到实现回收 FacesContext 实例以便重复使用时），调用任何其他方法将导致抛出 IllegalStateException。

实现必须调用 #setCurrentInstance 并传递 null，以移除此线程和此停用的 FacesContext 实例之间的关联。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

release

public abstract void release()

Release any resources associated with this FacesContext instance. Faces implementations may choose to pool instances in the associated FacesContextFactory to avoid repeated object creation and garbage collection. After release() is called on a FacesContext instance (until the FacesContext instance has been recycled by the implementation for re-use), calling any other methods will cause an IllegalStateException to be thrown.

The implementation must call setCurrentInstance(javax.faces.context.FacesContext) passing null to remove the association between this thread and this dead FacesContext instance.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public void renderResponse()

通知 JavaServer faces 实现，完成请求处理生命周期的当前阶段后，应该立即进入呈现响应 阶段，忽略尚未执行的任何阶段。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

renderResponse

public abstract void renderResponse()

Signal the JavaServer faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet.

Throws:
IllegalStateException - if this method is called after this instance has been released

abstract public void responseComplete()

通知 JavaServer Faces 实现，已经生成了此请求的 HTTP 响应（如 HTTP 重定向），完成当前阶段后，应该立即终止请求处理生命周期。

Throws IllegalStateException: 如果释放此实例后调用此方法
英文文档：

responseComplete

public abstract void responseComplete()

Signal the JavaServer Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed.

Throws:
IllegalStateException - if this method is called after this instance has been released

public static FacesContext getCurrentInstance()

返回当前线程正在处理的请求的 FacesContext 实例（如果有）。

英文文档：

getCurrentInstance

public static FacesContext getCurrentInstance()

Return the FacesContext instance for the request that is being processed by the current thread, if any.

protected static void setCurrentInstance(FacesContext context)

设置当前线程正在处理的请求的 FacesContext 实例。

context 当前线程的 FacesContext 实例；如果此线程不再拥有 FacesContext 实例，则为 null。
英文文档：

setCurrentInstance

protected static void setCurrentInstance(FacesContext context)

Set the FacesContext instance for the request that is being processed by the current thread.

Parameters:
context - The FacesContext instance for the current thread, or null if this thread no longer has a FacesContext instance.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesContextFactory (Java EE 5)

javax.faces.context
Class FacesContextFactory

java.lang.Object
    extended by  javax.faces.context.FacesContextFactory

public abstract class FacesContextFactory
extends Object

FacesContextFactory 是一个工厂对象，它创建（如果需要）并返回新的 FacesContext 实例，这些实例已经进行了初始化，以处理指定的请求和响应对象。实现可以调用分配的 FacesContext 实例的 release() 方法将其入池并回收，而不是每次都创建新的实例。

每个利用 JavaServer Faces 的 Web 应用程序都必须有一个 FacesContextFactory 实例。可以通过可移植的方式获取此实例，只需调用：

FacesContextFactory factory = (FacesContextFactory)
FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
英文文档：

FacesContextFactory is a factory object that creates (if needed) and returns new FacesContext instances, initialized for the processing of the specified request and response objects. Implementations may take advantage of the calls to the release() method of the allocated FacesContext instances to pool and recycle them, rather than creating a new instance every time.

There must be one FacesContextFactory instance per web application that is utilizing JavaServer Faces. This instance can be acquired, in a portable manner, by calling:

   FacesContextFactory factory = (FacesContextFactory)
    FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);

Constructor Summary
FacesContextFactory()
Method Summary
abstract  FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle)
Create (if needed) and return a FacesContext instance that is initialized for the processing of the specified request and response objects, utilizing the specified Lifecycle instance, for this web application.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FacesContextFactory()
英文文档：

FacesContextFactory

public FacesContextFactory()
Method Detail

abstract public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException

利用为此 Web 应用程序指定的 Lifecycle 实例创建（如果需要）并返回一个 FacesContext 实例，该实例已经进行了初始化，以处理指定的请求和响应对象。

此方法的实现必须确保，在对该实例调用 release() 方法之前，从调用此方法的线程调用 FacesContext 的 getCurrentInstance() 方法将返回相同的 FacesContext 实例。

context | 在 servlet 环境中，与此 Web 应用程序关联的 ServletContext
request | 在 servlet 环境中，将要处理的 ServletRequest
response | 在 servlet 环境中，将要处理的 ServletResponse
lifecycle | 用来处理此请求的 Lifecycle 实例
Throws | FacesException: 如果无法为指定的参数构建 FacesContext
Throws | NullPointerException: 如果有参数为 null
英文文档：

getFacesContext

public abstract FacesContext getFacesContext(Object context,
                                             Object request,
                                             Object response,
                                             Lifecycle lifecycle)
                                      throws FacesException

Create (if needed) and return a FacesContext instance that is initialized for the processing of the specified request and response objects, utilizing the specified Lifecycle instance, for this web application.

The implementation of this method must ensure that calls to the getCurrentInstance() method of FacesContext, from the same thread that called this method, will return the same FacesContext instance until the release() method is called on that instance.

Parameters:
context - In servlet environments, the ServletContext that is associated with this web application
request - In servlet environments, the ServletRequest that is to be processed
response - In servlet environments, the ServletResponse that is to be processed
lifecycle - The Lifecycle instance being used to process this request
Throws:
FacesException - if a FacesContext cannot be constructed for the specified parameters
NullPointerException - if any of the parameters are null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseStream (Java EE 5)

javax.faces.context
Class ResponseStream

java.lang.Object
    extended by  java.io.OutputStream
        extended by  javax.faces.context.ResponseStream
All Implemented Interfaces:
Closeable, Flushable
public abstract class ResponseStream
extends OutputStream

Extends: java.io.OutputStream

ResponseStream 是一个接口，该接口描述二进制输出的底层输出机制的适配器。

英文文档：

ResponseStream is an interface describing an adapter to an underlying output mechanism for binary output.

Constructor Summary
ResponseStream()
Method Summary
Methods inherited from class java.io.OutputStream
close, flush, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ResponseStream()
英文文档：

ResponseStream

public ResponseStream()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseWriter (Java EE 5)

javax.faces.context
Class ResponseWriter

java.lang.Object
    extended by  java.io.Writer
        extended by  javax.faces.context.ResponseWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable
Direct Known Subclasses:
ResponseWriterWrapper
public abstract class ResponseWriter
extends Writer

Extends: java.io.Writer
Extended by: ResponseWriterWrapper

ResponseWriter 是一个抽象类，该类描述基于字符输出的底层输出机制的适配器。除了从 java.io.Writer 继承的低级别 write() 方法之外，此类还提供一些实用程序方法，这些方法在生成标记语言（如 HTML 和 XML）的元素和属性方面非常有用。

英文文档：

ResponseWriter is an abstract class describing an adapter to an underlying output mechanism for character-based output. In addition to the low-level write() methods inherited from java.io.Writer, this class provides utility methods that are useful in producing elements and attributes for markup languages like HTML and XML.

Field Summary
Fields inherited from class java.io.Writer
lock
Constructor Summary
ResponseWriter()
Method Summary
abstract ResponseWriter | cloneWithWriter(Writer writer) Create and return a new instance of this ResponseWriter, using the specified Writer as the output destination.
abstract void | endDocument() Write whatever text should end a response.
abstract void | endElement(String name) Write the end of an element, after closing any open element created by a call to startElement().
abstract void | flush() Flush any ouput buffered by the output method to the underlying Writer or OutputStream.
abstract String | getCharacterEncoding() Return the character encoding (such as "ISO-8859-1") for this ResponseWriter.
abstract String | getContentType() Return the content type (such as "text/html") for this ResponseWriter.
abstract void | startDocument() Write whatever text should begin a response.
abstract void | startElement(String name, UIComponent component) Write the start of an element, up to and including the element name.
abstract void | writeAttribute(String name, Object value, String property) Write an attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
abstract void | writeComment(Object comment) Write a comment containing the specified text, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
abstract void | writeText(char[] text, int off, int len) Write text from a character array, after any performing any escaping appropriate for the markup language being rendered.
abstract void | writeText(Object text, String property) Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
void | writeText(Object text, UIComponent component, String property) Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
abstract void | writeURIAttribute(String name, Object value, String property) Write a URI attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any encoding appropriate to the markup language being rendered.
Methods inherited from class java.io.Writer
append, append, append, close, write, write, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ResponseWriter()
英文文档：

ResponseWriter

public ResponseWriter()
Method Detail

abstract public String getContentType()

返回此 ResponseWriter 的内容类型（如 "text/html"）。注：这不得包括 "charset=" 后缀。

英文文档：

getContentType

public abstract String getContentType()

Return the content type (such as "text/html") for this ResponseWriter. Note: this must not include the "charset=" suffix.

abstract public String getCharacterEncoding()

返回此 ResponseWriter 的字符编码（如 "ISO-8859-1"）。有关字符编码的列表，请参见 the IANA。

英文文档：

getCharacterEncoding

public abstract String getCharacterEncoding()

Return the character encoding (such as "ISO-8859-1") for this ResponseWriter. Please see the IANA for a list of character encodings.

abstract public void flush() throws java.io.IOException

将由输出方法缓冲的任何输出刷新到底层 Writer 或 OutputStream。此方法将不刷新底层 Writer 或 OutputStream；它只清除由此 ResponseWriter 缓冲的任何值。

英文文档：

flush

public abstract void flush()
                    throws IOException

Flush any ouput buffered by the output method to the underlying Writer or OutputStream. This method will not flush the underlying Writer or OutputStream; it simply clears any values buffered by this ResponseWriter.

Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException

abstract public void startDocument() throws java.io.IOException

无论写入什么文本都应开始响应。

Throws java.io.IOException: 如果发生输入/输出错误
英文文档：

startDocument

public abstract void startDocument()
                            throws IOException

Write whatever text should begin a response.

Throws:
IOException - if an input/output error occurs

abstract public void endDocument() throws java.io.IOException

无论写入什么文本都应结束响应。如果存在调用 startElement() 创建的公开元素，则将首先关闭该元素。

Throws java.io.IOException: 如果发生输入/输出错误
英文文档：

endDocument

public abstract void endDocument()
                          throws IOException

Write whatever text should end a response. If there is an open element that has been created by a call to startElement(), that element will be closed first.

Throws:
IOException - if an input/output error occurs

abstract public void startElement(String name, UIComponent component) throws java.io.IOException

写入元素的开头部分，直到包含元素名称。调用此方法后，客户端便可以调用 writeAttribute() 或 writeURIAttribute() 方法添加属性和相应的值。后续所有对 startElement()、writeComment()、writeText()、endElement()、endDocument()、close()、flush() 或 write() 的调用将关闭开始元素（即，在结尾添加 ">" 字符）。

name | 将开始的元素名称
component | 此元素对应的 UIComponent（如果有）
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 name 为 null
英文文档：

startElement

public abstract void startElement(String name,
                                  UIComponent component)
                           throws IOException

Write the start of an element, up to and including the
 element name.  Once this method has been called, clients can
 call the writeAttribute() or
 writeURIAttribute() methods to add attributes and
 corresponding values.  The starting element will be closed
 (that is, the trailing '>' character added)
 on any subsequent call to startElement(),
 writeComment(),
 writeText(), endElement(),
 endDocument(), close(),
 flush(), or write().

Parameters:
name - Name of the element to be started
component - The UIComponent (if any) to which this element corresponds
Throws:
IOException - if an input/output error occurs
NullPointerException - if name is null

abstract public void endElement(String name) throws java.io.IOException

关闭通过调用 startElement() 创建的任何开放元素之后，写入元素的结尾。必须按照与打开顺序相反的顺序关闭元素；否则会出现错误。

name | 将结束的元素的名称。
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 name 为 null
英文文档：

endElement

public abstract void endElement(String name)
                         throws IOException

Write the end of an element, after closing any open element created by a call to startElement(). Elements must be closed in the inverse order from which they were opened; it is an error to do otherwise.

Parameters:
name - Name of the element to be ended
Throws:
IOException - if an input/output error occurs
NullPointerException - if name is null

abstract public void writeAttribute(String name, Object value, String property) throws java.io.IOException

在将该文本转换为 String（如果必要）并执行与呈现的标记语言相应的任何转义之后，写入属性名称和相应的值。此方法只能在调用 startElement() 之后、关闭开放的元素之前调用。

name | 要添加的属性名称
value | 要添加的属性值
property | 与包含元素（对应于生成的属性）关联的 UIComponent 的属性（如果有）名称
Throws | IllegalStateException: 如果在当前没有打开的元素时调用此方法
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 name 为 null
英文文档：

writeAttribute

public abstract void writeAttribute(String name,
                                    Object value,
                                    String property)
                             throws IOException

Write an attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. This method may only be called after a call to startElement(), and before the opened element has been closed.

Parameters:
name - Attribute name to be added
value - Attribute value to be added
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds
Throws:
IllegalStateException - if this method is called when there is no currently open element
IOException - if an input/output error occurs
NullPointerException - if name is null

abstract public void writeURIAttribute(String name, Object value, String property) throws java.io.IOException

在将该文本转换为 String（如果必要）并执行与呈现的标记语言相应的任何编码之后，写入 URI 属性名称和相应的值。此方法只能在调用 startElement() 之后、关闭开放的元素之前调用。

name | 要添加的属性名称
value | 要添加的属性值
property | 与包含元素（对应于生成的属性）关联的 UIComponent 的属性（如果有）名称
Throws | IllegalStateException: 如果在当前没有打开的元素时调用此方法
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 name 为 null
英文文档：

writeURIAttribute

public abstract void writeURIAttribute(String name,
                                       Object value,
                                       String property)
                                throws IOException

Write a URI attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any encoding appropriate to the markup language being rendered. This method may only be called after a call to startElement(), and before the opened element has been closed.

Parameters:
name - Attribute name to be added
value - Attribute value to be added
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds
Throws:
IllegalStateException - if this method is called when there is no currently open element
IOException - if an input/output error occurs
NullPointerException - if name is null

abstract public void writeComment(Object comment) throws java.io.IOException

在将该文本转换为 String（如果必要）并执行与呈现的标记语言相应的任何转义之后，写入包含指定文本的注释。如果存在调用 startElement() 创建的公开元素，则将首先关闭该元素。

comment | 注释的文本内容
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 comment 为 null
英文文档：

writeComment

public abstract void writeComment(Object comment)
                           throws IOException

Write a comment containing the specified text, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. If there is an open element that has been created by a call to startElement(), that element will be closed first.

Parameters:
comment - Text content of the comment
Throws:
IOException - if an input/output error occurs
NullPointerException - if comment is null

abstract public void writeText(Object text, String property) throws java.io.IOException

在转换为 String（如果必要），并执行与呈现的标记语言相应的转义之后，写入对象。如果存在调用 startElement() 创建的公开元素，则将首先关闭该元素。

text | 要写入的文本
property | 与包含元素（对应于生成的文本）关联的 UIComponent 的属性（如果有）名称
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 text 为 null
英文文档：

writeText

public abstract void writeText(Object text,
                               String property)
                        throws IOException

Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. If there is an open element that has been created by a call to startElement(), that element will be closed first.

Parameters:
text - Text to be written
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds
Throws:
IOException - if an input/output error occurs
NullPointerException - if text is null

public void writeText(Object text, UIComponent component, String property) throws java.io.IOException

在转换为 String（如果必要），并执行与呈现的标记语言相应的转义之后，写入对象。该方法等效于 #writeText(java.lang.Object,java.lang.String)，但添加了一个 component 属性，以允许自定义的 ResponseWriter 实现将组件与文本的任意部分关联。

默认的实现忽略 component 参数并接通 #writeText(java.lang.Object,java.lang.String)

text | 要写入的文本
component | 此元素对应的 UIComponent（如果有）
property | 与包含元素（对应于生成的文本）关联的 UIComponent 的属性（如果有）名称
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 text 为 null
since | 1.2
英文文档：

writeText

public void writeText(Object text,
                      UIComponent component,
                      String property)
               throws IOException

Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. This method is equivalent to writeText(java.lang.Object,java.lang.String) but adds a component property to allow custom ResponseWriter implementations to associate a component with an arbitrary portion of text.

The default implementation simply ignores the component argument and calls through to writeText(java.lang.Object,java.lang.String)

Parameters:
text - Text to be written
component - The UIComponent (if any) to which this element corresponds
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds
Throws:
IOException - if an input/output error occurs
NullPointerException - if text is null
Since:
1.2

abstract public void writeText(char[] text, int off, int len) throws java.io.IOException

执行呈现的标记语言相应的任何转义之后，从字符数组中写入文本。如果存在调用 startElement() 创建的公开元素，则将首先关闭该元素。

text | 要写入的文本
off | 起始偏移量（相对于 0）
len | 要写入字符的数量
Throws | IndexOutOfBoundsException: 如果计算的开始或结束位置位于字符数组的边界之外
Throws | java.io.IOException: 如果发生输入/输出错误
Throws | NullPointerException: 如果 text 为 null
英文文档：

writeText

public abstract void writeText(char[] text,
                               int off,
                               int len)
                        throws IOException

Write text from a character array, after any performing any escaping appropriate for the markup language being rendered. If there is an open element that has been created by a call to startElement(), that element will be closed first.

Parameters:
text - Text to be written
off - Starting offset (zero-relative)
len - Number of characters to be written
Throws:
IndexOutOfBoundsException - if the calculated starting or ending position is outside the bounds of the character array
IOException - if an input/output error occurs
NullPointerException - if text is null

abstract public ResponseWriter cloneWithWriter(java.io.Writer writer)

使用指定的 Writer 作为输出目标，创建并返回此 ResponseWriter 的一个新实例。

writer 作为输出目标的 Writer
英文文档：

cloneWithWriter

public abstract ResponseWriter cloneWithWriter(Writer writer)

Create and return a new instance of this ResponseWriter, using the specified Writer as the output destination.

Parameters:
writer - The Writer that is the output destination
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseWriterWrapper (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.context
Class ResponseWriterWrapper

java.lang.Object
    extended by  java.io.Writer
        extended by  javax.faces.context.ResponseWriter
            extended by  javax.faces.context.ResponseWriterWrapper
All Implemented Interfaces:
Closeable, Flushable, Appendable
public abstract class ResponseWriterWrapper
extends ResponseWriter

Extends: java.io.Writer > ResponseWriter

提供 ResponseWriter 的简单实现，可供希望向现有 ResponseWriter 实例提供特殊行为的开发人员进行子类化。所有方法的默认实现均接通包装的 ResponseWriter。

用法：扩展此类并重写 #getWrapped，以返回包装的实例。

since 1.2
英文文档：

Provides a simple implementation of ResponseWriter that can be subclassed by developers wishing to provide specialized behavior to an existing ResponseWriter instance. The default implementation of all methods is to call through to the wrapped ResponseWriter.

Usage: extend this class and override getWrapped() to return the instance we are wrapping.

Since:
1.2

Field Summary
Fields inherited from class java.io.Writer
lock
Constructor Summary
ResponseWriterWrapper()
Method Summary
 ResponseWriter cloneWithWriter(Writer writer)
The default behavior of this method is to call ResponseWriter.cloneWithWriter(java.io.Writer) on the wrapped ResponseWriter object.
 void close()
The default behavior of this method is to call Writer.close() on the wrapped ResponseWriter object.
 void endDocument()
The default behavior of this method is to call ResponseWriter.endDocument() on the wrapped ResponseWriter object.
 void endElement(String name)
The default behavior of this method is to call ResponseWriter.endElement(String) on the wrapped ResponseWriter object.
 void flush()
The default behavior of this method is to call ResponseWriter.flush() on the wrapped ResponseWriter object.
 String getCharacterEncoding()
The default behavior of this method is to call ResponseWriter.getCharacterEncoding() on the wrapped ResponseWriter object.
 String getContentType()
The default behavior of this method is to call ResponseWriter.getContentType() on the wrapped ResponseWriter object.
protected abstract  ResponseWriter getWrapped()
 void startDocument()
The default behavior of this method is to call ResponseWriter.startDocument() on the wrapped ResponseWriter object.
 void startElement(String name, UIComponent component)
The default behavior of this method is to call ResponseWriter.startElement(String, javax.faces.component.UIComponent) on the wrapped ResponseWriter object.
 void write(char[] cbuf, int off, int len)
The default behavior of this method is to call Writer.write(char[], int, int) on the wrapped ResponseWriter object.
 void writeAttribute(String name, Object value, String property)
The default behavior of this method is to call ResponseWriter.writeAttribute(String, Object, String) on the wrapped ResponseWriter object.
 void writeComment(Object comment)
The default behavior of this method is to call ResponseWriter.writeComment(Object) on the wrapped ResponseWriter object.
 void writeText(char[] text, int off, int len)
The default behavior of this method is to call ResponseWriter.writeText(char[], int, int) on the wrapped ResponseWriter object.
 void writeText(Object text, String property)
The default behavior of this method is to call ResponseWriter.writeText(Object, String) on the wrapped ResponseWriter object.
 void writeText(Object text, UIComponent component, String property)
The default behavior of this method is to call ResponseWriter.writeText(Object, UIComponent, String) on the wrapped ResponseWriter object.
 void writeURIAttribute(String name, Object value, String property)
The default behavior of this method is to call ResponseWriter.writeURIAttribute(String, Object, String) on the wrapped ResponseWriter object.
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ResponseWriterWrapper()
英文文档：

ResponseWriterWrapper

public ResponseWriterWrapper()
Method Detail

abstract protected ResponseWriter getWrapped()
return 正在包装的实例。
英文文档：

getWrapped

protected abstract ResponseWriter getWrapped()
Returns:
the instance that we are wrapping.

public String getContentType()

此方法的默认行为是对包装的 ResponseWriter 对象调用 getContentType()。

since | 1.2
See also | getContentType()
英文文档：

getContentType

public String getContentType()

The default behavior of this method is to call ResponseWriter.getContentType() on the wrapped ResponseWriter object.

Specified by:
getContentType in class ResponseWriter
Since:
1.2
See Also:
ResponseWriter.getContentType()

public String getCharacterEncoding()

此方法的默认行为是对包装的 ResponseWriter 对象调用 getCharacterEncoding()。

since | 1.2
See also | getCharacterEncoding()
英文文档：

getCharacterEncoding

public String getCharacterEncoding()

The default behavior of this method is to call ResponseWriter.getCharacterEncoding() on the wrapped ResponseWriter object.

Specified by:
getCharacterEncoding in class ResponseWriter
Since:
1.2
See Also:
ResponseWriter.getCharacterEncoding()

public void flush() throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 flush()。

since | 1.2
See also | flush()
英文文档：

flush

public void flush()
           throws IOException

The default behavior of this method is to call ResponseWriter.flush() on the wrapped ResponseWriter object.

Specified by:
flush in interface Flushable
Specified by:
flush in class ResponseWriter
Throws:
IOException
Since:
1.2
See Also:
ResponseWriter.flush()

public void startDocument() throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 startDocument()。

since | 1.2
See also | startDocument()
英文文档：

startDocument

public void startDocument()
                   throws IOException

The default behavior of this method is to call ResponseWriter.startDocument() on the wrapped ResponseWriter object.

Specified by:
startDocument in class ResponseWriter
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.startDocument()

public void endDocument() throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 endDocument()。

since | 1.2
See also | endDocument()
英文文档：

endDocument

public void endDocument()
                 throws IOException

The default behavior of this method is to call ResponseWriter.endDocument() on the wrapped ResponseWriter object.

Specified by:
endDocument in class ResponseWriter
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.endDocument()

public void startElement(String name, UIComponent component) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 startElement(String, javax.faces.component.UIComponent)。

since | 1.2
See also | startElement(String, javax.faces.component.UIComponent)
英文文档：

startElement

public void startElement(String name,
                         UIComponent component)
                  throws IOException

The default behavior of this method is to call ResponseWriter.startElement(String, javax.faces.component.UIComponent) on the wrapped ResponseWriter object.

Specified by:
startElement in class ResponseWriter
Parameters:
name - Name of the element to be started
component - The UIComponent (if any) to which this element corresponds
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.startElement(String, javax.faces.component.UIComponent)

public void endElement(String name) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 endElement(String)。

since | 1.2
See also | endElement(String)
英文文档：

endElement

public void endElement(String name)
                throws IOException

The default behavior of this method is to call ResponseWriter.endElement(String) on the wrapped ResponseWriter object.

Specified by:
endElement in class ResponseWriter
Parameters:
name - Name of the element to be ended
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.endElement(String)

public void writeAttribute(String name, Object value, String property) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 writeAttribute(String, Object, String)。

since | 1.2
See also | writeAttribute(String, Object, String)
英文文档：

writeAttribute

public void writeAttribute(String name,
                           Object value,
                           String property)
                    throws IOException

The default behavior of this method is to call ResponseWriter.writeAttribute(String, Object, String) on the wrapped ResponseWriter object.

Specified by:
writeAttribute in class ResponseWriter
Parameters:
name - Attribute name to be added
value - Attribute value to be added
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.writeAttribute(String, Object, String)

public void writeURIAttribute(String name, Object value, String property) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 writeURIAttribute(String, Object, String)。

since | 1.2
See also | writeURIAttribute(String, Object, String)
英文文档：

writeURIAttribute

public void writeURIAttribute(String name,
                              Object value,
                              String property)
                       throws IOException

The default behavior of this method is to call ResponseWriter.writeURIAttribute(String, Object, String) on the wrapped ResponseWriter object.

Specified by:
writeURIAttribute in class ResponseWriter
Parameters:
name - Attribute name to be added
value - Attribute value to be added
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.writeURIAttribute(String, Object, String)

public void writeComment(Object comment) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 writeComment(Object)。

since | 1.2
See also | writeComment(Object)
英文文档：

writeComment

public void writeComment(Object comment)
                  throws IOException

The default behavior of this method is to call ResponseWriter.writeComment(Object) on the wrapped ResponseWriter object.

Specified by:
writeComment in class ResponseWriter
Parameters:
comment - Text content of the comment
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.writeComment(Object)

public void writeText(Object text, String property) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 writeText(Object, String)。

since | 1.2
See also | writeText(Object, String)
英文文档：

writeText

public void writeText(Object text,
                      String property)
               throws IOException

The default behavior of this method is to call ResponseWriter.writeText(Object, String) on the wrapped ResponseWriter object.

Specified by:
writeText in class ResponseWriter
Parameters:
text - Text to be written
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.writeText(Object, String)

public void writeText(Object text, UIComponent component, String property) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 writeText(Object, UIComponent, String)。

since | 1.2
See also | writeText(Object, String)
英文文档：

writeText

public void writeText(Object text,
                      UIComponent component,
                      String property)
               throws IOException

The default behavior of this method is to call ResponseWriter.writeText(Object, UIComponent, String) on the wrapped ResponseWriter object.

Overrides:
writeText in class ResponseWriter
Parameters:
text - Text to be written
component - The UIComponent (if any) to which this element corresponds
property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.writeText(Object, String)

public void writeText(char[] text, int off, int len) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 writeText(char[], int, int)。

since | 1.2
See also | writeText(char[], int, int)
英文文档：

writeText

public void writeText(char[] text,
                      int off,
                      int len)
               throws IOException

The default behavior of this method is to call ResponseWriter.writeText(char[], int, int) on the wrapped ResponseWriter object.

Specified by:
writeText in class ResponseWriter
Parameters:
text - Text to be written
off - Starting offset (zero-relative)
len - Number of characters to be written
Throws:
IOException - if an input/output error occurs
Since:
1.2
See Also:
ResponseWriter.writeText(char[], int, int)

public ResponseWriter cloneWithWriter(java.io.Writer writer)

此方法的默认行为是对包装的 ResponseWriter 对象调用 cloneWithWriter(java.io.Writer)。

since | 1.2
See also | cloneWithWriter(java.io.Writer)
英文文档：

cloneWithWriter

public ResponseWriter cloneWithWriter(Writer writer)

The default behavior of this method is to call ResponseWriter.cloneWithWriter(java.io.Writer) on the wrapped ResponseWriter object.

Specified by:
cloneWithWriter in class ResponseWriter
Parameters:
writer - The Writer that is the output destination
Since:
1.2
See Also:
ResponseWriter.cloneWithWriter(java.io.Writer)

public void close() throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 close()。

since | 1.2
See also | close()
英文文档：

close

public void close()
           throws IOException

The default behavior of this method is to call Writer.close() on the wrapped ResponseWriter object.

Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException
Since:
1.2
See Also:
Writer.close()

public void write(char[] cbuf, int off, int len) throws java.io.IOException

此方法的默认行为是对包装的 ResponseWriter 对象调用 write(char[], int, int)。

since | 1.2
See also | write(char[], int, int)
英文文档：

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException

The default behavior of this method is to call Writer.write(char[], int, int) on the wrapped ResponseWriter object.

Specified by:
write in class Writer
Throws:
IOException
Since:
1.2
See Also:
Writer.write(char[], int, int)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.convert (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.convert

Contains classes and interfaces defining converters.

See:
Description

Interface Summary
Converter Converter is an interface describing a Java class that can perform Object-to-String and String-to-Object conversions between model data objects and a String representation of those objects that is suitable for rendering.

Class Summary
BigDecimalConverter | Converter implementation for java.math.BigDecimal values.
BigIntegerConverter | Converter implementation for java.math.BigInteger values.
BooleanConverter | Converter implementation for java.lang.Boolean (and boolean primitive) values.
ByteConverter | Converter implementation for java.lang.Byte (and byte primitive) values.
CharacterConverter | Converter implementation for java.lang.Character (and char primitive) values.
DateTimeConverter | Converter implementation for java.util.Date values.
DoubleConverter | Converter implementation for java.lang.Double (and double primitive) values.
EnumConverter | Converter implementation for java.lang.Enum (and enum primitive) values.
FloatConverter | Converter implementation for java.lang.Float (and float primitive) values.
IntegerConverter | Converter implementation for java.lang.Integer (and int primitive) values.
LongConverter | Converter implementation for java.lang.Long (and long primitive) values.
NumberConverter | Converter implementation for java.lang.Number values.
ShortConverter | Converter implementation for java.lang.Short (and short primitive) values.

Exception Summary
ConverterException ConverterException is an exception thrown by the getAsObject() or getAsText() method of a Converter, to indicate that the requested conversion cannot be performed.

Package javax.faces.convert Description

Contains classes and interfaces defining converters. The main class in this package is Converter.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.convert Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.convert

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.convert.BigDecimalConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.BigIntegerConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.BooleanConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.ByteConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.CharacterConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.DateTimeConverter (implements javax.faces.convert.Converter, javax.faces.component.StateHolder)
    • javax.faces.convert.DoubleConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.EnumConverter (implements javax.faces.convert.Converter, javax.faces.component.StateHolder)
    • javax.faces.convert.FloatConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.IntegerConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.LongConverter (implements javax.faces.convert.Converter)
    • javax.faces.convert.NumberConverter (implements javax.faces.convert.Converter, javax.faces.component.StateHolder)
    • javax.faces.convert.ShortConverter (implements javax.faces.convert.Converter)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.faces.FacesException
            • javax.faces.convert.ConverterException

Interface Hierarchy

  • javax.faces.convert.Converter
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Converter (Java EE 5)

javax.faces.convert
Interface Converter

All Known Implementing Classes:
BigDecimalConverter, BigIntegerConverter, BooleanConverter, ByteConverter, CharacterConverter, DateTimeConverter, DoubleConverter, EnumConverter, FloatConverter, IntegerConverter, LongConverter, NumberConverter, ShortConverter
public interface Converter

Implemented by: BigDecimalConverter, BigIntegerConverter, BooleanConverter, ByteConverter, CharacterConverter, DateTimeConverter, DoubleConverter, EnumConverter, FloatConverter, IntegerConverter, LongConverter, NumberConverter, ShortConverter

Converter 是一个接口，它描述可以在模型数据对象及其适合于呈现的 String 表示形式之间执行 Object-to-String 和 String-to-Object 转换的 Java 类。

Converter 实现必须拥有一个公共的无参数构造方法。此外，如果 Converter 类希望保存配置属性值并用组件树恢复，则该实现还必须实现 StateHolder。

从 1.2 版本的规范开始，上述无参数构造方法要求引入了一种例外情况。如果转换器具有一个用 Class 实例作为参数的单参数构造方法，并且要转换数据的 Class 在转换器实例化时已知，则必须使用此构造方法来实例化转换器，而不是使用无参数的构造方法。这样便可对 Java 枚举类型进行按类转换。

如果某个 Converter 实现需要 java.util.Locale 实现其功能，则它必须包含取自当前 FacesContext 的 javax.faces.component.UIViewRoot 的 Locale，除非 Converter 保留其自己的 Locale 作为其状态的一部分。

英文文档：

Converter is an interface describing a Java class that can perform Object-to-String and String-to-Object conversions between model data objects and a String representation of those objects that is suitable for rendering.

Converter implementations must have a zero-arguments public constructor. In addition, if the Converter class wishes to have configuration property values saved and restored with the component tree, the implementation must also implement StateHolder.

Starting with version 1.2 of the specification, an exception to the above zero-arguments constructor requirement has been introduced. If a converter has a single argument constructor that takes a Class instance and the Class of the data to be converted is known at converter instantiation time, this constructor must be used to instantiate the converter instead of the zero-argument version. This enables the per-class conversion of Java enumerated types.

If any Converter implementation requires a java.util.Locale to perform its job, it must obtain that Locale from the UIViewRoot of the current FacesContext, unless the Converter maintains its own Locale as part of its state.

Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)

将指定的字符串值（与指定的 UIComponent 关联）转换为适合于在请求处理生命周期的应用请求值 阶段存储的模型数据对象。

context | 要处理的请求的 FacesContext
component | 与此模型对象值关联的 UIComponent
value | 要转换的 String 值（可以为 null）
return | 如果要转换的值为 null，则返回 null；否则返回转换的结果
Throws | ConverterException: 如果无法成功执行转换
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

getAsObject

Object getAsObject(FacesContext context,
                   UIComponent component,
                   String value)

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)

将指定的模型对象值（与指定的 UIComponent 关联）转换为适合包含于请求处理生命周期的呈现响应 阶段所生成的响应的字符串。

context | 要处理的请求的 FacesContext
component | 与此模型对象值关联的 UIComponent
value | 要转换的模型对象值（可以为 null）
return | 如果值为 null，则返回长度为 0 String；否则返回转换的结果
Throws | ConverterException: 如果无法成功执行转换
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

getAsString

String getAsString(FacesContext context,
                   UIComponent component,
                   Object value)

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BigDecimalConverter (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.convert
Class BigDecimalConverter

java.lang.Object
    extended by  javax.faces.convert.BigDecimalConverter
All Implemented Interfaces:
Converter
public class BigDecimalConverter
extends Object
implements Converter

Implements: Converter

java.math.BigDecimal 值的 Converter 实现。

英文文档：

Converter implementation for java.math.BigDecimal values.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | DECIMAL_ID The message identifier of the FacesMessage to be created if the conversion to BigDecimal fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the BigDecimal value to String fails.
Constructor Summary
BigDecimalConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

DECIMAL_ID

public static final String DECIMAL_ID

The message identifier of the FacesMessage to be created if the conversion to BigDecimal fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the BigDecimal value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public BigDecimalConverter()
英文文档：

BigDecimalConverter

public BigDecimalConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BigIntegerConverter (Java EE 5)

javax.faces.convert
Class BigIntegerConverter

java.lang.Object
    extended by  javax.faces.convert.BigIntegerConverter
All Implemented Interfaces:
Converter
public class BigIntegerConverter
extends Object
implements Converter

Implements: Converter

java.math.BigInteger 值的 Converter 实现。

英文文档：

Converter implementation for java.math.BigInteger values.

Field Summary
static String | BIGINTEGER_ID The message identifier of the FacesMessage to be created if the conversion to BigInteger fails.
static String | CONVERTER_ID The standard converter id for this converter.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the BigInteger value to String fails.
Constructor Summary
BigIntegerConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

BIGINTEGER_ID

public static final String BIGINTEGER_ID

The message identifier of the FacesMessage to be created if the conversion to BigInteger fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the BigInteger value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public BigIntegerConverter()
英文文档：

BigIntegerConverter

public BigIntegerConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BooleanConverter (Java EE 5)

javax.faces.convert
Class BooleanConverter

java.lang.Object
    extended by  javax.faces.convert.BooleanConverter
All Implemented Interfaces:
Converter
public class BooleanConverter
extends Object
implements Converter

Implements: Converter

java.lang.Boolean（以及 boolean 基本类型）值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Boolean (and boolean primitive) values.

Field Summary
static String | BOOLEAN_ID The message identifier of the FacesMessage to be created if the conversion to Boolean fails.
static String | CONVERTER_ID The standard converter id for this converter.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Boolean value to String fails.
Constructor Summary
BooleanConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

BOOLEAN_ID

public static final String BOOLEAN_ID

The message identifier of the FacesMessage to be created if the conversion to Boolean fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Boolean value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public BooleanConverter()
英文文档：

BooleanConverter

public BooleanConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ByteConverter (Java EE 5)

javax.faces.convert
Class ByteConverter

java.lang.Object
    extended by  javax.faces.convert.ByteConverter
All Implemented Interfaces:
Converter
public class ByteConverter
extends Object
implements Converter

Implements: Converter

java.lang.Byte（以及 byte 基本类型）值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Byte (and byte primitive) values.

Field Summary
static String | BYTE_ID The message identifier of the FacesMessage to be created if the conversion to Byte fails.
static String | CONVERTER_ID The standard converter id for this converter.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Byte value to String fails.
Constructor Summary
ByteConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

BYTE_ID

public static final String BYTE_ID

The message identifier of the FacesMessage to be created if the conversion to Byte fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Byte value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public ByteConverter()
英文文档：

ByteConverter

public ByteConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CharacterConverter (Java EE 5)

javax.faces.convert
Class CharacterConverter

java.lang.Object
    extended by  javax.faces.convert.CharacterConverter
All Implemented Interfaces:
Converter
public class CharacterConverter
extends Object
implements Converter

Implements: Converter

java.lang.Character（以及 char 基本类型）值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Character (and char primitive) values.

Field Summary
static String | CHARACTER_ID The message identifier of the FacesMessage to be created if the conversion to Character fails.
static String | CONVERTER_ID The standard converter id for this converter.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Character value to String fails.
Constructor Summary
CharacterConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

CHARACTER_ID

public static final String CHARACTER_ID

The message identifier of the FacesMessage to be created if the conversion to Character fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Character value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public CharacterConverter()
英文文档：

CharacterConverter

public CharacterConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DateTimeConverter (Java EE 5)

javax.faces.convert
Class DateTimeConverter

java.lang.Object
    extended by  javax.faces.convert.DateTimeConverter
All Implemented Interfaces:
StateHolder, Converter
public class DateTimeConverter
extends Object
implements Converter, StateHolder

Implements: Converter, StateHolder

java.util.Date 值的 Converter 实现。

getAsObject() 方法根据以下算法将 String 解析为 java.util.Date：

  • 如果指定的 String 为 null，则返回 null。否则，在继续处理前去除前导空格和尾部的空格。
  • 如果指定的 String（去除空格后）长度为 0，则返回 null。
  • 如果 locale 属性不为 null，则使用该 Locale 管理解析。否则，使用 UIViewRoot 的 Locale。
  • 如果指定了 pattern，则其语法必须遵守 java.text.SimpleDateFormat 指定的规则。此类模式将用于解析，并且将忽略 type、dateStyle 和 timeStyle 属性。
  • 如果尚未指定 pattern，则将根据 type 属性进行解析，它应该为日期值或时间值，或者同时包含两者。将根据 dateStyle 和 timeStyle 指定的样式分别对包含的任何日期和时间值进行解析。
  • 如果指定了 timezone，则它必须传递给底层 DateFormat 实例。否则，使用 "GMT" 时区。
  • 无论是哪种情况，解析必须严格；给定的字符串必须严格遵守解析格式。

getAsString() 方法应该获取类型为 java.util.Date（或子类）的值，并根据以下算法创建格式化 String：

  • 如果指定的值为 null，则返回长度为 0 的 String。
  • 如果指定的值为 String，则不加修改地返回该值。
  • 如果 locale 属性不为 null，则使用该 Locale 管理格式化。否则，使用 UIViewRoot 的 Locale。
  • 如果指定了 timezone，则它必须传递给底层 DateFormat 实例。否则，使用 "GMT" 时区。
  • 如果指定了 pattern，则其语法必须遵守 java.text.SimpleDateFormat 指定的规则。此类模式将用于格式化，并且将忽略 type、dateStyle 和 timeStyle 属性。
  • 如果尚未指定 pattern，则将根据 type 属性进行格式化，这将在格式化的 String 中包含日期值或时间值，或者同时包含两者。将根据 dateStyle 和 timeStyle 指定的样式分别对包含的任何日期和时间值进行格式化。
英文文档：

Converter implementation for java.util.Date values.

The getAsObject() method parses a String into a java.util.Date, according to the following algorithm:

  • If the specified String is null, return a null. Otherwise, trim leading and trailing whitespace before proceeding.
  • If the specified String - after trimming - has a zero length, return null.
  • If the locale property is not null, use that Locale for managing parsing. Otherwise, use the Locale from the UIViewRoot.
  • If a pattern has been specified, its syntax must conform the rules specified by java.text.SimpleDateFormat. Such a pattern will be used to parse, and the type, dateStyle, and timeStyle properties will be ignored.
  • If a pattern has not been specified, parsing will be based on the type property, which expects a date value, a time value, or both. Any date and time values included will be parsed in accordance to the styles specified by dateStyle and timeStyle, respectively.
  • If a timezone has been specified, it must be passed to the underlying DateFormat instance. Otherwise the "GMT" timezone is used.
  • In all cases, parsing must be non-lenient; the given string must strictly adhere to the parsing format.

The getAsString() method expects a value of type java.util.Date (or a subclass), and creates a formatted String according to the following algorithm:

  • If the specified value is null, return a zero-length String.
  • If the specified value is a String, return it unmodified.
  • If the locale property is not null, use that Locale for managing formatting. Otherwise, use the Locale from the UIViewRoot.
  • If a timezone has been specified, it must be passed to the underlying DateFormat instance. Otherwise the "GMT" timezone is used.
  • If a pattern has been specified, its syntax must conform the rules specified by java.text.SimpleDateFormat. Such a pattern will be used to format, and the type, dateStyle, and timeStyle properties will be ignored.
  • If a pattern has not been specified, formatting will be based on the type property, which includes a date value, a time value, or both into the formatted String. Any date and time values included will be formatted in accordance to the styles specified by dateStyle and timeStyle, respectively.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | DATE_ID The message identifier of the FacesMessage to be created if the conversion to Date fails.
static String | DATETIME_ID The message identifier of the FacesMessage to be created if the conversion to DateTime fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the DateTime value to String fails.
static String | TIME_ID The message identifier of the FacesMessage to be created if the conversion to Time fails.
Constructor Summary
DateTimeConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
String | getDateStyle() Return the style to be used to format or parse dates.
Locale | getLocale() Return the Locale to be used when parsing or formatting dates and times.
String | getPattern() Return the format pattern to be used when formatting and parsing dates and times.
String | getTimeStyle() Return the style to be used to format or parse times.
TimeZone | getTimeZone() Return the TimeZone used to interpret a time value.
String | getType() Return the type of value to be formatted or parsed.
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setDateStyle(String dateStyle) Set the style to be used to format or parse dates.
void | setLocale(Locale locale) Set the Locale to be used when parsing or formatting dates and times.
void | setPattern(String pattern) Set the format pattern to be used when formatting and parsing dates and times.
void | setTimeStyle(String timeStyle) Set the style to be used to format or parse times.
void | setTimeZone(TimeZone timeZone) Set the TimeZone used to interpret a time value.
void | setTransient(boolean transientFlag) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
void | setType(String type) Set the type of value to be formatted or parsed.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

DATE_ID

public static final String DATE_ID

The message identifier of the FacesMessage to be created if the conversion to Date fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

TIME_ID

public static final String TIME_ID

The message identifier of the FacesMessage to be created if the conversion to Time fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

DATETIME_ID

public static final String DATETIME_ID

The message identifier of the FacesMessage to be created if the conversion to DateTime fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the DateTime value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public DateTimeConverter()
英文文档：

DateTimeConverter

public DateTimeConverter()
Method Detail

public String getDateStyle()

返回将用于格式化或解析日期的样式。如果未设置，则返回默认值 default。

英文文档：

getDateStyle

public String getDateStyle()

Return the style to be used to format or parse dates. If not set, the default value, default, is returned.

public void setDateStyle(String dateStyle)

设置将用于格式化或解析日期的样式。有效值有 default、short、medium、long 和 full。当调用 getAsObject() 或 getAsString() 时，无效值将导致 ConverterException。

dateStyle 新样式代码
英文文档：

setDateStyle

public void setDateStyle(String dateStyle)

Set the style to be used to format or parse dates. Valid values are default, short, medium, long, and full. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

Parameters:
dateStyle - The new style code

public java.util.Locale getLocale()

返回将在解析或格式化日期和时间时使用的 Locale。如果没有明确设置，则返回存储在当前请求的 javax.faces.component.UIViewRoot 中的 Locale。

英文文档：

getLocale

public Locale getLocale()

Return the Locale to be used when parsing or formatting dates and times. If not explicitly set, the Locale stored in the UIViewRoot for the current request is returned.

public void setLocale(java.util.Locale locale)

设置将在解析或格式化日期和时间时使用的 Locale。如果设置为 null，则将使用存储在当前请求的 javax.faces.component.UIViewRoot 中的 Locale。

locale 新的 Locale（或者 null）。
英文文档：

setLocale

public void setLocale(Locale locale)

Set the Locale to be used when parsing or formatting dates and times. If set to null, the Locale stored in the UIViewRoot for the current request will be utilized.

Parameters:
locale - The new Locale (or null)

public String getPattern()

返回将在格式化和解析日期和时间时使用的格式模式。

英文文档：

getPattern

public String getPattern()

Return the format pattern to be used when formatting and parsing dates and times.

public void setPattern(String pattern)

设置将在格式化和解析日期和时间时使用的格式模式。有效值是 java.text.SimpleDateFormat 支持的那些值。当调用 getAsObject() 或 getAsString() 时，无效值将导致 ConverterException。

pattern 新的格式模式
英文文档：

setPattern

public void setPattern(String pattern)

Set the format pattern to be used when formatting and parsing dates and times. Valid values are those supported by java.text.SimpleDateFormat. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

Parameters:
pattern - The new format pattern

public String getTimeStyle()

返回将用于格式化或解析时间的样式。如果未设置，则返回默认值 default。

英文文档：

getTimeStyle

public String getTimeStyle()

Return the style to be used to format or parse times. If not set, the default value, default, is returned.

public void setTimeStyle(String timeStyle)

设置将用于格式化或解析时间的样式。有效值有 default、short、medium、long 和 full。当调用 getAsObject() 或 getAsString() 时，无效值将导致 ConverterException。

timeStyle 新样式代码
英文文档：

setTimeStyle

public void setTimeStyle(String timeStyle)

Set the style to be used to format or parse times. Valid values are default, short, medium, long, and full. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

Parameters:
timeStyle - The new style code

public java.util.TimeZone getTimeZone()

返回用来解释时间值的 TimeZone。如果没有明确设置，则返回默认时区 GMT。

英文文档：

getTimeZone

public TimeZone getTimeZone()

Return the TimeZone used to interpret a time value. If not explicitly set, the default time zone of GMT returned.

public void setTimeZone(java.util.TimeZone timeZone)

设置用来解释时间值的 TimeZone。

timeZone 新时区
英文文档：

setTimeZone

public void setTimeZone(TimeZone timeZone)

Set the TimeZone used to interpret a time value.

Parameters:
timeZone - The new time zone

public String getType()

返回要格式化或解析的值的类型。如果没有明确设置，则返回默认类型 date。

英文文档：

getType

public String getType()

Return the type of value to be formatted or parsed. If not explicitly set, the default type, date is returned.

public void setType(String type)

设置要格式化或解析的值的类型。有效值为 both、date 或 time。当调用 getAsObject() 或 getAsString() 时，无效值将导致 ConverterException。

type 新日期样式
英文文档：

setType

public void setType(String type)

Set the type of value to be formatted or parsed. Valid values are both, date, or time. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

Parameters:
type - The new date style

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean transientFlag)
英文文档：

setTransient

public void setTransient(boolean transientFlag)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
transientFlag - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


DoubleConverter (Java EE 5)

javax.faces.convert
Class DoubleConverter

java.lang.Object
    extended by  javax.faces.convert.DoubleConverter
All Implemented Interfaces:
Converter
public class DoubleConverter
extends Object
implements Converter

Implements: Converter

java.lang.Double（以及 double 基本类型）值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Double (and double primitive) values.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | DOUBLE_ID The message identifier of the FacesMessage to be created if the conversion to Double fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Double value to String fails.
Constructor Summary
DoubleConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

DOUBLE_ID

public static final String DOUBLE_ID

The message identifier of the FacesMessage to be created if the conversion to Double fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Double value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public DoubleConverter()
英文文档：

DoubleConverter

public DoubleConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EnumConverter (Java EE 5)

javax.faces.convert
Class EnumConverter

java.lang.Object
    extended by  javax.faces.convert.EnumConverter
All Implemented Interfaces:
StateHolder, Converter
public class EnumConverter
extends Object
implements Converter, StateHolder

Implements: Converter, StateHolder

java.lang.Enum（以及 enum 基本类型）值的 Converter 实现。

since 1.2
英文文档：

Converter implementation for java.lang.Enum (and enum primitive) values.

Since:
1.2

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | ENUM_ID The message identifier of the FacesMessage to be created if the conversion to Enum fails.
static String | ENUM_NO_CLASS_ID The message identifier of the FacesMessage to be created if the conversion to Enum fails and no target class has been provided.
Constructor Summary
EnumConverter()
EnumConverter(Class targetClass)
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the value argument to one of the enum constants of the class provided in our constructor.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the enum constant given by the value argument into a String.
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | restoreState(FacesContext facesContext, Object object) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext facesContext) Gets the state of the instance as a Serializable Object.
void | setTransient(boolean b) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

ENUM_ID

public static final String ENUM_ID

The message identifier of the FacesMessage to be created if the conversion to Enum fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by one of the enum constants or the empty string if none can be found.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

ENUM_NO_CLASS_ID

public static final String ENUM_NO_CLASS_ID

The message identifier of the FacesMessage to be created if the conversion to Enum fails and no target class has been provided. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public EnumConverter()
英文文档：

EnumConverter

public EnumConverter()

public EnumConverter(Class<T> targetClass)
英文文档：

EnumConverter

public EnumConverter(Class targetClass)
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)

将 value 参数转换为在构造方法中提供的类枚举常量之一。如果没有向此实例的构造方法提供任何目标类参数，则抛出包含 #ENUM_NO_CLASS_ID 消息和相应参数的 ConverterException。如果 value 参数为 null 或它的长度为 0，则返回 null。否则，使用目标类和 value 执行等效的 Enum.valueOf 并返回 Object。如果转换失败，则抛出一个 ConverterException，它包含 #ENUM_ID 消息和相应的参数。

context | 此请求的 FacesContext。
component | 将应用此值的 UIComponent。
value | 要转换为 Object 的 String value。
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)

Convert the value argument to one of the enum constants of the class provided in our constructor. If no target class argument has been provided to the constructor of this instance, throw a ConverterException containing the ENUM_NO_CLASS_ID message with proper parameters. If the value argument is null or it has a length of zero, return null. Otherwise, perform the equivalent of Enum.valueOf using target class and value and return the Object. If the conversion fails, throw a ConverterException containing the ENUM_ID message with proper parameters.

Specified by:
getAsObject in interface Converter
Parameters:
context - the FacesContext for this request.
component - the UIComponent to which this value will be applied.
value - the String value to be converted to Object.
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)

将由 value 参数给定的枚举常量转换为 String。如果没有向此实例的构造方法提供任何目标类参数，则抛出包含 #ENUM_NO_CLASS_ID 消息和相应参数的 ConverterException。如果 value 参数为 null，则返回 null。如果该值为提供的目标类的实例，则返回它的字符串值 (value.toString())。否则，抛出一个 ConverterException，它包含 #ENUM_ID 消息和相应的参数。

Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)

Convert the enum constant given by the value argument into a String. If no target class argument has been provided to the constructor of this instance, throw a ConverterException containing the ENUM_NO_CLASS_ID message with proper parameters. If the value,/code> argument is null, return null. If the value is an instance of the provided target class, return its string value (value.toString()). Otherwise, throw a ConverterException containing the ENUM_ID message with proper parameters.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public void restoreState(FacesContext facesContext, Object object)
英文文档：

restoreState

public void restoreState(FacesContext facesContext,
                         Object object)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public Object saveState(FacesContext facesContext)
英文文档：

saveState

public Object saveState(FacesContext facesContext)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void setTransient(boolean b)
英文文档：

setTransient

public void setTransient(boolean b)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
b - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


FloatConverter (Java EE 5)

javax.faces.convert
Class FloatConverter

java.lang.Object
    extended by  javax.faces.convert.FloatConverter
All Implemented Interfaces:
Converter
public class FloatConverter
extends Object
implements Converter

Implements: Converter

java.lang.Float（以及 float 基本类型）值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Float (and float primitive) values.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | FLOAT_ID The message identifier of the FacesMessage to be created if the conversion to Float fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Float value to String fails.
Constructor Summary
FloatConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

FLOAT_ID

public static final String FLOAT_ID

The message identifier of the FacesMessage to be created if the conversion to Float fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Float value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public FloatConverter()
英文文档：

FloatConverter

public FloatConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntegerConverter (Java EE 5)

javax.faces.convert
Class IntegerConverter

java.lang.Object
    extended by  javax.faces.convert.IntegerConverter
All Implemented Interfaces:
Converter
public class IntegerConverter
extends Object
implements Converter

Implements: Converter

java.lang.Integer（以及 int 基本类型）值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Integer (and int primitive) values.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | INTEGER_ID The message identifier of the FacesMessage to be created if the conversion to Integer fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Integer value to String fails.
Constructor Summary
IntegerConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

INTEGER_ID

public static final String INTEGER_ID

The message identifier of the FacesMessage to be created if the conversion to Integer fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Integer value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public IntegerConverter()
英文文档：

IntegerConverter

public IntegerConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LongConverter (Java EE 5)

javax.faces.convert
Class LongConverter

java.lang.Object
    extended by  javax.faces.convert.LongConverter
All Implemented Interfaces:
Converter
public class LongConverter
extends Object
implements Converter

Implements: Converter

java.lang.Long（以及 long 基本类型）值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Long (and long primitive) values.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | LONG_ID The message identifier of the FacesMessage to be created if the conversion to Long fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Long value to String fails.
Constructor Summary
LongConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

LONG_ID

public static final String LONG_ID

The message identifier of the FacesMessage to be created if the conversion to Long fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Long value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public LongConverter()
英文文档：

LongConverter

public LongConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NumberConverter (Java EE 5)

javax.faces.convert
Class NumberConverter

java.lang.Object
    extended by  javax.faces.convert.NumberConverter
All Implemented Interfaces:
StateHolder, Converter
public class NumberConverter
extends Object
implements Converter, StateHolder

Implements: Converter, StateHolder

java.lang.Number 值的 Converter 实现。

getAsObject() 方法根据以下算法将 String 解析为 java.lang.Double 或 java.lang.Long：

  • 如果指定的 String 为 null，则返回 null。否则，在继续执行前去除前导空格和尾部的空格。
  • 如果指定的 String（去除空格后）长度为 0，则返回 null。
  • 如果 locale 属性不为 null，则使用该 Locale 管理解析。否则，使用 UIViewRoot 的 Locale。
  • 如果指定了 pattern，则其语法必须遵守 java.text.DecimalFormat 指定的规则。此类模式将用于解析，并且将忽略 type 属性。
  • 如果尚未指定 pattern，则将根据 type 属性进行解析，它应该为货币、数字或百分比。通过调用 java.text.NumberFormat 类的 getCurrencyInstance()、getNumberInstance() 或 getPercentInstance() 方法，并传入选择的 Locale，可以分别确定货币、数字和百分比的解析模式。
  • 如果 integerOnly 属性设置为 true，则将仅解析 String 的整数部分。有关详细信息，请参见 java.text.NumberFormat 类的 setParseIntegerOnly() 方法的 JavaDoc。

getAsString() 方法应该获取类型为 java.lang.Number（或子类）的值，并根据以下算法创建格式化 String：

  • 如果指定的值为 null，则返回长度为 0 的 String。
  • 如果指定的值为 String，则不加修改地返回该值。
  • 如果 locale 属性不为 null，则使用该 Locale 管理格式化。否则，使用 FacesContext 中的 Locale。
  • 如果指定了 pattern，则其语法必须遵守 java.text.DecimalFormat 指定的规则。此类模式将用于格式化，并且将忽略 type 属性（以及在下一段中描述的有关格式化的选项）。
  • 如果尚未指定 pattern，则将根据 type 属性进行格式化，它将该值格式化为货币、数字或百分比。通过调用 java.text.NumberFormat 类的 getCurrencyInstance()、getNumberInstance() 或 getPercentInstance() 方法，并传入选择的 Locale，可以分别确定货币、数字和百分比的格式模式。此外，将对该格式模式应用以下属性（如果指定）：
    • 如果 groupingUsed 属性为 true，则对相应的 NumberFormat 实例调用 setGroupingUsed(true) 方法。
    • 将根据为 maxFractionDigits、maxIntegerDigits、minFractionDigits 和 minIntegerDigits 属性设置的任何值来配置结果整数部分和小数部分的最小位数和最大位数。
    • 如果类型设置为 currency，也可以使用 currencyCode 或 currencySymbol 属性配置要使用的货币符号。如果设置了两者，则 currencyCode 的值优先于 JDK 1.4（或更高版本）JVM；否则 currencySymbol 的值优先。
英文文档：

Converter implementation for java.lang.Number values.

The getAsObject() method parses a String into an java.lang.Double or java.lang.Long, according to the following algorithm:

  • If the specified String is null, return a null. Otherwise, trim leading and trailing whitespace before proceeding.
  • If the specified String - after trimming - has a zero length, return null.
  • If the locale property is not null, use that Locale for managing parsing. Otherwise, use the Locale from the UIViewRoot.
  • If a pattern has been specified, its syntax must conform the rules specified by java.text.DecimalFormat. Such a pattern will be used to parse, and the type property will be ignored.
  • If a pattern has not been specified, parsing will be based on the type property, which expects a currency, a number, or a percent. The parse pattern for currencies, numbers, and percentages is determined by calling the getCurrencyInstance(), getNumberInstance(), or getPercentInstance() method of the java.text.NumberFormat class, passing in the selected Locale.
  • If the integerOnly property has been set to true, only the integer portion of the String will be parsed. See the JavaDocs for the setParseIntegerOnly() method of the java.text.NumberFormat class for more information.

The getAsString() method expects a value of type java.lang.Number (or a subclass), and creates a formatted String according to the following algorithm:

  • If the specified value is null, return a zero-length String.
  • If the specified value is a String, return it unmodified.
  • If the locale property is not null, use that Locale for managing formatting. Otherwise, use the Locale from the FacesContext.
  • If a pattern has been specified, its syntax must conform the rules specified by java.text.DecimalFormat. Such a pattern will be used to format, and the type property (along with related formatting options described in the next paragraph) will be ignored.
  • If a pattern has not been specified, formatting will be based on the type property, which formats the value as a currency, a number, or a percent. The format pattern for currencies, numbers, and percentages is determined by calling the percentages is determined by calling the getCurrencyInstance(), getNumberInstance(), or getPercentInstance() method of the java.text.NumberFormat class, passing in the selected Locale. In addition, the following properties will be applied to the format pattern, if specified:
    • If the groupingUsed property is true, the setGroupingUsed(true) method on the corresponding NumberFormat instance will be called.
    • The minimum and maximum number of digits in the integer and fractional portions of the result will be configured based on any values set for the maxFractionDigits, maxIntegerDigits, minFractionDigits, and minIntegerDigits properties.
    • If the type is set to currency, it is also possible to configure the currency symbol to be used, using either the currencyCode or currencySymbol properties. If both are set, the value for currencyCode takes precedence on a JDK 1.4 (or later) JVM; otherwise, the value for currencySymbol takes precedence.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | CURRENCY_ID The message identifier of the FacesMessage to be created if the conversion to Number fails.
static String | NUMBER_ID The message identifier of the FacesMessage to be created if the conversion to Number fails.
static String | PATTERN_ID The message identifier of the FacesMessage to be created if the conversion to Number fails.
static String | PERCENT_ID The message identifier of the FacesMessage to be created if the conversion to Number fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Number value to String fails.
Constructor Summary
NumberConverter()
Method Summary
 Object getAsObject(FacesContext context, UIComponent component, String value)
Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
 String getAsString(FacesContext context, UIComponent component, Object value)
Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
 String getCurrencyCode()
Return the ISO 4217 currency code used by getAsString() with a type of currency.
 String getCurrencySymbol()
Return the currency symbol used by getAsString() with a type of currency.
 Locale getLocale()
Return the Locale to be used when parsing numbers.
 int getMaxFractionDigits()
Return the maximum number of digits getAsString() should render in the fraction portion of the result.
 int getMaxIntegerDigits()
Return the maximum number of digits getAsString() should render in the integer portion of the result.
 int getMinFractionDigits()
Return the minimum number of digits getAsString() should render in the fraction portion of the result.
 int getMinIntegerDigits()
Return the minimum number of digits getAsString() should render in the integer portion of the result.
 String getPattern()
Return the format pattern to be used when formatting and parsing numbers.
 String getType()
Return the number type to be used when formatting and parsing numbers.
 boolean isGroupingUsed()
Return true if getAsString should include grouping separators if necessary.
 boolean isIntegerOnly()
Return true if only the integer portion of the given value should be returned from getAsObject().
 boolean isTransient()
If true, the Object implementing this interface must not participate in state saving or restoring.
 void restoreState(FacesContext context, Object state)
Perform any processing required to restore the state from the entries in the state Object.
 Object saveState(FacesContext context)
Gets the state of the instance as a Serializable Object.
 void setCurrencyCode(String currencyCode)
Set the ISO 4217 currency code used by getAsString() with a type of currency.
 void setCurrencySymbol(String currencySymbol)
Set the currency symbol used by getAsString() with a type of currency.
 void setGroupingUsed(boolean groupingUsed)
Set the flag indicating whether getAsString() should include grouping separators if necessary.
 void setIntegerOnly(boolean integerOnly)
Set to true if only the integer portion of the given value should be returned from getAsObject().
 void setLocale(Locale locale)
Set the Locale to be used when parsing numbers.
 void setMaxFractionDigits(int maxFractionDigits)
Set the maximum number of digits getAsString() should render in the fraction portion of the result.
 void setMaxIntegerDigits(int maxIntegerDigits)
Set the maximum number of digits getAsString() should render in the integer portion of the result.
 void setMinFractionDigits(int minFractionDigits)
Set the minimum number of digits getAsString() should render in the fraction portion of the result.
 void setMinIntegerDigits(int minIntegerDigits)
Set the minimum number of digits getAsString() should render in the integer portion of the result.
 void setPattern(String pattern)
Set the format pattern to be used when formatting and parsing numbers.
 void setTransient(boolean transientFlag)
Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
 void setType(String type)
Set the number type to be used when formatting and parsing numbers.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

CURRENCY_ID

public static final String CURRENCY_ID

The message identifier of the FacesMessage to be created if the conversion to Number fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

NUMBER_ID

public static final String NUMBER_ID

The message identifier of the FacesMessage to be created if the conversion to Number fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

PATTERN_ID

public static final String PATTERN_ID

The message identifier of the FacesMessage to be created if the conversion to Number fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

PERCENT_ID

public static final String PERCENT_ID

The message identifier of the FacesMessage to be created if the conversion to Number fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Number value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public NumberConverter()
英文文档：

NumberConverter

public NumberConverter()
Method Detail

public String getCurrencyCode()

返回 type 为 currency 的 getAsString() 所使用的 ISO 4217 货币代码。如果未设置，则使用的值将根据格式 Locale 确定。

英文文档：

getCurrencyCode

public String getCurrencyCode()

Return the ISO 4217 currency code used by getAsString() with a type of currency. If not set, the value used will be based on the formatting Locale.

public void setCurrencyCode(String currencyCode)

设置 type 为 currency 的 getAsString() 所使用的 ISO 4217 货币代码。

currencyCode 新货币代码
英文文档：

setCurrencyCode

public void setCurrencyCode(String currencyCode)

Set the ISO 4217 currency code used by getAsString() with a type of currency.

Parameters:
currencyCode - The new currency code

public String getCurrencySymbol()

返回 type 为 currency 的 getAsString() 所使用的货币符号。如果未设置，则使用的值将根据格式 Locale 确定。

英文文档：

getCurrencySymbol

public String getCurrencySymbol()

Return the currency symbol used by getAsString() with a type of currency. If not set, the value used will be based on the formatting Locale.

public void setCurrencySymbol(String currencySymbol)

设置 type 为 currency 的 getAsString() 所使用的货币符号。

currencySymbol 新货币符号
英文文档：

setCurrencySymbol

public void setCurrencySymbol(String currencySymbol)

Set the currency symbol used by getAsString() with a type of currency.

Parameters:
currencySymbol - The new currency symbol

public boolean isGroupingUsed()

如果 getAsString 应该包含分组分隔符（如有必要），则返回 true。如果未修改，则默认值为 true。

英文文档：

isGroupingUsed

public boolean isGroupingUsed()

Return true if getAsString should include grouping separators if necessary. If not modified, the default value is true.

public void setGroupingUsed(boolean groupingUsed)

设置指示 getAsString() 是否应该包含分组分隔符（如有必要）的标志。

groupingUsed 新的分组使用的标志
英文文档：

setGroupingUsed

public void setGroupingUsed(boolean groupingUsed)

Set the flag indicating whether getAsString() should include grouping separators if necessary.

Parameters:
groupingUsed - The new grouping used flag

public boolean isIntegerOnly()

仅当给定值的整数部分应该从 getAsObject() 返回时，返回 true。如果未修改，则默认值为 false。

英文文档：

isIntegerOnly

public boolean isIntegerOnly()

Return true if only the integer portion of the given value should be returned from getAsObject(). If not modified, the default value is false.

public void setIntegerOnly(boolean integerOnly)

仅当给定值的整数部分应该从 getAsObject() 返回时，设置为 true。

integerOnly 新的 integer-only 标志
英文文档：

setIntegerOnly

public void setIntegerOnly(boolean integerOnly)

Set to true if only the integer portion of the given value should be returned from getAsObject().

Parameters:
integerOnly - The new integer-only flag

public int getMaxFractionDigits()

返回 getAsString() 应该在结果中呈现的小数部分的最大位数。

英文文档：

getMaxFractionDigits

public int getMaxFractionDigits()

Return the maximum number of digits getAsString() should render in the fraction portion of the result.

public void setMaxFractionDigits(int maxFractionDigits)

设置 getAsString() 应该在结果中呈现的小数部分的最大位数。如果未设置，则数值将取决于要转换的值。

maxFractionDigits 新的限制
英文文档：

setMaxFractionDigits

public void setMaxFractionDigits(int maxFractionDigits)

Set the maximum number of digits getAsString() should render in the fraction portion of the result. If not set, the number of digits depends on the value being converted.

Parameters:
maxFractionDigits - The new limit

public int getMaxIntegerDigits()

返回 getAsString() 应该在结果中呈现的整数部分的最大位数。

英文文档：

getMaxIntegerDigits

public int getMaxIntegerDigits()

Return the maximum number of digits getAsString() should render in the integer portion of the result.

public void setMaxIntegerDigits(int maxIntegerDigits)

设置 getAsString() 应该在结果中呈现的整数部分的最大位数。如果未设置，则数值将取决于要转换的值。

maxIntegerDigits 新的限制
英文文档：

setMaxIntegerDigits

public void setMaxIntegerDigits(int maxIntegerDigits)

Set the maximum number of digits getAsString() should render in the integer portion of the result. If not set, the number of digits depends on the value being converted.

Parameters:
maxIntegerDigits - The new limit

public int getMinFractionDigits()

返回 getAsString() 应该在结果中呈现的小数部分的最小位数。

英文文档：

getMinFractionDigits

public int getMinFractionDigits()

Return the minimum number of digits getAsString() should render in the fraction portion of the result.

public void setMinFractionDigits(int minFractionDigits)

设置 getAsString() 应该在结果中呈现的小数部分的最小位数。如果未设置，则数值将取决于要转换的值。

minFractionDigits 新的限制
英文文档：

setMinFractionDigits

public void setMinFractionDigits(int minFractionDigits)

Set the minimum number of digits getAsString() should render in the fraction portion of the result. If not set, the number of digits depends on the value being converted.

Parameters:
minFractionDigits - The new limit

public int getMinIntegerDigits()

返回 getAsString() 应该在结果中呈现的整数部分的最小位数。

英文文档：

getMinIntegerDigits

public int getMinIntegerDigits()

Return the minimum number of digits getAsString() should render in the integer portion of the result.

public void setMinIntegerDigits(int minIntegerDigits)

设置 getAsString() 应该在结果中呈现的整数部分的最小位数。如果未设置，则数值将取决于要转换的值。

minIntegerDigits 新的限制
英文文档：

setMinIntegerDigits

public void setMinIntegerDigits(int minIntegerDigits)

Set the minimum number of digits getAsString() should render in the integer portion of the result. If not set, the number of digits depends on the value being converted.

Parameters:
minIntegerDigits - The new limit

public java.util.Locale getLocale()

返回解析数字时使用的 Locale。如果此值为 null，则将使用存储在当前请求的 javax.faces.component.UIViewRoot 中的 Locale。

英文文档：

getLocale

public Locale getLocale()

Return the Locale to be used when parsing numbers. If this value is null, the Locale stored in the UIViewRoot for the current request will be utilized.

public void setLocale(java.util.Locale locale)

设置解析数字时使用的 Locale。如果设置为 null，则将使用存储在当前请求的 javax.faces.component.UIViewRoot 中的 Locale。

locale 新的 Locale（或者 null）。
英文文档：

setLocale

public void setLocale(Locale locale)

Set the Locale to be used when parsing numbers. If set to null, the Locale stored in the UIViewRoot for the current request will be utilized.

Parameters:
locale - The new Locale (or null)

public String getPattern()

返回将在格式化和解析数字时使用的格式模式。

英文文档：

getPattern

public String getPattern()

Return the format pattern to be used when formatting and parsing numbers.

public void setPattern(String pattern)

设置将在格式化和解析数字时使用的格式模式。有效值是 java.text.DecimalFormat 支持的那些值。当调用 getAsObject() 或 getAsString() 时，无效值将导致 ConverterException。

pattern 新的格式模式
英文文档：

setPattern

public void setPattern(String pattern)

Set the format pattern to be used when formatting and parsing numbers. Valid values are those supported by java.text.DecimalFormat. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

Parameters:
pattern - The new format pattern

public String getType()

返回将在格式化和解析数字时使用的数字类型。如果未修改，则默认类型为 number。

英文文档：

getType

public String getType()

Return the number type to be used when formatting and parsing numbers. If not modified, the default type is number.

public void setType(String type)

设置将在格式化和解析数字时使用的数字类型。有效值有 currency、number 或 percent。当调用 getAsObject() 或 getAsString() 时，无效值将导致 ConverterException。

type 新的数字样式
英文文档：

setType

public void setType(String type)

Set the number type to be used when formatting and parsing numbers. Valid values are currency, number, or percent. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

Parameters:
type - The new number style

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean transientFlag)
英文文档：

setTransient

public void setTransient(boolean transientFlag)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
transientFlag - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ShortConverter (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.convert
Class ShortConverter

java.lang.Object
    extended by  javax.faces.convert.ShortConverter
All Implemented Interfaces:
Converter
public class ShortConverter
extends Object
implements Converter

Implements: Converter

java.lang.Short（以及 short 基本类型) 值的 Converter 实现。

英文文档：

Converter implementation for java.lang.Short (and short primitive) values.

Field Summary
static String | CONVERTER_ID The standard converter id for this converter.
static String | SHORT_ID The message identifier of the FacesMessage to be created if the conversion to Short fails.
static String | STRING_ID The message identifier of the FacesMessage to be created if the conversion of the Short value to String fails.
Constructor Summary
ShortConverter()
Method Summary
Object | getAsObject(FacesContext context, UIComponent component, String value) Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
String | getAsString(FacesContext context, UIComponent component, Object value) Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONVERTER_ID

public static final String CONVERTER_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

SHORT_ID

public static final String SHORT_ID

The message identifier of the FacesMessage to be created if the conversion to Short fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

STRING_ID

public static final String STRING_ID

The message identifier of the FacesMessage to be created if the conversion of the Short value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public ShortConverter()
英文文档：

ShortConverter

public ShortConverter()
Method Detail

public Object getAsObject(FacesContext context, UIComponent component, String value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
Description copied from interface: Converter

Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.

Specified by:
getAsObject in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - String value to be converted (may be null)
Returns:
null if the value to convert is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

public String getAsString(FacesContext context, UIComponent component, Object value)
Throws | ConverterException: NullPointerException 如果无法成功执行转换
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
英文文档：

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
Description copied from interface: Converter

Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

Specified by:
getAsString in interface Converter
Parameters:
context - FacesContext for the request being processed
component - UIComponent with which this model object value is associated
value - Model object value to be converted (may be null)
Returns:
a zero-length String if value is null, otherwise the result of the conversion
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConverterException (Java EE 5)

javax.faces.convert
Class ConverterException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.convert.ConverterException
All Implemented Interfaces:
Serializable
public class ConverterException
extends FacesException

Extends: Throwable > Exception > RuntimeException > FacesException

ConverterException 是由 Converter 的 getAsObject() 或 getAsText() 方法抛出的异常，表示无法执行所请求的转换。

英文文档：

ConverterException is an exception thrown by the getAsObject() or getAsText() method of a Converter, to indicate that the requested conversion cannot be performed.

See Also:
Serialized Form

Constructor Summary
ConverterException()
Construct a new exception with no detail message or root cause.
ConverterException(FacesMessage message)
Construct a new exception with the specified detail message and no root cause.
ConverterException(FacesMessage message, Throwable cause)
Construct a new exception with the specified detail message and root cause.
ConverterException(String message)
Construct a new exception with the specified detail message and no root cause.
ConverterException(String message, Throwable cause)
Construct a new exception with the specified detail message and root cause.
ConverterException(Throwable cause)
Construct a new exception with the specified root cause.
Method Summary
 FacesMessage getFacesMessage()
Returns the FacesMessage associated with this exception; this will only be available if the converter that thew this exception instance placed it there.
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public ConverterException()

构造不带详细消息或根本原因的新异常。

英文文档：

ConverterException

public ConverterException()

Construct a new exception with no detail message or root cause.

public ConverterException(String message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

ConverterException

public ConverterException(String message)

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public ConverterException(Throwable cause)

构造带指定根本原因的新异常。详细消息将被设置为 (cause == null ? null :cause.toString()

cause 此异常的根本原因
英文文档：

ConverterException

public ConverterException(Throwable cause)

Construct a new exception with the specified root cause. The detail message will be set to (cause == null ? null : cause.toString()

Parameters:
cause - The root cause for this exception

public ConverterException(String message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

ConverterException

public ConverterException(String message,
                          Throwable cause)

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception

public ConverterException(FacesMessage message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

ConverterException

public ConverterException(FacesMessage message)

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public ConverterException(FacesMessage message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

ConverterException

public ConverterException(FacesMessage message,
                          Throwable cause)

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Method Detail

public FacesMessage getFacesMessage()

返回与此异常关联的 FacesMessage；只有当抛出此异常实例的转换器包含它时才能使用。

英文文档：

getFacesMessage

public FacesMessage getFacesMessage()

Returns the FacesMessage associated with this exception; this will only be available if the converter that thew this exception instance placed it there.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.faces.el (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.el

DEPRECATED Classes and interfaces for evaluating and processing reference expressions.

See:
Description

Class Summary
MethodBinding | Deprecated. This has been replaced by MethodExpression.
PropertyResolver | Deprecated. This has been replaced by ELResolver.
ValueBinding | Deprecated. This has been replaced by ValueExpression.
VariableResolver | Deprecated. This has been replaced by ELResolver when operating with a null base argument.

Exception Summary
EvaluationException | Deprecated. This has been replaced by ELException.
MethodNotFoundException | Deprecated. This has been replaced by MethodNotFoundException.
PropertyNotFoundException | Deprecated. This has been replaced by PropertyNotFoundException.
ReferenceSyntaxException | Deprecated. This has been replaced by ELException.

Package javax.faces.el Description

DEPRECATED Classes and interfaces for evaluating and processing reference expressions. The main class in this package is ValueBinding, which is the runtime representation of a reference expression. ValueBinding provides methods to get and set the value of the expression.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.el Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.el

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.el.MethodBinding
    • javax.faces.el.PropertyResolver
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.faces.FacesException
            • javax.faces.el.EvaluationException
              • javax.faces.el.MethodNotFoundException
              • javax.faces.el.PropertyNotFoundException
              • javax.faces.el.ReferenceSyntaxException
    • javax.faces.el.ValueBinding
    • javax.faces.el.VariableResolver
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


MethodBinding (Java EE 5)

javax.faces.el
Class MethodBinding

java.lang.Object
    extended by  javax.faces.el.MethodBinding
Deprecated. This has been replaced by MethodExpression.

MethodBinding 是一个对象，它可以对通过 ValueBinding 对方法绑定表达式的开头部分求值得到的实例调用任意公共方法。通过调用此 Web 应用程序的 javax.faces.application.Application 实例的 createMethodBinding() 方法，可以获得用于特定方法绑定表达式的不可变 MethodBinding。

deprecated 由 javax.el.MethodExpression 取代。
英文文档：

public abstract class MethodBinding
extends Object

MethodBinding is an object that can be used to call an arbitrary public method, on an instance that is acquired by evaluatng the leading portion of a method binding expression via a ValueBinding. An immutable MethodBinding for a particular method binding expression can be acquired by calling the createMethodBinding() method of the Application instance for this web application.

Constructor Summary
MethodBinding()
Deprecated.
Method Summary
String | getExpressionString() Deprecated. Return the (possibly null) expression String, with leading and trailing delimiters, from which this MethodBinding was built.
abstract Class | getType(FacesContext context) Deprecated. Return the Java class representing the return type from the method identified by this method binding expression.
abstract Object | invoke(FacesContext context, Object[] params) Deprecated. Return the return value (if any) resulting from a call to the method identified by this method binding expression, passing it the specified parameters, relative to the specified FacesContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MethodBinding()
英文文档：

MethodBinding

public MethodBinding()
Deprecated.
Method Detail

abstract public Object invoke(FacesContext context, Object[] params) throws EvaluationException, MethodNotFoundException

相对于指定的 FacesContext，返回调用此方法绑定表达式所标识的方法，并传入指定参数所得的返回值（如果有）。

context | 当前请求的 FacesContext
params | 要传递给所调用方法的参数数组；如果没有参数，则为 null
Throws | EvaluationException: 如果调用的方法抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | MethodNotFoundException: 如果没有找到合适的方法
Throws | NullPointerException: 如果 context 为 null
英文文档：

invoke

public abstract Object invoke(FacesContext context,
                              Object[] params)
                       throws EvaluationException,
                              MethodNotFoundException
Deprecated.

Return the return value (if any) resulting from a call to the method identified by this method binding expression, passing it the specified parameters, relative to the specified FacesContext.

Parameters:
context - FacesContext for the current request
params - Array of parameters to be passed to the called method, or null for no parameters
Throws:
EvaluationException - if an exception is thrown by the called method (the thrown exception must be included as the cause property of this exception)
MethodNotFoundException - if no suitable method can be found
NullPointerException - if context is null

abstract public Class<T> getType(FacesContext context) throws MethodNotFoundException

返回表示此方法绑定表达式所标识方法的返回类型的 Java 类。

context | 当前请求的 FacesContext
Throws | MethodNotFoundException: 如果没有找到合适的方法
Throws | NullPointerException: 如果 context 为 null
英文文档：

getType

public abstract Class getType(FacesContext context)
                       throws MethodNotFoundException
Deprecated.

Return the Java class representing the return type from the method identified by this method binding expression.

Parameters:
context - FacesContext for the current request
Throws:
MethodNotFoundException - if no suitable method can be found
NullPointerException - if context is null

public String getExpressionString()

返回据以构建此 MethodBinding 的表达式 String（可能为 null），带有前导分界符和尾部分界符。默认实现返回 null。

英文文档：

getExpressionString

public String getExpressionString()
Deprecated.

Return the (possibly null) expression String, with leading and trailing delimiters, from which this MethodBinding was built. The default implementation returns null.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyResolver (Java EE 5)

javax.faces.el
Class PropertyResolver

java.lang.Object
    extended by  javax.faces.el.PropertyResolver
Deprecated. This has been replaced by ELResolver.

PropertyResolver 表示一种可插入的机制，用于访问底层 Java 对象实例的“属性”。不同的 PropertyResolver 实现可以支持不同 Java 类实例上的属性解析（如对 JavaBean 组件属性进行基于内省的访问，或者对 java.util.Map 实例调用 get() 和 put()）。

所有实现必须遵守为每个方法定义的 JavaBean 组件、java.util.Map、java.util.List 和数组实例的规则，但允许为其他类型添加自定义语义。

deprecated 由 javax.el.ELResolver 取代。
英文文档：

public abstract class PropertyResolver
extends Object

PropertyResolver represents a pluggable mechanism for accessing a "property" of an underlying Java object instance. Different PropertyResolver implementations can support property resolution on instances of different Java classes (such as introspection-based access to properties of a JavaBeans component, or get() and put() calls on a java.util.Map instance).

All implementations must respect the rules for JavaBeans component, java.util.Map, java.util.List and array instances defined for each method but are allowed to add custom semantics for other types.

Constructor Summary
PropertyResolver()
Deprecated.
Method Summary
abstract Class | getType(Object base, int index) Deprecated. Return the java.lang.Class representing the type of the specified index.
abstract Class | getType(Object base, Object property) Deprecated. Return the java.lang.Class representing the type of the specified property.
abstract Object | getValue(Object base, int index) Deprecated. Return the value at the specified index of the specified base object.
abstract Object | getValue(Object base, Object property) Deprecated. Return the value of the specified property from the specified base object.
abstract boolean | isReadOnly(Object base, int index) Deprecated. Checks if the specified index is read-only.
abstract boolean | isReadOnly(Object base, Object property) Deprecated. Checks if the specified property is read-only.
abstract void | setValue(Object base, int index, Object value) Deprecated. Set the value at the specified index of the specified base object.
abstract void | setValue(Object base, Object property, Object value) Deprecated. Set the specified value of the specified property on the specified base object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public PropertyResolver()
英文文档：

PropertyResolver

public PropertyResolver()
Deprecated.
Method Detail

abstract public Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException

返回指定 base 对象的指定属性的值。

对于 Bean base 的对象，属性将强制匹配为 String，并用作属性名称。对于所有其他 base 对象类型（例如 Map），使用该属性时没有任何强制匹配。

base | 要返回其属性值的 base 对象
property | 要返回的属性
return | 属性值；如果 base 或 property 为 null，或者属性不存在且 base 对象为 Map 实例，则返回 null
Throws | EvaluationException: 如果获取属性值时抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果 Bean base 对象的指定属性不存在或不可读
英文文档：

getValue

public abstract Object getValue(Object base,
                                Object property)
                         throws EvaluationException,
                                PropertyNotFoundException
Deprecated.

Return the value of the specified property from the specified base object.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base - The base object whose property value is to be returned
property - The property to be returned
Returns:
The property value, or null if base or property is null, or if the property doesn't exist and the base object is a Map instance
Throws:
EvaluationException - if an exception is thrown while getting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the specified property for a bean base object does not exist or is not readable

abstract public Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException

返回指定 base 对象的指定索引处的值。

base | 要返回其属性值的 base 对象
index | 要返回的值的索引
return | 属性值；如果 base 为 null，或者索引超出 base 对象的边界，则为 null
Throws | EvaluationException: 如果获取属性值时抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果索引超出边界，或者 base 为 null
英文文档：

getValue

public abstract Object getValue(Object base,
                                int index)
                         throws EvaluationException,
                                PropertyNotFoundException
Deprecated.

Return the value at the specified index of the specified base object.

Parameters:
base - The base object whose property value is to be returned
index - The index of the value to return
Returns:
The property value, or null if base is null, or if the index is out of bounds for the base object
Throws:
EvaluationException - if an exception is thrown while getting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the index is out of bounds or if base is null

abstract public void setValue(Object base, Object property, Object value) throws EvaluationException, PropertyNotFoundException

设置指定 base 对象上指定属性的指定值。

对于 Bean base 的对象，属性将强制匹配为 String，并用作属性名称。对于所有其他 base 对象类型（例如 Map），使用该属性时没有任何强制匹配。

base | 要设置其属性值的 base 对象
property | 要设置的属性
value | 要设置的属性值
Throws | EvaluationException: 如果设置属性值期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果指定的 Bean base 对象不存在或不可写，或者 base 或 name 为 null
英文文档：

setValue

public abstract void setValue(Object base,
                              Object property,
                              Object value)
                       throws EvaluationException,
                              PropertyNotFoundException
Deprecated.

Set the specified value of the specified property on the specified base object.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base - The base object whose property value is to be set
property - The property to be set
value - The value of the property to be set
Throws:
EvaluationException - if an exception is thrown while setting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the specified bean base object property does not exist or is not writeable, or if base or name is null

abstract public void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException

设置指定 base 对象的指定索引处的值。

base | 要设置其属性值的 base 对象
index | 要设置的值的索引
value | 要设置的值
Throws | EvaluationException: 如果设置属性值期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果索引超出边界，或者 base 为 null
英文文档：

setValue

public abstract void setValue(Object base,
                              int index,
                              Object value)
                       throws EvaluationException,
                              PropertyNotFoundException
Deprecated.

Set the value at the specified index of the specified base object.

Parameters:
base - The base object whose property value is to be set
index - The index of the value to set
value - The value to be set
Throws:
EvaluationException - if an exception is thrown while setting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the index is out of bounds or if base is null

abstract public boolean isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException

检查指定的属性是否为只读。

对于 Bean base 的对象，属性将强制匹配为 String，并用作属性名称。对于所有其他 base 对象类型（例如 Map），使用该属性时没有任何强制匹配。

base | 要分析其属性的 base 对象
property | 要分析的属性
return | 如果已知指定 base 对象的指定属性不可变，则返回 true；否则返回 false
Throws | EvaluationException: 如果测试属性期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果指定的 Bean base 对象不存在，或者 base 或 property 为 null
英文文档：

isReadOnly

public abstract boolean isReadOnly(Object base,
                                   Object property)
                            throws EvaluationException,
                                   PropertyNotFoundException
Deprecated.

Checks if the specified property is read-only.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base - The base object whose property is to be analyzed
property - The property to be analyzed
Returns:
true if the specified property of the specified base object is known to be immutable; otherwise false
Throws:
EvaluationException - if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the specified bean base object property does not exist or if base or property is null

abstract public boolean isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException

检查指定的索引是否为只读。

base | 要分析其属性的 base 对象
index | 要返回其类型的值的索引
return | 如果已知指定 base 对象的指定索引处的值不可变，则返回 true；否则返回 false
Throws | EvaluationException: 如果测试属性期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果索引超出边界，或者 base 为 null
英文文档：

isReadOnly

public abstract boolean isReadOnly(Object base,
                                   int index)
                            throws EvaluationException,
                                   PropertyNotFoundException
Deprecated.

Checks if the specified index is read-only.

Parameters:
base - The base object whose property is to be analyzed
index - The index of the value whose type is to be returned
Returns:
true if the value at the specified index of the specified base object is known to be immutable; otherwise, false
Throws:
EvaluationException - if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the index is out of bounds or if base is null

abstract public Class<T> getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException

返回表示指定属性类型的 java.lang.Class。只要属性不是只读的，就可以将该类型的任何对象的实例设置为该属性的值。保证属性的实际值（如果不为 null）是此类型的实例或者此类型子类的实例。对于发现可以设置为该属性的值的对象类型，此方法也非常有用。

对于 Bean base 的对象，属性将强制匹配为 String，并用作属性名称。对于所有其他 base 对象类型（例如 Map），使用该属性时没有任何强制匹配。

base | 要分析其属性的 base 对象
property | 要分析的属性
return | java.lang.Class（如果可以确定），它表示指定 base 对象的指定属性的类型；否则返回 null
Throws | EvaluationException: 如果测试属性期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果指定的 Bean base 对象不存在，或者 base 或 property 为 null
英文文档：

getType

public abstract Class getType(Object base,
                              Object property)
                       throws EvaluationException,
                              PropertyNotFoundException
Deprecated.

Return the java.lang.Class representing the type of the specified property. An instance of any Object of that type my be set as the value of that property, as long as the property is not read-only. The actual value of the property, if non-null, is guaranteed to be an instance of this type, or an instance of a subclass of this type. This method is also useful for discovering the type of Objects that may be set as the value of the property.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base - The base object whose property is to be analyzed
property - The property to be analyzed
Returns:
the java.lang.Class representing the type of the specified property of the specified base object, if it can be determined; otherwise null
Throws:
EvaluationException - if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the specified bean base object property does not exist or if base or property is null

abstract public Class<T> getType(Object base, int index) throws EvaluationException, PropertyNotFoundException

返回表示指定索引类型的 java.lang.Class。

base | 要分析其属性的 base 对象
index | 要返回其类型的值的索引
return | java.lang.Class（如果可以确定），它表示指定 base 对象指定索引处的值的类型；否则返回 null
Throws | EvaluationException: 如果测试属性期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | PropertyNotFoundException: 如果索引超出边界，或者 base 为 null
英文文档：

getType

public abstract Class getType(Object base,
                              int index)
                       throws EvaluationException,
                              PropertyNotFoundException
Deprecated.

Return the java.lang.Class representing the type of the specified index.

Parameters:
base - The base object whose property is to be analyzed
index - The index of the value whose type is to be returned
Returns:
The java.lang.Class representing the type of value at the specified index of the specified base object, if it can be determined; otherwise null
Throws:
EvaluationException - if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException - if the index is out of bounds or if base is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValueBinding (Java EE 5)

javax.faces.el
Class ValueBinding

java.lang.Object
    extended by  javax.faces.el.ValueBinding
Deprecated. This has been replaced by ValueExpression.

ValueBinding 是一个对象，可以用来访问操作或值绑定表达式所表示的属性。通过调用此 Web 应用程序的 javax.faces.application.Application 实例的 createValueBinding() 方法，可以获得用于特定值绑定的不可变 ValueBinding。

deprecated 由 javax.el.ValueExpression 取代。
英文文档：

public abstract class ValueBinding
extends Object

ValueBinding is an object that can be used to access the property represented by an action or value binding expression. An immutable ValueBinding for a particular value binding can be acquired by calling the createValueBinding() method of the Application instance for this web application.

Constructor Summary
ValueBinding()
Deprecated.
Method Summary
String | getExpressionString() Deprecated. Return the (possibly null) expression String, including the delimiters, from which this ValueBinding was built.
abstract Class | getType(FacesContext context) Deprecated. Return the type of the property represented by this ValueBinding, relative to the specified FacesContext.
abstract Object | getValue(FacesContext context) Deprecated. Return the value of the property represented by this ValueBinding, relative to the specified FacesContext.
abstract boolean | isReadOnly(FacesContext context) Deprecated. Return true if the specified property of the specified property is known to be immutable; otherwise, return false.
abstract void | setValue(FacesContext context, Object value) Deprecated. Set the value of the property represented by this ValueBinding, relative to the specified FacesContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ValueBinding()
英文文档：

ValueBinding

public ValueBinding()
Deprecated.
Method Detail

abstract public Object getValue(FacesContext context) throws EvaluationException, PropertyNotFoundException

相对于指定的 FacesContext，返回此 ValueBinding 表示的属性的值。

context | 当前请求的 FacesContext
Throws | EvaluationException: 如果获取值时抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果指定的属性名称不存在，或者不可读
英文文档：

getValue

public abstract Object getValue(FacesContext context)
                         throws EvaluationException,
                                PropertyNotFoundException
Deprecated.

Return the value of the property represented by this ValueBinding, relative to the specified FacesContext.

Parameters:
context - FacesContext for the current request
Throws:
EvaluationException - if an exception is thrown while getting the value (the thrown exception must be included as the cause property of this exception)
NullPointerException - if context is null
PropertyNotFoundException - if a specified property name does not exist, or is not readable

abstract public void setValue(FacesContext context, Object value) throws EvaluationException, PropertyNotFoundException

相对于指定的 FacesContext，设置此 ValueBinding 表示的属性的值。

context | 当前请求的 FacesContext
value | 要设置的新值
Throws | EvaluationException: 如果在设置值时抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果指定的属性名称不存在，或者不可写
英文文档：

setValue

public abstract void setValue(FacesContext context,
                              Object value)
                       throws EvaluationException,
                              PropertyNotFoundException
Deprecated.

Set the value of the property represented by this ValueBinding, relative to the specified FacesContext.

Parameters:
context - FacesContext for the current request
value - The new value to be set
Throws:
EvaluationException - if an exception is thrown while setting the value (the thrown exception must be included as the cause property of this exception)
NullPointerException - if context is null
PropertyNotFoundException - if a specified property name does not exist, or is not writeable

abstract public boolean isReadOnly(FacesContext context) throws EvaluationException, PropertyNotFoundException

如果已知指定属性的指定属性不可变，则返回 true；否则返回 false。

context | 当前请求的 FacesContext
Throws | EvaluationException: 如果获取属性的描述期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果指定的属性名称不存在
英文文档：

isReadOnly

public abstract boolean isReadOnly(FacesContext context)
                            throws EvaluationException,
                                   PropertyNotFoundException
Deprecated.

Return true if the specified property of the specified property is known to be immutable; otherwise, return false.

Parameters:
context - FacesContext for the current request
Throws:
EvaluationException - if an exception is thrown while getting the description of the property (the thrown exception must be included as the cause property of this exception)
NullPointerException - if context is null
PropertyNotFoundException - if a specified property name does not exist

abstract public Class<T> getType(FacesContext context) throws EvaluationException, PropertyNotFoundException

相对于指定的 FacesContext，返回此 ValueBinding 表示的属性的类型。

context | 当前请求的 FacesContext
Throws | EvaluationException: 如果获取属性的描述期间抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | NullPointerException: 如果 context 为 null
Throws | PropertyNotFoundException: 如果指定的属性名称不存在
英文文档：

getType

public abstract Class getType(FacesContext context)
                       throws EvaluationException,
                              PropertyNotFoundException
Deprecated.

Return the type of the property represented by this ValueBinding, relative to the specified FacesContext.

Parameters:
context - FacesContext for the current request
Throws:
EvaluationException - if an exception is thrown while getting the description of the property (the thrown exception must be included as the cause property of this exception)
NullPointerException - if context is null
PropertyNotFoundException - if a specified property name does not exist

public String getExpressionString()

返回据以构建 ValueBinding 的表达式 String（可能为 null），包括分界符。

英文文档：

getExpressionString

public String getExpressionString()
Deprecated.

Return the (possibly null) expression String, including the delimiters, from which this ValueBinding was built.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VariableResolver (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.el
Class VariableResolver

java.lang.Object
    extended by  javax.faces.el.VariableResolver
Deprecated. This has been replaced by ELResolver when operating with a null base argument.

VariableResolver 代表一种可插入的机制，用于在求值时解析顶级变量引用。

deprecated 使用 null base 参数操作时，由 javax.el.ELResolver 取代。
英文文档：

public abstract class VariableResolver
extends Object

VariableResolver represents a pluggable mechanism for resolving a top-level variable reference at evaluation time.

Constructor Summary
VariableResolver()
Deprecated.
Method Summary
abstract  Object resolveVariable(FacesContext context, String name)
Deprecated. Resolve the specified variable name, and return the corresponding object, if any; otherwise, return null.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public VariableResolver()
英文文档：

VariableResolver

public VariableResolver()
Deprecated.
Method Detail

abstract public Object resolveVariable(FacesContext context, String name) throws EvaluationException

解析指定的变量名称，并返回相应的对象（如果有）；否则返回 null。

context | 据以解析此变量名称的 FacesContext
name | 要解析的变量名称
Throws | EvaluationException: 如果解析变量名称时抛出异常（抛出的异常必须作为此异常的 cause 属性包含在内）
Throws | NullPointerException: 如果 context 或 name 为 null
英文文档：

resolveVariable

public abstract Object resolveVariable(FacesContext context,
                                       String name)
                                throws EvaluationException
Deprecated.

Resolve the specified variable name, and return the corresponding object, if any; otherwise, return null.

Parameters:
context - FacesContext against which to resolve this variable name
name - Name of the variable to be resolved
Throws:
EvaluationException - if an exception is thrown while resolving the variable name (the thrown exception must be included as the cause property of this exception)
NullPointerException - if context or name is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EvaluationException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.el
Class EvaluationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.el.EvaluationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MethodNotFoundException, PropertyNotFoundException, ReferenceSyntaxException
Deprecated. This has been replaced by ELException.

Extends: Throwable > Exception > RuntimeException > FacesException
Extended by: MethodNotFoundException, PropertyNotFoundException, ReferenceSyntaxException

一个异常，它报告在对 MethodBinding 或 ValueBinding 中的表达式求值期间发生错误。

deprecated 由 javax.el.ELException 取代。
英文文档：

public class EvaluationException
extends FacesException

An exception reporting an error that occurred during the evaluation of an expression in a MethodBinding or ValueBinding.

See Also:
Serialized Form

Constructor Summary
EvaluationException()
Deprecated. Construct a new exception with no detail message or root cause.
EvaluationException(String message)
Deprecated. Construct a new exception with the specified detail message and no root cause.
EvaluationException(String message, Throwable cause)
Deprecated. Construct a new exception with the specified detail message and root cause.
EvaluationException(Throwable cause)
Deprecated. Construct a new exception with the specified root cause.
Method Summary
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public EvaluationException()

构造不带详细消息或根本原因的新异常。

英文文档：

EvaluationException

public EvaluationException()
Deprecated.

Construct a new exception with no detail message or root cause.

public EvaluationException(String message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

EvaluationException

public EvaluationException(String message)
Deprecated.

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public EvaluationException(Throwable cause)

构造带指定根本原因的新异常。详细消息将被设置为 (cause == null ? null :cause.toString()

cause 此异常的根本原因
英文文档：

EvaluationException

public EvaluationException(Throwable cause)
Deprecated.

Construct a new exception with the specified root cause. The detail message will be set to (cause == null ? null : cause.toString()

Parameters:
cause - The root cause for this exception

public EvaluationException(String message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

EvaluationException

public EvaluationException(String message,
                           Throwable cause)
Deprecated.

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MethodNotFoundException (Java EE 5)

javax.faces.el
Class MethodNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.el.EvaluationException
                        extended by  javax.faces.el.MethodNotFoundException
All Implemented Interfaces:
Serializable
Deprecated. This has been replaced by MethodNotFoundException.

Extends: Throwable > Exception > RuntimeException > FacesException > EvaluationException

根据 base 对象无法解析的方法名称导致的异常。

deprecated 由 javax.el.MethodNotFoundException 取代。
英文文档：

public class MethodNotFoundException
extends EvaluationException

An exception caused by a method name that cannot be resolved against a base object.

See Also:
Serialized Form

Constructor Summary
MethodNotFoundException()
Deprecated. Construct a new exception with no detail message or root cause.
MethodNotFoundException(String message)
Deprecated. Construct a new exception with the specified detail message and no root cause.
MethodNotFoundException(String message, Throwable cause)
Deprecated. Construct a new exception with the specified detail message and root cause.
MethodNotFoundException(Throwable cause)
Deprecated. Construct a new exception with the specified root cause.
Method Summary
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public MethodNotFoundException()

构造不带详细消息或根本原因的新异常。

英文文档：

MethodNotFoundException

public MethodNotFoundException()
Deprecated.

Construct a new exception with no detail message or root cause.

public MethodNotFoundException(String message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

MethodNotFoundException

public MethodNotFoundException(String message)
Deprecated.

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public MethodNotFoundException(Throwable cause)

构造带指定根本原因的新异常。详细消息将被设置为 (cause == null ? null :cause.toString()

cause 此异常的根本原因
英文文档：

MethodNotFoundException

public MethodNotFoundException(Throwable cause)
Deprecated.

Construct a new exception with the specified root cause. The detail message will be set to (cause == null ? null : cause.toString()

Parameters:
cause - The root cause for this exception

public MethodNotFoundException(String message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

MethodNotFoundException

public MethodNotFoundException(String message,
                               Throwable cause)
Deprecated.

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyNotFoundException (Java EE 5)

javax.faces.el
Class PropertyNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.el.EvaluationException
                        extended by  javax.faces.el.PropertyNotFoundException
All Implemented Interfaces:
Serializable
Deprecated. This has been replaced by PropertyNotFoundException.

Extends: Throwable > Exception > RuntimeException > FacesException > EvaluationException

根据 base 对象无法解析的属性名称导致的异常。

deprecated 由 javax.el.PropertyNotFoundException 取代。
英文文档：

public class PropertyNotFoundException
extends EvaluationException

An exception caused by a property name that cannot be resolved against a base object.

See Also:
Serialized Form

Constructor Summary
PropertyNotFoundException()
Deprecated. Construct a new exception with no detail message or root cause.
PropertyNotFoundException(String message)
Deprecated. Construct a new exception with the specified detail message and no root cause.
PropertyNotFoundException(String message, Throwable cause)
Deprecated. Construct a new exception with the specified detail message and root cause.
PropertyNotFoundException(Throwable cause)
Deprecated. Construct a new exception with the specified root cause.
Method Summary
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public PropertyNotFoundException()

构造不带详细消息或根本原因的新异常。

英文文档：

PropertyNotFoundException

public PropertyNotFoundException()
Deprecated.

Construct a new exception with no detail message or root cause.

public PropertyNotFoundException(String message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

PropertyNotFoundException

public PropertyNotFoundException(String message)
Deprecated.

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public PropertyNotFoundException(Throwable cause)

构造带指定根本原因的新异常。详细消息将被设置为 (cause == null ? null :cause.toString()

cause 此异常的根本原因
英文文档：

PropertyNotFoundException

public PropertyNotFoundException(Throwable cause)
Deprecated.

Construct a new exception with the specified root cause. The detail message will be set to (cause == null ? null : cause.toString()

Parameters:
cause - The root cause for this exception

public PropertyNotFoundException(String message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

PropertyNotFoundException

public PropertyNotFoundException(String message,
                                 Throwable cause)
Deprecated.

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReferenceSyntaxException (Java EE 5)

javax.faces.el
Class ReferenceSyntaxException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.el.EvaluationException
                        extended by  javax.faces.el.ReferenceSyntaxException
All Implemented Interfaces:
Serializable
Deprecated. This has been replaced by ELException.

Extends: Throwable > Exception > RuntimeException > FacesException > EvaluationException

一个异常，报告方法绑定表达式或值绑定表达式中的语法错误。

deprecated 由 javax.el.ELException 取代。
英文文档：

public class ReferenceSyntaxException
extends EvaluationException

An exception reporting a syntax error in a method binding expression or value binding expression.

See Also:
Serialized Form

Constructor Summary
ReferenceSyntaxException()
Deprecated. Construct a new exception with no detail message or root cause.
ReferenceSyntaxException(String message)
Deprecated. Construct a new exception with the specified detail message and no root cause.
ReferenceSyntaxException(String message, Throwable cause)
Deprecated. Construct a new exception with the specified detail message and root cause.
ReferenceSyntaxException(Throwable cause)
Deprecated. Construct a new exception with the specified root cause.
Method Summary
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public ReferenceSyntaxException()

构造不带详细消息或根本原因的新异常。

英文文档：

ReferenceSyntaxException

public ReferenceSyntaxException()
Deprecated.

Construct a new exception with no detail message or root cause.

public ReferenceSyntaxException(String message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

ReferenceSyntaxException

public ReferenceSyntaxException(String message)
Deprecated.

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public ReferenceSyntaxException(Throwable cause)

构造带指定根本原因的新异常。详细消息将被设置为 (cause == null ? null :cause.toString()

cause 此异常的根本原因
英文文档：

ReferenceSyntaxException

public ReferenceSyntaxException(Throwable cause)
Deprecated.

Construct a new exception with the specified root cause. The detail message will be set to (cause == null ? null : cause.toString()

Parameters:
cause - The root cause for this exception

public ReferenceSyntaxException(String message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

ReferenceSyntaxException

public ReferenceSyntaxException(String message,
                                Throwable cause)
Deprecated.

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.faces.event (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.event

Interfaces describing events and event listeners, and concrete event implementation classes.

See:
Description

Interface Summary
ActionListener | A listener interface for receiving ActionEvents.
FacesListener | A generic base interface for event listeners for various types of FacesEvents.
PhaseListener | An interface implemented by objects that wish to be notified at the beginning and ending of processing for each standard phase of the request processing lifecycle.
ValueChangeListener | A listener interface for receiving ValueChangeEvents.

Class Summary
ActionEvent | An ActionEvent represents the activation of a user interface component (such as a UICommand).
FacesEvent | FacesEvent is the base class for user interface and application events that can be fired by UIComponents.
MethodExpressionActionListener | MethodExpressionActionListener is an ActionListener that wraps a MethodExpression.
MethodExpressionValueChangeListener | MethodExpressionValueChangeListener is a ValueChangeListener that wraps a MethodExpression.
PhaseEvent | PhaseEvent represents the beginning or ending of processing for a particular phase of the request processing lifecycle, for the request encapsulated by the specified FacesContext.
PhaseId | Typesafe enumeration of the legal values that may be returned by the getPhaseId() method of the FacesEvent interface.
ValueChangeEvent | A ValueChangeEvent is a notification that the local value of the source component has been change as a result of user interface activity.

Exception Summary
AbortProcessingException An exception that may be thrown by event listeners to terminate the processing of the current event.

Package javax.faces.event Description

Interfaces describing events and event listeners, and concrete event implementation classes. All events extend from FacesEvent and all listeners extend from FacesListener.

For your convenience here is a UML class diagram of the classes in this package.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.event Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.event

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.EventObject (implements java.io.Serializable)
      • javax.faces.event.FacesEvent
        • javax.faces.event.ActionEvent
        • javax.faces.event.ValueChangeEvent
      • javax.faces.event.PhaseEvent
    • javax.faces.event.MethodExpressionActionListener (implements javax.faces.event.ActionListener, javax.faces.component.StateHolder)
    • javax.faces.event.MethodExpressionValueChangeListener (implements javax.faces.component.StateHolder, javax.faces.event.ValueChangeListener)
    • javax.faces.event.PhaseId (implements java.lang.Comparable<T>)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.faces.FacesException
            • javax.faces.event.AbortProcessingException

Interface Hierarchy

  • java.util.EventListener
    • javax.faces.event.FacesListener
      • javax.faces.event.ActionListener
      • javax.faces.event.ValueChangeListener
    • javax.faces.event.PhaseListener (also extends java.io.Serializable)
  • java.io.Serializable
    • javax.faces.event.PhaseListener (also extends java.util.EventListener)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ActionListener (Java EE 5)

javax.faces.event
Interface ActionListener

All Superinterfaces:
EventListener, FacesListener
All Known Implementing Classes:
MethodExpressionActionListener
public interface ActionListener
extends FacesListener

Implements: FacesListener
Implemented by: MethodExpressionActionListener

接收 ActionEvent 的侦听器接口。对接收此类事件感兴趣的类实现该接口，然后通过调用 addActionListener() 向感兴趣的源 UIComponent 注册它自身。

英文文档：

A listener interface for receiving ActionEvents. A class that is interested in receiving such events implements this interface, and then registers itself with the source UIComponent of interest, by calling addActionListener().

Method Summary
 void processAction(ActionEvent event)
Invoked when the action described by the specified ActionEvent occurs.

Method Detail

public void processAction(ActionEvent event) throws AbortProcessingException

当发生指定的 ActionEvent 所描述的操作时调用此方法。

event | 发生的 ActionEvent
Throws | AbortProcessingException: 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档：

processAction

void processAction(ActionEvent event)
                   throws AbortProcessingException

Invoked when the action described by the specified ActionEvent occurs.

Parameters:
event - The ActionEvent that has occurred
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesListener (Java EE 5)

javax.faces.event
Interface FacesListener

All Superinterfaces:
EventListener
All Known Subinterfaces:
ActionListener, ValueChangeListener
All Known Implementing Classes:
MethodExpressionActionListener, MethodExpressionValueChangeListener
public interface FacesListener
extends EventListener

Implements: java.util.EventListener
Implemented by: ActionListener, ValueChangeListener

各种类型的 FacesEvent 的事件侦听器的常规基本接口。特定 FacesEvent 事件类型的所有侦听器接口都必须扩展此接口。

此接口的实现必须有一个无参数公共构造方法。如果实现此接口的类具有需要在请求之间保存和恢复的状态，则该类还必须实现 javax.faces.component.StateHolder。

英文文档：

A generic base interface for event listeners for various types of FacesEvents. All listener interfaces for specific FacesEvent event types must extend this interface.

Implementations of this interface must have a zero-args public constructor. If the class that implements this interface has state that needs to be saved and restored between requests, the class must also implement StateHolder.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PhaseListener (Java EE 5)

javax.faces.event
Interface PhaseListener

All Superinterfaces:
EventListener, Serializable
public interface PhaseListener
extends EventListener, Serializable

Implements: java.util.EventListener, java.io.Serializable

该接口由希望在请求处理生命周期的每个标准阶段的处理开始和结束时获得通知的对象实现。

英文文档：

An interface implemented by objects that wish to be notified at the beginning and ending of processing for each standard phase of the request processing lifecycle.

Method Summary
void | afterPhase(PhaseEvent event) Handle a notification that the processing for a particular phase has just been completed.
void | beforePhase(PhaseEvent event) Handle a notification that the processing for a particular phase of the request processing lifecycle is about to begin.
PhaseId | getPhaseId() Return the identifier of the request processing phase during which this listener is interested in processing PhaseEvent events.

Method Detail

public void afterPhase(PhaseEvent event)

处理通知“特定阶段的处理刚刚完成”。

英文文档：

afterPhase

void afterPhase(PhaseEvent event)

Handle a notification that the processing for a particular phase has just been completed.

public void beforePhase(PhaseEvent event)

处理通知“对请求处理生命周期特定阶段的处理即将开始”。

英文文档：

beforePhase

void beforePhase(PhaseEvent event)

Handle a notification that the processing for a particular phase of the request processing lifecycle is about to begin.

public PhaseId getPhaseId()

返回请求处理阶段（该阶段内此侦听器侦听处理 PhaseEvent 事件）的标识符。合法值是由 PhaseId 类定义的单件实例，包括 PhaseId.ANY_PHASE（表示希望获得所有标准阶段的通知）。

英文文档：

getPhaseId

PhaseId getPhaseId()

Return the identifier of the request processing phase during which this listener is interested in processing PhaseEvent events. Legal values are the singleton instances defined by the PhaseId class, including PhaseId.ANY_PHASE to indicate an interest in being notified for all standard phases.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValueChangeListener (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.event
Interface ValueChangeListener

All Superinterfaces:
EventListener, FacesListener
All Known Implementing Classes:
MethodExpressionValueChangeListener
public interface ValueChangeListener
extends FacesListener

Implements: FacesListener
Implemented by: MethodExpressionValueChangeListener

接收 ValueChangeEvent 的侦听器接口。对接收此类事件感兴趣的类实现此接口，然后通过调用 addValueChangeListener() 向感兴趣的源 UIComponent 注册它自身。

英文文档：

A listener interface for receiving ValueChangeEvents. A class that is interested in receiving such events implements this interface, and then registers itself with the source UIComponent of interest, by calling addValueChangeListener().

Method Summary
 void processValueChange(ValueChangeEvent event)
Invoked when the value change described by the specified ValueChangeEvent occurs.

Method Detail

public void processValueChange(ValueChangeEvent event) throws AbortProcessingException

当发生指定的 ValueChangeEvent 所描述的值更改时调用此方法。

event | 发生的 ValueChangeEvent
Throws | AbortProcessingException: 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档：

processValueChange

void processValueChange(ValueChangeEvent event)
                        throws AbortProcessingException

Invoked when the value change described by the specified ValueChangeEvent occurs.

Parameters:
event - The ValueChangeEvent that has occurred
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ActionEvent (Java EE 5)

javax.faces.event
Class ActionEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.faces.event.FacesEvent
            extended by  javax.faces.event.ActionEvent
All Implemented Interfaces:
Serializable
public class ActionEvent
extends FacesEvent

Extends: java.util.EventObject > FacesEvent

表示激活用户界面组件（如 UICommand）的 ActionEvent。

英文文档：

An ActionEvent represents the activation of a user interface component (such as a UICommand).

See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ActionEvent(UIComponent component)
Construct a new event object from the specified source component and action command.
Method Summary
boolean | isAppropriateListener(FacesListener listener) Return true if this FacesListener is an instance of a listener class that this event supports.
void | processListener(FacesListener listener) Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate.
Methods inherited from class javax.faces.event.FacesEvent
getComponent, getPhaseId, queue, setPhaseId
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ActionEvent(UIComponent component)

根据指定的源组件和操作命令构造一个新的事件对象。

component | 此事件的源 UIComponent
Throws | IllegalArgumentException: 如果 component 为 null
英文文档：

ActionEvent

public ActionEvent(UIComponent component)

Construct a new event object from the specified source component and action command.

Parameters:
component - Source UIComponent for this event
Throws:
IllegalArgumentException - if component is null
Method Detail

public boolean isAppropriateListener(FacesListener listener)
英文文档：

isAppropriateListener

public boolean isAppropriateListener(FacesListener listener)
Description copied from class: FacesEvent

Return true if this FacesListener is an instance of a listener class that this event supports. Typically, this will be accomplished by an "instanceof" check on the listener class.

Specified by:
isAppropriateListener in class FacesEvent
Parameters:
listener - FacesListener to evaluate

public void processListener(FacesListener listener)
Throws AbortProcessingException: NullPointerException 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档：

processListener

public void processListener(FacesListener listener)
Description copied from class: FacesEvent

Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate. Typically, this will be accomplished by calling an event processing method, and passing this FacesEvent as a paramter.

Specified by:
processListener in class FacesEvent
Parameters:
listener - FacesListener to send this FacesEvent to
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesEvent (Java EE 5)

javax.faces.event
Class FacesEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.faces.event.FacesEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ActionEvent, ValueChangeEvent
public abstract class FacesEvent
extends EventObject

Extends: java.util.EventObject
Extended by: ActionEvent, ValueChangeEvent

FacesEvent 是可以由 UIComponent 激发的用户界面和应用程序事件的基类。具体的事件类必须子类化 FacesEvent 才能受到请求处理生命周期的支持。

英文文档：

FacesEvent is the base class for user interface and application events that can be fired by UIComponents. Concrete event classes must subclass FacesEvent in order to be supported by the request processing lifecycle.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
FacesEvent(UIComponent component)
Construct a new event object from the specified source component.
Method Summary
UIComponent | getComponent() Return the source UIComponent that sent this event.
PhaseId | getPhaseId() Return the identifier of the request processing phase during which this event should be delivered.
abstract boolean | isAppropriateListener(FacesListener listener) Return true if this FacesListener is an instance of a listener class that this event supports.
abstract void | processListener(FacesListener listener) Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate.
void | queue() Convenience method to queue this event for broadcast at the end of the current request processing lifecycle phase.
void | setPhaseId(PhaseId phaseId) Set the PhaseId during which this event will be delivered.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public FacesEvent(UIComponent component)

根据指定的源组件构造一个新的事件对象。

component | 此事件的源 UIComponent
Throws | IllegalArgumentException: 如果 component 为 null
英文文档：

FacesEvent

public FacesEvent(UIComponent component)

Construct a new event object from the specified source component.

Parameters:
component - Source UIComponent for this event
Throws:
IllegalArgumentException - if component is null
Method Detail

public UIComponent getComponent()

返回发送此事件的源 UIComponent。

英文文档：

getComponent

public UIComponent getComponent()

Return the source UIComponent that sent this event.

public PhaseId getPhaseId()

返回传送此事件的请求处理阶段的标识符。合法值是由 PhaseId 类定义的单件实例，包括默认值 PhaseId.ANY_PHASE。

英文文档：

getPhaseId

public PhaseId getPhaseId()

Return the identifier of the request processing phase during which this event should be delivered. Legal values are the singleton instances defined by the PhaseId class, including PhaseId.ANY_PHASE, which is the default value.

public void setPhaseId(PhaseId phaseId)

设置传送此事件的 PhaseId。

Throws IllegalArgumentException: phaseId 为 null。
英文文档：

setPhaseId

public void setPhaseId(PhaseId phaseId)

Set the PhaseId during which this event will be delivered.

Throws:
IllegalArgumentException - phaseId is null.

public void queue()

使此事件加入队列以便在当前请求处理生命周期阶段结束时进行广播的便捷方法。

Throws IllegalStateException: 如果此事件的源组件不是 UIViewRoot 的后代。
英文文档：

queue

public void queue()

Convenience method to queue this event for broadcast at the end of the current request processing lifecycle phase.

Throws:
IllegalStateException - if the source component for this event is not a descendant of a UIViewRoot

abstract public boolean isAppropriateListener(FacesListener listener)

如果此 FacesListener 是此事件支持的侦听器类的一个实例，则返回 true。通常，这将对侦听器类进行 "instanceof" 检查。

listener 要求值的 FacesListener
英文文档：

isAppropriateListener

public abstract boolean isAppropriateListener(FacesListener listener)

Return true if this FacesListener is an instance of a listener class that this event supports. Typically, this will be accomplished by an "instanceof" check on the listener class.

Parameters:
listener - FacesListener to evaluate

abstract public void processListener(FacesListener listener)

按照适用的机制，将此 FacesEvent 广播到指定的 FacesListener。通常，这将调用一个事件处理方法，并将此 FacesEvent 作为参数传递。

listener | 接收此 FacesEvent 的 FacesListener
Throws | AbortProcessingException: 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档：

processListener

public abstract void processListener(FacesListener listener)

Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate. Typically, this will be accomplished by calling an event processing method, and passing this FacesEvent as a paramter.

Parameters:
listener - FacesListener to send this FacesEvent to
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodExpressionActionListener (Java EE 5)

javax.faces.event
Class MethodExpressionActionListener

java.lang.Object
    extended by  javax.faces.event.MethodExpressionActionListener
All Implemented Interfaces:
EventListener, StateHolder, ActionListener, FacesListener
public class MethodExpressionActionListener
extends Object
implements ActionListener, StateHolder

Implements: ActionListener, StateHolder

MethodExpressionActionListener 是包装 MethodExpression 的 ActionListener。当收到一个 ActionEvent 时，它对 MethodExpression 标识的对象执行一个方法。

英文文档：

MethodExpressionActionListener is an ActionListener that wraps a MethodExpression. When it receives a ActionEvent, it executes a method on an object identified by the MethodExpression.

Constructor Summary
MethodExpressionActionListener()
MethodExpressionActionListener(MethodExpression methodExpression)
Construct a ValueChangeListener that contains a MethodExpression.
Method Summary
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | processAction(ActionEvent actionEvent) Invoked when the action described by the specified ActionEvent occurs.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setTransient(boolean newTransientValue) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MethodExpressionActionListener()
英文文档：

MethodExpressionActionListener

public MethodExpressionActionListener()

public MethodExpressionActionListener(MethodExpression methodExpression)

构造包含 MethodExpression 的 ValueChangeListener。

英文文档：

MethodExpressionActionListener

public MethodExpressionActionListener(MethodExpression methodExpression)

Construct a ValueChangeListener that contains a MethodExpression.

Method Detail

public void processAction(ActionEvent actionEvent) throws AbortProcessingException
Throws | NullPointerException: NullPointerException
Throws | AbortProcessingException: NullPointerException 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档：

processAction

public void processAction(ActionEvent actionEvent)
                   throws AbortProcessingException
Description copied from interface: ActionListener

Invoked when the action described by the specified ActionEvent occurs.

Specified by:
processAction in interface ActionListener
Parameters:
actionEvent - The ActionEvent that has occurred
Throws:
NullPointerException
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean newTransientValue)
英文文档：

setTransient

public void setTransient(boolean newTransientValue)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
newTransientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodExpressionValueChangeListener (Java EE 5)

javax.faces.event
Class MethodExpressionValueChangeListener

java.lang.Object
    extended by  javax.faces.event.MethodExpressionValueChangeListener
All Implemented Interfaces:
EventListener, StateHolder, FacesListener, ValueChangeListener
public class MethodExpressionValueChangeListener
extends Object
implements ValueChangeListener, StateHolder

Implements: ValueChangeListener, StateHolder

MethodExpressionValueChangeListener 是包装 MethodExpression 的 ValueChangeListener。当收到一个 ValueChangeEvent 时，它对 MethodExpression 标识的对象执行一个方法。

英文文档：

MethodExpressionValueChangeListener is a ValueChangeListener that wraps a MethodExpression. When it receives a ValueChangeEvent, it executes a method on an object identified by the MethodExpression.

Constructor Summary
MethodExpressionValueChangeListener()
MethodExpressionValueChangeListener(MethodExpression methodExpression)
Construct a ValueChangeListener that contains a MethodExpression.
Method Summary
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | processValueChange(ValueChangeEvent valueChangeEvent) Invoked when the value change described by the specified ValueChangeEvent occurs.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setTransient(boolean newTransientValue) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MethodExpressionValueChangeListener()
英文文档：

MethodExpressionValueChangeListener

public MethodExpressionValueChangeListener()

public MethodExpressionValueChangeListener(MethodExpression methodExpression)

构造包含 MethodExpression 的 ValueChangeListener。

英文文档：

MethodExpressionValueChangeListener

public MethodExpressionValueChangeListener(MethodExpression methodExpression)

Construct a ValueChangeListener that contains a MethodExpression.

Method Detail

public void processValueChange(ValueChangeEvent valueChangeEvent) throws AbortProcessingException
Throws | NullPointerException: NullPointerException
Throws | AbortProcessingException: NullPointerException 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档：

processValueChange

public void processValueChange(ValueChangeEvent valueChangeEvent)
                        throws AbortProcessingException
Description copied from interface: ValueChangeListener

Invoked when the value change described by the specified ValueChangeEvent occurs.

Specified by:
processValueChange in interface ValueChangeListener
Parameters:
valueChangeEvent - The ValueChangeEvent that has occurred
Throws:
NullPointerException
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean newTransientValue)
英文文档：

setTransient

public void setTransient(boolean newTransientValue)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
newTransientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PhaseEvent (Java EE 5)

javax.faces.event
Class PhaseEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.faces.event.PhaseEvent
All Implemented Interfaces:
Serializable
public class PhaseEvent
extends EventObject

Extends: java.util.EventObject

对于指定的 FacesContext 封装的请求，PhaseEvent 表示请求处理生命周期特定阶段的处理开始或结束。

英文文档：

PhaseEvent represents the beginning or ending of processing for a particular phase of the request processing lifecycle, for the request encapsulated by the specified FacesContext.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
PhaseEvent(FacesContext context, PhaseId phaseId, Lifecycle lifecycle)
Construct a new event object from the specified parameters.
Method Summary
FacesContext | getFacesContext() Return the FacesContext for the request being processed.
PhaseId | getPhaseId() Return the PhaseId representing the current request processing lifecycle phase.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public PhaseEvent(FacesContext context, PhaseId phaseId, Lifecycle lifecycle)

根据指定的参数构造一个新的事件对象。指定的 Lifecycle 将是此事件的源。

context | 当前请求的 FacesContext
phaseId | 当前请求处理生命周期阶段的标识符
lifecycle | Lifecycle 实例
Throws | NullPointerException: 如果 context、phaseId 或 Lifecycle 为 null
英文文档：

PhaseEvent

public PhaseEvent(FacesContext context,
                  PhaseId phaseId,
                  Lifecycle lifecycle)

Construct a new event object from the specified parameters. The specified Lifecycle will be the source of this event.

Parameters:
context - FacesContext for the current request
phaseId - Identifier of the current request processing lifecycle phase
lifecycle - Lifecycle instance
Throws:
NullPointerException - if context or phaseId or Lifecycleis null
Method Detail

public FacesContext getFacesContext()

返回正处理的请求的 FacesContext。

英文文档：

getFacesContext

public FacesContext getFacesContext()

Return the FacesContext for the request being processed.

public PhaseId getPhaseId()

返回表示当前请求处理生命周期阶段的 PhaseId。

英文文档：

getPhaseId

public PhaseId getPhaseId()

Return the PhaseId representing the current request processing lifecycle phase.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PhaseId (Java EE 5)

javax.faces.event
Class PhaseId

java.lang.Object
    extended by  javax.faces.event.PhaseId
All Implemented Interfaces:
Comparable
public class PhaseId
extends Object
implements Comparable

Implements: Comparable<T>

FacesEvent 接口的 getPhaseId() 方法所返回的合法值的类型安全的枚举。

英文文档：

Typesafe enumeration of the legal values that may be returned by the getPhaseId() method of the FacesEvent interface.

Field Summary
static PhaseId | ANY_PHASE Identifier that indicates an interest in events, no matter which request processing phase is being performed.
static PhaseId | APPLY_REQUEST_VALUES Identifier that indicates an interest in events queued for the Apply Request Values phase of the request processing lifecycle.
static PhaseId | INVOKE_APPLICATION Identifier that indicates an interest in events queued for the Invoke Application phase of the request processing lifecycle.
static PhaseId | PROCESS_VALIDATIONS Identifier that indicates an interest in events queued for the Process Validations phase of the request processing lifecycle.
static PhaseId | RENDER_RESPONSE Identifier for the Render Response phase of the request processing lifecycle.
static PhaseId | RESTORE_VIEW Identifier that indicates an interest in events queued for the Restore View phase of the request processing lifecycle.
static PhaseId | UPDATE_MODEL_VALUES Identifier that indicates an interest in events queued for the Update Model Values phase of the request processing lifecycle.
static List | VALUES List of valid PhaseId instances, in ascending order of their ordinal value.
Method Summary
int | compareTo(Object other) Compare this PhaseId instance to the specified one.
int | getOrdinal() Return the ordinal value of this PhaseId instance.
String | toString() Return a String representation of this PhaseId instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

ANY_PHASE

public static final PhaseId ANY_PHASE

Identifier that indicates an interest in events, no matter which request processing phase is being performed.

英文文档：

RESTORE_VIEW

public static final PhaseId RESTORE_VIEW

Identifier that indicates an interest in events queued for the Restore View phase of the request processing lifecycle.

英文文档：

APPLY_REQUEST_VALUES

public static final PhaseId APPLY_REQUEST_VALUES

Identifier that indicates an interest in events queued for the Apply Request Values phase of the request processing lifecycle.

英文文档：

PROCESS_VALIDATIONS

public static final PhaseId PROCESS_VALIDATIONS

Identifier that indicates an interest in events queued for the Process Validations phase of the request processing lifecycle.

英文文档：

UPDATE_MODEL_VALUES

public static final PhaseId UPDATE_MODEL_VALUES

Identifier that indicates an interest in events queued for the Update Model Values phase of the request processing lifecycle.

英文文档：

INVOKE_APPLICATION

public static final PhaseId INVOKE_APPLICATION

Identifier that indicates an interest in events queued for the Invoke Application phase of the request processing lifecycle.

英文文档：

RENDER_RESPONSE

public static final PhaseId RENDER_RESPONSE

Identifier for the Render Response phase of the request processing lifecycle.

英文文档：

VALUES

public static final List VALUES

List of valid PhaseId instances, in ascending order of their ordinal value.

Method Detail

public int compareTo(Object other)

将此 PhaseId 实例与指定的实例相比较。根据此对象小于、等于或大于指定对象分别返回负整数、0 或正整数。

other 要比较的另一个对象
英文文档：

compareTo

public int compareTo(Object other)

Compare this PhaseId instance to the specified one. Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface Comparable
Parameters:
other - The other object to be compared to

public int getOrdinal()

返回此 PhaseId 实例的序数值。

英文文档：

getOrdinal

public int getOrdinal()

Return the ordinal value of this PhaseId instance.

public String toString()

返回此 PhaseId 实例的 String 表示形式。

英文文档：

toString

public String toString()

Return a String representation of this PhaseId instance.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValueChangeEvent (Java EE 5)

javax.faces.event
Class ValueChangeEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.faces.event.FacesEvent
            extended by  javax.faces.event.ValueChangeEvent
All Implemented Interfaces:
Serializable
public class ValueChangeEvent
extends FacesEvent

Extends: java.util.EventObject > FacesEvent

ValueChangeEvent 通知由于用户界面活动，源组件的本地值发生了更改。只有成功完成了新值的验证，才会激发该通知。

英文文档：

A ValueChangeEvent is a notification that the local value of the source component has been change as a result of user interface activity. It is not fired unless validation of the new value was completed successfully.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ValueChangeEvent(UIComponent component, Object oldValue, Object newValue)
Construct a new event object from the specified source component, old value, and new value.
Method Summary
Object | getNewValue() Return the current local value of the source UIComponent.
Object | getOldValue() Return the previous local value of the source UIComponent.
boolean | isAppropriateListener(FacesListener listener) Return true if this FacesListener is an instance of a listener class that this event supports.
void | processListener(FacesListener listener) Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate.
Methods inherited from class javax.faces.event.FacesEvent
getComponent, getPhaseId, queue, setPhaseId
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ValueChangeEvent(UIComponent component, Object oldValue, Object newValue)

根据指定的源组件、旧值和新值构造一个新的事件对象。

此事件的默认 PhaseId 为 PhaseId#ANY_PHASE。

component | 此事件的源 UIComponent
oldValue | 此 UIComponent 以前的本地值
newValue | 此 UIComponent 的新本地值
Throws | IllegalArgumentException: 如果 component 为 null
英文文档：

ValueChangeEvent

public ValueChangeEvent(UIComponent component,
                        Object oldValue,
                        Object newValue)

Construct a new event object from the specified source component, old value, and new value.

The default PhaseId for this event is PhaseId.ANY_PHASE.

Parameters:
component - Source UIComponent for this event
oldValue - The previous local value of this UIComponent
newValue - The new local value of thie UIComponent
Throws:
IllegalArgumentException - if component is null
Method Detail

public Object getOldValue()

返回源 UIComponent 以前的本地值。

英文文档：

getOldValue

public Object getOldValue()

Return the previous local value of the source UIComponent.

public Object getNewValue()

返回源 UIComponent 的当前本地值。

英文文档：

getNewValue

public Object getNewValue()

Return the current local value of the source UIComponent.

public boolean isAppropriateListener(FacesListener listener)
英文文档：

isAppropriateListener

public boolean isAppropriateListener(FacesListener listener)
Description copied from class: FacesEvent

Return true if this FacesListener is an instance of a listener class that this event supports. Typically, this will be accomplished by an "instanceof" check on the listener class.

Specified by:
isAppropriateListener in class FacesEvent
Parameters:
listener - FacesListener to evaluate

public void processListener(FacesListener listener)
Throws AbortProcessingException: NullPointerException 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档：

processListener

public void processListener(FacesListener listener)
Description copied from class: FacesEvent

Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate. Typically, this will be accomplished by calling an event processing method, and passing this FacesEvent as a paramter.

Specified by:
processListener in class FacesEvent
Parameters:
listener - FacesListener to send this FacesEvent to
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AbortProcessingException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.event
Class AbortProcessingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.event.AbortProcessingException
All Implemented Interfaces:
Serializable
public class AbortProcessingException
extends FacesException

Extends: Throwable > Exception > RuntimeException > FacesException

由事件侦听器抛出的异常，用于终止当前事件的处理。

英文文档：

An exception that may be thrown by event listeners to terminate the processing of the current event.

See Also:
Serialized Form

Constructor Summary
AbortProcessingException()
Construct a new exception with no detail message or root cause.
AbortProcessingException(String message)
Construct a new exception with the specified detail message and no root cause.
AbortProcessingException(String message, Throwable cause)
Construct a new exception with the specified detail message and root cause.
AbortProcessingException(Throwable cause)
Construct a new exception with the specified root cause.
Method Summary
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public AbortProcessingException()

构造不带详细消息或根本原因的新异常。

英文文档：

AbortProcessingException

public AbortProcessingException()

Construct a new exception with no detail message or root cause.

public AbortProcessingException(String message)

构造带指定详细消息但不带根本原因的新异常。

message 此异常的详细消息
英文文档：

AbortProcessingException

public AbortProcessingException(String message)

Construct a new exception with the specified detail message and no root cause.

Parameters:
message - The detail message for this exception

public AbortProcessingException(Throwable cause)

构造带指定根本原因的新异常。

cause 此异常的根本原因
英文文档：

AbortProcessingException

public AbortProcessingException(Throwable cause)

Construct a new exception with the specified root cause.

Parameters:
cause - The root cause for this exception

public AbortProcessingException(String message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

AbortProcessingException

public AbortProcessingException(String message,
                                Throwable cause)

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.lifecycle (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.lifecycle

Classes and interfaces defining lifecycle management for the JavaServer Faces implementation.

See:
Description

Class Summary
Lifecycle | Lifecycle manages the processing of the entire lifecycle of a particular JavaServer Faces request.
LifecycleFactory | LifecycleFactory is a factory object that creates (if needed) and returns Lifecycle instances.

Package javax.faces.lifecycle Description

Classes and interfaces defining lifecycle management for the JavaServer Faces implementation. The main class in this package is Lifecycle. Lifecycle is the gateway to executing the request processing lifecycle.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.lifecycle Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.lifecycle

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.lifecycle.Lifecycle
    • javax.faces.lifecycle.LifecycleFactory
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Lifecycle (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.lifecycle
Class Lifecycle

java.lang.Object
    extended by  javax.faces.lifecycle.Lifecycle

public abstract class Lifecycle
extends Object

Lifecycle 管理特定 JavaServer Faces 请求的整个生命周期处理过程。它负责以指定的顺序执行 JavaServer Faces 规范中定义的所有阶段，除非在执行各个阶段期间发生的活动指示采用其他顺序。

Lifecycle 的实例可以通过对指定的生命周期标识符调用 LifecycleFactory 的 getLifecycle() 方法创建。因为此实例由多个同步请求共享，所以它必须以线程安全的方式实现。

英文文档：

Lifecycle manages the processing of the entire lifecycle of a particular JavaServer Faces request. It is responsible for executing all of the phases that have been defined by the JavaServer Faces Specification, in the specified order, unless otherwise directed by activities that occurred during the execution of each phase.

An instance of Lifecycle is created by calling the getLifecycle() method of LifecycleFactory, for a specified lifecycle identifier. Because this instance is shared across multiple simultaneous requests, it must be implemented in a thread-safe manner.

Constructor Summary
Lifecycle()
Method Summary
abstract void | addPhaseListener(PhaseListener listener) Register a new PhaseListener instance that is interested in being notified before and after the processing for standard phases of the request processing lifecycle.
abstract void | execute(FacesContext context) Execute all of the phases of the request processing lifecycle, up to but not including the Render Response phase, as described in the JavaServer Faces Specification, in the specified order.
abstract PhaseListener[] | getPhaseListeners() Return the set of registered PhaseListeners for this Lifecycle instance.
abstract void | removePhaseListener(PhaseListener listener) Deregister an existing PhaseListener instance that is no longer interested in being notified before and after the processing for standard phases of the request processing lifecycle.
abstract void | render(FacesContext context) Execute the Render Response phase of the request processing lifecycle, unless the responseComplete() method has been called on the FacesContext instance associated with the current request.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Lifecycle()
英文文档：

Lifecycle

public Lifecycle()
Method Detail

abstract public void addPhaseListener(PhaseListener listener)

注册新的 PhaseListener 实例，在处理请求处理生命周期的标准阶段之前和之后将通知该实例。

listener | 要注册的 PhaseListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

addPhaseListener

public abstract void addPhaseListener(PhaseListener listener)

Register a new PhaseListener instance that is interested in being notified before and after the processing for standard phases of the request processing lifecycle.

Parameters:
listener - The PhaseListener to be registered
Throws:
NullPointerException - if listener is null

abstract public void execute(FacesContext context) throws FacesException

以指定的顺序执行请求处理生命周期的所有阶段，直到但不包括呈现响应 阶段，如 JavaServer Faces 规范中所述。（应用程序、组件或事件侦听器）可以通过调用当前请求关联的 FacesContext 实例的 renderResponse() 或 responseComplete() 方法影响处理流。

context | 要处理的请求的 FacesContext
Throws | FacesException: 如果在执行请求处理生命周期的过程中抛出
Throws | NullPointerException: 如果 context 为 null
英文文档：

execute

public abstract void execute(FacesContext context)
                      throws FacesException

Execute all of the phases of the request processing lifecycle, up to but not including the Render Response phase, as described in the JavaServer Faces Specification, in the specified order. The processing flow can be affected (by the application, by components, or by event listeners) by calls to the renderResponse() or responseComplete() methods of the FacesContext instance associated with the current request.

Parameters:
context - FacesContext for the request to be processed
Throws:
FacesException - if thrown during the execution of the request processing lifecycle
NullPointerException - if context is null

abstract public PhaseListener[] getPhaseListeners()

返回针对此 Lifecycle 实例注册的 PhaseListener 集。如果不存在任何已注册侦听器，则此方法返回一个长度为 0 的数组。

英文文档：

getPhaseListeners

public abstract PhaseListener[] getPhaseListeners()

Return the set of registered PhaseListeners for this Lifecycle instance. If there are no registered listeners, a zero-length array is returned.

abstract public void removePhaseListener(PhaseListener listener)

取消注册现有的 PhaseListener 实例，在处理请求处理生命周期的标准阶段之前和之后不再通知该实例。如果没有注册任何侦听器实例，则不执行任何操作。

listener | 要取消注册的 PhaseListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

removePhaseListener

public abstract void removePhaseListener(PhaseListener listener)

Deregister an existing PhaseListener instance that is no longer interested in being notified before and after the processing for standard phases of the request processing lifecycle. If no such listener instance has been registered, no action is taken.

Parameters:
listener - The PhaseListener to be deregistered
Throws:
NullPointerException - if listener is null

abstract public void render(FacesContext context) throws FacesException

执行请求处理生命周期的呈现响应 阶段，除非对当前请求关联的 FacesContext 实例调用 responseComplete() 方法。

context | 要处理的请求的 FacesContext
Throws | FacesException: 如果在执行请求处理生命周期的过程中抛出异常
Throws | NullPointerException: 如果 context 为 null
英文文档：

render

public abstract void render(FacesContext context)
                     throws FacesException

Execute the Render Response phase of the request processing lifecycle, unless the responseComplete() method has been called on the FacesContext instance associated with the current request.

Parameters:
context - FacesContext for the request being processed
Throws:
FacesException - if an exception is thrown during the execution of the request processing lifecycle
NullPointerException - if context is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


LifecycleFactory (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.lifecycle
Class LifecycleFactory

java.lang.Object
    extended by  javax.faces.lifecycle.LifecycleFactory

public abstract class LifecycleFactory
extends Object

LifecycleFactory 是创建（如有需要）和返回 Lifecycle 实例的工厂对象。JavaServer Faces 实现必须至少提供一个默认的 Lifecycle 实现。高级实现（或外部第三方库）可以提供附加的 Lifecycle 实现（以生命周期标识符作为关键字），用于根据每个请求执行不同类型的请求处理。

每个利用 JavaServer Faces 的 Web 应用程序都必须有一个 LifecycleFactory 实例。可以通过可移植的方式获取此实例，即调用：

LifecycleFactory factory = (LifecycleFactory)
FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
英文文档：

LifecycleFactory is a factory object that creates (if needed) and returns Lifecycle instances. Implementations of JavaServer Faces must provide at least a default implementation of Lifecycle. Advanced implementations (or external third party libraries) MAY provide additional Lifecycle implementations (keyed by lifecycle identifiers) for performing different types of request processing on a per-request basis.

There must be one LifecycleFactory instance per web application that is utilizing JavaServer Faces. This instance can be acquired, in a portable manner, by calling:

   LifecycleFactory factory = (LifecycleFactory)
    FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);

Field Summary
static String DEFAULT_LIFECYCLE
The lifecycle identifier for the default Lifecycle instance for this JavaServer Faces implementation.
Constructor Summary
LifecycleFactory()
Method Summary
abstract void | addLifecycle(String lifecycleId, Lifecycle lifecycle) Register a new Lifecycle instance, associated with the specified lifecycleId, to be supported by this LifecycleFactory.
abstract Lifecycle | getLifecycle(String lifecycleId) Create (if needed) and return a Lifecycle instance for the specified lifecycle identifier.
abstract Iterator<String> | getLifecycleIds() Return an Iterator over the set of lifecycle identifiers supported by this factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

DEFAULT_LIFECYCLE

public static final String DEFAULT_LIFECYCLE

The lifecycle identifier for the default Lifecycle instance for this JavaServer Faces implementation.

See Also:
Constant Field Values
Constructor Detail

public LifecycleFactory()
英文文档：

LifecycleFactory

public LifecycleFactory()
Method Detail

abstract public void addLifecycle(String lifecycleId, Lifecycle lifecycle)

注册与指定 lifecycleId 关联的新 Lifecycle 实例，以便此 LifecycleFactory 为其提供支持。此方法可以在任意时间调用，并使相应的 Lifecycle 实例在此 Web 应用程序剩余的生命周期内一直可用。

lifecycleId | 新 Lifecycle 的标识符
lifecycle | 要注册的 Lifecycle 实例
Throws | IllegalArgumentException: 如果已经注册了带有指定 lifecycleId 的 Lifecycle
Throws | NullPointerException: 如果 lifecycleId 或 lifecycle 为 null
英文文档：

addLifecycle

public abstract void addLifecycle(String lifecycleId,
                                  Lifecycle lifecycle)

Register a new Lifecycle instance, associated with the specified lifecycleId, to be supported by this LifecycleFactory. This method may be called at any time, and makes the corresponding Lifecycle instance available throughout the remaining lifetime of this web application.

Parameters:
lifecycleId - Identifier of the new Lifecycle
lifecycle - Lifecycle instance that we are registering
Throws:
IllegalArgumentException - if a Lifecycle with the specified lifecycleId has already been registered
NullPointerException - if lifecycleId or lifecycle is null

abstract public Lifecycle getLifecycle(String lifecycleId)

为指定的生命周期标识符创建（如有需要）并返回 Lifecycle 实例。通过 getLifecycleIds() 方法可以获得可用生命周期标识符集合。

每次对同一个 Web 应用程序中的相同 lifecycleId 调用 getLifecycle() 都必须返回相同的 Lifecycle 实例。

lifecycleId | 请求的 Lifecycle 实例的生命周期标识符
Throws | IllegalArgumentException: 如果对于指定的标识符没有任何可以返回的 Lifecycle 实例
Throws | NullPointerException: 如果 lifecycleId 为 null
英文文档：

getLifecycle

public abstract Lifecycle getLifecycle(String lifecycleId)

Create (if needed) and return a Lifecycle instance for the specified lifecycle identifier. The set of available lifecycle identifiers is available via the getLifecycleIds() method.

Each call to getLifecycle() for the same lifecycleId, from within the same web application, must return the same Lifecycle instance.

Parameters:
lifecycleId - Lifecycle identifier of the requested Lifecycle instance
Throws:
IllegalArgumentException - if no Lifecycle instance can be returned for the specified identifier
NullPointerException - if lifecycleId is null

abstract public java.util.Iterator<E> getLifecycleIds()

返回一个对此工厂支持的生命周期标识符集合进行迭代的 Iterator。此集合必须包括 LifecycleFactory.DEFAULT_LIFECYCLE 指定的值。

英文文档：

getLifecycleIds

public abstract Iterator<String> getLifecycleIds()

Return an Iterator over the set of lifecycle identifiers supported by this factory. This set must include the value specified by LifecycleFactory.DEFAULT_LIFECYCLE.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.model (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.model

Standard model data beans for JavaServer Faces.

See:
Description

Interface Summary
DataModelListener DataModelListener represents an event listener that wishes to be notified of DataModelEvents occurring on a particular DataModel instance.

Class Summary
ArrayDataModel | ArrayDataModel is a convenience implementation of DataModel that wraps an array of Java objects.
DataModel | DataModel is an abstraction around arbitrary data binding technologies that can be used to adapt a variety of data sources for use by JavaServer Faces components that support per-row processing for their child components (such as UIData.
DataModelEvent | DataModelEvent represents an event of interest to registered listeners that occurred on the specified DataModel.
ListDataModel | ListDataModel is a convenience implementation of DataModel that wraps an List of Java objects.
ResultDataModel | ResultDataModel is a convenience implementation of DataModel that wraps a JSTL Result object, typically representing the results of executing an SQL query via JSTL tags.
ResultSetDataModel | ResultSetDataModel is a convenience implementation of DataModel that wraps a ResultSet of Java objects.
ScalarDataModel | ScalarDataModel is a convenience implementation of DataModel that wraps an individual Java object.
SelectItem | SelectItem represents a single item in the list of supported items associated with a UISelectMany or UISelectOne component.
SelectItemGroup | SelectItemGroup is a subclass of SelectItem that identifies a set of options that will be made available as a subordinate "submenu" or "options list", depending upon the requirements of the UISelectMany or UISelectOne renderer that is actually used.

Package javax.faces.model Description

Standard model data beans for JavaServer Faces.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.model Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.model

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.model.DataModel
      • javax.faces.model.ArrayDataModel
      • javax.faces.model.ListDataModel
      • javax.faces.model.ResultDataModel
      • javax.faces.model.ResultSetDataModel
      • javax.faces.model.ScalarDataModel
    • java.util.EventObject (implements java.io.Serializable)
      • javax.faces.model.DataModelEvent
    • javax.faces.model.SelectItem (implements java.io.Serializable)
      • javax.faces.model.SelectItemGroup

Interface Hierarchy

  • java.util.EventListener
    • javax.faces.model.DataModelListener
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DataModelListener (Java EE 5)

javax.faces.model
Interface DataModelListener

All Superinterfaces:
EventListener
public interface DataModelListener
extends EventListener

Implements: java.util.EventListener

DataModelListener 表示特定 DataModel 实例上发生 DataModelEvent 时希望获得通知的事件侦听器。

英文文档：

DataModelListener represents an event listener that wishes to be notified of DataModelEvents occurring on a particular DataModel instance.

Method Summary
 void rowSelected(DataModelEvent event)
Notification that a particular row index, with the associated row data, has been selected for processing.

Method Detail

public void rowSelected(DataModelEvent event)

通知已经选定了特定的行索引（及其关联的行数据）以供处理。

event 要处理的 DataModelEvent
英文文档：

rowSelected

void rowSelected(DataModelEvent event)

Notification that a particular row index, with the associated row data, has been selected for processing.

Parameters:
event - The DataModelEvent we are processing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ArrayDataModel (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.model
Class ArrayDataModel

java.lang.Object
    extended by  javax.faces.model.DataModel
        extended by  javax.faces.model.ArrayDataModel

public class ArrayDataModel
extends DataModel

Extends: DataModel

ArrayDataModel 是 DataModel 的便捷实现，它包装了一个 Java 对象数组。

英文文档：

ArrayDataModel is a convenience implementation of DataModel that wraps an array of Java objects.

Constructor Summary
ArrayDataModel()
Construct a new ArrayDataModel with no specified wrapped data.
ArrayDataModel(Object[] array)
Construct a new ArrayDataModel wrapping the specified array.
Method Summary
int | getRowCount() If there is wrappedData available, return the length of the array.
Object | getRowData() If row data is available, return the array element at the index specified by rowIndex.
int | getRowIndex() Return the zero-relative index of the currently selected row.
Object | getWrappedData() Return the object representing the data wrapped by this DataModel, if any.
boolean | isRowAvailable() Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the length of the array.
void | setRowIndex(int rowIndex) Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.
void | setWrappedData(Object data) Set the object representing the data collection wrapped by this DataModel.
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ArrayDataModel()

构造不带指定的包装数据的新 ArrayDataModel。

英文文档：

ArrayDataModel

public ArrayDataModel()

Construct a new ArrayDataModel with no specified wrapped data.

public ArrayDataModel(Object[] array)

构造包装指定数组的新 ArrayDataModel。

array 要包装的数组（如果有）
英文文档：

ArrayDataModel

public ArrayDataModel(Object[] array)

Construct a new ArrayDataModel wrapping the specified array.

Parameters:
array - Array to be wrapped (if any)
Method Detail

public boolean isRowAvailable()

如果有可用的 wrappedData，并且 rowIndex 的当前值大于等于 0 且小于数组的长度，则返回 true。否则返回 false。

Throws FacesException: 如果检测行可用性时发生错误
英文文档：

isRowAvailable

public boolean isRowAvailable()

Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the length of the array. Otherwise, return false.

Specified by:
isRowAvailable in class DataModel
Throws:
FacesException - if an error occurs getting the row availability

public int getRowCount()

如果有可用的 wrappedData，则返回该数组的长度。如果没有任何可用的 wrappedData，则返回 -1。

Throws FacesException: 如果获取行数时发生错误
英文文档：

getRowCount

public int getRowCount()

If there is wrappedData available, return the length of the array. If no wrappedData is available, return -1.

Specified by:
getRowCount in class DataModel
Throws:
FacesException - if an error occurs getting the row count

public Object getRowData()

如果行数据可用，则返回 rowIndex 指定索引处的数组元素。如果没有任何包装数据可用，则返回 null。

Throws | FacesException: 如果获取行数据时发生错误
Throws | IllegalArgumentException: 如果当前指定行索引处的行数据目前可用
英文文档：

getRowData

public Object getRowData()

If row data is available, return the array element at the index specified by rowIndex. If no wrapped data is available, return null.

Specified by:
getRowData in class DataModel
Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index

public int getRowIndex()
Throws FacesException: NullPointerException 如果获取行索引时发生错误
英文文档：

getRowIndex

public int getRowIndex()
Description copied from class: DataModel

Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, or no wrappedData is available, return -1.

Specified by:
getRowIndex in class DataModel
Throws:
FacesException - if an error occurs getting the row index

public void setRowIndex(int rowIndex)
Throws | FacesException: NullPointerException 如果设置行索引时发生错误
Throws | IllegalArgumentException: NullPointerException 如果 rowIndex 小于 -1
英文文档：

setRowIndex

public void setRowIndex(int rowIndex)
Description copied from class: DataModel

Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available for use by the getRowData() method.

If there is no wrappedData available when this method is called, the specified rowIndex is stored (and may be retrieved by a subsequent call to getRowData()), but no event is sent. Otherwise, if the currently selected row index is changed by this call, a DataModelEvent will be sent to the rowSelected() method of all registered DataModelListeners.

Specified by:
setRowIndex in class DataModel
Parameters:
rowIndex - The new zero-relative index (must be non-negative)
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1

public Object getWrappedData()
英文文档：

getWrappedData

public Object getWrappedData()
Description copied from class: DataModel

Return the object representing the data wrapped by this DataModel, if any.

Specified by:
getWrappedData in class DataModel

public void setWrappedData(Object data)
Throws ClassCastException: 如果 data 非 null 并且不是一个 Java 对象数组。
英文文档：

setWrappedData

public void setWrappedData(Object data)
Description copied from class: DataModel

Set the object representing the data collection wrapped by this DataModel. If the specified data is null, detach this DataModel from any previously wrapped data collection instead.

If data is non-null, the currently selected row index must be set to zero, and a DataModelEvent must be sent to the rowSelected() method of all registered DataModelListeners indicating that this row is now selected.

Specified by:
setWrappedData in class DataModel
Parameters:
data - Data collection to be wrapped, or null to detach from any previous data collection
Throws:
ClassCastException - if data is non-null and is not an array of Java objects.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DataModel (Java EE 5)

javax.faces.model
Class DataModel

java.lang.Object
    extended by  javax.faces.model.DataModel
Direct Known Subclasses:
ArrayDataModel, ListDataModel, ResultDataModel, ResultSetDataModel, ScalarDataModel
public abstract class DataModel
extends Object

Extended by: ArrayDataModel, ListDataModel, ResultDataModel, ResultSetDataModel, ScalarDataModel

DataModel 是对任意数据绑定技术的抽象，这些技术可以用来适配很多数据源，以供支持子组件按行处理的 JavaServer Faces 组件（如 UIData）使用。

DataModel 实例的底层数据集合建模为行对象 Collection，这些对象可以通过以 0 开始的指针（行索引）进行访问。API 提供了一些机制用于定位到指定的以 0 开始的行索引，并获取代表当前行索引所对应数据的对象。

通过调用 setWrappedData() 方法可以将具体的 DataModel 实例连接到特定的底层数据 Collection。通过向此方法传递 null 参数可以使其脱离底层数据 Collection。

具体的 DataModel 实现必须提供一个公有的无参构造方法，该方法调用 setWrappedData(null)。还应提供一个便捷的构造方法，该方法接收适当类型的包装对象（并通过调用 setWrappedData() 传递该对象）。

可能要注册事件侦听器，以便在选定新的行索引时收到通知。

英文文档：

DataModel is an abstraction around arbitrary data binding technologies that can be used to adapt a variety of data sources for use by JavaServer Faces components that support per-row processing for their child components (such as UIData.

The data collection underlying a DataModel instance is modeled as a collection of row objects that can be accessed by a zero-relative cursor (row index). The APIs provide mechanisms to position to a specified zero-relative row index, and to retrieve an object that represents the data that corresponds to the current row index.

A concrete DataModel instance is attached to a particular collection of underlying data by calling the setWrappedData() method. It can be detached from that underlying data collection by passing a null parameter to this method.

Concrete DataModel implementations must provide a public zero-arguments constructor that calls setWrappedData(null). A convenience constructor that takes a wrapped object of the appropriate type (and passes it on via a call to setWrappedData(), should also be provided.

Event listeners may be registered to receive notifications of when a new row index is selected.

Constructor Summary
DataModel()
Method Summary
void | addDataModelListener(DataModelListener listener) Add a new DataModelListener to the set interested in notifications from this DataModel.
DataModelListener[] | getDataModelListeners() Return the set of DataModelListeners interested in notifications from this DataModel.
abstract int | getRowCount() Return the number of rows of data objects represented by this DataModel.
abstract Object | getRowData() Return an object representing the data for the currenty selected row index.
abstract int | getRowIndex() Return the zero-relative index of the currently selected row.
abstract Object | getWrappedData() Return the object representing the data wrapped by this DataModel, if any.
abstract boolean | isRowAvailable() Return a flag indicating whether there is rowData available at the current rowIndex.
void | removeDataModelListener(DataModelListener listener) Remove an existing DataModelListener from the set interested in notifications from this DataModel.
abstract void | setRowIndex(int rowIndex) Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.
abstract void | setWrappedData(Object data) Set the object representing the data collection wrapped by this DataModel.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public DataModel()
英文文档：

DataModel

public DataModel()
Method Detail

abstract public boolean isRowAvailable()

返回一个指示当前 rowIndex 是否有可用的 rowData 的标志。如果没有任何 wrappedData 可用，则返回 false。

Throws FacesException: 如果检测行可用性时发生错误
英文文档：

isRowAvailable

public abstract boolean isRowAvailable()

Return a flag indicating whether there is rowData available at the current rowIndex. If no wrappedData is available, return false.

Throws:
FacesException - if an error occurs getting the row availability

abstract public int getRowCount()

返回此 DataModel 所表示的数据对象的行数。如果行数未知，或者没有任何可用的 wrappedData，则返回 -1。

Throws FacesException: 如果获取行数时发生错误
英文文档：

getRowCount

public abstract int getRowCount()

Return the number of rows of data objects represented by this DataModel. If the number of rows is unknown, or no wrappedData is available, return -1.

Throws:
FacesException - if an error occurs getting the row count

abstract public Object getRowData()

返回表示当前选定行索引处相应数据的对象。如果没有任何可用的 wrappedData，则返回 null。

Throws | FacesException: 如果获取行数据时发生错误
Throws | IllegalArgumentException: 如果当前指定行索引处的行数据目前可用
英文文档：

getRowData

public abstract Object getRowData()

Return an object representing the data for the currenty selected row index. If no wrappedData is available, return null.

Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index

abstract public int getRowIndex()

返回当前选定行索引（以 0 开始）。如果当前没有定位到某行，或没有任何可用的 wrappedData，则返回 -1。

Throws FacesException: 如果获取行索引时发生错误
英文文档：

getRowIndex

public abstract int getRowIndex()

Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, or no wrappedData is available, return -1.

Throws:
FacesException - if an error occurs getting the row index

abstract public void setRowIndex(int rowIndex)

设置当前选定行的索引（以 0 开始）；或者 -1，表示没有定位到某行。可以将行索引设置为某个值，在该索引处底层数据 Collection 不包含任何行数据。因此，调用者可以使用 isRowAvailable() 方法检测是否可以通过 getRowData() 方法获得行数据。

如果调用此方法时没有任何可用的 wrappedData，则存储指定的 rowIndex（随后可以通过调用 getRowData() 获取），但是不发送任何事件。否则，如果此调用更改了当前选定的行索引，就会向所有已注册 DataModelListener 的 rowSelected() 方法发送 DataModelEvent。

rowIndex | 新的以 0 开始的索引（必须为非负数）
Throws | FacesException: 如果设置行索引时发生错误
Throws | IllegalArgumentException: 如果 rowIndex 小于 -1
英文文档：

setRowIndex

public abstract void setRowIndex(int rowIndex)

Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available for use by the getRowData() method.

If there is no wrappedData available when this method is called, the specified rowIndex is stored (and may be retrieved by a subsequent call to getRowData()), but no event is sent. Otherwise, if the currently selected row index is changed by this call, a DataModelEvent will be sent to the rowSelected() method of all registered DataModelListeners.

Parameters:
rowIndex - The new zero-relative index (must be non-negative)
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1

abstract public Object getWrappedData()

返回表示此 DataModel 所包装数据的对象（如果有）。

英文文档：

getWrappedData

public abstract Object getWrappedData()

Return the object representing the data wrapped by this DataModel, if any.

abstract public void setWrappedData(Object data)

设置表示此 DataModel 所包装数据 Collection 的对象。如果指定的 data 为 null，则改为使此 DataModel 脱离以前包装的任何数据 Collection。

如果 data 非 null，则当前选定的行索引必须设置为 0，并且必须向所有已注册 DataModelListener 的 rowSelected() 方法发送 DataModelEvent，以指示现在选定了此行。

data | 要包装的数据 Collection；或者 null，表示脱离以前的任何数据 Collection
Throws | ClassCastException: 如果 data 的类型不适合此 DataModel 实现
英文文档：

setWrappedData

public abstract void setWrappedData(Object data)

Set the object representing the data collection wrapped by this DataModel. If the specified data is null, detach this DataModel from any previously wrapped data collection instead.

If data is non-null, the currently selected row index must be set to zero, and a DataModelEvent must be sent to the rowSelected() method of all registered DataModelListeners indicating that this row is now selected.

Parameters:
data - Data collection to be wrapped, or null to detach from any previous data collection
Throws:
ClassCastException - if data is not of the appropriate type for this DataModel implementation

public void addDataModelListener(DataModelListener listener)

向希望从此 DataModel 获得通知的集合添加一个新的 DataModelListener。

listener | 要注册的新的 DataModelListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

addDataModelListener

public void addDataModelListener(DataModelListener listener)

Add a new DataModelListener to the set interested in notifications from this DataModel.

Parameters:
listener - The new DataModelListener to be registered
Throws:
NullPointerException - if listener is null

public DataModelListener[] getDataModelListeners()

返回希望从此 DataModel 获得通知的 DataModelListener 集。如果不存在此类侦听器，则返回一个空数组。

英文文档：

getDataModelListeners

public DataModelListener[] getDataModelListeners()

Return the set of DataModelListeners interested in notifications from this DataModel. If there are no such listeners, an empty array is returned.

public void removeDataModelListener(DataModelListener listener)

从希望从 DataModel 获得通知的集合中移除一个现有的 DataModelListener。

listener | 要取消注册的旧 DataModelListener
Throws | NullPointerException: 如果 listener 为 null
英文文档：

removeDataModelListener

public void removeDataModelListener(DataModelListener listener)

Remove an existing DataModelListener from the set interested in notifications from this DataModel.

Parameters:
listener - The old DataModelListener to be deregistered
Throws:
NullPointerException - if listener is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DataModelEvent (Java EE 5)

javax.faces.model
Class DataModelEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.faces.model.DataModelEvent
All Implemented Interfaces:
Serializable
public class DataModelEvent
extends EventObject

Extends: java.util.EventObject

DataModelEvent 表示在指定的 DataModel 上发生了已注册侦听器感兴趣的事件。

英文文档：

DataModelEvent represents an event of interest to registered listeners that occurred on the specified DataModel.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
DataModelEvent(DataModel model, int index, Object data)
Construct an event object that is associated with the specified row index and associated data.
Method Summary
DataModel | getDataModel() Return the DataModel that fired this event.
Object | getRowData() Return the object representing the data for the specified row index, or null for no associated row data.
int | getRowIndex() Return the row index for this event, or -1 for no specific row.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public DataModelEvent(DataModel model, int index, Object data)

构造与指定行索引及其相关数据关联的事件对象。

model | 发生此事件的 DataModel
index | 发生此事件的行索引（以 0 开始）；或者 -1，表示没有关联任何特定行
data | 表示 index 所指定的行的数据；或者为 null，表示没有特定行数据
英文文档：

DataModelEvent

public DataModelEvent(DataModel model,
                      int index,
                      Object data)

Construct an event object that is associated with the specified row index and associated data.

Parameters:
model - The DataModel on which this event occurred
index - The zero relative row index for which this event occurred, or -1 for no specific row association
data - Representation of the data for the row specified by index, or null for no particular row data
Method Detail

public DataModel getDataModel()

返回触发此事件的 DataModel。

英文文档：

getDataModel

public DataModel getDataModel()

Return the DataModel that fired this event.

public Object getRowData()

返回表示指定行索引的对象；如果没有任何关联的行数据，则返回 null。

英文文档：

getRowData

public Object getRowData()

Return the object representing the data for the specified row index, or null for no associated row data.

public int getRowIndex()

返回此事件的行索引；如果没有任何特定行，则返回 -1。

英文文档：

getRowIndex

public int getRowIndex()

Return the row index for this event, or -1 for no specific row.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ListDataModel (Java EE 5)

javax.faces.model
Class ListDataModel

java.lang.Object
    extended by  javax.faces.model.DataModel
        extended by  javax.faces.model.ListDataModel

public class ListDataModel
extends DataModel

Extends: DataModel

ListDataModel 是 DataModel 的便捷实现，它包装了一个 Java 对象 List。

英文文档：

ListDataModel is a convenience implementation of DataModel that wraps an List of Java objects.

Constructor Summary
ListDataModel()
Construct a new ListDataModel with no specified wrapped data.
ListDataModel(List list)
Construct a new ListDataModel wrapping the specified list.
Method Summary
int | getRowCount() If there is wrappedData available, return the length of the list.
Object | getRowData() If row data is available, return the array element at the index specified by rowIndex.
int | getRowIndex() Return the zero-relative index of the currently selected row.
Object | getWrappedData() Return the object representing the data wrapped by this DataModel, if any.
boolean | isRowAvailable() Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the size of the list.
void | setRowIndex(int rowIndex) Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.
void | setWrappedData(Object data) Set the object representing the data collection wrapped by this DataModel.
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ListDataModel()

构造不带指定包装数据的新 ListDataModel。

英文文档：

ListDataModel

public ListDataModel()

Construct a new ListDataModel with no specified wrapped data.

public ListDataModel(java.util.List<E> list)

构造带指定列表的新 ListDataModel。

list 要包装的列表（如果有）
英文文档：

ListDataModel

public ListDataModel(List list)

Construct a new ListDataModel wrapping the specified list.

Parameters:
list - List to be wrapped (if any)
Method Detail

public boolean isRowAvailable()

如果有可用的 wrappedData，并且 rowIndex 的当前值大于等于 0 且小于列表的大小，则返回 true。否则返回 false。

Throws FacesException: 如果检测行可用性时发生错误
英文文档：

isRowAvailable

public boolean isRowAvailable()

Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the size of the list. Otherwise, return false.

Specified by:
isRowAvailable in class DataModel
Throws:
FacesException - if an error occurs getting the row availability

public int getRowCount()

如果有可用的 wrappedData，则返回该列表的长度。如果没有任何可用的 wrappedData，则返回 -1。

Throws FacesException: 如果获取行数时发生错误
英文文档：

getRowCount

public int getRowCount()

If there is wrappedData available, return the length of the list. If no wrappedData is available, return -1.

Specified by:
getRowCount in class DataModel
Throws:
FacesException - if an error occurs getting the row count

public Object getRowData()

如果行数据可用，则返回 rowIndex 指定索引处的数组元素。如果没有任何包装数据可用，则返回 null。

Throws | FacesException: 如果获取行数据时发生错误
Throws | IllegalArgumentException: 如果当前指定行索引处的行数据目前可用
英文文档：

getRowData

public Object getRowData()

If row data is available, return the array element at the index specified by rowIndex. If no wrapped data is available, return null.

Specified by:
getRowData in class DataModel
Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index

public int getRowIndex()
Throws FacesException: NullPointerException 如果获取行索引时发生错误
英文文档：

getRowIndex

public int getRowIndex()
Description copied from class: DataModel

Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, or no wrappedData is available, return -1.

Specified by:
getRowIndex in class DataModel
Throws:
FacesException - if an error occurs getting the row index

public void setRowIndex(int rowIndex)
Throws | FacesException: NullPointerException 如果设置行索引时发生错误
Throws | IllegalArgumentException: NullPointerException 如果 rowIndex 小于 -1
英文文档：

setRowIndex

public void setRowIndex(int rowIndex)
Description copied from class: DataModel

Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available for use by the getRowData() method.

If there is no wrappedData available when this method is called, the specified rowIndex is stored (and may be retrieved by a subsequent call to getRowData()), but no event is sent. Otherwise, if the currently selected row index is changed by this call, a DataModelEvent will be sent to the rowSelected() method of all registered DataModelListeners.

Specified by:
setRowIndex in class DataModel
Parameters:
rowIndex - The new zero-relative index (must be non-negative)
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1

public Object getWrappedData()
英文文档：

getWrappedData

public Object getWrappedData()
Description copied from class: DataModel

Return the object representing the data wrapped by this DataModel, if any.

Specified by:
getWrappedData in class DataModel

public void setWrappedData(Object data)
Throws ClassCastException: 如果 data 非 null，并且不是 List
英文文档：

setWrappedData

public void setWrappedData(Object data)
Description copied from class: DataModel

Set the object representing the data collection wrapped by this DataModel. If the specified data is null, detach this DataModel from any previously wrapped data collection instead.

If data is non-null, the currently selected row index must be set to zero, and a DataModelEvent must be sent to the rowSelected() method of all registered DataModelListeners indicating that this row is now selected.

Specified by:
setWrappedData in class DataModel
Parameters:
data - Data collection to be wrapped, or null to detach from any previous data collection
Throws:
ClassCastException - if data is non-null and is not a List
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResultDataModel (Java EE 5)

javax.faces.model
Class ResultDataModel

java.lang.Object
    extended by  javax.faces.model.DataModel
        extended by  javax.faces.model.ResultDataModel

public class ResultDataModel
extends DataModel

Extends: DataModel

ResultDataModel 是 DataModel 的便捷实现，它包装了一个 JSTL Result 对象，通常表示通过 JSTL 标记执行 SQL 查询的结果。

英文文档：

ResultDataModel is a convenience implementation of DataModel that wraps a JSTL Result object, typically representing the results of executing an SQL query via JSTL tags.

Constructor Summary
ResultDataModel()
Construct a new ResultDataModel with no specified wrapped data.
ResultDataModel(javax.servlet.jsp.jstl.sql.Result result)
Construct a new ResultDataModel wrapping the specified Result.
Method Summary
 int getRowCount()
If there is wrappedData available, return the length of the array returned by calling getRows() on the underlying Result.
 Object getRowData()
If row data is available, return the SortedMap array element at the index specified by rowIndex of the array returned by calling getRows() on the underlying Result.
 int getRowIndex()
Return the zero-relative index of the currently selected row.
 Object getWrappedData()
Return the object representing the data wrapped by this DataModel, if any.
 boolean isRowAvailable()
Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the length of the array returned by calling getRows() on the underlying Result.
 void setRowIndex(int rowIndex)
Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.
 void setWrappedData(Object data)
Set the object representing the data collection wrapped by this DataModel.
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ResultDataModel()

构造不带指定包装数据的新 ResultDataModel。

英文文档：

ResultDataModel

public ResultDataModel()

Construct a new ResultDataModel with no specified wrapped data.

public ResultDataModel(javax.servlet.jsp.jstl.sql.Result result)

构造包装指定 Result 的新 ResultDataModel。

result 要包装的 Result（如果有）
英文文档：

ResultDataModel

public ResultDataModel(javax.servlet.jsp.jstl.sql.Result result)

Construct a new ResultDataModel wrapping the specified Result.

Parameters:
result - Result to be wrapped (if any)
Method Detail

public boolean isRowAvailable()

如果有可用的 wrappedData，并且 rowIndex 的当前值大于等于 0，且小于对底层 Result 调用 getRows() 所返回的数组长度，则返回 true。否则返回 false。

Throws FacesException: 如果检测行可用性时发生错误
英文文档：

isRowAvailable

public boolean isRowAvailable()

Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the length of the array returned by calling getRows() on the underlying Result. Otherwise, return false.

Specified by:
isRowAvailable in class DataModel
Throws:
FacesException - if an error occurs getting the row availability

public int getRowCount()

如果有可用的 wrappedData，则返回对底层 Result 调用 getRows() 所返回的数组长度。如果没有任何可用的 wrappedData，则返回 -1。

Throws FacesException: 如果获取行数时发生错误
英文文档：

getRowCount

public int getRowCount()

If there is wrappedData available, return the length of the array returned by calling getRows() on the underlying Result. If no wrappedData is available, return -1.

Specified by:
getRowCount in class DataModel
Throws:
FacesException - if an error occurs getting the row count

public Object getRowData()

如果行数据可用，则返回一个 SortedMap 数组元素，该元素位于对底层 Result 调用 getRows() 所返回数组的 rowIndex 所指定的索引位置。如果没有任何包装数据可用，则返回 null。

注意，如果此方法返回非 null Map，那么它将包含当前行的列值，并且以列名称作为键。必须以大小写无关的方式执行列名称比较。

Throws | FacesException: 如果获取行数据时发生错误
Throws | IllegalArgumentException: 如果当前指定行索引处的行数据目前可用
英文文档：

getRowData

public Object getRowData()

If row data is available, return the SortedMap array element at the index specified by rowIndex of the array returned by calling getRows() on the underlying Result. If no wrapped data is available, return null.

Note that, if a non-null Map is returned by this method, it will contain the values of the columns for the current row, keyed by column name. Column name comparisons must be performed in a case-insensitive manner.

Specified by:
getRowData in class DataModel
Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index

public int getRowIndex()
Throws FacesException: NullPointerException 如果获取行索引时发生错误
英文文档：

getRowIndex

public int getRowIndex()
Description copied from class: DataModel

Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, or no wrappedData is available, return -1.

Specified by:
getRowIndex in class DataModel
Throws:
FacesException - if an error occurs getting the row index

public void setRowIndex(int rowIndex)
Throws | FacesException: NullPointerException 如果设置行索引时发生错误
Throws | IllegalArgumentException: NullPointerException 如果 rowIndex 小于 -1
英文文档：

setRowIndex

public void setRowIndex(int rowIndex)
Description copied from class: DataModel

Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available for use by the getRowData() method.

If there is no wrappedData available when this method is called, the specified rowIndex is stored (and may be retrieved by a subsequent call to getRowData()), but no event is sent. Otherwise, if the currently selected row index is changed by this call, a DataModelEvent will be sent to the rowSelected() method of all registered DataModelListeners.

Specified by:
setRowIndex in class DataModel
Parameters:
rowIndex - The new zero-relative index (must be non-negative)
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1

public Object getWrappedData()
英文文档：

getWrappedData

public Object getWrappedData()
Description copied from class: DataModel

Return the object representing the data wrapped by this DataModel, if any.

Specified by:
getWrappedData in class DataModel

public void setWrappedData(Object data)
Throws ClassCastException: 如果 data 非 null，并且不是 Result
英文文档：

setWrappedData

public void setWrappedData(Object data)
Description copied from class: DataModel

Set the object representing the data collection wrapped by this DataModel. If the specified data is null, detach this DataModel from any previously wrapped data collection instead.

If data is non-null, the currently selected row index must be set to zero, and a DataModelEvent must be sent to the rowSelected() method of all registered DataModelListeners indicating that this row is now selected.

Specified by:
setWrappedData in class DataModel
Parameters:
data - Data collection to be wrapped, or null to detach from any previous data collection
Throws:
ClassCastException - if data is non-null and is not a Result
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResultSetDataModel (Java EE 5)

javax.faces.model
Class ResultSetDataModel

java.lang.Object
    extended by  javax.faces.model.DataModel
        extended by  javax.faces.model.ResultSetDataModel

public class ResultSetDataModel
extends DataModel

Extends: DataModel

ResultSetDataModel 是 DataModel 的便捷实现，它包装了一个 Java 对象 ResultSet。注意，指定的 ResultSet 必须是可滚动的。此外，如果输入组件（它将更新模型值）在值绑定表达式中引用此对象，则指定的 ResultSet 必须是可更新的。

英文文档：

ResultSetDataModel is a convenience implementation of DataModel that wraps a ResultSet of Java objects. Note that the specified ResultSet MUST be scrollable. In addition, if input components (that will be updating model values) reference this object in value binding expressions, the specified ResultSet MUST be updatable.

Constructor Summary
ResultSetDataModel()
Construct a new ResultSetDataModel with no specified wrapped data.
ResultSetDataModel(ResultSet resultSet)
Construct a new ResultSetDataModel wrapping the specified ResultSet.
Method Summary
 int getRowCount()
Return -1, since ResultSet does not provide a standard way to determine the number of available rows without scrolling through the entire ResultSet, and this can be very expensive if the number of rows is large.
 Object getRowData()
If row data is available, return a Map representing the values of the columns for the row specified by rowIndex, keyed by the corresponding column names.
 int getRowIndex()
Return the zero-relative index of the currently selected row.
 Object getWrappedData()
Return the object representing the data wrapped by this DataModel, if any.
 boolean isRowAvailable()
Return true if there is wrappedData available, and the result of calling absolute() on the underlying ResultSet, passing the current value of rowIndex plus one (to account for the fact that ResultSet uses one-relative indexing), returns true.
 void setRowIndex(int rowIndex)
Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.
 void setWrappedData(Object data)
Set the object representing the data collection wrapped by this DataModel.
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ResultSetDataModel()

构造不带指定包装数据的新 ResultSetDataModel。

英文文档：

ResultSetDataModel

public ResultSetDataModel()

Construct a new ResultSetDataModel with no specified wrapped data.

public ResultSetDataModel(java.sql.ResultSet resultSet)

构造包装指定 ResultSet 的新 ResultSetDataModel。

resultSet 要包装的 ResultSet（如果有）
英文文档：

ResultSetDataModel

public ResultSetDataModel(ResultSet resultSet)

Construct a new ResultSetDataModel wrapping the specified ResultSet.

Parameters:
resultSet - ResultSet to be wrapped (if any)
Method Detail

public boolean isRowAvailable()

如果有可用的 wrappedData，并且对底层 ResultSet 调用 absolute()，同时传递 rowIndex 加 1 处的当前值（考虑到 ResultSet 使用以 1 开始的索引）所得结果为 true，则返回 true。否则返回 false。

Throws FacesException: 如果检测行可用性时发生错误
英文文档：

isRowAvailable

public boolean isRowAvailable()

Return true if there is wrappedData available, and the result of calling absolute() on the underlying ResultSet, passing the current value of rowIndex plus one (to account for the fact that ResultSet uses one-relative indexing), returns true. Otherwise, return false.

Specified by:
isRowAvailable in class DataModel
Throws:
FacesException - if an error occurs getting the row availability

public int getRowCount()

返回 -1，ResultSet 没有提供无需滚动整个 ResultSet 即可确定可用行数的标准方式，因此，如果行数很大，此操作可能开销很大。

Throws FacesException: 如果获取行数时发生错误
英文文档：

getRowCount

public int getRowCount()

Return -1, since ResultSet does not provide a standard way to determine the number of available rows without scrolling through the entire ResultSet, and this can be very expensive if the number of rows is large.

Specified by:
getRowCount in class DataModel
Throws:
FacesException - if an error occurs getting the row count

public Object getRowData()

如果行数据可用，则返回一个 Map，它表示 rowIndex 所指定行的列值，以相应的列名称作为键。如果没有任何包装数据可用，则返回 null。

如果返回非 null Map，则其行为必须符合 AbstractMap 的 JavaDoc 中描述的有关可变 Map 的协定，但存在以下例外和特殊行为：

  • Map 及其返回的任何支持对象必须以不区分大小写的方式执行所有列名称比较。必须使用不区分大小写的 Comparator（如 String.CASE_INSENSITIVE_ORDER）实现该目的。
  • 以下方法必须抛出 UnsupportedOperationException：clear()、remove()。
  • entrySet() 方法必须返回具有以下行为的 Set：
    • 对于任何试图向 Set 添加条目或从其中删除条目的操作抛出 UnsupportedOperationException，不管该操作是直接还是间接地通过 Set 所返回的 Iterator 进行。
    • 对此 set 中条目的 value 的更新必须写入底层 ResultSet 中相应的列值。
  • keySet() 方法必须返回一个 Set，它能对任何试图添加或删除键的操作抛出 UnsupportedOperationException，不管该操作是直接还是间接地通过 Set 所返回的 Iterator 进行。
  • 如果指定了 containsKey() 返回 false 的键值，则 put() 方法必须抛出 IllegalArgumentException。但是，如果指定了 Map 中已经存在的键，则指定的值必须写入底层 ResultSet 中相应的列值。
  • values() 方法必须返回一个 Collection，它能对任何添加或删除值的操作抛出 UnsupportedOperationException，不管该操作是直接还是间接地通过 Collection 所返回的 Iterator 进行。
Throws | FacesException: 如果获取行数据时发生错误
Throws | IllegalArgumentException: 如果当前指定行索引处的行数据目前可用
英文文档：

getRowData

public Object getRowData()

If row data is available, return a Map representing the values of the columns for the row specified by rowIndex, keyed by the corresponding column names. If no wrapped data is available, return null.

If a non-null Map is returned, its behavior must correspond to the contract for a mutable Map as described in the JavaDocs for AbstractMap, with the following exceptions and specialized behavior:

  • The Map, and any supporting objects it returns, must perform all column name comparisons in a case-insensitive manner. This case-insensitivity must be implemented using a case-insensitive Comparator, such as String.CASE_INSENSITIVE_ORDER.
  • The following methods must throw UnsupportedOperationException: clear(), remove().
  • The entrySet() method must return a Set that has the following behavior:
    • Throw UnsupportedOperationException for any attempt to add or remove entries from the Set, either directly or indirectly through an Iterator returned by the Set.
    • Updates to the value of an entry in this set must write through to the corresponding column value in the underlying ResultSet.
  • The keySet() method must return a Set that throws UnsupportedOperationException on any attempt to add or remove keys, either directly or through an Iterator returned by the Set.
  • The put() method must throw IllegalArgumentException if a key value for which containsKey() returns false is specified. However, if a key already present in the Map is specified, the specified value must write through to the corresponding column value in the underlying ResultSet.
  • The values() method must return a Collection that throws UnsupportedOperationException on any attempt to add or remove values, either directly or through an Iterator returned by the Collection.

Specified by:
getRowData in class DataModel
Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index

public int getRowIndex()
Throws FacesException: NullPointerException 如果获取行索引时发生错误
英文文档：

getRowIndex

public int getRowIndex()
Description copied from class: DataModel

Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, or no wrappedData is available, return -1.

Specified by:
getRowIndex in class DataModel
Throws:
FacesException - if an error occurs getting the row index

public void setRowIndex(int rowIndex)
Throws | FacesException: NullPointerException 如果设置行索引时发生错误
Throws | IllegalArgumentException: NullPointerException 如果 rowIndex 小于 -1
英文文档：

setRowIndex

public void setRowIndex(int rowIndex)
Description copied from class: DataModel

Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available for use by the getRowData() method.

If there is no wrappedData available when this method is called, the specified rowIndex is stored (and may be retrieved by a subsequent call to getRowData()), but no event is sent. Otherwise, if the currently selected row index is changed by this call, a DataModelEvent will be sent to the rowSelected() method of all registered DataModelListeners.

Specified by:
setRowIndex in class DataModel
Parameters:
rowIndex - The new zero-relative index (must be non-negative)
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1

public Object getWrappedData()
英文文档：

getWrappedData

public Object getWrappedData()
Description copied from class: DataModel

Return the object representing the data wrapped by this DataModel, if any.

Specified by:
getWrappedData in class DataModel

public void setWrappedData(Object data)
Throws ClassCastException: NullPointerException 如果 data 的类型不适合此 DataModel 实现
英文文档：

setWrappedData

public void setWrappedData(Object data)
Description copied from class: DataModel

Set the object representing the data collection wrapped by this DataModel. If the specified data is null, detach this DataModel from any previously wrapped data collection instead.

If data is non-null, the currently selected row index must be set to zero, and a DataModelEvent must be sent to the rowSelected() method of all registered DataModelListeners indicating that this row is now selected.

Specified by:
setWrappedData in class DataModel
Parameters:
data - Data collection to be wrapped, or null to detach from any previous data collection
Throws:
ClassCastException - if data is not of the appropriate type for this DataModel implementation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ScalarDataModel (Java EE 5)

javax.faces.model
Class ScalarDataModel

java.lang.Object
    extended by  javax.faces.model.DataModel
        extended by  javax.faces.model.ScalarDataModel

public class ScalarDataModel
extends DataModel

Extends: DataModel

ScalarDataModel 是 DataModel 的便捷实现，它包装了一个单独的 Java 对象。

英文文档：

ScalarDataModel is a convenience implementation of DataModel that wraps an individual Java object.

Constructor Summary
ScalarDataModel()
Construct a new ScalarDataModel with no specified wrapped data.
ScalarDataModel(Object scalar)
Construct a new ScalarDataModel wrapping the specified scalar object.
Method Summary
int | getRowCount() If there is wrappedData available, return 1.
Object | getRowData() If wrapped data is available, return the wrapped data instance.
int | getRowIndex() Return the zero-relative index of the currently selected row.
Object | getWrappedData() Return the object representing the data wrapped by this DataModel, if any.
boolean | isRowAvailable() Return true if there is wrappedData available, and the current value of rowIndex is zero.
void | setRowIndex(int rowIndex) Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.
void | setWrappedData(Object data) Set the object representing the data collection wrapped by this DataModel.
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ScalarDataModel()

构造不带指定包装数据的新 ScalarDataModel。

英文文档：

ScalarDataModel

public ScalarDataModel()

Construct a new ScalarDataModel with no specified wrapped data.

public ScalarDataModel(Object scalar)

构造包装指定标量对象的新 ScalarDataModel。

scalar 要包装的标量（如果有）
英文文档：

ScalarDataModel

public ScalarDataModel(Object scalar)

Construct a new ScalarDataModel wrapping the specified scalar object.

Parameters:
scalar - Scalar to be wrapped (if any)
Method Detail

public boolean isRowAvailable()

如果有可用的 wrappedData，并且 rowIndex 的当前值为 0，则返回 true。否则返回 false。

Throws FacesException: 如果检测行可用性时发生错误
英文文档：

isRowAvailable

public boolean isRowAvailable()

Return true if there is wrappedData available, and the current value of rowIndex is zero. Otherwise, return false.

Specified by:
isRowAvailable in class DataModel
Throws:
FacesException - if an error occurs getting the row availability

public int getRowCount()

如果有可用的 wrappedData，则返回 1。如果没有可用的 wrappedData，则返回 -1。

Throws FacesException: 如果获取行数时发生错误
英文文档：

getRowCount

public int getRowCount()

If there is wrappedData available, return 1. If no wrappedData is available, return -1.

Specified by:
getRowCount in class DataModel
Throws:
FacesException - if an error occurs getting the row count

public Object getRowData()

如果有可用的包装数据，则返回包装的数据实例。否则返回 null。

Throws | FacesException: 如果获取行数据时发生错误
Throws | IllegalArgumentException: 如果当前指定行索引处的行数据目前可用
英文文档：

getRowData

public Object getRowData()

If wrapped data is available, return the wrapped data instance. Otherwise, return null.

Specified by:
getRowData in class DataModel
Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index

public int getRowIndex()
Throws FacesException: NullPointerException 如果获取行索引时发生错误
英文文档：

getRowIndex

public int getRowIndex()
Description copied from class: DataModel

Return the zero-relative index of the currently selected row. If we are not currently positioned on a row, or no wrappedData is available, return -1.

Specified by:
getRowIndex in class DataModel
Throws:
FacesException - if an error occurs getting the row index

public void setRowIndex(int rowIndex)
Throws | FacesException: NullPointerException 如果设置行索引时发生错误
Throws | IllegalArgumentException: NullPointerException 如果 rowIndex 小于 -1
英文文档：

setRowIndex

public void setRowIndex(int rowIndex)
Description copied from class: DataModel

Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row. It is possible to set the row index at a value for which the underlying data collection does not contain any row data. Therefore, callers may use the isRowAvailable() method to detect whether row data will be available for use by the getRowData() method.

If there is no wrappedData available when this method is called, the specified rowIndex is stored (and may be retrieved by a subsequent call to getRowData()), but no event is sent. Otherwise, if the currently selected row index is changed by this call, a DataModelEvent will be sent to the rowSelected() method of all registered DataModelListeners.

Specified by:
setRowIndex in class DataModel
Parameters:
rowIndex - The new zero-relative index (must be non-negative)
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1

public Object getWrappedData()
英文文档：

getWrappedData

public Object getWrappedData()
Description copied from class: DataModel

Return the object representing the data wrapped by this DataModel, if any.

Specified by:
getWrappedData in class DataModel

public void setWrappedData(Object data)
Throws ClassCastException: NullPointerException 如果 data 的类型不适合此 DataModel 实现
英文文档：

setWrappedData

public void setWrappedData(Object data)
Description copied from class: DataModel

Set the object representing the data collection wrapped by this DataModel. If the specified data is null, detach this DataModel from any previously wrapped data collection instead.

If data is non-null, the currently selected row index must be set to zero, and a DataModelEvent must be sent to the rowSelected() method of all registered DataModelListeners indicating that this row is now selected.

Specified by:
setWrappedData in class DataModel
Parameters:
data - Data collection to be wrapped, or null to detach from any previous data collection
Throws:
ClassCastException - if data is not of the appropriate type for this DataModel implementation
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SelectItem (Java EE 5)

javax.faces.model
Class SelectItem

java.lang.Object
    extended by  javax.faces.model.SelectItem
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SelectItemGroup
public class SelectItem
extends Object
implements Serializable

Implements: java.io.Serializable
Extended by: SelectItemGroup

SelectItem 表示 UISelectMany 或 UISelectOne 组件关联的支持条目 列表中的一个条目。

英文文档：

SelectItem represents a single item in the list of supported items associated with a UISelectMany or UISelectOne component.

See Also:
Serialized Form

Constructor Summary
SelectItem()
Construct a SelectItem with no initialized property values.
SelectItem(Object value)
Construct a SelectItem with the specified value.
SelectItem(Object value, String label)
Construct a SelectItem with the specified value and label.
SelectItem(Object value, String label, String description)
Construct a SelectItem instance with the specified value, label and description.
SelectItem(Object value, String label, String description, boolean disabled)
Construct a SelectItem instance with the specified property values.
SelectItem(Object value, String label, String description, boolean disabled, boolean escape)
Construct a SelectItem instance with the specified property values.
Method Summary
String | getDescription() Return a description of this item, for use in development tools.
String | getLabel() Return the label of this item, to be rendered visibly for the user.
Object | getValue() Return the value of this item, to be delivered to the model if this item is selected by the user.
boolean | isDisabled() Return the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.
boolean | isEscape() Getter for property escape.
void | setDescription(String description) Set the description of this item, for use in development tools.
void | setDisabled(boolean disabled) Set the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.
void | setEscape(boolean escape) Setter for property escape.
void | setLabel(String label) Set the label of this item, to be rendered visibly for the user.
void | setValue(Object value) Set the value of this item, to be delivered to the model if this item is selected by this user.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SelectItem()

构造一个 SelectItem，没有初始化任何属性值。

英文文档：

SelectItem

public SelectItem()

Construct a SelectItem with no initialized property values.

public SelectItem(Object value)

构造带指定值的 SelectItem。label 属性将被设置为该值（如有必要，则转换为 String），description 属性将被设置为 null，disabled 属性将被设置为 false，escape 属性将被设置为 true。

value 用户选定此条目时要传递给模型的值
英文文档：

SelectItem

public SelectItem(Object value)

Construct a SelectItem with the specified value. The label property will be set to the value (converted to a String, if necessary), the description property will be set to null, the disabled property will be set to false, and the escape property will be set to ( true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user

public SelectItem(Object value, String label)

构造带指定值和标签的 SelectItem。description 属性将被设置为 null，disabled 属性将被设置为 false，escape 属性将被设置为 true。

value | 用户选定此条目时要传递给模型的值
label | 响应时要为此条目呈现的标签
英文文档：

SelectItem

public SelectItem(Object value,
                  String label)

Construct a SelectItem with the specified value and label. The description property will be set to null, the disabled property will be set to false, and the escape property will be set to true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response

public SelectItem(Object value, String label, String description)

构造带指定值、标签和描述的 SelectItem 实例。disabled 属性将被设置为 false，escape 属性将被设置为 true。

value | 用户选定此条目时要传递给模型的值
label | 响应时要为此条目呈现的标签
description | 此条目的描述，在工具中使用
英文文档：

SelectItem

public SelectItem(Object value,
                  String label,
                  String description)

Construct a SelectItem instance with the specified value, label and description. This disabled property will be set to false, and the escape property will be set to true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response
description - Description of this item, for use in tools

public SelectItem(Object value, String label, String description, boolean disabled)

构造带指定属性值的 SelectItem 实例。escape 属性将被设置为 true。

value | 用户选定此条目时要传递给模型的值
label | 响应时要为此条目呈现的标签
description | 此条目的描述，在工具中使用
disabled | 指示此选项已禁用的标志
英文文档：

SelectItem

public SelectItem(Object value,
                  String label,
                  String description,
                  boolean disabled)

Construct a SelectItem instance with the specified property values. The escape property will be set to true.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response
description - Description of this item, for use in tools
disabled - Flag indicating that this option is disabled

public SelectItem(Object value, String label, String description, boolean disabled, boolean escape)

构造带指定属性值的 SelectItem 实例。

value | 用户选定此条目时要传递给模型的值
label | 响应时要为此条目呈现的标签
description | 此条目的描述，在工具中使用
disabled | 指示此选项已禁用的标志
escape | 指示呈现时此选项的文本应该转义的标志。
since | 1.2
英文文档：

SelectItem

public SelectItem(Object value,
                  String label,
                  String description,
                  boolean disabled,
                  boolean escape)

Construct a SelectItem instance with the specified property values.

Parameters:
value - Value to be delivered to the model if this item is selected by the user
label - Label to be rendered for this item in the response
description - Description of this item, for use in tools
disabled - Flag indicating that this option is disabled
escape - Flag indicating that the text of this option should be escaped when rendered.
Since:
1.2
Method Detail

public String getDescription()

返回此条目的描述，在开发工具中使用。

英文文档：

getDescription

public String getDescription()

Return a description of this item, for use in development tools.

public void setDescription(String description)

设置此条目的描述，在开发工具中使用。

description 新的描述
英文文档：

setDescription

public void setDescription(String description)

Set the description of this item, for use in development tools.

Parameters:
description - The new description

public boolean isDisabled()

返回此条目的禁用标志，如果设置为 true，则应该修改呈现的输出，使用户不能选择此条目。

英文文档：

isDisabled

public boolean isDisabled()

Return the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.

public void setDisabled(boolean disabled)

设置此条目的禁用标志，如果设置为 true，则应该修改呈现的输出，使用户不能选择此条目。

disabled 新的禁用标志
英文文档：

setDisabled

public void setDisabled(boolean disabled)

Set the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.

Parameters:
disabled - The new disabled flag

public String getLabel()

返回此条目的标签，该标签将呈现给用户。

英文文档：

getLabel

public String getLabel()

Return the label of this item, to be rendered visibly for the user.

public void setLabel(String label)

设置此条目的标签，该标签将呈现给用户。

label 新的标签
英文文档：

setLabel

public void setLabel(String label)

Set the label of this item, to be rendered visibly for the user.

Parameters:
label - The new label

public Object getValue()

返回此条目的值，用户选择此条目时该值将传送给模型。

英文文档：

getValue

public Object getValue()

Return the value of this item, to be delivered to the model if this item is selected by the user.

public void setValue(Object value)

设置此条目的值，用户选择此条目时该值将传送给模型。

value 新值
英文文档：

setValue

public void setValue(Object value)

Set the value of this item, to be delivered to the model if this item is selected by this user.

Parameters:
value - The new value

public boolean isEscape()
escape 属性的获取方法。
return escape 属性的值。
英文文档：

isEscape

public boolean isEscape()
Getter for property escape.

Returns:
Value of property escape.

public void setEscape(boolean escape)
escape 属性的设置方法。
escape escape 属性的新值。
英文文档：

setEscape

public void setEscape(boolean escape)
Setter for property escape.

Parameters:
escape - New value of property escape.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SelectItemGroup (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.model
Class SelectItemGroup

java.lang.Object
    extended by  javax.faces.model.SelectItem
        extended by  javax.faces.model.SelectItemGroup
All Implemented Interfaces:
Serializable
public class SelectItemGroup
extends SelectItem

Extends: SelectItem

SelectItemGroup 是 SelectItem 的子类，它标识将用作从属“子菜单”或“选项列表”的一组选项，具体取决于实际使用的 UISelectMany 或 UISelectOne Renderer 的要求。通常，此实例的 value 属性将被忽略，而其 label 属性将用作子菜单的标签。

尽管可以将 SelectItemGroup 实例合并到此实例的 selectItems 属性（据以创建一个适合级联子菜单的数据结构），但是一些 Renderer 可能限制支持的嵌套层次。例如，创建 <select> 元素的基于 HTML 的 Renderer 通常将此实例呈现为 <optgroup> 元素，但是 HTML 4.01 规范不允许选项组嵌套。

英文文档：

SelectItemGroup is a subclass of SelectItem that identifies a set of options that will be made available as a subordinate "submenu" or "options list", depending upon the requirements of the UISelectMany or UISelectOne renderer that is actually used. In general, the value property of this instance will be ignored, and the label property of this instance will be used to label the submenu.

Although it is feasible to incorporate SelectItemGroup instances in he selectItems property of this instance (thereby creating a data structure suitable for cascading submenus), some renderers may place restrictions on the level of nesting they support. For example, HTML based renderers that create an <select> element will typically render this instance as an <optgroup> element, but the HTML 4.01 Specification disallows nested option groups.

See Also:
Serialized Form

Constructor Summary
SelectItemGroup()
Construct a SelectItemGroup with no initialized property values.
SelectItemGroup(String label)
Construct a SelectItemGroup with the specified label and no associated selectItems.
SelectItemGroup(String label, String description, boolean disabled, SelectItem[] selectItems)
Construct a SelectItemGroup with the specified properties.
Method Summary
SelectItem[] | getSelectItems() Return the set of subordinate SelectItems for this group.
void | setSelectItems(SelectItem[] selectItems) Set the set of subordinate SelectItems for this group.
Methods inherited from class javax.faces.model.SelectItem
getDescription, getLabel, getValue, isDisabled, isEscape, setDescription, setDisabled, setEscape, setLabel, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SelectItemGroup()

构造一个 SelectItemGroup，没有初始化任何属性值。

英文文档：

SelectItemGroup

public SelectItemGroup()

Construct a SelectItemGroup with no initialized property values.

public SelectItemGroup(String label)

构造带指定标签并且没有关联 selectItem 的 SelectItemGroup。value 属性将设置为长度为 0 的 String，description 属性将被设置为 null，disabled 属性将被设置为 false。

label | 响应时要为该组呈现的标签
Throws | NullPointerException: 如果 label 为 false
英文文档：

SelectItemGroup

public SelectItemGroup(String label)

Construct a SelectItemGroup with the specified label and no associated selectItems. The value property will be set to a zero-length String, the description property will be set to null, and the disabled property will be set to false.

Parameters:
label - Label to be rendered for this group in the response
Throws:
NullPointerException - if label is false

public SelectItemGroup(String label, String description, boolean disabled, SelectItem[] selectItems)

构造带指定属性的 SelectItemGroup。value 属性将被设置为长度为 0 的 String。

label | 响应时要为该组呈现的标签
description | 此组的描述，在工具中使用
disabled | 指示此组已禁用的标志
selectItems | 描述此组中可用条目的 SelectItem 数组
Throws | NullPointerException: 如果 label 或 selectItems 为 false
英文文档：

SelectItemGroup

public SelectItemGroup(String label,
                       String description,
                       boolean disabled,
                       SelectItem[] selectItems)

Construct a SelectItemGroup with the specified properties. The value property will be set to a zero-length String.

Parameters:
label - Label to be rendered for this group in the response
description - Description of this group, for use in tools
disabled - Flag indicating that this group is disabled
selectItems - Array of SelectItem describing the items available in this group
Throws:
NullPointerException - if label or selectItems is false
Method Detail

public SelectItem[] getSelectItems()

返回此组的从属 SelectItem 集。

英文文档：

getSelectItems

public SelectItem[] getSelectItems()

Return the set of subordinate SelectItems for this group.

public void setSelectItems(SelectItem[] selectItems)

设置此组的从属 SelectItem 集。

selectItems | 新的从属条目集
Throws | NullPointerException: 如果 selectItems 为 null
英文文档：

setSelectItems

public void setSelectItems(SelectItem[] selectItems)

Set the set of subordinate SelectItems for this group.

Parameters:
selectItems - The new set of subordinate items
Throws:
NullPointerException - if selectItems is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.render (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.render

Classes and interfaces defining the rendering model.

See:
Description

Class Summary
Renderer | A Renderer converts the internal representation of UIComponents into the output stream (or writer) associated with the response we are creating for a particular request.
RenderKit | RenderKit represents a collection of Renderer instances that, together, know how to render JavaServer Faces UIComponent instances for a specific client.
RenderKitFactory | RenderKitFactory is a factory object that registers and returns RenderKit instances.
ResponseStateManager | ResponseStateManager is the helper class to StateManager that knows the specific rendering technology being used to generate the response.

Package javax.faces.render Description

Classes and interfaces defining the rendering model. The main class in this package is RenderKit. RenderKit vends a set of Renderer instances which provide rendering capability for a specific client device type.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.render Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.render

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.render.Renderer
    • javax.faces.render.RenderKit
    • javax.faces.render.RenderKitFactory
    • javax.faces.render.ResponseStateManager
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Renderer (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.render
Class Renderer

java.lang.Object
    extended by  javax.faces.render.Renderer

public abstract class Renderer
extends Object

Renderer 将 UIComponent 的内部表示形式转换为与正在为特定请求创建的响应关联的输出流（或 writer）。每个 Renderer 都了解如何呈现一种或多种 UIComponent 类型（或类），并且为每个支持的 UIComponent 公布一组与呈现有关的属性。

Renderer 系列被打包成 RenderKit，共同支持呈现与 FacesContext 关联的视图中的所有 UIComponent。在特定 RenderKit 的 Renderer 集内，每个 Renderer 都使用 rendererType 属性唯一地标识。

各个 Renderer 实例将在呈现过程中根据需要实例化，并在 Web 应用程序的剩余生命周期内一直存在。因为每个实例都有可能从一个以上的请求处理线程中同时调用，所以必须以线程安全的方式为其编程。

英文文档：

A Renderer converts the internal representation of UIComponents into the output stream (or writer) associated with the response we are creating for a particular request. Each Renderer knows how to render one or more UIComponent types (or classes), and advertises a set of render-dependent attributes that it recognizes for each supported UIComponent.

Families of Renderers are packaged as a RenderKit, and together support the rendering of all of the UIComponents in a view associated with a FacesContext. Within the set of Renderers for a particular RenderKit, each must be uniquely identified by the rendererType property.

Individual Renderer instances will be instantiated as requested during the rendering process, and will remain in existence for the remainder of the lifetime of a web application. Because each instance may be invoked from more than one request processing thread simultaneously, they MUST be programmed in a thread-safe manner.

Constructor Summary
Renderer()
Method Summary
 String convertClientId(FacesContext context, String clientId)
Convert the component generated client id to a form suitable for transmission to the client.
 void decode(FacesContext context, UIComponent component)
Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.
 void encodeBegin(FacesContext context, UIComponent component)
Render the beginning specified UIComponent to the output stream or writer associated with the response we are creating.
 void encodeChildren(FacesContext context, UIComponent component)
Render the child components of this UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.
 void encodeEnd(FacesContext context, UIComponent component)
Render the ending of the current state of the specified UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.
 Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue)
Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered Converter for this component, if there is one).
 boolean getRendersChildren()
Return a flag indicating whether this Renderer is responsible for rendering the children the component it is asked to render.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Renderer()
英文文档：

Renderer

public Renderer()
Method Detail

public void decode(FacesContext context, UIComponent component)

从指定 FacesContext 中包含的请求中解码指定 UIComponent 的任何新状态，并将此状态存储在 UIComponent 中。

在解码期间，通过对关联的 UIComponent 调用 queueEvent()，可以将事件加入队列，以便稍后处理（由注册的事件侦听器实现）。

context | 要处理的请求的 FacesContext
component | 要解码的 UIComponent。
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

decode

public void decode(FacesContext context,
                   UIComponent component)

Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.

During decoding, events may be enqueued for later processing (by event listeners that have registered an interest), by calling queueEvent() on the associated UIComponent.

Parameters:
context - FacesContext for the request we are processing
component - UIComponent to be decoded.
Throws:
NullPointerException - if context or component is null

public void encodeBegin(FacesContext context, UIComponent component) throws java.io.IOException

将一开始指定的 UIComponent 呈现给与正在创建的响应关联的输出流或 writer。如果上一次对此组件调用 getConvertedValue() 时转换尝试失败，则应使用 decode() 执行期间保存的状态信息来复制错误的输入。

context | 要处理的请求的 FacesContext
component | 要呈现的 UIComponent
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

encodeBegin

public void encodeBegin(FacesContext context,
                        UIComponent component)
                 throws IOException

Render the beginning specified UIComponent to the output stream or writer associated with the response we are creating. If the conversion attempted in a previous call to getConvertedValue() for this component failed, the state information saved during execution of decode() should be used to reproduce the incorrect input.

Parameters:
context - FacesContext for the request we are processing
component - UIComponent to be rendered
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context or component is null

public void encodeChildren(FacesContext context, UIComponent component) throws java.io.IOException

呈现此 UIComponent 的子组件，根据 encodeBegin() 描述的规则获取要呈现的相应值。仅当此组件的 rendersChildren 属性为 true 时，才调用此方法。

context | 要创建的响应的 FacesContext
component | 要呈现其子组件的 UIComponent
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

encodeChildren

public void encodeChildren(FacesContext context,
                           UIComponent component)
                    throws IOException

Render the child components of this UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered. This method will only be called if the rendersChildren property of this component is true.

Parameters:
context - FacesContext for the response we are creating
component - UIComponent whose children are to be rendered
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context or component is null

public void encodeEnd(FacesContext context, UIComponent component) throws java.io.IOException

呈现指定 UIComponent 当前状态的结束，根据 encodeBegin() 描述的规则获取要呈现的相应值。

context | 要创建的响应的 FacesContext
component | 要呈现的 UIComponent
Throws | java.io.IOException: 如果呈现期间发生输入/输出错误
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

encodeEnd

public void encodeEnd(FacesContext context,
                      UIComponent component)
               throws IOException

Render the ending of the current state of the specified UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.

Parameters:
context - FacesContext for the response we are creating
component - UIComponent to be rendered
Throws:
IOException - if an input/output error occurs while rendering
NullPointerException - if context or component is null

public String convertClientId(FacesContext context, String clientId)

将组件生成的客户端 ID 转换成适合向客户端传输的形式。

默认实现返回未更改的参数 clientId。

context | 当前请求的 FacesContext
clientId | 要转换成客户端特定格式的客户端标识符。
Throws | NullPointerException: 如果 context 或 clientId 为 null
英文文档：

convertClientId

public String convertClientId(FacesContext context,
                              String clientId)

Convert the component generated client id to a form suitable for transmission to the client.

The default implementation returns the argument clientId unchanged.

Parameters:
context - FacesContext for the current request
clientId - the client identifier to be converted to client a specific format.
Throws:
NullPointerException - if context or clientId is null

public boolean getRendersChildren()

返回一个标志，它指示此 Renderer 是否负责呈现请求呈现的组件的子组件。默认实现返回 false。

英文文档：

getRendersChildren

public boolean getRendersChildren()

Return a flag indicating whether this Renderer is responsible for rendering the children the component it is asked to render. The default implementation returns false.

public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException

尝试将以前存储的状态信息转换成此组件需要的对象类型（如果有，则可以选择使用此组件的已注册 javax.faces.convert.Converter）。如果转换成功，则应该从此方法返回新的值；否则，应该抛出 ConverterException。

context | 要处理的请求的 FacesContext
component | 要解码的 UIComponent。
submittedValue | 在 decode 期间存储在组件中的值。
Throws | ConverterException: 如果无法成功转换提交的值。
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

getConvertedValue

public Object getConvertedValue(FacesContext context,
                                UIComponent component,
                                Object submittedValue)
                         throws ConverterException

Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered Converter for this component, if there is one). If conversion is successful, the new value should be returned from this method; if not, a ConverterException should be thrown.

Parameters:
context - FacesContext for the request we are processing
component - UIComponent to be decoded.
submittedValue - a value stored on the component during decode.
Throws:
ConverterException - if the submitted value cannot be converted successfully.
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


RenderKit (Java EE 5)

javax.faces.render
Class RenderKit

java.lang.Object
    extended by  javax.faces.render.RenderKit

public abstract class RenderKit
extends Object

RenderKit 表示 Renderer 实例的 Collection，这些实例了解如何为特定客户端呈现 JavaServer Faces UIComponent 实例。通常，RenderKit 专门用来处理一些客户端设备类型、标记语言和/或用户 Locale 的组合。RenderKit 还用作关联 Renderer 实例的 Factory，这些实例执行每个组件实际的呈现过程。

典型的 JavaServer Faces 实现将在 Web 应用程序启动时配置一个或多个 RenderKit 实例。通过调用 RenderKitFactory 的 getRenderKit() 方法可以获得这些实例。因为 RenderKit 实例是共享的，所以它们必须以线程安全的方式实现。当前规范限制同一应用程序中存在多个起作用的 RenderKit 实例，因此需要一个了解如何处理这种情况的自定义 javax.faces.application.ViewHandler 实例。在规范的将来版本中，将取消此限制。

RenderKit 实例还必须提供一个 ResponseStateManager 实例，它在保存和恢复树结构和状态的过程中使用。

英文文档：

RenderKit represents a collection of Renderer instances that, together, know how to render JavaServer Faces UIComponent instances for a specific client. Typically, RenderKits are specialized for some combination of client device type, markup language, and/or user Locale. A RenderKit also acts as a Factory for associated Renderer instances, which perform the actual rendering process for each component.

A typical JavaServer Faces implementation will configure one or more RenderKit instances at web application startup. They are made available through calls to the getRenderKit() methods of RenderKitFactory. Because RenderKit instances are shared, they must be implemented in a thread-safe manner. Due to limitations in the current specification having multiple RenderKit instances at play in the same application requires a custom ViewHandler instance that is aware of how to deal with this case. This limitation will be lifted in a future version of the spec.

The RenderKit instance must also vend a ResponseStateManager instance, which is used in the process of saving and restoring tree structure and state.

Constructor Summary
RenderKit()
Method Summary
abstract void | addRenderer(String family, String rendererType, Renderer renderer) Register the specified Renderer instance, associated with the specified component family and rendererType, to the set of Renderers registered with this RenderKit, replacing any previously registered Renderer for this combination of identifiers.
abstract ResponseStream | createResponseStream(OutputStream out) Use the provided OutputStream to create a new ResponseStream instance.
abstract ResponseWriter | createResponseWriter(Writer writer, String contentTypeList, String characterEncoding) Use the provided Writer to create a new ResponseWriter instance for the specified (optional) content type, and character encoding.
abstract Renderer | getRenderer(String family, String rendererType) Return the Renderer instance most recently registered for the specified component family and rendererType, if any; otherwise, return null.
abstract ResponseStateManager | getResponseStateManager() Return an instance of ResponseStateManager to handle rendering technology specific state management decisions.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public RenderKit()
英文文档：

RenderKit

public RenderKit()
Method Detail

abstract public void addRenderer(String family, String rendererType, Renderer renderer)

将与指定组件 family 和 rendererType 关联的指定 Renderer 实例注册已向此 RenderKit 注册的 Renderer 集，将之前注册的任何 Renderer 替换成此标识符的组合。

family | 要注册的 Renderer 组件系列
rendererType | 要注册的 Renderer 的 Renderer 类型
renderer | 要注册的 Renderer 实例
Throws | NullPointerException: 如果 family、rendererType 或 renderer 为 null
英文文档：

addRenderer

public abstract void addRenderer(String family,
                                 String rendererType,
                                 Renderer renderer)

Register the specified Renderer instance, associated with the specified component family and rendererType, to the set of Renderers registered with this RenderKit, replacing any previously registered Renderer for this combination of identifiers.

Parameters:
family - Component family of the Renderer to register
rendererType - Renderer type of the Renderer to register
renderer - Renderer instance we are registering
Throws:
NullPointerException - if family or rendererType or renderer is null

abstract public Renderer getRenderer(String family, String rendererType)

返回为指定组件 family 和 rendererType 最新注册的 Renderer 实例（如果有）；否则返回 null。

family | 请求的 Renderer 实例的组件系列
rendererType | 请求的 Renderer 实例的 Renderer 类型
Throws | NullPointerException: 如果 family 或 rendererType 为 null
英文文档：

getRenderer

public abstract Renderer getRenderer(String family,
                                     String rendererType)

Return the Renderer instance most recently registered for the specified component family and rendererType, if any; otherwise, return null.

Parameters:
family - Component family of the requested Renderer instance
rendererType - Renderer type of the requested Renderer instance
Throws:
NullPointerException - if family or rendererType is null

abstract public ResponseStateManager getResponseStateManager()

返回 ResponseStateManager 实例，以处理呈现技术特有的状态管理决策。

英文文档：

getResponseStateManager

public abstract ResponseStateManager getResponseStateManager()

Return an instance of ResponseStateManager to handle rendering technology specific state management decisions.

abstract public ResponseWriter createResponseWriter(java.io.Writer writer, String contentTypeList, String characterEncoding)

使用提供的 Writer 创建具有指定（可选）内容类型和字符编码的新 ResponseWriter 实例。

建议实现者参考类 javax.servlet.ServletResponse 的 getCharacterEncoding() 方法，以获取此方法所需的 characterEncoding 值。我们已经获得了此响应的 Writer（因为它最终将传递给此方法），所以我们知道在呈现响应期间不能更改字符编码。

writer | 必须据以构建此 ResponseWriter 的 writer。
contentTypeList | 此响应的内容类型的“Accept 头样式 (Accept header style)”列表；如果 RenderKit 应该选择最适合的类型，则为 null。从当前版本起，此参数的标准 RenderKit 接受的值包括任何有效的“Accept 头样式”String，包括 String text/html、application/xhtml+xml、application/xml 或 text/xml。这在将来的版本中可能会发生变化。RenderKit 必须支持此参数使用直接来自 Accept HTTP 头的值，因此需要根据 Accept 头的规范进行解析。有关 Accept 头规范，请参见 RFC 2616 的第 14.1 节。
characterEncoding | 如“ISO-8859-1”（对于此 ResponseWriter）；如果 RenderKit 应该选择最合适的编码，则为 null。有关字符编码的列表，请参见 the IANA。
return | 新的 ResponseWriter。
Throws | IllegalArgumentException: 如果 contentTypeList 中找不到匹配的内容类型，或者使用与实现有关的最适应算法找不到合适的内容类型，或者对于参数 characterEncoding 找不到匹配的字符编码。
英文文档：

createResponseWriter

public abstract ResponseWriter createResponseWriter(Writer writer,
                                                    String contentTypeList,
                                                    String characterEncoding)

Use the provided Writer to create a new ResponseWriter instance for the specified (optional) content type, and character encoding.

Implementors are advised to consult the getCharacterEncoding() method of class ServletResponse to get the required value for the characterEncoding for this method. Since the Writer for this response will already have been obtained (due to it ultimately being passed to this method), we know that the character encoding cannot change during the rendering of the response.

Parameters:
writer - the Writer around which this ResponseWriter must be built.
contentTypeList - an "Accept header style" list of content types for this response, or null if the RenderKit should choose the best fit. As of the current version, the values accepted by the Standard render-kit for this parameter include any valid "Accept header style" String that includes the String text/html, application/xhtml+xml, application/xml or text/xml. This may change in a future version. The RenderKit must support a value for this argument that comes straight from the Accept HTTP header, and therefore requires parsing according to the specification of the Accept header. Please see Section 14.1 of RFC 2616 for the specification of the Accept header.
characterEncoding - such as "ISO-8859-1" for this ResponseWriter, or null if the RenderKit should choose the best fit. Please see the IANA for a list of character encodings.
Returns:
a new ResponseWriter.
Throws:
IllegalArgumentException - if no matching content type can be found in contentTypeList, no appropriate content type can be found with the implementation dependent best fit algorithm, or no matching character encoding can be found for the argument characterEncoding.

abstract public ResponseStream createResponseStream(java.io.OutputStream out)

使用提供的 OutputStream 创建新的 ResponseStream 实例。

英文文档：

createResponseStream

public abstract ResponseStream createResponseStream(OutputStream out)

Use the provided OutputStream to create a new ResponseStream instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RenderKitFactory (Java EE 5)

javax.faces.render
Class RenderKitFactory

java.lang.Object
    extended by  javax.faces.render.RenderKitFactory

public abstract class RenderKitFactory
extends Object

RenderKitFactory 是注册并返回 RenderKit 实例的工厂对象。JavaServer Faces 实现必须至少提供一个默认的 RenderKit 实现。高级实现（或外部第三方库）可能提供附加的 RenderKit 实现（以呈现工具包标识符作为键），用来对相同的组件执行不同类型的呈现。

每个利用 JavaServer Faces 的 Web 应用程序都必须有一个 RenderKitFactory 实例。可以通过可移植的方式获取此实例，即调用：

RenderKitFactory factory = (RenderKitFactory)
FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
英文文档：

RenderKitFactory is a factory object that registers and returns RenderKit instances. Implementations of JavaServer Faces must provide at least a default implementation of RenderKit. Advanced implementations (or external third party libraries) may provide additional RenderKit implementations (keyed by render kit identifiers) for performing different types of rendering for the same components.

There must be one RenderKitFactory instance per web application that is utilizing JavaServer Faces. This instance can be acquired, in a portable manner, by calling:

   RenderKitFactory factory = (RenderKitFactory)
    FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);

Field Summary
static String HTML_BASIC_RENDER_KIT
The render kit identifier of the default RenderKit instance for this JavaServer Faces implementation.
Constructor Summary
RenderKitFactory()
Method Summary
abstract void | addRenderKit(String renderKitId, RenderKit renderKit) Register the specified RenderKit instance, associated with the specified renderKitId, to be supported by this RenderKitFactory, replacing any previously registered RenderKit for this identifier.
abstract RenderKit | getRenderKit(FacesContext context, String renderKitId) Return a RenderKit instance for the specified render kit identifier, possibly customized based on dynamic characteristics of the specified FacesContext, if non-null.
abstract Iterator<String> | getRenderKitIds() Return an Iterator over the set of render kit identifiers registered with this factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

HTML_BASIC_RENDER_KIT

public static final String HTML_BASIC_RENDER_KIT

The render kit identifier of the default RenderKit instance for this JavaServer Faces implementation.

See Also:
Constant Field Values
Constructor Detail

public RenderKitFactory()
英文文档：

RenderKitFactory

public RenderKitFactory()
Method Detail

abstract public void addRenderKit(String renderKitId, RenderKit renderKit)

注册此 RenderKitFactory 要支持的与指定 renderKitId 关联的指定 RenderKit 实例，同时替换之前为此标识符注册的任何 RenderKit。

renderKitId | 要注册的 RenderKit 的标识符
renderKit | 要注册的 RenderKit 实例
Throws | NullPointerException: 如果 renderKitId 或 renderKit 为 null
英文文档：

addRenderKit

public abstract void addRenderKit(String renderKitId,
                                  RenderKit renderKit)

Register the specified RenderKit instance, associated with the specified renderKitId, to be supported by this RenderKitFactory, replacing any previously registered RenderKit for this identifier.

Parameters:
renderKitId - Identifier of the RenderKit to register
renderKit - RenderKit instance that we are registering
Throws:
NullPointerException - if renderKitId or renderKit is null

abstract public RenderKit getRenderKit(FacesContext context, String renderKitId)

为指定的呈现工具包标识符返回 RenderKit 实例，如果非 null，则可能根据指定的 FacesContext 的动态特征进行了自定义。如果指定的标识符没有任何已注册 RenderKit，则返回 null。通过 getRenderKitIds() 方法可以获得一组可用的呈现工具包标识符。

context | 当前正在处理的请求的 FacesContext；如果不可用，则为 null。
renderKitId | 请求的 RenderKit 实例的呈现工具包标识符
Throws | IllegalArgumentException: 如果对于指定的标识符没有任何可以返回的 RenderKit 实例
Throws | NullPointerException: 如果 renderKitId 为 null
英文文档：

getRenderKit

public abstract RenderKit getRenderKit(FacesContext context,
                                       String renderKitId)

Return a RenderKit instance for the specified render kit identifier, possibly customized based on dynamic characteristics of the specified FacesContext, if non-null. If there is no registered RenderKit for the specified identifier, return null. The set of available render kit identifiers is available via the getRenderKitIds() method.

Parameters:
context - FacesContext for the request currently being processed, or null if none is available.
renderKitId - Render kit identifier of the requested RenderKit instance
Throws:
IllegalArgumentException - if no RenderKit instance can be returned for the specified identifier
NullPointerException - if renderKitId is null

abstract public java.util.Iterator<E> getRenderKitIds()

返回一个对向此工厂注册的呈现工具包标识符集进行迭代的 Iterator。此集合必须包括 RenderKitFactory.HTML_BASIC_RENDER_KIT 指定的值。

英文文档：

getRenderKitIds

public abstract Iterator<String> getRenderKitIds()

Return an Iterator over the set of render kit identifiers registered with this factory. This set must include the value specified by RenderKitFactory.HTML_BASIC_RENDER_KIT.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResponseStateManager (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.render
Class ResponseStateManager

java.lang.Object
    extended by  javax.faces.render.ResponseStateManager

public abstract class ResponseStateManager
extends Object

ResponseStateManager 是 javax.faces.application.StateManager 的帮助类，它了解用来生成响应的特定呈现技术。它是单件抽象类，由 RenderKit 提供。此类了解保存状态的机制，不管它是隐藏字段、会话还是两者的组合。

英文文档：

ResponseStateManager is the helper class to StateManager that knows the specific rendering technology being used to generate the response. It is a singleton abstract class, vended by the RenderKit. This class knows the mechanics of saving state, whether it be in hidden fields, session, or some combination of the two.

Field Summary
static String | RENDER_KIT_ID_PARAM The name of the request parameter used by the default implementation of ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext) to derive a RenderKit ID.
static String | VIEW_STATE_PARAM Implementations must use this value as the name and id of the client parameter in which to save the state between requests.
Constructor Summary
ResponseStateManager()
Method Summary
 Object getComponentStateToRestore(FacesContext context)
Deprecated. This method has been replaced by getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.
 Object getState(FacesContext context, String viewId)
The implementation must inspect the current request and return an Object representing the tree structure and component state passed in to a previous invocation of writeState(javax.faces.context.FacesContext,java.lang.Object).
 Object getTreeStructureToRestore(FacesContext context, String viewId)
Deprecated. This method has been replaced by getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.
 boolean isPostback(FacesContext context)
Return true if the current request is a postback.
 void writeState(FacesContext context, Object state)
 void writeState(FacesContext context, StateManager.SerializedView state)
Deprecated. This method has been replaced by writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

RENDER_KIT_ID_PARAM

public static final String RENDER_KIT_ID_PARAM

The name of the request parameter used by the default implementation of ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext) to derive a RenderKit ID.

See Also:
Constant Field Values

英文文档：

VIEW_STATE_PARAM

public static final String VIEW_STATE_PARAM

Implementations must use this value as the name and id of the client parameter in which to save the state between requests.

Since:
1.2
See Also:
Constant Field Values
Constructor Detail

public ResponseStateManager()
英文文档：

ResponseStateManager

public ResponseStateManager()
Method Detail

public void writeState(FacesContext context, Object state) throws java.io.IOException
英文文档：

writeState

public void writeState(FacesContext context,
                       Object state)
                throws IOException
Throws:
IOException

public void writeState(FacesContext context, StateManager.SerializedView state) throws java.io.IOException

接受参数 state 并使用当前的 ResponseWriter 将其写入到输出，此 writer 必须已位于合适位置。

如果 javax.faces.application.StateManager.SerializedView 将被写出到隐藏字段，则实现必须谨慎地执行所有必要的字符替换，以便 String 适合用作 HTTP 请求参数。

如果此应用程序的状态保存方法为 javax.faces.application.StateManager#STATE_SAVING_METHOD_CLIENT，则实现可以对要保存到客户端的状态进行加密。建议状态对客户端不可读，并且易于发现是否被篡改。引用实现遵守这些建议。

deprecated | 此方法由 #writeState(javax.faces.context.FacesContext,java.lang.Object) 取代。此方法的默认实现不执行任何操作。
context | 当前请求的 FacesContext 实例
state | 以前保存的序列化状态信息
英文文档：

writeState

public void writeState(FacesContext context,
                       StateManager.SerializedView state)
                throws IOException
Deprecated. This method has been replaced by writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.

Take the argument state and write it into the output using the current ResponseWriter, which must be correctly positioned already.

If the StateManager.SerializedView is to be written out to hidden fields, the implementation must take care to make all necessary character replacements to make the Strings suitable for inclusion as an HTTP request paramater.

If the state saving method for this application is StateManager.STATE_SAVING_METHOD_CLIENT, the implementation may encrypt the state to be saved to the client. We recommend that the state be unreadable by the client, and also be tamper evident. The reference implementation follows these recommendations.

Parameters:
context - The FacesContext instance for the current request
state - The serialized state information previously saved
Throws:
IOException

public Object getState(FacesContext context, String viewId)

实现必须检查当前的请求并返回一个 Object，用来表示传入以前调用的 #writeState(javax.faces.context.FacesContext,java.lang.Object) 的树结构和组件状态。

为了向后兼容现有的 ResponseStateManager 实现，此方法的默认实现调用 #getTreeStructureToRestore 和 #getComponentStateToRestore，并创建和返回包含两个元素的 Object 数组，其中元素 0 包含 structure 属性，元素 1 包含 SerializedView 的 state 属性。

since | 1.2
context | 当前请求的 FacesContext 实例
viewId | 要恢复的视图的视图标识符
return | 传入 writeState 的树结构和组件状态 Object。如果为初始请求，则此方法返回 null。
英文文档：

getState

public Object getState(FacesContext context,
                       String viewId)

The implementation must inspect the current request and return an Object representing the tree structure and component state passed in to a previous invocation of writeState(javax.faces.context.FacesContext,java.lang.Object).

For backwards compatability with existing ResponseStateManager implementations, the default implementation of this method calls getTreeStructureToRestore(javax.faces.context.FacesContext, java.lang.String) and getComponentStateToRestore(javax.faces.context.FacesContext) and creates and returns a two element Object array with element zero containing the structure property and element one containing the state property of the SerializedView.

Parameters:
context - The FacesContext instance for the current request
viewId - View identifier of the view to be restored
Returns:
the tree structure and component state Object passed in to writeState. If this is an initial request, this method returns null.
Since:
1.2

public Object getTreeStructureToRestore(FacesContext context, String viewId)

实现必须检查当前的请求并返回以前调用 writeState() 时传入的树结构 Object。

deprecated | 此方法由 #getState 取代。默认实现返回 null。
context | 当前请求的 FacesContext 实例
viewId | 要恢复的视图的视图标识符
英文文档：

getTreeStructureToRestore

public Object getTreeStructureToRestore(FacesContext context,
                                        String viewId)
Deprecated. This method has been replaced by getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.

The implementation must inspect the current request and return the tree structure Object passed to it on a previous invocation of writeState().

Parameters:
context - The FacesContext instance for the current request
viewId - View identifier of the view to be restored

public Object getComponentStateToRestore(FacesContext context)

实现必须检查当前的请求并返回以前调用 writeState() 时传入的组件状态 Object。

deprecated | 此方法由 #getState 取代。默认实现返回 null。
context | 当前请求的 FacesContext 实例
英文文档：

getComponentStateToRestore

public Object getComponentStateToRestore(FacesContext context)
Deprecated. This method has been replaced by getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.

The implementation must inspect the current request and return the component state Object passed to it on a previous invocation of writeState().

Parameters:
context - The FacesContext instance for the current request

public boolean isPostback(FacesContext context)

如果当前请求为 postback，则返回 true。在还原视图 阶段利用此方法确定应该调用 javax.faces.application.ViewHandler#restoreView 还是 javax.faces.application.ViewHandler#createView。如果此 ResponseStateManager 实例写出以前此请求为 postback 时的请求的状态，则默认实现必须返回 true；否则返回 false。

在标准 HTML RenderKit 中，此方法的实现必须参考 javax.faces.context.ExternalContext 的 requestParameterMap，当且仅当有一个键等于符号常量 #VIEW_STATE_PARAM 的值时返回 true。

为了向后兼容 JSF 1.2 以前的 ResponseStateManager 实现，提供了一个默认实现，该实现参考 javax.faces.context.ExternalContext 的 requestParameterMap，并且当其大小大于 0 时返回 true。

since 1.2
英文文档：

isPostback

public boolean isPostback(FacesContext context)

Return true if the current request is a postback. This method is leveraged from the Restore View Phase to determine if ViewHandler.restoreView(javax.faces.context.FacesContext, java.lang.String) or ViewHandler.createView(javax.faces.context.FacesContext, java.lang.String) should be called. The default implementation must return true if this ResponseStateManager instance wrote out state on a previous request to which this request is a postback, false otherwise.

The implementation if this method for the Standard HTML RenderKit must consult the ExternalContext's requestParameterMap and return true if and only if there is a key equal to the value of the symbolic constant VIEW_STATE_PARAM.

For backwards compatability with implementations of ResponseStateManager prior to JSF 1.2, a default implementation is provided that consults the ExternalContext's requestParameterMap and return true if its size is greater than 0.

Since:
1.2
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.validator (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.validator

Interface defining the validator model, and concrete validator implementation classes.

See:
Description

Interface Summary
Validator A Validator implementation is a class that can perform validation (correctness checks) on a EditableValueHolder.

Class Summary
DoubleRangeValidator | DoubleRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum values.
LengthValidator | LengthValidator is a Validator that checks the number of characters in the String representation of the value of the associated component.
LongRangeValidator | LongRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum values.
MethodExpressionValidator | MethodExpressionValidator is a Validator that wraps a MethodExpression, and it performs validation by executing a method on an object identified by the MethodExpression.

Exception Summary
ValidatorException A ValidatorException is an exception thrown by the validate() method of a Validator to indicate that validation failed.

Package javax.faces.validator Description

Interface defining the validator model, and concrete validator implementation classes.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.validator Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.validator

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.validator.DoubleRangeValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • javax.faces.validator.LengthValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • javax.faces.validator.LongRangeValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • javax.faces.validator.MethodExpressionValidator (implements javax.faces.component.StateHolder, javax.faces.validator.Validator)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.faces.FacesException
            • javax.faces.validator.ValidatorException

Interface Hierarchy

  • java.util.EventListener
    • javax.faces.validator.Validator
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Validator (Java EE 5)

javax.faces.validator
Interface Validator

All Superinterfaces:
EventListener
All Known Implementing Classes:
DoubleRangeValidator, LengthValidator, LongRangeValidator, MethodExpressionValidator
public interface Validator
extends EventListener

Implements: java.util.EventListener
Implemented by: DoubleRangeValidator, LengthValidator, LongRangeValidator, MethodExpressionValidator

Validator 实现是可以对 javax.faces.component.EditableValueHolder 执行验证（正确性检查）的类。视图中的每个 javax.faces.component.EditableValueHolder 可以关联 0 个或多个 Validator，并在请求处理生命周期的处理验证 阶段调用这些验证器。

各个 Validator 应检查传递给它的值和组件，并抛出包含 javax.faces.application.FacesMessage 的 ValidatorException，同时记录任何不符合必要规则的失败情况。

为了实现最大的普遍性，应该可以根据 Validator 实现类的属性配置 Validator 实例。例如，范围检查 Validator 应支持配置要使用的最小值和最大值。

Validator 实现必须提供一个公共的无参构造方法。此外，如果 Validator 类希望与视图一同保存和恢复配置的属性值，则该实现还必须实现 StateHolder。

英文文档：

A Validator implementation is a class that can perform validation (correctness checks) on a EditableValueHolder. Zero or more Validators can be associated with each EditableValueHolder in the view, and are called during the Process Validations phase of the request processing lifecycle.

Individual Validators should examine the value and component that they are passed, and throw a ValidatorException containing a FacesMessage, documenting any failures to conform to the required rules.

For maximum generality, Validator instances may be configurable based on properties of the Validator implementation class. For example, a range check Validator might support configuration of the minimum and maximum values to be used.

Validator implementations must have a zero-arguments public constructor. In addition, if the Validator class wishes to have configuration property values saved and restored with the view, the implementation must also implement StateHolder.

Field Summary
static String NOT_IN_RANGE_MESSAGE_ID
Deprecated. Use DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID or LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID instead.
Method Summary
 void validate(FacesContext context, UIComponent component, Object value)
Perform the correctness checks implemented by this Validator against the specified UIComponent.

Field Detail

英文文档：

NOT_IN_RANGE_MESSAGE_ID

static final String NOT_IN_RANGE_MESSAGE_ID
Deprecated. Use DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID or LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID instead.

The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set. The message format string for this message may optionally include a {0} placeholder, which will be replaced by the configured minimum value, and a {1} placeholder, which will be replaced by the configured maximum value.

See Also:
Constant Field Values
Method Detail

public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException

根据指定的 UIComponent 执行此 Validator 实现的正确性检查。如果发现任何违规情况，将抛出包含描述该失败的 javax.faces.application.FacesMessage 的 ValidatorException。

context | 要处理的请求的 FacesContext
component | 要检查正确性的 UIComponent
value | 要验证的值
Throws | ValidatorException: 如果验证失败
Throws | NullPointerException: 如果 context 或 component 为 null
英文文档：

validate

void validate(FacesContext context,
              UIComponent component,
              Object value)
              throws ValidatorException

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the FacesMessage describing the failure.

Parameters:
context - FacesContext for the request we are processing
component - UIComponent we are checking for correctness
value - the value to validate
Throws:
ValidatorException - if validation fails
NullPointerException - if context or component is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DoubleRangeValidator (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.validator
Class DoubleRangeValidator

java.lang.Object
    extended by  javax.faces.validator.DoubleRangeValidator
All Implemented Interfaces:
EventListener, StateHolder, Validator
public class DoubleRangeValidator
extends Object
implements Validator, StateHolder

Implements: Validator, StateHolder

DoubleRangeValidator 是一个 Validator，它根据指定的最小值和最大值检查相应组件的值。实现以下算法：

  • 如果传递的值为 null，则立即退出。
  • 如果当前组件值不是浮点类型，或者是可以转换成 double 的 String，则抛出包含 TYPE_MESSAGE_ID 消息的 ValidatorException。
  • 如果对此 Validator 配置了 maximum 和 minimum 属性，则根据这两个限制检查组件值。如果组件值不在此指定范围内，则抛出包含 #NOT_IN_RANGE_MESSAGE_ID 消息的 ValidatorException。
  • 如果对此 Validator 配置了 maximum 属性，则根据此限制检查组件值。如果组件值大于指定的最大值，则抛出包含 MAXIMUM_MESSAGE_ID 消息的 ValidatorException。
  • 如果对此 Validator 配置了 minimum 属性，则根据此限制检查组件值。如果组件值小于指定的最小值，则抛出包含 MINIMUM_MESSAGE_ID 消息的 ValidatorException。

对于所有导致抛出 ValidatorException 的上述原因，如果有些消息的参数匹配验证器参数，则这些参数的值必须使用转换器 ID javax.faces.Number 在应用程序中注册的 Converter 转换。这使值可以根据当前的 Locale 进行本地化。

英文文档：

DoubleRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum values. The following algorithm is implemented:

  • If the passed value is null, exit immediately.
  • If the current component value is not a floating point type, or a String that is convertible to double, throw a ValidatorException containing a TYPE_MESSAGE_ID message.
  • If both a maximum and minimum property has been configured on this Validator, check the component value against both limits. If the component value is not within this specified range, throw a ValidatorException containing a NOT_IN_RANGE_MESSAGE_ID message.
  • If a maximum property has been configured on this Validator, check the component value against this limit. If the component value is greater than the specified maximum, throw a ValidatorException containing a MAXIMUM_MESSAGE_ID message.
  • If a minimum property has been configured on this Validator, check the component value against this limit. If the component value is less than the specified minimum, throw a ValidatorException containing a MINIMUM_MESSAGE_ID message.

For all of the above cases that cause a ValidatorException to be thrown, if there are parameters to the message that match up with validator parameters, the values of these parameters must be converted using the Converter registered in the application under the converter id javax.faces.Number. This allows the values to be localized according to the current Locale.

Field Summary
static String | MAXIMUM_MESSAGE_ID The message identifier of the FacesMessage to be created if the maximum value check fails.
static String | MINIMUM_MESSAGE_ID The message identifier of the FacesMessage to be created if the minimum value check fails.
static String | NOT_IN_RANGE_MESSAGE_ID The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set.
static String | TYPE_MESSAGE_ID The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type.
static String | VALIDATOR_ID The standard converter id for this converter.
Constructor Summary
DoubleRangeValidator()
Construct a Validator with no preconfigured limits.
DoubleRangeValidator(double maximum)
Construct a Validator with the specified preconfigured limit.
DoubleRangeValidator(double maximum, double minimum)
Construct a Validator with the specified preconfigured limits.
Method Summary
boolean | equals(Object otherObj)
double | getMaximum() Return the maximum value to be enforced by this Validator or Double.MAX_VALUE if it has not been set.
double | getMinimum() Return the minimum value to be enforced by this Validator, or Double.MIN_VALUE if it has not been set.
int | hashCode()
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setMaximum(double maximum) Set the maximum value to be enforced by this Validator.
void | setMinimum(double minimum) Set the minimum value to be enforced by this Validator.
void | setTransient(boolean transientValue) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
void | validate(FacesContext context, UIComponent component, Object value) Perform the correctness checks implemented by this Validator against the specified UIComponent.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

VALIDATOR_ID

public static final String VALIDATOR_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

MAXIMUM_MESSAGE_ID

public static final String MAXIMUM_MESSAGE_ID

The message identifier of the FacesMessage to be created if the maximum value check fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured maximum value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

MINIMUM_MESSAGE_ID

public static final String MINIMUM_MESSAGE_ID

The message identifier of the FacesMessage to be created if the minimum value check fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured minimum value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

NOT_IN_RANGE_MESSAGE_ID

public static final String NOT_IN_RANGE_MESSAGE_ID

The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured minimum value.
  • {1} replaced by the configured maximum value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

TYPE_MESSAGE_ID

public static final String TYPE_MESSAGE_ID

The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type. The message format string for this message may optionally include a {0} placeholder that will be replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public DoubleRangeValidator()

构造没有预配置限制的 Validator。

英文文档：

DoubleRangeValidator

public DoubleRangeValidator()

Construct a Validator with no preconfigured limits.

public DoubleRangeValidator(double maximum)

构造具有指定预配置限制的 Validator。

maximum 允许的最大值
英文文档：

DoubleRangeValidator

public DoubleRangeValidator(double maximum)

Construct a Validator with the specified preconfigured limit.

Parameters:
maximum - Maximum value to allow

public DoubleRangeValidator(double maximum, double minimum)

构造具有指定预配置限制的 Validator。

maximum | 允许的最大值
minimum | 允许的最小值
英文文档：

DoubleRangeValidator

public DoubleRangeValidator(double maximum,
                            double minimum)

Construct a Validator with the specified preconfigured limits.

Parameters:
maximum - Maximum value to allow
minimum - Minimum value to allow
Method Detail

public double getMaximum()

返回此 Validator 强制执行的最大值；如果没有设置，则返回 Double.MAX_VALUE。

英文文档：

getMaximum

public double getMaximum()

Return the maximum value to be enforced by this Validator or Double.MAX_VALUE if it has not been set.

public void setMaximum(double maximum)

设置此 Validator 强制执行的最大值。

maximum 新的最大值
英文文档：

setMaximum

public void setMaximum(double maximum)

Set the maximum value to be enforced by this Validator.

Parameters:
maximum - The new maximum value

public double getMinimum()

返回此 Validator 强制执行的最小值；如果没有设置，则返回 Double.MIN_VALUE。

英文文档：

getMinimum

public double getMinimum()

Return the minimum value to be enforced by this Validator, or Double.MIN_VALUE if it has not been set.

public void setMinimum(double minimum)

设置此 Validator 强制执行的最小值。

minimum 新的最小值
英文文档：

setMinimum

public void setMinimum(double minimum)

Set the minimum value to be enforced by this Validator.

Parameters:
minimum - The new minimum value

public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
Throws | ValidatorException: NullPointerException 如果验证失败
英文文档：

validate

public void validate(FacesContext context,
                     UIComponent component,
                     Object value)
              throws ValidatorException
Description copied from interface: Validator

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the FacesMessage describing the failure.

Specified by:
validate in interface Validator
Parameters:
context - FacesContext for the request we are processing
component - UIComponent we are checking for correctness
value - the value to validate
Throws:
NullPointerException - if context or component is null
ValidatorException - if validation fails

public boolean equals(Object otherObj)
英文文档：

equals

public boolean equals(Object otherObj)
Overrides:
equals in class Object

public int hashCode()
英文文档：

hashCode

public int hashCode()
Overrides:
hashCode in class Object

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean transientValue)
英文文档：

setTransient

public void setTransient(boolean transientValue)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
transientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


LengthValidator (Java EE 5)

javax.faces.validator
Class LengthValidator

java.lang.Object
    extended by  javax.faces.validator.LengthValidator
All Implemented Interfaces:
EventListener, StateHolder, Validator
public class LengthValidator
extends Object
implements Validator, StateHolder

Implements: Validator, StateHolder

LengthValidator 是一个 Validator，它检查关联组件值的 String 表示形式中的字符数。实现以下算法：

  • 如有必要，可调用其 toString 方法将传递的值转换为 String。
  • 如果对此 Validator 配置了 maximum 属性，则根据此限制检查转换的 String。如果 String 长度大于指定的最大值，则抛出包含 MAXIMUM_MESSAGE_ID 消息的 ValidatorException。
  • 如果对此 Validator 配置了 minimum 属性，则根据此限制检查转换的 String。如果 String 长度小于指定的最小值，则抛出包含 MINIMUM_MESSAGE_ID 消息的 ValidatorException。

对于所有导致抛出 ValidatorException 的上述原因，如果有些消息的参数匹配验证器参数，则这些参数的值必须使用转换器 ID javax.faces.Number 在应用程序中注册的 Converter 转换。这使值可以根据当前的 Locale 进行本地化。

英文文档：

LengthValidator is a Validator that checks the number of characters in the String representation of the value of the associated component. The following algorithm is implemented:

  • Convert the passed value to a String, if necessary, by calling its toString() method.
  • If a maximum property has been configured on this Validator, check the length of the converted String against this limit. If the String length is larger than the specified maximum, throw a ValidatorException containing a a MAXIMUM_MESSAGE_ID message.
  • If a minimum property has been configured on this Validator, check the length of the converted String against this limit. If the String length is less than the specified minimum, throw a ValidatorException containing a a MINIMUM_MESSAGE_ID message.

For all of the above cases that cause a ValidatorException to be thrown, if there are parameters to the message that match up with validator parameters, the values of these parameters must be converted using the Converter registered in the application under the converter id javax.faces.Number. This allows the values to be localized according to the current Locale.

Field Summary
static String | MAXIMUM_MESSAGE_ID The message identifier of the FacesMessage to be created if the maximum length check fails.
static String | MINIMUM_MESSAGE_ID The message identifier of the FacesMessage to be created if the minimum length check fails.
static String | VALIDATOR_ID The standard validator id for this validator.
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
Constructor Summary
LengthValidator()
Construct a Validator with no preconfigured limits.
LengthValidator(int maximum)
Construct a Validator with the specified preconfigured limit.
LengthValidator(int maximum, int minimum)
Construct a Validator with the specified preconfigured limits.
Method Summary
boolean | equals(Object otherObj)
int | getMaximum() Return the maximum length to be enforced by this Validator, or 0 if the maximum has not been set.
int | getMinimum() Return the minimum length to be enforced by this Validator, or 0 if the minimum has not been set.
int | hashCode()
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setMaximum(int maximum) Set the maximum length to be enforced by this Validator.
void | setMinimum(int minimum) Set the minimum length to be enforced by this Validator.
void | setTransient(boolean transientValue) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
void | validate(FacesContext context, UIComponent component, Object value) Perform the correctness checks implemented by this Validator against the specified UIComponent.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

VALIDATOR_ID

public static final String VALIDATOR_ID

The standard validator id for this validator.

See Also:
Constant Field Values

英文文档：

MAXIMUM_MESSAGE_ID

public static final String MAXIMUM_MESSAGE_ID

The message identifier of the FacesMessage to be created if the maximum length check fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured maximum length.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

MINIMUM_MESSAGE_ID

public static final String MINIMUM_MESSAGE_ID

The message identifier of the FacesMessage to be created if the minimum length check fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured minimum length.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public LengthValidator()

构造没有预配置限制的 Validator。

英文文档：

LengthValidator

public LengthValidator()

Construct a Validator with no preconfigured limits.

public LengthValidator(int maximum)

构造具有指定预配置限制的 Validator。

maximum 允许的最大值
英文文档：

LengthValidator

public LengthValidator(int maximum)

Construct a Validator with the specified preconfigured limit.

Parameters:
maximum - Maximum value to allow

public LengthValidator(int maximum, int minimum)

构造具有指定预配置限制的 Validator。

maximum | 允许的最大值
minimum | 允许的最小值
英文文档：

LengthValidator

public LengthValidator(int maximum,
                       int minimum)

Construct a Validator with the specified preconfigured limits.

Parameters:
maximum - Maximum value to allow
minimum - Minimum value to allow
Method Detail

public int getMaximum()

返回此 Validator 强制执行的最大长度；如果没有设置最大值，则返回 0。

英文文档：

getMaximum

public int getMaximum()

Return the maximum length to be enforced by this Validator, or 0 if the maximum has not been set.

public void setMaximum(int maximum)

设置此 Validator 强制执行的最大长度。

maximum 新的最大值
英文文档：

setMaximum

public void setMaximum(int maximum)

Set the maximum length to be enforced by this Validator.

Parameters:
maximum - The new maximum value

public int getMinimum()

返回此 Validator 强制执行的最小长度；如果没有设置最小值，则返回 0。

英文文档：

getMinimum

public int getMinimum()

Return the minimum length to be enforced by this Validator, or 0 if the minimum has not been set.

public void setMinimum(int minimum)

设置此 Validator 强制执行的最小长度。

minimum 新的最小值
英文文档：

setMinimum

public void setMinimum(int minimum)

Set the minimum length to be enforced by this Validator.

Parameters:
minimum - The new minimum value

public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
Throws | ValidatorException: NullPointerException 如果验证失败
英文文档：

validate

public void validate(FacesContext context,
                     UIComponent component,
                     Object value)
              throws ValidatorException
Description copied from interface: Validator

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the FacesMessage describing the failure.

Specified by:
validate in interface Validator
Parameters:
context - FacesContext for the request we are processing
component - UIComponent we are checking for correctness
value - the value to validate
Throws:
NullPointerException - if context or component is null
ValidatorException - if validation fails

public boolean equals(Object otherObj)
英文文档：

equals

public boolean equals(Object otherObj)
Overrides:
equals in class Object

public int hashCode()
英文文档：

hashCode

public int hashCode()
Overrides:
hashCode in class Object

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean transientValue)
英文文档：

setTransient

public void setTransient(boolean transientValue)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
transientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LongRangeValidator (Java EE 5)

javax.faces.validator
Class LongRangeValidator

java.lang.Object
    extended by  javax.faces.validator.LongRangeValidator
All Implemented Interfaces:
EventListener, StateHolder, Validator
public class LongRangeValidator
extends Object
implements Validator, StateHolder

Implements: Validator, StateHolder

LongRangeValidator 是一个 Validator，它根据指定的最小值和最大值检查相应组件的值。实现以下算法：

  • 如果传递的值为 null，则立即退出。
  • 如果当前组件值不是浮点类型，或者是可以转换成 long 的 String，则抛出包含 TYPE_MESSAGE_ID 消息的 ValidatorException。
  • 如果对此 Validator 配置了 maximum 和 minimum 属性，则根据这两个限制检查组件值。如果组件值不在此指定范围内，则抛出包含 #NOT_IN_RANGE_MESSAGE_ID 消息的 ValidatorException。
  • 如果对此 Validator 配置了 maximum 属性，则根据此限制检查组件值。如果组件值大于指定的最大值，则抛出包含 MAXIMUM_MESSAGE_ID 消息的 ValidatorException。
  • 如果对此 Validator 配置了 minimum 属性，则根据此限制检查组件值。如果组件值小于指定的最小值，则抛出包含 MINIMUM_MESSAGE_ID 消息的 ValidatorException。

对于所有导致抛出 ValidatorException 的上述原因，如果有些消息的参数匹配验证器参数，则这些参数的值必须使用转换器 ID javax.faces.Number 在应用程序中注册的 Converter 转换。这使值可以根据当前的 Locale 进行本地化。

英文文档：

LongRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum values. The following algorithm is implemented:

  • If the passed value is null, exit immediately.
  • If the current component value is not a floating point type, or a String that is convertible to long, throw a ValidatorException containing a TYPE_MESSAGE_ID message.
  • If both a maximum and minimum property has been configured on this Validator, check the component value against both limits. If the component value is not within this specified range, throw a ValidatorException containing a NOT_IN_RANGE_MESSAGE_ID message.
  • If a maximum property has been configured on this Validator, check the component value against this limit. If the component value is greater than the specified maximum, throw a ValidatorException containing a MAXIMUM_MESSAGE_ID message.
  • If a minimum property has been configured on this Validator, check the component value against this limit. If the component value is less than the specified minimum, throw a ValidatorException containing a MINIMUM_MESSAGE_ID message.

For all of the above cases that cause a ValidatorException to be thrown, if there are parameters to the message that match up with validator parameters, the values of these parameters must be converted using the Converter registered in the application under the converter id javax.faces.Number. This allows the values to be localized according to the current Locale.

Field Summary
static String | MAXIMUM_MESSAGE_ID The message identifier of the FacesMessage to be created if the maximum value check fails.
static String | MINIMUM_MESSAGE_ID The message identifier of the FacesMessage to be created if the minimum value check fails.
static String | NOT_IN_RANGE_MESSAGE_ID The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set.
static String | TYPE_MESSAGE_ID The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type.
static String | VALIDATOR_ID The standard converter id for this converter.
Constructor Summary
LongRangeValidator()
Construct a Validator with no preconfigured limits.
LongRangeValidator(long maximum)
Construct a Validator with the specified preconfigured limit.
LongRangeValidator(long maximum, long minimum)
Construct a Validator with the specified preconfigured limits.
Method Summary
boolean | equals(Object otherObj)
long | getMaximum() Return the maximum value to be enforced by this Validator.
long | getMinimum() Return the minimum value to be enforced by this Validator.
int | hashCode()
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setMaximum(long maximum) Set the maximum value to be enforced by this Validator.
void | setMinimum(long minimum) Set the minimum value to be enforced by this Validator.
void | setTransient(boolean transientValue) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
void | validate(FacesContext context, UIComponent component, Object value) Perform the correctness checks implemented by this Validator against the specified UIComponent.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

VALIDATOR_ID

public static final String VALIDATOR_ID

The standard converter id for this converter.

See Also:
Constant Field Values

英文文档：

MAXIMUM_MESSAGE_ID

public static final String MAXIMUM_MESSAGE_ID

The message identifier of the FacesMessage to be created if the maximum value check fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured maximum value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

MINIMUM_MESSAGE_ID

public static final String MINIMUM_MESSAGE_ID

The message identifier of the FacesMessage to be created if the minimum value check fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured minimum value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

NOT_IN_RANGE_MESSAGE_ID

public static final String NOT_IN_RANGE_MESSAGE_ID

The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the configured minimum value.
  • {1} replaced by the configured maximum value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values

英文文档：

TYPE_MESSAGE_ID

public static final String TYPE_MESSAGE_ID

The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type. The message format string for this message may optionally include a {0} placeholder that will be replaced by a String whose value is the label of the input component that produced this message.

See Also:
Constant Field Values
Constructor Detail

public LongRangeValidator()

构造没有预配置限制的 Validator。

英文文档：

LongRangeValidator

public LongRangeValidator()

Construct a Validator with no preconfigured limits.

public LongRangeValidator(long maximum)

构造具有指定预配置限制的 Validator。

maximum 允许的最大值
英文文档：

LongRangeValidator

public LongRangeValidator(long maximum)

Construct a Validator with the specified preconfigured limit.

Parameters:
maximum - Maximum value to allow

public LongRangeValidator(long maximum, long minimum)

构造具有指定预配置限制的 Validator。

maximum | 允许的最大值
minimum | 允许的最小值
英文文档：

LongRangeValidator

public LongRangeValidator(long maximum,
                          long minimum)

Construct a Validator with the specified preconfigured limits.

Parameters:
maximum - Maximum value to allow
minimum - Minimum value to allow
Method Detail

public long getMaximum()

返回此 Validator 强制执行的最大值。

英文文档：

getMaximum

public long getMaximum()

Return the maximum value to be enforced by this Validator.

public void setMaximum(long maximum)

设置此 Validator 强制执行的最大值。

maximum 新的最大值
英文文档：

setMaximum

public void setMaximum(long maximum)

Set the maximum value to be enforced by this Validator.

Parameters:
maximum - The new maximum value

public long getMinimum()

返回此 Validator 强制执行的最小值。

英文文档：

getMinimum

public long getMinimum()

Return the minimum value to be enforced by this Validator.

public void setMinimum(long minimum)

设置此 Validator 强制执行的最小值。

minimum 新的最小值
英文文档：

setMinimum

public void setMinimum(long minimum)

Set the minimum value to be enforced by this Validator.

Parameters:
minimum - The new minimum value

public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
Throws | ValidatorException: NullPointerException 如果验证失败
英文文档：

validate

public void validate(FacesContext context,
                     UIComponent component,
                     Object value)
              throws ValidatorException
Description copied from interface: Validator

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the FacesMessage describing the failure.

Specified by:
validate in interface Validator
Parameters:
context - FacesContext for the request we are processing
component - UIComponent we are checking for correctness
value - the value to validate
Throws:
NullPointerException - if context or component is null
ValidatorException - if validation fails

public boolean equals(Object otherObj)
英文文档：

equals

public boolean equals(Object otherObj)
Overrides:
equals in class Object

public int hashCode()
英文文档：

hashCode

public int hashCode()
Overrides:
hashCode in class Object

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean transientValue)
英文文档：

setTransient

public void setTransient(boolean transientValue)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
transientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodExpressionValidator (Java EE 5)

javax.faces.validator
Class MethodExpressionValidator

java.lang.Object
    extended by  javax.faces.validator.MethodExpressionValidator
All Implemented Interfaces:
EventListener, StateHolder, Validator
public class MethodExpressionValidator
extends Object
implements Validator, StateHolder

Implements: Validator, StateHolder

MethodExpressionValidator 是一个 Validator，它包装了 MethodExpression，并通过对 MethodExpression 识别的对象执行验证方法以进行验证。

英文文档：

MethodExpressionValidator is a Validator that wraps a MethodExpression, and it performs validation by executing a method on an object identified by the MethodExpression.

Field Summary
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
Constructor Summary
MethodExpressionValidator()
MethodExpressionValidator(MethodExpression methodExpression)
Construct a Validator that contains a MethodExpression.
Method Summary
boolean | isTransient() If true, the Object implementing this interface must not participate in state saving or restoring.
void | restoreState(FacesContext context, Object state) Perform any processing required to restore the state from the entries in the state Object.
Object | saveState(FacesContext context) Gets the state of the instance as a Serializable Object.
void | setTransient(boolean transientValue) Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
void | validate(FacesContext context, UIComponent component, Object value) Perform the correctness checks implemented by this Validator against the specified UIComponent.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MethodExpressionValidator()
英文文档：

MethodExpressionValidator

public MethodExpressionValidator()

public MethodExpressionValidator(MethodExpression methodExpression)

构造包含 MethodExpression 的 Validator。

英文文档：

MethodExpressionValidator

public MethodExpressionValidator(MethodExpression methodExpression)

Construct a Validator that contains a MethodExpression.

Method Detail

public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
Throws | NullPointerException: NullPointerException 如果 context 或 component 为 null
Throws | ValidatorException: NullPointerException 如果验证失败
英文文档：

validate

public void validate(FacesContext context,
                     UIComponent component,
                     Object value)
              throws ValidatorException
Description copied from interface: Validator

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the FacesMessage describing the failure.

Specified by:
validate in interface Validator
Parameters:
context - FacesContext for the request we are processing
component - UIComponent we are checking for correctness
value - the value to validate
Throws:
NullPointerException - if context or component is null
ValidatorException - if validation fails

public Object saveState(FacesContext context)
英文文档：

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

public void restoreState(FacesContext context, Object state)
英文文档：

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

public boolean isTransient()
英文文档：

isTransient

public boolean isTransient()
Description copied from interface: StateHolder

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

public void setTransient(boolean transientValue)
英文文档：

setTransient

public void setTransient(boolean transientValue)
Description copied from interface: StateHolder

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
transientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidatorException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.validator
Class ValidatorException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.faces.FacesException
                    extended by  javax.faces.validator.ValidatorException
All Implemented Interfaces:
Serializable
public class ValidatorException
extends FacesException

Extends: Throwable > Exception > RuntimeException > FacesException

ValidatorException 是 Validator 的 validate() 方法抛出的异常，用于指示验证失败。

英文文档：

A ValidatorException is an exception thrown by the validate() method of a Validator to indicate that validation failed.

See Also:
Serialized Form

Constructor Summary
ValidatorException(FacesMessage message)
Construct a new exception with the specified message and no root cause.
ValidatorException(FacesMessage message, Throwable cause)
Construct a new exception with the specified detail message and root cause.
Method Summary
 FacesMessage getFacesMessage()
Returns the FacesMessage associated with the exception.
Methods inherited from class javax.faces.FacesException
getCause
Methods inherited from class java.lang.Throwable
fillInStackTrace, 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

public ValidatorException(FacesMessage message)

构造带指定消息但不带根本原因的新异常。

message 此异常的消息
英文文档：

ValidatorException

public ValidatorException(FacesMessage message)

Construct a new exception with the specified message and no root cause.

Parameters:
message - The message for this exception

public ValidatorException(FacesMessage message, Throwable cause)

构造带指定详细消息和根本原因的新异常。

message | 此异常的详细消息
cause | 此异常的根本原因
英文文档：

ValidatorException

public ValidatorException(FacesMessage message,
                          Throwable cause)

Construct a new exception with the specified detail message and root cause.

Parameters:
message - The detail message for this exception
cause - The root cause for this exception
Method Detail

public FacesMessage getFacesMessage()
返回与此异常关联的 FacesMessage。
英文文档：

getFacesMessage

public FacesMessage getFacesMessage()
Returns the FacesMessage associated with the exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.faces.webapp (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.faces.webapp

Classes required for integration of JavaServer Faces into web applications, including a standard servlet, base classes for JSP custom component tags, and concrete tag implementations for core tags.

See:
Description

Class Summary
AttributeTag | Deprecated. The Faces implementation must now provide the implementation for this class.
ConverterELTag | ConverterELTag is a base class for all JSP custom actions that create and register a Converter instance on the ValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentClassicTagBase.
ConverterTag | Deprecated. This has been partially replaced by ConverterELTag.
FacesServlet | FacesServlet is a servlet that manages the request processing lifecycle for web applications that are utilizing JavaServer Faces to construct the user interface.
FacetTag | FacetTag is the JSP mechanism for denoting a UIComponent is to be added as a facet to the component associated with its parent.
UIComponentBodyTag | Deprecated. All component tags now implement BodyTag.
UIComponentClassicTagBase | UIComponentTagBase is the base class for all JSP tags that use the "classic" JSP tag interface that correspond to a UIComponent instance in the view.
UIComponentELTag | UIComponentELTag specializes its superclass to allow for properties that take their values from EL API expressions.
UIComponentTag | Deprecated. Use of this class has been replaced with UIComponentELTag, which extends UIComponentClassicTagBase to add properties that use the EL API introduced as part of JSP 2.1.
UIComponentTagBase | UIComponentTagBase is the base class for all JSP tags that correspond to a UIComponent instance in the view.
ValidatorELTag | ValidatorELTag is a base class for all JSP custom actions that create and register a Validator instance on the EditableValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentTag.
ValidatorTag | Deprecated. This has been partially replaced by ValidatorELTag.

Package javax.faces.webapp Description

Classes required for integration of JavaServer Faces into web applications, including a standard servlet, base classes for JSP custom component tags, and concrete tag implementations for core tags.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.faces.webapp Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.faces.webapp

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.faces.webapp.FacesServlet (implements javax.servlet.Servlet)
    • javax.servlet.jsp.tagext.TagSupport (implements javax.servlet.jsp.tagext.IterationTag, java.io.Serializable)
      • javax.faces.webapp.AttributeTag
      • javax.faces.webapp.ConverterELTag
      • javax.faces.webapp.ConverterTag
      • javax.faces.webapp.FacetTag
      • javax.faces.webapp.ValidatorELTag
      • javax.faces.webapp.ValidatorTag
    • javax.faces.webapp.UIComponentTagBase (implements javax.servlet.jsp.tagext.JspTag)
      • javax.faces.webapp.UIComponentClassicTagBase (implements javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.JspIdConsumer)
        • javax.faces.webapp.UIComponentELTag (implements javax.servlet.jsp.tagext.Tag)
        • javax.faces.webapp.UIComponentTag (implements javax.servlet.jsp.tagext.Tag)
          • javax.faces.webapp.UIComponentBodyTag
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


AttributeTag (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.webapp
Class AttributeTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.faces.webapp.AttributeTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
Deprecated. The Faces implementation must now provide the implementation for this class.

Extends: TagSupport

提供以下功能的标记实现：向内部嵌套标记的组件添加指定的名称和 String 值，前提是该组件不包含具有相同名称的属性。此标记没有对当前创建的页面创建任何输出。

deprecated 现在 Faces 实现必须提供此类的实现。
英文文档：

public class AttributeTag
extends TagSupport

Tag implementation that adds an attribute with a specified name and String value to the component whose tag it is nested inside, if the component does not already contain an attribute with the same name. This tag creates no output to the page currently being created.

See Also:
Serialized Form

Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
AttributeTag()
Deprecated.
Method Summary
int | doEndTag() Deprecated. Default processing of the end tag returning EVAL_PAGE.
int | doStartTag() Deprecated. Register the specified attribute name and value with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if this UIComponent does not already have a value for the specified attribute name.
void | release() Deprecated. Release references to any acquired resources.
void | setName(String name) Deprecated. Set the attribute name.
void | setValue(String value) Deprecated. Set the attribute value.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public AttributeTag()
英文文档：

AttributeTag

public AttributeTag()
Deprecated.
Method Detail

public void setName(String name)

设置属性名称。

name 新的属性名称
英文文档：

setName

public void setName(String name)
Deprecated.

Set the attribute name.

Parameters:
name - The new attribute name

public void setValue(String value)

设置属性值。

value 新的属性值
英文文档：

setValue

public void setValue(String value)
Deprecated.

Set the attribute value.

Parameters:
value - The new attribute value

public int doStartTag() throws JspException

向最接近的 UIComponentTag 实例关联的 UIComponent 实例注册指定的属性名和值（如果此 UIComponent 的指定属性名没有值）。

Throws JspException: 如果发生 JSP 错误
英文文档：

doStartTag

public int doStartTag()
               throws JspException
Deprecated.

Register the specified attribute name and value with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if this UIComponent does not already have a value for the specified attribute name.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY
Throws:
JspException - if a JSP error occurs
See Also:
Tag.doStartTag()

public int doEndTag() throws JspException
英文文档：

doEndTag

public int doEndTag()
             throws JspException
Deprecated.
Description copied from class: TagSupport
Default processing of the end tag returning EVAL_PAGE.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Returns:
EVAL_PAGE
Throws:
JspException - if an error occurs while processing this tag
See Also:
Tag.doEndTag()

public void release()

释放对任何所需资源的引用。

英文文档：

release

public void release()
Deprecated.

Release references to any acquired resources.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport
See Also:
Tag.release()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConverterELTag (Java EE 5)

javax.faces.webapp
Class ConverterELTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.faces.webapp.ConverterELTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
public abstract class ConverterELTag
extends TagSupport

Extends: TagSupport

ConverterELTag 是所有满足以下条件的 JSP 自定义操作的基类：对最接近的标记实例（其实现类为 UIComponentClassicTagBase 的子类）所关联的 ValueHolder 创建并注册一个 Converter 实例。为了避免在重新显示页面时创建重复的实例，仅当执行当前页面期间拥有它的 UIComponentTag 创建相应的 UIComponent 时才创建和注册 Converter。

此类可以用作支持特定 Converter 子类的标记实例的基类。

此类的子类必须实现 createConverter() 方法，该方法创建并返回 Converter 实例。指定此 Converter 行为的任何配置属性必须通过 createConverter() 方法进行了设置。这通常发生在复制标记实例相应的属性值时。

此标记没有对当前创建的页面创建任何输出。它仅用于创建 Converter 时发生的副作用。

英文文档：

ConverterELTag is a base class for all JSP custom actions that create and register a Converter instance on the ValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentClassicTagBase. To avoid creating duplicate instances when a page is redisplayed, creation and registration of a Converter occurs only if the corresponding UIComponent was created (by the owning UIComponentTag) during the execution of the current page.

This class may be used as a base class for tag instances that support specific Converter subclasses.

Subclasses of this class must implement the createConverter() method, which creates and returns a Converter instance. Any configuration properties that specify behavior of this Converter must have been set by the createConverter() method. Generally, this occurs by copying corresponding attribute values on the tag instance.

This tag creates no output to the page currently being created. It is used solely for the side effect of Converter creation.

See Also:
Serialized Form

Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
ConverterELTag()
Method Summary
protected abstract Converter | createConverter() Create and return a new Converter to be registered on our surrounding UIComponent.
int | doStartTag() Create a new instance of the specified Converter class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentClassicTagBase instance, if the UIComponent instance was created by this execution of the containing JSP page.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ConverterELTag()
英文文档：

ConverterELTag

public ConverterELTag()
Method Detail

public int doStartTag() throws JspException

创建指定 Converter 类的新实例，如果执行包含它的 JSP 页面时创建了 UIComponent 实例，则向最接近的 UIComponentClassicTagBase 实例所关联的 UIComponent 实例注册该新实例。如果 UIComponent 的 localValue 为 String，可尝试转换它。

Throws JspException: 如果发生 JSP 错误
英文文档：

doStartTag

public int doStartTag()
               throws JspException

Create a new instance of the specified Converter class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentClassicTagBase instance, if the UIComponent instance was created by this execution of the containing JSP page. If the localValue of the UIComponent is a String, attempt to convert it.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY
Throws:
JspException - if a JSP error occurs
See Also:
Tag.doStartTag()

abstract protected Converter createConverter() throws JspException

创建并返回一个新的 Converter，以向接近的 UIComponent 注册。

Throws JspException: 如果无法创建新的实例
英文文档：

createConverter

protected abstract Converter createConverter()
                                      throws JspException

Create and return a new Converter to be registered on our surrounding UIComponent.

Throws:
JspException - if a new instance cannot be created
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConverterTag (Java EE 5)

javax.faces.webapp
Class ConverterTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.faces.webapp.ConverterTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
Deprecated. This has been partially replaced by ConverterELTag. The remainder of the functionality, namely, the binding facility and the implementation of the createConverter() method, is now an implementation detail.

Extends: TagSupport

ConverterTag 是所有满足以下条件的 JSP 自定义操作的基类：对最接近的标记实例（其实现类为 UIComponentTag 的子类）所关联的 ValueHolder 创建并注册一个 Converter 实例。为了避免在重新显示页面时创建重复的实例，仅当执行当前页面期间拥有它的 UIComponentTag 创建相应的 UIComponent 时才创建和注册 Converter。

此类必须直接用来实现常规的转换器注册标记（基于 converterId 属性指定的转换器 ID），或者用作支持特定 Converter 子类的标记实例的基类。此 converterId 属性必须引用一个已知的转换器 ID，或 faces-config.xml 文件中定义的自定义转换器 ID。

此类的子类必须实现 createConverter() 方法，该方法创建并返回 Converter 实例。指定此 Converter 行为的任何配置属性必须通过 createConverter() 方法进行了设置。这通常发生在复制标记实例相应的属性值时。

此标记没有对当前创建的页面创建任何输出。它仅用于创建 Converter 时发生的副作用。

deprecated 此类已经由 ConverterELTag 部分替代。剩下的功能（即绑定工具和 #createConverter 方法的实现）现在是一个实现细节。
英文文档：

public class ConverterTag
extends TagSupport

ConverterTag is a base class for all JSP custom actions that create and register a Converter instance on the ValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentTag. To avoid creating duplicate instances when a page is redisplayed, creation and registration of a Converter occurs only if the corresponding UIComponent was created (by the owning UIComponentTag) during the execution of the current page.

This class may be used directly to implement a generic converter registration tag (based on the converter-id specified by the converterId attribute), or as a base class for tag instances that support specific Converter subclasses. This converterId attribute must refer to one of the well known converter-ids, or a custom converter-id as defined in a faces-config.xml file.

Subclasses of this class must implement the createConverter() method, which creates and returns a Converter instance. Any configuration properties that specify behavior of this Converter must have been set by the createConverter() method. Generally, this occurs by copying corresponding attribute values on the tag instance.

This tag creates no output to the page currently being created. It is used solely for the side effect of Converter creation.

See Also:
Serialized Form

Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
ConverterTag()
Deprecated.
Method Summary
protected Converter | createConverter() Deprecated. Create and return a new Converter to be registered on our surrounding UIComponent.
int | doStartTag() Deprecated. Create a new instance of the specified Converter class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if the UIComponent instance was created by this execution of the containing JSP page.
void | release() Deprecated. Release references to any acquired resources.
void | setBinding(String binding) Deprecated. Set the expression that will be used to create a ValueExpression that references a backing bean property of the Converter instance to be created.
void | setConverterId(String converterId) Deprecated. Set the identifer of the Converter instance to be created.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ConverterTag()
英文文档：

ConverterTag

public ConverterTag()
Deprecated.
Method Detail

public void setConverterId(String converterId)

设置要创建的 Converter 实例的标识符。

converterId 要创建的转换器实例的标识符。
英文文档：

setConverterId

public void setConverterId(String converterId)
Deprecated.

Set the identifer of the Converter instance to be created.

Parameters:
converterId - The identifier of the converter instance to be created.

public void setBinding(String binding) throws JspException

设置将用来创建 ValueExpression（它引用要创建的 Converter 实例的支持 (backing) Bean 属性）的表达式。

binding | 新表达式
Throws | JspException: 如果发生 JSP 错误
英文文档：

setBinding

public void setBinding(String binding)
                throws JspException
Deprecated.

Set the expression that will be used to create a ValueExpression that references a backing bean property of the Converter instance to be created.

Parameters:
binding - The new expression
Throws:
JspException - if a JSP error occurs

public int doStartTag() throws JspException

创建指定 Converter 类的新实例，如果执行包含它的 JSP 页面时创建了 UIComponent 实例，则向最接近的 UIComponentTag 实例所关联的 UIComponent 实例注册该新实例。如果 UIComponent 的 localValue 为 String，可尝试转换它。

Throws JspException: 如果发生 JSP 错误
英文文档：

doStartTag

public int doStartTag()
               throws JspException
Deprecated.

Create a new instance of the specified Converter class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if the UIComponent instance was created by this execution of the containing JSP page. If the localValue of the UIComponent is a String, attempt to convert it.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY
Throws:
JspException - if a JSP error occurs
See Also:
Tag.doStartTag()

public void release()

释放对任何所需资源的引用。

英文文档：

release

public void release()
Deprecated.

Release references to any acquired resources.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport
See Also:
Tag.release()

protected Converter createConverter() throws JspException

创建并返回一个新的 Converter，以向接近的 UIComponent 注册。

Throws JspException: 如果无法创建新的实例
英文文档：

createConverter

protected Converter createConverter()
                             throws JspException
Deprecated.

Create and return a new Converter to be registered on our surrounding UIComponent.

Throws:
JspException - if a new instance cannot be created
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacesServlet (Java EE 5)

javax.faces.webapp
Class FacesServlet

java.lang.Object
    extended by  javax.faces.webapp.FacesServlet
All Implemented Interfaces:
Servlet
public final class FacesServlet
extends Object
implements Servlet

Implements: Servlet

FacesServlet 是管理 Web 应用程序请求处理生命周期的 servlet，这些应用程序利用 JavaServer Faces 来构造用户界面。

英文文档：

FacesServlet is a servlet that manages the request processing lifecycle for web applications that are utilizing JavaServer Faces to construct the user interface.

Field Summary
static String | CONFIG_FILES_ATTR Context initialization parameter name for a comma delimited list of context-relative resource paths (in addition to /WEB-INF/faces-config.xml which is loaded automatically if it exists) containing JavaServer Faces configuration information.
static String | LIFECYCLE_ID_ATTR Context initialization parameter name for the lifecycle identifier of the Lifecycle instance to be utilized.
Constructor Summary
FacesServlet()
Method Summary
void | destroy() Release all resources acquired at startup time.
ServletConfig | getServletConfig() Return the ServletConfig instance for this servlet.
String | getServletInfo() Return information about this Servlet.
void | init(ServletConfig servletConfig) Acquire the factory instances we will require.
void | service(ServletRequest request, ServletResponse response) Process an incoming request, and create the corresponding response, by executing the request processing lifecycle.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CONFIG_FILES_ATTR

public static final String CONFIG_FILES_ATTR

Context initialization parameter name for a comma delimited list of context-relative resource paths (in addition to /WEB-INF/faces-config.xml which is loaded automatically if it exists) containing JavaServer Faces configuration information.

See Also:
Constant Field Values

英文文档：

LIFECYCLE_ID_ATTR

public static final String LIFECYCLE_ID_ATTR

Context initialization parameter name for the lifecycle identifier of the Lifecycle instance to be utilized.

See Also:
Constant Field Values
Constructor Detail

public FacesServlet()
英文文档：

FacesServlet

public FacesServlet()
Method Detail

public void destroy()

释放启动时获取的所有资源。

英文文档：

destroy

public void destroy()

Release all resources acquired at startup time.

Specified by:
destroy in interface Servlet

public ServletConfig getServletConfig()

返回此 servlet 的 ServletConfig 实例。

英文文档：

getServletConfig

public ServletConfig getServletConfig()

Return the ServletConfig instance for this servlet.

Specified by:
getServletConfig in interface Servlet
Returns:
the ServletConfig object that initializes this servlet
See Also:
Servlet.init(javax.servlet.ServletConfig)

public String getServletInfo()

返回关于此 Servlet 的信息。

英文文档：

getServletInfo

public String getServletInfo()

Return information about this Servlet.

Specified by:
getServletInfo in interface Servlet
Returns:
a String containing servlet information

public void init(ServletConfig servletConfig) throws ServletException

获取将需要的工厂实例。

Throws ServletException: 如果由于某种原因此 Faces 应用程序启动失败。这包括在处理此 init() 方法之前或期间解析的 config 文件中的错误。
英文文档：

init

public void init(ServletConfig servletConfig)
          throws ServletException

Acquire the factory instances we will require.

Specified by:
init in interface Servlet
Parameters:
servletConfig - a ServletConfig object containing the servlet's configuration and initialization parameters
Throws:
ServletException - if, for any reason, the startup of this Faces application failed. This includes errors in the config file that is parsed before or during the processing of this init() method.
See Also:
UnavailableException, Servlet.getServletConfig()

public void service(ServletRequest request, ServletResponse response) throws java.io.IOException, ServletException

通过执行请求处理生命周期处理传入的请求，并创建相应的响应。

如果此方法的 request 和 response 参数分别不是 HttpServletRequest 和 HttpServletResponse，则此方法的调用结果不确定。

此方法必须对以下列字符串开头的请求做出响应：对响应参数（强制转换为 HttpServletResponse）调用 sendError 方法，并传递代码 HttpServletResponse.SC_NOT_FOUND 作为参数。

/WEB-INF/
/WEB-INF
/META-INF/
/META-INF

request | 正在处理的 servlet 请求
response | 正在创建的 servlet 响应
Throws | java.io.IOException: 如果处理期间发生输入/输出错误
Throws | ServletException: 如果处理期间发生 servlet 错误
英文文档：

service

public void service(ServletRequest request,
                    ServletResponse response)
             throws IOException,
                    ServletException

Process an incoming request, and create the corresponding response, by executing the request processing lifecycle.

If the request and response arguments to this method are not instances of HttpServletRequest and HttpServletResponse, respectively, the results of invoking this method are undefined.

This method must respond to requests that start with the following strings by invoking the sendError method on the response argument (cast to HttpServletResponse), passing the code HttpServletResponse.SC_NOT_FOUND as the argument.

/WEB-INF/
/WEB-INF
/META-INF/
/META-INF

Specified by:
service in interface Servlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
IOException - if an input/output error occurs during processing
ServletException - if a servlet error occurs during processing
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FacetTag (Java EE 5)

javax.faces.webapp
Class FacetTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.faces.webapp.FacetTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
public class FacetTag
extends TagSupport

Extends: TagSupport

FacetTag 是一种 JSP 机制，用来表示 javax.faces.component.UIComponent 将作为 facet 添加到其父标记关联的组件。

FacetTag 必须有且只有一个子标记。此子标记必须为表示单个 javax.faces.component.UIComponent 实例的 UIComponentTag 实例。

英文文档：

FacetTag is the JSP mechanism for denoting a UIComponent is to be added as a facet to the component associated with its parent.

A FacetTag must have one and only one child. This child must be a UIComponentTag instance representing a single UIComponent instance.

See Also:
Serialized Form

Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
FacetTag()
Method Summary
int | doStartTag() Return EVAL_BODY_INCLUDE to cause nested body content to be evaluated.
String | getName() Return the name to be assigned to this facet.
void | release() Release any resources allocated by this tag instance.
void | setName(String name) Set the name to be assigned to this facet.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FacetTag()
英文文档：

FacetTag

public FacetTag()
Method Detail

public String getName()

返回分配给此 facet 的名称。

英文文档：

getName

public String getName()

Return the name to be assigned to this facet.

public void setName(String name)

设置分配给此 facet 的名称。

name 新的 facet 名称
英文文档：

setName

public void setName(String name)

Set the name to be assigned to this facet.

Parameters:
name - The new facet name

public void release()

释放此标记实例分配的任何资源。

英文文档：

release

public void release()

Release any resources allocated by this tag instance.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport
See Also:
Tag.release()

public int doStartTag() throws JspException

返回 EVAL_BODY_INCLUDE，以促使对嵌套正文求值。

英文文档：

doStartTag

public int doStartTag()
               throws JspException

Return EVAL_BODY_INCLUDE to cause nested body content to be evaluated.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY
Throws:
JspException - if an error occurs while processing this tag
See Also:
Tag.doStartTag()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIComponentBodyTag (Java EE 5)

javax.faces.webapp
Class UIComponentBodyTag

java.lang.Object
    extended by  javax.faces.webapp.UIComponentTagBase
        extended by  javax.faces.webapp.UIComponentClassicTagBase
            extended by  javax.faces.webapp.UIComponentTag
                extended by  javax.faces.webapp.UIComponentBodyTag
All Implemented Interfaces:
BodyTag, IterationTag, JspIdConsumer, JspTag, Tag
Deprecated. All component tags now implement BodyTag. This class has been replaced by UIComponentELTag.

Extends: UIComponentTagBase > UIComponentClassicTagBase > UIComponentTag

UIComponentBodyTag 是与 UIComponent 有关的处理标记正文所需的所有 JSP 自定义操作的基类。

deprecated 现在所有组件都实现 BodyTag。此类已经由 UIComponentELTag 替代。
英文文档：

public abstract class UIComponentBodyTag
extends UIComponentTag

UIComponentBodyTag is a base class for all JSP custom actions, related to a UIComponent, that need to process their tag bodies.

Field Summary
Fields inherited from class javax.faces.webapp.UIComponentClassicTagBase
bodyContent, pageContext, UNIQUE_ID_PREFIX
Fields inherited from class javax.faces.webapp.UIComponentTagBase
log
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Constructor Summary
UIComponentBodyTag()
Deprecated.
Method Summary
Methods inherited from class javax.faces.webapp.UIComponentTag
createComponent, getParentUIComponentTag, hasBinding, isSuppressed, isValueReference, release, setBinding, setProperties, setRendered
Methods inherited from class javax.faces.webapp.UIComponentClassicTagBase
addChild, addFacet, addVerbatimAfterComponent, addVerbatimBeforeComponent, createVerbatimComponent, createVerbatimComponentFromBodyContent, doAfterBody, doEndTag, doInitBody, doStartTag, encodeBegin, encodeChildren, encodeEnd, findComponent, getBodyContent, getComponentInstance, getCreated, getCreatedComponents, getDoAfterBodyValue, getDoEndValue, getDoStartValue, getFacesContext, getFacesJspId, getFacetName, getId, getIndexOfNextChildTag, getJspId, getParent, getParentUIComponentClassicTagBase, getPreviousOut, setBodyContent, setId, setJspId, setPageContext, setParent, setupResponseWriter
Methods inherited from class javax.faces.webapp.UIComponentTagBase
getComponentType, getELContext, getRendererType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, setPageContext, setParent

Constructor Detail

public UIComponentBodyTag()
英文文档：

UIComponentBodyTag

public UIComponentBodyTag()
Deprecated.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIComponentClassicTagBase (Java EE 5)

javax.faces.webapp
Class UIComponentClassicTagBase

java.lang.Object
    extended by  javax.faces.webapp.UIComponentTagBase
        extended by  javax.faces.webapp.UIComponentClassicTagBase
All Implemented Interfaces:
BodyTag, IterationTag, JspIdConsumer, JspTag, Tag
Direct Known Subclasses:
UIComponentELTag, UIComponentTag
public abstract class UIComponentClassicTagBase
extends UIComponentTagBase
implements JspIdConsumer, BodyTag

Extends: UIComponentTagBase
Implements: javax.servlet.jsp.tagext.JspIdConsumer, BodyTag
Extended by: UIComponentELTag, UIComponentTag

UIComponentTagBase 是所有满足以下条件的 JSP 标记的基类：这些标记使用 "classic" JSP 标记接口，而该接口对应于视图中的 javax.faces.component.UIComponent 实例。在 Faces 1.2 中，所有组件标记都是 BodyTag 实例，以允许页面构建组件树，但是不呈现它。仅当完全构建组件树之后才会发生呈现。

UIComponentTag 扩展了 UIComponentClassicTagBase，添加了对符合 Faces 1.1 EL 的属性的支持。

UIComponentELTag 扩展了 UIComponentClassicTagBase 类，添加了对符合 EL API 的属性的支持。

默认实现允许根据页面作者的要求，在同一页面上适当混杂模板文本、非 Faces JSP 标记输出和 Faces 组件标记输出。

以下示例中的 CASE 标记将在此类的方法描述中引用。

  • CASE 1 描述作为组件标记的子标记出现的模板文本和/或非组件自定义标记输出，但是位置在该组件标记的第一个子组件标记出现之前。

  • CASE 2 描述在两个兄弟组件标记之间出现的模板文本和/或非组件自定义标记输出。

  • CASE 3 描述作为页面上任何位置的 <f:verbatim> 标记的子内容出现的模板文本和/或非组件自定义标记输出。

  • CASE 4 描述在最后一个子组件标记及其封装父组件标记的结束标记之间出现的模板文本和/或非组件自定义标记输出。

<h:panelGrid style="color:red" border="4" columns="2">
CASE 1
<h:outputText value="component 1"/>
CASE 2
<h:outputText value="component 2"/>
<f:verbatim>CASE 3</f:verbatim>
<c:out value="${pageScope.CASE4}" />
</h:panelGrid>

上述 faces 组件标记的排列必须得到与以下呈现方式相同的标记（假设对 ${pageScope.CASE4} 求值得到 "CASE 4"，不带引号）。

<table border="4" style="color:red">

<tbody>

<tr><td>CASE 1</td></tr> <tr><td>component 1</td></tr>

<tr><td>CASE 2</td> <tr><td>component 2</td></tr>

<tr><td>CASE 3</td> <td>CASE 4</td></tr>

</tbody>

</table>
英文文档：

UIComponentTagBase is the base class for all JSP tags that use the "classic" JSP tag interface that correspond to a UIComponent instance in the view. In Faces 1.2, all component tags are BodyTag instances to allow for the execution of the page to build the component tree, but not render it. Rendering happens only after the component tree is completely built.

UIComponentTag extends UIComponentClassicTagBase to add support for properties that conform to the Faces 1.1 EL.

UIComponentELTag extends UIComponentClassicTagBase class to add support for properties that conform to the EL API.

The default implementation allows the proper interweaving of template text, non-Faces JSP tag output, and Faces component tag output in the same page, as expected by the page author.

The CASE markers in the following example will be cited in the method descriptions of this class.

  • CASE 1 describes template text and/or non-component custom tag output occurring as the child of a component tag, but before the first component tag child of that component tag.

  • CASE 2 describes template text and/or non-component custom tag output occurring between two sibling component tags.

  • CASE 3 describes template text and/or non-component custom tag output occurring as the child content of an <f:verbatim> tag at any point in the page.

  • CASE 4 describes template text and/or non-component custom tag output occurring between the last child component tag and its enclosing parent component tag's end tag.

    <h:panelGrid style="color:red" border="4" columns="2">
      CASE 1
      <h:outputText value="component 1"/>
      CASE 2
      <h:outputText value="component 2"/>
      <f:verbatim>CASE 3</f:verbatim>
      <c:out value="${pageScope.CASE4}" />
    </h:panelGrid>

The preceding arrangement of faces component tags, must yield markup that will render identically to the following (assuming that ${pageScope.CASE4} evaluates to "CASE 4" without the quotes).

<table border="4" style="color:red">

  <tbody>

    <tr><td>CASE 1</td></tr> <tr><td>component 1</td></tr>

    <tr><td>CASE 2</td> <tr><td>component 2</td></tr>

    <tr><td>CASE 3</td> <td>CASE 4</td></tr>

  </tbody>

</table>

Field Summary
protected BodyContent | bodyContent The bodyContent for this tag handler.
protected PageContext | pageContext The JSP PageContext for the page we are embedded in.
protected static String | UNIQUE_ID_PREFIX Used as the prefix for ids.
Fields inherited from class javax.faces.webapp.UIComponentTagBase
log
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
UIComponentClassicTagBase()
Method Summary
protected  void addChild(UIComponent child)
Add the component identifier of the specified UIComponent to the list of component identifiers created or located by nested UIComponentTags processing this request.
protected  void addFacet(String name)
Add the facet name of the specified facet to the list of facet names created or located by nested UIComponentTags processing this request.
protected  void addVerbatimAfterComponent(UIComponentClassicTagBase parentTag, UIComponent verbatim, UIComponent component)
Add verbatim as a sibling of component in component in the parent's child list.
protected  void addVerbatimBeforeComponent(UIComponentClassicTagBase parentTag, UIComponent verbatim, UIComponent component)
Add verbatim as a sibling of component in component in the parent's child list.
protected abstract  UIComponent createComponent(FacesContext context, String newId)
Create and return a new child component of the type returned by calling getComponentType().
protected  UIOutput createVerbatimComponent()
Use the Application instance to create a new component with the following characteristics.
protected  UIComponent createVerbatimComponentFromBodyContent()
Create a transient UIOutput component from the body content, of this tag instance or return null if there is no body content, the body content is whitespace, or the body content is a comment.
 int doAfterBody()
Perform any processing necessary to handle the content implications of CASE 4 in the class description.
 int doEndTag()
Perform any processing necessary to handle the content implications of CASE 3 in the class description.
 void doInitBody()
Prepare for evaluation of the body.
 int doStartTag()
Perform any processing necessary to find (or create) the UIComponent instance in the view corresponding to this tag instance in the page and, if and only if a component was created, insert it into the tree at the proper location as expected by the page author.
protected  void encodeBegin()
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
protected  void encodeChildren()
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
protected  void encodeEnd()
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
protected  UIComponent findComponent(FacesContext context)
Find and return the UIComponent, from the component tree, that corresponds to this tag handler instance.
 BodyContent getBodyContent()
 UIComponent getComponentInstance()
Return the UIComponent instance that is associated with this tag instance.
 boolean getCreated()
Return true if we dynamically created a new component instance during execution of this tag.
protected  List<String> getCreatedComponents()
Returns the List of UIComponent ids created or located by nested UIComponentTags while processing the current request.
protected  int getDoAfterBodyValue()
Return the flag value that should be returned from the doAfterBody() method when it is called.
protected  int getDoEndValue()
Return the flag value that should be returned from the doEnd() method when it is called.
protected  int getDoStartValue()
Return the flag value that should be returned from the doStart() method when it is called.
protected  FacesContext getFacesContext()
Return the FacesContext instance for the current request.
protected  String getFacesJspId()
If this method has been called before on this tag's useful lifetime (before release() was called), return the previously returned value.
protected  String getFacetName()
Return the facet name that we should be stored under, if any; otherwise, return null (indicating that we will be a child component).
protected  String getId()
Return the id value assigned by the page author.
protected  int getIndexOfNextChildTag()
Return the index of the next child to be added as a child of this tag.
 String getJspId()
 Tag getParent()
Return the Tag that is the parent of this instance.
static UIComponentClassicTagBase getParentUIComponentClassicTagBase(PageContext context)
Locate and return the nearest enclosing UIComponentClassicTagBase if any; otherwise, return null.
 JspWriter getPreviousOut()
Get the JspWriter from our BodyContent.
protected abstract  boolean hasBinding()
Return true if this component has a non-null binding attribute.
 void release()
Release any resources allocated during the execution of this tag handler.
 void setBodyContent(BodyContent bodyContent)
Set the bodyContent for this tag handler.
 void setId(String id)
Set the component identifier for our component.
 void setJspId(String id)
Defined on JspIdConsumer.
 void setPageContext(PageContext pageContext)
Set the PageContext of the page containing this tag instance.
 void setParent(Tag parent)
Set the Tag that is the parent of this instance.
protected abstract  void setProperties(UIComponent component)
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.
protected  void setupResponseWriter()
Set up the ResponseWriter for the current response, if this has not been done already.
Methods inherited from class javax.faces.webapp.UIComponentTagBase
getComponentType, getELContext, getRendererType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

UNIQUE_ID_PREFIX

protected static final String UNIQUE_ID_PREFIX
Used as the prefix for ids. This is necessary to avoid uniqueness conflicts with the transient verbatim components.

See Also:
Constant Field Values

英文文档：

bodyContent

protected BodyContent bodyContent

The bodyContent for this tag handler.

英文文档：

pageContext

protected PageContext pageContext

The JSP PageContext for the page we are embedded in.

Constructor Detail

public UIComponentClassicTagBase()
英文文档：

UIComponentClassicTagBase

public UIComponentClassicTagBase()
Method Detail

protected int getDoStartValue() throws JspException

返回调用 doStart() 方法时应该从该方法返回的标志值。子类可重写此方法，以返回相应的值。

Throws JspException: 导致 doStart() 抛出异常
英文文档：

getDoStartValue

protected int getDoStartValue()
                       throws JspException

Return the flag value that should be returned from the doStart() method when it is called. Subclasses may override this method to return the appropriate value.

Throws:
JspException - to cause doStart() to throw an exception

protected int getDoEndValue() throws JspException

返回调用 doEnd() 方法时应该从该方法返回的标志值。子类可重写此方法，以返回相应的值。

Throws JspException: 导致 doEnd() 抛出异常
英文文档：

getDoEndValue

protected int getDoEndValue()
                     throws JspException

Return the flag value that should be returned from the doEnd() method when it is called. Subclasses may override this method to return the appropriate value.

Throws:
JspException - to cause doEnd() to throw an exception

protected void encodeBegin() throws java.io.IOException

委托给相应 UIComponent 的 encodeBegin() 方法。此方法从 doStartTag() 调用。通常，代理是无条件发生的，但是此方法有所不同，高级标记可以有条件地执行此调用。

Throws | java.io.IOException: 如果发生输入/输出错误
deprecated | 执行 JSP 页面期间不执行任何编码。编码推迟到页面完成执行时，以在发生编码前构建整个树。
英文文档：

encodeBegin

protected void encodeBegin()
                    throws IOException
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.

Delegate to the encodeBegin() method of our corresponding UIComponent. This method is called from doStartTag(). Normally, delegation occurs unconditionally; however, this method is abstracted out so that advanced tags can conditionally perform this call.

Throws:
IOException - if an input/output error occurs

protected void encodeChildren() throws java.io.IOException

委托给相应 UIComponent 的 encodeChildren() 方法。此方法从 doStartTag() 调用。通常，代理是无条件发生的，但是此方法有所不同，高级标记可以有条件地执行此调用。

Throws | java.io.IOException: 如果发生输入/输出错误
deprecated | 执行 JSP 页面期间不执行任何编码。编码推迟到页面完成执行时，以在发生编码前构建整个树。
英文文档：

encodeChildren

protected void encodeChildren()
                       throws IOException
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.

Delegate to the encodeChildren() method of our corresponding UIComponent. This method is called from doStartTag(). Normally, delegation occurs unconditionally; however, this method is abstracted out so that advanced tags can conditionally perform this call.

Throws:
IOException - if an input/output error occurs

protected void encodeEnd() throws java.io.IOException

委托给相应 UIComponent 的 encodeEnd() 方法。此方法从 doStartTag() 调用。通常，代理是无条件发生的，但是此方法有所不同，高级标记可以有条件地执行此调用。

Throws | java.io.IOException: 如果发生输入/输出错误
deprecated | 执行 JSP 页面期间不执行任何编码。编码推迟到页面完成执行时，以在发生编码前构建整个树。
英文文档：

encodeEnd

protected void encodeEnd()
                  throws IOException
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.

Delegate to the encodeEnd() method of our corresponding UIComponent. This method is called from doStartTag(). Normally, delegation occurs unconditionally; however, this method is abstracted out so that advanced tags can conditionally perform this call.

Throws:
IOException - if an input/output error occurs

public void setPageContext(PageContext pageContext)

设置包含此标记实例的页面的 PageContext。

pageContext 封装的 PageContext
英文文档：

setPageContext

public void setPageContext(PageContext pageContext)

Set the PageContext of the page containing this tag instance.

Specified by:
setPageContext in interface Tag
Parameters:
pageContext - The enclosing PageContext

public Tag getParent()

返回作为此实例父组件的 Tag。

英文文档：

getParent

public Tag getParent()

Return the Tag that is the parent of this instance.

Specified by:
getParent in interface Tag
Returns:
the current parent, or null if none.
See Also:
TagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.Tag, java.lang.Class)

public void setParent(Tag parent)

设置作为此实例父组件的 Tag。

parent 新的父 Tag
英文文档：

setParent

public void setParent(Tag parent)

Set the Tag that is the parent of this instance.

Specified by:
setParent in interface Tag
Parameters:
parent - The new parent Tag

protected void setupResponseWriter()

设置当前响应的 javax.faces.context.ResponseWriter（如果尚未设置）。

英文文档：

setupResponseWriter

protected void setupResponseWriter()

Set up the ResponseWriter for the current response, if this has not been done already.

@deprecated. ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot) is now responsible for setting up the response writer. This method is now a no-op.

protected UIComponent findComponent(FacesContext context) throws JspException

从对应于此标记处理程序实例的组件树查找并返回 UIComponent。如果没有这样的 UIComponent，则创建一个，并将其添加为 UIComponent（它与最新封装的 UIComponentTag 关联）的子组件或 facet。定位或创建组件的过程如下：

  1. 如果之前找到了此组件，则返回它。
  2. 通过查找父 UIComponentTag 实例并请求其组件定位父组件。如果没有父 UIComponentTag 实例，则此标记表示根组件，因此应从当前的 Tree 中获取它并返回。
  3. 如果此 UIComponentTag 实例有 facetName 属性集，则向父 UIComponent 请求具有此名称的 facet。如果找不到，则创建一个，使用新组件作为参数调用 setProperties()，并以此名称注册它。返回找到或创建的 facet UIComponent。
  4. 确定要分配给新组件的组件 ID，如下所示：如果此 UIComponentTag 有一个 id 属性集，则使用该值；否则，生成一个标识符，并保证每次处理页面时此 UIComponent 都有相同的标识符（即基于所有不带 id 属性集的 UIComponentTag 实例的位置）。
  5. 向父 UIComponent 请求带有此标识符的子组件。如果找不到，则创建一个，使用新组件作为参数调用 setProperties()，并将其注册为具有此标识符的子组件。返回找到或创建的子 UIComponent。

创建组件时，过程如下：

  1. 通过调用 UIComponentTag#getComponentType 获取组件类型
  2. 如果组件有 binding 属性，则根据其创建一个表达式，并使用该表达式、FacesContext 和组件类型调用 Application#createComponent。使用关键字 "binding" 存储该表达式。
  3. 否则，调用 Application#createComponent，只有组件类型参数。
  4. 调用 setProperties()。
  5. 将新组件添加为其父组件的子组件或 facet
英文文档：

findComponent

protected UIComponent findComponent(FacesContext context)
                             throws JspException

Find and return the UIComponent, from the component tree, that corresponds to this tag handler instance. If there is no such UIComponent, create one and add it as a child or facet of the UIComponent associated with our nearest enclosing UIComponentTag. The process for locating or creating the component is:

  1. If we have previously located this component, return it.
  2. Locate the parent component by looking for a parent UIComponentTag instance, and ask it for its component. If there is no parent UIComponentTag instance, this tag represents the root component, so get it from the current Tree and return it.
  3. If this UIComponentTag instance has the facetName attribute set, ask the parent UIComponent for a facet with this name. If not found, create one, call setProperties() with the new component as a parameter, and register it under this name. Return the found or created facet UIComponent.
  4. Determine the component id to be assigned to the new component, as follows: if this UIComponentTag has an id attribute set, use that value; otherwise, generate an identifier that is guaranteed to be the same for this UIComponent every time this page is processed (i.e. one based on the location of all UIComponentTag instances without an id attribute set).
  5. Ask the parent UIComponent for a child with this identifier. If not found, create one, call setProperties() with the new component as a parameter, and register it as a child with this identifier. Return the found or created child UIComponent.

When creating a component, the process is:

  1. Retrieve the component type by calling UIComponentTagBase.getComponentType()
  2. If the component has a binding attribute, create an expression from it, and call Application.createComponent(java.lang.String) with that expression, the FacesContext, and the component type. Store the expression using the key "binding".
  3. Otherwise, call Application.createComponent(java.lang.String) with only the component type.
  4. Call setProperties().
  5. Add the new component as a child or facet of its parent

Throws:
JspException

public static UIComponentClassicTagBase getParentUIComponentClassicTagBase(PageContext context)

查找并返回最新封装的 UIComponentClassicTagBase（如果有）；否则返回 null。

context 当前页面的 PageContext
英文文档：

getParentUIComponentClassicTagBase

public static UIComponentClassicTagBase getParentUIComponentClassicTagBase(PageContext context)

Locate and return the nearest enclosing UIComponentClassicTagBase if any; otherwise, return null.

Parameters:
context - PageContext for the current page

protected int getIndexOfNextChildTag()
英文文档：

getIndexOfNextChildTag

protected int getIndexOfNextChildTag()
Description copied from class: UIComponentTagBase

Return the index of the next child to be added as a child of this tag. The default implementation maintains a list of created components and returns the size of the list.

Specified by:
getIndexOfNextChildTag in class UIComponentTagBase

protected void addChild(UIComponent child)
英文文档：

addChild

protected void addChild(UIComponent child)
Description copied from class: UIComponentTagBase

Add the component identifier of the specified UIComponent to the list of component identifiers created or located by nested UIComponentTags processing this request.

Specified by:
addChild in class UIComponentTagBase
Parameters:
child - New child whose identifier should be added

protected void addFacet(String name)
英文文档：

addFacet

protected void addFacet(String name)
Description copied from class: UIComponentTagBase

Add the facet name of the specified facet to the list of facet names created or located by nested UIComponentTags processing this request.

Specified by:
addFacet in class UIComponentTagBase
Parameters:
name - Facet name to be added

protected UIComponent createVerbatimComponentFromBodyContent()

根据此标记实例的正文内容创建一个瞬态 UIOutput 组件；如果没有正文内容，正文内容为空白或正文内容为注释，则返回 null。

英文文档：

createVerbatimComponentFromBodyContent

protected UIComponent createVerbatimComponentFromBodyContent()

Create a transient UIOutput component from the body content, of this tag instance or return null if there is no body content, the body content is whitespace, or the body content is a comment.

protected UIOutput createVerbatimComponent()

使用 Application 实例创建带有以下特征的新组件。

componentType 为 javax.faces.HtmlOutputText。

transient 为 true。

escape 为 false。

id 为 FacesContext.getViewRoot().createUniqueId()

英文文档：

createVerbatimComponent

protected UIOutput createVerbatimComponent()

Use the Application instance to create a new component with the following characteristics.

componentType is javax.faces.HtmlOutputText.

transient is true.

escape is false.

id is FacesContext.getViewRoot().createUniqueId()

protected void addVerbatimBeforeComponent(UIComponentClassicTagBase parentTag, UIComponent verbatim, UIComponent component)

在父组件的子组件列表的 component 中添加 verbatim，作为 component 的兄弟组件。verbatim 被添加到该列表中紧接 component 之前的位置。

英文文档：

addVerbatimBeforeComponent

protected void addVerbatimBeforeComponent(UIComponentClassicTagBase parentTag,
                                          UIComponent verbatim,
                                          UIComponent component)

Add verbatim as a sibling of component in component in the parent's child list. verbatim is added to the list at the position immediatly preceding component.

protected void addVerbatimAfterComponent(UIComponentClassicTagBase parentTag, UIComponent verbatim, UIComponent component)

在父组件的子组件列表的 component 中添加 verbatim，作为 component 的兄弟组件。verbatim 被添加到该列表中紧接 component 之后的位置。

英文文档：

addVerbatimAfterComponent

protected void addVerbatimAfterComponent(UIComponentClassicTagBase parentTag,
                                         UIComponent verbatim,
                                         UIComponent component)

Add verbatim as a sibling of component in component in the parent's child list. verbatim is added to the list at the position immediatly following component.

public int doStartTag() throws JspException

执行在对应于页面中此标记实例的视图中查找（或创建）UIComponent 实例所必需的任何处理，当且仅当创建了组件时，才根据页面作者的要求将其插入到树中合适的位置。其次，导致创建一个瞬态 UIOutput 组件，并将其置于树中此标记的 UIComponent 实例之前。此 UIOutput 组件的值必须包含类描述中 CASE 1 或 CASE 2 覆盖的所有内容。

默认实现足以满足大多数组件，要实现此次要需求，它可以调用 #getParentUIComponentClassicTagBase 并对结果调用 #createVerbatimComponentFromBodyContent。然后通过调用 #addVerbatimBeforeComponent 将返回的组件添加到树中此标记实例的实际组件之前。

在返回之前，组件被推送到此响应的组件堆栈中，以便 #getParentUIComponentClassicTagBase 方法能够正常工作。

要返回的标志值可以通过调用 getDoStartValue() 方法获取，如果它的标记子类不希望使用默认值，则可以重写该方法。

Throws JspException: 如果发生错误
英文文档：

doStartTag

public int doStartTag()
               throws JspException

Perform any processing necessary to find (or create) the UIComponent instance in the view corresponding to this tag instance in the page and, if and only if a component was created, insert it into the tree at the proper location as expected by the page author. Secondarily, cause a transient UIOutput component to be created and placed in the tree before the UIComponent instance for this tag. The value of this UIOutput component must include anything covered by CASE 1 or CASE 2 in the class description.

The default implementation, which is intended to be sufficient for most components, implements this secondary requirement by calling getParentUIComponentClassicTagBase(javax.servlet.jsp.PageContext), and calling createVerbatimComponentFromBodyContent() on the result. It then adds the returned component to the tree before the actual component for this tag instance instance by calling addVerbatimBeforeComponent(javax.faces.webapp.UIComponentClassicTagBase, javax.faces.component.UIComponent, javax.faces.component.UIComponent).

Before returning, the component is pushed onto the component stack for this response to enable the getParentUIComponentClassicTagBase(javax.servlet.jsp.PageContext) method to work properly.

The flag value to be returned is acquired by calling the getDoStartValue() method, which tag subclasses may override if they do not want the default value.

Specified by:
doStartTag in interface Tag
Returns:
EVAL_BODY_INCLUDE if the tag wants to process body, SKIP_BODY if it does not want to process it.
Throws:
JspException - if an error occurs
See Also:
BodyTag

public int doEndTag() throws JspException

执行任何必要的处理，以处理与类描述 CASE 3 类似的情况。

默认实现足以满足大多数组件，它可以对此实例调用 #createVerbatimComponentFromBodyContent，并将其作为此标记组件的子组件添加到子组件列表的末尾。此外，还采取了以下内务处理步骤。

  • 从 UIComponent 获取上一次处理此页面时 UIComponentTag 实例创建的子组件的组件 ID 集（如果有）。将其与处理此页面期间创建的子组件列表相比较，并移除旧列表中出现的所有子组件，但不删除新的子组件。将新列表保存为组件属性，以便它能作为组件状态的一部分保存。
  • 从 UIComponent 获取上一次处理此页面时 UIComponentTag 实例创建的 facet 的 facet 名称集（如果有）。将其与处理此页面期间创建的 facet 列表相比较，并删除旧列表中出现的所有 facet，但不删除新的 facet。将新列表保存为组件属性，以便它能作为组件状态的一部分保存。
  • 释放对此组件的所有引用，并将其从此响应的组件堆栈中弹出；如果它是最外面的组件，则将此堆栈移除。

要返回的标志值可以通过调用 getDoEndValue() 方法获取，如果它的标记子类不希望使用默认值，则可以重写该方法。

Throws JspException: 如果发生错误
英文文档：

doEndTag

public int doEndTag()
             throws JspException

Perform any processing necessary to handle the content implications of CASE 3 in the class description.

The default implementation, which is intended to be sufficient for most components, calls createVerbatimComponentFromBodyContent() on this instance and adds it as a child of the component for this tag's component at the end of the child list. In addition, the following housekeeping steps are taken.

  • Retrieve from the UIComponent the set of component ids of child components created by UIComponentTag instances the last time this page was processed (if any). Compare it to the list of children created during this page processing pass, and remove all children present in the old list but not the new. Save the new list as a component attribute so that it gets saved as part of the component's state.
  • Retrieve from the UIComponent the set of facet names of facets created by UIComponentTag instances the last time this page was processed (if any). Compare it to the list of facets created during this page processing pass, and remove all facets present in the old list but not the new. Save the new list as a component attribute so that it gets saved as part of the component's state.
  • Release all references to the component, and pop it from the component stack for this response, removing the stack if this was the outermost component.

The flag value to be returned is acquired by calling the getDoEndValue() method, which tag subclasses may override if they do not want the default value.

Specified by:
doEndTag in interface Tag
Returns:
indication of whether to continue evaluating the JSP page.
Throws:
JspException - if an error occurs

public void release()

释放执行此标记处理程序期间分配的所有资源。

英文文档：

release

public void release()

Release any resources allocated during the execution of this tag handler.

Specified by:
release in interface Tag

protected int getDoAfterBodyValue() throws JspException

返回调用 doAfterBody() 方法时应该从该方法返回的标志值。子类可重写此方法，以返回相应的值。

英文文档：

getDoAfterBodyValue

protected int getDoAfterBodyValue()
                           throws JspException

Return the flag value that should be returned from the doAfterBody() method when it is called. Subclasses may override this method to return the appropriate value.

Throws:
JspException

public void setBodyContent(BodyContent bodyContent)

设置此标记处理程序的 bodyContent。此方法由 JSP 页面实现对象在 doInitiBody() 之前调用，每个操作调用最多调用一次。对于空标记或者 doStartTag() 方法返回 SKIP_BODY 或 EVAL_BODY_INCLUDE 的非空标记，不调用此方法。

bodyContent 此标记的新 BodyContent
英文文档：

setBodyContent

public void setBodyContent(BodyContent bodyContent)

Set the bodyContent for this tag handler. This method is invoked by the JSP page implementation object at most once per action invocation, before doInitiBody(). This method will not be invoked for empty tags or for non-empty tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.

Specified by:
setBodyContent in interface BodyTag
Parameters:
bodyContent - The new BodyContent for this tag
See Also:
BodyTag.doInitBody(), IterationTag.doAfterBody()

public JspWriter getPreviousOut()

从 BodyContent 获取 JspWriter。

英文文档：

getPreviousOut

public JspWriter getPreviousOut()

Get the JspWriter from our BodyContent.

public BodyContent getBodyContent()
英文文档：

getBodyContent

public BodyContent getBodyContent()

public void doInitBody() throws JspException

准备对正文求值。此方法由 JSP 页面实现对象在 setBodyContent() 之后并在第一次对正文求值之前调用。对于空标记或者 doStartTag() 方法返回 SKIP_BODY 或 EVAL_BODY_INCLUDE 的非空标记，不调用此方法。

Throws JspException: 如果遇到错误
英文文档：

doInitBody

public void doInitBody()
                throws JspException

Prepare for evaluation of the body. This method is invoked by the JSP page implementation object after setBodyContent() and before the first time the body is to be evaluated. This method will not be invoked for empty tags or for non-empty tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.

Specified by:
doInitBody in interface BodyTag
Throws:
JspException - if an error is encountered
See Also:
IterationTag.doAfterBody()

public int doAfterBody() throws JspException

执行任何必要的处理，以处理与类描述 CASE 4 类似的情况。

返回 #getDoAfterBodyValue 的结果

Throws JspException: 如果遇到错误
英文文档：

doAfterBody

public int doAfterBody()
                throws JspException

Perform any processing necessary to handle the content implications of CASE 4 in the class description.

Return result from getDoAfterBodyValue()

Specified by:
doAfterBody in interface IterationTag
Returns:
whether additional evaluations of the body are desired
Throws:
JspException - if an error is encountered

public void setId(String id)

设置组件的组件标识符。如果参数以 UIViewRoot#UNIQUE_ID_PREFIX 开头，则抛出 IllegalArgumentException

id | 新的组件标识符。它可以不以 UIViewRoot#UNIQUE_ID_PREFIX 开头。
Throws | IllegalArgumentException: 如果参数为非 null 并且以 UIViewRoot#UNIQUE_ID_PREFIX 开头。
英文文档：

setId

public void setId(String id)

Set the component identifier for our component. If the argument begins with UIViewRoot.UNIQUE_ID_PREFIX throw an IllegalArgumentException

Specified by:
setId in class UIComponentTagBase
Parameters:
id - The new component identifier. This may not start with UIViewRoot.UNIQUE_ID_PREFIX.
Throws:
IllegalArgumentException - if the argument is non-null and starts with UIViewRoot.UNIQUE_ID_PREFIX.

protected String getId()

返回页面作者分配的 id 值。

英文文档：

getId

protected String getId()

Return the id value assigned by the page author.

protected String getFacesJspId()

如果在此标记的有效生存期中调用了此方法（在调用 #release 之前），则返回以前返回的值。否则，如果 #getJspId 返回非 null，则将 #UNIQUE_ID_PREFIX 添加到 jspId，并返回该结果。

英文文档：

getFacesJspId

protected String getFacesJspId()

If this method has been called before on this tag's useful lifetime (before release() was called), return the previously returned value. Otherwise, if getJspId() returns non-null, prepend UNIQUE_ID_PREFIX to the jspId and return the result.

protected java.util.List<E> getCreatedComponents()
返回处理当前请求期间嵌套的 UIComponentTag 创建或定位的 UIComponent ID List。

英文文档：

getCreatedComponents

protected List<String> getCreatedComponents()
Returns the List of UIComponent ids created or located by nested UIComponentTags while processing the current request.

public void setJspId(String id)

对 JspIdConsumer 进行定义。此方法由容器在 #doStartTag 之前调用。保证参数在页面中是唯一的。

实现注意事项：此方法将检测我们所在的包含页面位置，并为特定“逻辑页面”中的每个包含页面分配一个唯一的 ID。这可以避免在组件没有显式 ID 的包含页面中出现重复 ID。

id 此标记的容器生成的 ID，保证在页面中是唯一的。
英文文档：

setJspId

public void setJspId(String id)

Defined on JspIdConsumer. This method is called by the container before doStartTag(). The argument is guaranteed to be unique within the page.

IMPLEMENTATION NOTE: This method will detect where we are in an include and assign a unique ID for each include in a particular 'logical page'. This allows us to avoid possible duplicate ID situations for included pages that have components without explicit IDs.

Specified by:
setJspId in interface JspIdConsumer
Parameters:
id - the container generated id for this tag, guaranteed to be unique within the page.

public String getJspId()
英文文档：

getJspId

public String getJspId()

abstract protected void setProperties(UIComponent component)

如果明确设置了此标记处理程序实例相应的属性，则重写指定组件的属性。仅当指定的 UIComponent 在执行此标记处理器实例期间实际创建时，才调用此方法，此调用将在向视图添加 UIComponent 之前发生。

希望支持其他设置属性的标记子类必须确保仍然调用了基类 setProperties() 方法。支持额外属性 foo 和 bar 的典型实现如下所示：

protected void setProperties(UIComponent component) {
super.setProperties(component);
if (foo != null) {
component.setAttribute("foo", foo);
   }
if (bar != null) {
component.setAttribute("bar", bar);
   }
 }

默认实现重写以下属性：

  • rendered - 为此标记处理程序实例指定了 rendered 属性的值时设置。
  • rendererType - getRendererType() 方法返回非 null 值时设置。
component 要重写属性的 UIComponent
英文文档：

setProperties

protected abstract void setProperties(UIComponent component)

Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified UIComponent was in fact created during the execution of this tag handler instance, and this call will occur BEFORE the UIComponent is added to the view.

Tag subclasses that want to support additional set properties must ensure that the base class setProperties() method is still called. A typical implementation that supports extra properties foo and bar would look something like this:

 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   if (foo != null) {
     component.setAttribute("foo", foo);
   }
   if (bar != null) {
     component.setAttribute("bar", bar);
   }
 }

The default implementation overrides the following properties:

  • rendered - Set if a value for the rendered property is specified for this tag handler instance.
  • rendererType - Set if the getRendererType() method returns a non-null value.

Parameters:
component - UIComponent whose properties are to be overridden

abstract protected UIComponent createComponent(FacesContext context, String newId) throws JspException

创建并返回新的类型（通过调用 getComponentType() 返回）子组件。如果此 UIComponentTag 拥有非 null 的 binding 属性，则使用为 binding 属性创建的表达式调用 Application#createComponent 实现，该表达式将被存储在组件中。否则，调用 Application#createComponent，只有组件类型参数。最后，初始化组件 ID 和其他属性。

context | 当前请求的 FacesContext
newId | 组件的 ID
英文文档：

createComponent

protected abstract UIComponent createComponent(FacesContext context,
                                               String newId)
                                        throws JspException

Create and return a new child component of the type returned by calling getComponentType(). If this UIComponentTag has a non-null binding attribute, this is done by call Application.createComponent(java.lang.String) with the expression created for the binding attribute, and the expression will be stored on the component. Otherwise, Application.createComponent(java.lang.String) is called with only the component type. Finally, initialize the components id and other properties.

Parameters:
context - FacesContext for the current request
newId - id of the component
Throws:
JspException

abstract protected boolean hasBinding()

如果此组件拥有非 null binding 属性，则返回 true。若要允许子类将 binding 属性公开为 Faces 1.1 风格的 EL 属性，以及将其公开为 EL API 属性，此方法是必需的。

英文文档：

hasBinding

protected abstract boolean hasBinding()

Return true if this component has a non-null binding attribute. This method is necessary to allow subclasses that expose the binding property as an Faces 1.1 style EL property as well as subclasses that expose it as an EL API property.

public UIComponent getComponentInstance()

返回关联此标记实例的 UIComponent 实例。此方法设计用于嵌套在标记中的标记，仅在对此标记实例执行 doStartTag() 和 doEndTag() 期间返回有用的结果。

英文文档：

getComponentInstance

public UIComponent getComponentInstance()

Return the UIComponent instance that is associated with this tag instance. This method is designed to be used by tags nested within this tag, and only returns useful results between the execution of doStartTag() and doEndTag() on this tag instance.

Specified by:
getComponentInstance in class UIComponentTagBase

public boolean getCreated()

如果执行此标记期间动态创建了新的组件，则返回 true。此方法设计用于嵌套在标记中的标记，仅在对此标记实例执行 doStartTag() 和 doEndTag() 期间返回有用的结果。

英文文档：

getCreated

public boolean getCreated()

Return true if we dynamically created a new component instance during execution of this tag. This method is designed to be used by tags nested within this tag, and only returns useful results between the execution of doStartTag() and doEndTag() on this tag instance.

Specified by:
getCreated in class UIComponentTagBase

protected FacesContext getFacesContext()
英文文档：

getFacesContext

protected FacesContext getFacesContext()
Description copied from class: UIComponentTagBase

Return the FacesContext instance for the current request. This value will be non-null only from the beginning of doStartTag() through the end of doEndTag() for each tag instance.

Specified by:
getFacesContext in class UIComponentTagBase

protected String getFacetName()

返回应该存储的 facet 名称（如果有），否则返回 null（表示为子组件）。

英文文档：

getFacetName

protected String getFacetName()

Return the facet name that we should be stored under, if any; otherwise, return null (indicating that we will be a child component).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIComponentELTag (Java EE 5)

javax.faces.webapp
Class UIComponentELTag

java.lang.Object
    extended by  javax.faces.webapp.UIComponentTagBase
        extended by  javax.faces.webapp.UIComponentClassicTagBase
            extended by  javax.faces.webapp.UIComponentELTag
All Implemented Interfaces:
BodyTag, IterationTag, JspIdConsumer, JspTag, Tag
public abstract class UIComponentELTag
extends UIComponentClassicTagBase
implements Tag

Extends: UIComponentTagBase > UIComponentClassicTagBase
Implements: Tag

UIComponentELTag 使其超类专门化，以允许属性从 EL API 表达式中获取值。

此标记设计用于 Faces 1.2 版本和 JSP 2.1 版本的容器。

英文文档：

UIComponentELTag specializes its superclass to allow for properties that take their values from EL API expressions.

This tag is designed for use with Faces version 1.2 and JSP version 2.1 containers.

Field Summary
Fields inherited from class javax.faces.webapp.UIComponentClassicTagBase
bodyContent, pageContext, UNIQUE_ID_PREFIX
Fields inherited from class javax.faces.webapp.UIComponentTagBase
log
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Constructor Summary
UIComponentELTag()
Method Summary
protected  UIComponent createComponent(FacesContext context, String newId)
Create and return a new child component of the type returned by calling getComponentType().
protected  ELContext getELContext()
Return the ELContext for the FacesContext for this request.
protected  boolean hasBinding()
Return true if this component has a non-null binding attribute.
 void release()
Release any resources allocated during the execution of this tag handler.
 void setBinding(ValueExpression binding)
Set the value expression for our component.
protected  void setProperties(UIComponent component)
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.
 void setRendered(ValueExpression rendered)
Set an override for the rendered attribute.
Methods inherited from class javax.faces.webapp.UIComponentClassicTagBase
addChild, addFacet, addVerbatimAfterComponent, addVerbatimBeforeComponent, createVerbatimComponent, createVerbatimComponentFromBodyContent, doAfterBody, doEndTag, doInitBody, doStartTag, encodeBegin, encodeChildren, encodeEnd, findComponent, getBodyContent, getComponentInstance, getCreated, getCreatedComponents, getDoAfterBodyValue, getDoEndValue, getDoStartValue, getFacesContext, getFacesJspId, getFacetName, getId, getIndexOfNextChildTag, getJspId, getParent, getParentUIComponentClassicTagBase, getPreviousOut, setBodyContent, setId, setJspId, setPageContext, setParent, setupResponseWriter
Methods inherited from class javax.faces.webapp.UIComponentTagBase
getComponentType, getRendererType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, setPageContext, setParent

Constructor Detail

public UIComponentELTag()
英文文档：

UIComponentELTag

public UIComponentELTag()
Method Detail

public void setBinding(ValueExpression binding) throws JspException

设置组件的值表达式。

binding | 新的值表达式
Throws | JspException: 如果发生错误
英文文档：

setBinding

public void setBinding(ValueExpression binding)
                throws JspException

Set the value expression for our component.

Parameters:
binding - The new value expression
Throws:
JspException - if an error occurs

protected boolean hasBinding()
英文文档：

hasBinding

protected boolean hasBinding()
Description copied from class: UIComponentClassicTagBase

Return true if this component has a non-null binding attribute. This method is necessary to allow subclasses that expose the binding property as an Faces 1.1 style EL property as well as subclasses that expose it as an EL API property.

Specified by:
hasBinding in class UIComponentClassicTagBase

public void setRendered(ValueExpression rendered)

为呈现的属性设置重写。

rendered 呈现属性的新值
英文文档：

setRendered

public void setRendered(ValueExpression rendered)

Set an override for the rendered attribute.

Parameters:
rendered - The new value for rendered attribute

protected ELContext getELContext()

返回此请求的 FacesContext 的 ELContext。

这是 getFacesContext().getELContext() 的便捷方法。

英文文档：

getELContext

protected ELContext getELContext()

Return the ELContext for the FacesContext for this request.

This is a convenience for getFacesContext().getELContext().

Overrides:
getELContext in class UIComponentTagBase

public void release()

释放执行此标记处理程序期间分配的所有资源。

英文文档：

release

public void release()

Release any resources allocated during the execution of this tag handler.

Specified by:
release in interface Tag
Overrides:
release in class UIComponentClassicTagBase

protected void setProperties(UIComponent component)

如果明确设置了此标记处理程序实例相应的属性，则重写指定组件的属性。仅当指定的 UIComponent 在执行此标记处理器实例期间实际创建时，才调用此方法，此调用将在向视图添加 UIComponent 之前发生。

希望支持其他设置属性的标记子类必须确保仍然调用了基类 setProperties() 方法。支持额外属性 foo 和 bar 的典型实现如下所示：

protected void setProperties(UIComponent component) {
super.setProperties(component);
if (foo != null) {
component.setAttribute("foo", foo);
   }
if (bar != null) {
component.setAttribute("bar", bar);
   }
 }

默认实现重写以下属性：

  • rendered - 为此标记处理程序实例指定了 rendered 属性的值时设置。
  • rendererType - getRendererType() 方法返回非 null 值时设置。
component 要重写属性的 UIComponent
英文文档：

setProperties

protected void setProperties(UIComponent component)

Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified UIComponent was in fact created during the execution of this tag handler instance, and this call will occur BEFORE the UIComponent is added to the view.

Tag subclasses that want to support additional set properties must ensure that the base class setProperties() method is still called. A typical implementation that supports extra properties foo and bar would look something like this:

 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   if (foo != null) {
     component.setAttribute("foo", foo);
   }
   if (bar != null) {
     component.setAttribute("bar", bar);
   }
 }

The default implementation overrides the following properties:

  • rendered - Set if a value for the rendered property is specified for this tag handler instance.
  • rendererType - Set if the getRendererType() method returns a non-null value.

Specified by:
setProperties in class UIComponentClassicTagBase
Parameters:
component - UIComponent whose properties are to be overridden

protected UIComponent createComponent(FacesContext context, String newId) throws JspException

创建并返回新的类型（通过调用 getComponentType() 返回）子组件。如果此 UIComponentELTag 拥有非 null 的 binding 属性，则使用为 binding 属性创建的 ValueExpression 调用 Application#createComponent 实现，该 ValueExpression 将被存储在组件中。否则，调用 Application#createComponent，只有组件类型参数。最后，初始化组件 ID 和其他属性。

context | 当前请求的 FacesContext
newId | 组件的 ID
英文文档：

createComponent

protected UIComponent createComponent(FacesContext context,
                                      String newId)
                               throws JspException

Create and return a new child component of the type returned by calling getComponentType(). If this UIComponentELTag has a non-null binding attribute, this is done by call Application.createComponent(java.lang.String) with the ValueExpression created for the binding attribute, and the ValueExpression will be stored on the component. Otherwise, Application.createComponent(java.lang.String) is called with only the component type. Finally, initialize the components id and other properties.

Specified by:
createComponent in class UIComponentClassicTagBase
Parameters:
context - FacesContext for the current request
newId - id of the component
Throws:
JspException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIComponentTag (Java EE 5)

javax.faces.webapp
Class UIComponentTag

java.lang.Object
    extended by  javax.faces.webapp.UIComponentTagBase
        extended by  javax.faces.webapp.UIComponentClassicTagBase
            extended by  javax.faces.webapp.UIComponentTag
All Implemented Interfaces:
BodyTag, IterationTag, JspIdConsumer, JspTag, Tag
Direct Known Subclasses:
UIComponentBodyTag
Deprecated. Use of this class has been replaced with UIComponentELTag, which extends UIComponentClassicTagBase to add properties that use the EL API introduced as part of JSP 2.1.

Extends: UIComponentTagBase > UIComponentClassicTagBase
Implements: Tag
Extended by: UIComponentBodyTag

UIComponentTag 是所有满足以下条件的 JSP 自定义操作的基类：这些操作对应于 JavaServer Faces 所呈现的页面中的用户界面组件。

在此规范版本中，UIComponentTag 扩展了 UIComponentClassicTagBase，添加了使用 Faces 1.1 表达式语言的属性。

deprecated 此类的用途已由 UIComponentELTag 替代，后者扩展了 UIComponentClassicTagBase，添加了使用作为 JSP 2.1 一部分引入的 EL API 的属性。
英文文档：

public abstract class UIComponentTag
extends UIComponentClassicTagBase
implements Tag

UIComponentTag is the base class for all JSP custom actions that correspond to user interface components in a page that is rendered by JavaServer Faces.

In this version of the specification, UIComponentTag extends UIComponentClassicTagBase to add properties that use the Faces 1.1 Expression Language.

Field Summary
Fields inherited from class javax.faces.webapp.UIComponentClassicTagBase
bodyContent, pageContext, UNIQUE_ID_PREFIX
Fields inherited from class javax.faces.webapp.UIComponentTagBase
log
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Constructor Summary
UIComponentTag()
Deprecated.
Method Summary
protected UIComponent | createComponent(FacesContext context, String newId) Deprecated. Implement createComponent using Faces 1.1 EL API.
static UIComponentTag | getParentUIComponentTag(PageContext context) Deprecated. Locate and return the nearest enclosing UIComponentTag if any; otherwise, return null.
protected boolean | hasBinding() Deprecated. Return true if this component has a non-null binding attribute.
protected boolean | isSuppressed() Deprecated.
static boolean | isValueReference(String value) Deprecated. Return true if the specified value conforms to the syntax requirements of a value binding expression.
void | release() Deprecated. Release any resources allocated during the execution of this tag handler.
void | setBinding(String binding) Deprecated. Set the value binding expression for our component.
protected void | setProperties(UIComponent component) Deprecated. Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.
void | setRendered(String rendered) Deprecated. Set an override for the rendered attribute.
Methods inherited from class javax.faces.webapp.UIComponentClassicTagBase
addChild, addFacet, addVerbatimAfterComponent, addVerbatimBeforeComponent, createVerbatimComponent, createVerbatimComponentFromBodyContent, doAfterBody, doEndTag, doInitBody, doStartTag, encodeBegin, encodeChildren, encodeEnd, findComponent, getBodyContent, getComponentInstance, getCreated, getCreatedComponents, getDoAfterBodyValue, getDoEndValue, getDoStartValue, getFacesContext, getFacesJspId, getFacetName, getId, getIndexOfNextChildTag, getJspId, getParent, getParentUIComponentClassicTagBase, getPreviousOut, setBodyContent, setId, setJspId, setPageContext, setParent, setupResponseWriter
Methods inherited from class javax.faces.webapp.UIComponentTagBase
getComponentType, getELContext, getRendererType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, setPageContext, setParent

Constructor Detail

public UIComponentTag()
英文文档：

UIComponentTag

public UIComponentTag()
Deprecated.
Method Detail

public void setBinding(String binding) throws JspException

设置组件的值绑定表达式。

binding | 新的值绑定表达式
Throws | IllegalArgumentException: 如果指定的绑定不是有效的值绑定表达式。
英文文档：

setBinding

public void setBinding(String binding)
                throws JspException
Deprecated.

Set the value binding expression for our component.

Parameters:
binding - The new value binding expression
Throws:
IllegalArgumentException - if the specified binding is not a valid value binding expression.
JspException

protected boolean hasBinding()
英文文档：

hasBinding

protected boolean hasBinding()
Deprecated.
Description copied from class: UIComponentClassicTagBase

Return true if this component has a non-null binding attribute. This method is necessary to allow subclasses that expose the binding property as an Faces 1.1 style EL property as well as subclasses that expose it as an EL API property.

Specified by:
hasBinding in class UIComponentClassicTagBase

public void setRendered(String rendered)

为呈现的属性设置重写。

rendered 呈现属性的新值
英文文档：

setRendered

public void setRendered(String rendered)
Deprecated.

Set an override for the rendered attribute.

Parameters:
rendered - The new value for rendered attribute

protected boolean isSuppressed()
英文文档：

isSuppressed

protected boolean isSuppressed()
Deprecated.

public static boolean isValueReference(String value)

如果指定的值符合值绑定表达式的语法要求，则返回 true。这些表达式 ` * 可以对大多数组件标记属性使用，表示希望对要在底层 UIComponent 上设置的属性值进行延迟求值。

value | 要求值的值。
Throws | NullPointerException: 如果 value 为 null
英文文档：

isValueReference

public static boolean isValueReference(String value)
Deprecated.

Return true if the specified value conforms to the syntax requirements of a value binding expression. Such expressions ` * may be used on most component tag attributes to signal a desire for deferred evaluation of the attribute or property value to be set on the underlying UIComponent.

Parameters:
value - The value to evaluate
Throws:
NullPointerException - if value is null

public void release()

释放执行此标记处理程序期间分配的所有资源。

英文文档：

release

public void release()
Deprecated.

Release any resources allocated during the execution of this tag handler.

Specified by:
release in interface Tag
Overrides:
release in class UIComponentClassicTagBase

protected void setProperties(UIComponent component)
component NullPointerException 要重写属性的 UIComponent
英文文档：

setProperties

protected void setProperties(UIComponent component)
Deprecated.
Description copied from class: UIComponentClassicTagBase

Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified UIComponent was in fact created during the execution of this tag handler instance, and this call will occur BEFORE the UIComponent is added to the view.

Tag subclasses that want to support additional set properties must ensure that the base class setProperties() method is still called. A typical implementation that supports extra properties foo and bar would look something like this:

 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   if (foo != null) {
     component.setAttribute("foo", foo);
   }
   if (bar != null) {
     component.setAttribute("bar", bar);
   }
 }

The default implementation overrides the following properties:

  • rendered - Set if a value for the rendered property is specified for this tag handler instance.
  • rendererType - Set if the getRendererType() method returns a non-null value.

Specified by:
setProperties in class UIComponentClassicTagBase
Parameters:
component - UIComponent whose properties are to be overridden

protected UIComponent createComponent(FacesContext context, String newId)

使用 Faces 1.1 EL API 实现 createComponent。

context | NullPointerException 当前请求的 FacesContext
newId | NullPointerException 当前请求的 FacesContext
英文文档：

createComponent

protected UIComponent createComponent(FacesContext context,
                                      String newId)
Deprecated.

Implement createComponent using Faces 1.1 EL API.

Specified by:
createComponent in class UIComponentClassicTagBase
Parameters:
context - FacesContext for the current request
newId - id of the component

public static UIComponentTag getParentUIComponentTag(PageContext context)

查找并返回最新封装的 UIComponentTag（如果有）；否则返回 null。

context 当前页面的 PageContext
英文文档：

getParentUIComponentTag

public static UIComponentTag getParentUIComponentTag(PageContext context)
Deprecated.

Locate and return the nearest enclosing UIComponentTag if any; otherwise, return null.

Parameters:
context - PageContext for the current page
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIComponentTagBase (Java EE 5)

javax.faces.webapp
Class UIComponentTagBase

java.lang.Object
    extended by  javax.faces.webapp.UIComponentTagBase
All Implemented Interfaces:
JspTag
Direct Known Subclasses:
UIComponentClassicTagBase
public abstract class UIComponentTagBase
extends Object
implements JspTag

Implements: JspTag
Extended by: UIComponentClassicTagBase

UIComponentTagBase 是所有满足以下条件的 JSP 标记的基类：这些标记对应于视图中的 javax.faces.component.UIComponent 实例。此基类允许在由 UIComponentELTag 和 UIComponentTag 实例组成的 JSP 页面中描述单个视图。

英文文档：

UIComponentTagBase is the base class for all JSP tags that correspond to a UIComponent instance in the view. This base class allows a single view to be described in a JSP page consisting of both UIComponentELTag and UIComponentTag instances.

Field Summary
protected static Logger log
Constructor Summary
UIComponentTagBase()
Method Summary
protected abstract void | addChild(UIComponent child) Add the component identifier of the specified UIComponent to the list of component identifiers created or located by nested UIComponentTags processing this request.
protected abstract void | addFacet(String name) Add the facet name of the specified facet to the list of facet names created or located by nested UIComponentTags processing this request.
abstract UIComponent | getComponentInstance() Return the UIComponent instance that is associated with this tag instance.
abstract String | getComponentType() Return the component type for the component that is or will be bound to this tag.
abstract boolean | getCreated() Return true if we dynamically created a new component instance during execution of this tag.
protected ELContext | getELContext() Return the ELContext for the FacesContext for this request.
protected abstract FacesContext | getFacesContext() Return the FacesContext instance for the current request.
protected abstract int | getIndexOfNextChildTag() Return the index of the next child to be added as a child of this tag.
abstract String | getRendererType() Return the rendererType property that selects the Renderer to be used for encoding this component, or null to ask the component to render itself directly.
abstract void | setId(String id) Set the component identifier for the component corresponding to this tag instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

log

protected static Logger log
Constructor Detail

public UIComponentTagBase()
英文文档：

UIComponentTagBase

public UIComponentTagBase()
Method Detail

abstract protected FacesContext getFacesContext()

返回当前请求的 FacesContext 实例。只有从每个标记实例的 doStartTag() 开始到 doEndTag() 结束时，此值才为非 null。

英文文档：

getFacesContext

protected abstract FacesContext getFacesContext()

Return the FacesContext instance for the current request. This value will be non-null only from the beginning of doStartTag() through the end of doEndTag() for each tag instance.

protected ELContext getELContext()

返回此请求的 FacesContext 的 ELContext。

这是 getFacesContext().getELContext() 的便捷方法。

英文文档：

getELContext

protected ELContext getELContext()

Return the ELContext for the FacesContext for this request.

This is a convenience for getFacesContext().getELContext().

abstract protected void addChild(UIComponent child)

将指定 UIComponent 的组件标识符添加到组件标识符列表，该列表是由处理此请求的嵌套 UIComponentTag 创建或找到的。

child 应该添加标识符的新子组件
英文文档：

addChild

protected abstract void addChild(UIComponent child)

Add the component identifier of the specified UIComponent to the list of component identifiers created or located by nested UIComponentTags processing this request.

Parameters:
child - New child whose identifier should be added

abstract protected void addFacet(String name)

将指定 facet 的 facet 名称添加到 facet 名称列表，该列表是由处理此请求的嵌套 UIComponentTag 创建或找到的。

name 要添加的 Facet 名称
英文文档：

addFacet

protected abstract void addFacet(String name)

Add the facet name of the specified facet to the list of facet names created or located by nested UIComponentTags processing this request.

Parameters:
name - Facet name to be added

abstract public void setId(String id)

设置此标记实例所对应组件的组件标识符。如果该参数以 javax.faces.component.UIViewRoot#UNIQUE_ID_PREFIX 开头，则抛出 IllegalArgumentException

id | 新的组件标识符。它可能不是以 javax.faces.component.UIViewRoot#UNIQUE_ID_PREFIX 开头。
Throws | IllegalArgumentException: 如果参数为非 null 并且以 javax.faces.component.UIViewRoot#UNIQUE_ID_PREFIX 开头。
英文文档：

setId

public abstract void setId(String id)

Set the component identifier for the component corresponding to this tag instance. If the argument begins with UIViewRoot.UNIQUE_ID_PREFIX throw an IllegalArgumentException

Parameters:
id - The new component identifier. This may not start with UIViewRoot.UNIQUE_ID_PREFIX.
Throws:
IllegalArgumentException - if the argument is non-null and starts with UIViewRoot.UNIQUE_ID_PREFIX.

abstract public String getComponentType()

返回绑定或即将绑定到此标记的组件的组件类型。此值可以被传递给 javax.faces.application.Application#createComponent，以便为此标记创建 UIComponent 实例。子类必须重写此方法，以返回相应的值。

英文文档：

getComponentType

public abstract String getComponentType()

Return the component type for the component that is or will be bound to this tag. This value can be passed to Application.createComponent(java.lang.String) to create the UIComponent instance for this tag. Subclasses must override this method to return the appropriate value.

abstract public String getRendererType()

返回 rendererType 属性，该属性选择用来编码此组件的 Renderer；或者返回 null，表示请求组件直接呈现自身。子类必须重写此方法，以返回相应的值。

英文文档：

getRendererType

public abstract String getRendererType()

Return the rendererType property that selects the Renderer to be used for encoding this component, or null to ask the component to render itself directly. Subclasses must override this method to return the appropriate value.

abstract public UIComponent getComponentInstance()

返回关联此标记实例的 UIComponent 实例。此方法设计用于嵌套在标记中的标记，仅在对此标记实例执行 doStartTag() 和 doEndTag() 期间返回有用的结果。

英文文档：

getComponentInstance

public abstract UIComponent getComponentInstance()

Return the UIComponent instance that is associated with this tag instance. This method is designed to be used by tags nested within this tag, and only returns useful results between the execution of doStartTag() and doEndTag() on this tag instance.

abstract public boolean getCreated()

如果执行此标记期间动态创建了新的组件，则返回 true。此方法设计用于嵌套在标记中的标记，仅在对此标记实例执行 doStartTag() 和 doEndTag() 期间返回有用的结果。

英文文档：

getCreated

public abstract boolean getCreated()

Return true if we dynamically created a new component instance during execution of this tag. This method is designed to be used by tags nested within this tag, and only returns useful results between the execution of doStartTag() and doEndTag() on this tag instance.

abstract protected int getIndexOfNextChildTag()

返回下一个子标记的索引，它将添加为此标记的子标记。默认实现维护一个所建组件的列表，并返回该列表的大小。

英文文档：

getIndexOfNextChildTag

protected abstract int getIndexOfNextChildTag()

Return the index of the next child to be added as a child of this tag. The default implementation maintains a list of created components and returns the size of the list.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidatorELTag (Java EE 5)

javax.faces.webapp
Class ValidatorELTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.faces.webapp.ValidatorELTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
public abstract class ValidatorELTag
extends TagSupport

Extends: TagSupport

ValidatorELTag 是所有满足以下条件的 JSP 自定义操作的基类：对最接近的标记实例（其实现类为 UIComponentTag 的子类）所关联的 EditableValueHolder 创建并注册一个 Validator 实例。为了避免在重新显示页面时创建重复的实例，仅当执行当前页面期间拥有它的 UIComponentTagBase 创建相应的 UIComponent 时才创建和注册 Validator。

此类必须用作支持特定 Validator 子类的标记实例的基类。

此类的子类必须实现 createValidator() 方法，该方法创建并返回 Validator 实例。指定此 Validator 所执行限制的任何配置属性必须通过 createValidator() 方法进行了设置。这通常发生在复制标记实例相应的属性值时。

此标记没有对当前创建的页面创建任何输出。它仅用于创建 Validator 时产生的副作用。

英文文档：

ValidatorELTag is a base class for all JSP custom actions that create and register a Validator instance on the EditableValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentTag. To avoid creating duplicate instances when a page is redisplayed, creation and registration of a Validator occurs only if the corresponding UIComponent was created (by the owning UIComponentTagBase) during the execution of the current page.

This class must be used as a base class for tag instances that support specific Validator subclasses.

Subclasses of this class must implement the createValidator() method, which creates and returns a Validator instance. Any configuration properties that specify the limits to be enforced by this Validator must have been set by the createValidator() method. Generally, this occurs by copying corresponding attribute values on the tag instance.

This tag creates no output to the page currently being created. It is used solely for the side effect of Validator creation.

See Also:
Serialized Form

Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
ValidatorELTag()
Method Summary
protected abstract Validator | createValidator() Create and return a new Validator to be registered on our surrounding UIComponent.
int | doStartTag() Create a new instance of the specified Validator class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTagBase instance, if the UIComponent instance was created by this execution of the containing JSP page.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ValidatorELTag()
英文文档：

ValidatorELTag

public ValidatorELTag()
Method Detail

public int doStartTag() throws JspException

创建指定 Validator 类的新实例，如果执行包含它的 JSP 页面时创建了 UIComponent 实例，则向最接近的 UIComponentTagBase 实例所关联的 UIComponent 实例注册该新实例。

Throws JspException: 如果发生 JSP 错误
英文文档：

doStartTag

public int doStartTag()
               throws JspException

Create a new instance of the specified Validator class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTagBase instance, if the UIComponent instance was created by this execution of the containing JSP page.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY
Throws:
JspException - if a JSP error occurs
See Also:
Tag.doStartTag()

abstract protected Validator createValidator() throws JspException

创建并返回一个新的 Validator，以向接近的 UIComponent 注册。

Throws JspException: 如果无法创建新的实例
英文文档：

createValidator

protected abstract Validator createValidator()
                                      throws JspException

Create and return a new Validator to be registered on our surrounding UIComponent.

Throws:
JspException - if a new instance cannot be created
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidatorTag (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.faces.webapp
Class ValidatorTag

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.faces.webapp.ValidatorTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
Deprecated. This has been partially replaced by ValidatorELTag. The remainder of the functionality, namely, the binding facility and the implementation of the createValidator() method, is now an implementation detail.

Extends: TagSupport

ValidatorTag 是所有满足以下条件的 JSP 自定义操作的基类：对最接近的标记实例（其实现类为 UIComponentTag 的子类）所关联的 EditableValueHolder 创建并注册一个 Validator 实例。为了避免在重新显示页面时创建重复的实例，仅当执行当前页面期间拥有它的 UIComponentTag 创建相应的 UIComponent 时才创建和注册 Validator。

此类必须直接用来实现常规的验证器注册标记（基于 id 属性指定的验证器 ID），或者用作支持特定 Validator 子类的标记实例的基类。此 id 属性必须引用一个已知的验证器 ID，或 faces-config.xml 文件中定义的自定义验证器 ID。

此类的子类必须实现 createValidator() 方法，该方法创建并返回 Validator 实例。指定此 Validator 所执行限制的任何配置属性必须通过 createValidator() 方法进行了设置。这通常发生在复制标记实例相应的属性值时。

此标记没有对当前创建的页面创建任何输出。它仅用于创建 Validator 时产生的副作用。

deprecated 此类已经由 ValidatorELTag 部分替代。剩下的功能（即绑定工具和 #createValidator 方法的实现）现在是一个实现细节。
英文文档：

public class ValidatorTag
extends TagSupport

ValidatorTag is a base class for all JSP custom actions that create and register a Validator instance on the EditableValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentTag. To avoid creating duplicate instances when a page is redisplayed, creation and registration of a Validator occurs only if the corresponding UIComponent was created (by the owning UIComponentTag) during the execution of the current page.

This class may be used directly to implement a generic validator registration tag (based on the validator-id specified by the id attribute), or as a base class for tag instances that support specific Validator subclasses. This id attribute must refer to one of the well known validator-ids, or a custom validator-id as defined in a faces-config.xml file.

Subclasses of this class must implement the createValidator() method, which creates and returns a Validator instance. Any configuration properties that specify the limits to be enforced by this Validator must have been set by the createValidator() method. Generally, this occurs by copying corresponding attribute values on the tag instance.

This tag creates no output to the page currently being created. It is used solely for the side effect of Validator creation.

See Also:
Serialized Form

Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
ValidatorTag()
Deprecated.
Method Summary
protected Validator | createValidator() Deprecated. Create and return a new Validator to be registered on our surrounding UIComponent.
int | doStartTag() Deprecated. Create a new instance of the specified Validator class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if the UIComponent instance was created by this execution of the containing JSP page.
void | release() Deprecated. Release references to any acquired resources.
void | setBinding(String binding) Deprecated. Set the expression that will be used to create a ValueExpression that references a backing bean property of the Validator instance to be created.
void | setValidatorId(String validatorId) Deprecated. Set the identifer of the Validator instance to be created.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ValidatorTag()
英文文档：

ValidatorTag

public ValidatorTag()
Deprecated.
Method Detail

public void setValidatorId(String validatorId)

设置要创建的 Validator 实例的标识符。

validatorId 要创建的验证器实例的新标识符。
英文文档：

setValidatorId

public void setValidatorId(String validatorId)
Deprecated.

Set the identifer of the Validator instance to be created.

Parameters:
validatorId - The new identifier of the validator instance to be created.

public void setBinding(String binding) throws JspException

设置将用来创建 ValueExpression（它引用要创建的 Validator 实例的支持 (backing) Bean 属性）的表达式。

binding | 新表达式
Throws | JspException: 如果发生 JSP 错误
英文文档：

setBinding

public void setBinding(String binding)
                throws JspException
Deprecated.

Set the expression that will be used to create a ValueExpression that references a backing bean property of the Validator instance to be created.

Parameters:
binding - The new expression
Throws:
JspException - if a JSP error occurs

public int doStartTag() throws JspException

创建指定 Validator 类的新实例，如果执行包含它的 JSP 页面时创建了 UIComponent 实例，则向最接近的 UIComponentTag 实例所关联的 UIComponent 实例注册该新实例。

Throws JspException: 如果发生 JSP 错误
英文文档：

doStartTag

public int doStartTag()
               throws JspException
Deprecated.

Create a new instance of the specified Validator class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if the UIComponent instance was created by this execution of the containing JSP page.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY
Throws:
JspException - if a JSP error occurs
See Also:
Tag.doStartTag()

public void release()

释放对任何所需资源的引用。

英文文档：

release

public void release()
Deprecated.

Release references to any acquired resources.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport
See Also:
Tag.release()

protected Validator createValidator() throws JspException

创建并返回一个新的 Validator，以向接近的 UIComponent 注册。

Throws JspException: 如果无法创建新的实例
英文文档：

createValidator

protected Validator createValidator()
                             throws JspException
Deprecated.

Create and return a new Validator to be registered on our surrounding UIComponent.

Throws:
JspException - if a new instance cannot be created
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.interceptor (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.interceptor

The javax.interceptor package contains classes and interfaces for use with EJB interceptors.

See:
Description

Interface Summary
InvocationContext Context information passed to AroundInvoke and Interceptor-class lifecycle callback methods.

Annotation Types Summary
AroundInvoke |
ExcludeClassInterceptors | Used to exclude class-level interceptors for a business method.
ExcludeDefaultInterceptors | Used to exclude default interceptors for a bean or a business method.
Interceptors | Declares an ordered list of interceptors for a class or method.

Package javax.interceptor Description

The javax.interceptor package contains classes and interfaces for use with EJB interceptors.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.interceptor Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.interceptor

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.interceptor.InvocationContext

Annotation Type Hierarchy

  • javax.interceptor.AroundInvoke (implements java.lang.annotation.Annotation)
  • javax.interceptor.ExcludeClassInterceptors (implements java.lang.annotation.Annotation)
  • javax.interceptor.ExcludeDefaultInterceptors (implements java.lang.annotation.Annotation)
  • javax.interceptor.Interceptors (implements java.lang.annotation.Annotation)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


InvocationContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.interceptor
Interface InvocationContext

public interface InvocationContext

传递给 AroundInvoke 和 Interceptor 类生命周期回调方法的上下文信息。
英文文档：

Context information passed to AroundInvoke and Interceptor-class lifecycle callback methods.

Method Summary
Map<String,Object> | getContextData() Returns the context data associated with this invocation or lifecycle callback.
Method | getMethod() Returns the method of the bean class for which the interceptor was invoked.
Object[] | getParameters() Returns the parameters that will be used to invoke the business method.
Object | getTarget() Returns the target instance.
Object | proceed() Proceed to the next entry in the interceptor chain.
void | setParameters(Object[] params) Sets the parameters that will be used to invoke the business method.

Method Detail

public Object getTarget()
返回目标实例。
英文文档：

getTarget

Object getTarget()
Returns the target instance.

public Method getMethod()
返回调用 Interceptor 的 Bean 类的方法。对于 AroundInvoke 方法，这是 Bean 类的业务方法。对于生命周期回调方法，返回 null。
英文文档：

getMethod

Method getMethod()
Returns the method of the bean class for which the interceptor was invoked. For AroundInvoke methods, this is the business method on the bean class. For lifecycle callback methods, returns null.

public Object[] getParameters()
返回将用来调用业务方法的参数。如果已经调用了 setParameters，则 getParameters() 返回设置的参数值。
Throws IllegalStateException: 如果在生命周期回调方法中调用。
英文文档：

getParameters

Object[] getParameters()
Returns the parameters that will be used to invoke the business method. If setParameters has been called, getParameters() returns the values to which the parameters have been set.

Throws:
IllegalStateException - if invoked within a lifecycle callback method.

public void setParameters(Object[] params)
设置将用来调用业务方法的参数。
Throws | IllegalStateException: 如果在生命周期回调方法中调用。
Throws | IllegalArgumentException: 如果参数类型与业务方法的类型不匹配，或者提供的参数数量与业务方法的参数数量不相等。
英文文档：

setParameters

void setParameters(Object[] params)
Sets the parameters that will be used to invoke the business method.

Throws:
IllegalStateException - if invoked within a lifecycle callback method.
IllegalArgumentException - if the parameter types do not match the types for the business method, or the number of parameters supplied does not equal the number of parameters for the business method.

public java.util.Map<K, V> getContextData()
返回与此调用或生命周期回调关联的上下文数据。如果没有上下文数据，将返回一个空 Map 对象。
英文文档：

getContextData

Map<String,Object> getContextData()
Returns the context data associated with this invocation or lifecycle callback. If there is no context data, an empty Map object will be returned.

public Object proceed() throws Exception
继续处理 Interceptor 链的下一个条目。proceed 方法返回调用的下一个方法的结果。如果该方法返回 void，那么 proceed 返回 null。
英文文档：

proceed

Object proceed()
               throws Exception
Proceed to the next entry in the interceptor chain. The proceed method returns the result of the next method invoked. If the method returns void, proceed returns null.

Throws:
Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AroundInvoke (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.interceptor
Annotation Type AroundInvoke

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface AroundInvoke

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

英文文档：

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


ExcludeClassInterceptors (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.interceptor
Annotation Type ExcludeClassInterceptors

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface ExcludeClassInterceptors

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

用于排除业务方法的类级别 Interceptor。
英文文档：

Used to exclude class-level interceptors for a business method.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ExcludeDefaultInterceptors (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.interceptor
Annotation Type ExcludeDefaultInterceptors

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
public @interface ExcludeDefaultInterceptors

Implements: Annotation
@Target(value={TYPE, METHOD})
@Retention(value=RUNTIME)

用于排除 Bean 或业务方法的默认 Interceptor。
英文文档：

Used to exclude default interceptors for a bean or a business method.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Interceptors (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.interceptor
Annotation Type Interceptors

@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
public @interface Interceptors

Implements: Annotation
@Target(value={TYPE, METHOD})
@Retention(value=RUNTIME)

声明一个类或方法的 Interceptor 有序列表。
英文文档：

Declares an ordered list of interceptors for a class or method.

Required Element Summary
 Class[] value

Element Detail

abstract public Class<T>[] value()
英文文档：

value

public abstract Class[] value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


javax.jms (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.jms

The Java Message Service (JMS) API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

See:
Description

Interface Summary
BytesMessage | A BytesMessage object is used to send a message containing a stream of uninterpreted bytes.
Connection | A Connection object is a client's active connection to its JMS provider.
ConnectionConsumer | For application servers, Connection objects provide a special facility for creating a ConnectionConsumer (optional).
ConnectionFactory | A ConnectionFactory object encapsulates a set of connection configuration parameters that has been defined by an administrator.
ConnectionMetaData | A ConnectionMetaData object provides information describing the Connection object.
DeliveryMode | The delivery modes supported by the JMS API are PERSISTENT and NON_PERSISTENT.
Destination | A Destination object encapsulates a provider-specific address.
ExceptionListener | If a JMS provider detects a serious problem with a Connection object, it informs the Connection object's ExceptionListener, if one has been registered.
MapMessage | A MapMessage object is used to send a set of name-value pairs.
Message | The Message interface is the root interface of all JMS messages.
MessageConsumer | A client uses a MessageConsumer object to receive messages from a destination.
MessageListener | A MessageListener object is used to receive asynchronously delivered messages.
MessageProducer | A client uses a MessageProducer object to send messages to a destination.
ObjectMessage | An ObjectMessage object is used to send a message that contains a serializable object in the Java programming language ("Java object").
Queue | A Queue object encapsulates a provider-specific queue name.
QueueBrowser | A client uses a QueueBrowser object to look at messages on a queue without removing them.
QueueConnection | A QueueConnection object is an active connection to a point-to-point JMS provider.
QueueConnectionFactory | A client uses a QueueConnectionFactory object to create QueueConnection objects with a point-to-point JMS provider.
QueueReceiver | A client uses a QueueReceiver object to receive messages that have been delivered to a queue.
QueueSender | A client uses a QueueSender object to send messages to a queue.
QueueSession | A QueueSession object provides methods for creating QueueReceiver, QueueSender, QueueBrowser, and TemporaryQueue objects.
ServerSession | A ServerSession object is an application server object that is used by a server to associate a thread with a JMS session (optional).
ServerSessionPool | A ServerSessionPool object is an object implemented by an application server to provide a pool of ServerSession objects for processing the messages of a ConnectionConsumer (optional).
Session | A Session object is a single-threaded context for producing and consuming messages.
StreamMessage | A StreamMessage object is used to send a stream of primitive types in the Java programming language.
TemporaryQueue | A TemporaryQueue object is a unique Queue object created for the duration of a Connection.
TemporaryTopic | A TemporaryTopic object is a unique Topic object created for the duration of a Connection.
TextMessage | A TextMessage object is used to send a message containing a java.lang.String.
Topic | A Topic object encapsulates a provider-specific topic name.
TopicConnection | A TopicConnection object is an active connection to a publish/subscribe JMS provider.
TopicConnectionFactory | A client uses a TopicConnectionFactory object to create TopicConnection objects with a publish/subscribe JMS provider.
TopicPublisher | A client uses a TopicPublisher object to publish messages on a topic.
TopicSession | A TopicSession object provides methods for creating TopicPublisher, TopicSubscriber, and TemporaryTopic objects.
TopicSubscriber | A client uses a TopicSubscriber object to receive messages that have been published to a topic.
XAConnection | The XAConnection interface extends the capability of Connection by providing an XASession (optional).
XAConnectionFactory | The XAConnectionFactory interface is a base interface for the XAQueueConnectionFactory and XATopicConnectionFactory interfaces.
XAQueueConnection | An XAQueueConnection provides the same create options as QueueConnection (optional).
XAQueueConnectionFactory | An XAQueueConnectionFactory provides the same create options as a QueueConnectionFactory (optional).
XAQueueSession | An XAQueueSession provides a regular QueueSession, which can be used to create QueueReceiver, QueueSender, and QueueBrowser objects (optional).
XASession | The XASession interface extends the capability of Session by adding access to a JMS provider's support for the Java Transaction API (JTA) (optional).
XATopicConnection | An XATopicConnection provides the same create options as TopicConnection (optional).
XATopicConnectionFactory | An XATopicConnectionFactory provides the same create options as a TopicConnectionFactory (optional).
XATopicSession | An XATopicSession provides a regular TopicSession.

Class Summary
QueueRequestor | The QueueRequestor helper class simplifies making service requests.
TopicRequestor | The TopicRequestor helper class simplifies making service requests.

Exception Summary
IllegalStateException | This exception is thrown when a method is invoked at an illegal or inappropriate time or if the provider is not in an appropriate state for the requested operation.
InvalidClientIDException | This exception must be thrown when a client attempts to set a connection's client ID to a value that is rejected by a provider.
InvalidDestinationException | This exception must be thrown when a destination either is not understood by a provider or is no longer valid.
InvalidSelectorException | This exception must be thrown when a JMS client attempts to give a provider a message selector with invalid syntax.
JMSException | This is the root class of all JMS API exceptions.
JMSSecurityException | This exception must be thrown when a provider rejects a user name/password submitted by a client.
MessageEOFException | This exception must be thrown when an unexpected end of stream has been reached when a StreamMessage or BytesMessage is being read.
MessageFormatException | This exception must be thrown when a JMS client attempts to use a data type not supported by a message or attempts to read data in a message as the wrong type.
MessageNotReadableException | This exception must be thrown when a JMS client attempts to read a write-only message.
MessageNotWriteableException | This exception must be thrown when a JMS client attempts to write to a read-only message.
ResourceAllocationException | This exception is thrown when a provider is unable to allocate the resources required by a method.
TransactionInProgressException | This exception is thrown when an operation is invalid because a transaction is in progress.
TransactionRolledBackException | This exception must be thrown when a call to Session.commit results in a rollback of the current transaction.

Package javax.jms Description

The Java Message Service (JMS) API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

JMS Applications

A JMS application is composed of the following parts:

  • JMS Provider - a messaging system that implements the JMS API in addition to the other administrative and control functionality required of a full-featured messaging product
  • JMS Clients - the Java language programs that send and receive messages
  • Messages - objects that are used to communicate information between the clients of an application
  • Administered Objects - provider-specific objects that clients look up and use to interact portably with a JMS provider
  • Non-JMS Clients - clients that use a message system's native client API instead of the JMS API. If the application predated the availability of the JMS API, it is likely that it will include both JMS clients and non-JMS clients.

Administration

JMS providers differ significantly in their implementations of underlying messaging technology. There are also major differences in how a JMS provider's system is installed and administered.

For JMS clients to be portable, they must be isolated from these proprietary aspects of a provider. This is done by defining JMS administered objects that are created and customized by a provider's administrator and later used by clients. The client uses them through JMS interfaces that are portable. The administrator creates them using provider-specific facilities.

There are two types of JMS administered objects:

  • ConnectionFactory - the object a client uses to create a connection with a JMS provider
  • Destination - the object a client uses to specify the destination of messages it is sending and the source of messages it receives

Administered objects are placed in a Java Naming and Directory InterfaceTM (JNDI) namespace by an administrator. A JMS client typically notes in its documentation the JMS administered objects it requires and how the JNDI names of these objects should be provided to it.

Two Messaging Styles

The JMS specification defines two styles of messaging: the point-to-point (PTP) or the publish-and-subscribe (Pub/Sub). These styles can be combined in a single application, or a given application can use just one of these styles.

The JMS API defines these two styles because they represent two of the dominant approaches to messaging currently in use. While the domains have many similarities, they also have some differences. JMS provides a unified programming interface to allow the client programmer to easily send and receive message using either domain, but the client programmer must also be aware of the differences between the domains. The key differences relate to how message persistence is handled, and the meaning of certain message attributes.

JMS Interfaces

When programming an application client, the programmer may either program using the domain specific interfaces, or may use the common interfaces. The key interfaces are listed in the table below. The preferred model is to use the common interfaces. The advantage to using the common interfaces is that both point-to-point and pub/sub tasks can be combined in one session, allowing transactions to operate over both domains.

In earlier versions of JMS, there were separate class hierarchies for the pub/sub and point-to-point programming models that had to be used. These class hierarchies are retained to support backward compatibility with earlier versions of the JMS API, but client developers are encouraged to use the common interfaces.

Relationship of PTP and Pub/Sub interfaces
JMS Common | PTP Domain | Pub/Sub Domain
ConnectionFactory | QueueConnectionFactory | TopicConnectionFactory
Connection | QueueConnection | TopicConnection
Destination | Queue | Topic
Session | QueueSession | TopicSession
MessageProducer | QueueSender | TopicPublisher
MessageConsumer | QueueReceiver | TopicSubscriber

The following provides a brief definition of these JMS concepts. See the PTP and Pub/Sub chapters of the JMS specification for more information.

  • ConnectionFactory - an administered object used by a client to create a Connection
  • Connection - an active connection to a JMS provider
  • Destination - an administered object that encapsulates the identity of a message destination
  • Session - a single-threaded context for sending and receiving messages
  • MessageProducer - an object created by a Session that is used for sending messages to a destination
  • MessageConsumer - an object created by a Session that is used for receiving messages sent to a destination

The term consume is used in this document to mean the receipt of a message by a JMS client; that is, a JMS provider has received a message and has given it to its client. Since the JMS API supports both synchronous and asynchronous receipt of messages, the term consume is used when there is no need to make a distinction between them.

The term produce is used as the most general term for sending a message. It means giving a message to a JMS provider for delivery to a destination.

Developing a JMS Application

Broadly speaking, a JMS application is one or more JMS clients that exchange messages. The application may also involve non-JMS clients; however, these clients use the JMS provider's native API in place of the JMS API.

A JMS application can be architected and deployed as a unit. In many cases, JMS clients are added incrementally to an existing application.

The message definitions used by an application may originate with JMS, or they may have been defined by the non-JMS part of the application.

Developing a JMS Client

A typical JMS client executes the following setup procedure:

  • Use JNDI to find a ConnectionFactory object
  • Use JNDI to find one or more Destination objects
  • Use the ConnectionFactory to create a JMS Connection. At this point, message delivery is inhibited
  • Use the Connection to create one or more JMS Sessions
  • Use a Session and the Destinations to create the MessageProducers and MessageConsumers needed
  • Start message delivery for the Connection. Messages will be delivered to MessageConsumers

At this point a client has the basic setup needed to produce and consume messages.

Package Specification

Java Message Service Specification - Version 1.1

Related Documentation

Java Message Service Tutorial

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.jms Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.jms

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.jms.QueueRequestor
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.jms.JMSException
          • javax.jms.IllegalStateException
          • javax.jms.InvalidClientIDException
          • javax.jms.InvalidDestinationException
          • javax.jms.InvalidSelectorException
          • javax.jms.JMSSecurityException
          • javax.jms.MessageEOFException
          • javax.jms.MessageFormatException
          • javax.jms.MessageNotReadableException
          • javax.jms.MessageNotWriteableException
          • javax.jms.ResourceAllocationException
          • javax.jms.TransactionInProgressException
          • javax.jms.TransactionRolledBackException
    • javax.jms.TopicRequestor

Interface Hierarchy

  • javax.jms.Connection
    • javax.jms.QueueConnection
      • javax.jms.XAQueueConnection (also extends javax.jms.XAConnection)
    • javax.jms.TopicConnection
      • javax.jms.XATopicConnection (also extends javax.jms.XAConnection)
    • javax.jms.XAConnection
      • javax.jms.XAQueueConnection (also extends javax.jms.QueueConnection)
      • javax.jms.XATopicConnection (also extends javax.jms.TopicConnection)
  • javax.jms.ConnectionConsumer
  • javax.jms.ConnectionFactory
    • javax.jms.QueueConnectionFactory
      • javax.jms.XAQueueConnectionFactory (also extends javax.jms.XAConnectionFactory)
    • javax.jms.TopicConnectionFactory
      • javax.jms.XATopicConnectionFactory (also extends javax.jms.XAConnectionFactory)
  • javax.jms.ConnectionMetaData
  • javax.jms.DeliveryMode
  • javax.jms.Destination
    • javax.jms.Queue
      • javax.jms.TemporaryQueue
    • javax.jms.Topic
      • javax.jms.TemporaryTopic
  • javax.jms.ExceptionListener
  • javax.jms.Message
    • javax.jms.BytesMessage
    • javax.jms.MapMessage
    • javax.jms.ObjectMessage
    • javax.jms.StreamMessage
    • javax.jms.TextMessage
  • javax.jms.MessageConsumer
    • javax.jms.QueueReceiver
    • javax.jms.TopicSubscriber
  • javax.jms.MessageListener
  • javax.jms.MessageProducer
    • javax.jms.QueueSender
    • javax.jms.TopicPublisher
  • javax.jms.QueueBrowser
  • java.lang.Runnable
    • javax.jms.Session
      • javax.jms.QueueSession
      • javax.jms.TopicSession
      • javax.jms.XASession
        • javax.jms.XAQueueSession
        • javax.jms.XATopicSession
  • javax.jms.ServerSession
  • javax.jms.ServerSessionPool
  • javax.jms.XAConnectionFactory
    • javax.jms.XAQueueConnectionFactory (also extends javax.jms.QueueConnectionFactory)
    • javax.jms.XATopicConnectionFactory (also extends javax.jms.TopicConnectionFactory)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


BytesMessage (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.jms
Interface BytesMessage

All Superinterfaces:
Message
public interface BytesMessage
extends Message

Implements: Message

BytesMessage 对象用于发送包含未解释字节流的消息。它继承自 Message 接口，并添加了字节消息正文。消息的接收者提供该字节的解释。

BytesMessage 方法主要基于 java.io.DataInputStream 和 java.io.DataOutputStream 中的方法。

此消息类型用于客户端现有消息格式的编码。如有可能，应改用其他自定义消息类型之一。

尽管 JMS API 允许将消息属性用于字节消息，但一般不使用它们，因为包含属性可能会影响格式。

可以使用用于每种类型的方法显式写入基本类型。它们通常也能作为对象写入。例如，对 BytesMessage.writeInt(6) 的调用等效于 BytesMessage.writeObject(new Integer(6))。这两种形式都提供，因为显式形式对于静态编程很方便，而编译期间类型未知时需要对象形式。

第一次创建消息，并调用 clearBody 时，消息的正文是只写模式。完成了对 reset 的初次调用后，消息正文是只读模式。发送了消息后，发送它的客户端可以保留并修改该消息，而不影响已经发送的消息。同一个消息对象可以发送多次。收到消息后，提供者调用 reset，以便消息正文对于客户端是只读模式。

如果在只读模式中对消息调用 clearBody，则消息正文被清除，并且消息处于只写模式。

如果客户端尝试在只写模式下读取消息，则抛出 MessageNotReadableException。

如果客户端尝试在只读模式下写入消息，则抛出 MessageNotWriteableException。

version
en
1.1 April 2, 2002
See also createBytesMessage(), javax.jms.MapMessage, javax.jms.Message, javax.jms.ObjectMessage, javax.jms.StreamMessage, javax.jms.TextMessage
英文文档：

A BytesMessage object is used to send a message containing a stream of uninterpreted bytes. It inherits from the Message interface and adds a bytes message body. The receiver of the message supplies the interpretation of the bytes.

The BytesMessage methods are based largely on those found in java.io.DataInputStream and java.io.DataOutputStream.

This message type is for client encoding of existing message formats. If possible, one of the other self-defining message types should be used instead.

Although the JMS API allows the use of message properties with byte messages, they are typically not used, since the inclusion of properties may affect the format.

The primitive types can be written explicitly using methods for each type. They may also be written generically as objects. For instance, a call to BytesMessage.writeInt(6) is equivalent to BytesMessage.writeObject(new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.

When the message is first created, and when clearBody is called, the body of the message is in write-only mode. After the first call to reset has been made, the message body is in read-only mode. After a message has been sent, the client that sent it can retain and modify it without affecting the message that has been sent. The same message object can be sent multiple times. When a message has been received, the provider has called reset so that the message body is in read-only mode for the client.

If clearBody is called on a message in read-only mode, the message body is cleared and the message is in write-only mode.

If a client attempts to read a message in write-only mode, a MessageNotReadableException is thrown.

If a client attempts to write a message in read-only mode, a MessageNotWriteableException is thrown.

Version:
1.1 April 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createBytesMessage(), MapMessage, Message, ObjectMessage, StreamMessage, TextMessage

Field Summary
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
Method Summary
long | getBodyLength() Gets the number of bytes of the message body when the message is in read-only mode.
boolean | readBoolean() Reads a boolean from the bytes message stream.
byte | readByte() Reads a signed 8-bit value from the bytes message stream.
int | readBytes(byte[] value) Reads a byte array from the bytes message stream.
int | readBytes(byte[] value, int length) Reads a portion of the bytes message stream.
char | readChar() Reads a Unicode character value from the bytes message stream.
double | readDouble() Reads a double from the bytes message stream.
float | readFloat() Reads a float from the bytes message stream.
int | readInt() Reads a signed 32-bit integer from the bytes message stream.
long | readLong() Reads a signed 64-bit integer from the bytes message stream.
short | readShort() Reads a signed 16-bit number from the bytes message stream.
int | readUnsignedByte() Reads an unsigned 8-bit number from the bytes message stream.
int | readUnsignedShort() Reads an unsigned 16-bit number from the bytes message stream.
String | readUTF() Reads a string that has been encoded using a modified UTF-8 format from the bytes message stream.
void | reset() Puts the message body in read-only mode and repositions the stream of bytes to the beginning.
void | writeBoolean(boolean value) Writes a boolean to the bytes message stream as a 1-byte value.
void | writeByte(byte value) Writes a byte to the bytes message stream as a 1-byte value.
void | writeBytes(byte[] value) Writes a byte array to the bytes message stream.
void | writeBytes(byte[] value, int offset, int length) Writes a portion of a byte array to the bytes message stream.
void | writeChar(char value) Writes a char to the bytes message stream as a 2-byte value, high byte first.
void | writeDouble(double value) Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the bytes message stream as an 8-byte quantity, high byte first.
void | writeFloat(float value) Converts the float argument to an int using the floatToIntBits method in class Float, and then writes that int value to the bytes message stream as a 4-byte quantity, high byte first.
void | writeInt(int value) Writes an int to the bytes message stream as four bytes, high byte first.
void | writeLong(long value) Writes a long to the bytes message stream as eight bytes, high byte first.
void | writeObject(Object value) Writes an object to the bytes message stream.
void | writeShort(short value) Writes a short to the bytes message stream as two bytes, high byte first.
void | writeUTF(String value) Writes a string to the bytes message stream using UTF-8 encoding in a machine-independent manner.
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty

Method Detail

public long getBodyLength() throws JMSException
当消息处于只读模式时，获取消息正文的字节数。返回的值可用于分配 byte 数组。不管读取消息的指针当前处于什么位置，返回的值都是消息正文的整个长度。
return | 消息中的字节数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageNotReadableException: 如果消息是只写模式。
since | 1.1
英文文档：

getBodyLength

long getBodyLength()
                   throws JMSException
Gets the number of bytes of the message body when the message is in read-only mode. The value returned can be used to allocate a byte array. The value returned is the entire length of the message body, regardless of where the pointer for reading the message is currently located.

Returns:
number of bytes in the message
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageNotReadableException - if the message is in write-only mode.
Since:
1.1

public boolean readBoolean() throws JMSException
从字节消息流中读取一个 boolean。
return | 读取的 boolean 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readBoolean

boolean readBoolean()
                    throws JMSException
Reads a boolean from the bytes message stream.

Returns:
the boolean value read
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public byte readByte() throws JMSException
从字节消息流读取一个有符号的 8 位值。
return | 字节消息流中的下一个字节，以有符号 8 位 byte 的形式表示
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readByte

byte readByte()
              throws JMSException
Reads a signed 8-bit value from the bytes message stream.

Returns:
the next byte from the bytes message stream as a signed 8-bit byte
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public int readUnsignedByte() throws JMSException
从字节消息流读取一个无符号的 8 位数。
return | 字节消息流中的下一个字节，它将被解释为一个无符号 8 位数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readUnsignedByte

int readUnsignedByte()
                     throws JMSException
Reads an unsigned 8-bit number from the bytes message stream.

Returns:
the next byte from the bytes message stream, interpreted as an unsigned 8-bit number
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public short readShort() throws JMSException
从字节消息流中读取一个有符号的 16 位数。
return | 字节消息流中的下两个字节，解释为一个有符号 16 位数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readShort

short readShort()
                throws JMSException
Reads a signed 16-bit number from the bytes message stream.

Returns:
the next two bytes from the bytes message stream, interpreted as a signed 16-bit number
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public int readUnsignedShort() throws JMSException
从字节消息流中读取一个无符号的 16 位数。
return | 字节消息流中的下两个字节，解释为一个无符号 16 位整数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readUnsignedShort

int readUnsignedShort()
                      throws JMSException
Reads an unsigned 16-bit number from the bytes message stream.

Returns:
the next two bytes from the bytes message stream, interpreted as an unsigned 16-bit integer
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public char readChar() throws JMSException
从字节消息流中读取一个 Unicode 字符值。
return | 字节消息流中的下两个字节，解释为一个 Unicode 字符
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readChar

char readChar()
              throws JMSException
Reads a Unicode character value from the bytes message stream.

Returns:
the next two bytes from the bytes message stream as a Unicode character
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public int readInt() throws JMSException
从字节消息流中读取一个有符号的 32 位整数。
return | 字节消息流中的下四个字节，解释为一个 int
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readInt

int readInt()
            throws JMSException
Reads a signed 32-bit integer from the bytes message stream.

Returns:
the next four bytes from the bytes message stream, interpreted as an int
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public long readLong() throws JMSException
从字节消息流中读取一个有符号的 64 位整数。
return | 字节消息流中的下八个字节，解释为一个 long
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readLong

long readLong()
              throws JMSException
Reads a signed 64-bit integer from the bytes message stream.

Returns:
the next eight bytes from the bytes message stream, interpreted as a long
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public float readFloat() throws JMSException
从字节消息流中读取一个 float。
return | 字节消息流中的下四个字节，解释为一个 float
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readFloat

float readFloat()
                throws JMSException
Reads a float from the bytes message stream.

Returns:
the next four bytes from the bytes message stream, interpreted as a float
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public double readDouble() throws JMSException
从字节消息流中读取一个 double。
return | 字节消息流中的下八个字节，解释为一个 double
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readDouble

double readDouble()
                  throws JMSException
Reads a double from the bytes message stream.

Returns:
the next eight bytes from the bytes message stream, interpreted as a double
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public String readUTF() throws JMSException
从字节消息流中读取一个已使用 UTF-8 修改版格式编码的字符串。

有关更多 UTF-8 格式的信息，请参阅 "File System Safe UCS Transformation Format (FSS_UTF)"，X/Open Preliminary Specification，X/Open Company Ltd.，文件号：P316。也可在 ISO/IEC 10646，Annex P 中查阅此信息。

return | 字节消息流的一个 Unicode 字符串
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的字节流末尾。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readUTF

String readUTF()
               throws JMSException
Reads a string that has been encoded using a modified UTF-8 format from the bytes message stream.

For more information on the UTF-8 format, see "File System Safe UCS Transformation Format (FSS_UTF)", X/Open Preliminary Specification, X/Open Company Ltd., Document Number: P316. This information also appears in ISO/IEC 10646, Annex P.

Returns:
a Unicode string from the bytes message stream
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of bytes stream has been reached.
MessageNotReadableException - if the message is in write-only mode.

public int readBytes(byte[] value) throws JMSException
从字节消息流中读取一个 byte 数组。

如果数组 value 的长度小于还需要从流中读取的字节数，则应该填满数组。后续调用读取下一个增量，依此类推。

如果流中剩余的字节数小于数组 value 的长度，则应将字节读入数组。读取字节总数的返回值将小于数组的长度，指示流中已无字节可供读取。下一次对流的读取返回 -1。

value | 将数据读入的缓冲区
return | 读入缓冲区的总字节数，如果由于已到达流末尾而不再有数据，则返回 -1
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readBytes

int readBytes(byte[] value)
              throws JMSException
Reads a byte array from the bytes message stream.

If the length of array value is less than the number of bytes remaining to be read from the stream, the array should be filled. A subsequent call reads the next increment, and so on.

If the number of bytes remaining in the stream is less than the length of array value, the bytes should be read into the array. The return value of the total number of bytes read will be less than the length of the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream returns -1.

Parameters:
value - the buffer into which the data is read
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageNotReadableException - if the message is in write-only mode.

public int readBytes(byte[] value, int length) throws JMSException
读取字节消息流的某一部分。

如果数组 value 的长度小于还需要从流中读取的字节数，则应该填满数组。后续调用读取下一个增量，依此类推。

如果流中剩余的字节数小于数组 value 的长度，则应将字节读入数组。读取字节总数的返回值将小于数组的长度，指示流中已无字节可供读取。下一次对流的读取返回 -1。

如果 length 为负，或者 length 大于数组 value 的长度，则抛出 IndexOutOfBoundsException。在此异常情况下不会从流中读取字节。

value | 将数据读入的缓冲区
length | 要读取的字节数；必须小于或等于 value.length
return | 读入缓冲区的总字节数，如果由于已到达流末尾而不再有数据，则返回 -1
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readBytes

int readBytes(byte[] value,
              int length)
              throws JMSException
Reads a portion of the bytes message stream.

If the length of array value is less than the number of bytes remaining to be read from the stream, the array should be filled. A subsequent call reads the next increment, and so on.

If the number of bytes remaining in the stream is less than the length of array value, the bytes should be read into the array. The return value of the total number of bytes read will be less than the length of the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream returns -1.

If length is negative, or length is greater than the length of the array value, then an IndexOutOfBoundsException is thrown. No bytes will be read from the stream for this exception case.

Parameters:
value - the buffer into which the data is read
length - the number of bytes to read; must be less than or equal to value.length
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageNotReadableException - if the message is in write-only mode.

public void writeBoolean(boolean value) throws JMSException
将一个 boolean 以 1-byte 值形式写入字节消息流。值 true 以值 (byte)1 的形式被写入；值 false 以值 (byte)0 的形式被写入。
value | 要写入的 boolean 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeBoolean

void writeBoolean(boolean value)
                  throws JMSException
Writes a boolean to the bytes message stream as a 1-byte value. The value true is written as the value (byte)1; the value false is written as the value (byte)0.

Parameters:
value - the boolean value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeByte(byte value) throws JMSException
将一个 byte 以 1-byte 值形式写入字节消息流。
value | 要写入的 byte 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeByte

void writeByte(byte value)
               throws JMSException
Writes a byte to the bytes message stream as a 1-byte value.

Parameters:
value - the byte value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeShort(short value) throws JMSException
将一个 short 以两个字节的形式写入字节消息流，先写高字节。
value | 要写入的 short。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeShort

void writeShort(short value)
                throws JMSException
Writes a short to the bytes message stream as two bytes, high byte first.

Parameters:
value - the short to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeChar(char value) throws JMSException
将一个 char 以 2-byte 值形式写入字节消息流，先写入高字节。
value | 要写入的 char 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeChar

void writeChar(char value)
               throws JMSException
Writes a char to the bytes message stream as a 2-byte value, high byte first.

Parameters:
value - the char value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeInt(int value) throws JMSException
将一个 int 以四个字节的形式写入字节消息流，先写入高字节。
value | 要写入的 int。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeInt

void writeInt(int value)
              throws JMSException
Writes an int to the bytes message stream as four bytes, high byte first.

Parameters:
value - the int to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeLong(long value) throws JMSException
将一个 long 以八个字节的形式写入字节消息流，先写入高字节。
value | 要写入的 long。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeLong

void writeLong(long value)
               throws JMSException
Writes a long to the bytes message stream as eight bytes, high byte first.

Parameters:
value - the long to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeFloat(float value) throws JMSException
使用 Float 类中的 floatToIntBits 方法将 float 参数转换为一个 int，然后将该 int 值以 4-byte 值形式写入字节消息流，先写入高字节。
value | 要写入的 float 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeFloat

void writeFloat(float value)
                throws JMSException
Converts the float argument to an int using the floatToIntBits method in class Float, and then writes that int value to the bytes message stream as a 4-byte quantity, high byte first.

Parameters:
value - the float value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeDouble(double value) throws JMSException
使用 Double 类中的 doubleToLongBits 方法将 double 参数转换为一个 long，然后将该 long 值以 8-byte 值形式写入字节消息流，先写入高字节。
value | 要写入的 double 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeDouble

void writeDouble(double value)
                 throws JMSException
Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the bytes message stream as an 8-byte quantity, high byte first.

Parameters:
value - the double value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeUTF(String value) throws JMSException
使用 UTF-8 编码以与机器无关的方式将一个字符串写入字节消息流。

有关更多 UTF-8 格式的信息，请参阅 "File System Safe UCS Transformation Format (FSS_UTF)"，X/Open Preliminary Specification，X/Open Company Ltd.，文件号：P316。也可在 ISO/IEC 10646，Annex P 中查阅此信息。

value | 要写入的 String 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeUTF

void writeUTF(String value)
              throws JMSException
Writes a string to the bytes message stream using UTF-8 encoding in a machine-independent manner.

For more information on the UTF-8 format, see "File System Safe UCS Transformation Format (FSS_UTF)", X/Open Preliminary Specification, X/Open Company Ltd., Document Number: P316. This information also appears in ISO/IEC 10646, Annex P.

Parameters:
value - the String value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeBytes(byte[] value) throws JMSException
将一个 byte 数组写入字节消息流。
value | 要写入的 byte 数组
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeBytes

void writeBytes(byte[] value)
                throws JMSException
Writes a byte array to the bytes message stream.

Parameters:
value - the byte array to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeBytes(byte[] value, int offset, int length) throws JMSException
将 byte 数组的某一部分写入字节消息流。
value | 要写入的 byte 数组
offset | byte 数组中的初始偏移量
length | 要使用的字节数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeBytes

void writeBytes(byte[] value,
                int offset,
                int length)
                throws JMSException
Writes a portion of a byte array to the bytes message stream.

Parameters:
value - the byte array value to be written
offset - the initial offset within the byte array
length - the number of bytes to use
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeObject(Object value) throws JMSException
将一个对象写入字节消息流。

此方法仅用于对象化的基本对象类型（Integer、Double、Long 等）、String 对象和 byte 数组。

value | 要写入的 Java 编程语言中的对象（“Java 对象”）；它不得为 null
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageFormatException: 如果对象是无效类型。
Throws | MessageNotWriteableException: 如果消息是只读模式。
Throws | NullPointerException: 如果参数 value 为 null。
英文文档：

writeObject

void writeObject(Object value)
                 throws JMSException
Writes an object to the bytes message stream.

This method works only for the objectified primitive object types (Integer, Double, Long ...), String objects, and byte arrays.

Parameters:
value - the object in the Java programming language ("Java object") to be written; it must not be null
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageFormatException - if the object is of an invalid type.
MessageNotWriteableException - if the message is in read-only mode.
NullPointerException - if the parameter value is null.

public void reset() throws JMSException
将消息正文置于只读模式并将字节流重新定位到起始处。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法重置消息。
Throws | MessageFormatException: 如果消息存在无效的格式。
英文文档：

reset

void reset()
           throws JMSException
Puts the message body in read-only mode and repositions the stream of bytes to the beginning.

Throws:
JMSException - if the JMS provider fails to reset the message due to some internal error.
MessageFormatException - if the message has an invalid format.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Connection (Java EE 5)

javax.jms
Interface Connection

All Known Subinterfaces:
QueueConnection, TopicConnection, XAConnection, XAQueueConnection, XATopicConnection
public interface Connection

Implemented by: QueueConnection, TopicConnection, XAConnection

Connection 对象是客户端到其 JMS 提供者的活动连接。它通常在 Java 虚拟机 (JVM) 外部分配提供者资源。

连接支持并发使用。

连接有几个用途：

  • 它封装与 JMS 提供者的开放连接。它通常表示客户端与服务提供者软件之间的一个开放式 TCP/IP 套接字。
  • 它在进行客户端验证的地方创建。
  • 它可以指定唯一客户端标识符。
  • 它提供一个 ConnectionMetaData 对象。
  • 它支持可选的 ExceptionListener 对象。

由于连接的创建涉及设置验证和通信，因此连接是一个相对重量级的对象。大多数客户端都将使用单个连接进行所有消息传送。其他更高级的应用程序可能使用几个连接。JMS API 没有解释使用多个连接的原因；不过，这么做可能是出于某些操作原因。

JMS 客户端通常创建一个连接、一个或多个会话，以及一定数量的消息生成方和使用方。连接创建时，它处于停止模式。这意味着没有消息被传送。

在设置完成之前（也就是，创建完所有消息使用方之前），连接通常处于停止模式。完成设置后，客户端调用连接的 start 方法，消息开始到达该连接的使用方。此设置约定会最大限度地减小客户端仍处于自身设置过程中时由于异步消息传送可能导致的客户端混乱。

可以立即启动连接，随后完成设置。执行该操作的客户端必须准备好处理在其仍处于设置过程中时进行的异步消息传送。

消息生成方可以在连接停止时发送消息。

version
en
1.1 - February 1, 2002
See also javax.jms.ConnectionFactory, javax.jms.QueueConnection, javax.jms.TopicConnection
英文文档：

A Connection object is a client's active connection to its JMS provider. It typically allocates provider resources outside the Java virtual machine (JVM).

Connections support concurrent use.

A connection serves several purposes:

  • It encapsulates an open connection with a JMS provider. It typically represents an open TCP/IP socket between a client and the service provider software.
  • Its creation is where client authentication takes place.
  • It can specify a unique client identifier.
  • It provides a ConnectionMetaData object.
  • It supports an optional ExceptionListener object.

Because the creation of a connection involves setting up authentication and communication, a connection is a relatively heavyweight object. Most clients will do all their messaging with a single connection. Other more advanced applications may use several connections. The JMS API does not architect a reason for using multiple connections; however, there may be operational reasons for doing so.

A JMS client typically creates a connection, one or more sessions, and a number of message producers and consumers. When a connection is created, it is in stopped mode. That means that no messages are being delivered.

It is typical to leave the connection in stopped mode until setup is complete (that is, until all message consumers have been created). At that point, the client calls the connection's start method, and messages begin arriving at the connection's consumers. This setup convention minimizes any client confusion that may result from asynchronous message delivery while the client is still in the process of setting itself up.

A connection can be started immediately, and the setup can be done afterwards. Clients that do this must be prepared to handle asynchronous message delivery while they are still in the process of setting up.

A message producer can send messages while a connection is stopped.

Version:
1.1 - February 1, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
ConnectionFactory, QueueConnection, TopicConnection

Method Summary
void | close() Closes the connection.
ConnectionConsumer | createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) Creates a connection consumer for this connection (optional operation).
ConnectionConsumer | createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) Create a durable connection consumer for this connection (optional operation).
Session | createSession(boolean transacted, int acknowledgeMode) Creates a Session object.
String | getClientID() Gets the client identifier for this connection.
ExceptionListener | getExceptionListener() Gets the ExceptionListener object for this connection.
ConnectionMetaData | getMetaData() Gets the metadata for this connection.
void | setClientID(String clientID) Sets the client identifier for this connection.
void | setExceptionListener(ExceptionListener listener) Sets an exception listener for this connection.
void | start() Starts (or restarts) a connection's delivery of incoming messages.
void | stop() Temporarily stops a connection's delivery of incoming messages.

Method Detail

public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
创建 Session 对象。
transacted | 指示会话是否是事务性的
acknowledgeMode | 指示使用方或客户端是否将确认收到的任何消息；如果会话是事务性的，则忽略此参数。合法值有 Session.AUTO_ACKNOWLEDGE、Session.CLIENT_ACKNOWLEDGE 和 Session.DUPS_OK_ACKNOWLEDGE。
return | 新建的会话
Throws | JMSException: 如果 Connection 对象由于某个内部错误或缺少对特定事务和确认模式的支持无法创建会话。
since | 1.1
See also | AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
英文文档：

createSession

Session createSession(boolean transacted,
                      int acknowledgeMode)
                      throws JMSException
Creates a Session object.

Parameters:
transacted - indicates whether the session is transacted
acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.
Returns:
a newly created session
Throws:
JMSException - if the Connection object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
Since:
1.1
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE

public String getClientID() throws JMSException
获取此连接的客户端标识符。

此值特定于 JMS 提供者。它可以由管理员在 ConnectionFactory 对象中预配置，也可以由应用程序通过调用 setClientID 方法动态分配。

return | 唯一客户端标识符
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法返回此连接的客户端 ID。
英文文档：

getClientID

String getClientID()
                   throws JMSException
Gets the client identifier for this connection.

This value is specific to the JMS provider. It is either preconfigured by an administrator in a ConnectionFactory object or assigned dynamically by the application by calling the setClientID method.

Returns:
the unique client identifier
Throws:
JMSException - if the JMS provider fails to return the client ID for this connection due to some internal error.

public void setClientID(String clientID) throws JMSException
设置此连接的客户端标识符。

分配 JMS 客户端的客户端标识符的首选方法是在特定于客户端的 ConnectionFactory 对象中配置它并以透明方式分配给其创建的 Connection 对象。

此外，客户端可以使用特定于提供者的值设置连接的客户端标识符。显式设置连接的客户端标识符的工具不是一种用来重写以管理方式配置的标识符的机制。它是为不存在以管理方式指定的标识符的情况提供的。如果存在以管理方式指定的标识符，则尝试通过设置更改它必定抛出 IllegalStateException。如果客户端要显式地设置客户端标识符，那么它必须在创建连接之后和对连接执行任何其他操作之前立即这样做。在这个时间点之后，设置客户端标识符将成为编程错误，会抛出 IllegalStateException。

客户端标识符的作用是将连接及其对象与提供者代表客户端维持的状态相关联。只有 JMS API 标识的这种状态才是支持持久订阅所需要的。

如果调用此方法时具有相同 clientID 的另一个连接已经在运行，则 JMS 提供者应能检测到重复的 ID 并抛出 InvalidClientIDException。

clientID | 唯一客户端标识符
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置此连接的客户端 ID。
Throws | InvalidClientIDException: 如果 JMS 客户端指定了无效或重复的客户端 ID。
Throws | IllegalStateException: 如果 JMS 客户端尝试在错误时间或者在已通过管理方式进行了配置时设置连接的客户端 ID。
英文文档：

setClientID

void setClientID(String clientID)
                 throws JMSException
Sets the client identifier for this connection.

The preferred way to assign a JMS client's client identifier is for it to be configured in a client-specific ConnectionFactory object and transparently assigned to the Connection object it creates.

Alternatively, a client can set a connection's client identifier using a provider-specific value. The facility to set a connection's client identifier explicitly is not a mechanism for overriding the identifier that has been administratively configured. It is provided for the case where no administratively specified identifier exists. If one does exist, an attempt to change it by setting it must throw an IllegalStateException. If a client sets the client identifier explicitly, it must do so immediately after it creates the connection and before any other action on the connection is taken. After this point, setting the client identifier is a programming error that should throw an IllegalStateException.

The purpose of the client identifier is to associate a connection and its objects with a state maintained on behalf of the client by a provider. The only such state identified by the JMS API is that required to support durable subscriptions.

If another connection with the same clientID is already running when this method is called, the JMS provider should detect the duplicate ID and throw an InvalidClientIDException.

Parameters:
clientID - the unique client identifier
Throws:
JMSException - if the JMS provider fails to set the client ID for this connection due to some internal error.
InvalidClientIDException - if the JMS client specifies an invalid or duplicate client ID.
IllegalStateException - if the JMS client attempts to set a connection's client ID at the wrong time or when it has been administratively configured.

public ConnectionMetaData getMetaData() throws JMSException
获取此连接的元数据。
return | 连接元数据
Throws | JMSException: 如果 JMS 提供者无法获取此连接的连接元数据。
See also | javax.jms.ConnectionMetaData
英文文档：

getMetaData

ConnectionMetaData getMetaData()
                               throws JMSException
Gets the metadata for this connection.

Returns:
the connection metadata
Throws:
JMSException - if the JMS provider fails to get the connection metadata for this connection.
See Also:
ConnectionMetaData

public ExceptionListener getExceptionListener() throws JMSException
获取此连接的 ExceptionListener 对象。不是每个 Connection 都有与之关联的 ExceptionListener。
return | 此连接的 ExceptionListener；如果没有与此连接关联的 ExceptionListener，则返回 null。
Throws | JMSException: 如果 JMS 提供者无法获取此连接的 ExceptionListener。
See also | setExceptionListener
英文文档：

getExceptionListener

ExceptionListener getExceptionListener()
                                       throws JMSException
Gets the ExceptionListener object for this connection. Not every Connection has an ExceptionListener associated with it.

Returns:
the ExceptionListener for this connection, or null. if no ExceptionListener is associated with this connection.
Throws:
JMSException - if the JMS provider fails to get the ExceptionListener for this connection.
See Also:
setExceptionListener(javax.jms.ExceptionListener)

public void setExceptionListener(ExceptionListener listener) throws JMSException
设置此连接的异常侦听器。

如果 JMS 提供者检测到连接存在严重问题，它会通知连接的 ExceptionListener（如果已注册了一个异常侦听器）。这是通过调用侦听器的 onException 方法并将其传递到描述该问题的 JMSException 对象来实现的。

异常侦听器允许客户端异步获得问题的通知。某些连接只使用消息，因此它们没有其他方式来了解其连接已失败。

连接序列化其 ExceptionListener 的执行。

JMS 提供者应该在通知客户端之前尝试自己解决连接问题。

listener | 异常侦听器
Throws | JMSException: 如果 JMS 提供者无法设置此连接的异常侦听器。
英文文档：

setExceptionListener

void setExceptionListener(ExceptionListener listener)
                          throws JMSException
Sets an exception listener for this connection.

If a JMS provider detects a serious problem with a connection, it informs the connection's ExceptionListener, if one has been registered. It does this by calling the listener's onException method, passing it a JMSException object describing the problem.

An exception listener allows a client to be notified of a problem asynchronously. Some connections only consume messages, so they would have no other way to learn their connection has failed.

A connection serializes execution of its ExceptionListener.

A JMS provider should attempt to resolve connection problems itself before it notifies the client of them.

Parameters:
listener - the exception listener
Throws:
JMSException - if the JMS provider fails to set the exception listener for this connection.

public void start() throws JMSException
启动或（重启）连接的传入消息传送。对已经启动的连接调用 start 将被忽略。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法启动消息传送。
See also | stop
英文文档：

start

void start()
           throws JMSException
Starts (or restarts) a connection's delivery of incoming messages. A call to start on a connection that has already been started is ignored.

Throws:
JMSException - if the JMS provider fails to start message delivery due to some internal error.
See Also:
stop()

public void stop() throws JMSException
暂时停止连接的传入消息传送。可以使用连接的 start 方法重启传送。当连接停止时，对所有连接的消息使用方的传送都被禁止：同步接收阻塞，并且消息没有传送到消息侦听器。

此调用将会一直阻塞，直到正在执行的接收和/或消息侦听器完成为止。

停止连接不会影响其发送消息的能力。对已经停止的连接调用 stop 将被忽略。

在消息传送暂停之前，不能返回对 stop 的调用。这意味着客户端可以确认以下事实：在重启连接之前，不会调用其任何消息侦听器并且等待 receive 调用返回的所有控制线程都不会返回消息。停止连接的接收计时器继续计时，因此当连接停止时，接收可能超时。

如果调用 stop 时消息侦听器正在运行，则 stop 调用必须等到所有消息侦听器返回后，它才能返回。当这些消息侦听器将要完成时，它们必须可以使用连接的全部服务。

Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法停止消息传送。
See also | start
英文文档：

stop

void stop()
          throws JMSException
Temporarily stops a connection's delivery of incoming messages. Delivery can be restarted using the connection's start method. When the connection is stopped, delivery to all the connection's message consumers is inhibited: synchronous receives block, and messages are not delivered to message listeners.

This call blocks until receives and/or message listeners in progress have completed.

Stopping a connection has no effect on its ability to send messages. A call to stop on a connection that has already been stopped is ignored.

A call to stop must not return until delivery of messages has paused. This means that a client can rely on the fact that none of its message listeners will be called and that all threads of control waiting for receive calls to return will not return with a message until the connection is restarted. The receive timers for a stopped connection continue to advance, so receives may time out while the connection is stopped.

If message listeners are running when stop is invoked, the stop call must wait until all of them have returned before it may return. While these message listeners are completing, they must have the full services of the connection available to them.

Throws:
JMSException - if the JMS provider fails to stop message delivery due to some internal error.
See Also:
start()

public void close() throws JMSException
关闭连接。

由于提供者通常会代表连接分配 JVM 之外的重要资源，因此不需要这些资源时客户端应该关闭它们。依赖于垃圾收集最终回收这些资源可能不够及时。

无需关闭已关闭连接的会话、生成方和使用方。

关闭连接会导致所有临时目的地被删除。

调用此方法时，在依次关闭消息处理之前，它不会返回。这意味着可能一直在运行的所有消息侦听器都已经返回，并且所有挂起的接收都已经返回。关闭会终止连接会话的使用方上所有挂起的消息接收。接收可能返回消息或 null，这取决于在关闭时是否有可用的消息。如果调用连接 close 时一个或多个连接会话的消息侦听器正在处理消息，则连接及其会话的所有工具都必须对这些侦听器保持可用，直到它们将控制返回给 JMS 提供者为止。

关闭连接会导致其正在执行的任何会话事务回滚。如果外部事务管理器协调会话的工作，则不使用会话的 commit 和 rollback 方法，并且关闭会话的工作结果将由该事务管理器以后决定。 关闭连接不会强制对客户端确认的会话进行确认。

从已关闭连接的会话调用所接收消息的 acknowledge 方法必须抛出 IllegalStateException。关闭已关闭的连接不会抛出异常。

Throws JMSException: 如果 JMS 提供者由于某个内部错误无法关闭连接。例如，无法释放资源或关闭套接字会导致抛出此异常。
英文文档：

close

void close()
           throws JMSException
Closes the connection.

Since a provider typically allocates significant resources outside the JVM on behalf of a connection, clients should close these resources when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

There is no need to close the sessions, producers, and consumers of a closed connection.

Closing a connection causes all temporary destinations to be deleted.

When this method is invoked, it should not return until message processing has been shut down in an orderly fashion. This means that all message listeners that may have been running have returned, and that all pending receives have returned. A close terminates all pending message receives on the connection's sessions' consumers. The receives may return with a message or with null, depending on whether there was a message available at the time of the close. If one or more of the connection's sessions' message listeners is processing a message at the time when connection close is invoked, all the facilities of the connection and its sessions must remain available to those listeners until they return control to the JMS provider.

Closing a connection causes any of its sessions' transactions in progress to be rolled back. In the case where a session's work is coordinated by an external transaction manager, a session's commit and rollback methods are not used and the result of a closed session's work is determined later by the transaction manager. Closing a connection does NOT force an acknowledgment of client-acknowledged sessions.

Invoking the acknowledge method of a received message from a closed connection's session must throw an IllegalStateException. Closing a closed connection must NOT throw an exception.

Throws:
JMSException - if the JMS provider fails to close the connection due to some internal error. For example, a failure to release resources or to close a socket connection can cause this exception to be thrown.

public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
创建此连接的连接使用方（可选操作）。这是一个专家级工具，常规 JMS 客户端不使用。
destination | 要访问的目的地
messageSelector | 仅包括那些属性匹配所传送的消息选择器表达式的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
sessionPool | 与此连接使用方关联的服务器会话池
maxMessages | 可以一次分配给服务器会话的最大消息数
return | 连接使用方
Throws | JMSException: 如果 Connection 对象由于某个内部错误或 sessionPool 和 messageSelector 的无效参数无法创建连接使用方。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
Throws | InvalidSelectorException: 如果消息选择器无效。
since | 1.1
See also | javax.jms.ConnectionConsumer
英文文档：

createConnectionConsumer

ConnectionConsumer createConnectionConsumer(Destination destination,
                                            String messageSelector,
                                            ServerSessionPool sessionPool,
                                            int maxMessages)
                                            throws JMSException
Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.

Parameters:
destination - the destination to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
sessionPool - the server session pool to associate with this connection consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the connection consumer
Throws:
JMSException - if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector.
InvalidDestinationException - if an invalid destination is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1
See Also:
ConnectionConsumer

public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
创建此连接的持久连接使用方（可选操作）。这是一个专家级工具，常规 JMS 客户端不使用。
topic | 要访问的主题
subscriptionName | 持久订阅名称
messageSelector | 仅包括那些属性匹配所传送的消息选择器表达式的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
sessionPool | 关联此持久连接使用方的服务器会话池
maxMessages | 可以一次分配给服务器会话的最大消息数
return | 持久连接使用方
Throws | JMSException: 如果 Connection 对象由于某个内部错误或 sessionPool 和 messageSelector 的无效参数无法创建连接使用方。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
Throws | InvalidSelectorException: 如果消息选择器无效。
since | 1.1
See also | javax.jms.ConnectionConsumer
英文文档：

createDurableConnectionConsumer

ConnectionConsumer createDurableConnectionConsumer(Topic topic,
                                                   String subscriptionName,
                                                   String messageSelector,
                                                   ServerSessionPool sessionPool,
                                                   int maxMessages)
                                                   throws JMSException
Create a durable connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.

Parameters:
topic - topic to access
subscriptionName - durable subscription name
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
sessionPool - the server session pool to associate with this durable connection consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the durable connection consumer
Throws:
JMSException - if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector.
InvalidDestinationException - if an invalid destination is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1
See Also:
ConnectionConsumer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionConsumer (Java EE 5)

javax.jms
Interface ConnectionConsumer

public interface ConnectionConsumer

Connection 对象为应用服务器提供了一个特殊工具来创建 ConnectionConsumer（可选）。它要使用的消息通过 Destination 和消息选择器指定。此外，必须为 ConnectionConsumer 提供 ServerSessionPool，用于处理它的消息。

通常，当流量少时，ConnectionConsumer 从其池中获取一个 ServerSession，在其中加载一个消息，然后启动该会话。随着流量增多，消息可能会滞留。如果发生这种情况，ConnectionConsumer 可以在每个 ServerSession 中加载多个消息。这样减少了线程上下文切换并且最大限度地减少了资源使用，但代价是需要对消息处理进行一些序列化。

version
en
1.1 February 8, 2002
See also createConnectionConsumer, createDurableConnectionConsumer, createConnectionConsumer, createConnectionConsumer, createDurableConnectionConsumer
英文文档：

For application servers, Connection objects provide a special facility for creating a ConnectionConsumer (optional). The messages it is to consume are specified by a Destination and a message selector. In addition, a ConnectionConsumer must be given a ServerSessionPool to use for processing its messages.

Normally, when traffic is light, a ConnectionConsumer gets a ServerSession from its pool, loads it with a single message, and starts it. As traffic picks up, messages can back up. If this happens, a ConnectionConsumer can load each ServerSession with more than one message. This reduces the thread context switches and minimizes resource use at the expense of some serialization of message processing.

Version:
1.1 February 8, 2002
Author:
Mark Hapner, Rich Burridge
See Also:
Connection.createConnectionConsumer(javax.jms.Destination, java.lang.String, javax.jms.ServerSessionPool, int),
Connection.createDurableConnectionConsumer(javax.jms.Topic, java.lang.String, java.lang.String, javax.jms.ServerSessionPool, int),
QueueConnection.createConnectionConsumer(javax.jms.Queue, java.lang.String, javax.jms.ServerSessionPool, int),
TopicConnection.createConnectionConsumer(javax.jms.Topic, java.lang.String, javax.jms.ServerSessionPool, int),
TopicConnection.createDurableConnectionConsumer(javax.jms.Topic, java.lang.String, java.lang.String, javax.jms.ServerSessionPool, int)

Method Summary
void | close() Closes the connection consumer.
ServerSessionPool | getServerSessionPool() Gets the server session pool associated with this connection consumer.

Method Detail

public ServerSessionPool getServerSessionPool() throws JMSException
获取与此连接使用方关联的服务器会话池。
return | 此连接使用方使用的服务器会话池
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取与此使用方关联的服务器会话池。
英文文档：

getServerSessionPool

ServerSessionPool getServerSessionPool()
                                       throws JMSException
Gets the server session pool associated with this connection consumer.

Returns:
the server session pool used by this connection consumer
Throws:
JMSException - if the JMS provider fails to get the server session pool associated with this consumer due to some internal error.

public void close() throws JMSException
关闭连接使用方。

由于提供者可能会代表连接使用方分配 Java 虚拟机之外的某些资源，因此不需要这些资源时客户端应该关闭它们。依赖于垃圾收集最终回收这些资源可能不够及时。

Throws JMSException: 如果 JMS 提供者无法代表连接使用者释放资源，或者无法关闭连接使用方。
英文文档：

close

void close()
           throws JMSException
Closes the connection consumer.

Since a provider may allocate some resources on behalf of a connection consumer outside the Java virtual machine, clients should close these resources when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Throws:
JMSException - if the JMS provider fails to release resources on behalf of the connection consumer or fails to close the connection consumer.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionFactory (Java EE 5)

javax.jms
Interface ConnectionFactory

All Known Subinterfaces:
QueueConnectionFactory, TopicConnectionFactory, XAQueueConnectionFactory, XATopicConnectionFactory
public interface ConnectionFactory

Implemented by: QueueConnectionFactory, TopicConnectionFactory

ConnectionFactory 对象封装一组已由管理员定义的连接配置参数。客户端使用它创建与 JMS 提供者的连接。

ConnectionFactory 对象是 JMS 管理对象，并且支持并发使用。

JMS 管理对象是由管理员创建且随后供 JMS 客户端使用的包含配置信息的对象。它们使在企业中管理 JMS API 成为现实。

虽然管理对象的接口并不明确依赖于 Java Naming and Directory Interface (JNDI) API，但 JMS API 约定 JMS 客户端通过 JNDI 名称空间查找管理对象。

管理员可以将管理对象放在名称空间的任何地方。JMS API 不定义命名策略。

JMS 提供者应该提供管理员在 JNDI 名称空间中创建和配置管理对象所需的工具。管理对象的 JMS 提供者实现应该是 javax.jndi.Referenceable 和 java.io.Serializable，以便它们可以存储在所有 JNDI 命名上下文中。此外，建议这些实现遵循 JavaBeansTM 设计模式。

此战略有以下几点好处：

  • 它向 JMS 客户端隐藏了特定于提供者的细节。
  • 它将管理信息抽象到 Java 编程语言的对象（“Java 对象”）中，通过通用管理控制台可以容易地组织和管理这些对象。
  • 由于所有流行的命名服务都会有 JNDI 提供者，因此这意味着 JMS 提供者能够交付一个在任何地方都能运行的管理对象的实现。

管理对象不应占用任何远程资源。它的查询不应该使用远程资源，JNDI API 本身使用的那些资源除外。

客户端应该将管理对象视为本地 Java 对象。查询它们不应带来任何隐藏的副作用或使用大量的本地资源。

version
en
1.1 - February 1, 2002
See also javax.jms.Connection, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory
英文文档：

A ConnectionFactory object encapsulates a set of connection configuration parameters that has been defined by an administrator. A client uses it to create a connection with a JMS provider.

A ConnectionFactory object is a JMS administered object and supports concurrent use.

JMS administered objects are objects containing configuration information that are created by an administrator and later used by JMS clients. They make it practical to administer the JMS API in the enterprise.

Although the interfaces for administered objects do not explicitly depend on the Java Naming and Directory Interface (JNDI) API, the JMS API establishes the convention that JMS clients find administered objects by looking them up in a JNDI namespace.

An administrator can place an administered object anywhere in a namespace. The JMS API does not define a naming policy.

It is expected that JMS providers will provide the tools an administrator needs to create and configure administered objects in a JNDI namespace. JMS provider implementations of administered objects should be both javax.jndi.Referenceable and java.io.Serializable so that they can be stored in all JNDI naming contexts. In addition, it is recommended that these implementations follow the JavaBeansTM design patterns.

This strategy provides several benefits:

  • It hides provider-specific details from JMS clients.
  • It abstracts administrative information into objects in the Java programming language ("Java objects") that are easily organized and administered from a common management console.
  • Since there will be JNDI providers for all popular naming services, this means that JMS providers can deliver one implementation of administered objects that will run everywhere.

An administered object should not hold on to any remote resources. Its lookup should not use remote resources other than those used by the JNDI API itself.

Clients should think of administered objects as local Java objects. Looking them up should not have any hidden side effects or use surprising amounts of local resources.

Version:
1.1 - February 1, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Connection, QueueConnectionFactory, TopicConnectionFactory

Method Summary
Connection | createConnection() Creates a connection with the default user identity.
Connection | createConnection(String userName, String password) Creates a connection with the specified user identity.

Method Detail

public Connection createConnection() throws JMSException
创建带有默认用户身份的连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
return | 新建的连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
since | 1.1
英文文档：

createConnection

Connection createConnection()
                            throws JMSException
Creates a connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Returns:
a newly created connection
Throws:
JMSException - if the JMS provider fails to create the connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Since:
1.1

public Connection createConnection(String userName, String password) throws JMSException
创建带有指定用户身份的连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
userName | 调用者的用户名
password | 调用者的密码
return | 新建的连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
since | 1.1
英文文档：

createConnection

Connection createConnection(String userName,
                            String password)
                            throws JMSException
Creates a connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created connection
Throws:
JMSException - if the JMS provider fails to create the connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Since:
1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionMetaData (Java EE 5)

javax.jms
Interface ConnectionMetaData

public interface ConnectionMetaData

ConnectionMetaData 对象提供描述 Connection 对象的信息。
version
en
1.0 - 13 March 1998
英文文档：

A ConnectionMetaData object provides information describing the Connection object.

Version:
1.0 - 13 March 1998
Author:
Mark Hapner, Rich Burridge

Method Summary
int | getJMSMajorVersion() Gets the JMS major version number.
int | getJMSMinorVersion() Gets the JMS minor version number.
String | getJMSProviderName() Gets the JMS provider name.
String | getJMSVersion() Gets the JMS API version.
Enumeration | getJMSXPropertyNames() Gets an enumeration of the JMSX property names.
int | getProviderMajorVersion() Gets the JMS provider major version number.
int | getProviderMinorVersion() Gets the JMS provider minor version number.
String | getProviderVersion() Gets the JMS provider version.

Method Detail

public String getJMSVersion() throws JMSException
获取 JMS API 版本。
return | JMS API 版本
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getJMSVersion

String getJMSVersion()
                     throws JMSException
Gets the JMS API version.

Returns:
the JMS API version
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.

public int getJMSMajorVersion() throws JMSException
获取 JMS 主版本号。
return | JMS API 主版本号
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getJMSMajorVersion

int getJMSMajorVersion()
                       throws JMSException
Gets the JMS major version number.

Returns:
the JMS API major version number
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.

public int getJMSMinorVersion() throws JMSException
获取 JMS 次版本号。
return | JMS API 次版本号
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getJMSMinorVersion

int getJMSMinorVersion()
                       throws JMSException
Gets the JMS minor version number.

Returns:
the JMS API minor version number
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.

public String getJMSProviderName() throws JMSException
获取 JMS 提供者名称。
return | JMS 提供者名称
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getJMSProviderName

String getJMSProviderName()
                          throws JMSException
Gets the JMS provider name.

Returns:
the JMS provider name
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.

public String getProviderVersion() throws JMSException
获取 JMS 提供者版本。
return | JMS 提供者版本
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getProviderVersion

String getProviderVersion()
                          throws JMSException
Gets the JMS provider version.

Returns:
the JMS provider version
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.

public int getProviderMajorVersion() throws JMSException
获取 JMS 提供者主版本号。
return | JMS 提供者主版本号
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getProviderMajorVersion

int getProviderMajorVersion()
                            throws JMSException
Gets the JMS provider major version number.

Returns:
the JMS provider major version number
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.

public int getProviderMinorVersion() throws JMSException
获取 JMS 提供者次版本号。
return | JMS 提供者次版本号
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getProviderMinorVersion

int getProviderMinorVersion()
                            throws JMSException
Gets the JMS provider minor version number.

Returns:
the JMS provider minor version number
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.

public java.util.Enumeration<E> getJMSXPropertyNames() throws JMSException
获取 JMSX 属性名称的枚举。
return | JMSX 属性名称的枚举
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取元数据。
英文文档：

getJMSXPropertyNames

Enumeration getJMSXPropertyNames()
                                 throws JMSException
Gets an enumeration of the JMSX property names.

Returns:
an Enumeration of JMSX property names
Throws:
JMSException - if the JMS provider fails to retrieve the metadata due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeliveryMode (Java EE 5)

javax.jms
Interface DeliveryMode

public interface DeliveryMode

JMS API 支持的传送模式是 PERSISTENT 和 NON_PERSISTENT。

如果客户端感觉若该消息在传输中丢失，应用程序就会发生问题，它就将消息标记为持久。如果偶然丢失消息是可容忍的，则客户端将消息标记为非持久。客户端使用传送模式告知 JMS 提供者如何在消息传输可靠性和吞吐量之间保持平衡。

传送模式仅包含消息到其目的地的传输。PERSISTENT 传送模式不保证在确认消息接收者之前将消息保留在目的地。客户端应该假定已通过管理方式设置了消息保留策略。消息保留策略管理从目的地到消息使用方的消息传送的可靠性。例如，如果客户端的消息存储空间已耗尽，则依据特定于站点的消息保留策略，某些消息可能被丢弃。

如果消息的传送模式是 PERSISTENT 并且如果目的地有充分的消息保留策略，则可以保证消息由 JMS 提供者传送一次并且只传送一次。

version
en
1.0 - 7 August 1998
英文文档：

The delivery modes supported by the JMS API are PERSISTENT and NON_PERSISTENT.

A client marks a message as persistent if it feels that the application will have problems if the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability with throughput.

Delivery mode covers only the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client's message storage space is exhausted, some messages may be dropped in accordance with a site-specific message retention policy.

A message is guaranteed to be delivered once and only once by a JMS provider if the delivery mode of the message is PERSISTENT and if the destination has a sufficient message retention policy.

Version:
1.0 - 7 August 1998
Author:
Mark Hapner, Rich Burridge

Field Summary
static int | NON_PERSISTENT This is the lowest-overhead delivery mode because it does not require that the message be logged to stable storage.
static int | PERSISTENT This delivery mode instructs the JMS provider to log the message to stable storage as part of the client's send operation.

Field Detail

英文文档：

NON_PERSISTENT

static final int NON_PERSISTENT
This is the lowest-overhead delivery mode because it does not require that the message be logged to stable storage. The level of JMS provider failure that causes a NON_PERSISTENT message to be lost is not defined.

A JMS provider must deliver a NON_PERSISTENT message with an at-most-once guarantee. This means that it may lose the message, but it must not deliver it twice.

See Also:
Constant Field Values

英文文档：

PERSISTENT

static final int PERSISTENT
This delivery mode instructs the JMS provider to log the message to stable storage as part of the client's send operation. Only a hard media failure should cause a PERSISTENT message to be lost.

See Also:
Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Destination (Java EE 5)

javax.jms
Interface Destination

All Known Subinterfaces:
Queue, TemporaryQueue, TemporaryTopic, Topic
public interface Destination

Implemented by: Queue, Topic

Destination 对象封装特定于提供者的地址。JMS API 不定义标准地址语法。尽管曾考虑过标准地址语法，但最终决定现有面向消息中间件 (MOM) 产品之间的地址语义差异太大，难以通过单个语法来概括。

由于 Destination 是一个管理对象，因此除其地址之外，它可能还包含特定于提供者的配置信息。

JMS API 还支持客户端使用特定于提供者的地址名称。

Destination 对象支持并发使用。

Destination 对象是一个 JMS 管理对象。

JMS 管理对象是由管理员创建且随后供 JMS 客户端使用的包含配置信息的对象。它们使在企业中管理 JMS API 成为现实。

虽然管理对象的接口并不明确依赖于 Java Naming and Directory Interface (JNDI) API，但 JMS API 约定 JMS 客户端通过 JNDI 名称空间查找管理对象。

管理员可以将管理对象放在名称空间的任何地方。JMS API 不定义命名策略。

JMS 提供者应该提供管理员在 JNDI 名称空间中创建和配置管理对象所需的工具。管理对象的 JMS 提供者实现应该实现 javax.naming.Referenceable 和 java.io.Serializable 接口，以便它们可以存储在所有 JNDI 命名上下文中。此外，建议这些实现遵循 JavaBeansTM 设计模式。

此战略有以下几点好处：

  • 它向 JMS 客户端隐藏了特定于提供者的细节。
  • 它将 JMS 管理信息抽象到 Java 编程语言的对象（“Java 对象”）中，通过通用管理控制台可以容易地组织和管理这些对象。
  • 由于所有流行的命名服务都会有 JNDI 提供者，因此 JMS 提供者能够交付一个在任何地方都能运行的管理对象的实现。

管理对象不应占用任何远程资源。它的查询不应该使用远程资源，JNDI API 本身使用的那些资源除外。

客户端应该将管理对象视为本地 Java 对象。查询它们不应带来任何隐藏的副作用或使用大量的本地资源。

version
en
1.0 - 3 August 1998
See also javax.jms.Queue, javax.jms.Topic
英文文档：

A Destination object encapsulates a provider-specific address. The JMS API does not define a standard address syntax. Although a standard address syntax was considered, it was decided that the differences in address semantics between existing message-oriented middleware (MOM) products were too wide to bridge with a single syntax.

Since Destination is an administered object, it may contain provider-specific configuration information in addition to its address.

The JMS API also supports a client's use of provider-specific address names.

Destination objects support concurrent use.

A Destination object is a JMS administered object.

JMS administered objects are objects containing configuration information that are created by an administrator and later used by JMS clients. They make it practical to administer the JMS API in the enterprise.

Although the interfaces for administered objects do not explicitly depend on the Java Naming and Directory Interface (JNDI) API, the JMS API establishes the convention that JMS clients find administered objects by looking them up in a JNDI namespace.

An administrator can place an administered object anywhere in a namespace. The JMS API does not define a naming policy.

It is expected that JMS providers will provide the tools an administrator needs to create and configure administered objects in a JNDI namespace. JMS provider implementations of administered objects should implement the javax.naming.Referenceable and java.io.Serializable interfaces so that they can be stored in all JNDI naming contexts. In addition, it is recommended that these implementations follow the JavaBeansTM design patterns.

This strategy provides several benefits:

  • It hides provider-specific details from JMS clients.
  • It abstracts JMS administrative information into objects in the Java programming language ("Java objects") that are easily organized and administered from a common management console.
  • Since there will be JNDI providers for all popular naming services, JMS providers can deliver one implementation of administered objects that will run everywhere.

An administered object should not hold on to any remote resources. Its lookup should not use remote resources other than those used by the JNDI API itself.

Clients should think of administered objects as local Java objects. Looking them up should not have any hidden side effects or use surprising amounts of local resources.

Version:
1.0 - 3 August 1998
Author:
Mark Hapner, Rich Burridge
See Also:
Queue, Topic

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExceptionListener (Java EE 5)

javax.jms
Interface ExceptionListener

public interface ExceptionListener

如果 JMS 提供者检测到 Connection 对象存在严重问题，它会通知 Connection 对象的 ExceptionListener（如果已注册了一个异常侦听器）。这是通过调用侦听器的 onException 方法并将其传递到描述问题的 JMSException 参数来实现的。

异常侦听器允许客户端异步获得问题的通知。某些连接只使用消息，因此它们没有其他方式来了解其连接已失败。

JMS 提供者应该在通知客户端之前尝试自己解决连接问题。

version
en
1.0 - 9 March 1998
See also setExceptionListener(ExceptionListener)
英文文档：

If a JMS provider detects a serious problem with a Connection object, it informs the Connection object's ExceptionListener, if one has been registered. It does this by calling the listener's onException method, passing it a JMSException argument describing the problem.

An exception listener allows a client to be notified of a problem asynchronously. Some connections only consume messages, so they would have no other way to learn that their connection has failed.

A JMS provider should attempt to resolve connection problems itself before it notifies the client of them.

Version:
1.0 - 9 March 1998
Author:
Mark Hapner, Rich Burridge
See Also:
Connection.setExceptionListener(ExceptionListener)

Method Summary
 void onException(JMSException exception)
Notifies user of a JMS exception.

Method Detail

public void onException(JMSException exception)
向用户通知 JMS 异常。
exception JMS 异常
英文文档：

onException

void onException(JMSException exception)
Notifies user of a JMS exception.

Parameters:
exception - the JMS exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MapMessage (Java EE 5)

javax.jms
Interface MapMessage

All Superinterfaces:
Message
public interface MapMessage
extends Message

Implements: Message

MapMessage 对象用于发送一组名称-值对。名称是 String 对象，值是 Java 编程语言中的基本数据类型。名称必须有一个不为 null 的值，并且不能是空字符串。可以根据名称按顺序或随机访问这些条目。条目的顺序是不确定的。MapMessage 继承自 Message 接口并添加了包含 Map 的消息正文。

可以使用用于每种类型的方法显式读取或写入基本类型。它们通常也能作为对象读取或写入。例如，对 MapMessage.setInt("foo", 6) 的调用等效于 MapMessage.setObject("foo", new Integer(6))。这两种形式都提供，因为显式形式对于静态编程很方便，而编译期间类型未知时需要对象形式。

当客户端接收 MapMessage 时，它是只读模式。如果客户端尝试在此时写入消息，则抛出 MessageNotWriteableException。如果调用了 clearBody，现在便可以读取和写入消息。

MapMessage 对象支持下面的转换表。必须支持标记的情况。未标记的情况必须抛出 JMSException。如果基本类型的 valueOf() 方法不接受它作为有效的基本类型 String 表示形式，则 String 到基本类型的转换可能抛出运行时异常。

作为行类型写入的值可以作为列类型读取。

|        | boolean byte short char int long float double String byte[]
 |----------------------------------------------------------------------
|boolean |    X                                            X
|byte    |          X     X         X   X                  X
|short   |                X         X   X                  X
|char    |                     X                           X
|int     |                          X   X                  X
|long    |                              X                  X
|float   |                                    X     X      X
|double  |                                          X      X
|String  |    X     X     X         X   X     X     X      X
|byte[]  |                                                        X
 |----------------------------------------------------------------------

尝试将 null 值作为基本类型读取将视同于调用基本类型相应的具有 null 值的 valueOf(String) 转换方法。由于 char 不支持 String 转换，尝试将 null 值作为 char 读取必然抛出 NullPointerException。

version
en
1.1 February 2, 002
See also createMapMessage(), javax.jms.BytesMessage, javax.jms.Message, javax.jms.ObjectMessage, javax.jms.StreamMessage, javax.jms.TextMessage
英文文档：

A MapMessage object is used to send a set of name-value pairs. The names are String objects, and the values are primitive data types in the Java programming language. The names must have a value that is not null, and not an empty string. The entries can be accessed sequentially or randomly by name. The order of the entries is undefined. MapMessage inherits from the Message interface and adds a message body that contains a Map.

The primitive types can be read or written explicitly using methods for each type. They may also be read or written generically as objects. For instance, a call to MapMessage.setInt("foo", 6) is equivalent to MapMessage.setObject("foo", new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.

When a client receives a MapMessage, it is in read-only mode. If a client attempts to write to the message at this point, a MessageNotWriteableException is thrown. If clearBody is called, the message can now be both read from and written to.

MapMessage objects support the following conversion table. The marked cases must be supported. The unmarked cases must throw a JMSException. The String-to-primitive conversions may throw a runtime exception if the primitive's valueOf() method does not accept it as a valid String representation of the primitive.

A value written as the row type can be read as the column type.

 |        | boolean byte short char int long float double String byte[]
 |----------------------------------------------------------------------
 |boolean |    X                                            X
 |byte    |          X     X         X   X                  X
 |short   |                X         X   X                  X
 |char    |                     X                           X
 |int     |                          X   X                  X
 |long    |                              X                  X
 |float   |                                    X     X      X
 |double  |                                          X      X
 |String  |    X     X     X         X   X     X     X      X
 |byte[]  |                                                        X
 |----------------------------------------------------------------------

Attempting to read a null value as a primitive type must be treated as calling the primitive's corresponding valueOf(String) conversion method with a null value. Since char does not support a String conversion, attempting to read a null value as a char must throw a NullPointerException.

Version:
1.1 February 2, 002
Author:
Mark Hapner, Rich Burridge
See Also:
Session.createMapMessage(), BytesMessage, Message, ObjectMessage, StreamMessage, TextMessage

Field Summary
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
Method Summary
boolean | getBoolean(String name) Returns the boolean value with the specified name.
byte | getByte(String name) Returns the byte value with the specified name.
byte[] | getBytes(String name) Returns the byte array value with the specified name.
char | getChar(String name) Returns the Unicode character value with the specified name.
double | getDouble(String name) Returns the double value with the specified name.
float | getFloat(String name) Returns the float value with the specified name.
int | getInt(String name) Returns the int value with the specified name.
long | getLong(String name) Returns the long value with the specified name.
Enumeration | getMapNames() Returns an Enumeration of all the names in the MapMessage object.
Object | getObject(String name) Returns the value of the object with the specified name.
short | getShort(String name) Returns the short value with the specified name.
String | getString(String name) Returns the String value with the specified name.
boolean | itemExists(String name) Indicates whether an item exists in this MapMessage object.
void | setBoolean(String name, boolean value) Sets a boolean value with the specified name into the Map.
void | setByte(String name, byte value) Sets a byte value with the specified name into the Map.
void | setBytes(String name, byte[] value) Sets a byte array value with the specified name into the Map.
void | setBytes(String name, byte[] value, int offset, int length) Sets a portion of the byte array value with the specified name into the Map.
void | setChar(String name, char value) Sets a Unicode character value with the specified name into the Map.
void | setDouble(String name, double value) Sets a double value with the specified name into the Map.
void | setFloat(String name, float value) Sets a float value with the specified name into the Map.
void | setInt(String name, int value) Sets an int value with the specified name into the Map.
void | setLong(String name, long value) Sets a long value with the specified name into the Map.
void | setObject(String name, Object value) Sets an object value with the specified name into the Map.
void | setShort(String name, short value) Sets a short value with the specified name into the Map.
void | setString(String name, String value) Sets a String value with the specified name into the Map.
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty

Method Detail

public boolean getBoolean(String name) throws JMSException
返回带指定名称的 boolean 值。
name | boolean 的名称
return | 带指定名称的 boolean 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getBoolean

boolean getBoolean(String name)
                   throws JMSException
Returns the boolean value with the specified name.

Parameters:
name - the name of the boolean
Returns:
the boolean value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public byte getByte(String name) throws JMSException
返回带指定名称的 byte 值。
name | byte 的名称
return | 带指定名称的 byte 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getByte

byte getByte(String name)
             throws JMSException
Returns the byte value with the specified name.

Parameters:
name - the name of the byte
Returns:
the byte value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public short getShort(String name) throws JMSException
返回带指定名称的 short 值。
name | short 的名称
return | 带指定名称的 short 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getShort

short getShort(String name)
               throws JMSException
Returns the short value with the specified name.

Parameters:
name - the name of the short
Returns:
the short value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public char getChar(String name) throws JMSException
返回带指定名称的 Unicode 字符值。
name | Unicode 字符的名称
return | 带指定名称的 Unicode 字符值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getChar

char getChar(String name)
             throws JMSException
Returns the Unicode character value with the specified name.

Parameters:
name - the name of the Unicode character
Returns:
the Unicode character value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public int getInt(String name) throws JMSException
返回带指定名称的 int 值。
name | int 的名称
return | 带指定名称的 int 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getInt

int getInt(String name)
           throws JMSException
Returns the int value with the specified name.

Parameters:
name - the name of the int
Returns:
the int value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public long getLong(String name) throws JMSException
返回带指定名称的 long 值。
name | long 的名称
return | 带指定名称的 long 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getLong

long getLong(String name)
             throws JMSException
Returns the long value with the specified name.

Parameters:
name - the name of the long
Returns:
the long value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public float getFloat(String name) throws JMSException
返回带指定名称的 float 值。
name | float 的名称
return | 带指定名称的 float 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getFloat

float getFloat(String name)
               throws JMSException
Returns the float value with the specified name.

Parameters:
name - the name of the float
Returns:
the float value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public double getDouble(String name) throws JMSException
返回带指定名称的 double 值。
name | double 的名称
return | 带指定名称的 double 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getDouble

double getDouble(String name)
                 throws JMSException
Returns the double value with the specified name.

Parameters:
name - the name of the double
Returns:
the double value with the specified name
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public String getString(String name) throws JMSException
返回带指定名称的 String 值。
name | String 的名称
return | 带指定名称的 String 值；如果没有具有此名称的项，则返回 null 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getString

String getString(String name)
                 throws JMSException
Returns the String value with the specified name.

Parameters:
name - the name of the String
Returns:
the String value with the specified name; if there is no item by this name, a null value is returned
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public byte[] getBytes(String name) throws JMSException
返回带指定名称的 byte 数组值。
name | byte 数组的名称
return | 带指定名称的 byte 数组值的副本；如果没有具有此名称的项，则返回 null 值。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageFormatException: 如果此类型转换无效。
英文文档：

getBytes

byte[] getBytes(String name)
                throws JMSException
Returns the byte array value with the specified name.

Parameters:
name - the name of the byte array
Returns:
a copy of the byte array value with the specified name; if there is no item by this name, a null value is returned.
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageFormatException - if this type conversion is invalid.

public Object getObject(String name) throws JMSException
返回带指定名称的对象值。

可以使用此方法（以对象化格式）返回 Java 编程语言中的对象（“Java 对象”），该对象已使用对等的 setObject 方法调用或其对等的基本 settype 方法存储在 Map 中。

注意，byte 值以 byte[] 的形式返回，而不是 Byte[]。

name | Java 对象的名称
return | 带指定名称的 Java 对象值的副本，以对象化格式返回（例如，如果对象设置为 int，则返回 Integer）；如果没有具有此名称的项，则返回 null 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
英文文档：

getObject

Object getObject(String name)
                 throws JMSException
Returns the value of the object with the specified name.

This method can be used to return, in objectified format, an object in the Java programming language ("Java object") that had been stored in the Map with the equivalent setObject method call, or its equivalent primitive settype method.

Note that byte values are returned as byte[], not Byte[].

Parameters:
name - the name of the Java object
Returns:
a copy of the Java object value with the specified name, in objectified format (for example, if the object was set as an int, an Integer is returned); if there is no item by this name, a null value is returned
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.

public java.util.Enumeration<E> getMapNames() throws JMSException
返回 MapMessage 对象中所有名称的 Enumeration。
return | 此 MapMessage 中所有名称的枚举
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
英文文档：

getMapNames

Enumeration getMapNames()
                        throws JMSException
Returns an Enumeration of all the names in the MapMessage object.

Returns:
an enumeration of all the names in this MapMessage
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.

public void setBoolean(String name, boolean value) throws JMSException
将带指定名称的 boolean 值设置到 Map 中。
name | boolean 的名称
value | 要在 Map 中设置的 boolean 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setBoolean

void setBoolean(String name,
                boolean value)
                throws JMSException
Sets a boolean value with the specified name into the Map.

Parameters:
name - the name of the boolean
value - the boolean value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setByte(String name, byte value) throws JMSException
将带指定名称的 byte 值设置到 Map 中。
name | byte 的名称
value | 要在 Map 中设置的 byte 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setByte

void setByte(String name,
             byte value)
             throws JMSException
Sets a byte value with the specified name into the Map.

Parameters:
name - the name of the byte
value - the byte value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setShort(String name, short value) throws JMSException
将带指定名称的 short 值设置到 Map 中。
name | short 的名称
value | 要在 Map 中设置的 short 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setShort

void setShort(String name,
              short value)
              throws JMSException
Sets a short value with the specified name into the Map.

Parameters:
name - the name of the short
value - the short value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setChar(String name, char value) throws JMSException
将带指定名称的 Unicode 字符值设置到 Map 中。
name | Unicode 字符的名称
value | 要在 Map 中设置的 Unicode 字符值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setChar

void setChar(String name,
             char value)
             throws JMSException
Sets a Unicode character value with the specified name into the Map.

Parameters:
name - the name of the Unicode character
value - the Unicode character value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setInt(String name, int value) throws JMSException
将带指定名称的 int 值设置到 Map 中。
name | int 的名称
value | 要在 Map 中设置的 int 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setInt

void setInt(String name,
            int value)
            throws JMSException
Sets an int value with the specified name into the Map.

Parameters:
name - the name of the int
value - the int value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setLong(String name, long value) throws JMSException
将带指定名称的 long 值设置到 Map 中。
name | long 的名称
value | 要在 Map 中设置的 long 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setLong

void setLong(String name,
             long value)
             throws JMSException
Sets a long value with the specified name into the Map.

Parameters:
name - the name of the long
value - the long value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setFloat(String name, float value) throws JMSException
将带指定名称的 float 值设置到 Map 中。
name | float 的名称
value | 要在 Map 中设置的 float 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setFloat

void setFloat(String name,
              float value)
              throws JMSException
Sets a float value with the specified name into the Map.

Parameters:
name - the name of the float
value - the float value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setDouble(String name, double value) throws JMSException
将带指定名称的 double 值设置到 Map 中。
name | double 的名称
value | 要在 Map 中设置的 double 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setDouble

void setDouble(String name,
               double value)
               throws JMSException
Sets a double value with the specified name into the Map.

Parameters:
name - the name of the double
value - the double value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setString(String name, String value) throws JMSException
将带指定名称的 String 值设置到 Map 中。
name | String 的名称
value | 要在 Map 中设置的 String 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setString

void setString(String name,
               String value)
               throws JMSException
Sets a String value with the specified name into the Map.

Parameters:
name - the name of the String
value - the String value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setBytes(String name, byte[] value) throws JMSException
将带指定名称的 byte 数组值设置到 Map 中。
name | byte 数组的名称
value | 要在 Map 中设置的 byte 数组值；数组是复制的，因此，将不能通过以后修改来改变 name 的值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | NullPointerException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setBytes

void setBytes(String name,
              byte[] value)
              throws JMSException
Sets a byte array value with the specified name into the Map.

Parameters:
name - the name of the byte array
value - the byte array value to set in the Map; the array is copied so that the value for name will not be altered by future modifications
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
NullPointerException - if the name is null, or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setBytes(String name, byte[] value, int offset, int length) throws JMSException
将带指定名称的 byte 数组值的一部分设置到 Map 中。
name | byte 数组的名称
value | 要在 Map 中设置的 byte 数组值
offset | byte 数组中的初始偏移量
length | 要使用的字节数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setBytes

void setBytes(String name,
              byte[] value,
              int offset,
              int length)
              throws JMSException
Sets a portion of the byte array value with the specified name into the Map.

Parameters:
name - the name of the byte array
value - the byte array value to set in the Map
offset - the initial offset within the byte array
length - the number of bytes to use
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageNotWriteableException - if the message is in read-only mode.

public void setObject(String name, Object value) throws JMSException
将带指定名称的对象值设置到 Map 中。

此方法仅用于对象化的基本对象类型（Integer、Double、Long 等）、String 对象和 byte 数组。

name | Java 对象的名称
value | 要在 Map 中设置的 Java 对象值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
Throws | MessageFormatException: 如果对象无效。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setObject

void setObject(String name,
               Object value)
               throws JMSException
Sets an object value with the specified name into the Map.

This method works only for the objectified primitive object types (Integer, Double, Long ...), String objects, and byte arrays.

Parameters:
name - the name of the Java object
value - the Java object value to set in the Map
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
IllegalArgumentException - if the name is null or if the name is an empty string.
MessageFormatException - if the object is invalid.
MessageNotWriteableException - if the message is in read-only mode.

public boolean itemExists(String name) throws JMSException
指示此 MapMessage 对象中是否存在某个项。
name | 要测试的项的名称
return | 如果存在该项，则返回 true
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法确定是否存在该项。
英文文档：

itemExists

boolean itemExists(String name)
                   throws JMSException
Indicates whether an item exists in this MapMessage object.

Parameters:
name - the name of the item to test
Returns:
true if the item exists
Throws:
JMSException - if the JMS provider fails to determine if the item exists due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Message (Java EE 5)

javax.jms
Interface Message

All Known Subinterfaces:
BytesMessage, MapMessage, ObjectMessage, StreamMessage, TextMessage
public interface Message

Implemented by: BytesMessage, MapMessage, ObjectMessage, StreamMessage, TextMessage

Message 接口是所有 JMS 消息的根接口。它定义用于所有消息的消息头和 acknowledge 方法。

大多数面向消息中间件 (MOM) 产品将消息视为由头和负载组成的轻量级实体。头包含了用于消息路由和标识的字段；负载包含了要发送的应用程序数据。

在这种一般形式下，消息的定义在不同的产品之间变化很大。JMS API 将很难支持所有这些消息模型。

考虑到这一点，JMS 消息模型具有以下目的：

  • 提供单一、统一的消息 API
  • 提供的 API 应适合于创建匹配提供者-本机消息传递应用程序所用格式的消息
  • 支持开发跨操作系统、机器架构和计算机语言的异构应用程序
  • 支持包含 Java 编程语言对象（“Java 对象”）的消息
  • 支持包含可扩展标记语言 (Extensible Markup Language, XML) 页面的消息

JMS 消息由以下部分组成：

  • Header（头）- 所有消息都支持相同的头字段集合。头字段包含客户端和提供者用于标识和路由消息的值。
  • Property（属性）- 每个消息都包含一个内置工具，用于支持应用程序定义的属性值。属性为支持应用程序定义的消息过滤提供了一种有效的机制。
  • Body（正文）- JMS API 定义了几种消息正文类型，涵盖了当前使用的大多数消息传递样式。

消息正文

JMS API 定义了五种消息正文类型：

  • Stream（流）- StreamMessage 对象的消息正文包含 Java 编程语言原始值流（“Java 基本类型”）。按顺序填充和读取。
  • Map（映射）- MapMessage 对象的消息正文包含一组名称-值对，其中名称是 String 对象，值是 Java 基本类型。可以根据名称按顺序或随机访问这些条目。条目的顺序是不确定的。
  • Text（文本）- TextMessage 对象的消息正文包含 java.lang.String 对象。此消息类型可用于传输纯文本消息和 XML 消息。
  • Object（对象）- ObjectMessage 对象的消息正文包含 Serializable Java 对象。
  • Byte（字节）- BytesMessage 对象的消息正文包含未解释的字节流。此消息类型可以按字面意义编码正文，以匹配现有的消息格式。在大多数情况下，可以使用更易用的其他正文类型。尽管 JMS API 允许将消息属性用于字节消息，但一般不使用它们，因为包含属性可能会影响格式。

消息头

JMSCorrelationID 头字段用于连接一个消息与另一个消息。它通常连接应答消息与请求消息。

JMSCorrelationID 可以保存特定于提供者的消息 ID、特定于应用程序的 String 对象，或者提供者-本机 byte[] 值。

消息属性

Message 对象包含一个内置工具，用于支持应用程序定义的属性值。实际上，这提供了一种将特定于应用程序的头字段添加到消息的机制。

属性允许应用程序通过消息选择器让 JMS 提供者使用特定于应用程序的标准为自己选择或过滤消息。

属性名称必须遵守消息选择器标识符的规则。属性名称不得为 null 或空字符串。如果设置了属性名称，并且它为 null 或空字符串，则必定抛出 IllegalArgumentException。

属性值可以为 boolean、byte、short、int、long、float、double 和 String。

属性值在发送消息前设置。客户端收到消息时，其属性值是只读模式。如果客户端尝试在此时设置属性，则抛出 MessageNotWriteableException。调用了 clearProperties 后便可以读取和写入属性。注意，头字段与属性不同。头字段永远不会是只读模式。

属性值可以复制消息正文中的值，也可以不复制。尽管 JMS 没有定义属性行为策略，但应用程序开发人员应该注意，JMS 提供者处理消息正文中的数据可能比处理消息属性中的数据更高效。要获得最佳性能，应用程序应该仅在需要自定义消息头时才使用消息属性。这样做的主要原因是为了支持自定义消息选择。

消息属性支持以下转换表格。必须支持做了记号的那些情况。没有做记号的那些情况必须抛出 JMSException。如果基本类型的 valueOf 方法不接受 String 作为基本类型的有效表示形式，则 String 向基本类型的转换可能抛出运行时异常。

作为行类型写入的值可以作为列类型读取。

|        | boolean byte short int long float double String
 |----------------------------------------------------------
|boolean |    X                                       X
|byte    |          X     X    X   X                  X
|short   |                X    X   X                  X
|int     |                     X   X                  X
|long    |                         X                  X
|float   |                               X     X      X
|double  |                                     X      X
|String  |    X     X     X    X   X     X     X      X
 |----------------------------------------------------------

除了特定于类型的属性设置/获取方法外，JMS 还提供了 setObjectProperty 和 getObjectProperty 方法。这些方法都支持使用对象化原始值的同一属性类型集。这是为了能够在执行时（而不是编译时）确定属性类型。它们支持相同的属性值转换。

setObjectProperty 方法接受类 Boolean、Byte、Short、Integer、Long、Float、Double 和 String 的值。尝试使用任何其他类都会抛出 JMSException。

getObjectProperty 方法仅返回类 Boolean、Byte、Short、Integer、Long、Float、Double 和 String 的值。

属性值的顺序是不确定的。若要迭代消息的属性值，请使用 getPropertyNames 获取属性名称枚举，然后使用各种属性获取方法获取它们的值。

可使用 clearProperties 方法删除消息的属性。此方法将使消息的属性集为空。

获取未设置名称的属性值将返回 null 值。只有 getStringProperty 和 getObjectProperty 方法才会返回 null 值。尝试将 null 值作为基本类型读取将视同于调用基本类型相应的 valueOf(String) 转换方法，并以 null 值作为参数。

JMS API 为 JMS 定义的属性保留 JMSX 属性名称前缀。Java 消息服务规范中定义了完整的属性集合。新的 JMS 定义属性可能会添加到以后的 JMS API 版本中。对这些属性的支持是可选的。String[] ConnectionMetaData.getJMSXPropertyNames 方法返回连接支持的 JMSX 属性名称。

无论这些 JMSX 属性是否受连接支持，都可以在消息选择器中引用它们。如果消息中不存在这些属性，则处理它们的方式与任何其他不存在的属性相同。

在规范中定义为“在发送过程中由提供者设置”的 JMSX 属性对于消息生成方和使用方都适用。规范中定义为“在接收过程中由提供者设置”的 JMSX 属性只适用于使用方。

JMSXGroupID 和 JMSXGroupSeq 是客户端分组消息时应该使用的标准属性。所有提供者都必须支持它们。除非特别说明，否则 JMSX 属性的值和语义是未定义的。

JMS API 为特定于提供者的属性保留 JMS_vendor_name 属性名称前缀。每个提供者都定义其自己的 vendor_name 值。这是 JMS 提供者使每个JMS 客户端能够使用其特殊的消息服务 (per-message services) 所采用的机制。

特定于提供者的属性的用途是，提供在单个 JMS 应用程序中集成 JMS 客户端与提供者-本机客户端时所需的特殊功能。它们不能用于 JMS 客户端之间的消息传递。

JMS Message 接口的提供者实现

JMS API 提供定义 JMS 消息模型的消息接口集。它不提供这些接口的实现。

每个 JMS 提供者向消息工厂集提供其 Session 对象，用于创建消息实例。这允许提供者使用根据其特定需求定制的消息实现。

提供者必须准备好接受不属于自己的消息实现。可能无法像处理自己的实现一样有效处理它们，但是必须处理它们。

注意提供者在处理外部消息实现时出现的以下例外情况。如果外部消息实现包含设置为外部目的地实现的 JMSReplyTo 头字段，则提供者不需要处理或保留此头字段的值。

消息选择器

JMS 消息选择器允许客户端通过头字段引用和属性引用指定感兴趣的消息。只传送头和属性值匹配选择器的那些消息。这意味着消息是否被传送取决于使用的 MessageConsumer（请参阅 QueueReceiver 和 TopicSubscriber）。

消息选择器不能引用消息正文值。

消息的头字段值和属性值替换了消息选择器中对应的标识符后，如果选择器求值为 true，则消息选择器匹配该消息。

消息选择器是一个 String，其语法是以 SQL92 条件表达式语法子集为基础的。如果消息选择器的值是一个空字符串，则该值视为 null，表示没有任何消息选择器可供消息使用方使用。

消息选择器的求值顺序是按优先级从左到右计算。可以使用括号来更改此顺序。

预定义选择器的字面值和操作符名称在这里用大写表示；实际上它们是不区分大小写的。

选择器可以包含：

  • 字面值：
    • 字符串字面值使用单引号括起，单引号则用两个单引号表示；例如，'literal' 和 'literal''s'。这些字面值与 Java 编程语言中的字符串字面值一样，都使用 Unicode 字符编码。
    • 一个精确的数字字面值是一个不带小数点的数值，如 57、-957 和 +62；支持 long 型的数值范围。精确的数字字面值使用 Java 编程语言中的整数字面值语法。
    • 一个近似的数字字面值是使用科学计数法表示的数值，如 7E3 和 -57.9E2，或者是带小数点的数值，如 7.、-95.7 和 +6.2；支持 double 型的数值范围。近似的数字字面值使用 Java 编程语言中的浮点字面值语法。
    • 布尔字面值为 TRUE 或 FALSE。
  • 标识符：
    • 标识符是一个任意长度的字母数字序列，其首字符必须是字母。字母是对其调用 Character.isJavaLetter 方法可返回 true 的任何字符。这包括 '_' 和 '$'。字母或数字是对其调用 Character.isJavaLetterOrDigit 方法可返回 true 的任何字符。
    • 标识符不能使用名称 NULL、TRUE 和 FALSE。
    • 标识符不能是 NOT、AND、OR、BETWEEN、LIKE、IN、IS 或 ESCAPE。
    • 标识符是头字段引用或属性引用。消息选择器中属性值的类型对应于设置属性时使用的类型。如果引用了消息中不存在的属性，则其值为 NULL。
    • 当属性用于消息选择器表达式时，不可应用适用于属性获取方法的转换。例如，假设将属性设置为一个字符串值，如下所示：
      myMessage.setStringProperty("NumberOfOrders", "2");
      以下消息选择器中的表达式将求值为 false，因为字符串不能用于算术表达式：
      "NumberOfOrders > 1"
    • 标识符是区分大小写的。
    • 消息头字段引用限于 JMSDeliveryMode、JMSPriority、JMSMessageID、JMSTimestamp、JMSCorrelationID 和 JMSType。JMSMessageID、JMSCorrelationID 和 JMSType 值可以为 null，如果为 null，则按 NULL 值处理它们。
    • 以 'JMSX' 开头的任何名称是一个 JMS 定义的属性名称。
    • 以 'JMS_' 开头的任何名称是一个特定于提供者的属性名称。
    • 不以 'JMS' 开头的任何名称是一个特定于应用程序的属性名称。
  • 空白字符与 Java 编程语言中的定义相同：空格、水平制表符、换页符和行结束符。
  • 表达式：
    • 选择器是一个条件表达式；求值为 true，则选择器匹配；求值为 false 或“未知”，则选择器不匹配。
    • 算术表达式由其他算术表达式、算术运算、标识符（其值视为数字字面值处理）和数字字面值构成。
    • 条件表达式由其他条件表达式、比较运算和逻辑运算构成。
  • 支持使用标准括号 () 对表达式的求值顺序进行排序。
  • 按优先级从高到低排序的逻辑运算符：NOT、AND、OR
  • 比较运算符：=、>、>=、<、<=、<>（不等于）
    • 只能比较相同类型的值。有一种例外情况，即比较精确数字字面值和近似数字字面值是有效的；所需的类型转换由 Java 编程语言中的数值提升 (numeric promotion) 规则定义。如果尝试比较不同类型的值，运算的值为 false。如果两个类型值求值都为 NULL，则表达式的值未知。
    • 字符串和布尔值的比较只能使用 = 和 <>。当且仅当两个字符串具有相同字符序列时它们才相等。
  • 按优先级从高到低排序的算术运算符：
    • +、-（一元）
    • *、/（乘和除）
    • +、-（加和减）
    • 算术运算必须使用 Java 编程语言中的数值提升。
  • arithmetic-expr1 [NOT] BETWEEN arithmetic-expr2 AND arithmetic-expr3（比较运算符）
    • "age BETWEEN 15 AND 19" 等于 "age >= 15 AND age <= 19"
    • "age NOT BETWEEN 15 AND 19" 等于 "age < 15 OR age > 19"
  • identifier [NOT] IN (string-literal1, string-literal2,...)（比较运算符，其中 identifier 具有 String 或 NULL 值）
    • "Country IN (' UK', 'US', 'France')" 对于 'UK' 为 true，对于 'Peru' 为 false；它等效于表达式 "(Country = ' UK') OR (Country = ' US') OR (Country = ' France')"
    • "Country NOT IN (' UK', 'US', 'France')" 对于 'UK' 为 false，对于 'Peru' 为 true；它等效于表达式 "NOT ((Country = ' UK') OR (Country = ' US') OR (Country = ' France'))"
    • 如果 IN 或 NOT IN 运算的标识符为 NULL，则运算的值未知。
  • identifier [NOT] LIKE pattern-value [ESCAPE escape-character]（比较运算符，其中 identifier 具有 String 值。pattern-value 是一个字符串字面值，其中 '_' 表示任何单个字符，'%' 表示任何字符序列，包括空序列，所有其他字符都表示自身。可选的 escape-character 是一个单字符字符串字面值，其字符用于转义 pattern-value 中 '_' 和 '%' 的特殊含义。）
    • "phone LIKE '12%3'" 对于 '123' 或 '12993' 为 true，对于 '1234' 为 false。
    • "word LIKE 'l_se'" 对于 'lose' 为 true，对于 'loose' 为 false。
    • "underscored LIKE '\_%' ESCAPE '\'" 对于 '_foo' 为 true，对于 'bar' 为 false。
    • "phone NOT LIKE '12%3'" 对于 '123' 或 '12993' 为 false，对于 '1234' 为 true。
    • 如果 LIKE 或 NOT LIKE 运算的 identifier 为 NULL，则运算的值未知。
  • identifier IS NULL（比较运算符，测试 null 头字段值或缺失的属性值）
    • "prop_name IS NULL"
  • identifier IS NOT NULL（比较运算符，测试非 null 头字段值或属性值是否存在）
    • "prop_name IS NOT NULL"

    JMS 提供者必须在出现消息选择器时验证其语法的正确性。提供语法不正确的选择器的方法必定导致抛出 JMSException。JMS 提供者还可以在出现选择器时有选择地提供一些语义检查。并非所有语义检查都可以在出现消息选择器时执行，因为属性类型是未知的。

    以下消息选择器选择消息类型为 car、颜色为 blue、重量超过 2500 磅的消息：

    "JMSType = 'car' AND color = 'blue' AND weight > 2500"

    Null 值

    如上所述，属性值可以为 NULL。包含 NULL 值的选择器求值表达式由 SQL92 NULL 语法定义。下面简要描述这些语法。

    SQL 将 NULL 值视为“未知”。比较或计算一个未知值总是得出一个未知值。

    IS NULL 和 IS NOT NULL 运算符将一个未知值分别转换为 TRUE 和 FALSE 值。

    布尔运算符使用下表定义的三值逻辑：

    AND 运算符的定义

    | AND  |   T   |   F   |   U
 +------+-------+-------+-------
|  T   |   T   |   F   |   U
|  F   |   F   |   F   |   F
|  U   |   U   |   F   |   U
 +------+-------+-------+-------

    OR 运算符的定义

    | OR   |   T   |   F   |   U
 +------+-------+-------+--------
|  T   |   T   |   T   |   T
|  F   |   T   |   F   |   U
|  U   |   T   |   U   |   U
 +------+-------+-------+-------

    NOT 运算符的定义

    | NOT
 +------+------
|  T   |   F
|  F   |   T
|  U   |   U
 +------+-------

    特别注意

    在消息选择器中使用时，JMSDeliveryMode 头字段被视为具有值 'PERSISTENT' 和 'NON_PERSISTENT'。

    日期和时间值应使用标准 long 型毫秒值。消息选择器中包含日期和时间字面值时，它的毫秒值应该是整数字面值。生成毫秒值的标准方法是使用 java.util.Calendar。

    尽管 SQL 支持定点十进制的比较和算术运算，但 JMS 消息选择器不支持。所以要将精确数字字面值限制为没有小数点的数字字面值（将带小数点的数字作为近似数值的可选表示形式）。

    不支持 SQL 注释。

    version
    en
    1.1 April 2, 2002
    See also receive(), receive(long), receiveNoWait(), onMessage(Message), javax.jms.BytesMessage, javax.jms.MapMessage, javax.jms.ObjectMessage, javax.jms.StreamMessage, javax.jms.TextMessage
    英文文档：

    The Message interface is the root interface of all JMS messages. It defines the message header and the acknowledge method used for all messages.

    Most message-oriented middleware (MOM) products treat messages as lightweight entities that consist of a header and a payload. The header contains fields used for message routing and identification; the payload contains the application data being sent.

    Within this general form, the definition of a message varies significantly across products. It would be quite difficult for the JMS API to support all of these message models.

    With this in mind, the JMS message model has the following goals:

    • Provide a single, unified message API
    • Provide an API suitable for creating messages that match the format used by provider-native messaging applications
    • Support the development of heterogeneous applications that span operating systems, machine architectures, and computer languages
    • Support messages containing objects in the Java programming language ("Java objects")
    • Support messages containing Extensible Markup Language (XML) pages

    JMS messages are composed of the following parts:

    • Header - All messages support the same set of header fields. Header fields contain values used by both clients and providers to identify and route messages.
    • Properties - Each message contains a built-in facility for supporting application-defined property values. Properties provide an efficient mechanism for supporting application-defined message filtering.
    • Body - The JMS API defines several types of message body, which cover the majority of messaging styles currently in use.

    Message Bodies

    The JMS API defines five types of message body:

    • Stream - A StreamMessage object's message body contains a stream of primitive values in the Java programming language ("Java primitives"). It is filled and read sequentially.
    • Map - A MapMessage object's message body contains a set of name-value pairs, where names are String objects, and values are Java primitives. The entries can be accessed sequentially or randomly by name. The order of the entries is undefined.
    • Text - A TextMessage object's message body contains a java.lang.String object. This message type can be used to transport plain-text messages, and XML messages.
    • Object - An ObjectMessage object's message body contains a Serializable Java object.
    • Bytes - A BytesMessage object's message body contains a stream of uninterpreted bytes. This message type is for literally encoding a body to match an existing message format. In many cases, it is possible to use one of the other body types, which are easier to use. Although the JMS API allows the use of message properties with byte messages, they are typically not used, since the inclusion of properties may affect the format.

    Message Headers

    The JMSCorrelationID header field is used for linking one message with another. It typically links a reply message with its requesting message.

    JMSCorrelationID can hold a provider-specific message ID, an application-specific String object, or a provider-native byte[] value.

    Message Properties

    A Message object contains a built-in facility for supporting application-defined property values. In effect, this provides a mechanism for adding application-specific header fields to a message.

    Properties allow an application, via message selectors, to have a JMS provider select, or filter, messages on its behalf using application-specific criteria.

    Property names must obey the rules for a message selector identifier. Property names must not be null, and must not be empty strings. If a property name is set and it is either null or an empty string, an IllegalArgumentException must be thrown.

    Property values can be boolean, byte, short, int, long, float, double, and String.

    Property values are set prior to sending a message. When a client receives a message, its properties are in read-only mode. If a client attempts to set properties at this point, a MessageNotWriteableException is thrown. If clearProperties is called, the properties can now be both read from and written to. Note that header fields are distinct from properties. Header fields are never in read-only mode.

    A property value may duplicate a value in a message's body, or it may not. Although JMS does not define a policy for what should or should not be made a property, application developers should note that JMS providers will likely handle data in a message's body more efficiently than data in a message's properties. For best performance, applications should use message properties only when they need to customize a message's header. The primary reason for doing this is to support customized message selection.

    Message properties support the following conversion table. The marked cases must be supported. The unmarked cases must throw a JMSException. The String-to-primitive conversions may throw a runtime exception if the primitive's valueOf method does not accept the String as a valid representation of the primitive.

    A value written as the row type can be read as the column type.

     |        | boolean byte short int long float double String
 |----------------------------------------------------------
 |boolean |    X                                       X
 |byte    |          X     X    X   X                  X
 |short   |                X    X   X                  X
 |int     |                     X   X                  X
 |long    |                         X                  X
 |float   |                               X     X      X
 |double  |                                     X      X
 |String  |    X     X     X    X   X     X     X      X
 |----------------------------------------------------------

    In addition to the type-specific set/get methods for properties, JMS provides the setObjectProperty and getObjectProperty methods. These support the same set of property types using the objectified primitive values. Their purpose is to allow the decision of property type to made at execution time rather than at compile time. They support the same property value conversions.

    The setObjectProperty method accepts values of class Boolean, Byte, Short, Integer, Long, Float, Double, and String. An attempt to use any other class must throw a JMSException.

    The getObjectProperty method only returns values of class Boolean, Byte, Short, Integer, Long, Float, Double, and String.

    The order of property values is not defined. To iterate through a message's property values, use getPropertyNames to retrieve a property name enumeration and then use the various property get methods to retrieve their values.

    A message's properties are deleted by the clearProperties method. This leaves the message with an empty set of properties.

    Getting a property value for a name which has not been set returns a null value. Only the getStringProperty and getObjectProperty methods can return a null value. Attempting to read a null value as a primitive type must be treated as calling the primitive's corresponding valueOf(String) conversion method with a null value.

    The JMS API reserves the JMSX property name prefix for JMS defined properties. The full set of these properties is defined in the Java Message Service specification. New JMS defined properties may be added in later versions of the JMS API. Support for these properties is optional. The String[] ConnectionMetaData.getJMSXPropertyNames method returns the names of the JMSX properties supported by a connection.

    JMSX properties may be referenced in message selectors whether or not they are supported by a connection. If they are not present in a message, they are treated like any other absent property.

    JMSX properties defined in the specification as "set by provider on send" are available to both the producer and the consumers of the message. JMSX properties defined in the specification as "set by provider on receive" are available only to the consumers.

    JMSXGroupID and JMSXGroupSeq are standard properties that clients should use if they want to group messages. All providers must support them. Unless specifically noted, the values and semantics of the JMSX properties are undefined.

    The JMS API reserves the JMS_vendor_name property name prefix for provider-specific properties. Each provider defines its own value for vendor_name. This is the mechanism a JMS provider uses to make its special per-message services available to a JMS client.

    The purpose of provider-specific properties is to provide special features needed to integrate JMS clients with provider-native clients in a single JMS application. They should not be used for messaging between JMS clients.

    Provider Implementations of JMS Message Interfaces

    The JMS API provides a set of message interfaces that define the JMS message model. It does not provide implementations of these interfaces.

    Each JMS provider supplies a set of message factories with its Session object for creating instances of messages. This allows a provider to use message implementations tailored to its specific needs.

    A provider must be prepared to accept message implementations that are not its own. They may not be handled as efficiently as its own implementation; however, they must be handled.

    Note the following exception case when a provider is handling a foreign message implementation. If the foreign message implementation contains a JMSReplyTo header field that is set to a foreign destination implementation, the provider is not required to handle or preserve the value of this header field.

    Message Selectors

    A JMS message selector allows a client to specify, by header field references and property references, the messages it is interested in. Only messages whose header and property values match the selector are delivered. What it means for a message not to be delivered depends on the MessageConsumer being used (see QueueReceiver and TopicSubscriber).

    Message selectors cannot reference message body values.

    A message selector matches a message if the selector evaluates to true when the message's header field values and property values are substituted for their corresponding identifiers in the selector.

    A message selector is a String whose syntax is based on a subset of the SQL92 conditional expression syntax. If the value of a message selector is an empty string, the value is treated as a null and indicates that there is no message selector for the message consumer.

    The order of evaluation of a message selector is from left to right within precedence level. Parentheses can be used to change this order.

    Predefined selector literals and operator names are shown here in uppercase; however, they are case insensitive.

    A selector can contain:

    • Literals:
      • A string literal is enclosed in single quotes, with a single quote represented by doubled single quote; for example, 'literal' and 'literal''s'. Like string literals in the Java programming language, these use the Unicode character encoding.
      • An exact numeric literal is a numeric value without a decimal point, such as 57, -957, and +62; numbers in the range of long are supported. Exact numeric literals use the integer literal syntax of the Java programming language.
      • An approximate numeric literal is a numeric value in scientific notation, such as 7E3 and -57.9E2, or a numeric value with a decimal, such as 7., -95.7, and +6.2; numbers in the range of double are supported. Approximate literals use the floating-point literal syntax of the Java programming language.
      • The boolean literals TRUE and FALSE.
    • Identifiers:
      • An identifier is an unlimited-length sequence of letters and digits, the first of which must be a letter. A letter is any character for which the method Character.isJavaLetter returns true. This includes '_' and '$'. A letter or digit is any character for which the method Character.isJavaLetterOrDigit returns true.
      • Identifiers cannot be the names NULL, TRUE, and FALSE.
      • Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or ESCAPE.
      • Identifiers are either header field references or property references. The type of a property value in a message selector corresponds to the type used to set the property. If a property that does not exist in a message is referenced, its value is NULL.
      • The conversions that apply to the get methods for properties do not apply when a property is used in a message selector expression. For example, suppose you set a property as a string value, as in the following:
        myMessage.setStringProperty("NumberOfOrders", "2");
        The following expression in a message selector would evaluate to false, because a string cannot be used in an arithmetic expression:
        "NumberOfOrders > 1"
      • Identifiers are case-sensitive.
      • Message header field references are restricted to JMSDeliveryMode, JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and JMSType. JMSMessageID, JMSCorrelationID, and JMSType values may be null and if so are treated as a NULL value.
      • Any name beginning with 'JMSX' is a JMS defined property name.
      • Any name beginning with 'JMS_' is a provider-specific property name.
      • Any name that does not begin with 'JMS' is an application-specific property name.
    • White space is the same as that defined for the Java programming language: space, horizontal tab, form feed, and line terminator.
    • Expressions:
      • A selector is a conditional expression; a selector that evaluates to true matches; a selector that evaluates to false or unknown does not match.
      • Arithmetic expressions are composed of themselves, arithmetic operations, identifiers (whose value is treated as a numeric literal), and numeric literals.
      • Conditional expressions are composed of themselves, comparison operations, and logical operations.
    • Standard bracketing () for ordering expression evaluation is supported.
    • Logical operators in precedence order: NOT, AND, OR
    • Comparison operators: =, >, >=, <, <=, <> (not equal)
      • Only like type values can be compared. One exception is that it is valid to compare exact numeric values and approximate numeric values; the type conversion required is defined by the rules of numeric promotion in the Java programming language. If the comparison of non-like type values is attempted, the value of the operation is false. If either of the type values evaluates to NULL, the value of the expression is unknown.
      • String and boolean comparison is restricted to = and <>. Two strings are equal if and only if they contain the same sequence of characters.
    • Arithmetic operators in precedence order:
      • +, - (unary)
      • *, / (multiplication and division)
      • +, - (addition and subtraction)
      • Arithmetic operations must use numeric promotion in the Java programming language.
    • arithmetic-expr1 [NOT] BETWEEN arithmetic-expr2 AND arithmetic-expr3 (comparison operator)
      • "age BETWEEN 15 AND 19" is equivalent to "age >= 15 AND age <= 19"
      • "age NOT BETWEEN 15 AND 19" is equivalent to "age < 15 OR age > 19"
    • identifier [NOT] IN (string-literal1, string-literal2,...) (comparison operator where identifier has a String or NULL value)
      • "Country IN (' UK', 'US', 'France')" is true for 'UK' and false for 'Peru'; it is equivalent to the expression "(Country = ' UK') OR (Country = ' US') OR (Country = ' France')"
      • "Country NOT IN (' UK', 'US', 'France')" is false for 'UK' and true for 'Peru'; it is equivalent to the expression "NOT ((Country = ' UK') OR (Country = ' US') OR (Country = ' France'))"
      • If identifier of an IN or NOT IN operation is NULL, the value of the operation is unknown.
    • identifier [NOT] LIKE pattern-value [ESCAPE escape-character] (comparison operator, where identifier has a String value; pattern-value is a string literal where '_' stands for any single character; '%' stands for any sequence of characters, including the empty sequence; and all other characters stand for themselves. The optional escape-character is a single-character string literal whose character is used to escape the special meaning of the '_' and '%' in pattern-value.)
      • "phone LIKE '12%3'" is true for '123' or '12993' and false for '1234'
      • "word LIKE 'l_se'" is true for 'lose' and false for 'loose'
      • "underscored LIKE '\_%' ESCAPE '\'" is true for '_foo' and false for 'bar'
      • "phone NOT LIKE '12%3'" is false for '123' or '12993' and true for '1234'
      • If identifier of a LIKE or NOT LIKE operation is NULL, the value of the operation is unknown.
    • identifier IS NULL (comparison operator that tests for a null header field value or a missing property value)
      • "prop_name IS NULL"
    • identifier IS NOT NULL (comparison operator that tests for the existence of a non-null header field value or a property value)
      • "prop_name IS NOT NULL"

      JMS providers are required to verify the syntactic correctness of a message selector at the time it is presented. A method that provides a syntactically incorrect selector must result in a JMSException. JMS providers may also optionally provide some semantic checking at the time the selector is presented. Not all semantic checking can be performed at the time a message selector is presented, because property types are not known.

      The following message selector selects messages with a message type of car and color of blue and weight greater than 2500 pounds:

      "JMSType = 'car' AND color = 'blue' AND weight > 2500"

      Null Values

      As noted above, property values may be NULL. The evaluation of selector expressions containing NULL values is defined by SQL92 NULL semantics. A brief description of these semantics is provided here.

      SQL treats a NULL value as unknown. Comparison or arithmetic with an unknown value always yields an unknown value.

      The IS NULL and IS NOT NULL operators convert an unknown value into the respective TRUE and FALSE values.

      The boolean operators use three-valued logic as defined by the following tables:

      The definition of the AND operator

       | AND  |   T   |   F   |   U
 +------+-------+-------+-------
 |  T   |   T   |   F   |   U
 |  F   |   F   |   F   |   F
 |  U   |   U   |   F   |   U
 +------+-------+-------+-------

      The definition of the OR operator

       | OR   |   T   |   F   |   U
 +------+-------+-------+--------
 |  T   |   T   |   T   |   T
 |  F   |   T   |   F   |   U
 |  U   |   T   |   U   |   U
 +------+-------+-------+-------

      The definition of the NOT operator

       | NOT
 +------+------
 |  T   |   F
 |  F   |   T
 |  U   |   U
 +------+-------

      Special Notes

      When used in a message selector, the JMSDeliveryMode header field is treated as having the values 'PERSISTENT' and 'NON_PERSISTENT'.

      Date and time values should use the standard long millisecond value. When a date or time literal is included in a message selector, it should be an integer literal for a millisecond value. The standard way to produce millisecond values is to use java.util.Calendar.

      Although SQL supports fixed decimal comparison and arithmetic, JMS message selectors do not. This is the reason for restricting exact numeric literals to those without a decimal (and the addition of numerics with a decimal as an alternate representation for approximate numeric values).

      SQL comments are not supported.

      Version:
      1.1 April 2, 2002
      Author:
      Mark Hapner, Rich Burridge, Kate Stout
      See Also:
      MessageConsumer.receive(), MessageConsumer.receive(long), MessageConsumer.receiveNoWait(), MessageListener.onMessage(Message), BytesMessage, MapMessage, ObjectMessage, StreamMessage, TextMessage

      Field Summary
      static int DEFAULT_DELIVERY_MODE
      The message producer's default delivery mode is PERSISTENT.
      static int DEFAULT_PRIORITY
      The message producer's default priority is 4.
      static long DEFAULT_TIME_TO_LIVE
      The message producer's default time to live is unlimited; the message never expires.
      Method Summary
       void acknowledge()
      Acknowledges all consumed messages of the session of this consumed message.
       void clearBody()
      Clears out the message body.
       void clearProperties()
      Clears a message's properties.
       boolean getBooleanProperty(String name)
      Returns the value of the boolean property with the specified name.
       byte getByteProperty(String name)
      Returns the value of the byte property with the specified name.
       double getDoubleProperty(String name)
      Returns the value of the double property with the specified name.
       float getFloatProperty(String name)
      Returns the value of the float property with the specified name.
       int getIntProperty(String name)
      Returns the value of the int property with the specified name.
       String getJMSCorrelationID()
      Gets the correlation ID for the message.
       byte[] getJMSCorrelationIDAsBytes()
      Gets the correlation ID as an array of bytes for the message.
       int getJMSDeliveryMode()
      Gets the DeliveryMode value specified for this message.
       Destination getJMSDestination()
      Gets the Destination object for this message.
       long getJMSExpiration()
      Gets the message's expiration value.
       String getJMSMessageID()
      Gets the message ID.
       int getJMSPriority()
      Gets the message priority level.
       boolean getJMSRedelivered()
      Gets an indication of whether this message is being redelivered.
       Destination getJMSReplyTo()
      Gets the Destination object to which a reply to this message should be sent.
       long getJMSTimestamp()
      Gets the message timestamp.
       String getJMSType()
      Gets the message type identifier supplied by the client when the message was sent.
       long getLongProperty(String name)
      Returns the value of the long property with the specified name.
       Object getObjectProperty(String name)
      Returns the value of the Java object property with the specified name.
       Enumeration getPropertyNames()
      Returns an Enumeration of all the property names.
       short getShortProperty(String name)
      Returns the value of the short property with the specified name.
       String getStringProperty(String name)
      Returns the value of the String property with the specified name.
       boolean propertyExists(String name)
      Indicates whether a property value exists.
       void setBooleanProperty(String name, boolean value)
      Sets a boolean property value with the specified name into the message.
       void setByteProperty(String name, byte value)
      Sets a byte property value with the specified name into the message.
       void setDoubleProperty(String name, double value)
      Sets a double property value with the specified name into the message.
       void setFloatProperty(String name, float value)
      Sets a float property value with the specified name into the message.
       void setIntProperty(String name, int value)
      Sets an int property value with the specified name into the message.
       void setJMSCorrelationID(String correlationID)
      Sets the correlation ID for the message.
       void setJMSCorrelationIDAsBytes(byte[] correlationID)
      Sets the correlation ID as an array of bytes for the message.
       void setJMSDeliveryMode(int deliveryMode)
      Sets the DeliveryMode value for this message.
       void setJMSDestination(Destination destination)
      Sets the Destination object for this message.
       void setJMSExpiration(long expiration)
      Sets the message's expiration value.
       void setJMSMessageID(String id)
      Sets the message ID.
       void setJMSPriority(int priority)
      Sets the priority level for this message.
       void setJMSRedelivered(boolean redelivered)
      Specifies whether this message is being redelivered.
       void setJMSReplyTo(Destination replyTo)
      Sets the Destination object to which a reply to this message should be sent.
       void setJMSTimestamp(long timestamp)
      Sets the message timestamp.
       void setJMSType(String type)
      Sets the message type.
       void setLongProperty(String name, long value)
      Sets a long property value with the specified name into the message.
       void setObjectProperty(String name, Object value)
      Sets a Java object property value with the specified name into the message.
       void setShortProperty(String name, short value)
      Sets a short property value with the specified name into the message.
       void setStringProperty(String name, String value)
      Sets a String property value with the specified name into the message.

      Field Detail

      英文文档：

      DEFAULT_DELIVERY_MODE

      static final int DEFAULT_DELIVERY_MODE
      The message producer's default delivery mode is PERSISTENT.

      See Also:
      DeliveryMode.PERSISTENT, Constant Field Values

      英文文档：

      DEFAULT_PRIORITY

      static final int DEFAULT_PRIORITY
      The message producer's default priority is 4.

      See Also:
      Constant Field Values

      英文文档：

      DEFAULT_TIME_TO_LIVE

      static final long DEFAULT_TIME_TO_LIVE
      The message producer's default time to live is unlimited; the message never expires.

      See Also:
      Constant Field Values
      Method Detail

      public String getJMSMessageID() throws JMSException
      获取消息 ID。

      JMSMessageID 头字段包含唯一标识提供者所发送的每个消息的值。

      发送消息时，可以忽略 JMSMessageID。send 或 publish 方法返回时，它包含一个提供者分配的值。

      JMSMessageID 是一个 String 值，应该用作历史存储库中标识消息的唯一键。唯一性的确切范围是提供者定义的。它至少应该涵盖用于提供者特定安装的所有消息，其中安装是一些连接的消息路由器集合。

      所有 JMSMessageID 值必须以前缀 'ID:' 开头。不同提供者之间不需要保证消息 ID 值的唯一性。

      由于消息 ID 会创建并增加消息的大小，因此，如果能获得应用程序无需使用消息 ID 的提示，那么一些 JMS 提供者可以优化消息开销。通过调用 MessageProducer.setDisableMessageID 方法，JMS 客户端对该消息生成方发送的所有消息实现了这一潜在的优化。如果 JMS 提供者接受此提示，则这些消息必须将消息 ID 设置为 null；如果提供者忽略该提示，则消息 ID 必须设置为唯一的普通值。

      return | 消息 ID
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取消息 ID。
      See also | setJMSMessageID(String), setDisableMessageID(boolean)
      英文文档：

      getJMSMessageID

      String getJMSMessageID()
                       throws JMSException
      Gets the message ID.

      The JMSMessageID header field contains a value that uniquely identifies each message sent by a provider.

      When a message is sent, JMSMessageID can be ignored. When the send or publish method returns, it contains a provider-assigned value.

      A JMSMessageID is a String value that should function as a unique key for identifying messages in a historical repository. The exact scope of uniqueness is provider-defined. It should at least cover all messages for a specific installation of a provider, where an installation is some connected set of message routers.

      All JMSMessageID values must start with the prefix 'ID:'. Uniqueness of message ID values across different providers is not required.

      Since message IDs take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that the message ID is not used by an application. By calling the MessageProducer.setDisableMessageID method, a JMS client enables this potential optimization for all messages sent by that message producer. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.

      Returns:
      the message ID
      Throws:
      JMSException - if the JMS provider fails to get the message ID due to some internal error.
      See Also:
      setJMSMessageID(String), MessageProducer.setDisableMessageID(boolean)

      public void setJMSMessageID(String id) throws JMSException
      设置消息 ID。

      JMS 提供者在发送消息时设置此字段。此方法可以用来更改收到的消息的值。

      id | 消息的 ID
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置消息 ID。
      See also | getJMSMessageID()
      英文文档：

      setJMSMessageID

      void setJMSMessageID(String id)
                     throws JMSException
      Sets the message ID.

      JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

      Parameters:
      id - the ID of the message
      Throws:
      JMSException - if the JMS provider fails to set the message ID due to some internal error.
      See Also:
      getJMSMessageID()

      public long getJMSTimestamp() throws JMSException
      获取消息时间戳。

      JMSTimestamp 头字段包含消息交给提供者发送的时间。它不是实际传输消息的时间，因为由于事务或其他客户端消息排队等原因，实际发送可能延后。

      发送消息时，忽略 JMSTimestamp。当 send 或 publish 方法返回时，它包含的时间值介于调用和返回的时间之间。该值采用 Java 编程语言中普通的毫秒时间值格式。

      由于时间戳会创建并增加消息的大小，因此，如果能获得应用程序无需使用时间戳的提示，那么一些 JMS 提供者可以优化消息开销。通过调用 MessageProducer.setDisableMessageTimestamp 方法，JMS 客户端对该消息生成方发送的所有消息实现了这一潜在的优化。如果 JMS 提供者接受此提示，这些消息必须将时间戳设置为 0；如果提供者忽略该提示，则时间戳必须设置为普通值。

      return | 消息时间戳
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取时间戳。
      See also | setJMSTimestamp(long), setDisableMessageTimestamp(boolean)
      英文文档：

      getJMSTimestamp

      long getJMSTimestamp()
                     throws JMSException
      Gets the message timestamp.

      The JMSTimestamp header field contains the time a message was handed off to a provider to be sent. It is not the time the message was actually transmitted, because the actual send may occur later due to transactions or other client-side queueing of messages.

      When a message is sent, JMSTimestamp is ignored. When the send or publish method returns, it contains a time value somewhere in the interval between the call and the return. The value is in the format of a normal millis time value in the Java programming language.

      Since timestamps take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that the timestamp is not used by an application. By calling the MessageProducer.setDisableMessageTimestamp method, a JMS client enables this potential optimization for all messages sent by that message producer. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint, the timestamp must be set to its normal value.

      Returns:
      the message timestamp
      Throws:
      JMSException - if the JMS provider fails to get the timestamp due to some internal error.
      See Also:
      setJMSTimestamp(long), MessageProducer.setDisableMessageTimestamp(boolean)

      public void setJMSTimestamp(long timestamp) throws JMSException
      设置消息时间戳。

      JMS 提供者在发送消息时设置此字段。此方法可以用来更改收到的消息的值。

      timestamp | 此消息的时间戳
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置时间戳。
      See also | getJMSTimestamp()
      英文文档：

      setJMSTimestamp

      void setJMSTimestamp(long timestamp)
                     throws JMSException
      Sets the message timestamp.

      JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

      Parameters:
      timestamp - the timestamp for this message
      Throws:
      JMSException - if the JMS provider fails to set the timestamp due to some internal error.
      See Also:
      getJMSTimestamp()

      public byte[] getJMSCorrelationIDAsBytes() throws JMSException
      以 byte 数组的形式获取消息的关联 ID。

      对 JMSCorrelationID 使用 byte[] 值是不可移植的。

      return | byte 数组形式的消息关联 ID
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取关联 ID。
      See also | setJMSCorrelationID(String), getJMSCorrelationID(), setJMSCorrelationIDAsBytes(byte[])
      英文文档：

      getJMSCorrelationIDAsBytes

      byte[] getJMSCorrelationIDAsBytes()
                                  throws JMSException
      Gets the correlation ID as an array of bytes for the message.

      The use of a byte[] value for JMSCorrelationID is non-portable.

      Returns:
      the correlation ID of a message as an array of bytes
      Throws:
      JMSException - if the JMS provider fails to get the correlation ID due to some internal error.
      See Also:
      setJMSCorrelationID(String), getJMSCorrelationID(), setJMSCorrelationIDAsBytes(byte[])

      public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException
      以 byte 数组的形式设置消息的关联 ID。

      在方法返回之前复制数组，因此以后修改数组将不会改变此消息头。

      如果提供者支持本机关联 ID，JMS 客户端可能需要分配特定的 JMSCorrelationID 值，以匹配本机消息传递客户端所期望的关联 ID。没有本机关联 ID 的 JMS 提供者不必支持此方法及其相应的获取方法；其实现可能抛出 java.lang.UnsupportedOperationException。

      对 JMSCorrelationID 使用 byte[] 值是不可移植的。

      correlationID | byte 数组形式的关联 ID
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置关联 ID。
      See also | setJMSCorrelationID(String), getJMSCorrelationID(), getJMSCorrelationIDAsBytes()
      英文文档：

      setJMSCorrelationIDAsBytes

      void setJMSCorrelationIDAsBytes(byte[] correlationID)
                                throws JMSException
      Sets the correlation ID as an array of bytes for the message.

      The array is copied before the method returns, so future modifications to the array will not alter this message header.

      If a provider supports the native concept of correlation ID, a JMS client may need to assign specific JMSCorrelationID values to match those expected by native messaging clients. JMS providers without native correlation ID values are not required to support this method and its corresponding get method; their implementation may throw a java.lang.UnsupportedOperationException.

      The use of a byte[] value for JMSCorrelationID is non-portable.

      Parameters:
      correlationID - the correlation ID value as an array of bytes
      Throws:
      JMSException - if the JMS provider fails to set the correlation ID due to some internal error.
      See Also:
      setJMSCorrelationID(String), getJMSCorrelationID(), getJMSCorrelationIDAsBytes()

      public void setJMSCorrelationID(String correlationID) throws JMSException
      设置消息的关联 ID。

      客户端可以使用 JMSCorrelationID 头字段连接一个消息与另一个消息。一种典型用法是连接响应消息与其请求消息。

      JMSCorrelationID 可以保存以下值之一：

      • 特定于提供者的消息 ID
      • 特定于应用程序的 String
      • 提供者-本机 byte[] 值

      由于 JMS 提供者发送的每个消息都分配了一个消息 ID 值，因此可以很方便地通过消息 ID 连接消息。所有消息 ID 值必须以 'ID:' 前缀开头。

      在某些情况下，应用程序（由几个客户端组成）需要使用特定于应用程序的值来连接消息。例如，应用程序可以使用 JMSCorrelationID 来保存引用某些外部信息的值。特定于应用程序的值不得以 'ID:' 前缀开头；这是为提供者生成的消息 ID 值而保留的。

      如果提供者支持本机关联 ID，JMS 客户端可能需要分配特定的 JMSCorrelationID 值，以匹配不使用 JMS API 的客户端所期望的关联 ID。byte[] 值可用于此目的。没有本机关联 ID 值的 JMS 提供者不必支持 byte[] 值。对 JMSCorrelationID 使用 byte[] 值是不可移植的。

      correlationID | 所引用消息的消息 ID
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置关联 ID。
      See also | getJMSCorrelationID(), getJMSCorrelationIDAsBytes(), setJMSCorrelationIDAsBytes(byte[])
      英文文档：

      setJMSCorrelationID

      void setJMSCorrelationID(String correlationID)
                         throws JMSException
      Sets the correlation ID for the message.

      A client can use the JMSCorrelationID header field to link one message with another. A typical use is to link a response message with its request message.

      JMSCorrelationID can hold one of the following:

      • A provider-specific message ID
      • An application-specific String
      • A provider-native byte[] value

      Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID. All message ID values must start with the 'ID:' prefix.

      In some cases, an application (made up of several clients) needs to use an application-specific value for linking messages. For instance, an application may use JMSCorrelationID to hold a value referencing some external information. Application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values.

      If a provider supports the native concept of correlation ID, a JMS client may need to assign specific JMSCorrelationID values to match those expected by clients that do not use the JMS API. A byte[] value is used for this purpose. JMS providers without native correlation ID values are not required to support byte[] values. The use of a byte[] value for JMSCorrelationID is non-portable.

      Parameters:
      correlationID - the message ID of a message being referred to
      Throws:
      JMSException - if the JMS provider fails to set the correlation ID due to some internal error.
      See Also:
      getJMSCorrelationID(),
getJMSCorrelationIDAsBytes(),
setJMSCorrelationIDAsBytes(byte[])

      public String getJMSCorrelationID() throws JMSException
      获取消息的关联 ID。

      此方法用于返回属于特定于提供者的消息 ID 或特定于应用程序的 String 值的关联 ID 值。

      return | String 形式的消息关联 ID
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取关联 ID。
      See also | setJMSCorrelationID(String), getJMSCorrelationIDAsBytes(), setJMSCorrelationIDAsBytes(byte[])
      英文文档：

      getJMSCorrelationID

      String getJMSCorrelationID()
                           throws JMSException
      Gets the correlation ID for the message.

      This method is used to return correlation ID values that are either provider-specific message IDs or application-specific String values.

      Returns:
      the correlation ID of a message as a String
      Throws:
      JMSException - if the JMS provider fails to get the correlation ID due to some internal error.
      See Also:
      setJMSCorrelationID(String), getJMSCorrelationIDAsBytes(), setJMSCorrelationIDAsBytes(byte[])

      public Destination getJMSReplyTo() throws JMSException
      获取 Destination 对象，应向该对象发送对此消息的应答。
      return | Destination，将向其发送对此消息的响应
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取 JMSReplyTo 目的地。
      See also | setJMSReplyTo(Destination)
      英文文档：

      getJMSReplyTo

      Destination getJMSReplyTo()
                          throws JMSException
      Gets the Destination object to which a reply to this message should be sent.

      Returns:
      Destination to which to send a response to this message
      Throws:
      JMSException - if the JMS provider fails to get the JMSReplyTo destination due to some internal error.
      See Also:
      setJMSReplyTo(Destination)

      public void setJMSReplyTo(Destination replyTo) throws JMSException
      设置 Destination 对象，应向该对象发送对此消息的应答。

      JMSReplyTo 头字段包含对当前消息的应答应发送到的目的地。如果它为 null，则不希望应答。目的地可以是 Queue 对象或 Topic 对象。

      发送时附带 null JMSReplyTo 值的消息可能是某些事件的通知，也可能只是一些发送方认为有意义的数据。

      带 JMSReplyTo 值的消息通常希望获得响应。如果响应是可选的，则由客户端决定是否响应。这些消息称为请求。响应请求的消息称为应答。

      在某些情况下，客户端可能希望刚刚收到的应答与之前发送的请求匹配。为此，客户端可以使用 JMSCorrelationID 头字段。

      replyTo | Destination，将向其发送对此消息的响应
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置 JMSReplyTo 目的地。
      See also | getJMSReplyTo()
      英文文档：

      setJMSReplyTo

      void setJMSReplyTo(Destination replyTo)
                   throws JMSException
      Sets the Destination object to which a reply to this message should be sent.

      The JMSReplyTo header field contains the destination where a reply to the current message should be sent. If it is null, no reply is expected. The destination may be either a Queue object or a Topic object.

      Messages sent with a null JMSReplyTo value may be a notification of some event, or they may just be some data the sender thinks is of interest.

      Messages with a JMSReplyTo value typically expect a response. A response is optional; it is up to the client to decide. These messages are called requests. A message sent in response to a request is called a reply.

      In some cases a client may wish to match a request it sent earlier with a reply it has just received. The client can use the JMSCorrelationID header field for this purpose.

      Parameters:
      replyTo - Destination to which to send a response to this message
      Throws:
      JMSException - if the JMS provider fails to set the JMSReplyTo destination due to some internal error.
      See Also:
      getJMSReplyTo()

      public Destination getJMSDestination() throws JMSException
      获取此消息的 Destination 对象。

      JMSDestination 头字段包含消息将要发送到的目的地。

      发送消息时，忽略此字段。在完成 send 或 publish 方法后，该字段将保存方法指定的目的地。

      接收消息时，其 JMSDestination 值必须与发送消息时分配的值相等。

      return | 此消息的目的地
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取目的地。
      See also | setJMSDestination(Destination)
      英文文档：

      getJMSDestination

      Destination getJMSDestination()
                              throws JMSException
      Gets the Destination object for this message.

      The JMSDestination header field contains the destination to which the message is being sent.

      When a message is sent, this field is ignored. After completion of the send or publish method, the field holds the destination specified by the method.

      When a message is received, its JMSDestination value must be equivalent to the value assigned when it was sent.

      Returns:
      the destination of this message
      Throws:
      JMSException - if the JMS provider fails to get the destination due to some internal error.
      See Also:
      setJMSDestination(Destination)

      public void setJMSDestination(Destination destination) throws JMSException
      设置此消息的 Destination 对象。

      JMS 提供者在发送消息时设置此字段。此方法可以用来更改收到的消息的值。

      destination | 此消息的目的地
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置目的地。
      See also | getJMSDestination()
      英文文档：

      setJMSDestination

      void setJMSDestination(Destination destination)
                       throws JMSException
      Sets the Destination object for this message.

      JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

      Parameters:
      destination - the destination for this message
      Throws:
      JMSException - if the JMS provider fails to set the destination due to some internal error.
      See Also:
      getJMSDestination()

      public int getJMSDeliveryMode() throws JMSException
      获取为此消息指定的 DeliveryMode 值。
      return | 此消息的传送模式
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取传送模式。
      See also | setJMSDeliveryMode(int), javax.jms.DeliveryMode
      英文文档：

      getJMSDeliveryMode

      int getJMSDeliveryMode()
                       throws JMSException
      Gets the DeliveryMode value specified for this message.

      Returns:
      the delivery mode for this message
      Throws:
      JMSException - if the JMS provider fails to get the delivery mode due to some internal error.
      See Also:
      setJMSDeliveryMode(int), DeliveryMode

      public void setJMSDeliveryMode(int deliveryMode) throws JMSException
      设置此消息的 DeliveryMode 值。

      JMS 提供者在发送消息时设置此字段。此方法可以用来更改收到的消息的值。

      deliveryMode | 此消息的传送模式
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置传送模式。
      See also | getJMSDeliveryMode(), javax.jms.DeliveryMode
      英文文档：

      setJMSDeliveryMode

      void setJMSDeliveryMode(int deliveryMode)
                        throws JMSException
      Sets the DeliveryMode value for this message.

      JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

      Parameters:
      deliveryMode - the delivery mode for this message
      Throws:
      JMSException - if the JMS provider fails to set the delivery mode due to some internal error.
      See Also:
      getJMSDeliveryMode(), DeliveryMode

      public boolean getJMSRedelivered() throws JMSException
      获取是否重新传送此消息的指示。

      如果客户端收到设置了 JMSRedelivered 字段的消息，则有可能（但不保证）之前发送此消息时没有得到接收方的确认。

      return | 如果要重新传送此消息，则返回 true
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取重新传送状态。
      See also | setJMSRedelivered(boolean)
      英文文档：

      getJMSRedelivered

      boolean getJMSRedelivered()
                          throws JMSException
      Gets an indication of whether this message is being redelivered.

      If a client receives a message with the JMSRedelivered field set, it is likely, but not guaranteed, that this message was delivered earlier but that its receipt was not acknowledged at that time.

      Returns:
      true if this message is being redelivered
      Throws:
      JMSException - if the JMS provider fails to get the redelivered state due to some internal error.
      See Also:
      setJMSRedelivered(boolean)

      public void setJMSRedelivered(boolean redelivered) throws JMSException
      指定是否重新传送此消息。

      此字段在传送消息时设置。此方法可以用来更改收到的消息的值。

      redelivered | 是否重新传送此消息的指示
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置重新传送状态。
      See also | getJMSRedelivered()
      英文文档：

      setJMSRedelivered

      void setJMSRedelivered(boolean redelivered)
                       throws JMSException
      Specifies whether this message is being redelivered.

      This field is set at the time the message is delivered. This method can be used to change the value for a message that has been received.

      Parameters:
      redelivered - an indication of whether this message is being redelivered
      Throws:
      JMSException - if the JMS provider fails to set the redelivered state due to some internal error.
      See Also:
      getJMSRedelivered()

      public String getJMSType() throws JMSException
      获取发送消息时客户端提供的消息类型标识符。
      return | 消息类型
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取消息类型。
      See also | setJMSType(String)
      英文文档：

      getJMSType

      String getJMSType()
                  throws JMSException
      Gets the message type identifier supplied by the client when the message was sent.

      Returns:
      the message type
      Throws:
      JMSException - if the JMS provider fails to get the message type due to some internal error.
      See Also:
      setJMSType(String)

      public void setJMSType(String type) throws JMSException
      设置消息类型。

      某些 JMS 提供者使用包含应用程序所发送消息的定义的消息存储库。JMSType 头字段可以引用提供者存储库中的消息定义。

      JMS API 不定义标准消息定义存储库，也不定义所含定义的命名策略。

      某些消息传递系统要求创建每个应用程序消息的消息类型定义，并要求每个消息指定其类型。为了使用此类 JMS 提供者，JMS 客户端应给 JMSType 分配一个值，无论应用程序是否使用它。这确保为需要它的那些提供者正确地设置了字段。

      为确保可移植性，JMS 客户端应使用 JMSType 的符号值，该值在安装期间可以配置为当前提供者消息存储库中定义的值。如果使用字符串字面值，则它们对于某些 JMS 提供者可能不是有效的类型名。

      type | 消息类型
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置消息类型。
      See also | getJMSType()
      英文文档：

      setJMSType

      void setJMSType(String type)
                throws JMSException
      Sets the message type.

      Some JMS providers use a message repository that contains the definitions of messages sent by applications. The JMSType header field may reference a message's definition in the provider's repository.

      The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains.

      Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to JMSType, whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it.

      To ensure portability, JMS clients should use symbolic values for JMSType that can be configured at installation time to the values defined in the current provider's message repository. If string literals are used, they may not be valid type names for some JMS providers.

      Parameters:
      type - the message type
      Throws:
      JMSException - if the JMS provider fails to set the message type due to some internal error.
      See Also:
      getJMSType()

      public long getJMSExpiration() throws JMSException
      获取消息的到期时间。

      发送消息时，不分配 JMSExpiration 头字段。在完成 send 或 publish 方法后，它保存消息的到期时间。这是客户端指定的生存时间值和调用 send 或 publish 时的 GMT 之和。

      如果生存时间指定为 0，则将 JMSExpiration 设置为 0 以指示消息不过期。

      到达消息的到期时间时，提供者应丢弃该消息。JMS API 不定义任何形式的消息到期通知。

      客户端不应接收已到期的消息；但是，JMS API 不保证一定不会发生这种情况。

      return | 消息到期的时间，它是客户端指定的生存时间值和发送时的 GMT 之和
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取消息到期时间。
      See also | setJMSExpiration(long)
      英文文档：

      getJMSExpiration

      long getJMSExpiration()
                      throws JMSException
      Gets the message's expiration value.

      When a message is sent, the JMSExpiration header field is left unassigned. After completion of the send or publish method, it holds the expiration time of the message. This is the sum of the time-to-live value specified by the client and the GMT at the time of the send or publish.

      If the time-to-live is specified as zero, JMSExpiration is set to zero to indicate that the message does not expire.

      When a message's expiration time is reached, a provider should discard it. The JMS API does not define any form of notification of message expiration.

      Clients should not receive messages that have expired; however, the JMS API does not guarantee that this will not happen.

      Returns:
      the time the message expires, which is the sum of the time-to-live value specified by the client and the GMT at the time of the send
      Throws:
      JMSException - if the JMS provider fails to get the message expiration due to some internal error.
      See Also:
      setJMSExpiration(long)

      public void setJMSExpiration(long expiration) throws JMSException
      设置消息的到期时间。

      JMS 提供者在发送消息时设置此字段。此方法可以用来更改收到的消息的值。

      expiration | 消息的到期时间
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置消息到期时间。
      See also | getJMSExpiration()
      英文文档：

      setJMSExpiration

      void setJMSExpiration(long expiration)
                      throws JMSException
      Sets the message's expiration value.

      JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

      Parameters:
      expiration - the message's expiration time
      Throws:
      JMSException - if the JMS provider fails to set the message expiration due to some internal error.
      See Also:
      getJMSExpiration()

      public int getJMSPriority() throws JMSException
      获取消息优先级别。

      JMS API 定义 10 个优先级值，0 表示最低优先级，9 表示最高优先级。此外，客户端应考虑将优先级 0-4 作为正常优先级等级，将优先级 5-9 作为加速优先级等级。

      JMS API 不要求提供者严格实现消息的优先级顺序；但是，提供者应尽可能在正常消息之前传送加速消息。

      return | 默认消息优先级
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取消息优先级。
      See also | setJMSPriority(int)
      英文文档：

      getJMSPriority

      int getJMSPriority()
                   throws JMSException
      Gets the message priority level.

      The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. In addition, clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority.

      The JMS API does not require that a provider strictly implement priority ordering of messages; however, it should do its best to deliver expedited messages ahead of normal messages.

      Returns:
      the default message priority
      Throws:
      JMSException - if the JMS provider fails to get the message priority due to some internal error.
      See Also:
      setJMSPriority(int)

      public void setJMSPriority(int priority) throws JMSException
      设置此消息的优先级别。

      JMS 提供者在发送消息时设置此字段。此方法可以用来更改收到的消息的值。

      priority | 此消息的优先级
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置消息优先级。
      See also | getJMSPriority()
      英文文档：

      setJMSPriority

      void setJMSPriority(int priority)
                    throws JMSException
      Sets the priority level for this message.

      JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

      Parameters:
      priority - the priority of this message
      Throws:
      JMSException - if the JMS provider fails to set the message priority due to some internal error.
      See Also:
      getJMSPriority()

      public void clearProperties() throws JMSException
      清除消息的属性。

      不清除消息的头字段和正文。

      Throws JMSException: 如果 JMS 提供者由于某个内部错误无法清除消息属性。
      英文文档：

      clearProperties

      void clearProperties()
                     throws JMSException
      Clears a message's properties.

      The message's header fields and body are not cleared.

      Throws:
      JMSException - if the JMS provider fails to clear the message properties due to some internal error.

      public boolean propertyExists(String name) throws JMSException
      指示是否存在属性值。
      name | 要测试的属性的名称。
      return | 如果属性存在，则返回 true
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法确定是否存在该属性。
      英文文档：

      propertyExists

      boolean propertyExists(String name)
                       throws JMSException
      Indicates whether a property value exists.

      Parameters:
      name - the name of the property to test
      Returns:
      true if the property exists
      Throws:
      JMSException - if the JMS provider fails to determine if the property exists due to some internal error.

      public boolean getBooleanProperty(String name) throws JMSException
      返回带指定名称的 boolean 属性的值。
      name | boolean 属性的名称。
      return | 指定名称的 boolean 属性值。
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getBooleanProperty

      boolean getBooleanProperty(String name)
                           throws JMSException
      Returns the value of the boolean property with the specified name.

      Parameters:
      name - the name of the boolean property
      Returns:
      the boolean property value for the specified name
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public byte getByteProperty(String name) throws JMSException
      返回带指定名称的 byte 属性的值。
      name | byte 属性的名称
      return | 指定名称的 byte 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getByteProperty

      byte getByteProperty(String name)
                     throws JMSException
      Returns the value of the byte property with the specified name.

      Parameters:
      name - the name of the byte property
      Returns:
      the byte property value for the specified name
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public short getShortProperty(String name) throws JMSException
      返回带指定名称的 short 属性的值。
      name | short 属性的名称
      return | 指定名称的 short 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getShortProperty

      short getShortProperty(String name)
                       throws JMSException
      Returns the value of the short property with the specified name.

      Parameters:
      name - the name of the short property
      Returns:
      the short property value for the specified name
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public int getIntProperty(String name) throws JMSException
      返回带指定名称的 int 属性的值。
      name | int 属性的名称
      return | 指定名称的 int 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getIntProperty

      int getIntProperty(String name)
                   throws JMSException
      Returns the value of the int property with the specified name.

      Parameters:
      name - the name of the int property
      Returns:
      the int property value for the specified name
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public long getLongProperty(String name) throws JMSException
      返回带指定名称的 long 属性的值。
      name | long 属性的名称。
      return | 指定名称的 long 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getLongProperty

      long getLongProperty(String name)
                     throws JMSException
      Returns the value of the long property with the specified name.

      Parameters:
      name - the name of the long property
      Returns:
      the long property value for the specified name
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public float getFloatProperty(String name) throws JMSException
      返回带指定名称的 float 属性的值。
      name | float 属性的名称
      return | 指定名称的 float 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getFloatProperty

      float getFloatProperty(String name)
                       throws JMSException
      Returns the value of the float property with the specified name.

      Parameters:
      name - the name of the float property
      Returns:
      the float property value for the specified name
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public double getDoubleProperty(String name) throws JMSException
      返回带指定名称的 double 属性的值。
      name | double 属性的名称
      return | 指定名称的 double 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getDoubleProperty

      double getDoubleProperty(String name)
                         throws JMSException
      Returns the value of the double property with the specified name.

      Parameters:
      name - the name of the double property
      Returns:
      the double property value for the specified name
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public String getStringProperty(String name) throws JMSException
      返回带指定名称的 String 属性的值。
      name | String 属性的名称
      return | 指定名称的 String 属性值；如果不存在此名称的属性，则返回 null 值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      Throws | MessageFormatException: 如果此类型转换无效。
      英文文档：

      getStringProperty

      String getStringProperty(String name)
                         throws JMSException
      Returns the value of the String property with the specified name.

      Parameters:
      name - the name of the String property
      Returns:
      the String property value for the specified name; if there is no property by this name, a null value is returned
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.
      MessageFormatException - if this type conversion is invalid.

      public Object getObjectProperty(String name) throws JMSException
      返回带指定名称的 Java 对象属性的值。

      此方法可以用于以对象化格式返回作为属性存储在消息中（通过调用等效的 setObjectProperty 方法或等效的基本方法 settypeProperty）的对象。

      name | Java 对象属性的名称
      return | 以对象化格式返回带指定名称的 Java 对象属性值（例如，如果属性设置为 int，则返回 Integer）；如果不存在此名称的属性，则返回 null 值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性值。
      英文文档：

      getObjectProperty

      Object getObjectProperty(String name)
                         throws JMSException
      Returns the value of the Java object property with the specified name.

      This method can be used to return, in objectified format, an object that has been stored as a property in the message with the equivalent setObjectProperty method call, or its equivalent primitive settypeProperty method.

      Parameters:
      name - the name of the Java object property
      Returns:
      the Java object property value with the specified name, in objectified format (for example, if the property was set as an int, an Integer is returned); if there is no property by this name, a null value is returned
      Throws:
      JMSException - if the JMS provider fails to get the property value due to some internal error.

      public java.util.Enumeration<E> getPropertyNames() throws JMSException
      返回所有属性名称的 Enumeration。

      注意，JMS 标准头字段不视为属性，不在此枚举中返回。

      return | 所有属性值名称的枚举
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取属性名称。
      英文文档：

      getPropertyNames

      Enumeration getPropertyNames()
                             throws JMSException
      Returns an Enumeration of all the property names.

      Note that JMS standard header fields are not considered properties and are not returned in this enumeration.

      Returns:
      an enumeration of all the names of property values
      Throws:
      JMSException - if the JMS provider fails to get the property names due to some internal error.

      public void setBooleanProperty(String name, boolean value) throws JMSException
      将带指定名称的 boolean 属性值设置到消息中。
      name | boolean 属性的名称。
      value | 要设置的 boolean 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setBooleanProperty

      void setBooleanProperty(String name,
                        boolean value)
                        throws JMSException
      Sets a boolean property value with the specified name into the message.

      Parameters:
      name - the name of the boolean property
      value - the boolean property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setByteProperty(String name, byte value) throws JMSException
      将带指定名称的 byte 属性值设置到消息中。
      name | byte 属性的名称
      value | 要设置的 byte 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setByteProperty

      void setByteProperty(String name,
                     byte value)
                     throws JMSException
      Sets a byte property value with the specified name into the message.

      Parameters:
      name - the name of the byte property
      value - the byte property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setShortProperty(String name, short value) throws JMSException
      将带指定名称的 short 属性值设置到消息中。
      name | short 属性的名称
      value | 要设置的 short 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setShortProperty

      void setShortProperty(String name,
                      short value)
                      throws JMSException
      Sets a short property value with the specified name into the message.

      Parameters:
      name - the name of the short property
      value - the short property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setIntProperty(String name, int value) throws JMSException
      将带指定名称的 int 属性值设置到消息中。
      name | int 属性的名称
      value | 要设置的 int 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setIntProperty

      void setIntProperty(String name,
                    int value)
                    throws JMSException
      Sets an int property value with the specified name into the message.

      Parameters:
      name - the name of the int property
      value - the int property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setLongProperty(String name, long value) throws JMSException
      将带指定名称的 long 属性值设置到消息中。
      name | long 属性的名称。
      value | 要设置的 long 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setLongProperty

      void setLongProperty(String name,
                     long value)
                     throws JMSException
      Sets a long property value with the specified name into the message.

      Parameters:
      name - the name of the long property
      value - the long property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setFloatProperty(String name, float value) throws JMSException
      将带指定名称的 float 属性值设置到消息中。
      name | float 属性的名称
      value | 要设置的 float 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setFloatProperty

      void setFloatProperty(String name,
                      float value)
                      throws JMSException
      Sets a float property value with the specified name into the message.

      Parameters:
      name - the name of the float property
      value - the float property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setDoubleProperty(String name, double value) throws JMSException
      将带指定名称的 double 属性值设置到消息中。
      name | double 属性的名称
      value | 要设置的 double 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setDoubleProperty

      void setDoubleProperty(String name,
                       double value)
                       throws JMSException
      Sets a double property value with the specified name into the message.

      Parameters:
      name - the name of the double property
      value - the double property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setStringProperty(String name, String value) throws JMSException
      将带指定名称的 String 属性值设置到消息中。
      name | String 属性的名称
      value | 要设置的 String 属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setStringProperty

      void setStringProperty(String name,
                       String value)
                       throws JMSException
      Sets a String property value with the specified name into the message.

      Parameters:
      name - the name of the String property
      value - the String property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageNotWriteableException - if properties are read-only

      public void setObjectProperty(String name, Object value) throws JMSException
      将带指定名称的 Java 对象属性值设置到消息中。

      注意，此方法仅用于对象化的基本对象类型（Integer、Double、Long 等）和 String 对象。

      name | Java 对象属性的名称
      value | 要设置的 Java 对象属性值
      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置属性值。
      Throws | IllegalArgumentException: 如果名称为 null，或者名称为空字符串。
      Throws | MessageFormatException: 如果对象无效
      Throws | MessageNotWriteableException: 如果属性是只读的
      英文文档：

      setObjectProperty

      void setObjectProperty(String name,
                       Object value)
                       throws JMSException
      Sets a Java object property value with the specified name into the message.

      Note that this method works only for the objectified primitive object types (Integer, Double, Long ...) and String objects.

      Parameters:
      name - the name of the Java object property
      value - the Java object property value to set
      Throws:
      JMSException - if the JMS provider fails to set the property due to some internal error.
      IllegalArgumentException - if the name is null or if the name is an empty string.
      MessageFormatException - if the object is invalid
      MessageNotWriteableException - if properties are read-only

      public void acknowledge() throws JMSException
      确认此使用消息会话的所有使用消息。

      在客户端指定其 JMS 会话的使用消息要显式确认时，使用的所有 JMS 消息都支持使用 acknowledge 方法。通过对使用消息调用 acknowledge，客户端确认传送消息的会话所使用的所有消息。

      对于事务性会话和指定使用隐式确认模式的会话，对 acknowledge 的调用将被忽略。

      客户端可以在使用消息时分别确认每个消息，也可以选择以应用程序定义的分组形式确认消息（对每组收到的最后一个消息调用 acknowledge 即可完成，从而确认会话使用的所有消息。）

      可能会重新传送已经接收但没有得到确认的消息。

      Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法确认消息。
      Throws | IllegalStateException: 如果在关闭的会话上调用此方法。
      See also | CLIENT_ACKNOWLEDGE
      英文文档：

      acknowledge

      void acknowledge()
                 throws JMSException
      Acknowledges all consumed messages of the session of this consumed message.

      All consumed JMS messages support the acknowledge method for use when a client has specified that its JMS session's consumed messages are to be explicitly acknowledged. By invoking acknowledge on a consumed message, a client acknowledges all messages consumed by the session that the message was delivered to.

      Calls to acknowledge are ignored for both transacted sessions and sessions specified to use implicit acknowledgement modes.

      A client may individually acknowledge each message as it is consumed, or it may choose to acknowledge messages as an application-defined group (which is done by calling acknowledge on the last received message of the group, thereby acknowledging all messages consumed by the session.)

      Messages that have been received but not acknowledged may be redelivered.

      Throws:
      JMSException - if the JMS provider fails to acknowledge the messages due to some internal error.
      IllegalStateException - if this method is called on a closed session.
      See Also:
      Session.CLIENT_ACKNOWLEDGE

      public void clearBody() throws JMSException
      清除消息正文。清除消息的正文不会清除其头值或属性条目。

      如果此消息正文为只读，则调用此方法将使消息正文的状态与新建消息的空正文状态相同。

      Throws JMSException: 如果 JMS 提供者由于某个内部错误无法清除消息正文。
      英文文档：

      clearBody

      void clearBody()
               throws JMSException
      Clears out the message body. Clearing a message's body does not clear its header values or property entries.

      If this message body was read-only, calling this method leaves the message body in the same state as an empty body in a newly created message.

      Throws:
      JMSException - if the JMS provider fails to clear the message body due to some internal error.
      Overview Package Class Tree Deprecated Index Help
      PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageConsumer (Java EE 5)

javax.jms
Interface MessageConsumer

All Known Subinterfaces:
QueueReceiver, TopicSubscriber
public interface MessageConsumer

Implemented by: QueueReceiver, TopicSubscriber

客户端使用 MessageConsumer 对象接收来自目的地的消息。通过将 Destination 对象传递到会话提供的消息-使用方创建方法，即可创建 MessageConsumer 对象。

MessageConsumer 是所有消息使用方的父接口。

可以使用消息选择器创建消息使用方。消息选择器使客户端能够将传送到消息使用方的消息限定为匹配该选择器的消息。

客户端可以同步接收消息使用方的消息或让使用方异步传送到达的消息。

对于同步接收，客户端可以使用其 receive 方法之一请求消息使用方的下一消息。有几种不同的 receive 方法可允许客户端轮询或等待下一消息。

对于异步传送，客户端可以向消息使用方注册一个 MessageListener 对象。当消息到达消息使用方时，它通过调用 MessageListener 的 onMessage 方法来传送消息。

如果 MessageListener 抛出异常，则是一个客户端编程错误。

version
en
1.0 - 13 March 1998
See also javax.jms.QueueReceiver, javax.jms.TopicSubscriber, javax.jms.Session
英文文档：

A client uses a MessageConsumer object to receive messages from a destination. A MessageConsumer object is created by passing a Destination object to a message-consumer creation method supplied by a session.

MessageConsumer is the parent interface for all message consumers.

A message consumer can be created with a message selector. A message selector allows the client to restrict the messages delivered to the message consumer to those that match the selector.

A client may either synchronously receive a message consumer's messages or have the consumer asynchronously deliver them as they arrive.

For synchronous receipt, a client can request the next message from a message consumer using one of its receive methods. There are several variations of receive that allow a client to poll or wait for the next message.

For asynchronous delivery, a client can register a MessageListener object with a message consumer. As messages arrive at the message consumer, it delivers them by calling the MessageListener's onMessage method.

It is a client programming error for a MessageListener to throw an exception.

Version:
1.0 - 13 March 1998
Author:
Mark Hapner, Rich Burridge
See Also:
QueueReceiver, TopicSubscriber, Session

Method Summary
void | close() Closes the message consumer.
MessageListener | getMessageListener() Gets the message consumer's MessageListener.
String | getMessageSelector() Gets this message consumer's message selector expression.
Message | receive() Receives the next message produced for this message consumer.
Message | receive(long timeout) Receives the next message that arrives within the specified timeout interval.
Message | receiveNoWait() Receives the next message if one is immediately available.
void | setMessageListener(MessageListener listener) Sets the message consumer's MessageListener.

Method Detail

public String getMessageSelector() throws JMSException
获取此消息使用方的消息选择器表达式。
return | 此消息使用方的消息选择器；如果消息使用方的消息选择器不存在（即如果没有设置消息选择器，或者设置为 null 或空字符串），则返回 null
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取消息选择器。
英文文档：

getMessageSelector

String getMessageSelector()
                          throws JMSException
Gets this message consumer's message selector expression.

Returns:
this message consumer's message selector, or null if no message selector exists for the message consumer (that is, if the message selector was not set or was set to null or the empty string)
Throws:
JMSException - if the JMS provider fails to get the message selector due to some internal error.

public MessageListener getMessageListener() throws JMSException
获取消息使用方的 MessageListener。
return | 消息使用方的侦听器；如果没有设置侦听器，则返回 null
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取消息侦听器。
See also | setMessageListener
英文文档：

getMessageListener

MessageListener getMessageListener()
                                   throws JMSException
Gets the message consumer's MessageListener.

Returns:
the listener for the message consumer, or null if no listener is set
Throws:
JMSException - if the JMS provider fails to get the message listener due to some internal error.
See Also:
setMessageListener(javax.jms.MessageListener)

public void setMessageListener(MessageListener listener) throws JMSException
设置消息使用方的 MessageListener。

将消息侦听器设置为 null 等效于取消为消息使用方设置的消息侦听器。

当现有侦听器正在使用消息或使用方正用于同步使用消息时，调用 MessageConsumer.setMessageListener 的效果是不确定的。

listener | 要接收消息的侦听器
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置消息侦听器。
See also | getMessageListener
英文文档：

setMessageListener

void setMessageListener(MessageListener listener)
                        throws JMSException
Sets the message consumer's MessageListener.

Setting the message listener to null is the equivalent of unsetting the message listener for the message consumer.

The effect of calling MessageConsumer.setMessageListener while messages are being consumed by an existing listener or the consumer is being used to consume messages synchronously is undefined.

Parameters:
listener - the listener to which the messages are to be delivered
Throws:
JMSException - if the JMS provider fails to set the message listener due to some internal error.
See Also:
getMessageListener()

public Message receive() throws JMSException
接收为此消息使用方生成的下一个消息。

在消息生成或此消息使用方关闭之前，将无限期地阻塞此调用。

如果在事务内完成了此 receive，则在事务提交之前使用方会一直保留该消息。

return | 为此消息使用方生成的下一个消息；如果此消息使用方已经同时关闭，则返回 null
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法接收文本消息。
英文文档：

receive

Message receive()
                throws JMSException
Receives the next message produced for this message consumer.

This call blocks indefinitely until a message is produced or until this message consumer is closed.

If this receive is done within a transaction, the consumer retains the message until the transaction commits.

Returns:
the next message produced for this message consumer, or null if this message consumer is concurrently closed
Throws:
JMSException - if the JMS provider fails to receive the next message due to some internal error.

public Message receive(long timeout) throws JMSException
接收在指定超时间隔内到达的下一个消息。

在消息到达、超时期满或此消息使用方关闭之前，将一直阻塞此调用。timeout 为 0 表示永远不会到期，将无限期地阻塞该调用。

timeout | 超时值（以毫秒为单位）
return | 为此消息使用方生成的下一个消息；如果超时期满或此消息使用方已经同时关闭，则返回 null
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法接收文本消息。
英文文档：

receive

Message receive(long timeout)
                throws JMSException
Receives the next message that arrives within the specified timeout interval.

This call blocks until a message arrives, the timeout expires, or this message consumer is closed. A timeout of zero never expires, and the call blocks indefinitely.

Parameters:
timeout - the timeout value (in milliseconds)
Returns:
the next message produced for this message consumer, or null if the timeout expires or this message consumer is concurrently closed
Throws:
JMSException - if the JMS provider fails to receive the next message due to some internal error.

public Message receiveNoWait() throws JMSException
接收立即可用的下一个消息。
return | 为此消息使用方生成的下一个消息；如果没有消息可用，则返回 null
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法接收文本消息。
英文文档：

receiveNoWait

Message receiveNoWait()
                      throws JMSException
Receives the next message if one is immediately available.

Returns:
the next message produced for this message consumer, or null if one is not available
Throws:
JMSException - if the JMS provider fails to receive the next message due to some internal error.

public void close() throws JMSException
关闭消息使用方。

由于提供者可以在 Java 虚拟机外部为 MessageConsumer 分配一些资源，因此不需要时客户端应该关闭这些资源。依赖于垃圾收集最终回收这些资源可能不够及时。

在正在进行的 receive 或消息侦听器完成前，此调用将一直阻塞。当此消息使用方关闭时，阻塞的消息使用方 receive 调用返回 null。

Throws JMSException: 如果 JMS 提供者由于某个内部错误无法关闭使用方。
英文文档：

close

void close()
           throws JMSException
Closes the message consumer.

Since a provider may allocate some resources on behalf of a MessageConsumer outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

This call blocks until a receive or message listener in progress has completed. A blocked message consumer receive call returns null when this message consumer is closed.

Throws:
JMSException - if the JMS provider fails to close the consumer due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageListener (Java EE 5)

javax.jms
Interface MessageListener

public interface MessageListener

MessageListener 对象用于接收异步传送的消息。

每个会话都必须确保向侦听器连续传递消息。这意味着分配给同一会话中一个或多个使用方的侦听器可以假定，在会话完成最后调用之前，不会对下一个消息调用 onMessage 方法。

version
en
1.0 - 13 March 1998
英文文档：

A MessageListener object is used to receive asynchronously delivered messages.

Each session must insure that it passes messages serially to the listener. This means that a listener assigned to one or more consumers of the same session can assume that the onMessage method is not called with the next message until the session has completed the last call.

Version:
1.0 - 13 March 1998
Author:
Mark Hapner, Rich Burridge

Method Summary
 void onMessage(Message message)
Passes a message to the listener.

Method Detail

public void onMessage(Message message)
向侦听器传递消息。
message 向侦听器传递的消息
英文文档：

onMessage

void onMessage(Message message)
Passes a message to the listener.

Parameters:
message - the message passed to the listener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageProducer (Java EE 5)

javax.jms
Interface MessageProducer

All Known Subinterfaces:
QueueSender, TopicPublisher
public interface MessageProducer

Implemented by: QueueSender, TopicPublisher

客户端使用 MessageProducer 对象将消息发送到目的地。通过将 Destination 对象传递到会话提供的消息-生成方创建方法，即可创建 MessageProducer 对象。

MessageProducer 是所有消息生成方的父接口。

客户端还可以选择创建消息生成方时不提供目的地。在这种情况下，每次发送操作都必须提供目的地。此类消息生成方通常用于使用请求的 JMSReplyTo 目的地向请求发送应答。

客户端可以为消息生成方发送的消息指定默认传送模式、优先级和生存时间。它还可以为单个消息指定传送模式、优先级和生存时间。

客户端可以为其发送的每个消息指定以毫秒为单位的生存时间。此值将消息到期时间定义为消息的生存时间值和消息发送时（对于事务性发送，这是客户端发送消息的时间，不是提交事务的时间）的 GMT 之和。

JMS 提供者应可能精确地终止消息；但是，JMS API 不定义提供的精确度。

version
en
1.1 - February 2, 2002
See also javax.jms.TopicPublisher, javax.jms.QueueSender, createProducer
英文文档：

A client uses a MessageProducer object to send messages to a destination. A MessageProducer object is created by passing a Destination object to a message-producer creation method supplied by a session.

MessageProducer is the parent interface for all message producers.

A client also has the option of creating a message producer without supplying a destination. In this case, a destination must be provided with every send operation. A typical use for this kind of message producer is to send replies to requests using the request's JMSReplyTo destination.

A client can specify a default delivery mode, priority, and time to live for messages sent by a message producer. It can also specify the delivery mode, priority, and time to live for an individual message.

A client can specify a time-to-live value in milliseconds for each message it sends. This value defines a message expiration time that is the sum of the message's time-to-live and the GMT when it is sent (for transacted sends, this is the time the client sends the message, not the time the transaction is committed).

A JMS provider should do its best to expire messages accurately; however, the JMS API does not define the accuracy provided.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
TopicPublisher, QueueSender, Session.createProducer(javax.jms.Destination)

Method Summary
void | close() Closes the message producer.
int | getDeliveryMode() Gets the producer's default delivery mode.
Destination | getDestination() Gets the destination associated with this MessageProducer.
boolean | getDisableMessageID() Gets an indication of whether message IDs are disabled.
boolean | getDisableMessageTimestamp() Gets an indication of whether message timestamps are disabled.
int | getPriority() Gets the producer's default priority.
long | getTimeToLive() Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
void | send(Destination destination, Message message) Sends a message to a destination for an unidentified message producer.
void | send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live.
void | send(Message message) Sends a message using the MessageProducer's default delivery mode, priority, and time to live.
void | send(Message message, int deliveryMode, int priority, long timeToLive) Sends a message to the destination, specifying delivery mode, priority, and time to live.
void | setDeliveryMode(int deliveryMode) Sets the producer's default delivery mode.
void | setDisableMessageID(boolean value) Sets whether message IDs are disabled.
void | setDisableMessageTimestamp(boolean value) Sets whether message timestamps are disabled.
void | setPriority(int defaultPriority) Sets the producer's default priority.
void | setTimeToLive(long timeToLive) Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.

Method Detail

public void setDisableMessageID(boolean value) throws JMSException
设置是否禁用消息 ID。

由于消息 ID 会创建并增加消息的大小，因此，如果能获得应用程序无需使用消息 ID 的提示，那么一些 JMS 提供者可以优化消息开销。通过对此消息生成方调用 setDisableMessageID 方法，JMS 客户端对此消息生成方发送的所有消息实现了这一潜在的优化。如果 JMS 提供者接受此提示，则这些消息必须将消息 ID 设置为 null；如果提供者忽略该提示，则消息 ID 必须设置为唯一的普通值。

默认情况下启用消息 ID。

value | 指示是否禁用消息 ID
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法将消息 ID 设置为禁用。
英文文档：

setDisableMessageID

void setDisableMessageID(boolean value)
                         throws JMSException
Sets whether message IDs are disabled.

Since message IDs take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that the message ID is not used by an application. By calling the setDisableMessageID method on this message producer, a JMS client enables this potential optimization for all messages sent by this message producer. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.

Message IDs are enabled by default.

Parameters:
value - indicates if message IDs are disabled
Throws:
JMSException - if the JMS provider fails to set message ID to disabled due to some internal error.

public boolean getDisableMessageID() throws JMSException
获取是否禁用消息 ID 的指示。
return | 是否禁用消息 ID 的指示
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法确定是否禁用消息 ID。
英文文档：

getDisableMessageID

boolean getDisableMessageID()
                            throws JMSException
Gets an indication of whether message IDs are disabled.

Returns:
an indication of whether message IDs are disabled
Throws:
JMSException - if the JMS provider fails to determine if message IDs are disabled due to some internal error.

public void setDisableMessageTimestamp(boolean value) throws JMSException
设置是否禁用消息时间戳。

由于时间戳会创建并增加消息的大小，因此，如果能获得应用程序无需使用时间戳的提示，那么一些 JMS 提供者可以优化消息开销。通过对此消息生成方调用 setDisableMessageTimestamp 方法，JMS 客户端对此消息生成方发送的所有消息实现了这一潜在的优化。如果 JMS 提供者接受此提示，这些消息必须将时间戳设置为 0；如果提供者忽略该提示，则时间戳必须设置为普通值。

默认情况下启用消息时间戳。

value | 指示是否禁用消息时间戳
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法将时间戳设置为禁用。
英文文档：

setDisableMessageTimestamp

void setDisableMessageTimestamp(boolean value)
                                throws JMSException
Sets whether message timestamps are disabled.

Since timestamps take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that the timestamp is not used by an application. By calling the setDisableMessageTimestamp method on this message producer, a JMS client enables this potential optimization for all messages sent by this message producer. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint, the timestamp must be set to its normal value.

Message timestamps are enabled by default.

Parameters:
value - indicates if message timestamps are disabled
Throws:
JMSException - if the JMS provider fails to set timestamps to disabled due to some internal error.

public boolean getDisableMessageTimestamp() throws JMSException
获取是否禁用消息时间戳的指示。
return | 是否禁用消息时间戳的指示
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法确定是否禁用时间戳。
英文文档：

getDisableMessageTimestamp

boolean getDisableMessageTimestamp()
                                   throws JMSException
Gets an indication of whether message timestamps are disabled.

Returns:
an indication of whether message timestamps are disabled
Throws:
JMSException - if the JMS provider fails to determine if timestamps are disabled due to some internal error.

public void setDeliveryMode(int deliveryMode) throws JMSException
设置生成方的默认传送模式。

默认情况下传送模式设置为 PERSISTENT。

deliveryMode | 此消息生成方的消息传送模式；合法值有 DeliveryMode.NON_PERSISTENT 和 DeliveryMode.PERSISTENT
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置传送模式。
See also | getDeliveryMode, NON_PERSISTENT, PERSISTENT, DEFAULT_DELIVERY_MODE
英文文档：

setDeliveryMode

void setDeliveryMode(int deliveryMode)
                     throws JMSException
Sets the producer's default delivery mode.

Delivery mode is set to PERSISTENT by default.

Parameters:
deliveryMode - the message delivery mode for this message producer; legal values are DeliveryMode.NON_PERSISTENT and DeliveryMode.PERSISTENT
Throws:
JMSException - if the JMS provider fails to set the delivery mode due to some internal error.
See Also:
getDeliveryMode(), DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT, Message.DEFAULT_DELIVERY_MODE

public int getDeliveryMode() throws JMSException
获取生成方的默认传送模式。
return | 此消息生成方的消息传送模式
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取传送模式。
See also | setDeliveryMode
英文文档：

getDeliveryMode

int getDeliveryMode()
                    throws JMSException
Gets the producer's default delivery mode.

Returns:
the message delivery mode for this message producer
Throws:
JMSException - if the JMS provider fails to get the delivery mode due to some internal error.
See Also:
setDeliveryMode(int)

public void setPriority(int defaultPriority) throws JMSException
设置生成方的默认优先级。

JMS API 定义 10 个优先级值，0 表示最低优先级，9 表示最高优先级。客户端应考虑将优先级 0-4 作为正常优先级等级，将优先级 5-9 作为加速优先级等级。默认情况下优先级设置为 4。

defaultPriority | 此消息生成方的消息优先级；必须是介于 0 和 9 之间的值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置优先级。
See also | getPriority, DEFAULT_PRIORITY
英文文档：

setPriority

void setPriority(int defaultPriority)
                 throws JMSException
Sets the producer's default priority.

The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. Priority is set to 4 by default.

Parameters:
defaultPriority - the message priority for this message producer; must be a value between 0 and 9
Throws:
JMSException - if the JMS provider fails to set the priority due to some internal error.
See Also:
getPriority(), Message.DEFAULT_PRIORITY

public int getPriority() throws JMSException
获取生成方的默认优先级。
return | 此消息生成方的消息优先级
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取优先级。
See also | setPriority
英文文档：

getPriority

int getPriority()
                throws JMSException
Gets the producer's default priority.

Returns:
the message priority for this message producer
Throws:
JMSException - if the JMS provider fails to get the priority due to some internal error.
See Also:
setPriority(int)

public void setTimeToLive(long timeToLive) throws JMSException
设置从消息指派时间算起消息系统应该保留已生产消息的默认时间长度（以毫秒为单位）。

默认情况下生存时间设置为 0。

timeToLive | 消息生存时间（以毫秒为单位）；0 表示生存时间未限定
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置生存时间。
See also | getTimeToLive, DEFAULT_TIME_TO_LIVE
英文文档：

setTimeToLive

void setTimeToLive(long timeToLive)
                   throws JMSException
Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.

Time to live is set to zero by default.

Parameters:
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if the JMS provider fails to set the time to live due to some internal error.
See Also:
getTimeToLive(), Message.DEFAULT_TIME_TO_LIVE

public long getTimeToLive() throws JMSException
获取从消息指派时间算起消息系统应该保留已生产消息的默认时间长度（以毫秒为单位）。
return | 消息生存时间（以毫秒为单位）；0 表示生存时间未限定
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取生存时间。
See also | setTimeToLive
英文文档：

getTimeToLive

long getTimeToLive()
                   throws JMSException
Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.

Returns:
the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if the JMS provider fails to get the time to live due to some internal error.
See Also:
setTimeToLive(long)

public Destination getDestination() throws JMSException
获取与此 MessageProducer 关联的目的地。
return | 此生成方的 Destination/
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此 MessageProduce 的目的地。
since | 1.1
英文文档：

getDestination

Destination getDestination()
                           throws JMSException
Gets the destination associated with this MessageProducer.

Returns:
this producer's Destination/
Throws:
JMSException - if the JMS provider fails to get the destination for this MessageProducer due to some internal error.
Since:
1.1

public void close() throws JMSException
关闭消息生成方。

由于提供者可以在 Java 虚拟机外部为 MessageProducer 分配一些资源，因此不需要时客户端应该关闭这些资源。依赖于垃圾收集最终回收这些资源可能不够及时。

Throws JMSException: 如果 JMS 提供者由于某个内部错误无法关闭生成方。
英文文档：

close

void close()
           throws JMSException
Closes the message producer.

Since a provider may allocate some resources on behalf of a MessageProducer outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Throws:
JMSException - if the JMS provider fails to close the producer due to some internal error.

public void send(Message message) throws JMSException
使用 MessageProducer 的默认传送模式、优先级和生存时间发送消息。
message | 要发送的消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端使用此方法，而其 MessageProducer 带有无效目的地。
Throws | UnsupportedOperationException: 如果客户端使用此方法，而其 MessageProducer 在创建时没有指定目的地。
since | 1.1
See also | createProducer, javax.jms.MessageProducer
英文文档：

send

void send(Message message)
          throws JMSException
Sends a message using the MessageProducer's default delivery mode, priority, and time to live.

Parameters:
message - the message to send
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException - if a client uses this method with a MessageProducer that did not specify a destination at creation time.
Since:
1.1
See Also:
Session.createProducer(javax.jms.Destination), MessageProducer

public void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
将消息发送到目的地，同时指定传送模式、优先级和生存时间。
message | 要发送的消息
deliveryMode | 要使用的传送模式
priority | 此消息的优先级
timeToLive | 消息的生命周期（以毫秒为单位）
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端使用此方法，而其 MessageProducer 带有无效目的地。
Throws | UnsupportedOperationException: 如果客户端使用此方法，而其 MessageProducer 在创建时没有指定目的地。
since | 1.1
See also | createProducer
英文文档：

send

void send(Message message,
          int deliveryMode,
          int priority,
          long timeToLive)
          throws JMSException
Sends a message to the destination, specifying delivery mode, priority, and time to live.

Parameters:
message - the message to send
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message's lifetime (in milliseconds)
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException - if a client uses this method with a MessageProducer that did not specify a destination at creation time.
Since:
1.1
See Also:
Session.createProducer(javax.jms.Destination)

public void send(Destination destination, Message message) throws JMSException
为未标识的消息生成方将消息发送到目的地。使用 MessageProducer 的默认传送模式、优先级和生存时间。

通常，在创建时为消息生成方分配一个目的地；但是，JMS API 也支持未标识的消息生成方，这需要在每次发送消息时提供目的地。

destination | 此消息要发送到的目的地
message | 要发送的消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端使用带无效目的地的此方法。
Throws | UnsupportedOperationException: 如果客户端使用此方法，其 MessageProducer 在创建时指定了目的地。
since | 1.1
See also | createProducer, javax.jms.MessageProducer
英文文档：

send

void send(Destination destination,
          Message message)
          throws JMSException
Sends a message to a destination for an unidentified message producer. Uses the MessageProducer's default delivery mode, priority, and time to live.

Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent.

Parameters:
destination - the destination to send this message to
message - the message to send
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid destination.
UnsupportedOperationException - if a client uses this method with a MessageProducer that specified a destination at creation time.
Since:
1.1
See Also:
Session.createProducer(javax.jms.Destination), MessageProducer

public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
为未标识的消息生成方将消息发送到目的地，同时指定传送模式、优先级和生存时间。

通常，在创建时为消息生成方分配一个目的地；但是，JMS API 也支持未标识的消息生成方，这需要在每次发送消息时提供目的地。

destination | 此消息要发送到的目的地
message | 要发送的消息
deliveryMode | 要使用的传送模式
priority | 此消息的优先级
timeToLive | 消息的生命周期（以毫秒为单位）
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端使用带无效目的地的此方法。
since | 1.1
See also | createProducer
英文文档：

send

void send(Destination destination,
          Message message,
          int deliveryMode,
          int priority,
          long timeToLive)
          throws JMSException
Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live.

Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent.

Parameters:
destination - the destination to send this message to
message - the message to send
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message's lifetime (in milliseconds)
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid destination.
Since:
1.1
See Also:
Session.createProducer(javax.jms.Destination)
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


ObjectMessage (Java EE 5)

javax.jms
Interface ObjectMessage

All Superinterfaces:
Message
public interface ObjectMessage
extends Message

Implements: Message

ObjectMessage 对象用于发送包含 Java 编程语言中可序列化对象（“Java 对象”）的消息。它继承自 Message 接口并添加了包含一个对某对象引用的正文。只能使用 Serializable Java 对象。

如果必须发送 Java 对象的集合，则可以使用自 JDK 1.2 起提供的 Collection 类之一。

当客户端接收 ObjectMessage 时，它是只读模式。如果客户端尝试在此时写入消息，则抛出 MessageNotWriteableException。如果调用了 clearBody，现在便可以读取和写入消息。

version
en
1.0 - 6 August 1998
See also createObjectMessage(), createObjectMessage(Serializable), javax.jms.BytesMessage, javax.jms.MapMessage, javax.jms.Message, javax.jms.StreamMessage, javax.jms.TextMessage
英文文档：

An ObjectMessage object is used to send a message that contains a serializable object in the Java programming language ("Java object"). It inherits from the Message interface and adds a body containing a single reference to an object. Only Serializable Java objects can be used.

If a collection of Java objects must be sent, one of the Collection classes provided since JDK 1.2 can be used.

When a client receives an ObjectMessage, it is in read-only mode. If a client attempts to write to the message at this point, a MessageNotWriteableException is thrown. If clearBody is called, the message can now be both read from and written to.

Version:
1.0 - 6 August 1998
Author:
Mark Hapner, Rich Burridge
See Also:
Session.createObjectMessage(), Session.createObjectMessage(Serializable), BytesMessage, MapMessage, Message, StreamMessage, TextMessage

Field Summary
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
Method Summary
Serializable | getObject() Gets the serializable object containing this message's data.
void | setObject(Serializable object) Sets the serializable object containing this message's data.
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty

Method Detail

public void setObject(java.io.Serializable object) throws JMSException
设置包含此消息数据的可序列化对象。要特别注意的是，调用 setObject() 时，ObjectMessage 包含的是对象的快照；后续对对象的修改不会影响 ObjectMessage 正文。
object | 消息的数据
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置对象。
Throws | MessageFormatException: 如果对象序列化失败。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setObject

void setObject(Serializable object)
               throws JMSException
Sets the serializable object containing this message's data. It is important to note that an ObjectMessage contains a snapshot of the object at the time setObject() is called; subsequent modifications of the object will have no effect on the ObjectMessage body.

Parameters:
object - the message's data
Throws:
JMSException - if the JMS provider fails to set the object due to some internal error.
MessageFormatException - if object serialization fails.
MessageNotWriteableException - if the message is in read-only mode.

public java.io.Serializable getObject() throws JMSException
获取包含此消息数据的可序列化对象。默认值为 null。
return | 包含此消息数据的可序列化对象。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取对象。
Throws | MessageFormatException: 如果对象反序列化失败。
英文文档：

getObject

Serializable getObject()
                       throws JMSException
Gets the serializable object containing this message's data. The default value is null.

Returns:
the serializable object containing this message's data
Throws:
JMSException - if the JMS provider fails to get the object due to some internal error.
MessageFormatException - if object deserialization fails.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Queue (Java EE 5)

javax.jms
Interface Queue

All Superinterfaces:
Destination
All Known Subinterfaces:
TemporaryQueue
public interface Queue
extends Destination

Implements: Destination
Implemented by: TemporaryQueue

Queue 对象封装特定于提供者的队列名称。客户端通过这种方式将队列的身份指定给 JMS API 方法。对于那些将 Destination 用作形参的方法，Queue 对象用作实参。例如，通过调用下面的方法，可以使用队列创建 MessageConsumer 和 MessageProducer：
  • Session.CreateConsumer(Destination destination)
  • Session.CreateProducer(Destination destination)

JMS API 未定义队列保留消息的实际时间长度和资源溢出的后果。

version
en
1.1 February 2 - 2000
See also createConsumer(Destination), createProducer(Destination), createQueue(String), createQueue(String)
英文文档：

A Queue object encapsulates a provider-specific queue name. It is the way a client specifies the identity of a queue to JMS API methods. For those methods that use a Destination as a parameter, a Queue object used as an argument. For example, a queue can be used to create a MessageConsumer and a MessageProducer by calling:

  • Session.CreateConsumer(Destination destination)
  • Session.CreateProducer(Destination destination)

The actual length of time messages are held by a queue and the consequences of resource overflow are not defined by the JMS API.

Version:
1.1 February 2 - 2000
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createConsumer(Destination),
Session.createProducer(Destination),
Session.createQueue(String),
QueueSession.createQueue(String)

Method Summary
String | getQueueName() Gets the name of this queue.
String | toString() Returns a string representation of this object.

Method Detail

public String getQueueName() throws JMSException
获取此队列的名称。

依赖于该名称的客户端是不可移植的。

return | 队列名称
Throws | JMSException: 如果 Queue 的 JMS 提供者实现由于某个内部错误无法返回队列名称。
英文文档：

getQueueName

String getQueueName()
                    throws JMSException
Gets the name of this queue.

Clients that depend upon the name are not portable.

Returns:
the queue name
Throws:
JMSException - if the JMS provider implementation of Queue fails to return the queue name due to some internal error.

public String toString()
返回此对象的字符串表示形式。
return 此队列的特定于提供者的身份值
英文文档：

toString

String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
the provider-specific identity values for this queue
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QueueBrowser (Java EE 5)

javax.jms
Interface QueueBrowser

public interface QueueBrowser

客户端使用 QueueBrowser 对象查看队列中的消息，而不会移除它们。

getEnumeration 方法返回用于扫描队列消息的 java.util.Enumeration。它可能是整个队列内容的枚举，也可能只包含与消息选择器相匹配的消息。

消息可能在扫描完成时到达和过期。JMS API 不要求枚举的内容为队列内容的静态快照。这些更改是否可见取决于 JMS 提供者。

可以从 Session 或 QueueSession 创建 QueueBrowser。

version
en
1.1 April 9, 2002
See also createBrowser, createBrowser, javax.jms.QueueReceiver
英文文档：

A client uses a QueueBrowser object to look at messages on a queue without removing them.

The getEnumeration method returns a java.util.Enumeration that is used to scan the queue's messages. It may be an enumeration of the entire content of a queue, or it may contain only the messages matching a message selector.

Messages may be arriving and expiring while the scan is done. The JMS API does not require the content of an enumeration to be a static snapshot of queue content. Whether these changes are visible or not depends on the JMS provider.

A QueueBrowser can be created from either a Session or a QueueSession.

Version:
1.1 April 9, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createBrowser(javax.jms.Queue), QueueSession.createBrowser(javax.jms.Queue), QueueReceiver

Method Summary
void | close() Closes the QueueBrowser.
Enumeration | getEnumeration() Gets an enumeration for browsing the current queue messages in the order they would be received.
String | getMessageSelector() Gets this queue browser's message selector expression.
Queue | getQueue() Gets the queue associated with this queue browser.

Method Detail

public Queue getQueue() throws JMSException
获取与此队列浏览器关联的队列。
return | 队列
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取与此浏览器关联的队列。
英文文档：

getQueue

Queue getQueue()
               throws JMSException
Gets the queue associated with this queue browser.

Returns:
the queue
Throws:
JMSException - if the JMS provider fails to get the queue associated with this browser due to some internal error.

public String getMessageSelector() throws JMSException
获取此队列浏览器的消息选择器表达式。
return | 此队列浏览器的消息选择器；如果该消息使用方没有消息选择器（即如果消息选择器未设置或设置为 null 或空字符串），则返回 null
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此浏览器的消息选择器。
英文文档：

getMessageSelector

String getMessageSelector()
                          throws JMSException
Gets this queue browser's message selector expression.

Returns:
this queue browser's message selector, or null if no message selector exists for the message consumer (that is, if the message selector was not set or was set to null or the empty string)
Throws:
JMSException - if the JMS provider fails to get the message selector for this browser due to some internal error.

public java.util.Enumeration<E> getEnumeration() throws JMSException
获取按照它们将被接收的顺序浏览当前队列消息的枚举。
return | 浏览这些消息的枚举
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此浏览器的枚举。
英文文档：

getEnumeration

Enumeration getEnumeration()
                           throws JMSException
Gets an enumeration for browsing the current queue messages in the order they would be received.

Returns:
an enumeration for browsing the messages
Throws:
JMSException - if the JMS provider fails to get the enumeration for this browser due to some internal error.

public void close() throws JMSException
关闭 QueueBrowser。

由于提供者可能会代表 QueueBrowser 分配 Java 虚拟机之外的某些资源，因此不需要这些资源时客户端应该关闭它们。依赖于垃圾收集最终回收这些资源可能不够及时。

Throws JMSException: 如果 JMS 提供者由于某个内部错误无法关闭此浏览器。
英文文档：

close

void close()
           throws JMSException
Closes the QueueBrowser.

Since a provider may allocate some resources on behalf of a QueueBrowser outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Throws:
JMSException - if the JMS provider fails to close this browser due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QueueConnection (Java EE 5)

javax.jms
Interface QueueConnection

All Superinterfaces:
Connection
All Known Subinterfaces:
XAQueueConnection
public interface QueueConnection
extends Connection

Implements: Connection
Implemented by: XAQueueConnection

QueueConnection 对象是到点对点 JMS 提供者的活动连接。客户端使用 QueueConnection 对象创建一个或多个生产和使用消息的 QueueSession 对象。

QueueConnection 可用于创建 QueueSession，可以从 QueueSession 中创建专门的与队列有关的对象。 一种更常用且建议采用的方法是使用 Connection 对象。

QueueConnection 对象 应用于支持已使用该对象的现有代码。

QueueConnection 无法用于创建 特定于发布/订阅域的对象。 createDurableConnectionConsumer 方法继承自 Connection，但如果在 QueueConnection 中 使用，则必须抛出 IllegalStateException 。

version
en
1.1 - April 9, 2002
See also javax.jms.Connection, javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory
英文文档：

A QueueConnection object is an active connection to a point-to-point JMS provider. A client uses a QueueConnection object to create one or more QueueSession objects for producing and consuming messages.

A QueueConnection can be used to create a QueueSession, from which specialized queue-related objects can be created. A more general, and recommended, approach is to use the Connection object.

The QueueConnection object should be used to support existing code that has already used it.

A QueueConnection cannot be used to create objects specific to the publish/subscribe domain. The createDurableConnectionConsumer method inherits from Connection, but must throw an IllegalStateException if used from QueueConnection.

Version:
1.1 - April 9, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Connection, ConnectionFactory, QueueConnectionFactory

Method Summary
ConnectionConsumer | createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) Creates a connection consumer for this connection (optional operation).
QueueSession | createQueueSession(boolean transacted, int acknowledgeMode) Creates a QueueSession object.
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, createDurableConnectionConsumer, createSession, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop

Method Detail

public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
创建 QueueSession 对象。
transacted | 指示会话是否是事务性的
acknowledgeMode | 指示使用方或 客户端是否将确认收到的任何消息；如果 会话是事务性的，则忽略此参数。合法值是 Session.AUTO_ACKNOWLEDGE、 Session.CLIENT_ACKNOWLEDGE 和 Session.DUPS_OK_ACKNOWLEDGE。
return | 新建的队列会话
Throws | JMSException: 如果 QueueConnection 对象 由于某个内部错误或 缺少对特定事务 和确认模式的支持无法创建会话。
See also | AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
英文文档：

createQueueSession

QueueSession createQueueSession(boolean transacted,
                                int acknowledgeMode)
                                throws JMSException
Creates a QueueSession object.

Parameters:
transacted - indicates whether the session is transacted
acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.
Returns:
a newly created queue session
Throws:
JMSException - if the QueueConnection object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE

public ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
创建此连接的连接使用方（可选操作）。 这是一个专家级工具，常规 JMS 客户端不使用。
queue | 要访问的队列
messageSelector | 仅传送属性 与消息选择器表达式相匹配的消息。值为 null 或 空字符串表示该消息使用方没有消息选择器 。
sessionPool | 与此连接使用方关联的服务器会话池
maxMessages | 可以一次分配给服务器会话的最大消息数
return | 连接使用方
Throws | JMSException: 如果 QueueConnection 对象 由于某个内部错误 或 sessionPool 和 messageSelector 的无效参数无法创建连接使用方。
Throws | InvalidDestinationException: 如果指定了无效的队列。
Throws | InvalidSelectorException: 如果消息选择器无效。
See also | javax.jms.ConnectionConsumer
英文文档：

createConnectionConsumer

ConnectionConsumer createConnectionConsumer(Queue queue,
                                            String messageSelector,
                                            ServerSessionPool sessionPool,
                                            int maxMessages)
                                            throws JMSException
Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.

Parameters:
queue - the queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
sessionPool - the server session pool to associate with this connection consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the connection consumer
Throws:
JMSException - if the QueueConnection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector.
InvalidDestinationException - if an invalid queue is specified.
InvalidSelectorException - if the message selector is invalid.
See Also:
ConnectionConsumer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QueueConnectionFactory (Java EE 5)

javax.jms
Interface QueueConnectionFactory

All Superinterfaces:
ConnectionFactory
All Known Subinterfaces:
XAQueueConnectionFactory
public interface QueueConnectionFactory
extends ConnectionFactory

Implements: ConnectionFactory
Implemented by: XAQueueConnectionFactory

客户端使用 QueueConnectionFactory 对象创建具有点对点 JMS 提供者的 QueueConnection 对象。

QueueConnectionFactory 可用于创建 QueueConnection，可以从 QueueConnection 中创建专门的与队列有关的对象。一种更常用且建议采用的方法是使用 ConnectionFactory 对象。

QueueConnectionFactory 对象可用于支持已使用该对象的现有代码。

version
en
1.1 - February 2, 2002
See also javax.jms.ConnectionFactory
英文文档：

A client uses a QueueConnectionFactory object to create QueueConnection objects with a point-to-point JMS provider.

QueueConnectionFactory can be used to create a QueueConnection, from which specialized queue-related objects can be created. A more general, and recommended, approach is to use the ConnectionFactory object.

The QueueConnectionFactory object can be used to support existing code that already uses it.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
ConnectionFactory

Method Summary
QueueConnection | createQueueConnection() Creates a queue connection with the default user identity.
QueueConnection | createQueueConnection(String userName, String password) Creates a queue connection with the specified user identity.
Methods inherited from interface javax.jms.ConnectionFactory
createConnection, createConnection

Method Detail

public QueueConnection createQueueConnection() throws JMSException
创建带有默认用户身份的队列连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
return | 新建的队列连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建队列连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createQueueConnection

QueueConnection createQueueConnection()
                                      throws JMSException
Creates a queue connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called. .

Returns:
a newly created queue connection
Throws:
JMSException - if the JMS provider fails to create the queue connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.

public QueueConnection createQueueConnection(String userName, String password) throws JMSException
创建带有指定用户身份的队列连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
userName | 调用者的用户名
password | 调用者的密码
return | 新建的队列连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建队列连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createQueueConnection

QueueConnection createQueueConnection(String userName,
                                      String password)
                                      throws JMSException
Creates a queue connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created queue connection
Throws:
JMSException - if the JMS provider fails to create the queue connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QueueReceiver (Java EE 5)

javax.jms
Interface QueueReceiver

All Superinterfaces:
MessageConsumer
public interface QueueReceiver
extends MessageConsumer

Implements: MessageConsumer

客户端使用 QueueReceiver 对象接收已传送到某个队列的消息。

尽管相同队列可以有多个 QueueReceiver，但 JMS API 没有定义在 QueueReceiver 之间分布消息的方式。

如果 QueueReceiver 指定了消息选择器，则未选择的消息将保留在队列中。按照定义，消息选择器允许 QueueReceiver 跳过消息。这意味着当最终读取跳过的消息时，读取的总顺序不会保持每个消息生成方定义的部分顺序。只有没有消息选择器的 QueueReceiver 会按消息生成方顺序读取消息。

创建 MessageConsumer 所提供的功能与创建 QueueReceiver 所提供的功能相同。创建新代码时建议使用 MessageConsumer 对象。提供 QueueReceiver 的目的是支持现有代码。

version
en
1.1 February 2, 2002
See also createConsumer(Destination, String), createConsumer(Destination), createReceiver(Queue, String), createReceiver(Queue), javax.jms.MessageConsumer
英文文档：

A client uses a QueueReceiver object to receive messages that have been delivered to a queue.

Although it is possible to have multiple QueueReceivers for the same queue, the JMS API does not define how messages are distributed between the QueueReceivers.

If a QueueReceiver specifies a message selector, the messages that are not selected remain on the queue. By definition, a message selector allows a QueueReceiver to skip messages. This means that when the skipped messages are eventually read, the total ordering of the reads does not retain the partial order defined by each message producer. Only QueueReceivers without a message selector will read messages in message producer order.

Creating a MessageConsumer provides the same features as creating a QueueReceiver. A MessageConsumer object is recommended for creating new code. The QueueReceiver is provided to support existing code.

Version:
1.1 February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createConsumer(Destination, String),
Session.createConsumer(Destination),
QueueSession.createReceiver(Queue, String),
QueueSession.createReceiver(Queue),
MessageConsumer

Method Summary
 Queue getQueue()
Gets the Queue associated with this queue receiver.
Methods inherited from interface javax.jms.MessageConsumer
close, getMessageListener, getMessageSelector, receive, receive, receiveNoWait, setMessageListener

Method Detail

public Queue getQueue() throws JMSException
获取与此队列接收者关联的 Queue。
return | 此接收者的 Queue
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此队列接收者的队列。
英文文档：

getQueue

Queue getQueue()
               throws JMSException
Gets the Queue associated with this queue receiver.

Returns:
this receiver's Queue
Throws:
JMSException - if the JMS provider fails to get the queue for this queue receiver due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QueueSender (Java EE 5)

javax.jms
Interface QueueSender

All Superinterfaces:
MessageProducer
public interface QueueSender
extends MessageProducer

Implements: MessageProducer

客户端使用 QueueSender 对象将消息发送给队列。

通常，Queue 是在创建 QueueSender 时指定的。在这种情况下，尝试使用未标识的 QueueSender 的 send 方法将抛出 java.lang.UnsupportedOperationException。

如果使用未标识的 Queue 创建 QueueSender，则尝试使用假定 Queue 已标识的 send 方法将抛出 java.lang.UnsupportedOperationException。

在执行其 send 方法期间，客户端内的其他线程不得更改消息。如果修改了消息，则 send 的结果是不确定的。

消息发送后，客户端可以保留并修该它，而不会影响已经发送的消息。同一个消息对象可以被发送多次。

以下消息头作为发送消息的一部分设置：JMSDestination、JMSDeliveryMode、JMSExpiration、JMSPriority、JMSMessageID 和 JMSTimeStamp。发送消息时，忽略这些消息头的值。send 完成后，这些消息头保持发送该消息的方法指定的值。如果通过 MessageProducer.setDisableMessageID 或 MessageProducer.setDisableMessageTimestamp 方法显式禁用了这些消息头的该设置，则 send 方法可以不设置 JMSMessageID 和 JMSTimeStamp。

创建 MessageProducer 所提供的功能与创建 QueueSender 所提供的功能相同。创建新代码时建议使用 MessageProducer 对象。提供 QueueSender 的目的是支持现有代码。

version
en
1.1 - February 2, 2002
See also javax.jms.MessageProducer, createProducer(Destination), createSender(Queue)
英文文档：

A client uses a QueueSender object to send messages to a queue.

Normally, the Queue is specified when a QueueSender is created. In this case, an attempt to use the send methods for an unidentified QueueSender will throw a java.lang.UnsupportedOperationException.

If the QueueSender is created with an unidentified Queue, an attempt to use the send methods that assume that the Queue has been identified will throw a java.lang.UnsupportedOperationException.

During the execution of its send method, a message must not be changed by other threads within the client. If the message is modified, the result of the send is undefined.

After sending a message, a client may retain and modify it without affecting the message that has been sent. The same message object may be sent multiple times.

The following message headers are set as part of sending a message: JMSDestination, JMSDeliveryMode, JMSExpiration, JMSPriority, JMSMessageID and JMSTimeStamp. When the message is sent, the values of these headers are ignored. After the completion of the send, the headers hold the values specified by the method sending the message. It is possible for the send method not to set JMSMessageID and JMSTimeStamp if the setting of these headers is explicitly disabled by the MessageProducer.setDisableMessageID or MessageProducer.setDisableMessageTimestamp method.

Creating a MessageProducer provides the same features as creating a QueueSender. A MessageProducer object is recommended when creating new code. The QueueSender is provided to support existing code.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
MessageProducer, Session.createProducer(Destination), QueueSession.createSender(Queue)

Method Summary
Queue | getQueue() Gets the queue associated with this QueueSender.
void | send(Message message) Sends a message to the queue.
void | send(Message message, int deliveryMode, int priority, long timeToLive) Sends a message to the queue, specifying delivery mode, priority, and time to live.
void | send(Queue queue, Message message) Sends a message to a queue for an unidentified message producer.
void | send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) Sends a message to a queue for an unidentified message producer, specifying delivery mode, priority and time to live.
Methods inherited from interface javax.jms.MessageProducer
close, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive

Method Detail

public Queue getQueue() throws JMSException
获取与此 QueueSender 关联的队列。
return | 此发送者的队列
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此 QueueSender 的队列。
英文文档：

getQueue

Queue getQueue()
               throws JMSException
Gets the queue associated with this QueueSender.

Returns:
this sender's queue
Throws:
JMSException - if the JMS provider fails to get the queue for this QueueSender due to some internal error.

public void send(Message message) throws JMSException
将消息发送到队列。使用 QueueSender 的默认传送模式、优先级和生存时间。
message | 要发送的消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与带有无效队列的 QueueSender 一起使用。
Throws | UnsupportedOperationException: 如果客户端将此方法与在创建时未指定队列的 QueueSender 一起使用。
See also | getDeliveryMode(), getTimeToLive(), getPriority()
英文文档：

send

void send(Message message)
          throws JMSException
Sends a message to the queue. Uses the QueueSender's default delivery mode, priority, and time to live.

Specified by:
send in interface MessageProducer
Parameters:
message - the message to send
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with a QueueSender with an invalid queue.
UnsupportedOperationException - if a client uses this method with a QueueSender that did not specify a queue at creation time.
See Also:
MessageProducer.getDeliveryMode(),
MessageProducer.getTimeToLive(),
MessageProducer.getPriority()

public void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
将消息发送到队列，指定传送模式、优先级和生存时间。
message | 要发送的消息
deliveryMode | 要使用的传送模式
priority | 此消息的优先级
timeToLive | 消息的生命周期（以毫秒为单位）
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与带有无效队列的 QueueSender 一起使用。
Throws | UnsupportedOperationException: 如果客户端将此方法与在创建时未指定队列的 QueueSender 一起使用。
英文文档：

send

void send(Message message,
          int deliveryMode,
          int priority,
          long timeToLive)
          throws JMSException
Sends a message to the queue, specifying delivery mode, priority, and time to live.

Specified by:
send in interface MessageProducer
Parameters:
message - the message to send
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message's lifetime (in milliseconds)
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with a QueueSender with an invalid queue.
UnsupportedOperationException - if a client uses this method with a QueueSender that did not specify a queue at creation time.
See Also:
Session.createProducer(javax.jms.Destination)

public void send(Queue queue, Message message) throws JMSException
将消息发送到未标识的消息生成方的队列。使用 QueueSender 的默认传送模式、优先级和生存时间。

通常，在创建时为消息生成方分配一个队列；但是，JMS API 也支持未标识的消息生成方，这需要在每次发送消息时提供队列。

queue | 要将此消息发送到的队列
message | 要发送的消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与无效队列一起使用。
See also | getDeliveryMode(), getTimeToLive(), getPriority()
英文文档：

send

void send(Queue queue,
          Message message)
          throws JMSException
Sends a message to a queue for an unidentified message producer. Uses the QueueSender's default delivery mode, priority, and time to live.

Typically, a message producer is assigned a queue at creation time; however, the JMS API also supports unidentified message producers, which require that the queue be supplied every time a message is sent.

Parameters:
queue - the queue to send this message to
message - the message to send
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid queue.
See Also:
MessageProducer.getDeliveryMode(),
MessageProducer.getTimeToLive(),
MessageProducer.getPriority()

public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
将消息发送到未标识的消息生成方的队列，指定传送模式、优先级和生存时间。

通常，在创建时为消息生成方分配一个队列；但是，JMS API 也支持未标识的消息生成方，这需要在每次发送消息时提供队列。

queue | 要将此消息发送到的队列
message | 要发送的消息
deliveryMode | 要使用的传送模式
priority | 此消息的优先级
timeToLive | 消息的生命周期（以毫秒为单位）
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发送消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与无效队列一起使用。
英文文档：

send

void send(Queue queue,
          Message message,
          int deliveryMode,
          int priority,
          long timeToLive)
          throws JMSException
Sends a message to a queue for an unidentified message producer, specifying delivery mode, priority and time to live.

Typically, a message producer is assigned a queue at creation time; however, the JMS API also supports unidentified message producers, which require that the queue be supplied every time a message is sent.

Parameters:
queue - the queue to send this message to
message - the message to send
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message's lifetime (in milliseconds)
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid queue.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QueueSession (Java EE 5)

javax.jms
Interface QueueSession

All Superinterfaces:
Runnable, Session
public interface QueueSession
extends Session

Implements: Session

QueueSession 对象提供了创建 QueueReceiver、QueueSender、QueueBrowser 和 TemporaryQueue 对象的方法。

如果有些消息已被接收但在 QueueSession 终止时尚未得到确认，则这些消息将会保留，并在使用方下次访问该队列时重新传送。

QueueSession 用于创建特定于点对点的对象。一般情况下，使用 Session 对象。QueueSession 用于支持现有代码。使用 Session 对象可简化编程模型，并允许跨两个消息传送域使用事务。

不能使用 QueueSession 创建特定于发布/订阅域的对象。下列方法继承自 Session，但如果在 QueueSession 中使用它们，则必定抛出 IllegalStateException：

  • createDurableSubscriber
  • createTemporaryTopic
  • createTopic
  • unsubscribe
version
en
1.1 - April 2, 2002
See also javax.jms.Session, createQueueSession(boolean, int), getQueueSession()
英文文档：

A QueueSession object provides methods for creating QueueReceiver, QueueSender, QueueBrowser, and TemporaryQueue objects.

If there are messages that have been received but not acknowledged when a QueueSession terminates, these messages will be retained and redelivered when a consumer next accesses the queue.

A QueueSession is used for creating Point-to-Point specific objects. In general, use the Session object. The QueueSession is used to support existing code. Using the Session object simplifies the programming model, and allows transactions to be used across the two messaging domains.

A QueueSession cannot be used to create objects specific to the publish/subscribe domain. The following methods inherit from Session, but must throw an IllegalStateException if they are used from QueueSession:

  • createDurableSubscriber
  • createTemporaryTopic
  • createTopic
  • unsubscribe

Version:
1.1 - April 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session, QueueConnection.createQueueSession(boolean, int), XAQueueSession.getQueueSession()

Field Summary
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
Method Summary
QueueBrowser | createBrowser(Queue queue) Creates a QueueBrowser object to peek at the messages on the specified queue.
QueueBrowser | createBrowser(Queue queue, String messageSelector) Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
Queue | createQueue(String queueName) Creates a queue identity given a Queue name.
QueueReceiver | createReceiver(Queue queue) Creates a QueueReceiver object to receive messages from the specified queue.
QueueReceiver | createReceiver(Queue queue, String messageSelector) Creates a QueueReceiver object to receive messages from the specified queue using a message selector.
QueueSender | createSender(Queue queue) Creates a QueueSender object to send messages to the specified queue.
TemporaryQueue | createTemporaryQueue() Creates a TemporaryQueue object.
Methods inherited from interface javax.jms.Session
close, commit, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createStreamMessage, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, getTransacted, recover, rollback, run, setMessageListener, unsubscribe

Method Detail

public Queue createQueue(String queueName) throws JMSException
创建给定 Queue 名称的队列身份。

此工具供某些特殊情况使用，这些情况下客户端需要动态操作队列身份。它允许创建具有特定于提供者的名称的队列身份。依赖于此能力的客户端是不可移植的。

注意，此方法不用于创建物理队列。物理创建队列是一项管理任务，不应由 JMS API 发起。有一个例外是创建临时队列，它可以使用 createTemporaryQueue 方法实现。

queueName | 此 Queue 的名称
return | 具有给定名称的 Queue
Throws | JMSException: 如果会话由于某个内部错误无法创建队列。
英文文档：

createQueue

Queue createQueue(String queueName)
                  throws JMSException
Creates a queue identity given a Queue name.

This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.

Specified by:
createQueue in interface Session
Parameters:
queueName - the name of this Queue
Returns:
a Queue with the given name
Throws:
JMSException - if the session fails to create a queue due to some internal error.

public QueueReceiver createReceiver(Queue queue) throws JMSException
创建 QueueReceiver 对象从指定队列接收消息。
queue | 要访问的 Queue
Throws | JMSException: 如果会话由于某个内部错误无法创建接收者。
Throws | InvalidDestinationException: 如果指定了无效的队列。
英文文档：

createReceiver

QueueReceiver createReceiver(Queue queue)
                             throws JMSException
Creates a QueueReceiver object to receive messages from the specified queue.

Parameters:
queue - the Queue to access
Throws:
JMSException - if the session fails to create a receiver due to some internal error.
InvalidDestinationException - if an invalid queue is specified.

public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
创建 QueueReceiver 对象从指定队列使用消息选择器接收消息。
queue | 要访问的 Queue
messageSelector | 仅传送属性与消息选择器表达式相匹配的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
Throws | JMSException: 如果会话由于某个内部错误无法创建接收者。
Throws | InvalidDestinationException: 如果指定了无效的队列。
Throws | InvalidSelectorException: 如果消息选择器无效。
英文文档：

createReceiver

QueueReceiver createReceiver(Queue queue,
                             String messageSelector)
                             throws JMSException
Creates a QueueReceiver object to receive messages from the specified queue using a message selector.

Parameters:
queue - the Queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a receiver due to some internal error.
InvalidDestinationException - if an invalid queue is specified.
InvalidSelectorException - if the message selector is invalid.

public QueueSender createSender(Queue queue) throws JMSException
创建 QueueSender 对象以将消息发送到指定队列。
queue | 要访问的 Queue；如果这是未标识的生成方，则为 null
Throws | JMSException: 如果会话由于某个内部错误无法创建发送者。
Throws | InvalidDestinationException: 如果指定了无效的队列。
英文文档：

createSender

QueueSender createSender(Queue queue)
                         throws JMSException
Creates a QueueSender object to send messages to the specified queue.

Parameters:
queue - the Queue to access, or null if this is an unidentified producer
Throws:
JMSException - if the session fails to create a sender due to some internal error.
InvalidDestinationException - if an invalid queue is specified.

public QueueBrowser createBrowser(Queue queue) throws JMSException
创建 QueueBrowser 对象以查看指定队列上的消息。
queue | 要访问的 Queue
Throws | JMSException: 如果会话由于某个内部错误无法创建浏览器。
Throws | InvalidDestinationException: 如果指定了无效的队列。
英文文档：

createBrowser

QueueBrowser createBrowser(Queue queue)
                           throws JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue.

Specified by:
createBrowser in interface Session
Parameters:
queue - the Queue to access
Throws:
JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid queue is specified.

public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
创建 QueueBrowser 对象以使用消息选择器查看指定队列上的消息。
queue | 要访问的 Queue
messageSelector | 仅传送属性与消息选择器表达式相匹配的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
Throws | JMSException: 如果会话由于某个内部错误无法创建浏览器。
Throws | InvalidDestinationException: 如果指定了无效的队列。
Throws | InvalidSelectorException: 如果消息选择器无效。
英文文档：

createBrowser

QueueBrowser createBrowser(Queue queue,
                           String messageSelector)
                           throws JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.

Specified by:
createBrowser in interface Session
Parameters:
queue - the Queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid queue is specified.
InvalidSelectorException - if the message selector is invalid.

public TemporaryQueue createTemporaryQueue() throws JMSException
创建 TemporaryQueue 对象。其生命周期将是 QueueConnection 的生命周期，除非提前删除该对象。
return | 临时队列身份
Throws | JMSException: 如果会话由于某个内部错误无法创建临时队列。
英文文档：

createTemporaryQueue

TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Creates a TemporaryQueue object. Its lifetime will be that of the QueueConnection unless it is deleted earlier.

Specified by:
createTemporaryQueue in interface Session
Returns:
a temporary queue identity
Throws:
JMSException - if the session fails to create a temporary queue due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServerSession (Java EE 5)

javax.jms
Interface ServerSession

public interface ServerSession

ServerSession 对象是应用服务器对象，服务器使用该对象将线程与 JMS 会话关联（可选）。

ServerSession 实现两个方法：

  • getSession - 返回 ServerSession 的 JMS 会话。
  • start - 开始执行 ServerSession 线程，并导致 JMS 会话的 run 方法执行。

JMS 提供者实现的 ConnectionConsumer 使用 ServerSession 处理一个或多个到达的消息。它通过从 ConnectionConsumer 的 ServerSessionPool 获取 ServerSession；获取 ServerSession 的 JMS 会话；使用消息加载 JMS 会话；然后启动 ServerSession 做到这一点。

在大多数情况下，ServerSession 会将它提供的某个对象注册为 ServerSession 的线程运行对象。ServerSession 的 start 方法将调用线程的 start 方法，从而启动新线程，然后从该线程调用 ServerSession 的运行对象的 run 方法。此对象将执行一些内务处理，然后调用 Session 的 run 方法。当 run 返回时，ServerSession 的运行对象可能将 ServerSession 返回到 ServerSessionPool，然后再次开始循环。

注意，JMS API 没有架构 ConnectionConsumer 使用消息加载 Session 的方式。由于 ConnectionConsumer 和 Session 都是由相同的 JMS 提供者实现的，因此它们可以使用专有机制来完成加载。

version
en
1.0 - 9 March 1998
See also javax.jms.ServerSessionPool, javax.jms.ConnectionConsumer
英文文档：

A ServerSession object is an application server object that is used by a server to associate a thread with a JMS session (optional).

A ServerSession implements two methods:

  • getSession - returns the ServerSession's JMS session.
  • start - starts the execution of the ServerSession thread and results in the execution of the JMS session's run method.

A ConnectionConsumer implemented by a JMS provider uses a ServerSession to process one or more messages that have arrived. It does this by getting a ServerSession from the ConnectionConsumer's ServerSessionPool; getting the ServerSession's JMS session; loading it with the messages; and then starting the ServerSession.

In most cases the ServerSession will register some object it provides as the ServerSession's thread run object. The ServerSession's start method will call the thread's start method, which will start the new thread, and from it, call the run method of the ServerSession's run object. This object will do some housekeeping and then call the Session's run method. When run returns, the ServerSession's run object can return the ServerSession to the ServerSessionPool, and the cycle starts again.

Note that the JMS API does not architect how the ConnectionConsumer loads the Session with messages. Since both the ConnectionConsumer and Session are implemented by the same JMS provider, they can accomplish the load using a private mechanism.

Version:
1.0 - 9 March 1998
Author:
Mark Hapner, Rich Burridge
See Also:
ServerSessionPool, ConnectionConsumer

Method Summary
Session | getSession() Return the ServerSession's Session.
void | start() Cause the Session's run method to be called to process messages that were just assigned to it.

Method Detail

public Session getSession() throws JMSException
返回 ServerSession 的 Session。此会话必须是由将消息分派给它的那个 Connection 创建的 Session。提供者将一个或多个消息分配给 Session，然后调用 ServerSession 中的 start。
return | 服务器会话的会话
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取与此 ServerSession 关联的会话。
英文文档：

getSession

Session getSession()
                   throws JMSException
Return the ServerSession's Session. This must be a Session created by the same Connection that will be dispatching messages to it. The provider will assign one or more messages to the Session and then call start on the ServerSession.

Returns:
the server session's session
Throws:
JMSException - if the JMS provider fails to get the associated session for this ServerSession due to some internal error.

public void start() throws JMSException
导致调用 Session 的 run 方法来处理刚分配给它的消息。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法启动服务器会话来处理消息。
英文文档：

start

void start()
           throws JMSException
Cause the Session's run method to be called to process messages that were just assigned to it.

Throws:
JMSException - if the JMS provider fails to start the server session to process messages due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServerSessionPool (Java EE 5)

javax.jms
Interface ServerSessionPool

public interface ServerSessionPool

ServerSessionPool 对象是由应用服务器实现的对象，它提供用于处理 ConnectionConsumer 消息的 ServerSession 对象的池（可选）。

该对象唯一的方法是 getServerSession。JMS API 没有架构实现该池的方式。它可以是 ServerSession 对象的静态池，它也可能使用复杂算法根据需要动态创建 ServerSession 对象。

如果 ServerSessionPool 中没有 ServerSession 对象，则 getServerSession 调用可能会阻塞。如果 ConnectionConsumer 被阻塞，则在最终返回 ServerSession 之前，它不会传送新消息。

version
en
1.0 - 9 March 1998
See also javax.jms.ServerSession
英文文档：

A ServerSessionPool object is an object implemented by an application server to provide a pool of ServerSession objects for processing the messages of a ConnectionConsumer (optional).

Its only method is getServerSession. The JMS API does not architect how the pool is implemented. It could be a static pool of ServerSession objects, or it could use a sophisticated algorithm to dynamically create ServerSession objects as needed.

If the ServerSessionPool is out of ServerSession objects, the getServerSession call may block. If a ConnectionConsumer is blocked, it cannot deliver new messages until a ServerSession is eventually returned.

Version:
1.0 - 9 March 1998
Author:
Mark Hapner, Rich Burridge
See Also:
ServerSession

Method Summary
 ServerSession getServerSession()
Return a server session from the pool.

Method Detail

public ServerSession getServerSession() throws JMSException
返回池中的服务器会话。
return | 池中的服务器会话
Throws | JMSException: 如果应用服务器无法返回其服务器会话池中的 ServerSession。
英文文档：

getServerSession

ServerSession getServerSession()
                               throws JMSException
Return a server session from the pool.

Returns:
a server session from the pool
Throws:
JMSException - if an application server fails to return a ServerSession out of its server session pool.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Session (Java EE 5)

javax.jms
Interface Session

All Superinterfaces:
Runnable
All Known Subinterfaces:
QueueSession, TopicSession, XAQueueSession, XASession, XATopicSession
public interface Session
extends Runnable

Implements: Runnable
Implemented by: QueueSession, TopicSession, XASession

Session 对象是生产和使用消息的单线程上下文。尽管它可以在 Java 虚拟机 (JVM) 外部分配提供者资源，但它仍被认为是一个轻量级 JMS 对象。

会话有几个用途：

  • 它是其消息生成方和使用方的工厂。
  • 它提供提供者最优化的消息工厂。
  • 它是 TemporaryTopics 和 TemporaryQueues 的工厂。
  • 它为需要动态操作特定于提供者的目的地名称的那些客户端提供创建 Queue 或 Topic 对象的方法。
  • 它支持一组事务将跨生成方和使用方的工作组合成原子单元。
  • 它为自己使用的消息和生产的消息定义串行顺序。
  • 它保留自己使用的消息，直到这些消息得到确认为止。
  • 它序列化向其消息使用方注册的消息侦听器的执行。
  • 它是 QueueBrowsers 的工厂。

一个会话可以创建并服务于多个消息生成方和使用方。

一个通常的用途是在同步的 MessageConsumer 上存在线程阻塞，直到消息到达。然后，该线程可以使用 Session 的一个或多个 MessageProducer。

如果客户端希望一个线程生产消息，而其他线程使用消息，则客户端应为其生产线程使用单独的会话。

在启动连接后，任何具有一个或多个已注册消息侦听器的会话都专门用于将消息传送给它的控制线程。客户端代码在其他控制线程中使用此会话或其任何组成对象都是错误的。此规则的唯一例外是使用会话或连接 close 方法。

大多数客户端应该可以轻松地将其工作自然划分到会话中。此模型使客户端可以轻松启动，并随着它们并发需要的增加逐步增加消息处理复杂性。

close 方法是在其他线程中正在执行其他某个会话方法时可以调用的唯一会话方法。

可以将会话指定为事务性的。每个事务性会话都支持一组事务。每个事务都将一组发送的消息和一组接收的消息分组成一个工作的原子单元。实际上，事务将会话的输入消息流和输出消息流组织成一系列原子单元。当事务提交时，其输入原子单元会得到确认，而其相关的输出原子单元会被发送。如果发生事务回滚，则该事务发送的消息会被销毁，而会话的输入会自动恢复。

事务输入和输出单元的内容只是那些在该会话当前事务内已生产和使用的消息。

使用其会话的 commit 方法或其会话的 rollback 方法来完成事务。完成会话的当前事务后，会自动开始下一个事务。因此，事务性会话始终有一个在其中执行工作的当前事务。

Java Transaction Service (JTS) 或其他某个事务监视器可用于将会话的事务与其他资源（数据库、其他 JMS 会话等）上的事务相结合。因为 Java 分布式事务是通过 Java Transaction API (JTA) 控制的，所以禁止在此上下文中使用会话的 commit 和 rollback 方法。

JMS API 不要求支持 JTA；但是，它确实定义了提供者提供此支持的方式。

尽管 JMS 客户端也可以直接处理分布式事务，但不太可能有很多 JMS 客户端会这样做。 在 JMS API 中对 JTA 的支持是为要将 JMS API 集成到其应用服务器产品的系统供应商准备的。

version
en
1.1 February 2, 2002
See also javax.jms.QueueSession, javax.jms.TopicSession, javax.jms.XASession
英文文档：

A Session object is a single-threaded context for producing and consuming messages. Although it may allocate provider resources outside the Java virtual machine (JVM), it is considered a lightweight JMS object.

A session serves several purposes:

  • It is a factory for its message producers and consumers.
  • It supplies provider-optimized message factories.
  • It is a factory for TemporaryTopics and TemporaryQueues.
  • It provides a way to create Queue or Topic objects for those clients that need to dynamically manipulate provider-specific destination names.
  • It supports a single series of transactions that combine work spanning its producers and consumers into atomic units.
  • It defines a serial order for the messages it consumes and the messages it produces.
  • It retains messages it consumes until they have been acknowledged.
  • It serializes execution of message listeners registered with its message consumers.
  • It is a factory for QueueBrowsers.

A session can create and service multiple message producers and consumers.

One typical use is to have a thread block on a synchronous MessageConsumer until a message arrives. The thread may then use one or more of the Session's MessageProducers.

If a client desires to have one thread produce messages while others consume them, the client should use a separate session for its producing thread.

Once a connection has been started, any session with one or more registered message listeners is dedicated to the thread of control that delivers messages to it. It is erroneous for client code to use this session or any of its constituent objects from another thread of control. The only exception to this rule is the use of the session or connection close method.

It should be easy for most clients to partition their work naturally into sessions. This model allows clients to start simply and incrementally add message processing complexity as their need for concurrency grows.

The close method is the only session method that can be called while some other session method is being executed in another thread.

A session may be specified as transacted. Each transacted session supports a single series of transactions. Each transaction groups a set of message sends and a set of message receives into an atomic unit of work. In effect, transactions organize a session's input message stream and output message stream into series of atomic units. When a transaction commits, its atomic unit of input is acknowledged and its associated atomic unit of output is sent. If a transaction rollback is done, the transaction's sent messages are destroyed and the session's input is automatically recovered.

The content of a transaction's input and output units is simply those messages that have been produced and consumed within the session's current transaction.

A transaction is completed using either its session's commit method or its session's rollback method. The completion of a session's current transaction automatically begins the next. The result is that a transacted session always has a current transaction within which its work is done.

The Java Transaction Service (JTS) or some other transaction monitor may be used to combine a session's transaction with transactions on other resources (databases, other JMS sessions, etc.). Since Java distributed transactions are controlled via the Java Transaction API (JTA), use of the session's commit and rollback methods in this context is prohibited.

The JMS API does not require support for JTA; however, it does define how a provider supplies this support.

Although it is also possible for a JMS client to handle distributed transactions directly, it is unlikely that many JMS clients will do this. Support for JTA in the JMS API is targeted at systems vendors who will be integrating the JMS API into their application server products.

Version:
1.1 February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
QueueSession, TopicSession, XASession

Field Summary
static int | AUTO_ACKNOWLEDGE With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully returned from a call to receive or when the message listener the session has called to process the message successfully returns.
static int | CLIENT_ACKNOWLEDGE With this acknowledgment mode, the client acknowledges a consumed message by calling the message's acknowledge method.
static int | DUPS_OK_ACKNOWLEDGE This acknowledgment mode instructs the session to lazily acknowledge the delivery of messages.
static int | SESSION_TRANSACTED This value is returned from the method getAcknowledgeMode if the session is transacted.
Method Summary
void | close() Closes the session.
void | commit() Commits all messages done in this transaction and releases any locks currently held.
QueueBrowser | createBrowser(Queue queue) Creates a QueueBrowser object to peek at the messages on the specified queue.
QueueBrowser | createBrowser(Queue queue, String messageSelector) Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
BytesMessage | createBytesMessage() Creates a BytesMessage object.
MessageConsumer | createConsumer(Destination destination) Creates a MessageConsumer for the specified destination.
MessageConsumer | createConsumer(Destination destination, String messageSelector) Creates a MessageConsumer for the specified destination, using a message selector.
MessageConsumer | createConsumer(Destination destination, String messageSelector, boolean NoLocal) Creates MessageConsumer for the specified destination, using a message selector.
TopicSubscriber | createDurableSubscriber(Topic topic, String name) Creates a durable subscriber to the specified topic.
TopicSubscriber | createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) Creates a durable subscriber to the specified topic, using a message selector and specifying whether messages published by its own connection should be delivered to it.
MapMessage | createMapMessage() Creates a MapMessage object.
Message | createMessage() Creates a Message object.
ObjectMessage | createObjectMessage() Creates an ObjectMessage object.
ObjectMessage | createObjectMessage(Serializable object) Creates an initialized ObjectMessage object.
MessageProducer | createProducer(Destination destination) Creates a MessageProducer to send messages to the specified destination.
Queue | createQueue(String queueName) Creates a queue identity given a Queue name.
StreamMessage | createStreamMessage() Creates a StreamMessage object.
TemporaryQueue | createTemporaryQueue() Creates a TemporaryQueue object.
TemporaryTopic | createTemporaryTopic() Creates a TemporaryTopic object.
TextMessage | createTextMessage() Creates a TextMessage object.
TextMessage | createTextMessage(String text) Creates an initialized TextMessage object.
Topic | createTopic(String topicName) Creates a topic identity given a Topic name.
int | getAcknowledgeMode() Returns the acknowledgement mode of the session.
MessageListener | getMessageListener() Returns the session's distinguished message listener (optional).
boolean | getTransacted() Indicates whether the session is in transacted mode.
void | recover() Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message.
void | rollback() Rolls back any messages done in this transaction and releases any locks currently held.
void | run() Optional operation, intended to be used only by Application Servers, not by ordinary JMS clients.
void | setMessageListener(MessageListener listener) Sets the session's distinguished message listener (optional).
void | unsubscribe(String name) Unsubscribes a durable subscription that has been created by a client.

Field Detail

英文文档：

AUTO_ACKNOWLEDGE

static final int AUTO_ACKNOWLEDGE
With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully returned from a call to receive or when the message listener the session has called to process the message successfully returns.

See Also:
Constant Field Values

英文文档：

CLIENT_ACKNOWLEDGE

static final int CLIENT_ACKNOWLEDGE
With this acknowledgment mode, the client acknowledges a consumed message by calling the message's acknowledge method. Acknowledging a consumed message acknowledges all messages that the session has consumed.

When client acknowledgment mode is used, a client may build up a large number of unacknowledged messages while attempting to process them. A JMS provider should provide administrators with a way to limit client overrun so that clients are not driven to resource exhaustion and ensuing failure when some resource they are using is temporarily blocked.

See Also:
Message.acknowledge(), Constant Field Values

英文文档：

DUPS_OK_ACKNOWLEDGE

static final int DUPS_OK_ACKNOWLEDGE
This acknowledgment mode instructs the session to lazily acknowledge the delivery of messages. This is likely to result in the delivery of some duplicate messages if the JMS provider fails, so it should only be used by consumers that can tolerate duplicate messages. Use of this mode can reduce session overhead by minimizing the work the session does to prevent duplicates.

See Also:
Constant Field Values

英文文档：

SESSION_TRANSACTED

static final int SESSION_TRANSACTED
This value is returned from the method getAcknowledgeMode if the session is transacted. If a Session is transacted, the acknowledgement mode is ignored.

See Also:
Constant Field Values
Method Detail

public BytesMessage createBytesMessage() throws JMSException
创建 BytesMessage 对象。BytesMessage 对象用于发送包含未解释字节流的消息。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createBytesMessage

BytesMessage createBytesMessage()
                                throws JMSException
Creates a BytesMessage object. A BytesMessage object is used to send a message containing a stream of uninterpreted bytes.

Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public MapMessage createMapMessage() throws JMSException
创建 MapMessage 对象。MapMessage 对象用于发送一组自定义的名称-值对，其中名称是 String 对象，而值是 Java 编程语言中的原始值。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createMapMessage

MapMessage createMapMessage()
                            throws JMSException
Creates a MapMessage object. A MapMessage object is used to send a self-defining set of name-value pairs, where names are String objects and values are primitive values in the Java programming language.

Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public Message createMessage() throws JMSException
创建 Message 对象。Message 接口是所有 JMS 消息的根接口。 Message 对象保留所有标准消息头信息。如果仅包含头信息的消息便已足够，则可以发送该对象。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createMessage

Message createMessage()
                      throws JMSException
Creates a Message object. The Message interface is the root interface of all JMS messages. A Message object holds all the standard message header information. It can be sent when a message containing only header information is sufficient.

Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public ObjectMessage createObjectMessage() throws JMSException
创建 ObjectMessage 对象。 ObjectMessage 对象用于发送包含可序列化 Java 对象的消息。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createObjectMessage

ObjectMessage createObjectMessage()
                                  throws JMSException
Creates an ObjectMessage object. An ObjectMessage object is used to send a message that contains a serializable Java object.

Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public ObjectMessage createObjectMessage(java.io.Serializable object) throws JMSException
创建已初始化的 ObjectMessage 对象。 ObjectMessage 对象用于发送包含可序列化 Java 对象的消息。
object | 要用于初始化此消息的对象
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createObjectMessage

ObjectMessage createObjectMessage(Serializable object)
                                  throws JMSException
Creates an initialized ObjectMessage object. An ObjectMessage object is used to send a message that contains a serializable Java object.

Parameters:
object - the object to use to initialize this message
Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public StreamMessage createStreamMessage() throws JMSException
创建 StreamMessage 对象。 StreamMessage 对象用于发送 Java 编程语言中自定义的原始值的流。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createStreamMessage

StreamMessage createStreamMessage()
                                  throws JMSException
Creates a StreamMessage object. A StreamMessage object is used to send a self-defining stream of primitive values in the Java programming language.

Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public TextMessage createTextMessage() throws JMSException
创建 TextMessage 对象。TextMessage 对象用于发送包含 String 对象的消息。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createTextMessage

TextMessage createTextMessage()
                              throws JMSException
Creates a TextMessage object. A TextMessage object is used to send a message containing a String object.

Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public TextMessage createTextMessage(String text) throws JMSException
创建已初始化的 TextMessage 对象。 TextMessage 对象用于发送包含 String 的消息。
text | 用于初始化此消息的字符串
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建此消息。
英文文档：

createTextMessage

TextMessage createTextMessage(String text)
                              throws JMSException
Creates an initialized TextMessage object. A TextMessage object is used to send a message containing a String.

Parameters:
text - the string used to initialize this message
Throws:
JMSException - if the JMS provider fails to create this message due to some internal error.

public boolean getTransacted() throws JMSException
指示会话是否处于事务性模式。
return | true 如果会话处于事务性模式
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法返回事务模式。
英文文档：

getTransacted

boolean getTransacted()
                      throws JMSException
Indicates whether the session is in transacted mode.

Returns:
true if the session is in transacted mode
Throws:
JMSException - if the JMS provider fails to return the transaction mode due to some internal error.

public int getAcknowledgeMode() throws JMSException
返回会话的确认模式。确认模式在创建会话时设置。如果会话是事务性的，则忽略确认模式。
return | 如果会话不是事务性的，则返回该会话的当前确认模式。如果会话是事务性的，则返回 SESSION_TRANSACTED。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法返回确认模式。
since | 1.1
See also | createSession
英文文档：

getAcknowledgeMode

int getAcknowledgeMode()
                       throws JMSException
Returns the acknowledgement mode of the session. The acknowledgement mode is set at the time that the session is created. If the session is transacted, the acknowledgement mode is ignored.

Returns:
If the session is not transacted, returns the current acknowledgement mode for the session. If the session is transacted, returns SESSION_TRANSACTED.
Throws:
JMSException - if the JMS provider fails to return the acknowledgment mode due to some internal error.
Since:
1.1
See Also:
Connection.createSession(boolean, int)

public void commit() throws JMSException
提交此事务中执行的所有消息，并释放当前保持的所有锁。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法提交事务。
Throws | TransactionRolledBackException: 如果在提交过程中，事务由于某个内部错误回滚。
Throws | IllegalStateException: 如果该方法未由事务性会话调用。
英文文档：

commit

void commit()
            throws JMSException
Commits all messages done in this transaction and releases any locks currently held.

Throws:
JMSException - if the JMS provider fails to commit the transaction due to some internal error.
TransactionRolledBackException - if the transaction is rolled back due to some internal error during commit.
IllegalStateException - if the method is not called by a transacted session.

public void rollback() throws JMSException
回滚此事务中执行的任何消息，并释放当前保持的所有锁。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法回滚事务。
Throws | IllegalStateException: 如果该方法未由事务性会话调用。
英文文档：

rollback

void rollback()
              throws JMSException
Rolls back any messages done in this transaction and releases any locks currently held.

Throws:
JMSException - if the JMS provider fails to roll back the transaction due to some internal error.
IllegalStateException - if the method is not called by a transacted session.

public void close() throws JMSException
关闭会话。

由于提供者可能会代表会话分配 JVM 之外的某些资源，因此不需要这些资源时客户端应该关闭它们。 依赖于垃圾收集最终回收这些资源可能不够及时。

无需关闭已关闭会话的生成方和使用方。

此调用将会一直阻塞，直到正在执行的 receive 调用或消息侦听器完成为止。当此会话关闭时，已阻塞的消息使用方 receive 调用返回 null。

关闭事务性会话必定回滚正在执行的事务。

此方法是唯一可并发调用的 Session 方法。

对已关闭会话调用任何其他 Session 方法必定抛出 JMSException.IllegalStateException。关闭已关闭的会话不会抛出异常。

Throws JMSException: 如果 JMS 提供者由于某个内部错误无法关闭此会话。
英文文档：

close

void close()
           throws JMSException
Closes the session.

Since a provider may allocate some resources on behalf of a session outside the JVM, clients should close the resources when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

There is no need to close the producers and consumers of a closed session.

This call will block until a receive call or message listener in progress has completed. A blocked message consumer receive call returns null when this session is closed.

Closing a transacted session must roll back the transaction in progress.

This method is the only Session method that can be called concurrently.

Invoking any other Session method on a closed session must throw a JMSException.IllegalStateException. Closing a closed session must not throw an exception.

Throws:
JMSException - if the JMS provider fails to close the session due to some internal error.

public void recover() throws JMSException
停止此会话中的消息传送，并使用最早的未确认消息重启消息传送。

所有使用方都按串行顺序传送消息。 确认已接收消息将自动确认所有已经传送到客户端的消息。

重启会话将导致会话采取以下操作：

  • 停止消息传送
  • 将所有可能已传送但未确认的消息标记为“重新传送”
  • 重启传送序列，包括所有以前已传送的未确认消息。重新传送的消息不必完全按照其最初的传送顺序传送。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法停止和重启消息传送。
Throws | IllegalStateException: 如果该方法由事务性会话调用。
英文文档：

recover

void recover()
             throws JMSException
Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message.

All consumers deliver messages in a serial order. Acknowledging a received message automatically acknowledges all messages that have been delivered to the client.

Restarting a session causes it to take the following actions:

  • Stop message delivery
  • Mark all messages that might have been delivered but not acknowledged as "redelivered"
  • Restart the delivery sequence including all unacknowledged messages that had been previously delivered. Redelivered messages do not have to be delivered in exactly their original delivery order.

Throws:
JMSException - if the JMS provider fails to stop and restart message delivery due to some internal error.
IllegalStateException - if the method is called by a transacted session.

public MessageListener getMessageListener() throws JMSException
返回会话的标识消息侦听器（可选）。
return | 与此会话关联的消息侦听器
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取消息侦听器。
See also | setMessageListener, javax.jms.ServerSessionPool, javax.jms.ServerSession
英文文档：

getMessageListener

MessageListener getMessageListener()
                                   throws JMSException
Returns the session's distinguished message listener (optional).

Returns:
the message listener associated with this session
Throws:
JMSException - if the JMS provider fails to get the message listener due to an internal error.
See Also:
setMessageListener(javax.jms.MessageListener), ServerSessionPool, ServerSession

public void setMessageListener(MessageListener listener) throws JMSException
设置会话的标识消息侦听器（可选）。

设置标识消息侦听器时，不能使用会话中消息接收的其他形式；但发送消息的所有形式仍得到支持。

这是一个专家级工具，常规 JMS 客户端不使用。

listener | 与此会话关联的消息侦听器
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置消息侦听器。
See also | getMessageListener, javax.jms.ServerSessionPool, javax.jms.ServerSession
英文文档：

setMessageListener

void setMessageListener(MessageListener listener)
                        throws JMSException
Sets the session's distinguished message listener (optional).

When the distinguished message listener is set, no other form of message receipt in the session can be used; however, all forms of sending messages are still supported.

This is an expert facility not used by regular JMS clients.

Parameters:
listener - the message listener to associate with this session
Throws:
JMSException - if the JMS provider fails to set the message listener due to an internal error.
See Also:
getMessageListener(), ServerSessionPool, ServerSession

public void run()
可选操作，仅供 Application Server 使用，普通 JMS 客户端无法使用。
See also javax.jms.ServerSession
英文文档：

run

void run()
Optional operation, intended to be used only by Application Servers, not by ordinary JMS clients.

Specified by:
run in interface Runnable
See Also:
ServerSession

public MessageProducer createProducer(Destination destination) throws JMSException
创建 MessageProducer 以将消息发送到指定目的地。

客户端使用 MessageProducer 对象将消息发送到目的地。由于 Queue 和 Topic 都继承自 Destination，因此它们可以用在 destination 参数中，以创建 MessageProducer 对象。

destination | 要发送到的 Destination；如果这是没有指定目的地的生成方，则为 null。
Throws | JMSException: 如果会话由于某个内部错误无法创建 MessageProducer。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
since | 1.1
英文文档：

createProducer

MessageProducer createProducer(Destination destination)
                               throws JMSException
Creates a MessageProducer to send messages to the specified destination.

A client uses a MessageProducer object to send messages to a destination. Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageProducer object.

Parameters:
destination - the Destination to send to, or null if this is a producer which does not have a specified destination.
Throws:
JMSException - if the session fails to create a MessageProducer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
Since:
1.1

public MessageConsumer createConsumer(Destination destination) throws JMSException
为指定目的地创建 MessageConsumer。 由于 Queue 和 Topic 都继承自 Destination，因此它们可以用在 destination 参数中，以创建 MessageConsumer。
destination | 要访问的 Destination。
Throws | JMSException: 如果会话由于某个内部错误无法创建使用方。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
since | 1.1
英文文档：

createConsumer

MessageConsumer createConsumer(Destination destination)
                               throws JMSException
Creates a MessageConsumer for the specified destination. Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageConsumer.

Parameters:
destination - the Destination to access.
Throws:
JMSException - if the session fails to create a consumer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
Since:
1.1

public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
为指定目的地创建 MessageConsumer，使用消息选择器。 由于 Queue 和 Topic 都继承自 Destination，因此它们可以用在 destination 参数中，以创建 MessageConsumer。

客户端使用 MessageConsumer 对象接收已发送到目的地的消息。

destination | 要访问的 Destination
messageSelector | 仅传送属性 与消息选择器表达式相匹配的消息。值为 null 或 空字符串表示该消息使用方没有消息选择器 。
Throws | JMSException: 如果会话由于某个内部错误无法创建 MessageConsumer。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
Throws | InvalidSelectorException: 如果消息选择器无效。
since | 1.1
英文文档：

createConsumer

MessageConsumer createConsumer(Destination destination,
                               String messageSelector)
                               throws JMSException
Creates a MessageConsumer for the specified destination, using a message selector. Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageConsumer.

A client uses a MessageConsumer object to receive messages that have been sent to a destination.

Parameters:
destination - the Destination to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a MessageConsumer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean NoLocal) throws JMSException
为指定目的地创建 MessageConsumer，使用消息选择器。如果目的地是主题，此方法可以指定是否应将由其自己的连接发布的消息传送给它。

由于 Queue 和 Topic 都继承自 Destination，因此它们可以用在 destination 参数中，以创建 MessageConsumer。

客户端使用 MessageConsumer 对象接收已发布到目的地的消息。

在某些情况下，连接可以既发布又订阅主题。使用方 NoLocal 属性允许使用方禁止传送由其自己的连接发布的消息。 此属性的默认值为 False。作为主题的目的地必须支持 noLocal 值。

destination | 要访问的 Destination
messageSelector | 仅传送属性 与消息选择器表达式相匹配的消息。值为 null 或 空字符串表示该消息使用方没有消息选择器 。
NoLocal | 如果为 true 且目的地是主题，则禁止传送由其自己的连接发布的消息。如果目的地为队列，则不指定 NoLocal 的行为。
Throws | JMSException: 如果会话由于某个内部错误无法创建 MessageConsumer。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
Throws | InvalidSelectorException: 如果消息选择器无效。
since | 1.1
英文文档：

createConsumer

MessageConsumer createConsumer(Destination destination,
                               String messageSelector,
                               boolean NoLocal)
                               throws JMSException
Creates MessageConsumer for the specified destination, using a message selector. This method can specify whether messages published by its own connection should be delivered to it, if the destination is a topic.

Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageConsumer.

A client uses a MessageConsumer object to receive messages that have been published to a destination.

In some cases, a connection may both publish and subscribe to a topic. The consumer NoLocal attribute allows a consumer to inhibit the delivery of messages published by its own connection. The default value for this attribute is False. The noLocal value must be supported by destinations that are topics.

Parameters:
destination - the Destination to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
NoLocal - - if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue.
Throws:
JMSException - if the session fails to create a MessageConsumer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

public Queue createQueue(String queueName) throws JMSException
创建给定 Queue 名称的队列身份。

此工具供某些特殊情况使用，这些情况下客户端需要动态操作队列身份。这允许创建具有特定于提供者的名称的队列身份。依赖于此能力的客户端是不可移植的。

注意，此方法不用于创建物理队列。 物理创建队列是一项管理任务，不应由 JMS API 发起。有一个例外是创建临时队列，它可以使用 createTemporaryQueue 方法实现。

queueName | 此 Queue 的名称
return | 具有给定名称的 Queue
Throws | JMSException: 如果会话由于某个内部错误无法创建队列。
since | 1.1
英文文档：

createQueue

Queue createQueue(String queueName)
                  throws JMSException
Creates a queue identity given a Queue name.

This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.

Parameters:
queueName - the name of this Queue
Returns:
a Queue with the given name
Throws:
JMSException - if the session fails to create a queue due to some internal error.
Since:
1.1

public Topic createTopic(String topicName) throws JMSException
创建给定 Topic 名称的主题身份。

此工具供某些特殊情况使用，这些情况下客户端需要动态操作主题身份。这允许创建具有特定于提供者的名称的主题身份。依赖于此能力的客户端是不可移植的。

注意，此方法不用于创建物理主题。物理创建主题是一项管理任务，不应由 JMS API 发起。有一个例外是创建临时主题，它可以使用 createTemporaryTopic 方法实现。

topicName | 此 Topic 的名称
return | 具有给定名称的 Topic
Throws | JMSException: 如果会话由于某个内部错误无法创建主题。
since | 1.1
英文文档：

createTopic

Topic createTopic(String topicName)
                  throws JMSException
Creates a topic identity given a Topic name.

This facility is provided for the rare cases where clients need to dynamically manipulate topic identity. This allows the creation of a topic identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical topic. The physical creation of topics is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary topics, which is accomplished with the createTemporaryTopic method.

Parameters:
topicName - the name of this Topic
Returns:
a Topic with the given name
Throws:
JMSException - if the session fails to create a topic due to some internal error.
Since:
1.1

public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
创建指定主题的持久订阅者。

如果客户端需要接收所有在主题上发布的消息，包括订阅者处于非活动状态时发布的消息，它使用持久 TopicSubscriber。JMS 提供者保留此持久订阅的记录并确保来自该主题发布者的所有消息能够一直保留，直到它们得到此持久订阅者的确认或消息过期。

具有持久订阅者的会话必须总是提供相同的客户端标识符。此外，每个客户端必须指定一个名称，该名称能够唯一地标识（在客户端标识符内）它所创建的每个持久订阅。一次只有一个会话可以拥有特定持久订阅的 TopicSubscriber。

客户端可以通过创建具有相同名称和新主题和/或消息选择器的持久 TopicSubscriber 来更改现有持久订阅。更改持久订阅者等效于取消订阅（删除）旧的持久订阅，并创建一个新的持久订阅。

在某些情况下，连接可以既发布又订阅主题。订阅者 NoLocal 属性允许订阅者禁止传送由其自己的连接发布的消息。 此属性的默认值为 false。

topic | 要订阅的非临时 Topic
name | 用于标识此订阅的名称
Throws | JMSException: 如果会话由于某个内部错误无法创建订阅者。
Throws | InvalidDestinationException: 如果指定了无效的主题。
since | 1.1
英文文档：

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        String name)
                                        throws JMSException
Creates a durable subscriber to the specified topic.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name that uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection. The default value for this attribute is false.

Parameters:
topic - the non-temporary Topic to subscribe to
name - the name used to identify this subscription
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.
Since:
1.1

public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
创建指定主题的持久订阅者，使用消息选择器并指定是否应将由其自己的连接发布的消息传送给它。

如果客户端需要接收所有在主题上发布的消息，包括订阅者处于非活动状态时发布的消息，它使用持久 TopicSubscriber。JMS 提供者保留此持久订阅的记录并确保来自该主题发布者的所有消息能够一直保留，直到它们得到此持久订阅者的确认或消息过期。

具有持久订阅者的会话必须总是提供相同的客户端标识符。此外，每个客户端必须指定一个名称，该名称能够唯一地标识（在客户端标识符内）它所创建的每个持久订阅。一次只有一个会话可以拥有特定持久订阅的 TopicSubscriber。 非活动持久订阅者是存在但当前没有与之关联的消息使用方的订阅者。

客户端可以通过创建具有相同名称和新主题和/或消息选择器的持久 TopicSubscriber 来更改现有持久订阅。更改持久订阅者等效于取消订阅（删除）旧的持久订阅，并创建一个新的持久订阅。

topic | 要订阅的非临时 Topic
name | 用于标识此订阅的名称
messageSelector | 仅传送属性与消息选择器表达式相匹配的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
noLocal | 如果设置，则禁止传送由其自己的连接发布的消息
Throws | JMSException: 如果会话由于某个内部错误无法创建订阅者。
Throws | InvalidDestinationException: 如果指定了无效的主题。
Throws | InvalidSelectorException: 如果消息选择器无效。
since | 1.1
英文文档：

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        String name,
                                        String messageSelector,
                                        boolean noLocal)
                                        throws JMSException
Creates a durable subscriber to the specified topic, using a message selector and specifying whether messages published by its own connection should be delivered to it.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name which uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription. An inactive durable subscriber is one that exists but does not currently have a message consumer associated with it.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

Parameters:
topic - the non-temporary Topic to subscribe to
name - the name used to identify this subscription
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
noLocal - if set, inhibits the delivery of messages published by its own connection
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

public QueueBrowser createBrowser(Queue queue) throws JMSException
创建 QueueBrowser 对象以查看指定队列上的消息。
queue | 要访问的 queue
Throws | JMSException: 如果会话由于某个内部错误无法创建浏览器。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
since | 1.1
英文文档：

createBrowser

QueueBrowser createBrowser(Queue queue)
                           throws JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue.

Parameters:
queue - the queue to access
Throws:
JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid destination is specified
Since:
1.1

public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
创建 QueueBrowser 对象以查看使用消息选择器的指定队列上的消息。
queue | 要访问的 queue
messageSelector | 仅传送属性 与消息选择器表达式相匹配的消息。值为 null 或 空字符串表示该消息使用方没有消息选择器 。
Throws | JMSException: 如果会话由于某个内部错误无法创建浏览器。
Throws | InvalidDestinationException: 如果指定了无效的目的地。
Throws | InvalidSelectorException: 如果消息选择器无效。
since | 1.1
英文文档：

createBrowser

QueueBrowser createBrowser(Queue queue,
                           String messageSelector)
                           throws JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.

Parameters:
queue - the queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid destination is specified
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

public TemporaryQueue createTemporaryQueue() throws JMSException
创建 TemporaryQueue 对象。其生命周期将是 Connection 的生命周期，除非提前删除该对象。
return | 临时队列身份
Throws | JMSException: 如果会话由于某个内部错误无法创建临时队列。
since | 1.1
英文文档：

createTemporaryQueue

TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Creates a TemporaryQueue object. Its lifetime will be that of the Connection unless it is deleted earlier.

Returns:
a temporary queue identity
Throws:
JMSException - if the session fails to create a temporary queue due to some internal error.
Since:
1.1

public TemporaryTopic createTemporaryTopic() throws JMSException
创建 TemporaryTopic 对象。其生命周期将是 Connection 的生命周期，除非提前删除该对象。
return | 临时主题身份
Throws | JMSException: 如果会话由于某个内部错误无法创建临时主题。
since | 1.1
英文文档：

createTemporaryTopic

TemporaryTopic createTemporaryTopic()
                                    throws JMSException
Creates a TemporaryTopic object. Its lifetime will be that of the Connection unless it is deleted earlier.

Returns:
a temporary topic identity
Throws:
JMSException - if the session fails to create a temporary topic due to some internal error.
Since:
1.1

public void unsubscribe(String name) throws JMSException
取消订阅客户端已创建的持久订阅。

此方法删除其提供者代表订阅者维持的状态。

在该订阅存在活动的 MessageConsumer 或 TopicSubscriber 时，或者当已使用的消息是挂起事务的一部分或尚未在会话中得到确认时，客户端删除持久订阅是错误的。

name | 用于标识此订阅的名称
Throws | JMSException: 如果会话由于某个内部错误无法取消对持久订阅的订阅。
Throws | InvalidDestinationException: 如果指定了无效的订阅名称。
since | 1.1
英文文档：

unsubscribe

void unsubscribe(String name)
                 throws JMSException
Unsubscribes a durable subscription that has been created by a client.

This method deletes the state being maintained on behalf of the subscriber by its provider.

It is erroneous for a client to delete a durable subscription while there is an active MessageConsumer or TopicSubscriber for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.

Parameters:
name - the name used to identify this subscription
Throws:
JMSException - if the session fails to unsubscribe to the durable subscription due to some internal error.
InvalidDestinationException - if an invalid subscription name is specified.
Since:
1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StreamMessage (Java EE 5)

javax.jms
Interface StreamMessage

All Superinterfaces:
Message
public interface StreamMessage
extends Message

Implements: Message

StreamMessage 对象用于发送 Java 编程语言中基本类型的流。按顺序填充和读取。它继承自 Message 接口并添加了流消息正文。其方法主要基于 java.io.DataInputStream 和 java.io.DataOutputStream 中的方法。

可以使用用于每种类型的方法显式读取或写入基本类型。它们通常也能作为对象读取或写入。例如，对 StreamMessage.writeInt(6) 的调用等效于 StreamMessage.writeObject(new Integer(6))。这两种形式都提供，因为显式形式对于静态编程很方便，而编译期间类型未知时需要对象形式。

第一次创建消息，并调用 clearBody 时，消息的正文是只写模式。完成了对 reset 的初次调用后，消息正文是只读模式。发送了消息后，发送它的客户端可以保留并修改该消息，而不影响已经发送的消息。同一个消息对象可以发送多次。收到消息后，提供者调用 reset，以便消息正文对于客户端是只读模式。

如果在只读模式中对消息调用 clearBody，则消息正文被清除，并且消息正文处于只写模式。

如果客户端尝试在只写模式下读取消息，则抛出 MessageNotReadableException。

如果客户端尝试在只读模式下写入消息，则抛出 MessageNotWriteableException。

StreamMessage 对象支持下面的转换表。必须支持标记的情况。未标记的情况必须抛出 JMSException。如果基本类型的 valueOf() 方法不接受它作为有效的基本类型 String 表示形式，则 String 到基本类型的转换可能抛出运行时异常。

作为行类型写入的值可以作为列类型读取。

|        | boolean byte short char int long float double String byte[]
 |----------------------------------------------------------------------
|boolean |    X                                            X
|byte    |          X     X         X   X                  X
|short   |                X         X   X                  X
|char    |                     X                           X
|int     |                          X   X                  X
|long    |                              X                  X
|float   |                                    X     X      X
|double  |                                          X      X
|String  |    X     X     X         X   X     X     X      X
|byte[]  |                                                        X
 |----------------------------------------------------------------------

尝试将 null 值作为基本类型读取将视同于调用基本类型相应的具有 null 值的 valueOf(String) 转换方法。由于 char 不支持 String 转换，尝试将 null 值作为 char 读取必然抛出 NullPointerException。

version
en
1.0 - 6 August 1998
See also createStreamMessage(), javax.jms.BytesMessage, javax.jms.MapMessage, javax.jms.Message, javax.jms.ObjectMessage, javax.jms.TextMessage
英文文档：

A StreamMessage object is used to send a stream of primitive types in the Java programming language. It is filled and read sequentially. It inherits from the Message interface and adds a stream message body. Its methods are based largely on those found in java.io.DataInputStream and java.io.DataOutputStream.

The primitive types can be read or written explicitly using methods for each type. They may also be read or written generically as objects. For instance, a call to StreamMessage.writeInt(6) is equivalent to StreamMessage.writeObject(new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.

When the message is first created, and when clearBody is called, the body of the message is in write-only mode. After the first call to reset has been made, the message body is in read-only mode. After a message has been sent, the client that sent it can retain and modify it without affecting the message that has been sent. The same message object can be sent multiple times. When a message has been received, the provider has called reset so that the message body is in read-only mode for the client.

If clearBody is called on a message in read-only mode, the message body is cleared and the message body is in write-only mode.

If a client attempts to read a message in write-only mode, a MessageNotReadableException is thrown.

If a client attempts to write a message in read-only mode, a MessageNotWriteableException is thrown.

StreamMessage objects support the following conversion table. The marked cases must be supported. The unmarked cases must throw a JMSException. The String-to-primitive conversions may throw a runtime exception if the primitive's valueOf() method does not accept it as a valid String representation of the primitive.

A value written as the row type can be read as the column type.

 |        | boolean byte short char int long float double String byte[]
 |----------------------------------------------------------------------
 |boolean |    X                                            X
 |byte    |          X     X         X   X                  X
 |short   |                X         X   X                  X
 |char    |                     X                           X
 |int     |                          X   X                  X
 |long    |                              X                  X
 |float   |                                    X     X      X
 |double  |                                          X      X
 |String  |    X     X     X         X   X     X     X      X
 |byte[]  |                                                        X
 |----------------------------------------------------------------------

Attempting to read a null value as a primitive type must be treated as calling the primitive's corresponding valueOf(String) conversion method with a null value. Since char does not support a String conversion, attempting to read a null value as a char must throw a NullPointerException.

Version:
1.0 - 6 August 1998
Author:
Mark Hapner, Rich Burridge
See Also:
Session.createStreamMessage(), BytesMessage, MapMessage, Message, ObjectMessage, TextMessage

Field Summary
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
Method Summary
boolean | readBoolean() Reads a boolean from the stream message.
byte | readByte() Reads a byte value from the stream message.
int | readBytes(byte[] value) Reads a byte array field from the stream message into the specified byte[] object (the read buffer).
char | readChar() Reads a Unicode character value from the stream message.
double | readDouble() Reads a double from the stream message.
float | readFloat() Reads a float from the stream message.
int | readInt() Reads a 32-bit integer from the stream message.
long | readLong() Reads a 64-bit integer from the stream message.
Object | readObject() Reads an object from the stream message.
short | readShort() Reads a 16-bit integer from the stream message.
String | readString() Reads a String from the stream message.
void | reset() Puts the message body in read-only mode and repositions the stream to the beginning.
void | writeBoolean(boolean value) Writes a boolean to the stream message.
void | writeByte(byte value) Writes a byte to the stream message.
void | writeBytes(byte[] value) Writes a byte array field to the stream message.
void | writeBytes(byte[] value, int offset, int length) Writes a portion of a byte array as a byte array field to the stream message.
void | writeChar(char value) Writes a char to the stream message.
void | writeDouble(double value) Writes a double to the stream message.
void | writeFloat(float value) Writes a float to the stream message.
void | writeInt(int value) Writes an int to the stream message.
void | writeLong(long value) Writes a long to the stream message.
void | writeObject(Object value) Writes an object to the stream message.
void | writeShort(short value) Writes a short to the stream message.
void | writeString(String value) Writes a String to the stream message.
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty

Method Detail

public boolean readBoolean() throws JMSException
读取流消息中的 boolean。
return | 读取的 boolean 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readBoolean

boolean readBoolean()
                    throws JMSException
Reads a boolean from the stream message.

Returns:
the boolean value read
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public byte readByte() throws JMSException
读取流消息中的 byte 值。
return | 流消息中的下一个字节，以 8 位 byte 的形式表示
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readByte

byte readByte()
              throws JMSException
Reads a byte value from the stream message.

Returns:
the next byte from the stream message as a 8-bit byte
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public short readShort() throws JMSException
读取流消息中的 16 位整数。
return | 流消息中的 16 位整数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readShort

short readShort()
                throws JMSException
Reads a 16-bit integer from the stream message.

Returns:
a 16-bit integer from the stream message
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public char readChar() throws JMSException
读取流消息中的 Unicode 字符值。
return | 流消息中的 Unicode 字符
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readChar

char readChar()
              throws JMSException
Reads a Unicode character value from the stream message.

Returns:
a Unicode character from the stream message
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid
MessageNotReadableException - if the message is in write-only mode.

public int readInt() throws JMSException
读取流消息中的 32 位整数。
return | 流消息中的 32 位整数值，解释为一个 int
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readInt

int readInt()
            throws JMSException
Reads a 32-bit integer from the stream message.

Returns:
a 32-bit integer value from the stream message, interpreted as an int
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public long readLong() throws JMSException
读取流消息中的 64 位整数。
return | 流消息中的 64 位整数值，解释为一个 long
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readLong

long readLong()
              throws JMSException
Reads a 64-bit integer from the stream message.

Returns:
a 64-bit integer value from the stream message, interpreted as a long
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public float readFloat() throws JMSException
读取流消息中的 float。
return | 流消息中的 float 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readFloat

float readFloat()
                throws JMSException
Reads a float from the stream message.

Returns:
a float value from the stream message
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public double readDouble() throws JMSException
读取流消息中的 double。
return | 流消息中的 double 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readDouble

double readDouble()
                  throws JMSException
Reads a double from the stream message.

Returns:
a double value from the stream message
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public String readString() throws JMSException
读取流消息中的 String。
return | 流消息中的 Unicode 字符串
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
英文文档：

readString

String readString()
                  throws JMSException
Reads a String from the stream message.

Returns:
a Unicode string from the stream message
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.

public int readBytes(byte[] value) throws JMSException
将流消息中的 byte 数组字段读入指定的 byte[] 对象（读缓冲区）。

要读取该字段值，应接连调用 readBytes，直到它返回的值小于读缓冲区的长度为止。缓冲区中读取的最后一个字节之后的字节值是不确定的。

如果 readBytes 返回的值等于缓冲区长度，则必须进行后续 readBytes 调用。如果不再有字节可供读取，则此调用返回 -1。

如果 byte 数组字段值为 null，则 readBytes 返回 -1。

如果 byte 数组字段值为空，则 readBytes 返回 0。

在第一次对 byte[] 字段值进行 readBytes 调用后，必须读取该字段的完整值，然后才能有效读取下一个字段。在该字段完整值读取完成之前尝试读取下一个字段，将抛出 MessageFormatException。

要将 byte 字段值读入新的 byte[] 对象，使用 readObject 方法。

value | 将数据读入的缓冲区
return | 读入缓冲区的总字节数，如果由于已到达 byte 字段末尾而不再有数据，则返回 -1
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
See also | readObject()
英文文档：

readBytes

int readBytes(byte[] value)
              throws JMSException
Reads a byte array field from the stream message into the specified byte[] object (the read buffer).

To read the field value, readBytes should be successively called until it returns a value less than the length of the read buffer. The value of the bytes in the buffer following the last byte read is undefined.

If readBytes returns a value equal to the length of the buffer, a subsequent readBytes call must be made. If there are no more bytes to be read, this call returns -1.

If the byte array field value is null, readBytes returns -1.

If the byte array field value is empty, readBytes returns 0.

Once the first readBytes call on a byte[] field value has been made, the full value of the field must be read before it is valid to read the next field. An attempt to read the next field before that has been done will throw a MessageFormatException.

To read the byte field value into a new byte[] object, use the readObject method.

Parameters:
value - the buffer into which the data is read
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the byte field has been reached
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.
See Also:
readObject()

public Object readObject() throws JMSException
读取流消息中的对象。

可以使用此方法（以对象化格式）返回 Java 编程语言中的对象（“Java 对象”），该对象已使用对等的 writeObject 方法调用或其对等的基本 writetype 方法写入流中。

注意，byte 值以 byte[] 的形式返回，而不是 Byte[]。

在 byte 字段的完整值读取完成之前就尝试调用 readObject 将 byte 字段值读入新 byte[] 对象，将抛出 MessageFormatException。

return | 流消息中的 Java 对象，以对象化格式返回（例如，如果对象写作 int，则返回 Integer）
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法读取消息。
Throws | MessageEOFException: 如果到达不可预料的消息流末尾。
Throws | MessageFormatException: 如果此类型转换无效。
Throws | MessageNotReadableException: 如果消息是只写模式。
See also | readBytes(byte[] value)
英文文档：

readObject

Object readObject()
                  throws JMSException
Reads an object from the stream message.

This method can be used to return, in objectified format, an object in the Java programming language ("Java object") that has been written to the stream with the equivalent writeObject method call, or its equivalent primitive writetype method.

Note that byte values are returned as byte[], not Byte[].

An attempt to call readObject to read a byte field value into a new byte[] object before the full value of the byte field has been read will throw a MessageFormatException.

Returns:
a Java object from the stream message, in objectified format (for example, if the object was written as an int, an Integer is returned)
Throws:
JMSException - if the JMS provider fails to read the message due to some internal error.
MessageEOFException - if unexpected end of message stream has been reached.
MessageFormatException - if this type conversion is invalid.
MessageNotReadableException - if the message is in write-only mode.
See Also:
readBytes(byte[] value)

public void writeBoolean(boolean value) throws JMSException
将 boolean 值写入流消息。值 true 以值 (byte)1 的形式被写入；值 false 以值 (byte)0 的形式被写入。
value | 要写入的 boolean 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeBoolean

void writeBoolean(boolean value)
                  throws JMSException
Writes a boolean to the stream message. The value true is written as the value (byte)1; the value false is written as the value (byte)0.

Parameters:
value - the boolean value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeByte(byte value) throws JMSException
将 byte 值写入流消息。
value | 要写入的 byte 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeByte

void writeByte(byte value)
               throws JMSException
Writes a byte to the stream message.

Parameters:
value - the byte value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeShort(short value) throws JMSException
将 short 值写入流消息。
value | 要写入的 short 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeShort

void writeShort(short value)
                throws JMSException
Writes a short to the stream message.

Parameters:
value - the short value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeChar(char value) throws JMSException
将 char 值写入流消息。
value | 要写入的 char 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeChar

void writeChar(char value)
               throws JMSException
Writes a char to the stream message.

Parameters:
value - the char value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeInt(int value) throws JMSException
将 int 值写入流消息。
value | 要写入的 int 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeInt

void writeInt(int value)
              throws JMSException
Writes an int to the stream message.

Parameters:
value - the int value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeLong(long value) throws JMSException
将 long 值写入流消息。
value | 要写入的 long 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeLong

void writeLong(long value)
               throws JMSException
Writes a long to the stream message.

Parameters:
value - the long value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeFloat(float value) throws JMSException
将 float 值写入流消息。
value | 要写入的 float 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeFloat

void writeFloat(float value)
                throws JMSException
Writes a float to the stream message.

Parameters:
value - the float value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeDouble(double value) throws JMSException
将 double 值写入流消息。
value | 要写入的 double 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeDouble

void writeDouble(double value)
                 throws JMSException
Writes a double to the stream message.

Parameters:
value - the double value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeString(String value) throws JMSException
将 String 值写入流消息。
value | 要写入的 String 值
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeString

void writeString(String value)
                 throws JMSException
Writes a String to the stream message.

Parameters:
value - the String value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeBytes(byte[] value) throws JMSException
将 byte 数组字段写入流消息。

byte 数组 value 以 byte 数组字段的形式写入消息。读取字段时，连续写入的 byte 数组字段被视为两个不同的字段。

value | 要写入的 byte 数组
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeBytes

void writeBytes(byte[] value)
                throws JMSException
Writes a byte array field to the stream message.

The byte array value is written to the message as a byte array field. Consecutively written byte array fields are treated as two distinct fields when the fields are read.

Parameters:
value - the byte array value to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeBytes(byte[] value, int offset, int length) throws JMSException
将 byte 数组的一部分以 byte 数组字段的形式写入流消息。

byte 数组 value 的一部分以 byte 数组字段的形式写入消息。读取字段时，连续写入的 byte 数组字段被视为两个不同的字段。

value | 要写入的 byte 数组
offset | byte 数组中的初始偏移量
length | 要使用的字节数
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeBytes

void writeBytes(byte[] value,
                int offset,
                int length)
                throws JMSException
Writes a portion of a byte array as a byte array field to the stream message.

The a portion of the byte array value is written to the message as a byte array field. Consecutively written byte array fields are treated as two distinct fields when the fields are read.

Parameters:
value - the byte array value to be written
offset - the initial offset within the byte array
length - the number of bytes to use
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public void writeObject(Object value) throws JMSException
将对象写入流消息。

此方法仅用于对象化的基本对象类型（Integer、Double、Long 等）、String 对象和 byte 数组。

value | 要写入的 Java 对象
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法写入消息。
Throws | MessageFormatException: 如果对象无效。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

writeObject

void writeObject(Object value)
                 throws JMSException
Writes an object to the stream message.

This method works only for the objectified primitive object types (Integer, Double, Long ...), String objects, and byte arrays.

Parameters:
value - the Java object to be written
Throws:
JMSException - if the JMS provider fails to write the message due to some internal error.
MessageFormatException - if the object is invalid.
MessageNotWriteableException - if the message is in read-only mode.

public void reset() throws JMSException
将消息正文置于只读模式并将流重新定位到开始处。
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法重置消息。
Throws | MessageFormatException: 如果消息存在无效的格式。
英文文档：

reset

void reset()
           throws JMSException
Puts the message body in read-only mode and repositions the stream to the beginning.

Throws:
JMSException - if the JMS provider fails to reset the message due to some internal error.
MessageFormatException - if the message has an invalid format.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TemporaryQueue (Java EE 5)

javax.jms
Interface TemporaryQueue

All Superinterfaces:
Destination, Queue
public interface TemporaryQueue
extends Queue

Implements: Queue

TemporaryQueue 对象是 Connection 持续期间创建的唯一 Queue 对象。它是系统定义的队列，只能由创建它的 Connection 使用。

TemporaryQueue 对象可以在 Session 或 QueueSession 级创建。在 Session 级创建该对象允许 TemporaryQueue 与 Pub/Sub 域中的对象一起参与到事务中。如果在 QueueSession 级创建它，则它只能与 PTP 域中的对象一起参与到事务中。

version
en
1.1 - February 2, 2002
See also createTemporaryQueue(), createTemporaryQueue()
英文文档：

A TemporaryQueue object is a unique Queue object created for the duration of a Connection. It is a system-defined queue that can be consumed only by the Connection that created it.

A TemporaryQueue object can be created at either the Session or QueueSession level. Creating it at the Session level allows to the TemporaryQueue to participate in transactions with objects from the Pub/Sub domain. If it is created at the QueueSession, it will only be able participate in transactions with objects from the PTP domain.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createTemporaryQueue(), QueueSession.createTemporaryQueue()

Method Summary
 void delete()
Deletes this temporary queue.
Methods inherited from interface javax.jms.Queue
getQueueName, toString

Method Detail

public void delete() throws JMSException
删除此临时队列。如果有现有接收者仍在使用该队列，则将抛出 JMSException。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法删除临时队列。
英文文档：

delete

void delete()
            throws JMSException
Deletes this temporary queue. If there are existing receivers still using it, a JMSException will be thrown.

Throws:
JMSException - if the JMS provider fails to delete the temporary queue due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TemporaryTopic (Java EE 5)

javax.jms
Interface TemporaryTopic

All Superinterfaces:
Destination, Topic
public interface TemporaryTopic
extends Topic

Implements: Topic

TemporaryTopic 对象是 Connection 持续期间创建的唯一 Topic 对象。它是系统定义的主题，只能由创建它的 Connection 使用。

TemporaryTopic 对象可以在 Session 或 TopicSession 级创建。在 Session 级创建该对象允许 TemporaryTopic 与 PTP 域中的对象一起参与到相同的事务中。如果在 TopicSession 级创建 TemporaryTopic，则它只能与 Pub/Sub 域中的对象一起参与到事务中。

version
en
1.1 - February 2, 2002
See also createTemporaryTopic(), createTemporaryTopic()
英文文档：

A TemporaryTopic object is a unique Topic object created for the duration of a Connection. It is a system-defined topic that can be consumed only by the Connection that created it.

A TemporaryTopic object can be created either at the Session or TopicSession level. Creating it at the Session level allows the TemporaryTopic to participate in the same transaction with objects from the PTP domain. If a TemporaryTopic is created at the TopicSession, it will only be able participate in transactions with objects from the Pub/Sub domain.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createTemporaryTopic(), TopicSession.createTemporaryTopic()

Method Summary
 void delete()
Deletes this temporary topic.
Methods inherited from interface javax.jms.Topic
getTopicName, toString

Method Detail

public void delete() throws JMSException
删除此临时主题。如果有现有订阅者仍在使用该队列，则将抛出 JMSException。
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法删除临时主题。
英文文档：

delete

void delete()
            throws JMSException
Deletes this temporary topic. If there are existing subscribers still using it, a JMSException will be thrown.

Throws:
JMSException - if the JMS provider fails to delete the temporary topic due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TextMessage (Java EE 5)

javax.jms
Interface TextMessage

All Superinterfaces:
Message
public interface TextMessage
extends Message

Implements: Message

TextMessage 对象用于发送包含 java.lang.String 的消息。它继承自 Message 接口并添加了文本消息正文。

此消息类型可用于传输基于文本的消息，包括那些含有 XML 内容的消息。

当客户端接收 TextMessage 时，它是只读模式。如果客户端尝试在此时写入消息，则抛出 MessageNotWriteableException。如果调用了 clearBody，现在便可以读取和写入消息。

version
en
1.1 - February 2, 2002
See also createTextMessage(), createTextMessage(String), javax.jms.BytesMessage, javax.jms.MapMessage, javax.jms.Message, javax.jms.ObjectMessage, javax.jms.StreamMessage, java.lang.String
英文文档：

A TextMessage object is used to send a message containing a java.lang.String. It inherits from the Message interface and adds a text message body.

This message type can be used to transport text-based messages, including those with XML content.

When a client receives a TextMessage, it is in read-only mode. If a client attempts to write to the message at this point, a MessageNotWriteableException is thrown. If clearBody is called, the message can now be both read from and written to.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createTextMessage(), Session.createTextMessage(String), BytesMessage, MapMessage, Message, ObjectMessage, StreamMessage, String

Field Summary
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
Method Summary
String | getText() Gets the string containing this message's data.
void | setText(String string) Sets the string containing this message's data.
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty

Method Detail

public void setText(String string) throws JMSException
设置包含此消息数据的字符串。
string | 包含消息数据的 String
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置文本。
Throws | MessageNotWriteableException: 如果消息是只读模式。
英文文档：

setText

void setText(String string)
             throws JMSException
Sets the string containing this message's data.

Parameters:
string - the String containing the message's data
Throws:
JMSException - if the JMS provider fails to set the text due to some internal error.
MessageNotWriteableException - if the message is in read-only mode.

public String getText() throws JMSException
获取包含此消息数据的字符串。默认值为 null。
return | 包含消息数据的 String
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取文本。
英文文档：

getText

String getText()
               throws JMSException
Gets the string containing this message's data. The default value is null.

Returns:
the String containing the message's data
Throws:
JMSException - if the JMS provider fails to get the text due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Topic (Java EE 5)

javax.jms
Interface Topic

All Superinterfaces:
Destination
All Known Subinterfaces:
TemporaryTopic
public interface Topic
extends Destination

Implements: Destination
Implemented by: TemporaryTopic

Topic 对象封装特定于提供者的主题名称。客户端通过这种方式将主题的身份指定给 JMS API 方法。对于那些将 Destination 用作形参的方法，Topic 对象可用作实参。例如，通过调用以下两个方法，可以使用 Topic 创建 MessageConsumer 和 MessageProducer：
  • Session.CreateConsumer(Destination destination)
  • Session.CreateProducer(Destination destination)

许多发布/订阅 (pub/sub) 提供者将主题分组为层次结构，并提供各种选项来订阅层次结构的各部分。JMS API 对 Topic 对象所代表的内容不加限制。它可能是主题层次结构中的叶节点，也可能是层次结构的较大部分。

主题的组织和对主题的订阅粒度是 pub/sub 应用程序架构的重要部分。JMS API 没有为应如何执行此操作指定策略。如果应用程序使用特定于提供者的主题分组机制，它应对此进行记录。如果使用不同的提供者安装该应用程序，则管理员负责构造等效的主题架构，并创建等效的 Topic 对象。

version
en
1.1 - February 2, 2002
See also createConsumer(Destination), createProducer(Destination), createTopic(String)
英文文档：

A Topic object encapsulates a provider-specific topic name. It is the way a client specifies the identity of a topic to JMS API methods. For those methods that use a Destination as a parameter, a Topic object may used as an argument . For example, a Topic can be used to create a MessageConsumer and a MessageProducer by calling:

  • Session.CreateConsumer(Destination destination)
  • Session.CreateProducer(Destination destination)

Many publish/subscribe (pub/sub) providers group topics into hierarchies and provide various options for subscribing to parts of the hierarchy. The JMS API places no restriction on what a Topic object represents. It may be a leaf in a topic hierarchy, or it may be a larger part of the hierarchy.

The organization of topics and the granularity of subscriptions to them is an important part of a pub/sub application's architecture. The JMS API does not specify a policy for how this should be done. If an application takes advantage of a provider-specific topic-grouping mechanism, it should document this. If the application is installed using a different provider, it is the job of the administrator to construct an equivalent topic architecture and create equivalent Topic objects.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createConsumer(Destination),
Session.createProducer(Destination),
TopicSession.createTopic(String)

Method Summary
String | getTopicName() Gets the name of this topic.
String | toString() Returns a string representation of this object.

Method Detail

public String getTopicName() throws JMSException
获取此主题的名称。

依赖于该名称的客户端是不可移植的。

return | 主题名称
Throws | JMSException: 如果 Topic 的 JMS 提供者实现由于某个内部错误无法返回主题名称。
英文文档：

getTopicName

String getTopicName()
                    throws JMSException
Gets the name of this topic.

Clients that depend upon the name are not portable.

Returns:
the topic name
Throws:
JMSException - if the JMS provider implementation of Topic fails to return the topic name due to some internal error.

public String toString()
返回此对象的字符串表示形式。
return 此主题的特定于提供者的身份值
英文文档：

toString

String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
the provider-specific identity values for this topic
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TopicConnection (Java EE 5)

javax.jms
Interface TopicConnection

All Superinterfaces:
Connection
All Known Subinterfaces:
XATopicConnection
public interface TopicConnection
extends Connection

Implements: Connection
Implemented by: XATopicConnection

TopicConnection 对象是到发布/订阅 JMS 提供者的活动连接。客户端使用 TopicConnection 对象创建一个或多个生产和使用消息的 TopicSession 对象。

TopicConnection 可用于创建 TopicSession，可以从 TopicSession 中创建专门的与主题有关的对象。一种更常用且建议采用的方法是使用 Connection 对象。

应该使用 TopicConnection 对象支持现有代码。

version
en
1.1 - February 2, 2002
See also javax.jms.Connection, javax.jms.ConnectionFactory, javax.jms.TopicConnectionFactory
英文文档：

A TopicConnection object is an active connection to a publish/subscribe JMS provider. A client uses a TopicConnection object to create one or more TopicSession objects for producing and consuming messages.

A TopicConnection can be used to create a TopicSession, from which specialized topic-related objects can be created. A more general, and recommended approach is to use the Connection object.

The TopicConnection object should be used to support existing code.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Connection, ConnectionFactory, TopicConnectionFactory

Method Summary
ConnectionConsumer | createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) Creates a connection consumer for this connection (optional operation).
ConnectionConsumer | createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) Create a durable connection consumer for this connection (optional operation).
TopicSession | createTopicSession(boolean transacted, int acknowledgeMode) Creates a TopicSession object.
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, createSession, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop

Method Detail

public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
创建 TopicSession 对象。
transacted | 指示会话是否是事务性的
acknowledgeMode | 指示使用方或客户端是否将确认收到的任何消息；如果会话是事务性的，则忽略此参数。合法值有 Session.AUTO_ACKNOWLEDGE、Session.CLIENT_ACKNOWLEDGE 和 Session.DUPS_OK_ACKNOWLEDGE。
return | 新建的主题会话
Throws | JMSException: 如果 TopicConnection 对象由于某个内部错误或缺少对特定事务和确认模式的支持无法创建会话。
See also | AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
英文文档：

createTopicSession

TopicSession createTopicSession(boolean transacted,
                                int acknowledgeMode)
                                throws JMSException
Creates a TopicSession object.

Parameters:
transacted - indicates whether the session is transacted
acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.
Returns:
a newly created topic session
Throws:
JMSException - if the TopicConnection object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE

public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
创建此连接的连接使用方（可选操作）。这是一个专家级工具，常规 JMS 客户端不使用。
topic | 要访问的主题
messageSelector | 仅包括那些属性匹配所传送的消息选择器表达式的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
sessionPool | 与此连接使用方关联的服务器会话池
maxMessages | 可以一次分配给服务器会话的最大消息数
return | 连接使用方
Throws | JMSException: 如果 TopicConnection 对象由于某个内部错误或 sessionPool 和 messageSelector 的无效参数无法创建连接使用方。
Throws | InvalidDestinationException: 如果指定了无效的主题。
Throws | InvalidSelectorException: 如果消息选择器无效。
See also | javax.jms.ConnectionConsumer
英文文档：

createConnectionConsumer

ConnectionConsumer createConnectionConsumer(Topic topic,
                                            String messageSelector,
                                            ServerSessionPool sessionPool,
                                            int maxMessages)
                                            throws JMSException
Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.

Parameters:
topic - the topic to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
sessionPool - the server session pool to associate with this connection consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the connection consumer
Throws:
JMSException - if the TopicConnection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector.
InvalidDestinationException - if an invalid topic is specified.
InvalidSelectorException - if the message selector is invalid.
See Also:
ConnectionConsumer

public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
创建此连接的持久连接使用方（可选操作）。这是一个专家级工具，常规 JMS 客户端不使用。
topic | 要访问的主题
subscriptionName | 持久订阅名称
messageSelector | 仅包括那些属性匹配所传送的消息选择器表达式的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
sessionPool | 关联此持久连接使用方的服务器会话池
maxMessages | 可以一次分配给服务器会话的最大消息数
return | 持久连接使用方
Throws | JMSException: 如果 TopicConnection 对象由于某个内部错误或 sessionPool 和 messageSelector 的无效参数无法创建连接使用方。
Throws | InvalidDestinationException: 如果指定了无效的主题。
Throws | InvalidSelectorException: 如果消息选择器无效。
See also | javax.jms.ConnectionConsumer
英文文档：

createDurableConnectionConsumer

ConnectionConsumer createDurableConnectionConsumer(Topic topic,
                                                   String subscriptionName,
                                                   String messageSelector,
                                                   ServerSessionPool sessionPool,
                                                   int maxMessages)
                                                   throws JMSException
Create a durable connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.

Specified by:
createDurableConnectionConsumer in interface Connection
Parameters:
topic - the topic to access
subscriptionName - durable subscription name
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
sessionPool - the server session pool to associate with this durable connection consumer
maxMessages - the maximum number of messages that can be assigned to a server session at one time
Returns:
the durable connection consumer
Throws:
JMSException - if the TopicConnection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector.
InvalidDestinationException - if an invalid topic is specified.
InvalidSelectorException - if the message selector is invalid.
See Also:
ConnectionConsumer
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TopicConnectionFactory (Java EE 5)

javax.jms
Interface TopicConnectionFactory

All Superinterfaces:
ConnectionFactory
All Known Subinterfaces:
XATopicConnectionFactory
public interface TopicConnectionFactory
extends ConnectionFactory

Implements: ConnectionFactory
Implemented by: XATopicConnectionFactory

客户端使用 TopicConnectionFactory 对象创建具有发布/订阅 JMS 提供者的 TopicConnection 对象。

TopicConnectionFactory 可用于创建 TopicConnection，可以从 TopicConnection 中创建专门的与主题有关的对象。一种更常用且建议采用的方法是使用 ConnectionFactory 对象。

应该使用 TopicConnectionFactory 对象支持现有代码。

version
en
1.1 - February 2, 2002
See also javax.jms.ConnectionFactory
英文文档：

A client uses a TopicConnectionFactory object to create TopicConnection objects with a publish/subscribe JMS provider.

A TopicConnectionFactory can be used to create a TopicConnection, from which specialized topic-related objects can be created. A more general, and recommended approach is to use the ConnectionFactory object.

The TopicConnectionFactory object should be used to support existing code.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
ConnectionFactory

Method Summary
TopicConnection | createTopicConnection() Creates a topic connection with the default user identity.
TopicConnection | createTopicConnection(String userName, String password) Creates a topic connection with the specified user identity.
Methods inherited from interface javax.jms.ConnectionFactory
createConnection, createConnection

Method Detail

public TopicConnection createTopicConnection() throws JMSException
创建带有默认用户身份的主题连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
return | 新建的主题连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建主题连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createTopicConnection

TopicConnection createTopicConnection()
                                      throws JMSException
Creates a topic connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Returns:
a newly created topic connection
Throws:
JMSException - if the JMS provider fails to create a topic connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.

public TopicConnection createTopicConnection(String userName, String password) throws JMSException
创建带有指定用户身份的主题连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
userName | 调用者的用户名
password | 调用者的密码
return | 新建的主题连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建主题连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createTopicConnection

TopicConnection createTopicConnection(String userName,
                                      String password)
                                      throws JMSException
Creates a topic connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created topic connection
Throws:
JMSException - if the JMS provider fails to create a topic connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TopicPublisher (Java EE 5)

javax.jms
Interface TopicPublisher

All Superinterfaces:
MessageProducer
public interface TopicPublisher
extends MessageProducer

Implements: MessageProducer

客户端使用 TopicPublisher 对象在主题上发布消息。TopicPublisher 对象是消息生成方的发布/订阅形式。

通常，Topic 是在创建 TopicPublisher 时指定的。在这种情况下，尝试使用未标识的 TopicPublisher 的 publish 方法将抛出 java.lang.UnsupportedOperationException。

如果使用未标识的 Topic 创建 TopicPublisher，则尝试使用假定 Topic 已标识的 publish 方法将抛出 java.lang.UnsupportedOperationException。

在执行其 publish 方法期间，客户端内的其他线程不得更改消息。如果修改了消息，则 publish 的结果是不确定的。

消息发布后，客户端可以保留并修改它，而不会影响已经发布的消息。同一个消息对象可以被发布多次。

以下消息头作为发布消息的一部分设置：JMSDestination、JMSDeliveryMode、JMSExpiration、JMSPriority、JMSMessageID 和 JMSTimeStamp。发布消息时，忽略这些消息头的值。publish 完成后，这些消息头保持发布该消息的方法指定的值。如果通过 MessageProducer.setDisableMessageID 或 MessageProducer.setDisableMessageTimestamp 方法显式禁用了这些消息头的该设置，则 publish 方法可以不设置 JMSMessageID 和 JMSTimeStamp。

创建 MessageProducer 所提供的功能与创建 TopicPublisher 所提供的功能相同。创建新代码时建议使用 MessageProducer 对象。提供 TopicPublisher 的目的是支持现有代码。

因为 TopicPublisher 继承自 MessageProducer，所以它继承作为 MessageProducer 接口一部分的 send 方法。使用 send 方法与使用 publish 方法的效果相同：它们在功能上相同。

version
en
1.1 February 2, 2002
See also createProducer(Destination), createPublisher(Topic)
英文文档：

A client uses a TopicPublisher object to publish messages on a topic. A TopicPublisher object is the publish-subscribe form of a message producer.

Normally, the Topic is specified when a TopicPublisher is created. In this case, an attempt to use the publish methods for an unidentified TopicPublisher will throw a java.lang.UnsupportedOperationException.

If the TopicPublisher is created with an unidentified Topic, an attempt to use the publish methods that assume that the Topic has been identified will throw a java.lang.UnsupportedOperationException.

During the execution of its publish method, a message must not be changed by other threads within the client. If the message is modified, the result of the publish is undefined.

After publishing a message, a client may retain and modify it without affecting the message that has been published. The same message object may be published multiple times.

The following message headers are set as part of publishing a message: JMSDestination, JMSDeliveryMode, JMSExpiration, JMSPriority, JMSMessageID and JMSTimeStamp. When the message is published, the values of these headers are ignored. After completion of the publish, the headers hold the values specified by the method publishing the message. It is possible for the publish method not to set JMSMessageID and JMSTimeStamp if the setting of these headers is explicitly disabled by the MessageProducer.setDisableMessageID or MessageProducer.setDisableMessageTimestamp method.

Creating a MessageProducer provides the same features as creating a TopicPublisher. A MessageProducer object is recommended when creating new code. The TopicPublisher is provided to support existing code.

Because TopicPublisher inherits from MessageProducer, it inherits the send methods that are a part of the MessageProducer interface. Using the send methods will have the same effect as using the publish methods: they are functionally the same.

Version:
1.1 February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createProducer(Destination), TopicSession.createPublisher(Topic)

Method Summary
Topic | getTopic() Gets the topic associated with this TopicPublisher.
void | publish(Message message) Publishes a message to the topic.
void | publish(Message message, int deliveryMode, int priority, long timeToLive) Publishes a message to the topic, specifying delivery mode, priority, and time to live.
void | publish(Topic topic, Message message) Publishes a message to a topic for an unidentified message producer.
void | publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.
Methods inherited from interface javax.jms.MessageProducer
close, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive

Method Detail

public Topic getTopic() throws JMSException
获取与此 TopicPublisher 相关的主题。
return | 此发布者的主题
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此 TopicPublisher 的主题。
英文文档：

getTopic

Topic getTopic()
               throws JMSException
Gets the topic associated with this TopicPublisher.

Returns:
this publisher's topic
Throws:
JMSException - if the JMS provider fails to get the topic for this TopicPublisher due to some internal error.

public void publish(Message message) throws JMSException
将消息发布到主题。使用 TopicPublisher 的默认传送模式、优先级和生存时间。
message | 要发布的消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发布消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与带有无效主题的 TopicPublisher 一起使用。
Throws | UnsupportedOperationException: 如果客户端将此方法与在创建时未指定主题的 TopicPublisher 一起使用。
See also | getDeliveryMode(), getTimeToLive(), getPriority()
英文文档：

publish

void publish(Message message)
             throws JMSException
Publishes a message to the topic. Uses the TopicPublisher's default delivery mode, priority, and time to live.

Parameters:
message - the message to publish
Throws:
JMSException - if the JMS provider fails to publish the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with a TopicPublisher with an invalid topic.
UnsupportedOperationException - if a client uses this method with a TopicPublisher that did not specify a topic at creation time.
See Also:
MessageProducer.getDeliveryMode(),
MessageProducer.getTimeToLive(),
MessageProducer.getPriority()

public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
将消息发布到主题，指定传送模式、优先级和生存时间。
message | 要发布的消息
deliveryMode | 要使用的传送模式
priority | 此消息的优先级
timeToLive | 消息的生命周期（以毫秒为单位）
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发布消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与带有无效主题的 TopicPublisher 一起使用。
Throws | UnsupportedOperationException: 如果客户端将此方法与在创建时未指定主题的 TopicPublisher 一起使用。
英文文档：

publish

void publish(Message message,
             int deliveryMode,
             int priority,
             long timeToLive)
             throws JMSException
Publishes a message to the topic, specifying delivery mode, priority, and time to live.

Parameters:
message - the message to publish
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message's lifetime (in milliseconds)
Throws:
JMSException - if the JMS provider fails to publish the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with a TopicPublisher with an invalid topic.
UnsupportedOperationException - if a client uses this method with a TopicPublisher that did not specify a topic at creation time.

public void publish(Topic topic, Message message) throws JMSException
将消息发布到未标识的消息生成方的主题。使用 TopicPublisher 的默认传送模式、优先级和生存时间。

通常，在创建时为消息生成方分配一个主题；但是，JMS API 也支持未标识的消息生成方，这需要在每次发布消息时提供主题。

topic | 要将此消息发布到的主题
message | 要发布的消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发布消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与无效主题一起使用。
See also | getDeliveryMode(), getTimeToLive(), getPriority()
英文文档：

publish

void publish(Topic topic,
             Message message)
             throws JMSException
Publishes a message to a topic for an unidentified message producer. Uses the TopicPublisher's default delivery mode, priority, and time to live.

Typically, a message producer is assigned a topic at creation time; however, the JMS API also supports unidentified message producers, which require that the topic be supplied every time a message is published.

Parameters:
topic - the topic to publish this message to
message - the message to publish
Throws:
JMSException - if the JMS provider fails to publish the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid topic.
See Also:
MessageProducer.getDeliveryMode(),
MessageProducer.getTimeToLive(),
MessageProducer.getPriority()

public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
将消息发布到未标识的消息生成方的主题，指定传送模式、优先级和生存时间。

通常，在创建时为消息生成方分配一个主题；但是，JMS API 也支持未标识的消息生成方，这需要在每次发布消息时提供主题。

topic | 要将此消息发布到的主题
message | 要发布的消息
deliveryMode | 要使用的传送模式
priority | 此消息的优先级
timeToLive | 消息的生命周期（以毫秒为单位）
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法发布消息。
Throws | MessageFormatException: 如果指定了无效的消息。
Throws | InvalidDestinationException: 如果客户端将此方法与无效主题一起使用。
英文文档：

publish

void publish(Topic topic,
             Message message,
             int deliveryMode,
             int priority,
             long timeToLive)
             throws JMSException
Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.

Typically, a message producer is assigned a topic at creation time; however, the JMS API also supports unidentified message producers, which require that the topic be supplied every time a message is published.

Parameters:
topic - the topic to publish this message to
message - the message to publish
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message's lifetime (in milliseconds)
Throws:
JMSException - if the JMS provider fails to publish the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid topic.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TopicSession (Java EE 5)

javax.jms
Interface TopicSession

All Superinterfaces:
Runnable, Session
public interface TopicSession
extends Session

Implements: Session

TopicSession 对象提供创建 TopicPublisher、TopicSubscriber 和 TemporaryTopic 对象的方法。它还提供 删除其客户端持久订阅者的方法。

TopicSession 用于创建特定于 Pub/Sub 的对象。一般情况下，使用 Session 对象，而 使用 TopicSession 只是为了支持 现有代码。使用 Session 对象可简化 编程模型，并允许跨两个消息传送域 使用事务。

不能使用 TopicSession 创建特定于 点对点域的对象。下列方法继承自 Session，但如果在 TopicSession 中使用，则必定抛出 IllegalStateException ：

  • createBrowser
  • createQueue
  • createTemporaryQueue
version
en
1.1 - April 9, 2002
See also javax.jms.Session, createSession(boolean, int), createTopicSession(boolean, int), getTopicSession()
英文文档：

A TopicSession object provides methods for creating TopicPublisher, TopicSubscriber, and TemporaryTopic objects. It also provides a method for deleting its client's durable subscribers.

A TopicSession is used for creating Pub/Sub specific objects. In general, use the Session object, and use TopicSession only to support existing code. Using the Session object simplifies the programming model, and allows transactions to be used across the two messaging domains.

A TopicSession cannot be used to create objects specific to the point-to-point domain. The following methods inherit from Session, but must throw an IllegalStateException if used from TopicSession:

  • createBrowser
  • createQueue
  • createTemporaryQueue

Version:
1.1 - April 9, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session,
Connection.createSession(boolean, int),
TopicConnection.createTopicSession(boolean, int),
XATopicSession.getTopicSession()

Field Summary
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
Method Summary
TopicSubscriber | createDurableSubscriber(Topic topic, String name) Creates a durable subscriber to the specified topic.
TopicSubscriber | createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) Creates a durable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.
TopicPublisher | createPublisher(Topic topic) Creates a publisher for the specified topic.
TopicSubscriber | createSubscriber(Topic topic) Creates a nondurable subscriber to the specified topic.
TopicSubscriber | createSubscriber(Topic topic, String messageSelector, boolean noLocal) Creates a nondurable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.
TemporaryTopic | createTemporaryTopic() Creates a TemporaryTopic object.
Topic | createTopic(String topicName) Creates a topic identity given a Topic name.
void | unsubscribe(String name) Unsubscribes a durable subscription that has been created by a client.
Methods inherited from interface javax.jms.Session
close, commit, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTextMessage, createTextMessage, getAcknowledgeMode, getMessageListener, getTransacted, recover, rollback, run, setMessageListener

Method Detail

public Topic createTopic(String topicName) throws JMSException
创建给定 Topic 名称的主题身份。

此工具供某些特殊情况使用，这些情况下客户端需要动态操作主题身份。这允许创建具有特定于提供者的名称的主题身份。依赖于此能力的客户端是不可移植的。

注意，此方法不用于创建物理主题。物理创建主题是一项管理任务，不应由 JMS API 发起。有一个例外是创建临时主题，它可以使用 createTemporaryTopic 方法实现。

topicName | 此 Topic 的名称
return | 具有给定名称的 Topic
Throws | JMSException: 如果会话由于某个内部错误无法创建主题。
英文文档：

createTopic

Topic createTopic(String topicName)
                  throws JMSException
Creates a topic identity given a Topic name.

This facility is provided for the rare cases where clients need to dynamically manipulate topic identity. This allows the creation of a topic identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical topic. The physical creation of topics is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary topics, which is accomplished with the createTemporaryTopic method.

Specified by:
createTopic in interface Session
Parameters:
topicName - the name of this Topic
Returns:
a Topic with the given name
Throws:
JMSException - if the session fails to create a topic due to some internal error.

public TopicSubscriber createSubscriber(Topic topic) throws JMSException
创建指定主题的非持久订阅者。

客户端使用 TopicSubscriber 对象接收 已发布到主题的消息。

常规 TopicSubscriber 对象不是持久的。 它们仅接收在其活动状态下发布的消息。

在某些情况下，连接可以既发布又订阅 主题。订阅者 NoLocal 属性允许订阅者 禁止传送由其自己的连接发布的消息。 此属性的默认值为 false。

topic | 要订阅的 Topic
Throws | JMSException: 如果会话由于某个内部错误无法创建订阅者。
Throws | InvalidDestinationException: 如果指定了无效的主题。
英文文档：

createSubscriber

TopicSubscriber createSubscriber(Topic topic)
                                 throws JMSException
Creates a nondurable subscriber to the specified topic.

A client uses a TopicSubscriber object to receive messages that have been published to a topic.

Regular TopicSubscriber objects are not durable. They receive only messages that are published while they are active.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection. The default value for this attribute is false.

Parameters:
topic - the Topic to subscribe to
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.

public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
创建指定主题的非持久订阅者， 使用消息选择器或指定是否应将由其自己的连接发布的 消息传送给它。

客户端使用 TopicSubscriber 对象接收 已发布到主题的消息。

常规 TopicSubscriber 对象不是持久的。 它们仅接收在其活动状态下发布的消息。

订阅者的消息选择器过滤掉的消息将 绝不会传送给订阅者。从订阅者的角度来看， 这些消息不存在。

在某些情况下，连接可以既发布又订阅 主题。订阅者 NoLocal 属性允许订阅者 禁止传送由其自己的连接发布的消息。 此属性的默认值为 false。

topic | 要订阅的 Topic
messageSelector | 仅传送属性 与消息选择器表达式相匹配的消息。值为 null 或 空字符串表示该消息使用方没有消息选择器 。
noLocal | 如果设置，则禁止传送由其自己的连接发布的消息
Throws | JMSException: 如果会话由于某个内部错误无法创建订阅者。
Throws | InvalidDestinationException: 如果指定了无效的主题。
Throws | InvalidSelectorException: 如果消息选择器无效。
英文文档：

createSubscriber

TopicSubscriber createSubscriber(Topic topic,
                                 String messageSelector,
                                 boolean noLocal)
                                 throws JMSException
Creates a nondurable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.

A client uses a TopicSubscriber object to receive messages that have been published to a topic.

Regular TopicSubscriber objects are not durable. They receive only messages that are published while they are active.

Messages filtered out by a subscriber's message selector will never be delivered to the subscriber. From the subscriber's perspective, they do not exist.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection. The default value for this attribute is false.

Parameters:
topic - the Topic to subscribe to
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
noLocal - if set, inhibits the delivery of messages published by its own connection
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.
InvalidSelectorException - if the message selector is invalid.

public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
创建指定主题的持久订阅者。

如果客户端需要接收所有在主题上发布的消息，包括订阅者处于非活动状态时发布的消息，它使用持久 TopicSubscriber。JMS 提供者保留此持久订阅的记录并确保来自该主题发布者的所有消息能够一直保留，直到它们得到此持久订阅者的确认或消息过期。

具有持久订阅者的会话必须总是提供相同的客户端标识符。此外，每个客户端必须指定一个名称，该名称能够唯一地标识（在客户端标识符内）它所创建的每个持久订阅。一次只有一个会话可以拥有特定持久订阅的 TopicSubscriber。

客户端可以通过创建具有相同名称和新主题和/或消息选择器的持久 TopicSubscriber 来更改现有持久订阅。更改持久订阅者等效于取消订阅（删除）旧的持久订阅，并创建一个新的持久订阅。

在某些情况下，连接可以既发布又订阅主题。订阅者 NoLocal 属性允许订阅者禁止传送由其自己的连接发布的消息。 此属性的默认值为 false。

topic | 要订阅的非临时 Topic
name | 用于标识此订阅的名称
Throws | JMSException: 如果会话由于某个内部错误无法创建订阅者。
Throws | InvalidDestinationException: 如果指定了无效的主题。
英文文档：

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        String name)
                                        throws JMSException
Creates a durable subscriber to the specified topic.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name that uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection. The default value for this attribute is false.

Specified by:
createDurableSubscriber in interface Session
Parameters:
topic - the non-temporary Topic to subscribe to
name - the name used to identify this subscription
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.

public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
创建指定主题的持久订阅者， 使用消息选择器或指定是否应将由其自己的连接发布的 消息传送给它。

如果客户端需要接收所有在主题上发布的消息 ，包括订阅者处于非活动状态时发布的消息， 它使用持久 TopicSubscriber。JMS 提供者 保留此 持久订阅的记录并确保来自该主题发布者的所有消息 能够一直保留，直到它们得到此持久订阅者的确认 或消息过期。

具有持久订阅者的会话必须总是提供相同的 客户端标识符。此外，每个客户端必须指定一个名称，该名称能够 唯一地标识（在客户端标识符内） 它所创建的每个持久订阅。一次只有一个会话可以拥有特定持久订阅的 TopicSubscriber。 非活动持久订阅者是存在但 当前没有与之关联的消息使用方的订阅者。

客户端可以通过创建具有相同名称和新主题和/或消息选择器的 持久 TopicSubscriber 来更改 现有 持久订阅。更改持久订阅者等效于 取消订阅（删除）旧的持久订阅，并创建一个新的持久订阅。

topic | 要订阅的非临时 Topic
name | 用于标识此订阅的名称
messageSelector | 仅传送属性与消息选择器表达式相匹配的消息。值为 null 或空字符串表示该消息使用方没有消息选择器。
noLocal | 如果设置，则禁止传送由其自己的连接发布的消息
Throws | JMSException: 如果会话由于某个内部错误无法创建订阅者。
Throws | InvalidDestinationException: 如果指定了无效的主题。
Throws | InvalidSelectorException: 如果消息选择器无效。
英文文档：

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        String name,
                                        String messageSelector,
                                        boolean noLocal)
                                        throws JMSException
Creates a durable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name which uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription. An inactive durable subscriber is one that exists but does not currently have a message consumer associated with it.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

Specified by:
createDurableSubscriber in interface Session
Parameters:
topic - the non-temporary Topic to subscribe to
name - the name used to identify this subscription
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
noLocal - if set, inhibits the delivery of messages published by its own connection
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.
InvalidSelectorException - if the message selector is invalid.

public TopicPublisher createPublisher(Topic topic) throws JMSException
创建指定主题的发布者。

客户端使用 TopicPublisher 对象在主题上发布 消息。 每次客户端在主题上创建 TopicPublisher 时，它 都会定义 一个新的消息序列，该消息序列与客户端以前发送的消息 没有顺序关系。

topic | 要发布的 Topic；如果这是 未标识的生成方，则为 null
Throws | JMSException: 如果会话由于某个内部错误 无法创建发布者。
Throws | InvalidDestinationException: 如果指定了无效的主题。
英文文档：

createPublisher

TopicPublisher createPublisher(Topic topic)
                               throws JMSException
Creates a publisher for the specified topic.

A client uses a TopicPublisher object to publish messages on a topic. Each time a client creates a TopicPublisher on a topic, it defines a new sequence of messages that have no ordering relationship with the messages it has previously sent.

Parameters:
topic - the Topic to publish to, or null if this is an unidentified producer
Throws:
JMSException - if the session fails to create a publisher due to some internal error.
InvalidDestinationException - if an invalid topic is specified.

public TemporaryTopic createTemporaryTopic() throws JMSException
创建 TemporaryTopic 对象。其生命周期将是 TopicConnection 的生命周期，除非提前删除该对象。
return | 临时主题身份
Throws | JMSException: 如果会话由于某个内部错误无法创建临时主题。
英文文档：

createTemporaryTopic

TemporaryTopic createTemporaryTopic()
                                    throws JMSException
Creates a TemporaryTopic object. Its lifetime will be that of the TopicConnection unless it is deleted earlier.

Specified by:
createTemporaryTopic in interface Session
Returns:
a temporary topic identity
Throws:
JMSException - if the session fails to create a temporary topic due to some internal error.

public void unsubscribe(String name) throws JMSException
取消订阅客户端已创建的持久订阅。

此方法删除其提供者代表订阅者维持的状态 。

在该订阅存在活动的 TopicSubscriber 时， 或者当已使用的消息是挂起事务的一部分或 尚未在会话中得到确认时，客户端删除持久订阅是错误的。

name | 用于标识此订阅的名称
Throws | JMSException: 如果会话由于某个内部错误无法取消对持久订阅的订阅。
Throws | InvalidDestinationException: 如果指定了无效的订阅名称。
英文文档：

unsubscribe

void unsubscribe(String name)
                 throws JMSException
Unsubscribes a durable subscription that has been created by a client.

This method deletes the state being maintained on behalf of the subscriber by its provider.

It is erroneous for a client to delete a durable subscription while there is an active TopicSubscriber for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.

Specified by:
unsubscribe in interface Session
Parameters:
name - the name used to identify this subscription
Throws:
JMSException - if the session fails to unsubscribe to the durable subscription due to some internal error.
InvalidDestinationException - if an invalid subscription name is specified.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TopicSubscriber (Java EE 5)

javax.jms
Interface TopicSubscriber

All Superinterfaces:
MessageConsumer
public interface TopicSubscriber
extends MessageConsumer

Implements: MessageConsumer

客户端使用 TopicSubscriber 对象接收已发布到某个主题的消息。TopicSubscriber 对象是消息使用方的发布/订阅形式。MessageConsumer 可以使用 Session.createConsumer 创建。

TopicSession 允许为每个主题创建多个 TopicSubscriber 对象。它会将主题的每个消息传送给每个有资格接收它的订阅者。消息的每个副本都被视为完全不同的消息。对一个副本所做的工作不会影响其他副本；确认一个副本不等于确认其他副本；一个消息可能会立即传送，而另一个会等待其订阅者处理在它之前的消息。

常规 TopicSubscriber 对象不是持久的。它们仅接收在其活动状态下发布的消息。

订阅者的消息选择器过滤掉的消息将绝不会传送给订阅者。从订阅者的角度来看，这些消息不存在。

在某些情况下，连接可以既发布又订阅主题。订阅者 NoLocal 属性允许订阅者禁止传送由其自己的连接发布的消息。

如果客户端需要接收所有在主题上发布的消息，包括订阅者处于非活动状态时发布的消息，它使用持久 TopicSubscriber。JMS 提供者保留此持久订阅的记录并确保来自该主题发布者的所有消息能够一直保留，直到它们得到此持久订阅者的确认或消息过期。

具有持久订阅者的会话必须总是提供相同的客户端标识符。此外，每个客户端必须指定一个名称，该名称能够唯一地标识（在客户端标识符内）它所创建的每个持久订阅。一次只有一个会话可以拥有特定持久订阅的 TopicSubscriber。

客户端可以通过创建具有相同名称和新主题和/或消息选择器的持久 TopicSubscriber 来更改现有持久订阅。更改持久订阅等效于取消订阅（删除）旧的持久订阅，并创建一个新的持久订阅。

unsubscribe 方法用于删除持久订阅。unsubscribe 方法可以在 Session 或 TopicSession 级使用。此方法删除其提供者代表订阅者维持的状态。

创建 MessageConsumer 所提供的功能与创建 TopicSubscriber 所提供的功能相同。要创建持久订阅者，建议使用 Session.CreateDurableSubscriber。提供 TopicSubscriber 的目的是支持现有代码。

version
en
1.1 - February 2, 2002
See also createConsumer, createDurableSubscriber, javax.jms.TopicSession, createSubscriber, javax.jms.MessageConsumer
英文文档：

A client uses a TopicSubscriber object to receive messages that have been published to a topic. A TopicSubscriber object is the publish/subscribe form of a message consumer. A MessageConsumer can be created by using Session.createConsumer.

A TopicSession allows the creation of multiple TopicSubscriber objects per topic. It will deliver each message for a topic to each subscriber eligible to receive it. Each copy of the message is treated as a completely separate message. Work done on one copy has no effect on the others; acknowledging one does not acknowledge the others; one message may be delivered immediately, while another waits for its subscriber to process messages ahead of it.

Regular TopicSubscriber objects are not durable. They receive only messages that are published while they are active.

Messages filtered out by a subscriber's message selector will never be delivered to the subscriber. From the subscriber's perspective, they do not exist.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name that uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscription is equivalent to unsubscribing (deleting) the old one and creating a new one.

The unsubscribe method is used to delete a durable subscription. The unsubscribe method can be used at the Session or TopicSession level. This method deletes the state being maintained on behalf of the subscriber by its provider.

Creating a MessageConsumer provides the same features as creating a TopicSubscriber. To create a durable subscriber, use of Session.CreateDurableSubscriber is recommended. The TopicSubscriber is provided to support existing code.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session.createConsumer(javax.jms.Destination), Session.createDurableSubscriber(javax.jms.Topic, java.lang.String), TopicSession, TopicSession.createSubscriber(javax.jms.Topic), MessageConsumer

Method Summary
boolean | getNoLocal() Gets the NoLocal attribute for this subscriber.
Topic | getTopic() Gets the Topic associated with this subscriber.
Methods inherited from interface javax.jms.MessageConsumer
close, getMessageListener, getMessageSelector, receive, receive, receiveNoWait, setMessageListener

Method Detail

public Topic getTopic() throws JMSException
获取与此订阅者相关的 Topic。
return | 此订阅者的 Topic
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此主题订阅者的主题。
英文文档：

getTopic

Topic getTopic()
               throws JMSException
Gets the Topic associated with this subscriber.

Returns:
this subscriber's Topic
Throws:
JMSException - if the JMS provider fails to get the topic for this topic subscriber due to some internal error.

public boolean getNoLocal() throws JMSException
获取此订阅者的 NoLocal 属性。此属性的默认值为 false。
return | 如果禁止传送本地发布的消息，则返回 true
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取此主题订阅者的 NoLocal 属性。
英文文档：

getNoLocal

boolean getNoLocal()
                   throws JMSException
Gets the NoLocal attribute for this subscriber. The default value for this attribute is false.

Returns:
true if locally published messages are being inhibited
Throws:
JMSException - if the JMS provider fails to get the NoLocal attribute for this topic subscriber due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XAConnection (Java EE 5)

javax.jms
Interface XAConnection

All Superinterfaces:
Connection
All Known Subinterfaces:
XAQueueConnection, XATopicConnection
public interface XAConnection
extends Connection

Implements: Connection
Implemented by: XAQueueConnection, XATopicConnection

XAConnection 接口通过提供 XASession 扩展 Connection 的功能（可选）。

XAConnection 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 February 2, 2002
See also javax.jms.XAQueueConnection, javax.jms.XATopicConnection
英文文档：

The XAConnection interface extends the capability of Connection by providing an XASession (optional).

The XAConnection interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
XAQueueConnection, XATopicConnection

Method Summary
Session | createSession(boolean transacted, int acknowledgeMode) Creates an Session object.
XASession | createXASession() Creates an XASession object.
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, createDurableConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop

Method Detail

public XASession createXASession() throws JMSException
创建 XASession 对象。
return | 新建的 XASession
Throws | JMSException: 如果 XAConnection 对象由于某个内部错误无法创建 XASession。
since | 1.1
英文文档：

createXASession

XASession createXASession()
                          throws JMSException
Creates an XASession object.

Returns:
a newly created XASession
Throws:
JMSException - if the XAConnection object fails to create an XASession due to some internal error.
Since:
1.1

public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
创建 Session 对象。
transacted | 未定义用法
acknowledgeMode | 未定义用法
return | Session 对象
Throws | JMSException: 如果 XAConnection 对象由于某个内部错误无法创建 Session。
since | 1.1
英文文档：

createSession

Session createSession(boolean transacted,
                      int acknowledgeMode)
                      throws JMSException
Creates an Session object.

Specified by:
createSession in interface Connection
Parameters:
transacted - usage undefined
acknowledgeMode - usage undefined
Returns:
a Session object
Throws:
JMSException - if the XAConnection object fails to create an Session due to some internal error.
Since:
1.1
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XAConnectionFactory (Java EE 5)

javax.jms
Interface XAConnectionFactory

All Known Subinterfaces:
XAQueueConnectionFactory, XATopicConnectionFactory
public interface XAConnectionFactory

Implemented by: XAQueueConnectionFactory, XATopicConnectionFactory

XAConnectionFactory 接口是 XAQueueConnectionFactory 和 XATopicConnectionFactory 接口的基接口。

某些应用服务器支持将具有 JTS 功能的资源使用分组成分布式事务（可选）。要在 JTS 事务中包含 JMS API 事务，应用服务器需要 JTS 感知的 JMS 提供者。JMS 提供者使用 XAConnectionFactory 对象公开其 JTS 支持，应用服务器使用该对象创建 XAConnection 对象。

XAConnectionFactory 对象是 JMS 管理对象，就像 ConnectionFactory 对象一样。根据预期应用服务器将使用 Java Naming and Directory Interface (JNDI) API 查找这些对象。

XAConnectionFactory 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 April 4, 2002
See also javax.jms.XAQueueConnectionFactory, javax.jms.XATopicConnectionFactory
英文文档：

The XAConnectionFactory interface is a base interface for the XAQueueConnectionFactory and XATopicConnectionFactory interfaces.

Some application servers provide support for grouping JTS capable resource use into a distributed transaction (optional). To include JMS API transactions in a JTS transaction, an application server requires a JTS aware JMS provider. A JMS provider exposes its JTS support using an XAConnectionFactory object, which an application server uses to create XAConnection objects.

XAConnectionFactory objects are JMS administered objects, just like ConnectionFactory objects. It is expected that application servers will find them using the Java Naming and Directory Interface (JNDI) API.

The XAConnectionFactory interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 April 4, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
XAQueueConnectionFactory, XATopicConnectionFactory

Method Summary
XAConnection | createXAConnection() Creates an XAConnection with the default user identity.
XAConnection | createXAConnection(String userName, String password) Creates an XA connection with the specified user identity.

Method Detail

public XAConnection createXAConnection() throws JMSException
创建带有默认用户身份的 XAConnection。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
return | 新建的 XAConnection
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
since | 1.1
英文文档：

createXAConnection

XAConnection createXAConnection()
                                throws JMSException
Creates an XAConnection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Returns:
a newly created XAConnection
Throws:
JMSException - if the JMS provider fails to create an XA connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Since:
1.1

public XAConnection createXAConnection(String userName, String password) throws JMSException
创建带有指定用户身份的 XA 连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
userName | 调用者的用户名
password | 调用者的密码
return | 新建的 XA 连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
since | 1.1
英文文档：

createXAConnection

XAConnection createXAConnection(String userName,
                                String password)
                                throws JMSException
Creates an XA connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created XA connection
Throws:
JMSException - if the JMS provider fails to create an XA connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Since:
1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XAQueueConnection (Java EE 5)

javax.jms
Interface XAQueueConnection

All Superinterfaces:
Connection, QueueConnection, XAConnection
public interface XAQueueConnection
extends XAConnection, QueueConnection

Implements: XAConnection, QueueConnection

XAQueueConnection 提供的创建选项与 QueueConnection 提供的相同（可选）。唯一的不同之处是 XAConnection 按定义是事务性的。

XAQueueConnection 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 February 2 - 2002
See also javax.jms.XAConnection
英文文档：

An XAQueueConnection provides the same create options as QueueConnection (optional). The only difference is that an XAConnection is by definition transacted.

The XAQueueConnection interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 February 2 - 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
XAConnection

Method Summary
QueueSession | createQueueSession(boolean transacted, int acknowledgeMode) Creates an XAQueueSession object.
XAQueueSession | createXAQueueSession() Creates an XAQueueSession object.
Methods inherited from interface javax.jms.XAConnection
createSession, createXASession
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, createDurableConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
Methods inherited from interface javax.jms.QueueConnection
createConnectionConsumer
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, createDurableConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop

Method Detail

public XAQueueSession createXAQueueSession() throws JMSException
创建 XAQueueSession 对象。
return | 新建的 XAQueueSession
Throws | JMSException: 如果 XAQueueConnection 对象由于某个内部错误无法创建 XA 队列会话。
英文文档：

createXAQueueSession

XAQueueSession createXAQueueSession()
                                    throws JMSException
Creates an XAQueueSession object.

Returns:
a newly created XAQueueSession
Throws:
JMSException - if the XAQueueConnection object fails to create an XA queue session due to some internal error.

public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
创建 XAQueueSession 对象。
transacted | 未定义用法
acknowledgeMode | 未定义用法
return | 新建的 XAQueueSession
Throws | JMSException: 如果 XAQueueConnection 对象由于某个内部错误无法创建 XA 队列会话。
英文文档：

createQueueSession

QueueSession createQueueSession(boolean transacted,
                                int acknowledgeMode)
                                throws JMSException
Creates an XAQueueSession object.

Specified by:
createQueueSession in interface QueueConnection
Parameters:
transacted - usage undefined
acknowledgeMode - usage undefined
Returns:
a newly created XAQueueSession
Throws:
JMSException - if the XAQueueConnection object fails to create an XA queue session due to some internal error.
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XAQueueConnectionFactory (Java EE 5)

javax.jms
Interface XAQueueConnectionFactory

All Superinterfaces:
ConnectionFactory, QueueConnectionFactory, XAConnectionFactory
public interface XAQueueConnectionFactory
extends XAConnectionFactory, QueueConnectionFactory

Implements: XAConnectionFactory, QueueConnectionFactory

XAQueueConnectionFactory 提供的创建选项与 QueueConnectionFactory 提供的相同（可选）。

XATopicConnectionFactory 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 - 8 April 2002
See also javax.jms.QueueConnectionFactory, javax.jms.XAConnectionFactory
英文文档：

An XAQueueConnectionFactory provides the same create options as a QueueConnectionFactory (optional).

The XATopicConnectionFactory interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 - 8 April 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
QueueConnectionFactory, XAConnectionFactory

Method Summary
XAQueueConnection | createXAQueueConnection() Creates an XA queue connection with the default user identity.
XAQueueConnection | createXAQueueConnection(String userName, String password) Creates an XA queue connection with the specified user identity.
Methods inherited from interface javax.jms.XAConnectionFactory
createXAConnection, createXAConnection
Methods inherited from interface javax.jms.QueueConnectionFactory
createQueueConnection, createQueueConnection
Methods inherited from interface javax.jms.ConnectionFactory
createConnection, createConnection

Method Detail

public XAQueueConnection createXAQueueConnection() throws JMSException
创建带有默认用户身份的 XA 队列连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
return | 新建的 XA 队列连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 队列连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createXAQueueConnection

XAQueueConnection createXAQueueConnection()
                                          throws JMSException
Creates an XA queue connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Returns:
a newly created XA queue connection
Throws:
JMSException - if the JMS provider fails to create an XA queue connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.

public XAQueueConnection createXAQueueConnection(String userName, String password) throws JMSException
创建带有指定用户身份的 XA 队列连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
userName | 调用者的用户名
password | 调用者的密码
return | 新建的 XA 队列连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 队列连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createXAQueueConnection

XAQueueConnection createXAQueueConnection(String userName,
                                          String password)
                                          throws JMSException
Creates an XA queue connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created XA queue connection
Throws:
JMSException - if the JMS provider fails to create an XA queue connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XAQueueSession (Java EE 5)

javax.jms
Interface XAQueueSession

All Superinterfaces:
Runnable, Session, XASession
public interface XAQueueSession
extends XASession

Implements: XASession

XAQueueSession 提供常规 QueueSession，可用于创建 QueueReceiver、QueueSender 和 QueueBrowser 对象（可选）。

XAQueueSession 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 - February 2, 2002
See also javax.jms.XASession
英文文档：

An XAQueueSession provides a regular QueueSession, which can be used to create QueueReceiver, QueueSender, and QueueBrowser objects (optional).

The XAQueueSession interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
XASession

Field Summary
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
Method Summary
 QueueSession getQueueSession()
Gets the queue session associated with this XAQueueSession.
Methods inherited from interface javax.jms.XASession
commit, getSession, getTransacted, getXAResource, rollback
Methods inherited from interface javax.jms.Session
close, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, recover, run, setMessageListener, unsubscribe

Method Detail

public QueueSession getQueueSession() throws JMSException
获取与此 XAQueueSession 关联的队列会话。
return | 队列会话对象
Throws | JMSException: 如果发生内部错误。
英文文档：

getQueueSession

QueueSession getQueueSession()
                             throws JMSException
Gets the queue session associated with this XAQueueSession.

Returns:
the queue session object
Throws:
JMSException - if an internal error occurs.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XASession (Java EE 5)

javax.jms
Interface XASession

All Superinterfaces:
Runnable, Session
All Known Subinterfaces:
XAQueueSession, XATopicSession
public interface XASession
extends Session

Implements: Session
Implemented by: XAQueueSession, XATopicSession

XASession 接口扩展了 Session 的功能，它可以通过 JMS 提供者支持 Java Transaction API (JTA)（可选）。此支持采用 javax.transaction.xa.XAResource 对象的形式。此对象的功能与标准 X/Open XA Resource 接口定义的功能非常类似。

应用服务器通过获取 XASession 的 XAResource 控制其事务分配。它使用 XAResource 将会话分配给事务、准备和提交事务工作等。

XAResource 提供了一些相当复杂的工具来交错多个事务的工作、恢复正在进行的事务列表等。JTA 感知的 JMS 提供者必须完全实现此功能。可以使用支持 XA 的数据库服务来实现此功能，或者 JMS 提供者可以选择从头开始实现此功能。

为应用服务器客户端提供了它认为是常规的 JMS Session。应用服务器在后台控制底层 XASession 的事务管理。

XASession 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 February 2, 2002
See also javax.jms.Session
英文文档：

The XASession interface extends the capability of Session by adding access to a JMS provider's support for the Java Transaction API (JTA) (optional). This support takes the form of a javax.transaction.xa.XAResource object. The functionality of this object closely resembles that defined by the standard X/Open XA Resource interface.

An application server controls the transactional assignment of an XASession by obtaining its XAResource. It uses the XAResource to assign the session to a transaction, prepare and commit work on the transaction, and so on.

An XAResource provides some fairly sophisticated facilities for interleaving work on multiple transactions, recovering a list of transactions in progress, and so on. A JTA aware JMS provider must fully implement this functionality. This could be done by using the services of a database that supports XA, or a JMS provider may choose to implement this functionality from scratch.

A client of the application server is given what it thinks is a regular JMS Session. Behind the scenes, the application server controls the transaction management of the underlying XASession.

The XASession interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
Session

Field Summary
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
Method Summary
void | commit() Throws a TransactionInProgressException, since it should not be called for an XASession object.
Session | getSession() Gets the session associated with this XASession.
boolean | getTransacted() Indicates whether the session is in transacted mode.
XAResource | getXAResource() Returns an XA resource to the caller.
void | rollback() Throws a TransactionInProgressException, since it should not be called for an XASession object.
Methods inherited from interface javax.jms.Session
close, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, recover, run, setMessageListener, unsubscribe

Method Detail

public Session getSession() throws JMSException
获取与此 XASession 关联的会话。
return | 会话对象
Throws | JMSException: 如果发生内部错误。
since | 1.1
英文文档：

getSession

Session getSession()
                   throws JMSException
Gets the session associated with this XASession.

Returns:
the session object
Throws:
JMSException - if an internal error occurs.
Since:
1.1

public XAResource getXAResource()
返回调用者的 XA 资源。
return 调用者的 XA 资源
英文文档：

getXAResource

XAResource getXAResource()
Returns an XA resource to the caller.

Returns:
an XA resource to the caller

public boolean getTransacted() throws JMSException
指示会话是否处于事务性模式。
return
en
true
Throws JMSException: 如果 JMS 提供者由于某个内部错误无法返回事务模式。
英文文档：

getTransacted

boolean getTransacted()
                      throws JMSException
Indicates whether the session is in transacted mode.

Specified by:
getTransacted in interface Session
Returns:
true
Throws:
JMSException - if the JMS provider fails to return the transaction mode due to some internal error.

public void commit() throws JMSException
抛出 TransactionInProgressException，因为不应对 XASession 对象调用它。
Throws TransactionInProgressException: 如果对 XASession 调用此方法。
英文文档：

commit

void commit()
            throws JMSException
Throws a TransactionInProgressException, since it should not be called for an XASession object.

Specified by:
commit in interface Session
Throws:
TransactionInProgressException - if the method is called on an XASession.
JMSException - if the JMS provider fails to commit the transaction due to some internal error.
TransactionRolledBackException - if the transaction is rolled back due to some internal error during commit.
IllegalStateException - if the method is not called by a transacted session.

public void rollback() throws JMSException
抛出 TransactionInProgressException，因为不应对 XASession 对象调用它。
Throws TransactionInProgressException: 如果对 XASession 调用此方法。
英文文档：

rollback

void rollback()
              throws JMSException
Throws a TransactionInProgressException, since it should not be called for an XASession object.

Specified by:
rollback in interface Session
Throws:
TransactionInProgressException - if the method is called on an XASession.
JMSException - if the JMS provider fails to roll back the transaction due to some internal error.
IllegalStateException - if the method is not called by a transacted session.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XATopicConnection (Java EE 5)

javax.jms
Interface XATopicConnection

All Superinterfaces:
Connection, TopicConnection, XAConnection
public interface XATopicConnection
extends XAConnection, TopicConnection

Implements: XAConnection, TopicConnection

XATopicConnection 提供的创建选项与 TopicConnection 提供的相同（可选）。创建的 Topic 连接是事务型的。

XATopicConnection 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 - February 2, 2002
See also javax.jms.XAConnection
英文文档：

An XATopicConnection provides the same create options as TopicConnection (optional). The Topic connections created are transactional.

The XATopicConnection interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 - February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
XAConnection

Method Summary
TopicSession | createTopicSession(boolean transacted, int acknowledgeMode) Creates an XATopicSession object.
XATopicSession | createXATopicSession() Creates an XATopicSession object.
Methods inherited from interface javax.jms.XAConnection
createSession, createXASession
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
Methods inherited from interface javax.jms.TopicConnection
createConnectionConsumer, createDurableConnectionConsumer
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop

Method Detail

public XATopicSession createXATopicSession() throws JMSException
创建 XATopicSession 对象。
return | 新建的 XA 主题会话
Throws | JMSException: 如果 XATopicConnection 对象由于某个内部错误无法创建 XA 主题会话。
英文文档：

createXATopicSession

XATopicSession createXATopicSession()
                                    throws JMSException
Creates an XATopicSession object.

Returns:
a newly created XA topic session
Throws:
JMSException - if the XATopicConnection object fails to create an XA topic session due to some internal error.

public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
创建 XATopicSession 对象。
transacted | 未定义用法
acknowledgeMode | 未定义用法
return | 新建的 XA 主题会话
Throws | JMSException: 如果 XATopicConnection 对象由于某个内部错误无法创建 XA 主题会话。
英文文档：

createTopicSession

TopicSession createTopicSession(boolean transacted,
                                int acknowledgeMode)
                                throws JMSException
Creates an XATopicSession object.

Specified by:
createTopicSession in interface TopicConnection
Parameters:
transacted - usage undefined
acknowledgeMode - usage undefined
Returns:
a newly created XA topic session
Throws:
JMSException - if the XATopicConnection object fails to create an XA topic session due to some internal error.
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XATopicConnectionFactory (Java EE 5)

javax.jms
Interface XATopicConnectionFactory

All Superinterfaces:
ConnectionFactory, TopicConnectionFactory, XAConnectionFactory
public interface XATopicConnectionFactory
extends XAConnectionFactory, TopicConnectionFactory

Implements: XAConnectionFactory, TopicConnectionFactory

XATopicConnectionFactory 提供的创建选项与 TopicConnectionFactory 提供的相同（可选）。

XATopicConnectionFactory 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 February 2, 2002
See also javax.jms.TopicConnectionFactory, javax.jms.XAConnectionFactory
英文文档：

An XATopicConnectionFactory provides the same create options as a TopicConnectionFactory (optional).

The XATopicConnectionFactory interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
1.1 February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
TopicConnectionFactory, XAConnectionFactory

Method Summary
XATopicConnection | createXATopicConnection() Creates an XA topic connection with the default user identity.
XATopicConnection | createXATopicConnection(String userName, String password) Creates an XA topic connection with the specified user identity.
Methods inherited from interface javax.jms.XAConnectionFactory
createXAConnection, createXAConnection
Methods inherited from interface javax.jms.TopicConnectionFactory
createTopicConnection, createTopicConnection
Methods inherited from interface javax.jms.ConnectionFactory
createConnection, createConnection

Method Detail

public XATopicConnection createXATopicConnection() throws JMSException
创建带有默认用户身份的 XA 主题连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
return | 新建的 XA 主题连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 主题连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createXATopicConnection

XATopicConnection createXATopicConnection()
                                          throws JMSException
Creates an XA topic connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Returns:
a newly created XA topic connection
Throws:
JMSException - if the JMS provider fails to create an XA topic connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.

public XATopicConnection createXATopicConnection(String userName, String password) throws JMSException
创建带有指定用户身份的 XA 主题连接。以停止模式创建连接。在显式调用 Connection.start 方法前，不会传送任何消息。
userName | 调用者的用户名
password | 调用者的密码
return | 新建的 XA 主题连接
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 主题连接。
Throws | JMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
英文文档：

createXATopicConnection

XATopicConnection createXATopicConnection(String userName,
                                          String password)
                                          throws JMSException
Creates an XA topic connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created XA topic connection
Throws:
JMSException - if the JMS provider fails to create an XA topic connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XATopicSession (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.jms
Interface XATopicSession

All Superinterfaces:
Runnable, Session, XASession
public interface XATopicSession
extends XASession

Implements: XASession

XATopicSession 提供常规 TopicSession，可用于创建 TopicSubscriber 和 TopicPublisher 对象（可选）。

XATopicSession 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用，以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持，而不是直接使用这些 XA 接口。

version
en
1.1 February 2, 2002
See also javax.jms.XASession, javax.jms.TopicSession
英文文档：

An XATopicSession provides a regular TopicSession. which can be used to create TopicSubscriber and TopicPublisher objects (optional).

The XATopicSession interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than using these XA interfaces directly.

Version:
1.1 February 2, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
XASession, TopicSession

Field Summary
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
Method Summary
 TopicSession getTopicSession()
Gets the topic session associated with this XATopicSession.
Methods inherited from interface javax.jms.XASession
commit, getSession, getTransacted, getXAResource, rollback
Methods inherited from interface javax.jms.Session
close, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, recover, run, setMessageListener, unsubscribe

Method Detail

public TopicSession getTopicSession() throws JMSException
获取与此 XATopicSession 关联的主题会话。
return | 主题会话对象
Throws | JMSException: 如果发生内部错误。
英文文档：

getTopicSession

TopicSession getTopicSession()
                             throws JMSException
Gets the topic session associated with this XATopicSession.

Returns:
the topic session object
Throws:
JMSException - if an internal error occurs.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


QueueRequestor (Java EE 5)

javax.jms
Class QueueRequestor

java.lang.Object
    extended by  javax.jms.QueueRequestor

public class QueueRequestor
extends Object

QueueRequestor 帮助类简化了服务请求的建立。

QueueRequestor 构造方法提供有非事务性 QueueSession 和目的地 Queue。它创建用于响应的 TemporaryQueue，并提供发送请求消息和等待其回复的 request 方法。

这是基本的请求/回复抽象，应该足以满足大部分使用情况。JMS 提供者和客户端可以随意创建更复杂的版本。

version
en
1.0 - 8 July 1998
See also javax.jms.TopicRequestor
英文文档：

The QueueRequestor helper class simplifies making service requests.

The QueueRequestor constructor is given a non-transacted QueueSession and a destination Queue. It creates a TemporaryQueue for the responses and provides a request method that sends the request message and waits for its reply.

This is a basic request/reply abstraction that should be sufficient for most uses. JMS providers and clients are free to create more sophisticated versions.

Version:
1.0 - 8 July 1998
Author:
Mark Hapner, Rich Burridge
See Also:
TopicRequestor

Constructor Summary
QueueRequestor(QueueSession session, Queue queue)
Constructor for the QueueRequestor class.
Method Summary
void | close() Closes the QueueRequestor and its session.
Message | request(Message message) Sends a request and waits for a reply.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public QueueRequestor(QueueSession session, Queue queue) throws JMSException
QueueRequestor 类的构造方法。

此实现假定没有处理 session 参数，提交模式为 AUTO_ACKNOWLEDGE 或 DUPS_OK_ACKNOWLEDGE。

session | 队列所属的 QueueSession
queue | 要执行请求/回复调用的队列
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 QueueRequestor。
Throws | InvalidDestinationException: 如果指定了无效的队列。
英文文档：

QueueRequestor

public QueueRequestor(QueueSession session,
                      Queue queue)
               throws JMSException
Constructor for the QueueRequestor class.

This implementation assumes the session parameter to be non-transacted, with a delivery mode of either AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE.

Parameters:
session - the QueueSession the queue belongs to
queue - the queue to perform the request/reply call on
Throws:
JMSException - if the JMS provider fails to create the QueueRequestor due to some internal error.
InvalidDestinationException - if an invalid queue is specified.
Method Detail

public Message request(Message message) throws JMSException
发送请求并等待回复。临时队列用于 JMSReplyTo 目的地，而且要求每个请求只有一个回复。
message | 要发送的消息
return | 回复消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法完成请求。
英文文档：

request

public Message request(Message message)
                throws JMSException
Sends a request and waits for a reply. The temporary queue is used for the JMSReplyTo destination, and only one reply per request is expected.

Parameters:
message - the message to send
Returns:
the reply message
Throws:
JMSException - if the JMS provider fails to complete the request due to some internal error.

public void close() throws JMSException
关闭 QueueRequestor 及其会话。

由于提供者可能会代表 QueueRequestor 分配 Java 虚拟机之外的某些资源，因此不需要这些资源时客户端应该关闭它们。依赖于垃圾收集最终回收这些资源可能不够及时。

注意，此方法关闭传递给 QueueRequestor 构造方法的 QueueSession 对象。

Throws JMSException: 如果 JMS 提供者由于某个内部错误无法关闭 QueueRequestor。
英文文档：

close

public void close()
           throws JMSException
Closes the QueueRequestor and its session.

Since a provider may allocate some resources on behalf of a QueueRequestor outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Note that this method closes the QueueSession object passed to the QueueRequestor constructor.

Throws:
JMSException - if the JMS provider fails to close the QueueRequestor due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TopicRequestor (Java EE 5)

javax.jms
Class TopicRequestor

java.lang.Object
    extended by  javax.jms.TopicRequestor

public class TopicRequestor
extends Object

TopicRequestor 帮助类简化了服务请求的建立。

TopicRequestor 构造方法提供有非事务性 TopicSession 和目的地 Topic。它创建用于响应的 TemporaryTopic，并提供发送请求消息和等待其回复的 request 方法。

这是基本的请求/回复抽象，应该足以满足大部分使用情况。JMS 提供者和客户端可以随意创建更复杂的版本。

version
en
1.0 - 8 July 1998
See also javax.jms.QueueRequestor
英文文档：

The TopicRequestor helper class simplifies making service requests.

The TopicRequestor constructor is given a non-transacted TopicSession and a destination Topic. It creates a TemporaryTopic for the responses and provides a request method that sends the request message and waits for its reply.

This is a basic request/reply abstraction that should be sufficient for most uses. JMS providers and clients are free to create more sophisticated versions.

Version:
1.0 - 8 July 1998
Author:
Mark Hapner, Rich Burridge
See Also:
QueueRequestor

Constructor Summary
TopicRequestor(TopicSession session, Topic topic)
Constructor for the TopicRequestor class.
Method Summary
void | close() Closes the TopicRequestor and its session.
Message | request(Message message) Sends a request and waits for a reply.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public TopicRequestor(TopicSession session, Topic topic) throws JMSException
TopicRequestor 类的构造方法。

此实现假定会话参数为非事务性，传送模式为 AUTO_ACKNOWLEDGE 或 DUPS_OK_ACKNOWLEDGE。

session | 主题所属的 TopicSession
topic | 要执行请求/回复调用的主题
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法创建 TopicRequestor。
Throws | InvalidDestinationException: 如果指定了无效的主题。
英文文档：

TopicRequestor

public TopicRequestor(TopicSession session,
                      Topic topic)
               throws JMSException
Constructor for the TopicRequestor class.

This implementation assumes the session parameter to be non-transacted, with a delivery mode of either AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE.

Parameters:
session - the TopicSession the topic belongs to
topic - the topic to perform the request/reply call on
Throws:
JMSException - if the JMS provider fails to create the TopicRequestor due to some internal error.
InvalidDestinationException - if an invalid topic is specified.
Method Detail

public Message request(Message message) throws JMSException
发送请求并等待回复。临时主题用于 JMSReplyTo 目的地；返回第一个回复，并丢弃后面的回复。
message | 要发送的消息
return | 回复消息
Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法完成请求。
英文文档：

request

public Message request(Message message)
                throws JMSException
Sends a request and waits for a reply. The temporary topic is used for the JMSReplyTo destination; the first reply is returned, and any following replies are discarded.

Parameters:
message - the message to send
Returns:
the reply message
Throws:
JMSException - if the JMS provider fails to complete the request due to some internal error.

public void close() throws JMSException
关闭 TopicRequestor 及其会话。

由于提供者可能会代表 TopicRequestor 分配 Java 虚拟机之外的某些资源，因此不需要这些资源时客户端应该关闭它们。依赖于垃圾收集最终回收这些资源可能不够及时。

注意，此方法关闭传递给 TopicRequestor 构造方法的 TopicSession 对象。

Throws JMSException: 如果 JMS 提供者由于某个内部错误无法关闭 TopicRequestor。
英文文档：

close

public void close()
           throws JMSException
Closes the TopicRequestor and its session.

Since a provider may allocate some resources on behalf of a TopicRequestor outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Note that this method closes the TopicSession object passed to the TopicRequestor constructor.

Throws:
JMSException - if the JMS provider fails to close the TopicRequestor due to some internal error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IllegalStateException (Java EE 5)

javax.jms
Class IllegalStateException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.IllegalStateException
All Implemented Interfaces:
Serializable
public class IllegalStateException
extends JMSException

Extends: Throwable > Exception > JMSException

在非法或不适当的时间调用方法或者提供者未处于所请求操作的适当状态时，抛出此异常。例如，如果在非事务性会话上调用 Session.commit，则必定抛出此异常。当调用某个不适合于域的方法时，如调用 TopicSession.CreateQueueBrowser，也会抛出此异常。

version
en
April 9, 2002
英文文档：

This exception is thrown when a method is invoked at an illegal or inappropriate time or if the provider is not in an appropriate state for the requested operation. For example, this exception must be thrown if Session.commit is called on a non-transacted session. This exception is also called when a domain inappropriate method is called, such as calling TopicSession.CreateQueueBrowser.

Version:
April 9, 2002
Author:
Rahul Sharma, Kate Stout
See Also:
Serialized Form

Constructor Summary
IllegalStateException(String reason)
Constructs an IllegalStateException with the specified reason.
IllegalStateException(String reason, String errorCode)
Constructs an IllegalStateException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public IllegalStateException(String reason, String errorCode)
构造带指定原因和错误代码的 IllegalStateException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

IllegalStateException

public IllegalStateException(String reason,
                             String errorCode)
Constructs an IllegalStateException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public IllegalStateException(String reason)
构造带指定原因的 IllegalStateException。错误代码默认为 null。
reason 对异常的描述
英文文档：

IllegalStateException

public IllegalStateException(String reason)
Constructs an IllegalStateException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidClientIDException (Java EE 5)

javax.jms
Class InvalidClientIDException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.InvalidClientIDException
All Implemented Interfaces:
Serializable
public class InvalidClientIDException
extends JMSException

Extends: Throwable > Exception > JMSException

当客户端尝试将连接的客户端 ID 设置为被提供者拒绝的值时，必定抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when a client attempts to set a connection's client ID to a value that is rejected by a provider.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
InvalidClientIDException(String reason)
Constructs an InvalidClientIDException with the specified reason.
InvalidClientIDException(String reason, String errorCode)
Constructs an InvalidClientIDException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public InvalidClientIDException(String reason, String errorCode)
构造带指定原因和错误代码的 InvalidClientIDException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

InvalidClientIDException

public InvalidClientIDException(String reason,
                                String errorCode)
Constructs an InvalidClientIDException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public InvalidClientIDException(String reason)
构造带指定原因的 InvalidClientIDException。错误代码默认为 null。
reason 对异常的描述
英文文档：

InvalidClientIDException

public InvalidClientIDException(String reason)
Constructs an InvalidClientIDException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidDestinationException (Java EE 5)

javax.jms
Class InvalidDestinationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.InvalidDestinationException
All Implemented Interfaces:
Serializable
public class InvalidDestinationException
extends JMSException

Extends: Throwable > Exception > JMSException

当目的地不被提供者理解或不再有效时，必定抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when a destination either is not understood by a provider or is no longer valid.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
InvalidDestinationException(String reason)
Constructs an InvalidDestinationException with the specified reason.
InvalidDestinationException(String reason, String errorCode)
Constructs an InvalidDestinationException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public InvalidDestinationException(String reason, String errorCode)
构造带指定原因和错误代码的 InvalidDestinationException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

InvalidDestinationException

public InvalidDestinationException(String reason,
                                   String errorCode)
Constructs an InvalidDestinationException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public InvalidDestinationException(String reason)
构造带指定原因的 InvalidDestinationException。错误代码默认为 null。
reason 对异常的描述
英文文档：

InvalidDestinationException

public InvalidDestinationException(String reason)
Constructs an InvalidDestinationException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidSelectorException (Java EE 5)

javax.jms
Class InvalidSelectorException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.InvalidSelectorException
All Implemented Interfaces:
Serializable
public class InvalidSelectorException
extends JMSException

Extends: Throwable > Exception > JMSException

当 JMS 客户端尝试为提供者提供带有无效语法的消息选择器时，必定抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when a JMS client attempts to give a provider a message selector with invalid syntax.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
InvalidSelectorException(String reason)
Constructs an InvalidSelectorException with the specified reason.
InvalidSelectorException(String reason, String errorCode)
Constructs an InvalidSelectorException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public InvalidSelectorException(String reason, String errorCode)
构造带指定原因和错误代码的 InvalidSelectorException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

InvalidSelectorException

public InvalidSelectorException(String reason,
                                String errorCode)
Constructs an InvalidSelectorException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public InvalidSelectorException(String reason)
构造带指定原因的 InvalidSelectorException。错误代码默认为 null。
reason 对异常的描述
英文文档：

InvalidSelectorException

public InvalidSelectorException(String reason)
Constructs an InvalidSelectorException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSException (Java EE 5)

javax.jms
Class JMSException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IllegalStateException, InvalidClientIDException, InvalidDestinationException, InvalidSelectorException, JMSSecurityException, MessageEOFException, MessageFormatException, MessageNotReadableException, MessageNotWriteableException, ResourceAllocationException, TransactionInProgressException, TransactionRolledBackException
public class JMSException
extends Exception

Extends: Throwable > Exception
Extended by: IllegalStateException, InvalidClientIDException, InvalidDestinationException, InvalidSelectorException, JMSSecurityException, MessageEOFException, MessageFormatException, MessageNotReadableException, MessageNotWriteableException, ResourceAllocationException, TransactionInProgressException, TransactionRolledBackException

这是所有 JMS API 异常的根类。

它提供以下信息：

  • 描述错误的特定于提供者的字符串。此字符串是标准异常消息，可通过 getMessage 方法获得。
  • 特定于提供者的字符串错误代码
  • 对其他异常的引用。通常，JMS API 异常是某个低级问题导致的。如果合适的话，此低级异常可以链接到 JMS API 异常。
version
en
1.0 - 5 Oct 1998
英文文档：

This is the root class of all JMS API exceptions.

It provides the following information:

  • A provider-specific string describing the error. This string is the standard exception message and is available via the getMessage method.
  • A provider-specific string error code
  • A reference to another exception. Often a JMS API exception will be the result of a lower-level problem. If appropriate, this lower-level exception can be linked to the JMS API exception.

Version:
1.0 - 5 Oct 1998
Author:
Mark Hapner, Rich Burridge
See Also:
Serialized Form

Constructor Summary
JMSException(String reason)
Constructs a JMSException with the specified reason and with the error code defaulting to null.
JMSException(String reason, String errorCode)
Constructs a JMSException with the specified reason and error code.
Method Summary
String | getErrorCode() Gets the vendor-specific error code.
Exception | getLinkedException() Gets the exception linked to this one.
void | setLinkedException(Exception ex) Adds a linked Exception.
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

public JMSException(String reason, String errorCode)
构造带指定原因和错误代码的 JMSException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

JMSException

public JMSException(String reason,
                    String errorCode)
Constructs a JMSException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public JMSException(String reason)
构造带指定原因和默认为 null 的错误代码的 JMSException。
reason 对异常的描述
英文文档：

JMSException

public JMSException(String reason)
Constructs a JMSException with the specified reason and with the error code defaulting to null.

Parameters:
reason - a description of the exception
Method Detail

public String getErrorCode()
获取特定于供应商的错误代码。
return 指定特定于供应商的错误代码的字符串
英文文档：

getErrorCode

public String getErrorCode()
Gets the vendor-specific error code.

Returns:
a string specifying the vendor-specific error code

public Exception getLinkedException()
获取与此异常链接的异常。
return 链接的 Exception；如果不存在，则返回 null
英文文档：

getLinkedException

public Exception getLinkedException()
Gets the exception linked to this one.

Returns:
the linked Exception, null if none

public void setLinkedException(Exception ex)
添加链接的 Exception。
ex 链接的 Exception
英文文档：

setLinkedException

public void setLinkedException(Exception ex)
Adds a linked Exception.

Parameters:
ex - the linked Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSSecurityException (Java EE 5)

javax.jms
Class JMSSecurityException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.JMSSecurityException
All Implemented Interfaces:
Serializable
public class JMSSecurityException
extends JMSException

Extends: Throwable > Exception > JMSException

当提供者拒绝客户端提交的用户名/密码时，必定抛出此异常。当安全限制阻止某方法完成时也可能抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when a provider rejects a user name/password submitted by a client. It may also be thrown for any case where a security restriction prevents a method from completing.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
JMSSecurityException(String reason)
Constructs a JMSSecurityException with the specified reason.
JMSSecurityException(String reason, String errorCode)
Constructs a JMSSecurityException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public JMSSecurityException(String reason, String errorCode)
构造带指定原因和错误代码的 JMSSecurityException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

JMSSecurityException

public JMSSecurityException(String reason,
                            String errorCode)
Constructs a JMSSecurityException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public JMSSecurityException(String reason)
构造带指定原因的 JMSSecurityException。错误代码默认为 null。
reason 对异常的描述
英文文档：

JMSSecurityException

public JMSSecurityException(String reason)
Constructs a JMSSecurityException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageEOFException (Java EE 5)

javax.jms
Class MessageEOFException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.MessageEOFException
All Implemented Interfaces:
Serializable
public class MessageEOFException
extends JMSException

Extends: Throwable > Exception > JMSException

如果在读取 StreamMessage 或 BytesMessage 时意外到达消息流末尾，则必定抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when an unexpected end of stream has been reached when a StreamMessage or BytesMessage is being read.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
MessageEOFException(String reason)
Constructs a MessageEOFException with the specified reason.
MessageEOFException(String reason, String errorCode)
Constructs a MessageEOFException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public MessageEOFException(String reason, String errorCode)
构造带指定原因和错误代码的 MessageEOFException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

MessageEOFException

public MessageEOFException(String reason,
                           String errorCode)
Constructs a MessageEOFException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public MessageEOFException(String reason)
构造带指定原因的 MessageEOFException。错误代码默认为 null。
reason 对异常的描述
英文文档：

MessageEOFException

public MessageEOFException(String reason)
Constructs a MessageEOFException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageFormatException (Java EE 5)

javax.jms
Class MessageFormatException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.MessageFormatException
All Implemented Interfaces:
Serializable
public class MessageFormatException
extends JMSException

Extends: Throwable > Exception > JMSException

如果 JMS 客户端尝试使用消息不支持的数据类型，或者尝试以错误类型读取消息中的数据，则必须抛出此异常。当消息属性值发生同等类型的错误时，也必须抛出此异常。例如，如果给定的 StreamMessage.writeObject 是不受支持的类，或者 StreamMessage.readShort 用于读取 boolean 值，则必须抛出此异常。注意一种特殊情况，即尝试以数值形式读取未正确格式化的 String 数据导致的失败必须抛出 java.lang.NumberFormatException。

version
en
26 August 1998
英文文档：

This exception must be thrown when a JMS client attempts to use a data type not supported by a message or attempts to read data in a message as the wrong type. It must also be thrown when equivalent type errors are made with message property values. For example, this exception must be thrown if StreamMessage.writeObject is given an unsupported class or if StreamMessage.readShort is used to read a boolean value. Note that the special case of a failure caused by an attempt to read improperly formatted String data as numeric values must throw the java.lang.NumberFormatException.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
MessageFormatException(String reason)
Constructs a MessageFormatException with the specified reason.
MessageFormatException(String reason, String errorCode)
Constructs a MessageFormatException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public MessageFormatException(String reason, String errorCode)
构造带指定原因和错误代码的 MessageFormatException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

MessageFormatException

public MessageFormatException(String reason,
                              String errorCode)
Constructs a MessageFormatException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public MessageFormatException(String reason)
构造带指定原因的 MessageFormatException。错误代码默认为 null。
reason 对异常的描述
英文文档：

MessageFormatException

public MessageFormatException(String reason)
Constructs a MessageFormatException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageNotReadableException (Java EE 5)

javax.jms
Class MessageNotReadableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.MessageNotReadableException
All Implemented Interfaces:
Serializable
public class MessageNotReadableException
extends JMSException

Extends: Throwable > Exception > JMSException

当 JMS 客户端尝试读取只写消息时，必须抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when a JMS client attempts to read a write-only message.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
MessageNotReadableException(String reason)
Constructs a MessageNotReadableException with the specified reason.
MessageNotReadableException(String reason, String errorCode)
Constructs a MessageNotReadableException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public MessageNotReadableException(String reason, String errorCode)
构造带指定原因和错误代码的 MessageNotReadableException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

MessageNotReadableException

public MessageNotReadableException(String reason,
                                   String errorCode)
Constructs a MessageNotReadableException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public MessageNotReadableException(String reason)
构造带指定原因的 MessageNotReadableException。错误代码默认为 null。
reason 对异常的描述
英文文档：

MessageNotReadableException

public MessageNotReadableException(String reason)
Constructs a MessageNotReadableException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageNotWriteableException (Java EE 5)

javax.jms
Class MessageNotWriteableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.MessageNotWriteableException
All Implemented Interfaces:
Serializable
public class MessageNotWriteableException
extends JMSException

Extends: Throwable > Exception > JMSException

当 JMS 客户端尝试写入只读消息时，必须抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when a JMS client attempts to write to a read-only message.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
MessageNotWriteableException(String reason)
Constructs a MessageNotWriteableException with the specified reason.
MessageNotWriteableException(String reason, String errorCode)
Constructs a MessageNotWriteableException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public MessageNotWriteableException(String reason, String errorCode)
构造带指定原因和错误代码的 MessageNotWriteableException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

MessageNotWriteableException

public MessageNotWriteableException(String reason,
                                    String errorCode)
Constructs a MessageNotWriteableException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public MessageNotWriteableException(String reason)
构造带指定原因的 MessageNotWriteableException。错误代码默认为 null。
reason 对异常的描述
英文文档：

MessageNotWriteableException

public MessageNotWriteableException(String reason)
Constructs a MessageNotWriteableException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAllocationException (Java EE 5)

javax.jms
Class ResourceAllocationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.ResourceAllocationException
All Implemented Interfaces:
Serializable
public class ResourceAllocationException
extends JMSException

Extends: Throwable > Exception > JMSException

当提供者无法分配某方法所需的资源时，会抛出此异常。例如，当对 TopicConnectionFactory.createTopicConnection 的调用由于缺少 JMS 提供者资源而失败时，应抛出此异常。

version
en
26 August 1998
英文文档：

This exception is thrown when a provider is unable to allocate the resources required by a method. For example, this exception should be thrown when a call to TopicConnectionFactory.createTopicConnection fails due to a lack of JMS provider resources.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
ResourceAllocationException(String reason)
Constructs a ResourceAllocationException with the specified reason.
ResourceAllocationException(String reason, String errorCode)
Constructs a ResourceAllocationException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public ResourceAllocationException(String reason, String errorCode)
构造带指定原因和错误代码的 ResourceAllocationException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

ResourceAllocationException

public ResourceAllocationException(String reason,
                                   String errorCode)
Constructs a ResourceAllocationException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public ResourceAllocationException(String reason)
构造带指定原因的 ResourceAllocationException。错误代码默认为 null。
reason 对异常的描述
英文文档：

ResourceAllocationException

public ResourceAllocationException(String reason)
Constructs a ResourceAllocationException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionInProgressException (Java EE 5)

javax.jms
Class TransactionInProgressException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.TransactionInProgressException
All Implemented Interfaces:
Serializable
public class TransactionInProgressException
extends JMSException

Extends: Throwable > Exception > JMSException

在某个操作因事务正在进行而无效时抛出此异常。例如，当会话是分布式事务的一部分时，尝试调用 Session.commit 应抛出 TransactionInProgressException。

version
en
26 August 1998
英文文档：

This exception is thrown when an operation is invalid because a transaction is in progress. For instance, an attempt to call Session.commit when a session is part of a distributed transaction should throw a TransactionInProgressException.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
TransactionInProgressException(String reason)
Constructs a TransactionInProgressException with the specified reason.
TransactionInProgressException(String reason, String errorCode)
Constructs a TransactionInProgressException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public TransactionInProgressException(String reason, String errorCode)
构造带指定原因和错误代码的 TransactionInProgressException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

TransactionInProgressException

public TransactionInProgressException(String reason,
                                      String errorCode)
Constructs a TransactionInProgressException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public TransactionInProgressException(String reason)
构造带指定原因的 TransactionInProgressException。错误代码默认为 null。
reason 对异常的描述
英文文档：

TransactionInProgressException

public TransactionInProgressException(String reason)
Constructs a TransactionInProgressException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionRolledBackException (Java EE 5)

javax.jms
Class TransactionRolledBackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.jms.JMSException
                extended by  javax.jms.TransactionRolledBackException
All Implemented Interfaces:
Serializable
public class TransactionRolledBackException
extends JMSException

Extends: Throwable > Exception > JMSException

当对 Session.commit 的调用导致当前事务回滚时，必须抛出此异常。

version
en
26 August 1998
英文文档：

This exception must be thrown when a call to Session.commit results in a rollback of the current transaction.

Version:
26 August 1998
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
TransactionRolledBackException(String reason)
Constructs a TransactionRolledBackException with the specified reason.
TransactionRolledBackException(String reason, String errorCode)
Constructs a TransactionRolledBackException with the specified reason and error code.
Method Summary
Methods inherited from class javax.jms.JMSException
getErrorCode, getLinkedException, setLinkedException
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

public TransactionRolledBackException(String reason, String errorCode)
构造带指定原因和错误代码的 TransactionRolledBackException。
reason | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

TransactionRolledBackException

public TransactionRolledBackException(String reason,
                                      String errorCode)
Constructs a TransactionRolledBackException with the specified reason and error code.

Parameters:
reason - a description of the exception
errorCode - a string specifying the vendor-specific error code

public TransactionRolledBackException(String reason)
构造带指定原因的 TransactionRolledBackException。错误代码默认为 null。
reason 对异常的描述
英文文档：

TransactionRolledBackException

public TransactionRolledBackException(String reason)
Constructs a TransactionRolledBackException with the specified reason. The error code defaults to null.

Parameters:
reason - a description of the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.jws (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.jws

Enum Summary
WebParam.Mode The direction in which the parameter flows

Annotation Types Summary
HandlerChain | Associates the Web Service with an externally defined handler chain.
Oneway | Indicates that the given @WebMethod has only an input message and no output.
WebMethod | Customizes a method that is exposed as a Web Service operation.
WebParam | Customizes the mapping of an individual parameter to a Web Service message part and XML element.
WebResult | Customizes the mapping of the return value to a WSDL part and XML element.
WebService | Marks a Java class as implementing a Web Service, or a Java interface as defining a Web Service interface.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.jws Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.jws

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • javax.jws.HandlerChain (implements java.lang.annotation.Annotation)
  • javax.jws.Oneway (implements java.lang.annotation.Annotation)
  • javax.jws.WebMethod (implements java.lang.annotation.Annotation)
  • javax.jws.WebParam (implements java.lang.annotation.Annotation)
  • javax.jws.WebResult (implements java.lang.annotation.Annotation)
  • javax.jws.WebService (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.jws.WebParam.Mode
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


HandlerChain (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.jws
Annotation Type HandlerChain

@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD,FIELD})
public @interface HandlerChain

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={TYPE, METHOD, FIELD})

将 Web Service 与外部定义的处理程序链关联。此注释通常用于不适合将处理程序配置直接嵌入 Java 源的情况；例如，需要在多个 Web Service 之间共享处理程序配置的地方，或者处理程序链由多个传输的处理程序组成的地方。 将此注释与 @SOAPMessageHandlers 注释组合在一起是错误的。
英文文档：

Associates the Web Service with an externally defined handler chain. This annotation is typically used in scenarios where embedding the handler configuration directly in the Java source is not appropriate; for example, where the handler configuration needs to be shared across multiple Web Services, or where the handler chain consists of handlers for multiple transports. It is an error to combine this annotation with the @SOAPMessageHandlers annotation.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Required Element Summary
 String file
Location of the handler chain file.
Optional Element Summary
 String name
Deprecated. As of JSR-181 2.0 with no replacement.

Element Detail

abstract public String file()
处理程序链文件的位置。

该位置支持两种格式：

  1. externalForm 形式的绝对 java.net.URL（例如：http://myhandlers.foo.com/handlerfile1.xml）。
  2. 相对于源文件或类文件的相对路径（例如：bar/handlerfile1.xml）。
英文文档：

file

public abstract String file
Location of the handler chain file.

The location supports 2 formats:

  1. An absolute java.net.URL in externalForm (ex: http://myhandlers.foo.com/handlerfile1.xml).
  2. A relative path from the source file or class file (ex: bar/handlerfile1.xml).

abstract public String
name()

配置文件中的处理程序链的名称。
deprecated 从 JSR-181 2.0 开始，无替代版本。
英文文档：

name

@Deprecated
public abstract String name
Deprecated. As of JSR-181 2.0 with no replacement.

Name of the handler chain in the configuration file

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


Oneway (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.jws
Annotation Type Oneway

@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Oneway

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=METHOD)

指示给定 @WebMethod 只有一条输入消息并且没有输出。通常，在执行实际业务方法之前，单向的方法返回调用的应用程序的控件线程。如果标记了 @Oneway 的操作具有返回值或 Holder 参数，或者声明了任何已检查的异常，则 181 处理器应该报告错误。
英文文档：

Indicates that the given @WebMethod has only an input message and no output. Typically, a oneway method returns the thread of control to the calling application prior to executing the actual business method. A 181 processor should report an error if an operation marked @Oneway has a return value or Holder parameters, or declares any checked exceptions.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebMethod (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.jws
Annotation Type WebMethod

@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface WebMethod

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=METHOD)

定制一个公开为 Web Service 操作的方法。关联方法必须是公共方法且其参数可以返回值，并且异常必须遵循 JAX-RPC 1.1 的第 5 节中定义的规则。 该方法不需要抛出 java.rmi.RemoteException。
英文文档：

Customizes a method that is exposed as a Web Service operation. The associated method must be public and its parameters return value, and exceptions must follow the rules defined in JAX-RPC 1.1, section 5. The method is not required to throw java.rmi.RemoteException.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Optional Element Summary
String | action The action for this operation.
boolean | exclude Marks a method to NOT be exposed as a web method.
String | operationName Name of the wsdl:operation matching this method.

abstract public String operationName()
与此方法匹配的 wsdl:operation 的名称。
specdefault Java 方法的名称。
英文文档：

operationName

public abstract String operationName
Name of the wsdl:operation matching this method.

Default:
""

abstract public String action()
此操作的动作。

对于 SOAP 绑定，此方法可确定 soap 动作的值。

英文文档：

action

public abstract String action
The action for this operation.

For SOAP bindings, this determines the value of the soap action.

Default:
""

abstract public boolean exclude()
将某一方法标记为不作为一个 web 方法公开。

此方法用于阻止将某一继承方法公开为此 web 服务的一部分。如果指定此元素，则不得为

since 2.0
英文文档：

exclude

public abstract boolean exclude
Marks a method to NOT be exposed as a web method.

Used to stop an inherited method from being exposed as part of this web service. If this element is specified, other elements MUST NOT be specified for the @WebMethod.

This member-value is not allowed on endpoint interfaces.

Since:
2.0
Default:
false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebParam (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.jws
Annotation Type WebParam

@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public @interface WebParam

Implements: Annotation
Inner classes: WebParam.Mode
@Retention(value=RUNTIME)
@Target(value=PARAMETER)

定制单个参数到 Web Service 消息部分和 XML 元素的映射关系。
英文文档：

Customizes the mapping of an individual parameter to a Web Service message part and XML element.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Optional Element Summary
boolean | header If true, the parameter is pulled from a message header rather then the message body.
WebParam.Mode | mode The direction in which the parameter is flowing (One of IN, OUT, or INOUT).
String | name Name of the parameter.
String | partName The name of the wsdl:part representing this parameter.
String | targetNamespace The XML namespace for the parameter.

abstract public String name()
参数名称。

如果该操作是 rpc 样式的，并且尚未指定 @WebParam.partName，则此名称是表示参数的 wsdl:part 的名称。
如果该操作是文档样式的，或者参数映射到某一个头，则此名称是表示参数的 XML 元素的本地名称。

如果操作是文档样式的，参数样式为 BARE 并且模式为 OUT 或 INOUT，则必须指定一个名称。

specdefault 如果操作是文档样式的并且参数样式为 BARE，则默认名称为 @WebMethod.operationName；
否则为 argN，其中的 N 表示方法签名中参数的索引（从 arg0 开始）。
英文文档：

name

public abstract String name
Name of the parameter.

If the operation is rpc style and @WebParam.partName has not been specified, this is name of the wsdl:part representing the parameter.
If the operation is document style or the parameter maps to a header, this is the local name of the XML element representing the parameter.

A name MUST be specified if the operation is document style, the parameter style is BARE, and the mode is OUT or INOUT.

Default:
""

abstract public String partName()
表示此参数的 wsdl:part 的名称。

此名称仅在操作是 rpc 样式，或者操作是文档样式且参数样式为 BARE 时使用。

specdefault
en
@WebParam.name
since 2.0
英文文档：

partName

public abstract String partName
The name of the wsdl:part representing this parameter.

This is only used if the operation is rpc style or if the operation is document style and the parameter style is BARE.

Since:
2.0
Default:
""

abstract public String targetNamespace()
参数的 XML 名称空间。

仅在操作是文档样式或者参数映射到某一个头时使用。如果目标名称空间被设置为 ??，则此名称空间表示空名称空间。

specdefault 如果操作是文档样式，参数样式是 WRAPPED，并且参数没有映射到某一个头，则默认名称空间为空名称空间；
否则，为 Web Service 的 targetNamespace。
英文文档：

targetNamespace

public abstract String targetNamespace
The XML namespace for the parameter.

Only used if the operation is document style or the paramater maps to a header. If the target namespace is set to ??, this represents the empty namespace.

Default:
""

abstract public WebParam.Mode mode()
参数的流向（IN、OUT 或 INOUT 之一）。

OUT 和 INOUT 模式只是为那些符合 Holder 类型定义（JAX-WS 2.0 [5] 的第 2.3.3 节）的参数类型所指定的。Holder 类型的参数必须为 OUT 或 INOUT。

specdefault 如果是一个 Holder 类型，则默认模式为 INOUT。
如果不是一个 Holder 类型，则为 IN。
英文文档：

mode

public abstract WebParam.Mode mode
The direction in which the parameter is flowing (One of IN, OUT, or INOUT).

The OUT and INOUT modes may only be specified for parameter types that conform to the definition of Holder types (JAX-WS 2.0 [5], section 2.3.3). Parameters that are Holder Types MUST be OUT or INOUT.

Default:
IN

abstract public boolean header()
如果为 true，则参数是从消息头而不是消息正文获取的。
英文文档：

header

public abstract boolean header
If true, the parameter is pulled from a message header rather then the message body.

Default:
false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebResult (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.jws
Annotation Type WebResult

@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface WebResult

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=METHOD)

定制返回值到 WSDL 部分和 XML 元素的映射关系。
英文文档：

Customizes the mapping of the return value to a WSDL part and XML element.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Optional Element Summary
boolean | header If true, the result is pulled from a message header rather then the message body.
String | name Name of return value.
String | partName The name of the wsdl:part representing this return value.
String | targetNamespace The XML namespace for the return value.

abstract public String name()
返回值的名称。

如果操作是 rpc 样式，并且尚未指定

specdefault 如果操作是文档样式并且参数样式为 BARE，则默认名称为 @WebParam.operationName+?Response?；
否则为 return。
英文文档：

name

public abstract String name
Name of return value.

If the operation is rpc style and @WebResult.partName has not been specified, this is the name of the wsdl:part representing the return value.
If the operation is document style or the return value maps to a header, this is the local name of the XML element representing the return value.

Default:
""

abstract public String partName()
表示此返回值的 wsdl:part 的名称。

此名称只在操作是 rpc 样式，或者操作是文档样式且参数样式为 BARE 时使用。

specdefault | {@code
since | 2.0
英文文档：

partName

public abstract String partName
The name of the wsdl:part representing this return value.

This is only used if the operation is rpc style, or if the operation is document style and the parameter style is BARE.

Since:
2.0
Default:
""

abstract public String targetNamespace()
返回值的 XML 名称空间。

只在操作是文档样式或者返回值映射到某一个头时使用。如果目标名称空间被设置为 ，则此名称空间表示空名称空间。

specdefault 如果操作是文档样式，参数样式是 WRAPPED，并且返回值没有映射到某一个头，则默认名称空间为空名称空间。
否则，为 Web Service 的 targetNamespace。
英文文档：

targetNamespace

public abstract String targetNamespace
The XML namespace for the return value.

Only used if the operation is document style or the return value maps to a header. If the target namespace is set to ??, this represents the empty namespace.

Default:
""

abstract public boolean header()
如果为 true，则结果是从消息头而不是消息正文获取的。
since 2.0
英文文档：

header

public abstract boolean header
If true, the result is pulled from a message header rather then the message body.

Since:
2.0
Default:
false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebService (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.jws
Annotation Type WebService

@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface WebService

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=TYPE)

将 Java 类标记为实现 Web Service，或者将 Java 接口标记为定义 Web Service 接口。
英文文档：

Marks a Java class as implementing a Web Service, or a Java interface as defining a Web Service interface.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Optional Element Summary
String | endpointInterface The complete name of the service endpoint interface defining the service?s abstract Web Service contract.
String | name The name of the Web Service.
String | portName The port name of the Web Service.
String | serviceName The service name of the Web Service.
String | targetNamespace If the @WebService.targetNamespace annotation is on a service endpoint interface, the targetNamespace is used for the namespace for the wsdl:portType (and associated XML elements).
String | wsdlLocation The location of a pre-defined WSDL describing the service.

abstract public String name()
Web Service 的名称。

当映射到 WSDL 1.1 时，该名称被用作 wsdl:portType 的名称。

specdefault Java 类或接口的简单名称。
英文文档：

name

public abstract String name
The name of the Web Service.

Used as the name of the wsdl:portType when mapped to WSDL 1.1.

Default:
""

abstract public String targetNamespace()
如果 @WebService.targetNamespace 注释是关于某一服务端点接口的，则 targetNamespace 用于 wsdl:portType（以及关联的 XML 元素）的名称空间。

如果 @WebService.targetNamespace 注释是关于某个没有引用服务端点接口（通过 endpointInterface 属性）的服务实现 bean 的，则 targetNamespace 既可以用于 wsdl:portType 也可以用于 wsdl:service（以及关联的 XML 元素）。

如果 @WebService.targetNamespace 注释是关于某个引用服务端点接口（通过 endpointInterface 属性）的服务实现 bean 的，则 targetNamespace 仅用于 wsdl:service（以及关联的 XML 元素）。

specdefault 随实现而定，正如 JAX-WS 2.0 [5] 第 3.2 节中描述的那样。
英文文档：

targetNamespace

public abstract String targetNamespace
If the @WebService.targetNamespace annotation is on a service endpoint interface, the targetNamespace is used for the namespace for the wsdl:portType (and associated XML elements).

If the @WebService.targetNamespace annotation is on a service implementation bean that does NOT reference a service endpoint interface (through the endpointInterface attribute), the targetNamespace is used for both the wsdl:portType and the wsdl:service (and associated XML elements).

If the @WebService.targetNamespace annotation is on a service implementation bean that does reference a service endpoint interface (through the endpointInterface attribute), the targetNamespace is used for only the wsdl:service (and associated XML elements).

Default:
""

abstract public String serviceName()
Web Service 的服务名称。

当映射到 WSDL 1.1 时，此名称被用作 wsdl:service 的名称。

不允许在端点接口上使用此成员值。

specdefault Java class + Service 的简单名称。
英文文档：

serviceName

public abstract String serviceName
The service name of the Web Service.

Used as the name of the wsdl:service when mapped to WSDL 1.1.

This member-value is not allowed on endpoint interfaces.

Default:
""

abstract public String portName()
Web Service 的端口名称。

当映射到 WSDL 1.1 时，此名称被用作 wsdl:port 的名称。

不允许在端点接口上使用此成员值。

specdefault
en
@WebService.name+?Port?.
since 2.0
英文文档：

portName

public abstract String portName
The port name of the Web Service.

Used as the name of the wsdl:port when mapped to WSDL 1.1.

This member-value is not allowed on endpoint interfaces.

Since:
2.0
Default:
""

abstract public String wsdlLocation()
描述服务的预定义 WSDL 的位置。

wsdlLocation 是引用预先存在的 WSDL 文件的 URL（相对或绝对）。wsdlLocation 值的存在指示服务实现 bean 将实现预先定义的 WSDL 协定。如果服务实现 bean 与此 WSDL 中声明的 portType 和绑定不一致，则 JSR-181 工具必须提供反馈。注意，单个 WSDL 文件可能包含多个 portType 和多个绑定。服务实现 bean 上的注释确定对应于 Web Service 的特定 portType 和绑定。

英文文档：

wsdlLocation

public abstract String wsdlLocation
The location of a pre-defined WSDL describing the service.

The wsdlLocation is a URL (relative or absolute) that refers to a pre-existing WSDL file. The presence of a wsdlLocation value indicates that the service implementation bean is implementing a pre-defined WSDL contract. The JSR-181 tool MUST provide feedback if the service implementation bean is inconsistent with the portType and bindings declared in this WSDL. Note that a single WSDL file might contain multiple portTypes and multiple bindings. The annotations on the service implementation bean determine the specific portType and bindings that correspond to the Web Service.

Default:
""

abstract public String endpointInterface()
定义服务抽象 Web 服务协定的服务端点接口的完整名称。

此注释允许开发人员将接口协定与实现分离。如果此注释存在，则使用服务端点接口来确定抽象 WSDL 协定（portType 和绑定）。服务端点接口可以包含用来定制 Java 到 WSDL 的映射关系的 JSR-181 注释。
服务实现 Bean 可以实现服务端点接口，但并不要求这样做。
如果此成员值不存在，则 Web 服务协定是根据服务实现 Bean 上的注释生成的。如果目标环境需要一个服务端点接口，则将生成一个由实现定义的包，该包具有由实现定义的名称。

不允许在端点接口上使用此成员值。

英文文档：

endpointInterface

public abstract String endpointInterface
The complete name of the service endpoint interface defining the service?s abstract Web Service contract.

This annotation allows the developer to separate the interface contract from the implementation. If this annotation is present, the service endpoint interface is used to determine the abstract WSDL contract (portType and bindings). The service endpoint interface MAY include JSR-181 annotations to customize the mapping from Java to WSDL.
The service implementation bean MAY implement the service endpoint interface, but is not REQUIRED to do so.
If this member-value is not present, the Web Service contract is generated from annotations on the service implementation bean. If a service endpoint interface is required by the target environment, it will be generated into an implementation-defined package with an implementation- defined name

This member-value is not allowed on endpoint interfaces.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.jws.soap (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.jws.soap

Enum Summary
SOAPBinding.ParameterStyle | The style of mapping parameters onto SOAP messages
SOAPBinding.Style | The SOAP binding style
SOAPBinding.Use | The SOAP binding use

Annotation Types Summary
InitParam | Deprecated. As of JSR-181 2.0 with no replacement.
SOAPBinding | Specifies the mapping of the Web Service onto the SOAP message protocol.
SOAPMessageHandler | Deprecated. As of JSR-181 2.0 with no replacement.
SOAPMessageHandlers | Deprecated. As of JSR-181 2.0 with no replacement.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.jws.soap Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.jws.soap

Package Hierarchies:
All Packages

Annotation Type Hierarchy

  • javax.jws.soap.InitParam (implements java.lang.annotation.Annotation)
  • javax.jws.soap.SOAPBinding (implements java.lang.annotation.Annotation)
  • javax.jws.soap.SOAPMessageHandler (implements java.lang.annotation.Annotation)
  • javax.jws.soap.SOAPMessageHandlers (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.jws.soap.SOAPBinding.Style
      • javax.jws.soap.SOAPBinding.Use
      • javax.jws.soap.SOAPBinding.ParameterStyle
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


InitParam (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.jws.soap
Annotation Type InitParam

Deprecated. As of JSR-181 2.0 with no replacement.

Implements: Annotation

Deprecated.
一个初始化参数。
deprecated 从 JSR-181 2.0 开始，无替代版本。
英文文档：

@Deprecated
public @interface InitParam

An initialization parameter

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Required Element Summary
String | name Deprecated. Name of the initialization parameter
String | value Deprecated. Value of the initialization parameter

Element Detail

abstract public String name()
初始化参数的名称。
英文文档：

name

public abstract String name
Deprecated.
Name of the initialization parameter

abstract public String value()
初始化参数的值。
英文文档：

value

public abstract String value
Deprecated.
Value of the initialization parameter

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


SOAPBinding (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.jws.soap
Annotation Type SOAPBinding

@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface SOAPBinding

Implements: Annotation
Inner classes: SOAPBinding.Style, SOAPBinding.Use, SOAPBinding.ParameterStyle
@Retention(value=RUNTIME)
@Target(value={TYPE, METHOD})

指定 Web Service 到 SOAP 消息协议的映射关系。
英文文档：

Specifies the mapping of the Web Service onto the SOAP message protocol.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Optional Element Summary
SOAPBinding.ParameterStyle | parameterStyle Determines whether method parameters represent the entire message body, or whether the parameters are elements wrapped inside a top-level element named after the operation
SOAPBinding.Style | style Defines the encoding style for messages send to and from the Web Service.
SOAPBinding.Use | use Defines the formatting style for messages sent to and from the Web Service.

abstract public SOAPBinding.Style style()
定义发送到 Web Service 的消息和从 Web Service 发送的消息的编码样式。
英文文档：

style

public abstract SOAPBinding.Style style
Defines the encoding style for messages send to and from the Web Service.

Default:
DOCUMENT

abstract public SOAPBinding.Use use()
定义发送到 Web Service 的消息和从 Web Service 发送的消息的格式样式。
英文文档：

use

public abstract SOAPBinding.Use use
Defines the formatting style for messages sent to and from the Web Service.

Default:
LITERAL

abstract public SOAPBinding.ParameterStyle parameterStyle()
确定方法参数是否表示整个消息正文，或者参数是否是包装在以操作命名的顶层元素中的元素。
英文文档：

parameterStyle

public abstract SOAPBinding.ParameterStyle parameterStyle
Determines whether method parameters represent the entire message body, or whether the parameters are elements wrapped inside a top-level element named after the operation

Default:
WRAPPED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SOAPMessageHandler (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.jws.soap
Annotation Type SOAPMessageHandler

Deprecated. As of JSR-181 2.0 with no replacement.

Implements: Annotation

Deprecated.
单个 SOAP 消息处理程序。
deprecated 从 JSR-181 2.0 开始，无替代版本。
英文文档：

@Deprecated
public @interface SOAPMessageHandler

A single SOAP message handler

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Required Element Summary
 String className
Deprecated. Name of the handler class.
Optional Element Summary
String[] | headers Deprecated. List of SOAP headers processed by the handler.
InitParam[] | initParams Deprecated. Array of name/value pairs that should be passed to the handler during initialization.
String | name Deprecated. Name of the handler.
String[] | roles Deprecated. List of SOAP roles/actors implemented by the handler

Element Detail

abstract public String className()
处理程序类的名称。
英文文档：

className

public abstract String className
Deprecated.
Name of the handler class.

abstract public String name()
处理程序的名称。默认为处理程序类的名称。
英文文档：

name

public abstract String name
Deprecated.
Name of the handler. Defaults to the name of the handler class.

Default:
""

abstract public InitParam[] initParams()
应该在初始化期间传递给处理程序的名称/值对所组成的数组。
英文文档：

initParams

public abstract InitParam[] initParams
Deprecated.
Array of name/value pairs that should be passed to the handler during initialization.

Default:
{}

abstract public String[] roles()
由处理程序实现的 SOAP 角色/参与者所组成的列表。
英文文档：

roles

public abstract String[] roles
Deprecated.
List of SOAP roles/actors implemented by the handler

Default:
{}

abstract public String[] headers()
由处理程序处理的 SOAP 头所组成的列表。此数组中的每个元素都包含一个 QName，该 QName 定义处理程序所处理的头元素。该 QName 是使用 javax.xml.namespace.QName.valueOf(String qNameAsString) 文档中所描述的字符串表示法指定的。
英文文档：

headers

public abstract String[] headers
Deprecated.
List of SOAP headers processed by the handler. Each element in this array contains a QName which defines the header element processed by the handler. The QNames are specified using the string notation described in the documentation for javax.xml.namespace.QName.valueOf(String qNameAsString)

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SOAPMessageHandlers (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.jws.soap
Annotation Type SOAPMessageHandlers

Deprecated. As of JSR-181 2.0 with no replacement.

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=TYPE)

Deprecated.
指定一个 SOAP 协议处理程序列表，这些处理程序在业务方法之前和之后在 Web Service 上运行。调用这些处理程序来响应以服务为目标的 SOAP 消息。

@SOAPMessageHandlers 注释是一个 SOAPMessageHandler 类型的数组。处理程序按照它们在注释中出现的顺序运行，从数组中的第一个处理程序开始。

deprecated 从 JSR-181 2.0 开始，无替代版本。
英文文档：

@Retention(value=RUNTIME)
@Target(value=TYPE)
@Deprecated
public @interface SOAPMessageHandlers

Specifies a list of SOAP protocol handlers that run before and after business methods on the Web Service. These handlers are called in response to SOAP messages targeting the service.

The @SOAPMessageHandlers annotation is an array of SOAPMessageHandler types. The handlers are run in the order in which they appear in the annotation, starting with the first handler in the array.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Required Element Summary
 SOAPMessageHandler[] value
Deprecated.

Element Detail

abstract public SOAPMessageHandler[] value()
英文文档：

value

public abstract SOAPMessageHandler[] value
Deprecated.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.mail (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.mail

The JavaMailTM API provides classes that model a mail system.

See:
Description

Interface Summary
MessageAware | An interface optionally implemented by DataSources to supply information to a DataContentHandler about the message context in which the data content object is operating.
MultipartDataSource | MultipartDataSource is a DataSource that contains body parts.
Part | The Part interface is the common base interface for Messages and BodyParts.
QuotaAwareStore | An interface implemented by Stores that support quotas.
UIDFolder | The UIDFolder interface is implemented by Folders that can support the "disconnected" mode of operation, by providing unique-ids for messages in the folder.

Class Summary
Address | This abstract class models the addresses in a message.
Authenticator | The class Authenticator represents an object that knows how to obtain authentication for a network connection.
BodyPart | This class models a Part that is contained within a Multipart.
FetchProfile | Clients use a FetchProfile to list the Message attributes that it wishes to prefetch from the server for a range of messages.
FetchProfile.Item | This inner class is the base class of all items that can be requested in a FetchProfile.
Flags | The Flags class represents the set of flags on a Message.
Flags.Flag | This inner class represents an individual system flag.
Folder | Folder is an abstract class that represents a folder for mail messages.
Header | The Header class stores a name/value pair to represent headers.
Message | This class models an email message.
Message.RecipientType | This inner class defines the types of recipients allowed by the Message class.
MessageContext | The context in which a piece of Message content is contained.
Multipart | Multipart is a container that holds multiple body parts.
PasswordAuthentication | The class PasswordAuthentication is a data holder that is used by Authenticator.
Provider | The Provider is a class that describes a protocol implementation.
Provider.Type | This inner class defines the Provider type.
Quota | This class represents a set of quotas for a given quota root.
Quota.Resource | An individual resource in a quota root.
Service | An abstract class that contains the functionality common to messaging services, such as stores and transports.
Session | The Session class represents a mail session and is not subclassed.
Store | An abstract class that models a message store and its access protocol, for storing and retrieving messages.
Transport | An abstract class that models a message transport.
UIDFolder.FetchProfileItem | A fetch profile item for fetching UIDs.
URLName | The name of a URL.

Exception Summary
AuthenticationFailedException | This exception is thrown when the connect method on a Store or Transport object fails due to an authentication failure (e.g., bad user name or password).
FolderClosedException | This exception is thrown when a method is invoked on a Messaging object and the Folder that owns that object has died due to some reason.
FolderNotFoundException | This exception is thrown by Folder methods, when those methods are invoked on a non existent folder.
IllegalWriteException | The exception thrown when a write is attempted on a read-only attribute of any Messaging object.
MessageRemovedException | The exception thrown when an invalid method is invoked on an expunged Message.
MessagingException | The base class for all exceptions thrown by the Messaging classes
MethodNotSupportedException | The exception thrown when a method is not supported by the implementation
NoSuchProviderException | This exception is thrown when Session attempts to instantiate a Provider that doesn't exist.
ReadOnlyFolderException | This exception is thrown when an attempt is made to open a folder read-write access when the folder is marked read-only.
SendFailedException | This exception is thrown when the message cannot be sent.
StoreClosedException | This exception is thrown when a method is invoked on a Messaging object and the Store that owns that object has died due to some reason.

Package javax.mail Description

The JavaMailTM API provides classes that model a mail system. The javax.mail package defines classes that are common to all mail systems. The javax.mail.internet package defines classes that are specific to mail systems based on internet standards such as MIME, SMTP, POP3, and IMAP. The JavaMail API includes the javax.mail package and subpackages.

For an overview of the JavaMail API, read the JavaMail specification included in the download bundle or available on the JavaMail web site.

The code to send a plain text message can be as simple as the following:

    Properties props = new Properties();
    props.put("mail.smtp.host", "my-mail-server");
    props.put("mail.from", "me@example.com");
    Session session = Session.getInstance(props, null);

    try {
        MimeMessage msg = new MimeMessage(session);
        msg.setFrom();
        msg.setRecipients(Message.RecipientType.TO,
                          "you@example.com");
        msg.setSubject("JavaMail hello world example");
        msg.setSentDate(new Date());
        msg.setText("Hello, world!\n");
        Transport.send(msg);
    } catch (MessagingException mex) {
        System.out.println("send failed, exception: " + mex);
    }
The JavaMail download bundle contains many more complete examples in the "demo" directory.

Don't forget to see the JavaMail API FAQ for answers to the most common questions. The JavaMail web site contains many additional resources.

The JavaMail API supports the following standard properties, which may be set in the Session object, or in the Properties object used to create the Session object. The properties are always set as strings; the Type column describes how the string is interpreted. For example, use

        props.put("mail.debug", "true");
to set the mail.debug property, which is of type boolean.

Name | Type | Description
mail.debug | boolean | The initial debug mode. Default is false.
mail.from | String | The return email address of the current user, used by the InternetAddress method getLocalAddress.
mail.mime.address.strict | boolean | The MimeMessage class uses the InternetAddress method parseHeader to parse headers in messages. This property controls the strict flag passed to the parseHeader method. The default is true.
mail.host | String | The default host name of the mail server for both Stores and Transports. Used if the mail.protocol.host property isn't set.
mail.store.protocol | String | Specifies the default message access protocol. The Session method getStore() returns a Store object that implements this protocol. By default the first Store provider in the configuration files is returned.
mail.transport.protocol | String | Specifies the default message access protocol. The Session method getTransport() returns a Transport object that implements this protocol. By default the first Transport provider in the configuration files is returned.
mail.user | String | The default user name to use when connecting to the mail server. Used if the mail.protocol.user property isn't set.
mail.protocol.class | String | Specifies the fully qualified class name of the provider for the specified protocol. Used in cases where more than one provider for a given protocol exists; this property can be used to specify which provider to use by default. The provider must still be listed in a configuration file.
mail.protocol.host | String | The host name of the mail server for the specified protocol. Overrides the mail.host property.
mail.protocol.port | int | The port number of the mail server for the specified protocol. If not specified the protocol's default port number is used.
mail.protocol.user | String | The user name to use when connecting to mail servers using the specified protocol. Overrides the mail.user property.

The JavaMail API also supports several System properties; see the javax.mail.internet package documentation for details.

The JavaMail reference implementation from Sun includes protocol providers in subpackages of com.sun.mail. Note that the APIs to these protocol providers are not part of the standard JavaMail API. Portable programs will not use these APIs.

Nonportable programs may use the APIs of the Sun protocol providers by (for example) casting a returned Folder object to a com.sun.mail.imap.IMAPFolder object. Similarly for Store and Message objects returned from the standard JavaMail APIs.

The Sun protocol providers also support properties that are specific to those providers. The package documentation for the IMAP, POP3, and SMTP packages provide details.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.mail Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.mail

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.mail.Address (implements java.io.Serializable)
    • javax.mail.Authenticator
    • javax.mail.BodyPart (implements javax.mail.Part)
    • javax.mail.FetchProfile
    • javax.mail.FetchProfile.Item
      • javax.mail.UIDFolder.FetchProfileItem
    • javax.mail.Flags (implements java.lang.Cloneable, java.io.Serializable)
    • javax.mail.Flags.Flag
    • javax.mail.Folder
    • javax.mail.Header
    • javax.mail.Message (implements javax.mail.Part)
    • javax.mail.Message.RecipientType (implements java.io.Serializable)
    • javax.mail.MessageContext
    • javax.mail.Multipart
    • javax.mail.PasswordAuthentication
    • javax.mail.Provider
    • javax.mail.Provider.Type
    • javax.mail.Quota
    • javax.mail.Quota.Resource
    • javax.mail.Service
      • javax.mail.Store
      • javax.mail.Transport
    • javax.mail.Session
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.mail.MessagingException
          • javax.mail.AuthenticationFailedException
          • javax.mail.FolderClosedException
          • javax.mail.FolderNotFoundException
          • javax.mail.IllegalWriteException
          • javax.mail.MessageRemovedException
          • javax.mail.MethodNotSupportedException
          • javax.mail.NoSuchProviderException
          • javax.mail.ReadOnlyFolderException
          • javax.mail.SendFailedException
          • javax.mail.StoreClosedException
    • javax.mail.URLName

Interface Hierarchy

  • javax.activation.DataSource
    • javax.mail.MultipartDataSource
  • javax.mail.MessageAware
  • javax.mail.Part
  • javax.mail.QuotaAwareStore
  • javax.mail.UIDFolder
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


MessageAware (Java EE 5)

javax.mail
Interface MessageAware

All Known Implementing Classes:
MimePartDataSource
public interface MessageAware

Implemented by: MimePartDataSource

可由 DataSources 选择实现的接口，用于向 DataContentHandler 提供有关操作数据内容对象所在消息上下文的信息。
since
en
JavaMail 1.1
See also javax.mail.MessageContext, javax.activation.DataSource, javax.activation.DataContentHandler
英文文档：

An interface optionally implemented by DataSources to supply information to a DataContentHandler about the message context in which the data content object is operating.

Since:
JavaMail 1.1
See Also:
MessageContext, DataSource, DataContentHandler

Method Summary
 MessageContext getMessageContext()
Return the message context.

Method Detail

public MessageContext getMessageContext()
返回消息上下文。
英文文档：

getMessageContext

MessageContext getMessageContext()
Return the message context.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MultipartDataSource (Java EE 5)

javax.mail
Interface MultipartDataSource

All Superinterfaces:
DataSource
public interface MultipartDataSource
extends DataSource

Implements: DataSource

MultipartDataSource 是包含正文部分的 DataSource。此接口可以感知此类 DataSources 并使用适当的方法访问 BodyParts，能更有效地实现“邮件感知的”DataContentHandlers。

注意，MultipartDataSource 的数据也可以用作输入流。

此接口通常由预先解析 multipart 正文的提供者实现，例如 IMAP 提供者。

version | 1.8, 07/05/04
See also | javax.activation.DataSource
英文文档：

MultipartDataSource is a DataSource that contains body parts. This allows "mail aware" DataContentHandlers to be implemented more efficiently by being aware of such DataSources and using the appropriate methods to access BodyParts.

Note that the data of a MultipartDataSource is also available as an input stream.

This interface will typically be implemented by providers that preparse multipart bodies, for example an IMAP provider.

Version:
1.8, 07/05/04
Author:
John Mani
See Also:
DataSource

Method Summary
BodyPart | getBodyPart(int index) Get the specified Part.
int | getCount() Return the number of enclosed BodyPart objects.
Methods inherited from interface javax.activation.DataSource
getContentType, getInputStream, getName, getOutputStream

Method Detail

public int getCount()
返回封闭 BodyPart 对象的数量。
return 部分数
英文文档：

getCount

int getCount()
Return the number of enclosed BodyPart objects.

Returns:
number of parts

public BodyPart getBodyPart(int index) throws MessagingException
获取指定的 Part。Part 是从 0 开始编号的。
index | 所需 Part 的索引
return | Part
Throws | IndexOutOfBoundsException: 如果给定索引超出范围。
Throws | MessagingException:
英文文档：

getBodyPart

BodyPart getBodyPart(int index)
                     throws MessagingException
Get the specified Part. Parts are numbered starting at 0.

Parameters:
index - the index of the desired Part
Returns:
the Part
Throws:
IndexOutOfBoundsException - if the given index is out of range.
MessagingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Part (Java EE 5)

javax.mail
Interface Part

All Known Subinterfaces:
MimePart
All Known Implementing Classes:
BodyPart, Message, MimeBodyPart, MimeMessage, PreencodedMimeBodyPart
public interface Part

Implemented by: BodyPart, Message, MimePart

Part 接口是 Message 和 BodyPart 的公共基本接口。

Part 由一个属性集和一个 "Content" 组成。

属性：

JavaMail API 定义了一组标准 Part 属性，这些属性通用于大多数现有 Mail 系统。这些属性有自己的设置方法和获取方法。Mail 系统可能还支持其他 Part 属性，这些属性是以名称-值对的形式表示的，其中名称和值都是 String。

内容：

"content" 的数据类型由 getContentType() 方法返回。MIME 类型系统用于指定数据类型。

Part 的 "content" 有多种格式：

  • 作为 DataHandler - 使用 getDataHandler() 方法。Part 的 "content" 还可通过 javax.activation.DataHandler 对象获取。DataHandler 对象允许客户端发现可以对内容进行的操作，并实例化相应的组件来执行这些操作。
  • 作为输入流 - 使用 getInputStream() 方法。所有特定于邮件的编码都是在返回此流之前解码的。
  • 作为 Java 对象 - 使用 getContent() 方法。此方法以 Java 对象的形式返回 "content"。返回的对象无疑取决于内容本身。需要特别指出的是，"multipart" Part 的内容总是 Multipart 或其子类。也就是说，对 "multipart" 类型的 Part 调用 getContent() 将总是返回 Multipart（或子类）对象。
Part 提供 writeTo() 方法，该方法以适用于传输的、对邮件安全的形式传出字节流。此字节流通常是 Part 属性及其内容的字节流的聚合。

Message 和 BodyPart 实现 Part 接口。注意，在 MIME 用法中，Part 将模拟 Entity（RFC 2045 的第 2.4 节）。

英文文档：

The Part interface is the common base interface for Messages and BodyParts.

Part consists of a set of attributes and a "Content".

Attributes:

The JavaMail API defines a set of standard Part attributes that are considered to be common to most existing Mail systems. These attributes have their own settor and gettor methods. Mail systems may support other Part attributes as well, these are represented as name-value pairs where both the name and value are Strings.

Content:

The data type of the "content" is returned by the getContentType() method. The MIME typing system is used to name data types.

The "content" of a Part is available in various formats:

  • As a DataHandler - using the getDataHandler() method. The "content" of a Part is also available through a javax.activation.DataHandler object. The DataHandler object allows clients to discover the operations available on the content, and to instantiate the appropriate component to perform those operations.
  • As an input stream - using the getInputStream() method. Any mail-specific encodings are decoded before this stream is returned.
  • As a Java object - using the getContent() method. This method returns the "content" as a Java object. The returned object is of course dependent on the content itself. In particular, a "multipart" Part's content is always a Multipart or subclass thereof. That is, getContent() on a "multipart" type Part will always return a Multipart (or subclass) object.
Part provides the writeTo() method that streams out its bytestream in mail-safe form suitable for transmission. This bytestream is typically an aggregation of the Part attributes and its content's bytestream.

Message and BodyPart implement the Part interface. Note that in MIME parlance, Part models an Entity (RFC 2045, Section 2.4).

Author:
John Mani

Field Summary
static String | ATTACHMENT This part should be presented as an attachment.
static String | INLINE This part should be presented inline.
Method Summary
void | addHeader(String header_name, String header_value) Add this value to the existing values for this header_name.
Enumeration | getAllHeaders() Return all the headers from this part as an Enumeration of Header objects.
Object | getContent() Return the content as a Java object.
String | getContentType() Returns the Content-Type of the content of this part.
DataHandler | getDataHandler() Return a DataHandler for the content within this part.
String | getDescription() Return a description String for this part.
String | getDisposition() Return the disposition of this part.
String | getFileName() Get the filename associated with this part, if possible.
String[] | getHeader(String header_name) Get all the headers for this header name.
InputStream | getInputStream() Return an input stream for this part's "content".
int | getLineCount() Return the number of lines in the content of this part.
Enumeration | getMatchingHeaders(String[] header_names) Return matching headers from this part as an Enumeration of Header objects.
Enumeration | getNonMatchingHeaders(String[] header_names) Return non-matching headers from this envelope as an Enumeration of Header objects.
int | getSize() Return the size of the content of this part in bytes.
boolean | isMimeType(String mimeType) Is this Part of the specified MIME type?
void | removeHeader(String header_name) Remove all headers with this name.
void | setContent(Multipart mp) This method sets the given Multipart object as this message's content.
void | setContent(Object obj, String type) A convenience method for setting this part's content.
void | setDataHandler(DataHandler dh) This method provides the mechanism to set this part's content.
void | setDescription(String description) Set a description String for this part.
void | setDisposition(String disposition) Set the disposition of this part.
void | setFileName(String filename) Set the filename associated with this part, if possible.
void | setHeader(String header_name, String header_value) Set the value for this header_name.
void | setText(String text) A convenience method that sets the given String as this part's content with a MIME type of "text/plain".
void | writeTo(OutputStream os) Output a bytestream for this Part.

Field Detail

英文文档：

ATTACHMENT

static final String ATTACHMENT
This part should be presented as an attachment.

See Also:
getDisposition(), setDisposition(java.lang.String), Constant Field Values

英文文档：

INLINE

static final String INLINE
This part should be presented inline.

See Also:
getDisposition(), setDisposition(java.lang.String), Constant Field Values
Method Detail

public int getSize() throws MessagingException
返回此部分的内容大小（以字节为单位）。如果无法确定大小，则返回 -1。

注意，该大小可能不是内容大小的准确度量，可能没有考虑内容的传输编码。该大小适合显示在用户界面中，为用户提供此部分的大小的粗略参考。

return | 内容大小（以字节为单位）
Throws | MessagingException:
英文文档：

getSize

int getSize()
            throws MessagingException
Return the size of the content of this part in bytes. Return -1 if the size cannot be determined.

Note that the size may not be an exact measure of the content size and may or may not account for any transfer encoding of the content. The size is appropriate for display in a user interface to give the user a rough idea of the size of this part.

Returns:
size of content in bytes
Throws:
MessagingException

public int getLineCount() throws MessagingException
返回此部分的内容的行数。如果无法确定该数值，则返回 -1。 注意，此数值可能不是内容长度的准确度量，可能没有考虑内容的传输编码。
return | 内容的行数。
Throws | MessagingException:
英文文档：

getLineCount

int getLineCount()
                 throws MessagingException
Return the number of lines in the content of this part. Return -1 if the number cannot be determined. Note that this number may not be an exact measure of the content length and may or may not account for any transfer encoding of the content.

Returns:
number of lines in the content.
Throws:
MessagingException

public String getContentType() throws MessagingException
返回此部分的内容的 Content-Type。如果 Content-Type 无法确定，则返回 null。

MIME 类型系统用于指定 Content-type。

return | 此部分的 ContentType
Throws | MessagingException:
See also | javax.activation.DataHandler
英文文档：

getContentType

String getContentType()
                      throws MessagingException
Returns the Content-Type of the content of this part. Returns null if the Content-Type could not be determined.

The MIME typing system is used to name Content-types.

Returns:
The ContentType of this part
Throws:
MessagingException
See Also:
DataHandler

public boolean isMimeType(String mimeType) throws MessagingException
此 Part 是指定的 MIME 类型吗？此方法仅比较 primaryType 和 subType。忽略内容类型参数。

例如，当比较内容类型的 "text/plain" 部分与 "text/plain; charset=foobar" 时，此方法将返回 true。

如果 mimeType 的 subType 是特殊字符 '*'，则比较过程中将忽略 subtype。

英文文档：

isMimeType

boolean isMimeType(String mimeType)
                   throws MessagingException
Is this Part of the specified MIME type? This method compares only the primaryType and subType. The parameters of the content types are ignored.

For example, this method will return true when comparing a Part of content type "text/plain" with "text/plain; charset=foobar".

If the subType of mimeType is the special character '*', then the subtype is ignored during the comparison.

Throws:
MessagingException

public String getDisposition() throws MessagingException
返回此部分的 disposition。disposition 描述各部分应该如何展示给用户。（请参见 RFC 2183。）返回值应该不考虑大小写。例如：

String disp = part.getDisposition();
if (disp == null || disp.equalsIgnoreCase(Part.ATTACHMENT))
    // treat as attachment if not first part

return | 此部分的 disposition；如果未知，则返回 null
Throws | MessagingException:
See also | ATTACHMENT, INLINE, getFileName
英文文档：

getDisposition

String getDisposition()
                      throws MessagingException
Return the disposition of this part. The disposition describes how the part should be presented to the user. (See RFC 2183.) The return value should be considered without regard to case. For example:

 String disp = part.getDisposition();
 if (disp == null || disp.equalsIgnoreCase(Part.ATTACHMENT))
        // treat as attachment if not first part

Returns:
disposition of this part, or null if unknown
Throws:
MessagingException
See Also:
ATTACHMENT, INLINE, getFileName()

public void setDisposition(String disposition) throws MessagingException
设置此部分的 disposition。
disposition | 此部分的 disposition
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改此头
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
See also | ATTACHMENT, INLINE, setFileName
英文文档：

setDisposition

void setDisposition(String disposition)
                    throws MessagingException
Set the disposition of this part.

Parameters:
disposition - disposition of this part
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of this header
IllegalStateException - if this Part is obtained from a READ_ONLY folder
See Also:
ATTACHMENT, INLINE, setFileName(java.lang.String)

public String getDescription() throws MessagingException
返回此部分的描述 String。这通常包括一些与此部分关联的描述性信息。如果不存在，则返回 null。
return | 此部分的描述
Throws | MessagingException:
英文文档：

getDescription

String getDescription()
                      throws MessagingException
Return a description String for this part. This typically associates some descriptive information with this part. Returns null if none is available.

Returns:
description of this part
Throws:
MessagingException

public void setDescription(String description) throws MessagingException
设置此部分的描述 String。这通常包括一些与此部分关联的描述性信息。
description | 此部分的描述
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改此头
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setDescription

void setDescription(String description)
                    throws MessagingException
Set a description String for this part. This typically associates some descriptive information with this part.

Parameters:
description - description of this part
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of this header
IllegalStateException - if this Part is obtained from a READ_ONLY folder

public String getFileName() throws MessagingException
如果可能，获取与此部分关联的文件名称。在此部分表示从文件加载的“附件”时非常有用。该文件名通常是一个简单名称，不包含目录组件。
return 与此部分关联的文件名称
英文文档：

getFileName

String getFileName()
                   throws MessagingException
Get the filename associated with this part, if possible. Useful if this part represents an "attachment" that was loaded from a file. The filename will usually be a simple name, not including directory components.

Returns:
Filename to associate with this part
Throws:
MessagingException

public void setFileName(String filename) throws MessagingException
如果可能，设置与此部分关联的文件名称。在此部分表示从文件加载的“附件”时非常有用。该文件名通常是一个简单名称，不包含目录组件。
filename | 与此部分关联的文件名称
Throws | IllegalWriteException: 如果底层实现不支持修改此头
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setFileName

void setFileName(String filename)
                 throws MessagingException
Set the filename associated with this part, if possible. Useful if this part represents an "attachment" that was loaded from a file. The filename will usually be a simple name, not including directory components.

Parameters:
filename - Filename to associate with this part
Throws:
IllegalWriteException - if the underlying implementation does not support modification of this header
IllegalStateException - if this Part is obtained from a READ_ONLY folder
MessagingException

public java.io.InputStream getInputStream() throws java.io.IOException, MessagingException
返回用于此部分的 "content" 的输入流。所有特定于邮件的传输编码都将在提供输入流之前解码。

这通常是一个便捷方法，该方法只调用 DataHandler 的 getInputStream() 方法。

return | InputStream
Throws | java.io.IOException: 此异常通常由 DataHandler 抛出。有关更多信息，请参考 javax.activation.DataHandler 的文档。
Throws | MessagingException:
See also | getDataHandler, getInputStream
英文文档：

getInputStream

InputStream getInputStream()
                           throws IOException,
                                  MessagingException
Return an input stream for this part's "content". Any mail-specific transfer encodings will be decoded before the input stream is provided.

This is typically a convenience method that just invokes the DataHandler's getInputStream() method.

Returns:
an InputStream
Throws:
IOException - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.
MessagingException
See Also:
getDataHandler(), DataHandler.getInputStream()

public DataHandler getDataHandler() throws MessagingException
返回用于此部分的内容的 DataHandler。DataHandler 允许客户端操作和获取内容。
return | 内容的 DataHandler
Throws | MessagingException:
英文文档：

getDataHandler

DataHandler getDataHandler()
                           throws MessagingException
Return a DataHandler for the content within this part. The DataHandler allows clients to operate on as well as retrieve the content.

Returns:
DataHandler for the content
Throws:
MessagingException

public Object getContent() throws java.io.IOException, MessagingException
以 Java 对象的形式返回内容。所返回对象的类型当然取决于内容本身。例如，"text/plain" 内容的返回对象通常为 String 对象。"multipart" 内容的返回对象总是 Multipart 子类。对于 DataHandler 系统未知的内容类型，将输入流作为内容返回。

这是一个便捷方法，该方法只调用 DataHandler 的 getContent() 方法。

return | 对象
Throws | MessagingException:
Throws | java.io.IOException: 此异常通常由 DataHandler 抛出。有关更多信息，请参考 javax.activation.DataHandler 的文档。
See also | getContent
英文文档：

getContent

Object getContent()
                  throws IOException,
                         MessagingException
Return the content as a Java object. The type of the returned object is of course dependent on the content itself. For example, the object returned for "text/plain" content is usually a String object. The object returned for a "multipart" content is always a Multipart subclass. For content-types that are unknown to the DataHandler system, an input stream is returned as the content

This is a convenience method that just invokes the DataHandler's getContent() method

Returns:
Object
Throws:
MessagingException
IOException - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.
See Also:
DataHandler.getContent()

public void setDataHandler(DataHandler dh) throws MessagingException
此方法提供设置此部分的内容的机制。DataHandler 包装实际的内容。
dh | 用于内容的 DataHandler。
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setDataHandler

void setDataHandler(DataHandler dh)
                    throws MessagingException
This method provides the mechanism to set this part's content. The DataHandler wraps around the actual content.

Parameters:
dh - The DataHandler for the content.
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this Part is obtained from a READ_ONLY folder

public void setContent(Object obj, String type) throws MessagingException
设置此部分的内容的便捷方法。该部分将内容包装在 DataHandler 内部。

注意，为了正常运行，指定类型的 DataContentHandler 类应该可用于 JavaMail 实现，即要执行 setContent(foobar, "application/x-foobar")，必须安装 "application/x-foobar" 的 DataContentHandler。有关更多信息，请参考 Java Activation Framework。

obj | Java 对象。
type | 此对象的 MIME 类型。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setContent

void setContent(Object obj,
                String type)
                throws MessagingException
A convenience method for setting this part's content. The part internally wraps the content in a DataHandler.

Note that a DataContentHandler class for the specified type should be available to the JavaMail implementation for this to work right. i.e., to do setContent(foobar, "application/x-foobar"), a DataContentHandler for "application/x-foobar" should be installed. Refer to the Java Activation Framework for more information.

Parameters:
obj - A java object.
type - MIME type of this object.
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this Part is obtained from a READ_ONLY folder
MessagingException

public void setText(String text) throws MessagingException
使用 MIME 类型 "text/plain" 将给定的 String 设置为此部分内容的便捷方法。
text | 作为 Message 内容的文本。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setText

void setText(String text)
             throws MessagingException
A convenience method that sets the given String as this part's content with a MIME type of "text/plain".

Parameters:
text - The text that is the Message's content.
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this Part is obtained from a READ_ONLY folder
MessagingException

public void setContent(Multipart mp) throws MessagingException
此方法将给定的 Multipart 对象设置为此消息的内容。
mp | 为 Message 的内容的 multipart 对象。
Throws | IllegalWriteException: 如果底层实现 不支持修改现有值
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setContent

void setContent(Multipart mp)
                throws MessagingException
This method sets the given Multipart object as this message's content.

Parameters:
mp - The multipart object that is the Message's content
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this Part is obtained from a READ_ONLY folder
MessagingException

public void writeTo(java.io.OutputStream os) throws java.io.IOException, MessagingException
输出此 Part 的字节流。此字节流通常是 Part 属性及其 'content' 中已恰当编码的字节流的聚合。

实现 Part 接口的类决定了要使用的相应编码算法。

字节流通常用于发送。

Throws | java.io.IOException: 如果写入流时发生错误，或者 javax.activation 层发生错误。
Throws | MessagingException: 如果获取要写入的数据时发生错误
See also | writeTo
英文文档：

writeTo

void writeTo(OutputStream os)
             throws IOException,
                    MessagingException
Output a bytestream for this Part. This bytestream is typically an aggregration of the Part attributes and an appropriately encoded bytestream from its 'content'.

Classes that implement the Part interface decide on the appropriate encoding algorithm to be used.

The bytestream is typically used for sending.

Throws:
IOException - if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
MessagingException - if an error occurs fetching the data to be written
See Also:
DataHandler.writeTo(java.io.OutputStream)

public String[] getHeader(String header_name) throws MessagingException
获取具有此头名称的所有头。如果不存在具有此名称的头，则返回 null。
header_name | 此头的名称
return | 具有此名称的所有头的值字段
Throws | MessagingException:
英文文档：

getHeader

String[] getHeader(String header_name)
                   throws MessagingException
Get all the headers for this header name. Returns null if no headers for this header name are available.

Parameters:
header_name - the name of this header
Returns:
the value fields for all headers with this name
Throws:
MessagingException

public void setHeader(String header_name, String header_value) throws MessagingException
设置此 header_name 的值。使用此新值替换所有现有的头值。
header_name | 此头的名称
header_value | 此头的值
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setHeader

void setHeader(String header_name,
               String header_value)
               throws MessagingException
Set the value for this header_name. Replaces all existing header values with this new value.

Parameters:
header_name - the name of this header
header_value - the value for this header
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this Part is obtained from a READ_ONLY folder

public void addHeader(String header_name, String header_value) throws MessagingException
将此值添加到此 header_name 的现有值中。
header_name | 此头的名称
header_value | 此头的值
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

addHeader

void addHeader(String header_name,
               String header_value)
               throws MessagingException
Add this value to the existing values for this header_name.

Parameters:
header_name - the name of this header
header_value - the value for this header
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this Part is obtained from a READ_ONLY folder

public void removeHeader(String header_name) throws MessagingException
移除具有此名称的所有头。
header_name | 此头的名称
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

removeHeader

void removeHeader(String header_name)
                  throws MessagingException
Remove all headers with this name.

Parameters:
header_name - the name of this header
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this Part is obtained from a READ_ONLY folder

public java.util.Enumeration<E> getAllHeaders() throws MessagingException
以 Header 对象的枚举形式返回此部分的所有头。
return | Header 对象的枚举
Throws | MessagingException:
英文文档：

getAllHeaders

Enumeration getAllHeaders()
                          throws MessagingException
Return all the headers from this part as an Enumeration of Header objects.

Returns:
enumeration of Header objects
Throws:
MessagingException

public java.util.Enumeration<E> getMatchingHeaders(String[] header_names) throws MessagingException
以 Header 对象的枚举形式返回此部分的匹配头。
return | Header 对象的枚举
Throws | MessagingException:
英文文档：

getMatchingHeaders

Enumeration getMatchingHeaders(String[] header_names)
                               throws MessagingException
Return matching headers from this part as an Enumeration of Header objects.

Returns:
enumeration of Header objects
Throws:
MessagingException

public java.util.Enumeration<E> getNonMatchingHeaders(String[] header_names) throws MessagingException
以 Header 对象的枚举形式返回此封装中不匹配的头。
return | Header 对象的枚举
Throws | MessagingException:
英文文档：

getNonMatchingHeaders

Enumeration getNonMatchingHeaders(String[] header_names)
                                  throws MessagingException
Return non-matching headers from this envelope as an Enumeration of Header objects.

Returns:
enumeration of Header objects
Throws:
MessagingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QuotaAwareStore (Java EE 5)

javax.mail
Interface QuotaAwareStore

public interface QuotaAwareStore

由支持配额的 Store 实现的接口。getQuota 和 setQuota 方法支持 IMAP QUOTA 扩展定义的配额模型。有关的更多信息，请参见 RFC 2087。

since
en
JavaMail 1.4
英文文档：

An interface implemented by Stores that support quotas. The getQuota and setQuota methods support the quota model defined by the IMAP QUOTA extension. Refer to RFC 2087 for more information.

Since:
JavaMail 1.4

Method Summary
Quota[] | getQuota(String root) Get the quotas for the named quota root.
void | setQuota(Quota quota) Set the quotas for the quota root specified in the quota argument.

Method Detail

public Quota[] getQuota(String root) throws MessagingException
获取指定配额根的配额。配额是基于配额根进行控制的，不一定是基于文件夹。文件夹与配额根之间的关系取决于服务器。对于某个用户拥有的所有文件夹，某些服务器只实现一个配额根。另一些服务器可能针对每个文件夹都实现单独的配额根。单个文件夹甚至可以拥有多个配额根，这些配额根可能控制不同资源的配额。
root | 配额根的名称
return | Quota 对象数组
Throws | MessagingException: 如果服务器不支持 QUOTA 扩展
英文文档：

getQuota

Quota[] getQuota(String root)
                 throws MessagingException
Get the quotas for the named quota root. Quotas are controlled on the basis of a quota root, not (necessarily) a folder. The relationship between folders and quota roots depends on the server. Some servers might implement a single quota root for all folders owned by a user. Other servers might implement a separate quota root for each folder. A single folder can even have multiple quota roots, perhaps controlling quotas for different resources.

Parameters:
root - the name of the quota root
Returns:
array of Quota objects
Throws:
MessagingException - if the server doesn't support the QUOTA extension

public void setQuota(Quota quota) throws MessagingException
为 quota 参数中指定的配额根设置配额。通常此配额是用 getQuota 方法获取的配额根中的一个，但不一定如此。
quota | 要设置的配额
Throws | MessagingException: 如果服务器不支持 QUOTA 扩展
英文文档：

setQuota

void setQuota(Quota quota)
              throws MessagingException
Set the quotas for the quota root specified in the quota argument. Typically this will be one of the quota roots obtained from the getQuota method, but it need not be.

Parameters:
quota - the quota to set
Throws:
MessagingException - if the server doesn't support the QUOTA extension
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIDFolder (Java EE 5)

javax.mail
Interface UIDFolder

public interface UIDFolder

Inner classes: UIDFolder.FetchProfileItem

UIDFolder 接口由可支持 "disconnected" 操作模式的 Folder 实现，实现方式是为该文件夹中的消息提供唯一 id。此接口基于 IMAP 模型实现对 disconnected 操作的支持。

唯一标识符 (UID) 是一个正的 long 值，被分配给特定文件夹中的每条消息。在邮箱中，唯一标识符是以严格的升序方式分配的。也就是说，向邮箱中添加每条消息时都会给它分配一个比以前添加的消息更高的 UID。唯一标识符可以跨会话保留。这允许客户端重新与服务器同步其来自以前会话的状态。

与每个邮箱关联的是唯一标识符有效性值。如果以前会话中的唯一标识符无法保留到此会话，那么唯一标识符有效性值必须是比以前会话中使用的有效性值更大的值。

有关更多信息，请参见 RFC 2060 http://www.ietf.org/rfc/rfc2060.txt。

英文文档：

The UIDFolder interface is implemented by Folders that can support the "disconnected" mode of operation, by providing unique-ids for messages in the folder. This interface is based on the IMAP model for supporting disconnected operation.

A Unique identifier (UID) is a positive long value, assigned to each message in a specific folder. Unique identifiers are assigned in a strictly ascending fashion in the mailbox. That is, as each message is added to the mailbox it is assigned a higher UID than the message(s) which were added previously. Unique identifiers persist across sessions. This permits a client to resynchronize its state from a previous session with the server.

Associated with every mailbox is a unique identifier validity value. If unique identifiers from an earlier session fail to persist to this session, the unique identifier validity value must be greater than the one used in the earlier session.

Refer to RFC 2060 http://www.ietf.org/rfc/rfc2060.txt for more information.

Author:
John Mani

Nested Class Summary
static class UIDFolder.FetchProfileItem
A fetch profile item for fetching UIDs.
Field Summary
static long LASTUID
This is a special value that can be used as the end parameter in getMessagesByUID(start, end), to denote the UID of the last message in the folder.
Method Summary
Message | getMessageByUID(long uid) Get the Message corresponding to the given UID.
Message[] | getMessagesByUID(long[] uids) Get the Messages specified by the given array of UIDs.
Message[] | getMessagesByUID(long start, long end) Get the Messages specified by the given range.
long | getUID(Message message) Get the UID for the specified message.
long | getUIDValidity() Returns the UIDValidity value associated with this folder.

Field Detail

英文文档：

LASTUID

static final long LASTUID
This is a special value that can be used as the end parameter in getMessagesByUID(start, end), to denote the UID of the last message in the folder.

See Also:
getMessagesByUID(long, long), Constant Field Values
Method Detail

public long getUIDValidity() throws MessagingException
返回与此文件夹关联的 UIDValidity 值。

客户端通常将此值与以前会话中保存的 UIDValidity 值进行比较，以确保所有缓存的 UID 都没有过时。

return
en
UIDValidity
英文文档：

getUIDValidity

long getUIDValidity()
                    throws MessagingException
Returns the UIDValidity value associated with this folder.

Clients typically compare this value against a UIDValidity value saved from a previous session to insure that any cached UIDs are not stale.

Returns:
UIDValidity
Throws:
MessagingException

public Message getMessageByUID(long uid) throws MessagingException
获取与给定 UID 相对应的 Message。如果不存在这样的消息，则返回 null。
uid | 所需消息的 UID
return | Message 对象。如果没有获得与此 UID 相对应的消息，则返回 null。
Throws | MessagingException:
英文文档：

getMessageByUID

Message getMessageByUID(long uid)
                        throws MessagingException
Get the Message corresponding to the given UID. If no such message exists, null is returned.

Parameters:
uid - UID for the desired message
Returns:
the Message object. null is returned if no message corresponding to this UID is obtained.
Throws:
MessagingException

public Message[] getMessagesByUID(long start, long end) throws MessagingException
获取给定范围指定的 Message。可将特殊值 LASTUID 用于 end 参数，以指示文件夹中最后一条消息的 UID。
start | 起始 UID
end | 结束 UID
return | Message 对象数组
Throws | MessagingException:
See also | LASTUID
英文文档：

getMessagesByUID

Message[] getMessagesByUID(long start,
                           long end)
                           throws MessagingException
Get the Messages specified by the given range. The special value LASTUID can be used for the end parameter to indicate the UID of the last message in the folder.

Parameters:
start - start UID
end - end UID
Returns:
array of Message objects
Throws:
MessagingException
See Also:
LASTUID

public Message[] getMessagesByUID(long[] uids) throws MessagingException
获取给定 UID 数组指定的 Message。如果任一 UID 无效，则为该条目返回 null。

注意，返回数组的大小应该与指定的 UID 数组的大小相同，并且 null 条目可能出现在数组中，指示无效 UID。

uids | UID 数组
return | Message 对象数组
Throws | MessagingException:
英文文档：

getMessagesByUID

Message[] getMessagesByUID(long[] uids)
                           throws MessagingException
Get the Messages specified by the given array of UIDs. If any UID is invalid, null is returned for that entry.

Note that the returned array will be of the same size as the specified array of UIDs, and null entries may be present in the array to indicate invalid UIDs.

Parameters:
uids - array of UIDs
Returns:
array of Message objects
Throws:
MessagingException

public long getUID(Message message) throws MessagingException
获取指定消息的 UID。注意，该消息必须属于此文件夹。否则抛出 java.util.NoSuchElementException。
message | 来自此文件夹的 Message
return | 此消息的 UID
Throws | java.util.NoSuchElementException: 如果给定 Message 不在此 Folder 中。
英文文档：

getUID

long getUID(Message message)
            throws MessagingException
Get the UID for the specified message. Note that the message must belong to this folder. Otherwise java.util.NoSuchElementException is thrown.

Parameters:
message - Message from this folder
Returns:
UID for this message
Throws:
NoSuchElementException - if the given Message is not in this Folder.
MessagingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UIDFolder.FetchProfileItem (Java EE 5)

javax.mail
Class UIDFolder.FetchProfileItem

java.lang.Object
    extended by  javax.mail.FetchProfile.Item
        extended by  javax.mail.UIDFolder.FetchProfileItem
Enclosing interface:
UIDFolder
public static class UIDFolder.FetchProfileItem
extends FetchProfile.Item

Extends: FetchProfile.Item
Contained within: UIDFolder

用于获取 UID 的 fetch 配置文件项。此内部类扩展了 FetchProfile.Item 类，以添加特定于 UIDFolder 的新的 FetchProfile 项类型。此处目前定义的唯一项是 UID 项。
See also javax.mail.FetchProfile
英文文档：

A fetch profile item for fetching UIDs. This inner class extends the FetchProfile.Item class to add new FetchProfile item types, specific to UIDFolders. The only item currently defined here is the UID item.

See Also:
FetchProfile

Field Summary
static UIDFolder.FetchProfileItem UID
UID is a fetch profile item that can be included in a FetchProfile during a fetch request to a Folder.
Fields inherited from class javax.mail.FetchProfile.Item
CONTENT_INFO, ENVELOPE, FLAGS
Constructor Summary
protected UIDFolder.FetchProfileItem(String name)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

UID

public static final UIDFolder.FetchProfileItem UID
UID is a fetch profile item that can be included in a FetchProfile during a fetch request to a Folder. This item indicates that the UIDs for messages in the specified range are desired to be prefetched.

An example of how a client uses this is below:

        FetchProfile fp = new FetchProfile();
        fp.add(UIDFolder.FetchProfileItem.UID);
        folder.fetch(msgs, fp);

Constructor Detail

protected UIDFolder.FetchProfileItem(String name)
英文文档：

UIDFolder.FetchProfileItem

protected UIDFolder.FetchProfileItem(String name)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Address (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail
Class Address

java.lang.Object
    extended by  javax.mail.Address
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InternetAddress, NewsAddress
public abstract class Address
extends Object
implements Serializable

Implements: java.io.Serializable
Extended by: InternetAddress, NewsAddress

此抽象类模拟消息中的地址。子类提供特定实现。子类通常将是可序列化的，这样，（例如）搜索项中的 Address 对象的使用可以随搜索项一起被序列化。
英文文档：

This abstract class models the addresses in a message. Subclasses provide specific implementations. Subclasses will typically be serializable so that (for example) the use of Address objects in search terms can be serialized along with the search terms.

Author:
John Mani, Bill Shannon
See Also:
Serialized Form

Constructor Summary
Address()
Method Summary
abstract boolean | equals(Object address) The equality operator.
abstract String | getType() Return a type string that identifies this address type.
abstract String | toString() Return a String representation of this address object.
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public Address()
英文文档：

Address

public Address()
Method Detail

abstract public String getType()
返回标识此地址类型的类型字符串。
return | 地址类型
See also | javax.mail.internet.InternetAddress
英文文档：

getType

public abstract String getType()
Return a type string that identifies this address type.

Returns:
address type
See Also:
InternetAddress

abstract public String toString()
返回此 Address 对象的 String 表示形式。
return 此地址的字符串表示形式
英文文档：

toString

public abstract String toString()
Return a String representation of this address object.

Overrides:
toString in class Object
Returns:
string representation of this address

abstract public boolean equals(Object address)
等号运算符。子类应该提供此方法的实现，该方法支持值相等性（这两个 Address 对象表示相同的目标吗？），而不支持对象引用相等性。子类还必须提供相应的 hashCode 方法的实现，该方法保留 equals 和 hashCode 的常规协定 - 比较起来相等的对象必须具有相同的 hashCode。
address Address 对象
英文文档：

equals

public abstract boolean equals(Object address)
The equality operator. Subclasses should provide an implementation of this method that supports value equality (do the two Address objects represent the same destination?), not object reference equality. A subclass must also provide a corresponding implementation of the hashCode method that preserves the general contract of equals and hashCode - objects that compare as equal must have the same hashCode.

Overrides:
equals in class Object
Parameters:
address - Address object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Authenticator (Java EE 5)

javax.mail
Class Authenticator

java.lang.Object
    extended by  javax.mail.Authenticator

public abstract class Authenticator
extends Object

Authenticator 类表示懂得如何获得网络连接验证的对象。通常，它通过提示用户输入信息来完成此操作。

应用程序通过创建子类，并在创建该子类时向会话注册其实例使用此类。在需要验证时，系统将调用该子类上的一个方法（比如 getPasswordAuthentication）。子类的方法可使用许多继承的方法 (getRequestingXXX()) 查询正在请求的验证，并为用户形成适当的消息。

请求验证的所有方法都有一个失败的默认实现。

version | 1.9, 05/04/07
See also | java.net.Authenticator, getInstance(java.util.Properties, javax.mail.Authenticator), getDefaultInstance(java.util.Properties, javax.mail.Authenticator), requestPasswordAuthentication, javax.mail.PasswordAuthentication
英文文档：

The class Authenticator represents an object that knows how to obtain authentication for a network connection. Usually, it will do this by prompting the user for information.

Applications use this class by creating a subclass, and registering an instance of that subclass with the session when it is created. When authentication is required, the system will invoke a method on the subclass (like getPasswordAuthentication). The subclass's method can query about the authentication being requested with a number of inherited methods (getRequestingXXX()), and form an appropriate message for the user.

All methods that request authentication have a default implementation that fails.

Version:
1.9, 05/04/07
Author:
Bill Foote, Bill Shannon
See Also:
Authenticator, Session.getInstance(java.util.Properties, javax.mail.Authenticator), Session.getDefaultInstance(java.util.Properties, javax.mail.Authenticator), Session.requestPasswordAuthentication(java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String), PasswordAuthentication

Constructor Summary
Authenticator()
Method Summary
protected String | getDefaultUserName()
protected PasswordAuthentication | getPasswordAuthentication() Called when password authentication is needed.
protected int | getRequestingPort()
protected String | getRequestingPrompt()
protected String | getRequestingProtocol() Give the protocol that's requesting the connection.
protected InetAddress | getRequestingSite()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Authenticator()
英文文档：

Authenticator

public Authenticator()
Method Detail

final protected java.net.InetAddress getRequestingSite()
return 请求授权的站点的 InetAddress；如果不可用，则返回 null。
英文文档：

getRequestingSite

protected final InetAddress getRequestingSite()
Returns:
the InetAddress of the site requesting authorization, or null if it's not available.

final protected int getRequestingPort()
return 所请求的连接的端口
英文文档：

getRequestingPort

protected final int getRequestingPort()
Returns:
the port for the requested connection

final protected String getRequestingProtocol()
给出正在请求连接的协议。通常此操作是基于 URLName 的。
return | 协议
See also | getProtocol
英文文档：

getRequestingProtocol

protected final String getRequestingProtocol()
Give the protocol that's requesting the connection. Often this will be based on a URLName.

Returns:
the protcol
See Also:
URLName.getProtocol()

final protected String getRequestingPrompt()
return 请求方给出的提示字符串
英文文档：

getRequestingPrompt

protected final String getRequestingPrompt()
Returns:
the prompt string given by the requestor

final protected String getDefaultUserName()
return 请求方给出的默认用户名
英文文档：

getDefaultUserName

protected final String getDefaultUserName()
Returns:
the default user name given by the requestor

protected PasswordAuthentication getPasswordAuthentication()
需要密码验证时调用。子类应该重写默认实现，默认实现返回 null。

注意，如果此方法使用对话框提示用户输入此信息，那么对话框需要一直阻塞直到用户提供该信息。此方法不能在显示对话框后简单地返回。

return 从用户收集的 PasswordAuthentication；如果一个也没有提供，则返回 null。
英文文档：

getPasswordAuthentication

protected PasswordAuthentication getPasswordAuthentication()
Called when password authentication is needed. Subclasses should override the default implementation, which returns null.

Note that if this method uses a dialog to prompt the user for this information, the dialog needs to block until the user supplies the information. This method can not simply return after showing the dialog.

Returns:
The PasswordAuthentication collected from the user, or null if none is provided.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BodyPart (Java EE 5)

javax.mail
Class BodyPart

java.lang.Object
    extended by  javax.mail.BodyPart
All Implemented Interfaces:
Part
Direct Known Subclasses:
MimeBodyPart
public abstract class BodyPart
extends Object
implements Part

Implements: Part
Extended by: MimeBodyPart

此类模拟包含在 Multipart 中的一个 Part。这是一个抽象类。子类提供实际实现。

BodyPart 实现 Part 接口。因此，它包含一个属性集合和一个“内容”。

英文文档：

This class models a Part that is contained within a Multipart. This is an abstract class. Subclasses provide actual implementations.

BodyPart implements the Part interface. Thus, it contains a set of attributes and a "content".

Author:
John Mani, Bill Shannon

Field Summary
protected  Multipart parent
The Multipart object containing this BodyPart, if known.
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
Constructor Summary
BodyPart()
Method Summary
 Multipart getParent()
Return the containing Multipart object, or null if not known.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.mail.Part
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader, setText, writeTo

Field Detail

英文文档：

parent

protected Multipart parent
The Multipart object containing this BodyPart, if known.

Since:
JavaMail 1.1
Constructor Detail

public BodyPart()
英文文档：

BodyPart

public BodyPart()
Method Detail

public Multipart getParent()
返回包含此 BodyPart 的 Multipart 对象；如果该对象未知，则返回 null。
英文文档：

getParent

public Multipart getParent()
Return the containing Multipart object, or null if not known.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FetchProfile (Java EE 5)

javax.mail
Class FetchProfile

java.lang.Object
    extended by  javax.mail.FetchProfile

public class FetchProfile
extends Object

Inner classes: FetchProfile.Item

客户端使用 FetchProfile 列出希望从服务器预获取的某一范围消息的 Message 属性。

从 Folder 获得的消息是轻量级对象，这些对象开始通常作为对实际消息的空引用。当对该特定 Message 调用适当的 get*() 方法时，才“按需”填充这样的 Message 对象。某些基于服务器的消息访问协议 (Ex:IMAP) 允许在单个请求中批量获取某一范围消息的消息属性。想要使用某一范围 Message 的消息属性的客户端（例如，要显示头列表中顶级头的客户端）可能需要使用这类服务器提供的优化。FetchProfile 允许客户端向服务器指示此需求。

注意，实现并不一定会支持 FetchProfile，因为可能存在后端服务不允许简单有效地获取这类配置文件的情况。

说明 FetchProfile 用法的示例代码如下所示：

Message[] msgs = folder.getMessages();

FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
fp.add("X-mailer");
folder.fetch(msgs, fp);

See also fetch
英文文档：

Clients use a FetchProfile to list the Message attributes that it wishes to prefetch from the server for a range of messages.

Messages obtained from a Folder are light-weight objects that typically start off as empty references to the actual messages. Such a Message object is filled in "on-demand" when the appropriate get*() methods are invoked on that particular Message. Certain server-based message access protocols (Ex: IMAP) allow batch fetching of message attributes for a range of messages in a single request. Clients that want to use message attributes for a range of Messages (Example: to display the top-level headers in a headerlist) might want to use the optimization provided by such servers. The FetchProfile allows the client to indicate this desire to the server.

Note that implementations are not obligated to support FetchProfiles, since there might be cases where the backend service does not allow easy, efficient fetching of such profiles.

Sample code that illustrates the use of a FetchProfile is given below:

  Message[] msgs = folder.getMessages();

  FetchProfile fp = new FetchProfile();
  fp.add(FetchProfile.Item.ENVELOPE);
  fp.add("X-mailer");
  folder.fetch(msgs, fp);

Author:
John Mani, Bill Shannon
See Also:
Folder.fetch(javax.mail.Message[], javax.mail.FetchProfile)

Nested Class Summary
static class FetchProfile.Item
This inner class is the base class of all items that can be requested in a FetchProfile.
Constructor Summary
FetchProfile()
Create an empty FetchProfile.
Method Summary
void | add(FetchProfile.Item item) Add the given special item as one of the attributes to be prefetched.
void | add(String headerName) Add the specified header-field to the list of attributes to be prefetched.
boolean | contains(FetchProfile.Item item) Returns true if the fetch profile contains given special item.
boolean | contains(String headerName) Returns true if the fetch profile contains given header name.
String[] | getHeaderNames() Get the names of the header-fields set in this profile.
FetchProfile.Item[] | getItems() Get the items set in this profile.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FetchProfile()
创建一个空 FetchProfile。
英文文档：

FetchProfile

public FetchProfile()
Create an empty FetchProfile.

Method Detail

public void add(FetchProfile.Item item)
将给定特殊项作为要预获取的属性之一添加。
item | 要获取的特殊项
See also | ENVELOPE, CONTENT_INFO, FLAGS
英文文档：

add

public void add(FetchProfile.Item item)
Add the given special item as one of the attributes to be prefetched.

Parameters:
item - the special item to be fetched
See Also:
FetchProfile.Item.ENVELOPE, FetchProfile.Item.CONTENT_INFO, FetchProfile.Item.FLAGS

public void add(String headerName)
将指定头字段添加到要预获取的属性的列表中。
headerName 要预获取的头
英文文档：

add

public void add(String headerName)
Add the specified header-field to the list of attributes to be prefetched.

Parameters:
headerName - header to be prefetched

public boolean contains(FetchProfile.Item item)
如果 fetch 配置文件包含给定特殊项，则返回 true。
英文文档：

contains

public boolean contains(FetchProfile.Item item)
Returns true if the fetch profile contains given special item.

public boolean contains(String headerName)
如果 fetch 配置文件包含给定头名称，则返回 true。
英文文档：

contains

public boolean contains(String headerName)
Returns true if the fetch profile contains given header name.

public FetchProfile.Item[] getItems()
获取此配置文件中设置的项。
return 此配置文件中设置的项
英文文档：

getItems

public FetchProfile.Item[] getItems()
Get the items set in this profile.

Returns:
items set in this profile

public String[] getHeaderNames()
获取此配置文件中设置的头字段的名称。
return 此配置文件中设置的头
英文文档：

getHeaderNames

public String[] getHeaderNames()
Get the names of the header-fields set in this profile.

Returns:
headers set in this profile
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FetchProfile.Item (Java EE 5)

javax.mail
Class FetchProfile.Item

java.lang.Object
    extended by  javax.mail.FetchProfile.Item
Direct Known Subclasses:
UIDFolder.FetchProfileItem
Enclosing class:
FetchProfile
public static class FetchProfile.Item
extends Object

Contained within: FetchProfile
Extended by: UIDFolder.FetchProfileItem

此内部类是可在 FetchProfile 中请求的所有项的基类。此处目前定义的项是 ENVELOPE、CONTENT_INFO 和 FLAGS。UIDFolder 接口还定义了 UID Item。

注意，此类只有一个受保护的构造方法，因此新的 Item 类型被限制为此类或其子类。这有效地实现了所允许 Item 类型的枚举。

See also javax.mail.UIDFolder
英文文档：

This inner class is the base class of all items that can be requested in a FetchProfile. The items currently defined here are ENVELOPE, CONTENT_INFO and FLAGS. The UIDFolder interface defines the UID Item as well.

Note that this class only has a protected constructor, therby restricting new Item types to either this class or subclasses. This effectively implements a enumeration of allowed Item types.

See Also:
UIDFolder

Field Summary
static FetchProfile.Item | CONTENT_INFO This item is for fetching information about the content of the message.
static FetchProfile.Item | ENVELOPE This is the Envelope item.
static FetchProfile.Item | FLAGS This is the Flags item.
Constructor Summary
protected FetchProfile.Item(String name)
Constructor for an item.
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

ENVELOPE

public static final FetchProfile.Item ENVELOPE
This is the Envelope item.

The Envelope is an aggregration of the common attributes of a Message. Implementations should include the following attributes: From, To, Cc, Bcc, ReplyTo, Subject and Date. More items may be included as well.

For implementations of the IMAP4 protocol (RFC 2060), the Envelope should include the ENVELOPE data item. More items may be included too.

英文文档：

CONTENT_INFO

public static final FetchProfile.Item CONTENT_INFO
This item is for fetching information about the content of the message.

This includes all the attributes that describe the content of the message. Implementations should include the following attributes: ContentType, ContentDisposition, ContentDescription, Size and LineCount. Other items may be included as well.

英文文档：

FLAGS

public static final FetchProfile.Item FLAGS
This is the Flags item.

Constructor Detail

protected FetchProfile.Item(String name)
项的构造方法。该名称仅用于调试。
英文文档：

FetchProfile.Item

protected FetchProfile.Item(String name)
Constructor for an item. The name is used only for debugging.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Flags (Java EE 5)

javax.mail
Class Flags

java.lang.Object
    extended by  javax.mail.Flags
All Implemented Interfaces:
Serializable, Cloneable
public class Flags
extends Object
implements Cloneable, Serializable

Implements: Cloneable, java.io.Serializable
Inner classes: Flags.Flag

Flags 类表示 Message 上的标志集合。Flags 由预定义的系统标志和用户定义的标志组成。

系统标志由 Flags.Flag 内部类表示。用户定义的标志则表示为一个 String。用户标志是不区分大小写的。

预定义了一组标准的系统标志。大多数文件夹实现都应该支持这些标志。某些实现可能还支持用户定义的任意标志。Folder 上的 getPermanentFlags 方法将返回一个包含该文件夹实现支持的所有标志的 Flags 对象。

Flags 对象是可序列化的，因此，（例如）搜索条目中的 Flags 对象的使用可以随搜索条目一起被序列化。

警告： 此类的序列化对象可能与以后的 JavaMail API 版本不兼容。当前的序列化支持适用于短期存储。

以下代码示例说明了如何设置、检查和获取某条消息的标志。

Message m = folder.getMessage(1);
m.setFlag(Flags.Flag.DELETED, true); // set the DELETED flag

// Check if DELETED flag is set of this message
if (m.isSet(Flags.Flag.DELETED))
    System.out.println("DELETED message");

// Examine ALL system flags for this message
Flags flags = m.getFlags();
Flags.Flag[] sf = flags.getSystemFlags();
for (int i = 0; i < sf.length; i++) {
    if (sf[i] == Flags.Flag.DELETED)
System.out.println("DELETED message");
    else if (sf[i] == Flags.Flag.SEEN)
System.out.println("SEEN message");
      ......
      ......
 }

See also getPermanentFlags
英文文档：

The Flags class represents the set of flags on a Message. Flags are composed of predefined system flags, and user defined flags.

A System flag is represented by the Flags.Flag inner class. A User defined flag is represented as a String. User flags are case-independent.

A set of standard system flags are predefined. Most folder implementations are expected to support these flags. Some implementations may also support arbitrary user-defined flags. The getPermanentFlags method on a Folder returns a Flags object that holds all the flags that are supported by that folder implementation.

A Flags object is serializable so that (for example) the use of Flags objects in search terms can be serialized along with the search terms.

Warning: Serialized objects of this class may not be compatible with future JavaMail API releases. The current serialization support is appropriate for short term storage.

The below code sample illustrates how to set, examine and get the flags for a message.

 Message m = folder.getMessage(1);
 m.setFlag(Flags.Flag.DELETED, true); // set the DELETED flag

 // Check if DELETED flag is set of this message
 if (m.isSet(Flags.Flag.DELETED))
        System.out.println("DELETED message");

 // Examine ALL system flags for this message
 Flags flags = m.getFlags();
 Flags.Flag[] sf = flags.getSystemFlags();
 for (int i = 0; i < sf.length; i++) {
        if (sf[i] == Flags.Flag.DELETED)
            System.out.println("DELETED message");
        else if (sf[i] == Flags.Flag.SEEN)
            System.out.println("SEEN message");
      ......
      ......
 }

Author:
John Mani, Bill Shannon
See Also:
Folder.getPermanentFlags(), Serialized Form

Nested Class Summary
static class Flags.Flag
This inner class represents an individual system flag.
Constructor Summary
Flags()
Construct an empty Flags object.
Flags(Flags.Flag flag)
Construct a Flags object initialized with the given system flag.
Flags(Flags flags)
Construct a Flags object initialized with the given flags.
Flags(String flag)
Construct a Flags object initialized with the given user flag.
Method Summary
void | add(Flags.Flag flag) Add the specified system flag to this Flags object.
void | add(Flags f) Add all the flags in the given Flags object to this Flags object.
void | add(String flag) Add the specified user flag to this Flags object.
Object | clone() Returns a clone of this Flags object.
boolean | contains(Flags.Flag flag) Check whether the specified system flag is present in this Flags object.
boolean | contains(Flags f) Check whether all the flags in the specified Flags object are present in this Flags object.
boolean | contains(String flag) Check whether the specified user flag is present in this Flags object.
boolean | equals(Object obj) Check whether the two Flags objects are equal.
Flags.Flag[] | getSystemFlags() Return all the system flags in this Flags object.
String[] | getUserFlags() Return all the user flags in this Flags object.
int | hashCode() Compute a hash code for this Flags object.
void | remove(Flags.Flag flag) Remove the specified system flag from this Flags object.
void | remove(Flags f) Remove all flags in the given Flags object from this Flags object.
void | remove(String flag) Remove the specified user flag from this Flags object.
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Flags()
构造一个空的 Flags 对象。
英文文档：

Flags

public Flags()
Construct an empty Flags object.

public Flags(Flags flags)
构造一个用给定标志初始化的 Flags 对象。
flags 用于初始化的标志
英文文档：

Flags

public Flags(Flags flags)
Construct a Flags object initialized with the given flags.

Parameters:
flags - the flags for initialization

public Flags(Flags.Flag flag)
构造一个用给定系统标志初始化的 Flags 对象。
flag 用于初始化的标志
英文文档：

Flags

public Flags(Flags.Flag flag)
Construct a Flags object initialized with the given system flag.

Parameters:
flag - the flag for initialization

public Flags(String flag)
构造一个用给定用户标志初始化的 Flags 对象。
flag 用于初始化的标志
英文文档：

Flags

public Flags(String flag)
Construct a Flags object initialized with the given user flag.

Parameters:
flag - the flag for initialization
Method Detail

public void add(Flags.Flag flag)
将指定系统标志添加到此 Flags 对象。
flag 要添加的标志
英文文档：

add

public void add(Flags.Flag flag)
Add the specified system flag to this Flags object.

Parameters:
flag - the flag to add

public void add(String flag)
将指定用户标志添加到此 Flags 对象。
flag 要添加的标志
英文文档：

add

public void add(String flag)
Add the specified user flag to this Flags object.

Parameters:
flag - the flag to add

public void add(Flags f)
将给定 Flags 对象中的所有标志添加到此 Flags 对象。
f Flags 对象
英文文档：

add

public void add(Flags f)
Add all the flags in the given Flags object to this Flags object.

Parameters:
f - Flags object

public void remove(Flags.Flag flag)
从此 Flags 对象中移除指定系统标志。
flag 要移除的标志
英文文档：

remove

public void remove(Flags.Flag flag)
Remove the specified system flag from this Flags object.

Parameters:
flag - the flag to be removed

public void remove(String flag)
从此 Flags 对象中移除指定用户标志。
flag 要移除的标志
英文文档：

remove

public void remove(String flag)
Remove the specified user flag from this Flags object.

Parameters:
flag - the flag to be removed

public void remove(Flags f)
从此 Flags 对象中移除给定 Flags 对象中的所有标志。
f 要移除的标志
英文文档：

remove

public void remove(Flags f)
Remove all flags in the given Flags object from this Flags object.

Parameters:
f - the flag to be removed

public boolean contains(Flags.Flag flag)
检查此 Flags 对象中是否存在指定系统标志。
return 如果给定标志存在，则返回 true；否则返回 false。
英文文档：

contains

public boolean contains(Flags.Flag flag)
Check whether the specified system flag is present in this Flags object.

Returns:
true of the given flag is present, otherwise false.

public boolean contains(String flag)
检查此 Flags 对象中是否存在指定用户标志。
return 如果给定标志存在，则返回 true；否则返回 false。
英文文档：

contains

public boolean contains(String flag)
Check whether the specified user flag is present in this Flags object.

Returns:
true of the given flag is present, otherwise false.

public boolean contains(Flags f)
检查此 Flags 对象中是否存在指定 Flags 对象中的所有标志。
return 如果存在给定 Flags 对象中的所有标志，则返回 true；否则返回 false。
英文文档：

contains

public boolean contains(Flags f)
Check whether all the flags in the specified Flags object are present in this Flags object.

Returns:
true if all flags in the given Flags object are present, otherwise false.

public boolean equals(Object obj)
检查两个 Flags 对象是否相等。
return 如果两个对象相等，则返回 true
英文文档：

equals

public boolean equals(Object obj)
Check whether the two Flags objects are equal.

Overrides:
equals in class Object
Returns:
true if they're equal

public int hashCode()
计算此 Flags 对象的哈希码。
return 哈希码
英文文档：

hashCode

public int hashCode()
Compute a hash code for this Flags object.

Overrides:
hashCode in class Object
Returns:
the hash code

public Flags.Flag[] getSystemFlags()
返回此 Flags 对象中的所有系统标志。如果没有设置标志，则返回大小为 0 的数组。
return 表示系统标志的 Flags.Flag 对象的数组
英文文档：

getSystemFlags

public Flags.Flag[] getSystemFlags()
Return all the system flags in this Flags object. Returns an array of size zero if no flags are set.

Returns:
array of Flags.Flag objects representing system flags

public String[] getUserFlags()
返回此 Flags 对象中的所有用户标志。如果没有设置标志，则返回大小为 0 的数组。
return String 数组，每个 String 都表示一个标志。
英文文档：

getUserFlags

public String[] getUserFlags()
Return all the user flags in this Flags object. Returns an array of size zero if no flags are set.

Returns:
array of Strings, each String represents a flag.

public Object clone()
返回此 Flags 对象的副本。
英文文档：

clone

public Object clone()
Returns a clone of this Flags object.

Overrides:
clone in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Flags.Flag (Java EE 5)

javax.mail
Class Flags.Flag

java.lang.Object
    extended by  javax.mail.Flags.Flag
Enclosing class:
Flags
public static final class Flags.Flag
extends Object

Contained within: Flags

此内部类表示单独的系统标志。此处预定义了一组标准的系统标志对象。
英文文档：

This inner class represents an individual system flag. A set of standard system flag objects are predefined here.

Field Summary
static Flags.Flag | ANSWERED This message has been answered.
static Flags.Flag | DELETED This message is marked deleted.
static Flags.Flag | DRAFT This message is a draft.
static Flags.Flag | FLAGGED This message is flagged.
static Flags.Flag | RECENT This message is recent.
static Flags.Flag | SEEN This message is seen.
static Flags.Flag | USER A special flag that indicates that this folder supports user defined flags.
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

ANSWERED

public static final Flags.Flag ANSWERED
This message has been answered. This flag is set by clients to indicate that this message has been answered to.

英文文档：

DELETED

public static final Flags.Flag DELETED
This message is marked deleted. Clients set this flag to mark a message as deleted. The expunge operation on a folder removes all messages in that folder that are marked for deletion.

英文文档：

DRAFT

public static final Flags.Flag DRAFT
This message is a draft. This flag is set by clients to indicate that the message is a draft message.

英文文档：

FLAGGED

public static final Flags.Flag FLAGGED
This message is flagged. No semantic is defined for this flag. Clients alter this flag.

英文文档：

RECENT

public static final Flags.Flag RECENT
This message is recent. Folder implementations set this flag to indicate that this message is new to this folder, that is, it has arrived since the last time this folder was opened.

Clients cannot alter this flag.

英文文档：

SEEN

public static final Flags.Flag SEEN
This message is seen. This flag is implicitly set by the implementation when the this Message's content is returned to the client in some form. The getInputStream and getContent methods on Message cause this flag to be set.

Clients can alter this flag.

英文文档：

USER

public static final Flags.Flag USER
A special flag that indicates that this folder supports user defined flags.

The implementation sets this flag. Clients cannot alter this flag but can use it to determine if a folder supports user defined flags by using folder.getPermanentFlags().contains(Flags.Flag.USER).

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Folder (Java EE 5)

javax.mail
Class Folder

java.lang.Object
    extended by  javax.mail.Folder

public abstract class Folder
extends Object

Folder 是表示邮件消息文件夹的抽象类。子类实现特定于协议的 Folder。

Folder 可以包含 Message、其他 Folder 或两者，这提供了以 Store 的默认文件夹为根的树状层次结构。（注意，有些 Folder 实现可能不允许 Message 和其他 Folder 都位于同一 Folder 中）。

文件夹名称的解释是与实现相关的。文件夹完全名称中不同的层次结构级别是用层次结构分界符字符将彼此隔开的。

保留不区分大小写的完全文件夹名称（即相对于 Store 的默认文件夹的完全名称）INBOX 来表示“此服务器上此用户的主文件夹”。并不是所有 Store 都会提供一个 INBOX 文件夹，也不是所有用户都会一直拥有一个 INBOX 文件夹。保留名称 INBOX 是为了在该文件夹存在时在提供它的 Store 中引用此文件夹。

从 Store 中获得的 Folder 对象无需实际存在于后端存储中。exists 方法测试文件夹是否存在。create 方法创建一个 Folder。

Folder 最初处于关闭状态。某些方法在这种状态下是有效的；这些方法的文档注明了这一点。通过调用其 'open' 方法打开 Folder。除了 open、delete 和 renameTo 之外，所有 Folder 方法在这种状态下都是有效的。

获得 Folder 的唯一方式是调用 Store、Folder 或 Session 上的 getFolder 方法，或者调用 Folder 上的 list 或 listSubscribed 方法。Store 不缓存上述方法返回的 Folder 对象。因此，用相同文件夹名称多次调用 getFolder 方法将返回不同的 Folder 对象。对于 list 和 listSubscribed 方法也是如此。

Folder 缓存 Folder 中的 Message 对象。因此，用同一消息编号多次调用 getMessage(msgno) 将返回相同的 Message 对象，直到对此 Folder 执行清除操作。

注意，如果使用清除方法清除了该包含 Folder，则 Message 的消息编号可在会话中发生更改。使用消息编号作为对消息的引用的客户端应该意识到这一点，并且应该做好准备应对这种情况（可能通过清空现有消息编号引用并重新加载它们来应对）。由于这种复杂性，客户端最好使用 Message 对象作为对消息的引用，而不使用消息编号。已清除的 Message 对象仍然必须被删改，但该文件夹中的其他 Message 对象不受清除的影响。

英文文档：

Folder is an abstract class that represents a folder for mail messages. Subclasses implement protocol specific Folders.

Folders can contain Messages, other Folders or both, thus providing a tree-like hierarchy rooted at the Store's default folder. (Note that some Folder implementations may not allow both Messages and other Folders in the same Folder).

The interpretation of folder names is implementation dependent. The different levels of hierarchy in a folder's full name are separated from each other by the hierarchy delimiter character.

The case-insensitive full folder name (that is, the full name relative to the default folder for a Store) INBOX is reserved to mean the "primary folder for this user on this server". Not all Stores will provide an INBOX folder, and not all users will have an INBOX folder at all times. The name INBOX is reserved to refer to this folder, when it exists, in Stores that provide it.

A Folder object obtained from a Store need not actually exist in the backend store. The exists method tests whether the folder exists or not. The create method creates a Folder.

A Folder is initially in the closed state. Certain methods are valid in this state; the documentation for those methods note this. A Folder is opened by calling its 'open' method. All Folder methods, except open, delete and renameTo, are valid in this state.

The only way to get a Folder is by invoking the getFolder method on Store, Folder, or Session, or by invoking the list or listSubscribed methods on Folder. Folder objects returned by the above methods are not cached by the Store. Thus, invoking the getFolder method with the same folder name multiple times will return distinct Folder objects. Likewise for the list and listSubscribed methods.

The Message objects within the Folder are cached by the Folder. Thus, invoking getMessage(msgno) on the same message number multiple times will return the same Message object, until an expunge is done on this Folder.

Note that a Message's message number can change within a session if the containing Folder is expunged using the expunge method. Clients that use message numbers as references to messages should be aware of this and should be prepared to deal with situation (probably by flushing out existing message number references and reloading them). Because of this complexity, it is better for clients to use Message objects as references to messages, rather than message numbers. Expunged Message objects still have to be pruned, but other Message objects in that folder are not affected by the expunge.

Author:
John Mani, Bill Shannon

Field Summary
static int | HOLDS_FOLDERS This folder can contain other folders
static int | HOLDS_MESSAGES This folder can contain messages
protected int | mode The open mode of this folder.
static int | READ_ONLY The Folder is read only.
static int | READ_WRITE The state and contents of this folder can be modified.
protected Store | store The parent store.
Constructor Summary
protected Folder(Store store)
Constructor that takes a Store object.
Method Summary
 void addConnectionListener(ConnectionListener l)
Add a listener for Connection events on this Folder.
 void addFolderListener(FolderListener l)
Add a listener for Folder events on this Folder.
 void addMessageChangedListener(MessageChangedListener l)
Add a listener for MessageChanged events on this Folder.
 void addMessageCountListener(MessageCountListener l)
Add a listener for MessageCount events on this Folder.
abstract  void appendMessages(Message[] msgs)
Append given Messages to this folder.
abstract  void close(boolean expunge)
Close this Folder.
 void copyMessages(Message[] msgs, Folder folder)
Copy the specified Messages from this Folder into another Folder.
abstract  boolean create(int type)
Create this folder on the Store.
abstract  boolean delete(boolean recurse)
Delete this Folder.
abstract  boolean exists()
Tests if this folder physically exists on the Store.
abstract  Message[] expunge()
Expunge (permanently remove) messages marked DELETED.
 void fetch(Message[] msgs, FetchProfile fp)
Prefetch the items specified in the FetchProfile for the given Messages.
protected  void finalize()
 int getDeletedMessageCount()
Get the number of deleted messages in this Folder.
abstract  Folder getFolder(String name)
Return the Folder object corresponding to the given name.
abstract  String getFullName()
Returns the full name of this Folder.
abstract  Message getMessage(int msgnum)
Get the Message object corresponding to the given message number.
abstract  int getMessageCount()
Get total number of messages in this Folder.
 Message[] getMessages()
Get all Message objects from this Folder.
 Message[] getMessages(int[] msgnums)
Get the Message objects for message numbers specified in the array.
 Message[] getMessages(int start, int end)
Get the Message objects for message numbers ranging from start through end, both start and end inclusive.
 int getMode()
Return the open mode of this folder.
abstract  String getName()
Returns the name of this Folder.
 int getNewMessageCount()
Get the number of new messages in this Folder.
abstract  Folder getParent()
Returns the parent folder of this folder.
abstract  Flags getPermanentFlags()
Get the permanent flags supported by this Folder.
abstract  char getSeparator()
Return the delimiter character that separates this Folder's pathname from the names of immediate subfolders.
 Store getStore()
Returns the Store that owns this Folder object.
abstract  int getType()
Returns the type of this Folder, that is, whether this folder can hold messages or subfolders or both.
 int getUnreadMessageCount()
Get the total number of unread messages in this Folder.
 URLName getURLName()
Return a URLName representing this folder.
abstract  boolean hasNewMessages()
Returns true if this Folder has new messages since the last time this indication was reset.
abstract  boolean isOpen()
Indicates whether this Folder is in the 'open' state.
 boolean isSubscribed()
Returns true if this Folder is subscribed.
 Folder[] list()
Convenience method that returns the list of folders under this Folder.
abstract  Folder[] list(String pattern)
Returns a list of Folders belonging to this Folder's namespace that match the specified pattern.
 Folder[] listSubscribed()
Convenience method that returns the list of subscribed folders under this Folder.
 Folder[] listSubscribed(String pattern)
Returns a list of subscribed Folders belonging to this Folder's namespace that match the specified pattern.
protected  void notifyConnectionListeners(int type)
Notify all ConnectionListeners.
protected  void notifyFolderListeners(int type)
Notify all FolderListeners registered on this Folder and this folder's Store.
protected  void notifyFolderRenamedListeners(Folder folder)
Notify all FolderListeners registered on this Folder and this folder's Store about the renaming of this folder.
protected  void notifyMessageAddedListeners(Message[] msgs)
Notify all MessageCountListeners about the addition of messages into this folder.
protected  void notifyMessageChangedListeners(int type, Message msg)
Notify all MessageChangedListeners.
protected  void notifyMessageRemovedListeners(boolean removed, Message[] msgs)
Notify all MessageCountListeners about the removal of messages from this Folder.
abstract  void open(int mode)
Open this Folder.
 void removeConnectionListener(ConnectionListener l)
Remove a Connection event listener.
 void removeFolderListener(FolderListener l)
Remove a Folder event listener.
 void removeMessageChangedListener(MessageChangedListener l)
Remove a MessageChanged listener.
 void removeMessageCountListener(MessageCountListener l)
Remove a MessageCount listener.
abstract  boolean renameTo(Folder f)
Rename this Folder.
 Message[] search(SearchTerm term)
Search this Folder for messages matching the specified search criterion.
 Message[] search(SearchTerm term, Message[] msgs)
Search the given array of messages for those that match the specified search criterion.
 void setFlags(int[] msgnums, Flags flag, boolean value)
Set the specified flags on the messages whose message numbers are in the array.
 void setFlags(int start, int end, Flags flag, boolean value)
Set the specified flags on the messages numbered from start through end, both start and end inclusive.
 void setFlags(Message[] msgs, Flags flag, boolean value)
Set the specified flags on the messages specified in the array.
 void setSubscribed(boolean subscribe)
Subscribe or unsubscribe this Folder.
 String toString()
override the default toString(), it will return the String from Folder.getFullName() or if that is null, it will use the default toString() behavior.
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

store

protected Store store
The parent store.

英文文档：

mode

protected int mode
The open mode of this folder. The open mode is Folder.READ_ONLY, Folder.READ_WRITE, or -1 if not known.

Since:
JavaMail 1.1

英文文档：

HOLDS_MESSAGES

public static final int HOLDS_MESSAGES
This folder can contain messages

See Also:
Constant Field Values

英文文档：

HOLDS_FOLDERS

public static final int HOLDS_FOLDERS
This folder can contain other folders

See Also:
Constant Field Values

英文文档：

READ_ONLY

public static final int READ_ONLY
The Folder is read only. The state and contents of this folder cannot be modified.

See Also:
Constant Field Values

英文文档：

READ_WRITE

public static final int READ_WRITE
The state and contents of this folder can be modified.

See Also:
Constant Field Values
Constructor Detail

protected Folder(Store store)
带有 Store 对象的构造方法。
store 保存此文件夹的 Store
英文文档：

Folder

protected Folder(Store store)
Constructor that takes a Store object.

Parameters:
store - the Store that holds this folder
Method Detail

abstract public String getName()
返回此 Folder 的名称。

可以对关闭的 Folder 调用此方法。

return Folder 的名称
英文文档：

getName

public abstract String getName()
Returns the name of this Folder.

This method can be invoked on a closed Folder.

Returns:
name of the Folder

abstract public String getFullName()
返回此 Folder 的完全名称。如果该文件夹位于此 Store 的根层次结构下，则返回的名称是相对于根的。否则返回一个以层次结构分界符开头的绝对名称。

可以对关闭的 Folder 调用此方法。

return Folder 的完全名称
英文文档：

getFullName

public abstract String getFullName()
Returns the full name of this Folder. If the folder resides under the root hierarchy of this Store, the returned name is relative to the root. Otherwise an absolute name, starting with the hierarchy delimiter, is returned.

This method can be invoked on a closed Folder.

Returns:
full name of the Folder

public URLName getURLName() throws MessagingException
返回表示此文件夹的 URLName。返回的 URLName 不 包括用来访问 store 的密码。
return | 表示此文件夹的 URLName
since
en
JavaMail 1.1
See also | javax.mail.URLName
英文文档：

getURLName

public URLName getURLName()
                   throws MessagingException
Return a URLName representing this folder. The returned URLName does not include the password used to access the store.

Returns:
the URLName representing this folder
Throws:
MessagingException
Since:
JavaMail 1.1
See Also:
URLName

public Store getStore()
返回拥有此 Folder 对象的 Store。可以对关闭的 Folder 调用此方法。
return Store
英文文档：

getStore

public Store getStore()
Returns the Store that owns this Folder object. This method can be invoked on a closed Folder.

Returns:
the Store

abstract public Folder getParent() throws MessagingException
返回此文件夹的父文件夹。可以对关闭的 Folder 调用此方法。如果此文件夹位于文件夹层次结构的顶部，则此方法返回 null。

注意，因为 Folder 对象未被缓存，所以调用此方法将返回一个新的截然不同的 Folder 对象。

return 父文件夹
英文文档：

getParent

public abstract Folder getParent()
                          throws MessagingException
Returns the parent folder of this folder. This method can be invoked on a closed Folder. If this folder is the top of a folder hierarchy, this method returns null.

Note that since Folder objects are not cached, invoking this method returns a new distinct Folder object.

Returns:
Parent folder
Throws:
MessagingException

abstract public boolean exists() throws MessagingException
测试此文件夹在物理上是否存在于该 Store 上。可以对关闭的 Folder 调用此方法。
return | 如果文件夹存在，则返回 true；否则返回 false
Throws | MessagingException: 如果到该服务器的连接丢失，则通常抛出此异常。
See also | create
英文文档：

exists

public abstract boolean exists()
                        throws MessagingException
Tests if this folder physically exists on the Store. This method can be invoked on a closed Folder.

Returns:
true if the folder exists, otherwise false
Throws:
MessagingException - typically if the connection to the server is lost.
See Also:
create(int)

abstract public Folder[] list(String pattern) throws MessagingException
返回一个 Folder 列表，这些 Folder 属于此 Folder 的与指定模式匹配的名称空间。模式可能包含通配符字符 "%" 和 "*"，前者匹配除层次结构分界符以外的任意字符，后者匹配任意字符。

例如，假定文件夹层次结构如下所示：

Personal/
Finance/
Stocks
Bonus
StockOptions
Jokes
对 "Personal" 调用 list("*") 将返回整个层次结构。
对 "Personal" 调用 list("%") 将返回 "Finance" 和 "Jokes"。
对 "Personal" 调用 list("Jokes") 将返回 "Jokes"。
对 "Finance" 调用 list("Stock*") 将返回 "Stocks" 和 "StockOptions"。

Store 不缓存 Folder 对象，因此用相同的模式多次调用此方法将返回许多不同的 Folder 对象。

可以对关闭的 Folder 调用此方法。

pattern | 匹配模式
return | 匹配的 Folder 对象的数组。如果不存在匹配的 Folder，则返回一个空数组。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
See also | listSubscribed
英文文档：

list

public abstract Folder[] list(String pattern)
                       throws MessagingException
Returns a list of Folders belonging to this Folder's namespace that match the specified pattern. Patterns may contain the wildcard characters "%", which matches any character except hierarchy delimiters, and "*", which matches any character.

As an example, given the folder hierarchy:

    Personal/
       Finance/
          Stocks
          Bonus
          StockOptions
       Jokes
list("*") on "Personal" will return the whole hierarchy.
list("%") on "Personal" will return "Finance" and "Jokes".
list("Jokes") on "Personal" will return "Jokes".
list("Stock*") on "Finance" will return "Stocks" and "StockOptions".

Folder objects are not cached by the Store, so invoking this method on the same pattern multiple times will return that many distinct Folder objects.

This method can be invoked on a closed Folder.

Parameters:
pattern - the match pattern
Returns:
array of matching Folder objects. An empty array is returned if no matching Folders exist.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException
See Also:
listSubscribed(java.lang.String)

public Folder[] listSubscribed(String pattern) throws MessagingException
返回已订阅 Folder 的列表，这些 Folder 属于此 Folder 的与指定模式匹配的名称空间。如果该文件夹不支持订阅，则此方法应该解析为 list。（此处提供的默认实现就是完成此操作的）。该模式可以包含通配符，这与 list 类似。

注意，在给定的文件夹层次结构级别上，可能未订阅某个特定文件夹，但可以订阅文件夹层次结构中该文件夹下的文件夹。为了允许遍历文件夹层次结构，可返回此类未订阅的文件夹，指示该层次结构中更低级别的某个文件夹被订阅了。文件夹上的 isSubscribed 方法可判断任何特定文件夹是否被实际订阅了。

Store 不缓存 Folder 对象，因此用相同的模式多次调用此方法将返回许多不同的 Folder 对象。

可以对关闭的 Folder 调用此方法。

pattern | 匹配模式
return | 匹配的已订阅 Folder 对象的数组。如果不存在匹配的已订阅文件夹，则返回一个空数组。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
See also | list
英文文档：

listSubscribed

public Folder[] listSubscribed(String pattern)
                        throws MessagingException
Returns a list of subscribed Folders belonging to this Folder's namespace that match the specified pattern. If the folder does not support subscription, this method should resolve to list. (The default implementation provided here, does just this). The pattern can contain wildcards as for list.

Note that, at a given level of the folder hierarchy, a particular folder may not be subscribed, but folders underneath that folder in the folder hierarchy may be subscribed. In order to allow walking the folder hierarchy, such unsubscribed folders may be returned, indicating that a folder lower in the hierarchy is subscribed. The isSubscribed method on a folder will tell whether any particular folder is actually subscribed.

Folder objects are not cached by the Store, so invoking this method on the same pattern multiple times will return that many distinct Folder objects.

This method can be invoked on a closed Folder.

Parameters:
pattern - the match pattern
Returns:
array of matching subscribed Folder objects. An empty array is returned if no matching subscribed folders exist.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException
See Also:
list(java.lang.String)

public Folder[] list() throws MessagingException
返回此 Folder 下文件夹的列表的便捷方法。此方法只使用 "%" 作为匹配模式来调用 list(String pattern) 方法。可以对关闭的 Folder 调用此方法。
return | 此 Folder 下的 Folder 对象的数组。如果不存在子文件夹，则返回一个空数组。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
See also | list
英文文档：

list

public Folder[] list()
              throws MessagingException
Convenience method that returns the list of folders under this Folder. This method just calls the list(String pattern) method with "%" as the match pattern. This method can be invoked on a closed Folder.

Returns:
array of Folder objects under this Folder. An empty array is returned if no subfolders exist.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException
See Also:
list(java.lang.String)

public Folder[] listSubscribed() throws MessagingException
返回此 Folder 下已订阅文件夹的列表的便捷方法。此方法只使用 "%" 作为匹配模式来调用 listSubscribed(String pattern) 方法。可以对关闭的 Folder 调用此方法。
return | 此 Folder 下已订阅 Folder 对象的数组。如果不存在已订阅子文件夹，则返回一个空数组。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
See also | listSubscribed
英文文档：

listSubscribed

public Folder[] listSubscribed()
                        throws MessagingException
Convenience method that returns the list of subscribed folders under this Folder. This method just calls the listSubscribed(String pattern) method with "%" as the match pattern. This method can be invoked on a closed Folder.

Returns:
array of subscribed Folder objects under this Folder. An empty array is returned if no subscribed subfolders exist.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException
See Also:
listSubscribed(java.lang.String)

abstract public char getSeparator() throws MessagingException
返回将此 Folder 的路径名与直接子文件夹名称分隔开的分界符字符。可以对关闭的 Folder 调用此方法。
Throws | FolderNotFoundException: 如果该实现需要该文件夹存在，但该文件夹不存在
return | 层次结构分隔符字符
英文文档：

getSeparator

public abstract char getSeparator()
                           throws MessagingException
Return the delimiter character that separates this Folder's pathname from the names of immediate subfolders. This method can be invoked on a closed Folder.

Returns:
Hierarchy separator character
Throws:
FolderNotFoundException - if the implementation requires the folder to exist, but it does not
MessagingException

abstract public int getType() throws MessagingException
返回此 Folder 的类型，即此文件夹是保存消息，还是保存子文件夹，还是二者都包括。返回的值是带有适当位集的整数位字段。可以对关闭的 Folder 调用此方法。
return | 带有适当位集的整数
Throws | FolderNotFoundException: 如果此文件夹不存在。
See also | HOLDS_FOLDERS, HOLDS_MESSAGES
英文文档：

getType

public abstract int getType()
                     throws MessagingException
Returns the type of this Folder, that is, whether this folder can hold messages or subfolders or both. The returned value is an integer bitfield with the appropriate bits set. This method can be invoked on a closed folder.

Returns:
integer with appropriate bits set
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException
See Also:
HOLDS_FOLDERS, HOLDS_MESSAGES

abstract public boolean create(int type) throws MessagingException
在 Store 上创建此文件夹。在创建此文件夹时，还将创建其路径中不存在的任何文件夹。

如果创建成功，则向此 Folder 和此 Store 上注册的所有 FolderListener 传送 CREATED FolderEvent。

type | 此文件夹的类型。
return | 如果创建成功，则返回 true；否则返回 false。
Throws | MessagingException:
See also | HOLDS_FOLDERS, HOLDS_MESSAGES, javax.mail.event.FolderEvent
英文文档：

create

public abstract boolean create(int type)
                        throws MessagingException
Create this folder on the Store. When this folder is created, any folders in its path that do not exist are also created.

If the creation is successful, a CREATED FolderEvent is delivered to any FolderListeners registered on this Folder and this Store.

Parameters:
type - The type of this folder.
Returns:
true if the creation succeeds, else false.
Throws:
MessagingException
See Also:
HOLDS_FOLDERS, HOLDS_MESSAGES, FolderEvent

public boolean isSubscribed()
如果此 Folder 被订阅，则返回 true。

可以对关闭的 Folder 调用此方法。

此处提供的默认实现只返回 true。

return 如果此 Folder 被订阅，则返回 ture
英文文档：

isSubscribed

public boolean isSubscribed()
Returns true if this Folder is subscribed.

This method can be invoked on a closed Folder.

The default implementation provided here just returns true.

Returns:
true if this Folder is subscribed

public void setSubscribed(boolean subscribe) throws MessagingException
订阅或取消订阅此 Folder。并不是所有 Store 都支持订阅。

可以对关闭的 Folder 调用此方法。

此处提供的实现只抛出 MethodNotSupportedException。

subscribe | 该参数为 ture 表示订阅，为 false 表示取消订阅
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MethodNotSupportedException: 如果此 Store 不支持订阅
Throws | MessagingException:
英文文档：

setSubscribed

public void setSubscribed(boolean subscribe)
                   throws MessagingException
Subscribe or unsubscribe this Folder. Not all Stores support subscription.

This method can be invoked on a closed Folder.

The implementation provided here just throws the MethodNotSupportedException.

Parameters:
subscribe - true to subscribe, false to unsubscribe
Throws:
FolderNotFoundException - if this folder does not exist.
MethodNotSupportedException - if this store does not support subscription
MessagingException

abstract public boolean hasNewMessages() throws MessagingException
如果自上次重置此指示后，此 Folder 有了新的消息，则返回 ture。设置或重置此指示的时间取决于 Folder 实现（在使用 IMAP 的情况下，取决于服务器）。可使用此方法在 Folder 上实现轻量级“检查新邮件”操作，无需打开该 Folder。（例如，监视邮箱和邮箱中有新邮件时的标志的线程。）此方法应该指示 Folder 中的任何消息是否设置了 RECENT 标志。

注意，这不是对新邮件的增量检查，也就是说，无法用它来确定自上次调用此方法以来是否有任何新邮件到达。要实现增量检查，需要打开 Folder。

可以对能够包含 Message 的关闭的 Folder 调用此方法。

return | 如果 Store 有新 Message，则返回 true
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
英文文档：

hasNewMessages

public abstract boolean hasNewMessages()
                                throws MessagingException
Returns true if this Folder has new messages since the last time this indication was reset. When this indication is set or reset depends on the Folder implementation (and in the case of IMAP, depends on the server). This method can be used to implement a lightweight "check for new mail" operation on a Folder without opening it. (For example, a thread that monitors a mailbox and flags when it has new mail.) This method should indicate whether any messages in the Folder have the RECENT flag set.

Note that this is not an incremental check for new mail, i.e., it cannot be used to determine whether any new messages have arrived since the last time this method was invoked. To implement incremental checks, the Folder needs to be opened.

This method can be invoked on a closed Folder that can contain Messages.

Returns:
true if the Store has new Messages
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException

abstract public Folder getFolder(String name) throws MessagingException
返回与给定名称相对应的 Folder 对象。注意，此文件夹不必在物理上存在于该 Store 中。Folder 上的 exists() 方法可指示其是否实际存在于 Store 上。

在某些 Store 中，名称可以是绝对路径，如果它以层次结构分界符开始。否则，它将被解释为相对于此 Folder 的路径。

Store 不缓存 Folder 对象，因此用相同的名称多次调用此方法将返回许多不同的 Folder 对象。

可以对关闭的 Folder 调用此方法。

name | Folder 的名称
return | Folder 对象
Throws | MessagingException:
英文文档：

getFolder

public abstract Folder getFolder(String name)
                          throws MessagingException
Return the Folder object corresponding to the given name. Note that this folder does not physically have to exist in the Store. The exists() method on a Folder indicates whether it really exists on the Store.

In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Otherwise, it is interpreted relative to this Folder.

Folder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct Folder objects.

This method can be invoked on a closed Folder.

Parameters:
name - name of the Folder
Returns:
Folder object
Throws:
MessagingException

abstract public boolean delete(boolean recurse) throws MessagingException
删除此 Folder。此方法只有在关闭的 Folder 上才会成功。

recurse 标志控制删除是否影响子文件夹。如果该标志为 true，则删除所有子文件夹，然后删除此文件夹本身。如果该标志为 false，则具体行为取决于文件夹类型，如下方详述：

  • 文件夹只能包含消息：(type == HOLDS_MESSAGES)。
    移除文件夹内的所有消息。然后移除文件夹本身。Store 和此文件夹将生成相应的 FolderEvent。

  • 文件夹只能包含子文件夹：(type == HOLDS_FOLDERS)。
    如果此文件夹为空（根本不包含任何子文件夹），则移除它。Store 和此文件夹将生成相应的 FolderEvent。
    如果此文件夹包含任何子文件夹，则删除失败并返回 false。

  • 文件夹可以包含子文件夹和消息：
    如果文件夹为空（没有消息或子文件夹），则移除它。如果文件夹不包含子文件夹，只包含消息，则移除所有消息。然后移除文件夹本身。在上述两种情况下，Store 和此文件夹将生成相应的 FolderEvent。

    如果该文件夹包含子文件夹，则有 3 种可能的选择，实现可以任选其一：

    1. 操作失败，而不考虑此文件夹是否包含消息。有些实现可能选择使用这种简单的方法。delete() 方法返回 false。
    2. 移除该文件夹内的所有消息。不移除子文件夹。不以任何方式移除文件夹本身或影响它。delete() 方法返回 true。且此文件夹上的 exists() 方法将返回 true，指示此文件夹仍然存在。
      Store 和此文件夹将生成相应的 FolderEvent。
    3. 移除该文件夹内的所有消息。不移除子文件夹。文件夹本身将其类型从 HOLDS_FOLDERS | HOLDS_MESSAGES 更改为 HOLDS_FOLDERS。这样就无法将新消息添加到此文件夹中，但可以在此文件夹下创建新的子文件夹。delete() 方法返回 true，指示操作成功。此文件夹上的 exists() 方法将返回 true，指示此文件夹仍然存在。
      Store 和此文件夹将生成相应的 FolderEvent。
return | 如果成功删除该 Folder，则返回 true
Throws | FolderNotFoundException: 如果此文件夹不存在
Throws | IllegalStateException: 如果此文件夹不处于关闭状态。
Throws | MessagingException:
See also | javax.mail.event.FolderEvent
英文文档：

delete

public abstract boolean delete(boolean recurse)
                        throws MessagingException
Delete this Folder. This method will succeed only on a closed Folder.

The recurse flag controls whether the deletion affects subfolders or not. If true, all subfolders are deleted, then this folder itself is deleted. If false, the behaviour is dependent on the folder type and is elaborated below:

  • The folder can contain only messages: (type == HOLDS_MESSAGES).
    All messages within the folder are removed. The folder itself is then removed. An appropriate FolderEvent is generated by the Store and this folder.

  • The folder can contain only subfolders: (type == HOLDS_FOLDERS).
    If this folder is empty (does not contain any subfolders at all), it is removed. An appropriate FolderEvent is generated by the Store and this folder.
    If this folder contains any subfolders, the delete fails and returns false.

  • The folder can contain subfolders as well as messages:
    If the folder is empty (no messages or subfolders), it is removed. If the folder contains no subfolders, but only messages, then all messages are removed. The folder itself is then removed. In both the above cases, an appropriate FolderEvent is generated by the Store and this folder.

    If the folder contains subfolders there are 3 possible choices an implementation is free to do:

    1. The operation fails, irrespective of whether this folder contains messages or not. Some implementations might elect to go with this simple approach. The delete() method returns false.
    2. Any messages within the folder are removed. Subfolders are not removed. The folder itself is not removed or affected in any manner. The delete() method returns true. And the exists() method on this folder will return true indicating that this folder still exists.
      An appropriate FolderEvent is generated by the Store and this folder.
    3. Any messages within the folder are removed. Subfolders are not removed. The folder itself changes its type from HOLDS_FOLDERS | HOLDS_MESSAGES to HOLDS_FOLDERS. Thus new messages cannot be added to this folder, but new subfolders can be created underneath. The delete() method returns true indicating success. The exists() method on this folder will return true indicating that this folder still exists.
      An appropriate FolderEvent is generated by the Store and this folder.

Returns:
true if the Folder is deleted successfully
Throws:
FolderNotFoundException - if this folder does not exist
IllegalStateException - if this folder is not in the closed state.
MessagingException
See Also:
FolderEvent

abstract public boolean renameTo(Folder f) throws MessagingException
重命名此 Folder。此方法只有在关闭的 Folder 上才会成功。

如果重命名成功，则向此文件夹及其包含 Store 上注册的 FolderListener 传送 RENAMED FolderEvent。

f | 表示此 Folder 的新名称的文件夹
return | 如果成功重命名该 Folder，则返回 true
Throws | FolderNotFoundException: 如果此文件夹不存在
Throws | IllegalStateException: 如果此文件夹不处于关闭状态。
Throws | MessagingException:
See also | javax.mail.event.FolderEvent
英文文档：

renameTo

public abstract boolean renameTo(Folder f)
                          throws MessagingException
Rename this Folder. This method will succeed only on a closed Folder.

If the rename is successful, a RENAMED FolderEvent is delivered to FolderListeners registered on this folder and its containing Store.

Parameters:
f - a folder representing the new name for this Folder
Returns:
true if the Folder is renamed successfully
Throws:
FolderNotFoundException - if this folder does not exist
IllegalStateException - if this folder is not in the closed state.
MessagingException
See Also:
FolderEvent

abstract public void open(int mode) throws MessagingException
打开此 Folder。此方法仅对可以包含 Message 并处于关闭状态的 Folder 有效。

如果成功打开此文件夹，则向此 Folder 上注册的所有 ConnectionListener 传送 OPENED ConnectionEvent。

打开多个到特定 Store 上同一文件夹的连接的效果是与实现相关的。有些实现允许有多个读者，但只允许有一个编写者。其他实现则允许有多个编写者和读者。

mode | 打开 Folder READ_ONLY 或 READ_WRITE
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | IllegalStateException: 如果此文件夹不处于关闭状态。
Throws | MessagingException:
See also | READ_ONLY, READ_WRITE, getType(), javax.mail.event.ConnectionEvent
英文文档：

open

public abstract void open(int mode)
                   throws MessagingException
Open this Folder. This method is valid only on Folders that can contain Messages and that are closed.

If this folder is opened successfully, an OPENED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder.

The effect of opening multiple connections to the same folder on a specifc Store is implementation dependent. Some implementations allow multiple readers, but only one writer. Others allow multiple writers as well as readers.

Parameters:
mode - open the Folder READ_ONLY or READ_WRITE
Throws:
FolderNotFoundException - if this folder does not exist.
IllegalStateException - if this folder is not in the closed state.
MessagingException
See Also:
READ_ONLY, READ_WRITE, getType(), ConnectionEvent

abstract public void close(boolean expunge) throws MessagingException
关闭此 Folder。此方法只对打开的 Folder 有效。

向此 Folder 上注册的所有 ConnectionListener 传送 CLOSED ConnectionEvent。注意，即使此方法通过抛出 MessagingException 异常终止，该文件夹也会关闭。

expunge | 如果此标志为 ture，则清除所有已删除的消息
Throws | IllegalStateException: 如果此文件夹没有打开
Throws | MessagingException:
See also | javax.mail.event.ConnectionEvent
英文文档：

close

public abstract void close(boolean expunge)
                    throws MessagingException
Close this Folder. This method is valid only on open Folders.

A CLOSED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder. Note that the folder is closed even if this method terminates abnormally by throwing a MessagingException.

Parameters:
expunge - expunges all deleted messages if this flag is true
Throws:
IllegalStateException - if this folder is not opened
MessagingException
See Also:
ConnectionEvent

abstract public boolean isOpen()
指示此 Folder 是否处于 'open' 状态。
return 如果此 Folder 处于 'open' 状态，则返回 true
英文文档：

isOpen

public abstract boolean isOpen()
Indicates whether this Folder is in the 'open' state.

Returns:
true if this Folder is in the 'open' state.

public int getMode()
返回此文件夹的打开模式。返回 Folder.READ_ONLY、Folder.READ_WRITE 或如果打开模式未知，则返回 -1（这通常只是因为某个旧的 Folder 提供者未更新到使用此新方法）。
Throws | IllegalStateException: 如果此文件夹没有打开
return | 此文件夹的打开模式
since
en
JavaMail 1.1
英文文档：

getMode

public int getMode()
Return the open mode of this folder. Returns Folder.READ_ONLY, Folder.READ_WRITE, or -1 if the open mode is not known (usually only because an older Folder provider has not been updated to use this new method).

Returns:
the open mode of this folder
Throws:
IllegalStateException - if this folder is not opened
Since:
JavaMail 1.1

abstract public Flags getPermanentFlags()
获取此 Folder 支持的持久标志。返回包含所有受支持标志的 Flag 对象。

特殊标志 Flags.USER 指示此 Folder 支持用户定义的任意标志。

在打开文件夹之前，该文件夹的受支持持久标志可能是不可用的。

return 持久标志；如果持久标志未知，则返回 null
英文文档：

getPermanentFlags

public abstract Flags getPermanentFlags()
Get the permanent flags supported by this Folder. Returns a Flags object that contains all the flags supported.

The special flag Flags.USER indicates that this Folder supports arbitrary user-defined flags.

The supported permanent flags for a folder may not be available until the folder is opened.

Returns:
permanent flags, or null if not known

abstract public int getMessageCount() throws MessagingException
获取此 Folder 中消息的总数。

可以对关闭的 Folder 调用此方法。但要注意的是，对于某些文件夹实现而言，获取总消息计数可能是一个开销很大的操作，涉及到实际打开该文件夹。在这种情况下，提供者可以选择在关闭状态下不支持此功能，此时此方法必须返回 -1。

对关闭的文件夹调用此方法的客户端必须要意识到这可能是一个开销很大的操作。这种情况下，客户端还必须准备好处理返回值 -1。

return | 消息总数。如果对关闭的文件夹调用此方法，则某些实现可能返回 -1。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
英文文档：

getMessageCount

public abstract int getMessageCount()
                             throws MessagingException
Get total number of messages in this Folder.

This method can be invoked on a closed folder. However, note that for some folder implementations, getting the total message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.

Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.

Returns:
total number of messages. -1 may be returned by certain implementations if this method is invoked on a closed folder.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException

public int getNewMessageCount() throws MessagingException
获取此 Folder 中新消息的数量。

可以对关闭的 Folder 调用此方法。但要注意的是，对于某些文件夹实现而言，获取新消息计数可能是一个开销很大的操作，涉及到实际打开该文件夹。在这种情况下，提供者可以选择在关闭状态下不支持此功能，此时此方法必须返回 -1。

对关闭的文件夹调用此方法的客户端必须要意识到这可能是一个开销很大的操作。这种情况下，客户端还必须准备好处理返回值 -1。

如果此文件夹是关闭的，则此实现返回 -1。否则，此实现将使用 getMessage(int) 获取该文件夹中的每个 Message，并检查它是否设置了 RECENT 标志。返回设置了此标志的消息总数。

return | 新消息数。如果对关闭的文件夹调用此方法，则某些实现可能返回 -1。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
英文文档：

getNewMessageCount

public int getNewMessageCount()
                       throws MessagingException
Get the number of new messages in this Folder.

This method can be invoked on a closed folder. However, note that for some folder implementations, getting the new message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.

Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.

This implementation returns -1 if this folder is closed. Else this implementation gets each Message in the folder using getMessage(int) and checks whether its RECENT flag is set. The total number of messages that have this flag set is returned.

Returns:
number of new messages. -1 may be returned by certain implementations if this method is invoked on a closed folder.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException

public int getUnreadMessageCount() throws MessagingException
获取此 Folder 中未读消息的总数。

可以对关闭的 Folder 调用此方法。但要注意的是，对于某些文件夹实现而言，获取未读消息计数可能是一个开销很大的操作，涉及到实际打开该文件夹。在这种情况下，提供者可以选择在关闭状态下不支持此功能，此时此方法必须返回 -1。

对关闭的文件夹调用此方法的客户端必须要意识到这可能是一个开销很大的操作。这种情况下，客户端还必须准备好处理返回值 -1。

如果此文件夹是关闭的，则此实现返回 -1。否则，此实现将使用 getMessage(int) 获取该文件夹中的每个 Message，并检查它是否设置了 SEEN 标志。返回未设置此标志的消息总数。

return | 未读消息的总数。如果对关闭的文件夹调用此方法，则某些实现可能返回 -1。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
英文文档：

getUnreadMessageCount

public int getUnreadMessageCount()
                          throws MessagingException
Get the total number of unread messages in this Folder.

This method can be invoked on a closed folder. However, note that for some folder implementations, getting the unread message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.

Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.

This implementation returns -1 if this folder is closed. Else this implementation gets each Message in the folder using getMessage(int) and checks whether its SEEN flag is set. The total number of messages that do not have this flag set is returned.

Returns:
total number of unread messages. -1 may be returned by certain implementations if this method is invoked on a closed folder.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException

public int getDeletedMessageCount() throws MessagingException
获取此 Folder 中已删除消息的数量。

可以对关闭的 Folder 调用此方法。但要注意的是，对于某些文件夹实现而言，获取已删除消息计数可能是一个开销很大的操作，涉及到实际打开该文件夹。在这种情况下，提供者可以选择在关闭状态下不支持此功能，此时此方法必须返回 -1。

对关闭的文件夹调用此方法的客户端必须要意识到这可能是一个开销很大的操作。这种情况下，客户端还必须准备好处理返回值 -1。

如果此文件夹是关闭的，则此实现返回 -1。否则，此实现将使用 getMessage(int) 获取该文件夹中的每个 Message，并检查它是否设置了 DELETED 标志。返回设置了此标志的消息总数。

return | 已删除消息的数量。如果对关闭的文件夹调用此方法，则某些实现可能返回 -1。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException:
since
en
JavaMail 1.3
英文文档：

getDeletedMessageCount

public int getDeletedMessageCount()
                           throws MessagingException
Get the number of deleted messages in this Folder.

This method can be invoked on a closed folder. However, note that for some folder implementations, getting the deleted message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.

Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.

This implementation returns -1 if this folder is closed. Else this implementation gets each Message in the folder using getMessage(int) and checks whether its DELETED flag is set. The total number of messages that have this flag set is returned.

Returns:
number of deleted messages. -1 may be returned by certain implementations if this method is invoked on a closed folder.
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException
Since:
JavaMail 1.3

abstract public Message getMessage(int msgnum) throws MessagingException
获取与给定消息编号相对应的 Message 对象。Message 对象的消息编号是此 Message 在其 Folder 中的相对位置。消息编号从 1 开始，到达文件夹中的消息总数为止。注意，如果 Folder 中的其他消息被删除且该 Folder 被清除，则某一特定 Message 的消息编号可在会话期间发生更改。

Message 对象是对按需填充的实际消息的轻量级引用。因此 Folder 实现应该提供轻量级 Message 对象。

与 Folder 对象不同，使用同一消息编号重复调用 getMessage 将返回相同的 Message 对象只要此文件夹中没有消息被清除。

因为如果文件夹被清除，消息编号就可在会话中发生更改，所以建议客户端不要使用消息编号作为对消息的引用。请使用 Message 对象替代。

msgnum | 消息编号
return | Message 对象
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | IllegalStateException: 如果此文件夹没有打开
Throws | IndexOutOfBoundsException: 如果消息编号超出范围。
Throws | MessagingException:
See also | getMessageCount, fetch
英文文档：

getMessage

public abstract Message getMessage(int msgnum)
                            throws MessagingException
Get the Message object corresponding to the given message number. A Message object's message number is the relative position of this Message in its Folder. Messages are numbered starting at 1 through the total number of message in the folder. Note that the message number for a particular Message can change during a session if other messages in the Folder are deleted and the Folder is expunged.

Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.

Unlike Folder objects, repeated calls to getMessage with the same message number will return the same Message object, as long as no messages in this folder have been expunged.

Since message numbers can change within a session if the folder is expunged , clients are advised not to use message numbers as references to messages. Use Message objects instead.

Parameters:
msgnum - the message number
Returns:
the Message object
Throws:
FolderNotFoundException - if this folder does not exist.
IllegalStateException - if this folder is not opened
IndexOutOfBoundsException - if the message number is out of range.
MessagingException
See Also:
getMessageCount(), fetch(javax.mail.Message[], javax.mail.FetchProfile)

public Message[] getMessages(int start, int end) throws MessagingException
获取从 start 到 end 消息编号范围内（包括 start 和 end）的 Message 对象。注意，消息编号从 1 而不是从 0 开始。

Message 对象是对按需填充的实际消息的轻量级引用。因此 Folder 实现应该提供轻量级 Message 对象。

此实现使用 getMessage(index) 获取所需的 Message 对象。注意，返回的数组必须包含 (end-start+1) Message 对象。

start | 第一条消息的编号
end | 最后一条消息的编号
return | Message 对象
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | IllegalStateException: 如果此文件夹没有打开。
Throws | IndexOutOfBoundsException: 如果开始或结束的消息编号超出范围。
Throws | MessagingException:
See also | fetch
英文文档：

getMessages

public Message[] getMessages(int start,
                             int end)
                      throws MessagingException
Get the Message objects for message numbers ranging from start through end, both start and end inclusive. Note that message numbers start at 1, not 0.

Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.

This implementation uses getMessage(index) to obtain the required Message objects. Note that the returned array must contain (end-start+1) Message objects.

Parameters:
start - the number of the first message
end - the number of the last message
Returns:
the Message objects
Throws:
FolderNotFoundException - if this folder does not exist.
IllegalStateException - if this folder is not opened.
IndexOutOfBoundsException - if the start or end message numbers are out of range.
MessagingException
See Also:
fetch(javax.mail.Message[], javax.mail.FetchProfile)

public Message[] getMessages(int[] msgnums) throws MessagingException
获取具有数组中指定的消息编号的 Message 对象。

Message 对象是对按需填充的实际消息的轻量级引用。因此 Folder 实现应该提供轻量级 Message 对象。

此实现使用 getMessage(index) 获取所需的 Message 对象。注意，返回的数组必须包含 msgnums.length Message 对象。

msgnums | 消息编号的数组
return | Message 对象的数组。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | IllegalStateException: 如果此文件夹没有打开。
Throws | IndexOutOfBoundsException: 如果给定数组中的任何消息编号超出范围。
Throws | MessagingException:
See also | fetch
英文文档：

getMessages

public Message[] getMessages(int[] msgnums)
                      throws MessagingException
Get the Message objects for message numbers specified in the array.

Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.

This implementation uses getMessage(index) to obtain the required Message objects. Note that the returned array must contain msgnums.length Message objects

Parameters:
msgnums - the array of message numbers
Returns:
the array of Message objects.
Throws:
FolderNotFoundException - if this folder does not exist.
IllegalStateException - if this folder is not opened.
IndexOutOfBoundsException - if any message number in the given array is out of range.
MessagingException
See Also:
fetch(javax.mail.Message[], javax.mail.FetchProfile)

public Message[] getMessages() throws MessagingException
获取此 Folder 中的所有 Message 对象。如果文件夹为空，则返回一个空数组。 客户端可使用 Message 对象（而不是序列号）作为对文件夹中消息的引用；此方法为客户端提供 Message 对象。文件夹实现应该提供轻量级 Message 对象，这些对象是按需填充的。

此实现调用 getMessageCount() 获取当前消息计数，然后使用 getMessage() 获取从 1 到该消息计数的 Message 对象。

return | Message 对象的数组，如果文件夹为空，则返回一个空数组。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | IllegalStateException: 如果此文件夹没有打开。
Throws | MessagingException:
See also | fetch
英文文档：

getMessages

public Message[] getMessages()
                      throws MessagingException
Get all Message objects from this Folder. Returns an empty array if the folder is empty. Clients can use Message objects (instead of sequence numbers) as references to the messages within a folder; this method supplies the Message objects to the client. Folder implementations are expected to provide light-weight Message objects, which get filled on demand.

This implementation invokes getMessageCount() to get the current message count and then uses getMessage() to get Message objects from 1 till the message count.

Returns:
array of Message objects, empty array if folder is empty.
Throws:
FolderNotFoundException - if this folder does not exist.
IllegalStateException - if this folder is not opened.
MessagingException
See Also:
fetch(javax.mail.Message[], javax.mail.FetchProfile)

abstract public void appendMessages(Message[] msgs) throws MessagingException
将给定 Message 追加到此文件夹。可以对关闭的 Folder 调用此方法。当消息到达文件夹时，向此文件夹上注册的所有 MessageCountListener 传送相应的 MessageCountEvent。

即使发现给定消息数组中的某个 Message 是已清除的 Message，文件夹实现也不得中止此操作。

msgs | 要追加的 Message 的数组
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | MessagingException: 如果追加失败。
英文文档：

appendMessages

public abstract void appendMessages(Message[] msgs)
                             throws MessagingException
Append given Messages to this folder. This method can be invoked on a closed Folder. An appropriate MessageCountEvent is delivered to any MessageCountListener registered on this folder when the messages arrive in the folder.

Folder implementations must not abort this operation if a Message in the given message array turns out to be an expunged Message.

Parameters:
msgs - array of Messages to be appended
Throws:
FolderNotFoundException - if this folder does not exist.
MessagingException - if the append failed.

public void fetch(Message[] msgs, FetchProfile fp) throws MessagingException
预获取给定 Message 的 FetchProfile 中指定的项。

客户端使用此方法指示需要给定消息范围内的全部指定项。实现应该以有效方式获取给定消息范围内的这些项。注意，此方法只是预获取所需项实现的提示。

一个例子是客户端使用文件夹中所有消息的 Subject、From 和 X-mailer 头填充其头视图窗口。

Message[] msgs = folder.getMessages();

FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
fp.add("X-mailer");
folder.fetch(msgs, fp);

for (int i = 0; i < folder.getMessageCount(); i++) {
display(msg[i].getFrom());
display(msg[i].getSubject());
display(msg[i].getHeader("X-mailer"));
  }

此处提供的实现未做任何有用的操作就返回了。想为此方法提供一个真正实现的提供者应该重写此方法。

msgs | 获取这些消息的项
fp | FetchProfile
Throws | IllegalStateException: 如果此文件夹没有打开
Throws | MessagingException.:
英文文档：

fetch

public void fetch(Message[] msgs,
                  FetchProfile fp)
           throws MessagingException
Prefetch the items specified in the FetchProfile for the given Messages.

Clients use this method to indicate that the specified items are needed en-masse for the given message range. Implementations are expected to retrieve these items for the given message range in a efficient manner. Note that this method is just a hint to the implementation to prefetch the desired items.

An example is a client filling its header-view window with the Subject, From and X-mailer headers for all messages in the folder.

  Message[] msgs = folder.getMessages();

  FetchProfile fp = new FetchProfile();
  fp.add(FetchProfile.Item.ENVELOPE);
  fp.add("X-mailer");
  folder.fetch(msgs, fp);

  for (int i = 0; i < folder.getMessageCount(); i++) {
      display(msg[i].getFrom());
      display(msg[i].getSubject());
      display(msg[i].getHeader("X-mailer"));
  }

The implementation provided here just returns without doing anything useful. Providers wanting to provide a real implementation for this method should override this method.

Parameters:
msgs - fetch items for these messages
fp - the FetchProfile
Throws:
IllegalStateException - if this folder is not opened
MessagingException.
MessagingException

public void setFlags(Message[] msgs, Flags flag, boolean value) throws MessagingException
在数组中指定的消息上设置指定标志。这将导致向此 Message 包含文件夹上注册的所有 MessageChangedListener 传送相应的 MessageChangedEvent。

注意，指定的 Message 对象必须属于此文件夹。某些 Folder 实现可以为一组消息优化设置 Flag 的操作，因此客户端可能希望使用此方法，而不是对每个 Message 调用 Message.setFlags。

此实现退化到对每个 Message 对象调用 setFlags()。能够优化这种情况的特定 Folder 实现应该采取优化的操作。同样，即使发现数组中的某个 Message 是已清除的 Message，实现也不得中止操作。

msgs | 消息对象的数组
flag | 包含要设置的标志的 Flag 对象
value | 将标志设置为此 boolean 值
Throws | IllegalStateException: 如果此文件夹没有打开；如果它以 READ_ONLY 模式打开。
Throws | MessagingException:
See also | setFlags, javax.mail.event.MessageChangedEvent
英文文档：

setFlags

public void setFlags(Message[] msgs,
                     Flags flag,
                     boolean value)
              throws MessagingException
Set the specified flags on the messages specified in the array. This will result in appropriate MessageChangedEvents being delivered to any MessageChangedListener registered on this Message's containing folder.

Note that the specified Message objects must belong to this folder. Certain Folder implementations can optimize the operation of setting Flags for a group of messages, so clients might want to use this method, rather than invoking Message.setFlags for each Message.

This implementation degenerates to invoking setFlags() on each Message object. Specific Folder implementations that can optimize this case should do so. Also, an implementation must not abort the operation if a Message in the array turns out to be an expunged Message.

Parameters:
msgs - the array of message objects
flag - Flags object containing the flags to be set
value - set the flags to this boolean value
Throws:
IllegalStateException - if this folder is not opened or if it has been opened READ_ONLY.
MessagingException
See Also:
Message.setFlags(javax.mail.Flags, boolean), MessageChangedEvent

public void setFlags(int start, int end, Flags flag, boolean value) throws MessagingException
在编号从 start 到 end（包括 start 和 end）的消息上设置指定标志。注意，消息编号从 1 而不是从 0 开始。这将导致向此 Message 包含文件夹上注册的所有 MessageChangedListener 传送相应的 MessageChangedEvent。

某些 Folder 实现可以为一组消息优化设置 Flag 的操作，因此客户端可能希望使用此方法，而不是对每个 Message 调用 Message.setFlags。

默认实现使用 getMessage(int) 获取每个 Message 对象，然后对要设置标志的对象调用 setFlags。能够优化这种情况的特定 Folder 实现应该采取优化的操作。同样，即使某个消息编号引用了已清除的消息，实现也不得中止操作。

start | 第一条消息的编号
end | 最后一条消息的编号
flag | 包含要设置的标志的 Flag 对象
value | 将标志设置为此 boolean 值
Throws | IllegalStateException: 如果此文件夹没有打开；如果它以 READ_ONLY 模式打开。
Throws | IndexOutOfBoundsException: 如果开始或结束的消息编号超出范围。
Throws | MessagingException:
See also | setFlags, javax.mail.event.MessageChangedEvent
英文文档：

setFlags

public void setFlags(int start,
                     int end,
                     Flags flag,
                     boolean value)
              throws MessagingException
Set the specified flags on the messages numbered from start through end, both start and end inclusive. Note that message numbers start at 1, not 0. This will result in appropriate MessageChangedEvents being delivered to any MessageChangedListener registered on this Message's containing folder.

Certain Folder implementations can optimize the operation of setting Flags for a group of messages, so clients might want to use this method, rather than invoking Message.setFlags for each Message.

The default implementation uses getMessage(int) to get each Message object and then invokes setFlags on that object to set the flags. Specific Folder implementations that can optimize this case should do so. Also, an implementation must not abort the operation if a message number refers to an expunged message.

Parameters:
start - the number of the first message
end - the number of the last message
flag - Flags object containing the flags to be set
value - set the flags to this boolean value
Throws:
IllegalStateException - if this folder is not opened or if it has been opened READ_ONLY.
IndexOutOfBoundsException - if the start or end message numbers are out of range.
MessagingException
See Also:
Message.setFlags(javax.mail.Flags, boolean), MessageChangedEvent

public void setFlags(int[] msgnums, Flags flag, boolean value) throws MessagingException
在其消息编号位于数组中的消息上设置指定标志。这将导致向此 Message 包含文件夹上注册的所有 MessageChangedListener 传送相应的 MessageChangedEvent。

某些 Folder 实现可以为一组消息优化设置 Flag 的操作，因此客户端可能希望使用此方法，而不是对每个 Message 调用 Message.setFlags。

默认实现使用 getMessage(int) 获取每个 Message 对象，然后对要设置标志的对象调用 setFlags。能够优化这种情况的特定 Folder 实现应该采取优化的操作。同样，即使某个消息编号引用了已清除的消息，实现也不得中止操作。

msgnums | 消息编号的数组
flag | 包含要设置的标志的 Flag 对象
value | 将标志设置为此 boolean 值
Throws | IllegalStateException: 如果此文件夹没有打开；如果它以 READ_ONLY 模式打开。
Throws | IndexOutOfBoundsException: 如果给定数组中的任何消息编号超出范围。
Throws | MessagingException:
See also | setFlags, javax.mail.event.MessageChangedEvent
英文文档：

setFlags

public void setFlags(int[] msgnums,
                     Flags flag,
                     boolean value)
              throws MessagingException
Set the specified flags on the messages whose message numbers are in the array. This will result in appropriate MessageChangedEvents being delivered to any MessageChangedListener registered on this Message's containing folder.

Certain Folder implementations can optimize the operation of setting Flags for a group of messages, so clients might want to use this method, rather than invoking Message.setFlags for each Message.

The default implementation uses getMessage(int) to get each Message object and then invokes setFlags on that object to set the flags. Specific Folder implementations that can optimize this case should do so. Also, an implementation must not abort the operation if a message number refers to an expunged message.

Parameters:
msgnums - the array of message numbers
flag - Flags object containing the flags to be set
value - set the flags to this boolean value
Throws:
IllegalStateException - if this folder is not opened or if it has been opened READ_ONLY.
IndexOutOfBoundsException - if any message number in the given array is out of range.
MessagingException
See Also:
Message.setFlags(javax.mail.Flags, boolean), MessageChangedEvent

public void copyMessages(Message[] msgs, Folder folder) throws MessagingException
将指定 Message 从此 Folder 复制到另一个 Folder 中。此操作会将这些 Message 追加到目标 Folder。不必打开目标 Folder。当消息到达文件夹时，向目标文件夹上注册的所有 MessageCountListener 传送相应的 MessageCountEvent。

注意，指定的 Message 对象必须属于此文件夹。文件夹实现可能能够通过进行服务器端复制来优化此方法。

此实现只需对目标文件夹调用 appendMessages() 就可以追加给定 Message。如果目标文件夹的 Store 与此文件夹的 Store 相同，那么支持服务器端复制的特定文件夹实现就应该这样做。同样，即使发现数组中的某个 Message 是已清除的 Message，实现也不得中止操作。

msgs | 消息对象的数组
folder | 将消息复制到的文件夹
Throws | FolderNotFoundException: 如果目标文件夹不存在。
Throws | IllegalStateException: 如果此文件夹没有打开。
Throws | MessagingException:
See also | appendMessages
英文文档：

copyMessages

public void copyMessages(Message[] msgs,
                         Folder folder)
                  throws MessagingException
Copy the specified Messages from this Folder into another Folder. This operation appends these Messages to the destination Folder. The destination Folder does not have to be opened. An appropriate MessageCountEvent is delivered to any MessageCountListener registered on the destination folder when the messages arrive in the folder.

Note that the specified Message objects must belong to this folder. Folder implementations might be able to optimize this method by doing server-side copies.

This implementation just invokes appendMessages() on the destination folder to append the given Messages. Specific folder implementations that support server-side copies should do so, if the destination folder's Store is the same as this folder's Store. Also, an implementation must not abort the operation if a Message in the array turns out to be an expunged Message.

Parameters:
msgs - the array of message objects
folder - the folder to copy the messages to
Throws:
FolderNotFoundException - if the destination folder does not exist.
IllegalStateException - if this folder is not opened.
MessagingException
See Also:
appendMessages(javax.mail.Message[])

abstract public Message[] expunge() throws MessagingException
清除（永久移除）标记为 DELETED 的消息。返回包含已清除消息对象的数组。对这些消息对象中的每一个调用 getMessageNumber 方法将返回该 Message 的原始序列号（即清除之前的序列号）。向该文件夹上注册的所有 MessageCountListener 传送包含已清除消息的 MessageCountEvent。

清除会导致对这些已清除消息之后的 Message 对象重新编号。使用消息编号作为对消息的引用的客户端应该意识到这一点，并且应该做好准备应对这种情况（可能通过清空现有消息编号缓存并重新加载它们来应对）。由于这种复杂性，客户端最好使用 Message 对象作为对消息的引用，而不使用消息编号。任何已清除的 Message 对象仍然必须被删改，但该文件夹中的其他 Message 不受清除的影响。

在清除某个消息之后，只有 isExpunged 和 getMessageNumber 方法在相应的 Message 对象上仍然有效；其他方法可能抛出 MessageRemovedException。

return | 已清除的 Message 对象的数组
Throws | FolderNotFoundException: 如果此文件夹不存在
Throws | IllegalStateException: 如果此文件夹没有打开。
Throws | MessagingException:
See also | isExpunged, javax.mail.event.MessageCountEvent
英文文档：

expunge

public abstract Message[] expunge()
                           throws MessagingException
Expunge (permanently remove) messages marked DELETED. Returns an array containing the expunged message objects. The getMessageNumber method on each of these message objects returns that Message's original (that is, prior to the expunge) sequence number. A MessageCountEvent containing the expunged messages is delivered to any MessageCountListeners registered on the folder.

Expunge causes the renumbering of Message objects subsequent to the expunged messages. Clients that use message numbers as references to messages should be aware of this and should be prepared to deal with the situation (probably by flushing out existing message number caches and reloading them). Because of this complexity, it is better for clients to use Message objects as references to messages, rather than message numbers. Any expunged Messages objects still have to be pruned, but other Messages in that folder are not affected by the expunge.

After a message is expunged, only the isExpunged and getMessageNumber methods are still valid on the corresponding Message object; other methods may throw MessageRemovedException

Returns:
array of expunged Message objects
Throws:
FolderNotFoundException - if this folder does not exist
IllegalStateException - if this folder is not opened.
MessagingException
See Also:
Message.isExpunged(), MessageCountEvent

public Message[] search(SearchTerm term) throws MessagingException
在此 Folder 中搜索与指定搜索标准匹配的消息。返回包含匹配消息的数组。如果不存在任何匹配项，则返回空数组。

此实现调用 search(term, getMessages())，以便在此文件夹中的所有消息上应用该搜索。能够实现服务器端搜索的提供者可能希望重写此方法，以提供更有效的实现。

term | 搜索标准
return | 匹配消息的数组
Throws | SearchException: 如果搜索条目过于复杂，该实现无法处理。
Throws | FolderNotFoundException: 如果此文件夹不存在。
Throws | IllegalStateException: 如果此文件夹没有打开。
Throws | MessagingException:
See also | javax.mail.search.SearchTerm
英文文档：

search

public Message[] search(SearchTerm term)
                 throws MessagingException
Search this Folder for messages matching the specified search criterion. Returns an array containing the matching messages . Returns an empty array if no matches were found.

This implementation invokes search(term, getMessages()), to apply the search over all the messages in this folder. Providers that can implement server-side searching might want to override this method to provide a more efficient implementation.

Parameters:
term - the search criterion
Returns:
array of matching messages
Throws:
SearchException - if the search term is too complex for the implementation to handle.
FolderNotFoundException - if this folder does not exist.
IllegalStateException - if this folder is not opened.
MessagingException
See Also:
SearchTerm

public Message[] search(SearchTerm term, Message[] msgs) throws MessagingException
在给定的消息数组中搜索与指定搜索标准匹配的那些消息。返回包含匹配消息的数组。如果不存在任何匹配项，则返回空数组。

注意，指定的 Message 对象必须属于此文件夹。

此实现在给定的消息数组中迭代，并通过使用给定条目调用其 match() 方法在每个消息上应用搜索标准。返回成功匹配的消息。能够实现服务器端搜索的提供者可能希望重写此方法，以提供更有效的实现。如果搜索条目太复杂或者包含在服务器上无法执行的用户定义条目，那么提供者可能选择抛出 SearchException，或者退化到客户端搜索，通过调用 super.search() 来调用此实现。

term | 搜索标准
msgs | 要搜索的消息
return | 匹配消息的数组
Throws | SearchException: 如果搜索条目过于复杂，该实现无法处理。
Throws | IllegalStateException: 如果此文件夹没有打开
Throws | MessagingException:
See also | javax.mail.search.SearchTerm
英文文档：

search

public Message[] search(SearchTerm term,
                        Message[] msgs)
                 throws MessagingException
Search the given array of messages for those that match the specified search criterion. Returns an array containing the matching messages. Returns an empty array if no matches were found.

Note that the specified Message objects must belong to this folder.

This implementation iterates through the given array of messages, and applies the search criterion on each message by calling its match() method with the given term. The messages that succeed in the match are returned. Providers that can implement server-side searching might want to override this method to provide a more efficient implementation. If the search term is too complex or contains user-defined terms that cannot be executed on the server, providers may elect to either throw a SearchException or degenerate to client-side searching by calling super.search() to invoke this implementation.

Parameters:
term - the search criterion
msgs - the messages to be searched
Returns:
array of matching messages
Throws:
SearchException - if the search term is too complex for the implementation to handle.
IllegalStateException - if this folder is not opened
MessagingException
See Also:
SearchTerm

public void addConnectionListener(ConnectionListener l)
为此 Folder 上的 Connection 事件添加侦听器。

此处提供的实现将此侦听器添加到 ConnectionListener 的内部列表。

l | Connection 事件的 Listener
See also | javax.mail.event.ConnectionEvent
英文文档：

addConnectionListener

public void addConnectionListener(ConnectionListener l)
Add a listener for Connection events on this Folder.

The implementation provided here adds this listener to an internal list of ConnectionListeners.

Parameters:
l - the Listener for Connection events
See Also:
ConnectionEvent

public void removeConnectionListener(ConnectionListener l)
移除 Connection 事件侦听器。

此处提供的实现将从 ConnectionListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addConnectionListener
英文文档：

removeConnectionListener

public void removeConnectionListener(ConnectionListener l)
Remove a Connection event listener.

The implementation provided here removes this listener from the internal list of ConnectionListeners.

Parameters:
l - the listener
See Also:
addConnectionListener(javax.mail.event.ConnectionListener)

protected void notifyConnectionListeners(int type)
通知所有 ConnectionListener。文件夹实现应该使用此方法广播 Connection 事件。

提供的实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 ConnectionListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

type | ConnectionEvent 类型
See also | javax.mail.event.ConnectionEvent
英文文档：

notifyConnectionListeners

protected void notifyConnectionListeners(int type)
Notify all ConnectionListeners. Folder implementations are expected to use this method to broadcast connection events.

The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered ConnectionListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

Parameters:
type - the ConnectionEvent type
See Also:
ConnectionEvent

public void addFolderListener(FolderListener l)
为此 Folder 上的 Folder 事件添加侦听器。

此处提供的实现将此侦听器添加到 FolderListener 的内部列表。

l | Folder 事件的 Listener
See also | javax.mail.event.FolderEvent
英文文档：

addFolderListener

public void addFolderListener(FolderListener l)
Add a listener for Folder events on this Folder.

The implementation provided here adds this listener to an internal list of FolderListeners.

Parameters:
l - the Listener for Folder events
See Also:
FolderEvent

public void removeFolderListener(FolderListener l)
移除 Folder 事件侦听器。

此处提供的实现将从 FolderListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addFolderListener
英文文档：

removeFolderListener

public void removeFolderListener(FolderListener l)
Remove a Folder event listener.

The implementation provided here removes this listener from the internal list of FolderListeners.

Parameters:
l - the listener
See Also:
addFolderListener(javax.mail.event.FolderListener)

protected void notifyFolderListeners(int type)
通知此 Folder 和此文件夹的 Store 上注册的所有 FolderListener。文件夹实现应该使用此方法广播 Folder 事件。

此处提供的实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给在此文件夹上注册的 FolderListener。该实现还调用此文件夹的 Store 上的 notifyFolderListeners 来通知该 Store 上注册的所有 FolderListener。

type | FolderEvent 的类型
See also | notifyFolderRenamedListeners
英文文档：

notifyFolderListeners

protected void notifyFolderListeners(int type)
Notify all FolderListeners registered on this Folder and this folder's Store. Folder implementations are expected to use this method to broadcast Folder events.

The implementation provided here queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the FolderListeners registered on this folder. The implementation also invokes notifyFolderListeners on this folder's Store to notify any FolderListeners registered on the store.

Parameters:
type - type of FolderEvent
See Also:
notifyFolderRenamedListeners(javax.mail.Folder)

protected void notifyFolderRenamedListeners(Folder folder)
通知此 Folder 和此文件夹的 Store 上注册的所有 FolderListener 有关此文件夹重命名的信息。文件夹实现应该使用此方法广播 Folder 事件，指示文件夹的重命名。

此处提供的实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给在此文件夹上注册的 FolderListener。该实现还调用此文件夹的 Store 上的 notifyFolderRenamedListeners 来通知该 Store 上注册的所有 FolderListener。

folder | 表示新名称的文件夹。
since
en
JavaMail 1.1
See also | notifyFolderListeners
英文文档：

notifyFolderRenamedListeners

protected void notifyFolderRenamedListeners(Folder folder)
Notify all FolderListeners registered on this Folder and this folder's Store about the renaming of this folder. Folder implementations are expected to use this method to broadcast Folder events indicating the renaming of folders.

The implementation provided here queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the FolderListeners registered on this folder. The implementation also invokes notifyFolderRenamedListeners on this folder's Store to notify any FolderListeners registered on the store.

Parameters:
folder - Folder representing the new name.
Since:
JavaMail 1.1
See Also:
notifyFolderListeners(int)

public void addMessageCountListener(MessageCountListener l)
为此 Folder 上的 MessageCount 事件添加侦听器。

此处提供的实现将此侦听器添加到 MessageCountListener 的内部列表。

l | MessageCount 事件的 Listener
See also | javax.mail.event.MessageCountEvent
英文文档：

addMessageCountListener

public void addMessageCountListener(MessageCountListener l)
Add a listener for MessageCount events on this Folder.

The implementation provided here adds this listener to an internal list of MessageCountListeners.

Parameters:
l - the Listener for MessageCount events
See Also:
MessageCountEvent

public void removeMessageCountListener(MessageCountListener l)
移除 MessageCount 侦听器。

此处提供的实现将从 MessageCountListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addMessageCountListener
英文文档：

removeMessageCountListener

public void removeMessageCountListener(MessageCountListener l)
Remove a MessageCount listener.

The implementation provided here removes this listener from the internal list of MessageCountListeners.

Parameters:
l - the listener
See Also:
addMessageCountListener(javax.mail.event.MessageCountListener)

protected void notifyMessageAddedListeners(Message[] msgs)
通知所有 MessageCountListener 有关向此文件夹中添加消息的信息。文件夹实现应该使用此方法广播 MessageCount 事件，指示新消息的到达。

提供的实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 MessageCountListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

英文文档：

notifyMessageAddedListeners

protected void notifyMessageAddedListeners(Message[] msgs)
Notify all MessageCountListeners about the addition of messages into this folder. Folder implementations are expected to use this method to broadcast MessageCount events for indicating arrival of new messages.

The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered MessageCountListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

protected void notifyMessageRemovedListeners(boolean removed, Message[] msgs)
通知所有 MessageCountListener 有关从此 Folder 中移除消息的信息。文件夹实现应该使用此方法广播 MessageCount 事件，指示消息的移除。

提供的实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 MessageCountListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

英文文档：

notifyMessageRemovedListeners

protected void notifyMessageRemovedListeners(boolean removed,
                                             Message[] msgs)
Notify all MessageCountListeners about the removal of messages from this Folder. Folder implementations are expected to use this method to broadcast MessageCount events indicating removal of messages.

The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered MessageCountListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

public void addMessageChangedListener(MessageChangedListener l)
为此 Folder 上的 MessageChanged 事件添加侦听器。

此处提供的实现将此侦听器添加到 MessageChangedListener 的内部列表。

l | MessageChanged 事件的 Listener
See also | javax.mail.event.MessageChangedEvent
英文文档：

addMessageChangedListener

public void addMessageChangedListener(MessageChangedListener l)
Add a listener for MessageChanged events on this Folder.

The implementation provided here adds this listener to an internal list of MessageChangedListeners.

Parameters:
l - the Listener for MessageChanged events
See Also:
MessageChangedEvent

public void removeMessageChangedListener(MessageChangedListener l)
移除 MessageChanged 侦听器。

此处提供的实现将从 MessageChangedListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addMessageChangedListener
英文文档：

removeMessageChangedListener

public void removeMessageChangedListener(MessageChangedListener l)
Remove a MessageChanged listener.

The implementation provided here removes this listener from the internal list of MessageChangedListeners.

Parameters:
l - the listener
See Also:
addMessageChangedListener(javax.mail.event.MessageChangedListener)

protected void notifyMessageChangedListeners(int type, Message msg)
通知所有 MessageChangedListener。文件夹实现应该使用此方法广播 MessageChanged 事件。

提供的实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 MessageChangedListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

英文文档：

notifyMessageChangedListeners

protected void notifyMessageChangedListeners(int type,
                                             Message msg)
Notify all MessageChangedListeners. Folder implementations are expected to use this method to broadcast MessageChanged events.

The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to registered MessageChangedListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

protected void finalize() throws Throwable
英文文档：

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

public String toString()
重写默认的 toString()，它将返回从 Folder.getFullName() 获得的 String；如果返回结果为 null，则将使用默认的 toString() 行为。
英文文档：

toString

public String toString()
override the default toString(), it will return the String from Folder.getFullName() or if that is null, it will use the default toString() behavior.

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Header (Java EE 5)

javax.mail
Class Header

java.lang.Object
    extended by  javax.mail.Header
Direct Known Subclasses:
InternetHeaders.InternetHeader
public class Header
extends Object

Extended by: InternetHeaders.InternetHeader

Header 类存储表示头的名称/值对。
英文文档：

The Header class stores a name/value pair to represent headers.

Author:
John Mani

Field Summary
protected String | name The name of the header.
protected String | value The value of the header.
Constructor Summary
Header(String name, String value)
Construct a Header object.
Method Summary
String | getName() Returns the name of this header.
String | getValue() Returns the value of this header.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

name

protected String name
The name of the header.

Since:
JavaMail 1.4

英文文档：

value

protected String value
The value of the header.

Since:
JavaMail 1.4
Constructor Detail

public Header(String name, String value)
构造一个 Header 对象。
name | 头的名称
value | 头的值
英文文档：

Header

public Header(String name,
              String value)
Construct a Header object.

Parameters:
name - name of the header
value - value of the header
Method Detail

public String getName()
返回此头的名称。
return 头的名称
英文文档：

getName

public String getName()
Returns the name of this header.

Returns:
name of the header

public String getValue()
返回此头的值。
return 头的值
英文文档：

getValue

public String getValue()
Returns the value of this header.

Returns:
value of the header
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Message (Java EE 5)

javax.mail
Class Message

java.lang.Object
    extended by  javax.mail.Message
All Implemented Interfaces:
Part
Direct Known Subclasses:
MimeMessage
public abstract class Message
extends Object
implements Part

Implements: Part
Inner classes: Message.RecipientType
Extended by: MimeMessage

此类模拟电子邮件消息。这是一个抽象类。子类提供实际实现。

Message 实现 Part 接口。Message 包含一个属性集和一个 "content"。文件夹中的 Message 还包括一组标记，描述其在该文件夹中的状态。

除了在 Part 接口中定义的属性之外，Message 还定义了一些新属性。这些属性指定消息的元数据，即与消息有关的地址信息和描述性信息。

Message 对象可从 Folder 中获取，也可以通过构造相应子类的新 Message 对象获取。已接收的 Message 通常从名为 "INBOX" 的文件夹获取。

从文件夹获取的 Message 对象只是对实际消息的轻量级引用。当从该消息请求每个条目时，Message 是“延迟”填充的（按需）。注意，某些 Folder 实现可能返回预先填充了一些用户指定条目的 Message 对象。 要发送一条消息，需要实例化相应的 Message 子类（例如 MimeMessage），填充属性和内容，然后使用 Transport.send 方法发送该消息。

See also javax.mail.Part
英文文档：

This class models an email message. This is an abstract class. Subclasses provide actual implementations.

Message implements the Part interface. Message contains a set of attributes and a "content". Messages within a folder also have a set of flags that describe its state within the folder.

Message defines some new attributes in addition to those defined in the Part interface. These attributes specify meta-data for the message - i.e., addressing and descriptive information about the message.

Message objects are obtained either from a Folder or by constructing a new Message object of the appropriate subclass. Messages that have been received are normally retrieved from a folder named "INBOX".

A Message object obtained from a folder is just a lightweight reference to the actual message. The Message is 'lazily' filled up (on demand) when each item is requested from the message. Note that certain folder implementations may return Message objects that are pre-filled with certain user-specified items. To send a message, an appropriate subclass of Message (e.g., MimeMessage) is instantiated, the attributes and content are filled in, and the message is sent using the Transport.send method.

Author:
John Mani, Bill Shannon, Max Spivak
See Also:
Part

Nested Class Summary
static class Message.RecipientType
This inner class defines the types of recipients allowed by the Message class.
Field Summary
protected boolean | expunged True if this message has been expunged.
protected Folder | folder The containing folder, if this message is obtained from a folder
protected int | msgnum The number of this message within its folder, or zero if the message was not retrieved from a folder.
protected Session | session The Session object for this Message
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
Constructor Summary
protected | Message() No-arg version of the constructor.
protected | Message(Folder folder, int msgnum) Constructor that takes a Folder and a message number.
protected | Message(Session session) Constructor that takes a Session.
Method Summary
abstract void | addFrom(Address[] addresses) Add these addresses to the existing "From" attribute
void | addRecipient(Message.RecipientType type, Address address) Add this recipient address to the existing ones of the given type.
abstract void | addRecipients(Message.RecipientType type, Address[] addresses) Add these recipient addresses to the existing ones of the given type.
Address[] | getAllRecipients() Get all the recipient addresses for the message.
abstract Flags | getFlags() Returns a Flags object containing the flags for this message.
Folder | getFolder() Get the folder from which this message was obtained.
abstract Address[] | getFrom() Returns the "From" attribute.
int | getMessageNumber() Get the Message number for this Message.
abstract Date | getReceivedDate() Get the date this message was received.
abstract Address[] | getRecipients(Message.RecipientType type) Get all the recipient addresses of the given type.
Address[] | getReplyTo() Get the addresses to which replies should be directed.
abstract Date | getSentDate() Get the date this message was sent.
abstract String | getSubject() Get the subject of this message.
boolean | isExpunged() Checks whether this message is expunged.
boolean | isSet(Flags.Flag flag) Check whether the flag specified in the flag argument is set in this message.
boolean | match(SearchTerm term) Apply the specified Search criterion to this message.
abstract Message | reply(boolean replyToAll) Get a new Message suitable for a reply to this message.
abstract void | saveChanges() Save any changes made to this message into the message-store when the containing folder is closed, if the message is contained in a folder.
protected void | setExpunged(boolean expunged) Sets the expunged flag for this Message.
void | setFlag(Flags.Flag flag, boolean set) Set the specified flag on this message to the specified value.
abstract void | setFlags(Flags flag, boolean set) Set the specified flags on this message to the specified value.
abstract void | setFrom() Set the "From" attribute in this Message.
abstract void | setFrom(Address address) Set the "From" attribute in this Message.
protected void | setMessageNumber(int msgnum) Set the Message number for this Message.
void | setRecipient(Message.RecipientType type, Address address) Set the recipient address.
abstract void | setRecipients(Message.RecipientType type, Address[] addresses) Set the recipient addresses.
void | setReplyTo(Address[] addresses) Set the addresses to which replies should be directed.
abstract void | setSentDate(Date date) Set the sent date of this message.
abstract void | setSubject(String subject) Set the subject of this message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.mail.Part
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader, setText, writeTo

Field Detail

英文文档：

msgnum

protected int msgnum
The number of this message within its folder, or zero if the message was not retrieved from a folder.

英文文档：

expunged

protected boolean expunged
True if this message has been expunged.

英文文档：

folder

protected Folder folder
The containing folder, if this message is obtained from a folder

英文文档：

session

protected Session session
The Session object for this Message

Constructor Detail

protected Message()
无参数构造方法。
英文文档：

Message

protected Message()
No-arg version of the constructor.

protected Message(Folder folder, int msgnum)
带 Folder 和消息编号的构造方法。由 Folder 实现使用。
folder | 包含文件夹
msgnum | 此消息在此文件夹中的序列号
英文文档：

Message

protected Message(Folder folder,
                  int msgnum)
Constructor that takes a Folder and a message number. Used by Folder implementations.

Parameters:
folder - containing folder
msgnum - this message's sequence number within this folder

protected Message(Session session)
带 Session 的构造方法。用于客户端创建的 Message 对象。
session Session 对象
英文文档：

Message

protected Message(Session session)
Constructor that takes a Session. Used for client created Message objects.

Parameters:
session - A Session object
Method Detail

abstract public Address[] getFrom() throws MessagingException
返回 "From" 属性。"From" 属性包含希望发送此消息的人员的身份信息。

在某些实现中，这可能与实际发送消息的实体不同。

如果此消息中不存在这个属性，则此方法返回 null。如果此属性存在，但不包含任何地址，则返回一个空数组。

return | Address 对象数组
Throws | MessagingException:
英文文档：

getFrom

public abstract Address[] getFrom()
                           throws MessagingException
Returns the "From" attribute. The "From" attribute contains the identity of the person(s) who wished this message to be sent.

In certain implementations, this may be different from the entity that actually sent the message.

This method returns null if this attribute is not present in this message. Returns an empty array if this attribute is present, but contains no addresses.

Returns:
array of Address objects
Throws:
MessagingException

abstract public void setFrom() throws MessagingException
设置此 Message 中的 "From" 属性。此属性的值是从属性 "mail.user" 获取的。如果此属性不存在，则使用系统属性 "user.name"。
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
英文文档：

setFrom

public abstract void setFrom()
                      throws MessagingException
Set the "From" attribute in this Message. The value of this attribute is obtained from the property "mail.user". If this property is absent, the system property "user.name" is used.

Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.

abstract public void setFrom(Address address) throws MessagingException
设置此 Message 中的 "From" 属性。
address | 发送方
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
英文文档：

setFrom

public abstract void setFrom(Address address)
                      throws MessagingException
Set the "From" attribute in this Message.

Parameters:
address - the sender
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.

abstract public void addFrom(Address[] addresses) throws MessagingException
将这些地址添加到现有 "From" 属性。
addresses | 发送方
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

addFrom

public abstract void addFrom(Address[] addresses)
                      throws MessagingException
Add these addresses to the existing "From" attribute

Parameters:
addresses - the senders
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

abstract public Address[] getRecipients(Message.RecipientType type) throws MessagingException
获取给定类型的所有接收方地址。

如果此消息中不存在给定类型的接收方，则此方法返回 null。如果头存在，但不包含任何地址，则返回一个空数组。

type | 接收方类型
return | Address 对象数组
Throws | MessagingException:
See also | TO, CC, BCC
英文文档：

getRecipients

public abstract Address[] getRecipients(Message.RecipientType type)
                                 throws MessagingException
Get all the recipient addresses of the given type.

This method returns null if no recipients of the given type are present in this message. It may return an empty array if the header is present, but contains no addresses.

Parameters:
type - the recipient type
Returns:
array of Address objects
Throws:
MessagingException
See Also:
Message.RecipientType.TO, Message.RecipientType.CC, Message.RecipientType.BCC

public Address[] getAllRecipients() throws MessagingException
获取消息的所有接收方地址。默认实现使用 getRecipients 方法提取 TO、CC 和 BCC 接收方。

如果此消息中不存在接收方头，则此方法返回 null。如果接收方头存在，但不包含任何地址，则返回一个空数组。

return | Address 对象数组
Throws | MessagingException:
See also | TO, CC, BCC, getRecipients
英文文档：

getAllRecipients

public Address[] getAllRecipients()
                           throws MessagingException
Get all the recipient addresses for the message. The default implementation extracts the TO, CC, and BCC recipients using the getRecipients method.

This method returns null if none of the recipient headers are present in this message. It may Return an empty array if any recipient header is present, but contains no addresses.

Returns:
array of Address objects
Throws:
MessagingException
See Also:
Message.RecipientType.TO, Message.RecipientType.CC, Message.RecipientType.BCC, getRecipients(javax.mail.Message.RecipientType)

abstract public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
设置接收方地址。所有指定类型的地址都由 addresses 参数替代。
type | 接收方类型
addresses | 地址
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
英文文档：

setRecipients

public abstract void setRecipients(Message.RecipientType type,
                                   Address[] addresses)
                            throws MessagingException
Set the recipient addresses. All addresses of the specified type are replaced by the addresses parameter.

Parameters:
type - the recipient type
addresses - the addresses
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.

public void setRecipient(Message.RecipientType type, Address address) throws MessagingException
设置接收方地址。所有指定类型的地址都由 address 参数替代。

默认实现使用 setRecipients 方法。

type | 接收方类型
address | 地址
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

setRecipient

public void setRecipient(Message.RecipientType type,
                         Address address)
                  throws MessagingException
Set the recipient address. All addresses of the specified type are replaced by the address parameter.

The default implementation uses the setRecipients method.

Parameters:
type - the recipient type
address - the address
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

abstract public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
将这些接收方地址添加到给定类型的现存地址中。
type | 接收方类型
addresses | 地址
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
英文文档：

addRecipients

public abstract void addRecipients(Message.RecipientType type,
                                   Address[] addresses)
                            throws MessagingException
Add these recipient addresses to the existing ones of the given type.

Parameters:
type - the recipient type
addresses - the addresses
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.

public void addRecipient(Message.RecipientType type, Address address) throws MessagingException
将此接收方地址添加到给定类型的现存地址中。

默认实现使用 addRecipients 方法。

type | 接收方类型
address | 地址
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

addRecipient

public void addRecipient(Message.RecipientType type,
                         Address address)
                  throws MessagingException
Add this recipient address to the existing ones of the given type.

The default implementation uses the addRecipients method.

Parameters:
type - the recipient type
address - the address
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

public Address[] getReplyTo() throws MessagingException
获取应该发送回复的地址。这通常是消息的发送方，但一些消息可能将回复发送到其他地址。

默认实现仅调用 getFrom 方法。

如果相应的头不存在，则此方法返回 null。如果头存在，但不包含任何地址，则返回一个空数组。

return | 应该发送回复的地址
Throws | MessagingException:
See also | getFrom
英文文档：

getReplyTo

public Address[] getReplyTo()
                     throws MessagingException
Get the addresses to which replies should be directed. This will usually be the sender of the message, but some messages may direct replies to a different address.

The default implementation simply calls the getFrom method.

This method returns null if the corresponding header is not present. Returns an empty array if the header is present, but contains no addresses.

Returns:
addresses to which replies should be directed
Throws:
MessagingException
See Also:
getFrom()

public void setReplyTo(Address[] addresses) throws MessagingException
设置发送回复的地址。（通常只会指定一个地址。）并非所有消息类型都允许独立于消息发送方指定此地址。

此处提供的默认实现仅抛出 MethodNotSupportedException。

addresses | 应该发送回复的地址
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MethodNotSupportedException: 如果底层实现不支持设置此属性
英文文档：

setReplyTo

public void setReplyTo(Address[] addresses)
                throws MessagingException
Set the addresses to which replies should be directed. (Normally only a single address will be specified.) Not all message types allow this to be specified separately from the sender of the message.

The default implementation provided here just throws the MethodNotSupportedException.

Parameters:
addresses - addresses to which replies should be directed
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MethodNotSupportedException - if the underlying implementation does not support setting this attribute

abstract public String getSubject() throws MessagingException
获取此消息的主题。
return | 主题
Throws | MessagingException:
英文文档：

getSubject

public abstract String getSubject()
                           throws MessagingException
Get the subject of this message.

Returns:
the subject
Throws:
MessagingException

abstract public void setSubject(String subject) throws MessagingException
设置此消息的主题。
subject | 主题
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
英文文档：

setSubject

public abstract void setSubject(String subject)
                         throws MessagingException
Set the subject of this message.

Parameters:
subject - the subject
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.

abstract public java.util.Date getSentDate() throws MessagingException
获取发送此消息的日期。
return | 发送此消息的日期
Throws | MessagingException:
英文文档：

getSentDate

public abstract Date getSentDate()
                          throws MessagingException
Get the date this message was sent.

Returns:
the date this message was sent
Throws:
MessagingException

abstract public void setSentDate(java.util.Date date) throws MessagingException
设置此消息的发送日期。
date | 此消息的发送日期
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
英文文档：

setSentDate

public abstract void setSentDate(Date date)
                          throws MessagingException
Set the sent date of this message.

Parameters:
date - the sent date of this message
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.

abstract public java.util.Date getReceivedDate() throws MessagingException
获取收到此消息的日期。
return | 收到此消息的日期
Throws | MessagingException:
英文文档：

getReceivedDate

public abstract Date getReceivedDate()
                              throws MessagingException
Get the date this message was received.

Returns:
the date this message was received
Throws:
MessagingException

abstract public Flags getFlags() throws MessagingException
返回包含此消息的标志的 Flags 对象。

修改这个返回的 Flags 对象中的任何标志都不会影响此消息的标志。可使用 setFlags() 完成此操作。

return | 包含此消息标志的 Flags 对象。
Throws | MessagingException:
See also | javax.mail.Flags, setFlags
英文文档：

getFlags

public abstract Flags getFlags()
                        throws MessagingException
Returns a Flags object containing the flags for this message.

Modifying any of the flags in this returned Flags object will not affect the flags of this message. Use setFlags() to do that.

Returns:
Flags object containing the flags for this message
Throws:
MessagingException
See Also:
Flags, setFlags(javax.mail.Flags, boolean)

public boolean isSet(Flags.Flag flag) throws MessagingException
检查此消息中是否设置了 flag 参数中指定的标志。

默认实现使用 getFlags。

flag | 标志
return | 此消息指定标志的值
Throws | MessagingException:
See also | javax.mail.Flags.Flag, ANSWERED, DELETED, DRAFT, FLAGGED, RECENT, SEEN
英文文档：

isSet

public boolean isSet(Flags.Flag flag)
              throws MessagingException
Check whether the flag specified in the flag argument is set in this message.

The default implementation uses getFlags.

Parameters:
flag - the flag
Returns:
value of the specified flag for this message
Throws:
MessagingException
See Also:
Flags.Flag, Flags.Flag.ANSWERED, Flags.Flag.DELETED, Flags.Flag.DRAFT, Flags.Flag.FLAGGED, Flags.Flag.RECENT, Flags.Flag.SEEN

abstract public void setFlags(Flags flag, boolean set) throws MessagingException
将此消息上的指定标志设置为指定值。注意，此消息中未在给定 Flags 对象中指定的任何标志都不受影响。

这将导致向此 Message 包含文件夹上注册的任何 MessageChangedListener 传送 MessageChangedEvent。

flag | 包含要设置的标志的 Flag 对象
set | 要设置的值
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值。
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
See also | javax.mail.event.MessageChangedEvent
英文文档：

setFlags

public abstract void setFlags(Flags flag,
                              boolean set)
                       throws MessagingException
Set the specified flags on this message to the specified value. Note that any flags in this message that are not specified in the given Flags object are unaffected.

This will result in a MessageChangedEvent being delivered to any MessageChangedListener registered on this Message's containing folder.

Parameters:
flag - Flags object containing the flags to be set
set - the value to be set
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values.
IllegalStateException - if this message is obtained from a READ_ONLY folder.
See Also:
MessageChangedEvent

public void setFlag(Flags.Flag flag, boolean set) throws MessagingException
将此消息上的指定标志设置为指定值。 这将导致向此 Message 包含文件夹上注册的任何 MessageChangedListener 传送 MessageChangedEvent。

默认实现使用 setFlags 方法。

flag | 包含要设置的标志的 Flags.Flag 对象
set | 要设置的值
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值。
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
See also | javax.mail.event.MessageChangedEvent
英文文档：

setFlag

public void setFlag(Flags.Flag flag,
                    boolean set)
             throws MessagingException
Set the specified flag on this message to the specified value. This will result in a MessageChangedEvent being delivered to any MessageChangedListener registered on this Message's containing folder.

The default implementation uses the setFlags method.

Parameters:
flag - Flags.Flag object containing the flag to be set
set - the value to be set
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values.
IllegalStateException - if this message is obtained from a READ_ONLY folder.
See Also:
MessageChangedEvent

public int getMessageNumber()
获取此 Message 的 Message 编号。Message 对象的消息编号是其 Folder 中此 Message 的相对位置。注意，如果会话期间删除（擦除）了 Folder 中的其他消息，则特定 Message 的消息编号可能发生更改。

有效的消息编号从 1 开始。不属于任何文件夹的消息（比如新撰写的消息或派生的消息）使用 0 作为其消息编号。

return 消息编号
英文文档：

getMessageNumber

public int getMessageNumber()
Get the Message number for this Message. A Message object's message number is the relative position of this Message in its Folder. Note that the message number for a particular Message can change during a session if other messages in the Folder are deleted and expunged.

Valid message numbers start at 1. Messages that do not belong to any folder (like newly composed or derived messages) have 0 as their message number.

Returns:
the message number

protected void setMessageNumber(int msgnum)
设置此 Message 的 Message 编号。此方法仅供实现类调用。
英文文档：

setMessageNumber

protected void setMessageNumber(int msgnum)
Set the Message number for this Message. This method is invoked only by the implementation classes.

public Folder getFolder()
获取可从中获得此消息的文件夹。如果此消息是一条新消息或者嵌套消息，则此方法返回 null。
return 包含文件夹
英文文档：

getFolder

public Folder getFolder()
Get the folder from which this message was obtained. If this is a new message or nested message, this method returns null.

Returns:
the containing folder

public boolean isExpunged()
检查是否擦除了此消息。除 getMessageNumber() 以外，所有其他方法对已擦除的 Message 对象都是无效的。

由于对包含 Folder 显式调用 expunge() 而被擦除的 Message 将立即从该 Folder 中移除。由于另一个原因被外部擦除的 Message 将标记为 "expunged"，并在调用 isExpunged() 方法时返回 true，但直到对 Folder 显式调用 expunge() 时才将其从该 Folder 中移除。

有关擦除处理的更多详细信息，请参见 expunge() 的描述。

See also expunge
英文文档：

isExpunged

public boolean isExpunged()
Checks whether this message is expunged. All other methods except getMessageNumber() are invalid on an expunged Message object.

Messages that are expunged due to an explict expunge() request on the containing Folder are removed from the Folder immediately. Messages that are externally expunged by another source are marked "expunged" and return true for the isExpunged() method, but they are not removed from the Folder until an explicit expunge() is done on the Folder.

See the description of expunge() for more details on expunge handling.

See Also:
Folder.expunge()

protected void setExpunged(boolean expunged)
设置此 Message 的 expunged 标志。此方法仅供实现类使用。
expunged expunged 标志
英文文档：

setExpunged

protected void setExpunged(boolean expunged)
Sets the expunged flag for this Message. This method is to be used only by the implementation classes.

Parameters:
expunged - the expunged flag

abstract public Message reply(boolean replyToAll) throws MessagingException
获取适用于回复此消息的新 Message。新的 Message 将恰当设置其属性和头。注意，这个新消息对象为空，即它没有 "content"。这些必须由客户端恰当地填充。

如果设置了 replyToAll，则新的 Message 将发送给此消息的所有接收方。否则，回复将只发送给此消息的发送方（使用 getReplyTo 方法的值）。

"Subject" 字段使用原主题加上前缀 "Re:" 填写（除非它已经以 "Re:" 开头）。

回复消息将使用与此消息相同的会话。

replyToAll | 回复应该发送给此消息的所有接收方
return | 回复 Message
Throws | MessagingException:
英文文档：

reply

public abstract Message reply(boolean replyToAll)
                       throws MessagingException
Get a new Message suitable for a reply to this message. The new Message will have its attributes and headers set up appropriately. Note that this new message object will be empty, that is, it will not have a "content". These will have to be suitably filled in by the client.

If replyToAll is set, the new Message will be addressed to all recipients of this message. Otherwise, the reply will be addressed to only the sender of this message (using the value of the getReplyTo method).

The "Subject" field is filled in with the original subject prefixed with "Re:" (unless it already starts with "Re:").

The reply message will use the same session as this message.

Parameters:
replyToAll - reply should be sent to all recipients of this message
Returns:
the reply Message
Throws:
MessagingException

abstract public void saveChanges() throws MessagingException
如果消息包含在某个文件夹中，那么当该包含文件夹关闭时，对此消息进行的所有更改将保存到消息存储库中。（一些实现可能会立刻保存这些更改。）更新所有头字段，使它们与已更改的消息内容一致。如果消息的头或内容的任何部分发生更改，则必须调用 saveChanges 确保这些更改是永久性的。如果没有调用 saveChanges，那么这些修改也许被保存，也许不被保存，具体取决于消息存储库和 Folder 实现。

不应该修改从设置为 READ_ONLY 的文件夹获取的消息，也不应对这些消息调用 saveChanges。

Throws | MessagingException:
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值。
英文文档：

saveChanges

public abstract void saveChanges()
                          throws MessagingException
Save any changes made to this message into the message-store when the containing folder is closed, if the message is contained in a folder. (Some implementations may save the changes immediately.) Update any header fields to be consistent with the changed message contents. If any part of a message's headers or contents are changed, saveChanges must be called to ensure that those changes are permanent. If saveChanges is not called, any such modifications may or may not be saved, depending on the message store and folder implementation.

Messages obtained from folders opened READ_ONLY should not be modified and saveChanges should not be called on such messages.

Throws:
MessagingException
IllegalStateException - if this message is obtained from a READ_ONLY folder.
IllegalWriteException - if the underlying implementation does not support modification of existing values.

public boolean match(SearchTerm term) throws MessagingException
将指定 Search 标准应用于此消息。
term | Search 标准
return | 如果 Message 与此搜索标准匹配，则返回 true；否则返回 false。
Throws | MessagingException:
See also | javax.mail.search.SearchTerm
英文文档：

match

public boolean match(SearchTerm term)
              throws MessagingException
Apply the specified Search criterion to this message.

Parameters:
term - the Search criterion
Returns:
true if the Message matches this search criterion, false otherwise.
Throws:
MessagingException
See Also:
SearchTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Message.RecipientType (Java EE 5)

javax.mail
Class Message.RecipientType

java.lang.Object
    extended by  javax.mail.Message.RecipientType
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MimeMessage.RecipientType
Enclosing class:
Message
public static class Message.RecipientType
extends Object
implements Serializable

Implements: java.io.Serializable
Contained within: Message
Extended by: MimeMessage.RecipientType

此内部类定义了 Message 类所允许的接收方类型。目前已定义的类型有 TO、CC 和 BCC。 注意，此类只有一个受保护的构造方法，因此新的 Recipient 类型被限制为此类或其子类。这有效实现了所允许 Recipient 类型的枚举。 以下代码示例显示了如何使用此类从消息中获取 "TO" 接收方。

Message msg = folder.getMessages(1);
Address[] a = m.getRecipients(Message.RecipientType.TO);

See also getRecipients, setRecipients, addRecipients
英文文档：

This inner class defines the types of recipients allowed by the Message class. The currently defined types are TO, CC and BCC. Note that this class only has a protected constructor, thereby restricting new Recipient types to either this class or subclasses. This effectively implements an enumeration of the allowed Recipient types. The following code sample shows how to use this class to obtain the "TO" recipients from a message.

 Message msg = folder.getMessages(1);
 Address[] a = m.getRecipients(Message.RecipientType.TO);

See Also:
Message.getRecipients(javax.mail.Message.RecipientType),
Message.setRecipients(javax.mail.Message.RecipientType, javax.mail.Address[]),
Message.addRecipients(javax.mail.Message.RecipientType, javax.mail.Address[]),
Serialized Form

Field Summary
static Message.RecipientType | BCC The "Bcc" (blind carbon copy) recipients.
static Message.RecipientType | CC The "Cc" (carbon copy) recipients.
static Message.RecipientType | TO The "To" (primary) recipients.
protected String | type The type of recipient, usually the name of a corresponding Internet standard header.
Constructor Summary
protected Message.RecipientType(String type)
Constructor for use by subclasses.
Method Summary
protected Object | readResolve() When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class.
String | toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

TO

public static final Message.RecipientType TO
The "To" (primary) recipients.

英文文档：

CC

public static final Message.RecipientType CC
The "Cc" (carbon copy) recipients.

英文文档：

BCC

public static final Message.RecipientType BCC
The "Bcc" (blind carbon copy) recipients.

英文文档：

type

protected String type
The type of recipient, usually the name of a corresponding Internet standard header.

Constructor Detail

protected Message.RecipientType(String type)
子类使用的构造方法。
英文文档：

Message.RecipientType

protected Message.RecipientType(String type)
Constructor for use by subclasses.

Method Detail

protected Object readResolve() throws java.io.ObjectStreamException
反序列化 RecipientType 时，我们需要确保仅返回此类中定义的已知静态最终实例之一。子类必须实现自己的 readResolve 方法，以便在调用此超类方法前检查已知的实例。
英文文档：

readResolve

protected Object readResolve()
                      throws ObjectStreamException
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class. Subclasses must implement their own readResolve method that checks for their known instances before calling this super method.

Throws:
ObjectStreamException

public String toString()
英文文档：

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageContext (Java EE 5)

javax.mail
Class MessageContext

java.lang.Object
    extended by  javax.mail.MessageContext

public class MessageContext
extends Object

包含 Message 内容的某个片段的上下文。MessageAware 接口的 getMessageContext 方法返回 MessageContext 对象。MessageAware 通常由 DataSources 实现，以允许 DataContentHandler 传递有关操作数据内容对象所在上下文的信息。
since
en
JavaMail 1.1
See also javax.mail.MessageAware, javax.activation.DataSource, javax.activation.DataContentHandler
英文文档：

The context in which a piece of Message content is contained. A MessageContext object is returned by the getMessageContext method of the MessageAware interface. MessageAware is typically implemented by DataSources to allow a DataContentHandler to pass on information about the context in which a data content object is operating.

Since:
JavaMail 1.1
See Also:
MessageAware, DataSource, DataContentHandler

Constructor Summary
MessageContext(Part part)
Create a MessageContext object describing the context of the given Part.
Method Summary
Message | getMessage() Return the Message that contains the content.
Part | getPart() Return the Part that contains the content.
Session | getSession() Return the Session we're operating in.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MessageContext(Part part)
创建描述给定 Part 的上下文的 MessageContext 对象。
英文文档：

MessageContext

public MessageContext(Part part)
Create a MessageContext object describing the context of the given Part.

Method Detail

public Part getPart()
返回包含内容的 Part。
return 包含内容的 Part；如果未知，则返回 null
英文文档：

getPart

public Part getPart()
Return the Part that contains the content.

Returns:
the containing Part, or null if not known

public Message getMessage()
返回包含内容的 Message。沿父 Message 对象链从头到尾搜索包含内容的 Multipart 对象，直到找到某个 Message 对象为止；或者返回 null。
return 包含内容的 Message；如果未知，则返回 null
英文文档：

getMessage

public Message getMessage()
Return the Message that contains the content. Follows the parent chain up through containing Multipart objects until it comes to a Message object, or null.

Returns:
the containing Message, or null if not known

public Session getSession()
返回正操作的 Session。
return Session；如果未知，则返回 null
英文文档：

getSession

public Session getSession()
Return the Session we're operating in.

Returns:
the Session, or null if not known
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Multipart (Java EE 5)

javax.mail
Class Multipart

java.lang.Object
    extended by  javax.mail.Multipart
Direct Known Subclasses:
MimeMultipart
public abstract class Multipart
extends Object

Extended by: MimeMultipart

Multipart 是保存多个正文部分的容器。Multipart 提供获取和设置其子部分的方法。

Multipart 还充当多数 Multipart DataContentHandler 所返回的内容对象的基类。例如，对其源为 "multipart/signed" 数据源的 DataHandler 调用 getContent() 方法可能返回相应的 Multipart 子类。

一些消息传递系统提供不同的 Multipart 子类型。例如，MIME 指定了一组包括 "alternative"、"mixed"、"related"、"parallel"、"signed" 等在内的子类型。

Multipart 是一个抽象类。子类提供实际实现。

version 1.16, 07/05/04
英文文档：

Multipart is a container that holds multiple body parts. Multipart provides methods to retrieve and set its subparts.

Multipart also acts as the base class for the content object returned by most Multipart DataContentHandlers. For example, invoking getContent() on a DataHandler whose source is a "multipart/signed" data source may return an appropriate subclass of Multipart.

Some messaging systems provide different subtypes of Multiparts. For example, MIME specifies a set of subtypes that include "alternative", "mixed", "related", "parallel", "signed", etc.

Multipart is an abstract class. Subclasses provide actual implementations.

Version:
1.16, 07/05/04
Author:
John Mani

Field Summary
protected String | contentType This field specifies the content-type of this multipart object.
protected Part | parent The Part containing this Multipart, if known.
protected Vector | parts Vector of BodyPart objects.
Constructor Summary
protected Multipart()
Default constructor.
Method Summary
void | addBodyPart(BodyPart part) Adds a Part to the multipart.
void | addBodyPart(BodyPart part, int index) Adds a BodyPart at position index.
BodyPart | getBodyPart(int index) Get the specified Part.
String | getContentType() Return the content-type of this Multipart.
int | getCount() Return the number of enclosed BodyPart objects.
Part | getParent() Return the Part that contains this Multipart object, or null if not known.
boolean | removeBodyPart(BodyPart part) Remove the specified part from the multipart message.
void | removeBodyPart(int index) Remove the part at specified location (starting from 0).
protected void | setMultipartDataSource(MultipartDataSource mp) Setup this Multipart object from the given MultipartDataSource.
void | setParent(Part parent) Set the parent of this Multipart to be the specified Part.
abstract void | writeTo(OutputStream os) Output an appropriately encoded bytestream to the given OutputStream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

parts

protected Vector parts
Vector of BodyPart objects.

英文文档：

contentType

protected String contentType
This field specifies the content-type of this multipart object. It defaults to "multipart/mixed".

英文文档：

parent

protected Part parent
The Part containing this Multipart, if known.

Since:
JavaMail 1.1
Constructor Detail

protected Multipart()
默认构造方法。创建一个空的 Multipart 对象。
英文文档：

Multipart

protected Multipart()
Default constructor. An empty Multipart object is created.

Method Detail

protected void setMultipartDataSource(MultipartDataSource mp) throws MessagingException
根据给定 MultipartDataSource 设置此 Multipart 对象。

该方法将 MultipartDataSource 的 BodyPart 对象添加到此 Multipart 中。此 Multipart 的 contentType 被设置为 MultipartDataSource 的内容类型。

此方法通常在以下情况下使用：拥有已经预先解析成单独正文部分的 Multipart 数据源（例如 IMAP 数据源），但需要创建表示特定 multipart 子类型的相应 Multipart 子类。

mp Multipart 数据源
英文文档：

setMultipartDataSource

protected void setMultipartDataSource(MultipartDataSource mp)
                               throws MessagingException
Setup this Multipart object from the given MultipartDataSource.

The method adds the MultipartDataSource's BodyPart objects into this Multipart. This Multipart's contentType is set to that of the MultipartDataSource.

This method is typically used in those cases where one has a multipart data source that has already been pre-parsed into the individual body parts (for example, an IMAP datasource), but needs to create an appropriate Multipart subclass that represents a specific multipart subtype.

Parameters:
mp - Multipart datasource
Throws:
MessagingException

public String getContentType()
返回此 Multipart 的内容类型。

此实现只返回 contentType 字段的值。

return | 内容类型
See also | contentType
英文文档：

getContentType

public String getContentType()
Return the content-type of this Multipart.

This implementation just returns the value of the contentType field.

Returns:
content-type
See Also:
contentType

public int getCount() throws MessagingException
返回封闭的 BodyPart 对象的数量。

return | 部分数
See also | parts
英文文档：

getCount

public int getCount()
             throws MessagingException
Return the number of enclosed BodyPart objects.

Returns:
number of parts
Throws:
MessagingException
See Also:
parts

public BodyPart getBodyPart(int index) throws MessagingException
获取指定的 Part。Part 是从 0 开始编号的。
index | 所需 Part 的索引
return | Part
Throws | IndexOutOfBoundsException: 如果给定索引超出范围。
Throws | MessagingException:
英文文档：

getBodyPart

public BodyPart getBodyPart(int index)
                     throws MessagingException
Get the specified Part. Parts are numbered starting at 0.

Parameters:
index - the index of the desired Part
Returns:
the Part
Throws:
IndexOutOfBoundsException - if the given index is out of range.
MessagingException

public boolean removeBodyPart(BodyPart part) throws MessagingException
从 multipart 消息中移除指定的部分。将所有部分向移除部分移动一位。
part | 要移除的部分
return | 如果移除了 part，则返回 true；否则返回 false
Throws | MessagingException: 如果不存在此类 Part
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

removeBodyPart

public boolean removeBodyPart(BodyPart part)
                       throws MessagingException
Remove the specified part from the multipart message. Shifts all the parts after the removed part down one.

Parameters:
part - The part to remove
Returns:
true if part removed, false otherwise
Throws:
MessagingException - if no such Part exists
IllegalWriteException - if the underlying implementation does not support modification of existing values

public void removeBodyPart(int index) throws MessagingException
移除指定位置（从 0 开始）的部分。将所有部分向移除部分移动一位。
index | 要移除部分的索引
Throws | MessagingException:
Throws | IndexOutOfBoundsException: 如果给定索引超出范围。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

removeBodyPart

public void removeBodyPart(int index)
                    throws MessagingException
Remove the part at specified location (starting from 0). Shifts all the parts after the removed part down one.

Parameters:
index - Index of the part to remove
Throws:
MessagingException
IndexOutOfBoundsException - if the given index is out of range.
IllegalWriteException - if the underlying implementation does not support modification of existing values

public void addBodyPart(BodyPart part) throws MessagingException
将 Part 添加到 multipart。BodyPart 将被添加到现有的 Part 列表。
part | 要添加的 Part
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

addBodyPart

public void addBodyPart(BodyPart part)
                 throws MessagingException
Adds a Part to the multipart. The BodyPart is appended to the list of existing Parts.

Parameters:
part - The Part to be appended
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

public void addBodyPart(BodyPart part, int index) throws MessagingException
在 index 处添加 BodyPart。如果 index 不是列表中的最后一个，则后续部分将向上移。如果 index 大于现有的部分数，则将在末尾添加 BodyPart。
part | 要插入的 BodyPart
index | 插入部分的位置
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

addBodyPart

public void addBodyPart(BodyPart part,
                        int index)
                 throws MessagingException
Adds a BodyPart at position index. If index is not the last one in the list, the subsequent parts are shifted up. If index is larger than the number of parts present, the BodyPart is appended to the end.

Parameters:
part - The BodyPart to be inserted
index - Location where to insert the part
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

abstract public void writeTo(java.io.OutputStream os) throws java.io.IOException, MessagingException
将相应的已编码字节流输出到给定的 OutputStream。实现子类决定相应的编码算法。字节流通常用于发送。
Throws | java.io.IOException: 如果发生与 IO 相关的异常
Throws | MessagingException:
英文文档：

writeTo

public abstract void writeTo(OutputStream os)
                      throws IOException,
                             MessagingException
Output an appropriately encoded bytestream to the given OutputStream. The implementation subclass decides the appropriate encoding algorithm to be used. The bytestream is typically used for sending.

Throws:
IOException - if an IO related exception occurs
MessagingException

public Part getParent()
返回包含此 Multipart 对象的 Part；如果未知，则返回 null。
since
en
JavaMail 1.1
英文文档：

getParent

public Part getParent()
Return the Part that contains this Multipart object, or null if not known.

Since:
JavaMail 1.1

public void setParent(Part parent)
将此 Multipart 的父 Multipart 设置为指定的 Part。通常由 Message 或 BodyPart setContent(Multipart) 方法调用。如果要从包含 Part 中移除 Multipart，则 parent 可能为 null。
since
en
JavaMail 1.1
英文文档：

setParent

public void setParent(Part parent)
Set the parent of this Multipart to be the specified Part. Normally called by the Message or BodyPart setContent(Multipart) method. parent may be null if the Multipart is being removed from its containing Part.

Since:
JavaMail 1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PasswordAuthentication (Java EE 5)

javax.mail
Class PasswordAuthentication

java.lang.Object
    extended by  javax.mail.PasswordAuthentication

public final class PasswordAuthentication
extends Object

PasswordAuthentication 类是供 Authenticator 使用的数据持有者。它只是用户名和密码的存储库。
version | 1.6, 05/04/07
See also | java.net.PasswordAuthentication, javax.mail.Authenticator, getPasswordAuthentication()
英文文档：

The class PasswordAuthentication is a data holder that is used by Authenticator. It is simply a repository for a user name and a password.

Version:
1.6, 05/04/07
Author:
Bill Foote
See Also:
PasswordAuthentication, Authenticator, Authenticator.getPasswordAuthentication()

Constructor Summary
PasswordAuthentication(String userName, String password)
Initialize a new PasswordAuthentication
Method Summary
String | getPassword()
String | getUserName()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public PasswordAuthentication(String userName, String password)
初始化新的 PasswordAuthentication
userName | 用户名
password | 用户的密码
英文文档：

PasswordAuthentication

public PasswordAuthentication(String userName,
                              String password)
Initialize a new PasswordAuthentication

Parameters:
userName - the user name
password - The user's password
Method Detail

public String getUserName()
return 用户名
英文文档：

getUserName

public String getUserName()
Returns:
the user name

public String getPassword()
return 密码
英文文档：

getPassword

public String getPassword()
Returns:
the password
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Provider (Java EE 5)

javax.mail
Class Provider

java.lang.Object
    extended by  javax.mail.Provider

public class Provider
extends Object

Inner classes: Provider.Type

Provider 是描述协议实现的类。这些值通常来自 javamail.providers 和 javamail.default.providers 资源文件。应用程序还可以创建和注册 Provider 对象，以动态添加对新提供者的支持。
version 1.11, 07/05/04
英文文档：

The Provider is a class that describes a protocol implementation. The values typically come from the javamail.providers and javamail.default.providers resource files. An application may also create and register a Provider object to dynamically add support for a new provider.

Version:
1.11, 07/05/04
Author:
Max Spivak, Bill Shannon

Nested Class Summary
static class Provider.Type
This inner class defines the Provider type.
Constructor Summary
Provider(Provider.Type type, String protocol, String classname, String vendor, String version)
Create a new provider of the specified type for the specified protocol.
Method Summary
 String getClassName()
Returns name of the class that implements the protocol
 String getProtocol()
Returns the protocol supported by this Provider
 Provider.Type getType()
Returns the type of this Provider
 String getVendor()
Returns name of vendor associated with this implementation or null
 String getVersion()
Returns version of this implementation or null if no version
 String toString()
Overrides Object.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public Provider(Provider.Type type, String protocol, String classname, String vendor, String version)
为指定协议创建指定类型的新提供者。指定类可实现该提供者。
type | Type.STORE 或 Type.TRANSPORT
protocol | 用于类型的有效协议
classname | 实现此协议的类名称
vendor | 标识供应商的可选字符串（可为 null）
version | 可选的实现版本字符串（可为 null）
since
en
JavaMail 1.4
英文文档：

Provider

public Provider(Provider.Type type,
                String protocol,
                String classname,
                String vendor,
                String version)
Create a new provider of the specified type for the specified protocol. The specified class implements the provider.

Parameters:
type - Type.STORE or Type.TRANSPORT
protocol - valid protocol for the type
classname - class name that implements this protocol
vendor - optional string identifying the vendor (may be null)
version - optional implementation version string (may be null)
Since:
JavaMail 1.4
Method Detail

public Provider.Type getType()
返回此 Provider 的类型。
英文文档：

getType

public Provider.Type getType()
Returns the type of this Provider

public String getProtocol()
返回此 Provider 支持的协议。
英文文档：

getProtocol

public String getProtocol()
Returns the protocol supported by this Provider

public String getClassName()
返回实现协议的类的名称。
英文文档：

getClassName

public String getClassName()
Returns name of the class that implements the protocol

public String getVendor()
返回与此实现关联的供应商的名称，或者返回 null。
英文文档：

getVendor

public String getVendor()
Returns name of vendor associated with this implementation or null

public String getVersion()
返回此实现的版本；如果没有任何版本，则返回 null。
英文文档：

getVersion

public String getVersion()
Returns version of this implementation or null if no version

public String toString()
重写 Object.toString()。
英文文档：

toString

public String toString()
Overrides Object.toString()

Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Provider.Type (Java EE 5)

javax.mail
Class Provider.Type

java.lang.Object
    extended by  javax.mail.Provider.Type
Enclosing class:
Provider
public static class Provider.Type
extends Object

Contained within: Provider

此内部类定义了 Provider 类型。目前，STORE 和 TRANSPORT 是仅有的两个受支持的提供者类型。
英文文档：

This inner class defines the Provider type. Currently, STORE and TRANSPORT are the only two provider types supported.

Field Summary
static Provider.Type | STORE
static Provider.Type | TRANSPORT
Method Summary
 String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

STORE

public static final Provider.Type STORE

英文文档：

TRANSPORT

public static final Provider.Type TRANSPORT
Method Detail

public String toString()
英文文档：

toString

public String toString()
Overrides:
toString in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Quota (Java EE 5)

javax.mail
Class Quota

java.lang.Object
    extended by  javax.mail.Quota

public class Quota
extends Object

Inner classes: Quota.Resource

此类表示用于给定配额根 (quota root) 的一组配额。每个配额根都有一个用 Quota.Resource 类表示的资源的集合。每个资源都有一个名称（例如 "STORAGE"）、一个当前使用量和一个使用限制。请参见 RFC 2087。
since
en
JavaMail 1.4
version 1.7, 07/05/04
英文文档：

This class represents a set of quotas for a given quota root. Each quota root has a set of resources, represented by the Quota.Resource class. Each resource has a name (for example, "STORAGE"), a current usage, and a usage limit. See RFC 2087.

Since:
JavaMail 1.4
Version:
1.7, 07/05/04
Author:
Bill Shannon

Nested Class Summary
static class Quota.Resource
An individual resource in a quota root.
Field Summary
String | quotaRoot The name of the quota root.
Quota.Resource[] | resources The set of resources associated with this quota root.
Constructor Summary
Quota(String quotaRoot)
Create a Quota object for the named quotaroot with no associated resources.
Method Summary
 void setResourceLimit(String name, long limit)
Set a resource limit for this quota root.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

quotaRoot

public String quotaRoot
The name of the quota root.

英文文档：

resources

public Quota.Resource[] resources
The set of resources associated with this quota root.

Constructor Detail

public Quota(String quotaRoot)
为指定的配额根创建 Quota 对象，不带任何关联的资源。
quotaRoot 配额根的名称
英文文档：

Quota

public Quota(String quotaRoot)
Create a Quota object for the named quotaroot with no associated resources.

Parameters:
quotaRoot - the name of the quota root
Method Detail

public void setResourceLimit(String name, long limit)
为此配额根设置资源限制。
name | 资源的名称
limit | 资源限制
英文文档：

setResourceLimit

public void setResourceLimit(String name,
                             long limit)
Set a resource limit for this quota root.

Parameters:
name - the name of the resource
limit - the resource limit
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Quota.Resource (Java EE 5)

javax.mail
Class Quota.Resource

java.lang.Object
    extended by  javax.mail.Quota.Resource
Enclosing class:
Quota
public static class Quota.Resource
extends Object

Contained within: Quota

配额根中的单独资源。
since
en
JavaMail 1.4
英文文档：

An individual resource in a quota root.

Since:
JavaMail 1.4

Field Summary
long | limit The usage limit for the resource.
String | name The name of the resource.
long | usage The current usage of the resource.
Constructor Summary
Quota.Resource(String name, long usage, long limit)
Construct a Resource object with the given name, usage, and limit.
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

name

public String name
The name of the resource.

英文文档：

usage

public long usage
The current usage of the resource.

英文文档：

limit

public long limit
The usage limit for the resource.

Constructor Detail

public Quota.Resource(String name, long usage, long limit)
使用给定名称、使用量和限制构造 Resource 对象。
name | 资源的名称
usage | 资源的当前使用量
limit | 资源的使用限制
英文文档：

Quota.Resource

public Quota.Resource(String name,
                      long usage,
                      long limit)
Construct a Resource object with the given name, usage, and limit.

Parameters:
name - the resource name
usage - the current usage of the resource
limit - the usage limit for the resource
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Service (Java EE 5)

javax.mail
Class Service

java.lang.Object
    extended by  javax.mail.Service
Direct Known Subclasses:
Store, Transport
public abstract class Service
extends Object

Extended by: Store, Transport

包含常用于消息传递服务（比如 store 和 transport）的功能的抽象类。

消息传递服务是从 Session 中创建的，并使用 URLName 命名。在使用某个服务之前，必须先连接到该服务。发送 Connection 事件以反映其连接状态。

version 1.33, 07/05/14
英文文档：

An abstract class that contains the functionality common to messaging services, such as stores and transports.

A messaging service is created from a Session and is named using a URLName. A service must be connected before it can be used. Connection events are sent to reflect its connection status.

Version:
1.33, 07/05/14
Author:
Christopher Cotton, Bill Shannon, Kanwar Oberoi

Field Summary
protected boolean | debug Debug flag for this service.
protected Session | session The session from which this service was created.
protected URLName | url The URLName of this service.
Constructor Summary
protected Service(Session session, URLName urlname)
Constructor.
Method Summary
 void addConnectionListener(ConnectionListener l)
Add a listener for Connection events on this service.
 void close()
Close this service and terminate its connection.
 void connect()
A generic connect method that takes no parameters.
 void connect(String host, int port, String user, String password)
Similar to connect(host, user, password) except a specific port can be specified.
 void connect(String user, String password)
Connect to the current host using the specified username and password.
 void connect(String host, String user, String password)
Connect to the specified address.
protected  void finalize()
Stop the event dispatcher thread so the queue can be garbage collected.
 URLName getURLName()
Return a URLName representing this service.
 boolean isConnected()
Is this service currently connected?
protected  void notifyConnectionListeners(int type)
Notify all ConnectionListeners.
protected  boolean protocolConnect(String host, int port, String user, String password)
The service implementation should override this method to perform the actual protocol-specific connection attempt.
protected  void queueEvent(MailEvent event, Vector vector)
Add the event and vector of listeners to the queue to be delivered.
 void removeConnectionListener(ConnectionListener l)
Remove a Connection event listener.
protected  void setConnected(boolean connected)
Set the connection state of this service.
protected  void setURLName(URLName url)
Set the URLName representing this service.
 String toString()
Return getURLName.toString() if this service has a URLName, otherwise it will return the default toString.
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

session

protected Session session
The session from which this service was created.

英文文档：

url

protected URLName url
The URLName of this service.

英文文档：

debug

protected boolean debug
Debug flag for this service. Set from the session's debug flag when this service is created.

Constructor Detail

protected Service(Session session, URLName urlname)
构造方法。
session | 此服务的 Session 对象
urlname | 要用于此服务的 URLName 对象
英文文档：

Service

protected Service(Session session,
                  URLName urlname)
Constructor.

Parameters:
session - Session object for this service
urlname - URLName object to be used for this service
Method Detail

public void connect() throws MessagingException
不带参数的常规 connect 方法。子类可以实现相应的验证方案。需要额外信息的子类可能想要使用某些属性，或者可能使用弹出窗口以交互方式获得这些信息。

如果连接成功，则向此服务上的所有 ConnectionListener 传送一个 "open" ConnectionEvent。

大多数客户端应该只调用此方法连接到该服务。

连接已经连接的服务是一个错误。

此处提供的实现仅使用 null 调用以下 connect(String, String, String) 方法。

Throws | AuthenticationFailedException: 用于验证失败
Throws | MessagingException: 用于其他失败
Throws | IllegalStateException: 如果已经连接该服务
See also | javax.mail.event.ConnectionEvent
英文文档：

connect

public void connect()
             throws MessagingException
A generic connect method that takes no parameters. Subclasses can implement the appropriate authentication schemes. Subclasses that need additional information might want to use some properties or might get it interactively using a popup window.

If the connection is successful, an "open" ConnectionEvent is delivered to any ConnectionListeners on this service.

Most clients should just call this method to connect to the service.

It is an error to connect to an already connected service.

The implementation provided here simply calls the following connect(String, String, String) method with nulls.

Throws:
AuthenticationFailedException - for authentication failures
MessagingException - for other failures
IllegalStateException - if the service is already connected
See Also:
ConnectionEvent

public void connect(String host, String user, String password) throws MessagingException
连接到指定地址。此方法提供一个需要用户名和密码的简单验证方案。

如果连接成功，则向此服务上的所有 ConnectionListener 传送一个 "open" ConnectionEvent。

连接已经连接的服务是一个错误。

Service 类中的实现将从该会话、从此服务的 URLName 和提供的参数中收集主机、用户和密码的默认值，然后调用 protocolConnect 方法。如果 protocolConnect 方法返回 false，则将提示用户任何缺失的信息，并且将再次调用 protocolConnect 方法。子类应该重写 protocolConnect 方法。子类还应该实现 getURLName 方法，或者使用此类中的实现。

在成功的连接上，使用包含用于建立连接的信息（包括密码）的 URLName 调用 setURLName 方法。

如果传入的用户名为 null，则如上所述将选择默认值。 如果传入的密码为 null，并且这是第一次成功连接到此服务，则从用户处收集的用户名和密码将被保存为默认值，用于后续使用其他 Service 对象实例时到此同一服务的连接尝试（连接信息通常总是保存在特定 Service 对象实例中）。密码是使用 Session 方法 setPasswordAuthentication 保存的。假定应用程序显式管理密码，那么即使传入的密码不为 null，也不保存该密码。

host | 要连接到的主机
user | 用户名
password | 此用户的密码
Throws | AuthenticationFailedException: 用于验证失败
Throws | MessagingException: 用于其他失败
Throws | IllegalStateException: 如果已经连接该服务
See also | javax.mail.event.ConnectionEvent, setPasswordAuthentication
英文文档：

connect

public void connect(String host,
                    String user,
                    String password)
             throws MessagingException
Connect to the specified address. This method provides a simple authentication scheme that requires a username and password.

If the connection is successful, an "open" ConnectionEvent is delivered to any ConnectionListeners on this service.

It is an error to connect to an already connected service.

The implementation in the Service class will collect defaults for the host, user, and password from the session, from the URLName for this service, and from the supplied parameters and then call the protocolConnect method. If the protocolConnect method returns false, the user will be prompted for any missing information and the protocolConnect method will be called again. The subclass should override the protocolConnect method. The subclass should also implement the getURLName method, or use the implementation in this class.

On a successful connection, the setURLName method is called with a URLName that includes the information used to make the connection, including the password.

If the username passed in is null, a default value will be chosen as described above. If the password passed in is null and this is the first successful connection to this service, the user name and the password collected from the user will be saved as defaults for subsequent connection attempts to this same service when using other Service object instances (the connection information is typically always saved within a particular Service object instance). The password is saved using the Session method setPasswordAuthentication. If the password passed in is not null, it is not saved, on the assumption that the application is managing passwords explicitly.

Parameters:
host - the host to connect to
user - the user name
password - this user's password
Throws:
AuthenticationFailedException - for authentication failures
MessagingException - for other failures
IllegalStateException - if the service is already connected
See Also:
ConnectionEvent, Session.setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication)

public void connect(String user, String password) throws MessagingException
使用指定用户名和密码连接到当前主机。此方法等效于使用 null 作为主机名调用 connect(host, user, password) 方法。
user | 用户名
password | 此用户的密码
Throws | AuthenticationFailedException: 用于验证失败
Throws | MessagingException: 用于其他失败
Throws | IllegalStateException: 如果已经连接该服务
since
en
JavaMail 1.4
See also | javax.mail.event.ConnectionEvent, setPasswordAuthentication, connect(java.lang.String, java.lang.String, java.lang.String)
英文文档：

connect

public void connect(String user,
                    String password)
             throws MessagingException
Connect to the current host using the specified username and password. This method is equivalent to calling the connect(host, user, password) method with null for the host name.

Parameters:
user - the user name
password - this user's password
Throws:
AuthenticationFailedException - for authentication failures
MessagingException - for other failures
IllegalStateException - if the service is already connected
Since:
JavaMail 1.4
See Also:
ConnectionEvent, Session.setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication), connect(java.lang.String, java.lang.String, java.lang.String)

public void connect(String host, int port, String user, String password) throws MessagingException
类似于 connect(host, user, password)，但是可指定特定端口。
host | 要连接到的主机
port | 要连接到的端口（-1 表示默认端口）
user | 用户名
password | 此用户的密码
Throws | AuthenticationFailedException: 用于验证失败
Throws | MessagingException: 用于其他失败
Throws | IllegalStateException: 如果已经连接该服务
See also | connect(java.lang.String, java.lang.String, java.lang.String), javax.mail.event.ConnectionEvent
英文文档：

connect

public void connect(String host,
                    int port,
                    String user,
                    String password)
             throws MessagingException
Similar to connect(host, user, password) except a specific port can be specified.

Parameters:
host - the host to connect to
port - the port to connect to (-1 means the default port)
user - the user name
password - this user's password
Throws:
AuthenticationFailedException - for authentication failures
MessagingException - for other failures
IllegalStateException - if the service is already connected
See Also:
connect(java.lang.String, java.lang.String, java.lang.String), ConnectionEvent

protected boolean protocolConnect(String host, int port, String user, String password) throws MessagingException
该服务实现应该重写此方法以执行实际的特定于协议的连接尝试。connect 方法的默认实现根据需要调用此方法。

如果验证需要用户名或密码，但相应参数为 null，则 protocolConnect 方法应该返回 false；在需要提供缺失信息时，connect 方法将提示用户。如果因为提供的用户名或密码导致验证失败，则此方法也可能返回 false。另外，在验证失败时此方法可能抛出 AuthenticationFailedException。此异常可能包括带有关于失败的更多详细信息的 String 消息。

protocolConnect 方法应该抛出一个异常来报告与验证无关的失败（比如无效主机名或端口号、验证过程中连接丢失，或服务器不可用，等等）。

host | 要连接到的主机的名称
port | 要使用的端口（-1 表示使用默认端口）
user | 登录时使用的用户名
password | 用户的密码
return | 如果连接成功，则返回 true；如果验证失败，则返回 false
Throws | AuthenticationFailedException: 用于验证失败
Throws | MessagingException: 用于非验证失败
英文文档：

protocolConnect

protected boolean protocolConnect(String host,
                                  int port,
                                  String user,
                                  String password)
                           throws MessagingException
The service implementation should override this method to perform the actual protocol-specific connection attempt. The default implementation of the connect method calls this method as needed.

The protocolConnect method should return false if a user name or password is required for authentication but the corresponding parameter is null; the connect method will prompt the user when needed to supply missing information. This method may also return false if authentication fails for the supplied user name or password. Alternatively, this method may throw an AuthenticationFailedException when authentication fails. This exception may include a String message with more detail about the failure.

The protocolConnect method should throw an exception to report failures not related to authentication, such as an invalid host name or port number, loss of a connection during the authentication process, unavailability of the server, etc.

Parameters:
host - the name of the host to connect to
port - the port to use (-1 means use default port)
user - the name of the user to login as
password - the user's password
Returns:
true if connection successful, false if authentication failed
Throws:
AuthenticationFailedException - for authentication failures
MessagingException - for non-authentication failures

public boolean isConnected()
此服务目前是否被连接？

此实现使用私有 boolean 字段存储连接状态。此方法返回该字段的值。

子类可能想重写此方法以验证到该消息存储的任何连接是否仍然处于活动状态。

return 如果该服务被连接，则返回 true；如果该服务未被连接，则返回 false
英文文档：

isConnected

public boolean isConnected()
Is this service currently connected?

This implementation uses a private boolean field to store the connection state. This method returns the value of that field.

Subclasses may want to override this method to verify that any connection to the message store is still alive.

Returns:
true if the service is connected, false if it is not connected

protected void setConnected(boolean connected)
设置此服务的连接状态。在调用 connect 和 close 方法期间，连接状态将由该服务实现自动设置。如果到该服务的连接自动断开，则子类将需要调用此方法设置状态。

此类中的实现仅设置 isConnected 方法返回的私有字段。

connected 如果该服务被连接，则为 true；如果该服务未被连接，则为 false
英文文档：

setConnected

protected void setConnected(boolean connected)
Set the connection state of this service. The connection state will automatically be set by the service implementation during the connect and close methods. Subclasses will need to call this method to set the state if the service was automatically disconnected.

The implementation in this class merely sets the private field returned by the isConnected method.

Parameters:
connected - true if the service is connected, false if it is not connected

public void close() throws MessagingException
关闭此服务并终止其连接。向所有 ConnectionListener 传送 close ConnectionEvent。在此服务关闭后，所有属于此服务的 Messaging 组件（Folder、Message，等等）都是无效的。注意，即使此方法通过抛出 MessagingException 异常终止，服务也会关闭。

此实现使用 setConnected(false) 将此服务的 connected 状态设置为 false。然后它会向所有注册的 ConnectionListener 发送 close ConnectionEvent。重写此方法以进行特定于实现的清除的子类应该调用此方法，作为确保事件通知的最后一步（可能通过在 finally 子句中包含对 super.close() 的调用来完成）。

Throws | MessagingException: 用于关闭时发生的错误
See also | javax.mail.event.ConnectionEvent
英文文档：

close

public void close()
           throws MessagingException
Close this service and terminate its connection. A close ConnectionEvent is delivered to any ConnectionListeners. Any Messaging components (Folders, Messages, etc.) belonging to this service are invalid after this service is closed. Note that the service is closed even if this method terminates abnormally by throwing a MessagingException.

This implementation uses setConnected(false) to set this service's connected state to false. It will then send a close ConnectionEvent to any registered ConnectionListeners. Subclasses overriding this method to do implementation specific cleanup should call this method as a last step to insure event notification, probably by including a call to super.close() in a finally clause.

Throws:
MessagingException - for errors while closing
See Also:
ConnectionEvent

public URLName getURLName()
返回表示此服务的 URLName。返回的 URLName 不 包括密码字段。

如果 URLName 不符合标准格式，则子类应该仅重写此方法。

Service 类中的实现返回带有已剔除密码和文件信息的 url 字段（通常是其副本）。

return | 表示此服务的 URLName
See also | javax.mail.URLName
英文文档：

getURLName

public URLName getURLName()
Return a URLName representing this service. The returned URLName does not include the password field.

Subclasses should only override this method if their URLName does not follow the standard format.

The implementation in the Service class returns (usually a copy of) the url field with the password and file information stripped out.

Returns:
the URLName representing this service
See Also:
URLName

protected void setURLName(URLName url)
设置表示此服务的 URLName。通常用于在已成功连接某个服务之后更新 url 字段。

如果 URL 不符合标准格式，则子类应该仅重写此方法。尤其是，如果 URL 并不需要 URLName 支持的所有可能字段，则子类应该重写此方法；应该构造移除了所有不需要字段的新的 URLName。

Service 类中的实现仅设置 url 字段。

See also javax.mail.URLName
英文文档：

setURLName

protected void setURLName(URLName url)
Set the URLName representing this service. Normally used to update the url field after a service has successfully connected.

Subclasses should only override this method if their URL does not follow the standard format. In particular, subclasses should override this method if their URL does not require all the possible fields supported by URLName; a new URLName should be constructed with any unneeded fields removed.

The implementation in the Service class simply sets the url field.

See Also:
URLName

public void addConnectionListener(ConnectionListener l)
为此服务上的 Connection 事件添加侦听器。

此处提供的默认实现将此侦听器添加到 ConnectionListener 的内部列表。

l | Connection 事件的 Listener
See also | javax.mail.event.ConnectionEvent
英文文档：

addConnectionListener

public void addConnectionListener(ConnectionListener l)
Add a listener for Connection events on this service.

The default implementation provided here adds this listener to an internal list of ConnectionListeners.

Parameters:
l - the Listener for Connection events
See Also:
ConnectionEvent

public void removeConnectionListener(ConnectionListener l)
移除 Connection 事件侦听器。

此处提供的默认实现将从 ConnectionListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addConnectionListener
英文文档：

removeConnectionListener

public void removeConnectionListener(ConnectionListener l)
Remove a Connection event listener.

The default implementation provided here removes this listener from the internal list of ConnectionListeners.

Parameters:
l - the listener
See Also:
addConnectionListener(javax.mail.event.ConnectionListener)

protected void notifyConnectionListeners(int type)
通知所有 ConnectionListener。服务实现应该使用此方法广播 Connection 事件。

提供的默认实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 ConnectionListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

英文文档：

notifyConnectionListeners

protected void notifyConnectionListeners(int type)
Notify all ConnectionListeners. Service implementations are expected to use this method to broadcast connection events.

The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered ConnectionListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

public String toString()
如果此服务有 URLName，则返回 getURLName.toString()；否则将返回默认 toString。
英文文档：

toString

public String toString()
Return getURLName.toString() if this service has a URLName, otherwise it will return the default toString.

Overrides:
toString in class Object

protected void queueEvent(MailEvent event, java.util.Vector<E> vector)
将侦听器的事件和向量添加到将要传送的队列。
英文文档：

queueEvent

protected void queueEvent(MailEvent event,
                          Vector vector)
Add the event and vector of listeners to the queue to be delivered.

protected void finalize() throws Throwable
停止事件分发程序线程，这样可以对队列进行垃圾回收。
英文文档：

finalize

protected void finalize()
                 throws Throwable
Stop the event dispatcher thread so the queue can be garbage collected.

Overrides:
finalize in class Object
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Session (Java EE 5)

javax.mail
Class Session

java.lang.Object
    extended by  javax.mail.Session

public final class Session
extends Object

Session 类表示邮件会话，无法为 Session 类创建子类。它将邮件 API 使用的属性和默认值收集在一起。桌面上的多个应用程序可共享一个默认会话。也可以创建非共享的会话。

Session 类提供对实现 Store、Transport 和相关类的协议提供者的访问。协议提供者是使用以下文件配置的：

  • javamail.providers 和 javamail.default.providers
  • javamail.address.map 和 javamail.default.address.map

按以下顺序使用三个方法搜索每个 javamail.X 资源文件：

  1. java.home/lib/javamail.X
  2. META-INF/javamail.X
  3. META-INF/javamail.default.X

第一种方法允许用户包含自己的资源文件版本，实现方式是将资源文件放在 java.home 属性指向的 lib 目录中。第二种方法允许使用 JavaMail API 的应用程序在其应用程序或 jar 文件的 META-INF 目录中包含自己的资源文件。javamail.default.X 默认文件是 JavaMail mail.jar 文件的一部分。

文件位置取决于 ClassLoader 方法 getResource 的实现方式。通常，getResource 方法会搜索整个 CLASSPATH，直到找到请求的文件，然后停止。JDK 1.1 对将要在 CLASSPATH 中找到的每个名称的文件数有所限制，该文件数被限制为 1。但是，这只会影响上述的方法二；方法一是从特定位置加载的（如果 SecurityManager 允许）；而方法三使用不同的名称以确保默认资源文件总是能成功加载。J2SE 1.2 和以后的版本都未将给定名称的文件数限制为 1。

资源文件中条目的排序非常重要。如果存在多个条目，则第一个条目优先于后面的条目。例如，找到的第一个 IMAP 提供者将会被设置为默认 IMAP 实现，直到被应用程序显式更改为止。用户或系统提供的资源文件扩充（它们不会重写）JavaMail API 包含的默认文件。这意味着所有已加载文件中的所有条目都将是可用的。

javamail.providers 和 javamail.default.providers

这些资源文件指定系统上可用的 store 和 transport，同时允许应用程序“发现”哪些 store 和 transport 实现是可用的。协议实现以每行一个的形式列出。该文件格式定义了四个描述协议实现的属性。每个属性都是一个用 "=" 分隔的名称-值对，其中名称为小写。每个名称-值对都是由分号 (";") 分隔的。定义了以下名称。

提供者文件中的属性名称
名称 | 描述
protocol | 为协议分配的名称。例如，为 Transport 分配的名称为 smtp。
type | 有效条目是 store 和 transport。
class | 实现此协议的类名称。
vendor | 标识供应商的可选字符串。
version | 标识版本的可选字符串。

以下是 META-INF/javamail.default.providers 文件内容的示例：

protocol=imap; type=store; class=com.sun.mail.imap.IMAPStore; vendor=Sun Microsystems, Inc.;
protocol=smtp; type=transport; class=com.sun.mail.smtp.SMTPTransport; vendor=Sun Microsystems, Inc.;

javamail.address.map 和 javamail.default.address.map

这些资源文件将传输地址类型映射到传输协议。javax.mail.Address 的 getType 方法返回地址类型。javamail.address.map 文件将传输类型映射到协议。该文件格式是一系列名称-值对。每个键名都应该与系统上当前安装的地址类型相对应；还应该有条目用于存在的每个 javax.mail.Address 实现（如果要使用该实现的话）。例如，javax.mail.internet.InternetAddress 方法 getType 返回 "rfc822"。每个引用的协议都应该安装在系统上。对于下面的 news 例子，客户端应该安装支持 nntp 协议的 Transport 提供者。

以下是 javamail.address.map 文件通常的内容：

rfc822=smtp
news=nntp
version 1.76, 07/05/04
英文文档：

The Session class represents a mail session and is not subclassed. It collects together properties and defaults used by the mail API's. A single default session can be shared by multiple applications on the desktop. Unshared sessions can also be created.

The Session class provides access to the protocol providers that implement the Store, Transport, and related classes. The protocol providers are configured using the following files:

  • javamail.providers and javamail.default.providers
  • javamail.address.map and javamail.default.address.map

Each javamail.X resource file is searched for using three methods in the following order:

  1. java.home/lib/javamail.X
  2. META-INF/javamail.X
  3. META-INF/javamail.default.X

The first method allows the user to include their own version of the resource file by placing it in the lib directory where the java.home property points. The second method allows an application that uses the JavaMail APIs to include their own resource files in their application's or jar file's META-INF directory. The javamail.default.X default files are part of the JavaMail mail.jar file.

File location depends upon how the ClassLoader method getResource is implemented. Usually, the getResource method searches through CLASSPATH until it finds the requested file and then stops. JDK 1.1 has a limitation that the number of files of each name that will be found in the CLASSPATH is limited to one. However, this only affects method two, above; method one is loaded from a specific location (if allowed by the SecurityManager) and method three uses a different name to ensure that the default resource file is always loaded successfully. J2SE 1.2 and later are not limited to one file of a given name.

The ordering of entries in the resource files matters. If multiple entries exist, the first entries take precedence over the later entries. For example, the first IMAP provider found will be set as the default IMAP implementation until explicitly changed by the application. The user- or system-supplied resource files augment, they do not override, the default files included with the JavaMail APIs. This means that all entries in all files loaded will be available.

javamail.providers and javamail.default.providers

These resource files specify the stores and transports that are available on the system, allowing an application to "discover" what store and transport implementations are available. The protocol implementations are listed one per line. The file format defines four attributes that describe a protocol implementation. Each attribute is an "="-separated name-value pair with the name in lowercase. Each name-value pair is semi-colon (";") separated. The following names are defined.

Attribute Names in Providers Files
Name | Description
protocol | Name assigned to protocol. For example, smtp for Transport.
type | Valid entries are store and transport.
class | Class name that implements this protocol.
vendor | Optional string identifying the vendor.
version | Optional string identifying the version.

Here's an example of META-INF/javamail.default.providers file contents:

 protocol=imap; type=store; class=com.sun.mail.imap.IMAPStore; vendor=Sun Microsystems, Inc.;
 protocol=smtp; type=transport; class=com.sun.mail.smtp.SMTPTransport; vendor=Sun Microsystems, Inc.;

javamail.address.map and javamail.default.address.map

These resource files map transport address types to the transport protocol. The getType method of javax.mail.Address returns the address type. The javamail.address.map file maps the transport type to the protocol. The file format is a series of name-value pairs. Each key name should correspond to an address type that is currently installed on the system; there should also be an entry for each javax.mail.Address implementation that is present if it is to be used. For example, the javax.mail.internet.InternetAddress method getType returns "rfc822". Each referenced protocol should be installed on the system. For the case of news, below, the client should install a Transport provider supporting the nntp protocol.

Here are the typical contents of a javamail.address.map file:

 rfc822=smtp
 news=nntp

Version:
1.76, 07/05/04
Author:
John Mani, Bill Shannon, Max Spivak

Method Summary
void | addProvider(Provider provider) Add a provider to the session.
boolean | getDebug() Get the debug setting for this Session.
PrintStream | getDebugOut() Returns the stream to be used for debugging output.
static Session | getDefaultInstance(Properties props) Get the default Session object.
static Session | getDefaultInstance(Properties props, Authenticator authenticator) Get the default Session object.
Folder | getFolder(URLName url) Get a closed Folder object for the given URLName.
static Session | getInstance(Properties props) Get a new Session object.
static Session | getInstance(Properties props, Authenticator authenticator) Get a new Session object.
PasswordAuthentication | getPasswordAuthentication(URLName url) Return any saved PasswordAuthentication for this (store or transport) URLName.
Properties | getProperties() Returns the Properties object associated with this Session
String | getProperty(String name) Returns the value of the specified property.
Provider | getProvider(String protocol) Returns the default Provider for the protocol specified.
Provider[] | getProviders() This method returns an array of all the implementations installed via the javamail.
Store | getStore() Get a Store object that implements this user's desired Store protocol.
Store | getStore(Provider provider) Get an instance of the store specified by Provider.
Store | getStore(String protocol) Get a Store object that implements the specified protocol.
Store | getStore(URLName url) Get a Store object for the given URLName.
Transport | getTransport() Get a Transport object that implements this user's desired Transport protcol.
Transport | getTransport(Address address) Get a Transport object that can transport a Message to the specified address type.
Transport | getTransport(Provider provider) Get an instance of the transport specified in the Provider.
Transport | getTransport(String protocol) Get a Transport object that implements the specified protocol.
Transport | getTransport(URLName url) Get a Transport object for the given URLName.
PasswordAuthentication | requestPasswordAuthentication(InetAddress addr, int port, String protocol, String prompt, String defaultUserName) Call back to the application to get the needed user name and password.
void | setDebug(boolean debug) Set the debug setting for this Session.
void | setDebugOut(PrintStream out) Set the stream to be used for debugging output for this session.
void | setPasswordAuthentication(URLName url, PasswordAuthentication pw) Save a PasswordAuthentication for this (store or transport) URLName.
void | setProtocolForAddress(String addresstype, String protocol) Set the default transport protocol to use for addresses of the specified type.
void | setProvider(Provider provider) Set the passed Provider to be the default implementation for the protocol in Provider.protocol overriding any previous values.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

public static Session getInstance(java.util.Properties props, Authenticator authenticator)
获取新 Session 对象。
props | 保存相关属性的 Properties 对象。 客户端应该为 JavaMail 规范附录 A 中列出的属性（尤其是 mail.store.protocol、mail.transport.protocol、mail.host、mail.user 和 mail.from）提供值，因为默认值不可能适用于所有情况。
authenticator | 需要用户名和密码时用来回调应用程序的 Authenticator 对象。
return | 新 Session 对象
See also | javax.mail.Authenticator
英文文档：

getInstance

public static Session getInstance(Properties props,
                                  Authenticator authenticator)
Get a new Session object.

Parameters:
props - Properties object that hold relevant properties.
It is expected that the client supplies values for the properties listed in Appendix A of the JavaMail spec (particularly mail.store.protocol, mail.transport.protocol, mail.host, mail.user, and mail.from) as the defaults are unlikely to work in all cases.
authenticator - Authenticator object used to call back to the application when a user name and password is needed.
Returns:
a new Session object
See Also:
Authenticator

public static Session getInstance(java.util.Properties props)
获取新 Session 对象。
props 保存相关属性的 Properties 对象。
客户端应该为 JavaMail 规范附录 A 中列出的属性（尤其是 mail.store.protocol、mail.transport.protocol、mail.host、mail.user 和 mail.from）提供值，因为默认值不可能适用于所有情况。
return 新 Session 对象
since
en
JavaMail 1.2
英文文档：

getInstance

public static Session getInstance(Properties props)
Get a new Session object.

Parameters:
props - Properties object that hold relevant properties.
It is expected that the client supplies values for the properties listed in Appendix A of the JavaMail spec (particularly mail.store.protocol, mail.transport.protocol, mail.host, mail.user, and mail.from) as the defaults are unlikely to work in all cases.
Returns:
a new Session object
Since:
JavaMail 1.2

public static Session getDefaultInstance(java.util.Properties props, Authenticator authenticator)
获取默认 Session 对象。如果还没有设置默认对象，则将创建一个新 Session 对象，并将其作为默认对象安装。

由于默认会话可能对同一 Java 虚拟机上正在执行的所有代码都可用，并且该会话可能包含安全性敏感信息，比如用户名和密码，因此对默认会话的访问是受限制的。Authenticator 对象（必须由调用者创建）间接用于检查访问权限。将创建会话时传入的 Authenticator 对象与给后续请求传入的 Authenticator 对象进行比较以获得默认会话。如果两个对象是相同的，或者它们来自相同的 ClassLoader，则允许请求。否则，拒绝它。

注意，如果用于创建会话的 Authenticator 对象为 null，则任何人都可以通过传入 null 获得默认会话。

还要注意，创建新 Session 对象时，Properties 对象仅在第一次调用此方法时使用。后续调用返回第一次调用创建的 Session 对象，并忽略传递的 Properties 对象。每次调用 getInstance 方法时，都可以使用该方法获取一个新 Session 对象。

在 JDK 1.2 中，可能会使用其他安全性 Permission 对象控制对默认会话的访问。

props | Properties 对象。仅在创建新 Session 对象时使用。 客户端应该为 JavaMail 规范附录 A 中列出的属性（尤其是 mail.store.protocol、mail.transport.protocol、mail.host、mail.user 和 mail.from）提供值，因为默认值不可能适用于所有情况。
authenticator | Authenticator 对象。仅在创建新 Session 对象时使用。否则，它必须与用于创建 Session 的 Authenticator 匹配。
return | 默认 Session 对象
英文文档：

getDefaultInstance

public static Session getDefaultInstance(Properties props,
                                         Authenticator authenticator)
Get the default Session object. If a default has not yet been setup, a new Session object is created and installed as the default.

Since the default session is potentially available to all code executing in the same Java virtual machine, and the session can contain security sensitive information such as user names and passwords, access to the default session is restricted. The Authenticator object, which must be created by the caller, is used indirectly to check access permission. The Authenticator object passed in when the session is created is compared with the Authenticator object passed in to subsequent requests to get the default session. If both objects are the same, or are from the same ClassLoader, the request is allowed. Otherwise, it is denied.

Note that if the Authenticator object used to create the session is null, anyone can get the default session by passing in null.

Note also that the Properties object is used only the first time this method is called, when a new Session object is created. Subsequent calls return the Session object that was created by the first call, and ignore the passed Properties object. Use the getInstance method to get a new Session object every time the method is called.

In JDK 1.2, additional security Permission objects may be used to control access to the default session.

Parameters:
props - Properties object. Used only if a new Session object is created.
It is expected that the client supplies values for the properties listed in Appendix A of the JavaMail spec (particularly mail.store.protocol, mail.transport.protocol, mail.host, mail.user, and mail.from) as the defaults are unlikely to work in all cases.
authenticator - Authenticator object. Used only if a new Session object is created. Otherwise, it must match the Authenticator used to create the Session.
Returns:
the default Session object

public static Session getDefaultInstance(java.util.Properties props)
获取默认 Session 对象。如果没有设置默认对象，则将创建一个新 Session 对象，并将其作为默认对象安装。

注意，未使用 Authenticator 创建的默认会话对同一 Java 虚拟机上正在执行的所有代码都可用，并且该会话可能包含安全性敏感信息，比如用户名和密码。

props Properties 对象。仅在创建新 Session 对象时使用。
客户端应该为 JavaMail 规范附录 A 中列出的属性（尤其是 mail.store.protocol、mail.transport.protocol、mail.host、mail.user 和 mail.from）提供值，因为默认值不可能适用于所有情况。
return 默认 Session 对象
since
en
JavaMail 1.2
英文文档：

getDefaultInstance

public static Session getDefaultInstance(Properties props)
Get the default Session object. If a default has not yet been setup, a new Session object is created and installed as the default.

Note that a default session created with no Authenticator is available to all code executing in the same Java virtual machine, and the session can contain security sensitive information such as user names and passwords.

Parameters:
props - Properties object. Used only if a new Session object is created.
It is expected that the client supplies values for the properties listed in Appendix A of the JavaMail spec (particularly mail.store.protocol, mail.transport.protocol, mail.host, mail.user, and mail.from) as the defaults are unlikely to work in all cases.
Returns:
the default Session object
Since:
JavaMail 1.2

public void setDebug(boolean debug)
设置此 Session 的调试设置。

由于调试设置仅在已创建 Session 后开启，因此要开启 Session 构造方法中的调试，需要将传入构造方法的 Properties 对象中的属性 mail.debug 设置为 true。mail.debug 属性的值用于初始化每个 Session 的调试标志。对 setDebug 方法的后续调用可操作每个 Session 的调试标志，并且对 mail.debug 属性没有任何影响。

debug 调试设置
英文文档：

setDebug

public void setDebug(boolean debug)
Set the debug setting for this Session.

Since the debug setting can be turned on only after the Session has been created, to turn on debugging in the Session constructor, set the property mail.debug in the Properties object passed in to the constructor to true. The value of the mail.debug property is used to initialize the per-Session debugging flag. Subsequent calls to the setDebug method manipulate the per-Session debugging flag and have no affect on the mail.debug property.

Parameters:
debug - Debug setting

public boolean getDebug()
获取此 Session 的调试设置。
return 当前调试设置
英文文档：

getDebug

public boolean getDebug()
Get the debug setting for this Session.

Returns:
current debug setting

public void setDebugOut(java.io.PrintStream out)
设置用于此会话调试输出的流。如果 out 为 null，则将使用 System.out。注意，创建会话之前发生的调试输出将总是发送到 System.out，这是设置 mail.debug 系统属性的结果。
out 用于调试输出的 PrintStream
since
en
JavaMail 1.3
英文文档：

setDebugOut

public void setDebugOut(PrintStream out)
Set the stream to be used for debugging output for this session. If out is null, System.out will be used. Note that debugging output that occurs before any session is created, as a result of setting the mail.debug system property, will always be sent to System.out.

Parameters:
out - the PrintStream to use for debugging output
Since:
JavaMail 1.3

public java.io.PrintStream getDebugOut()
返回用于调试输出的流。如果没有设置流，则返回 System.out。
return 用于调试输出的 PrintStream
since
en
JavaMail 1.3
英文文档：

getDebugOut

public PrintStream getDebugOut()
Returns the stream to be used for debugging output. If no stream has been set, System.out is returned.

Returns:
the PrintStream to use for debugging output
Since:
JavaMail 1.3

public Provider[] getProviders()
此方法返回通过 javamail.[default.]providers 文件安装的所有实现的数组，可以使用此应用程序可用的 ClassLoader 加载这些文件。
return 已配置的提供者的数组
英文文档：

getProviders

public Provider[] getProviders()
This method returns an array of all the implementations installed via the javamail.[default.]providers files that can be loaded using the ClassLoader available to this application.

Returns:
Array of configured providers

public Provider getProvider(String protocol) throws NoSuchProviderException
返回指定协议的默认 Provider。首先检查 mail.<protocol>.class 属性，如果该属性存在，则返回与此实现关联的 Provider。如果该属性不存在，则返回配置文件中出现的第一个 Provider。如果未找到该协议的实现，则抛出 NoSuchProviderException。
protocol | 已配置的协议（即 smtp、imap，等等)
return | 当前已为指定协议配置的 Provider
Throws | NoSuchProviderException: 如果未找到给定协议的提供者。
英文文档：

getProvider

public Provider getProvider(String protocol)
                     throws NoSuchProviderException
Returns the default Provider for the protocol specified. Checks mail.<protocol>.class property first and if it exists, returns the Provider associated with this implementation. If it doesn't exist, returns the Provider that appeared first in the configuration files. If an implementation for the protocol isn't found, throws NoSuchProviderException

Parameters:
protocol - Configured protocol (i.e. smtp, imap, etc)
Returns:
Currently configured Provider for the specified protocol
Throws:
NoSuchProviderException - If a provider for the given protocol is not found.

public void setProvider(Provider provider) throws NoSuchProviderException
将传递的 Provider 设置为 Provider.protocol 中协议的默认实现，同时重写所有以前的值。
provider | 当前配置的 Provider，它将被设置为协议的默认实现
Throws | NoSuchProviderException: 如果传入的提供者无效。
英文文档：

setProvider

public void setProvider(Provider provider)
                 throws NoSuchProviderException
Set the passed Provider to be the default implementation for the protocol in Provider.protocol overriding any previous values.

Parameters:
provider - Currently configured Provider which will be set as the default for the protocol
Throws:
NoSuchProviderException - If the provider passed in is invalid.

public Store getStore() throws NoSuchProviderException
获取实现此用户所需的 Store 协议的 Store 对象。mail.store.protocol 属性指定所需协议。如果没有获得适当的 Store 对象，则抛出 NoSuchProviderException。
return | Store 对象
Throws | NoSuchProviderException: 如果未找到给定协议的提供者。
英文文档：

getStore

public Store getStore()
               throws NoSuchProviderException
Get a Store object that implements this user's desired Store protocol. The mail.store.protocol property specifies the desired protocol. If an appropriate Store object is not obtained, NoSuchProviderException is thrown

Returns:
a Store object
Throws:
NoSuchProviderException - If a provider for the given protocol is not found.

public Store getStore(String protocol) throws NoSuchProviderException
获取实现指定协议的 Store 对象。如果无法获得适当的 Store 对象，则抛出 NoSuchProviderException。
protocol |
return | Store 对象
Throws | NoSuchProviderException: 如果未找到给定协议的提供者。
英文文档：

getStore

public Store getStore(String protocol)
               throws NoSuchProviderException
Get a Store object that implements the specified protocol. If an appropriate Store object cannot be obtained, NoSuchProviderException is thrown.

Parameters:
protocol -
Returns:
a Store object
Throws:
NoSuchProviderException - If a provider for the given protocol is not found.

public Store getStore(URLName url) throws NoSuchProviderException
获取给定 URLName 的 Store 对象。如果无法获得请求的 Store 对象，则抛出 NoSuchProviderException。 使用 URL 字符串的 "scheme" 部分（请参考 RFC 1738）定位 Store 协议。

url | 表示所需 Store 的 URLName
return | 关闭的 Store 对象
Throws | NoSuchProviderException: 如果未找到给定 URLName 的提供者。
See also | getFolder(URLName), javax.mail.URLName
英文文档：

getStore

public Store getStore(URLName url)
               throws NoSuchProviderException
Get a Store object for the given URLName. If the requested Store object cannot be obtained, NoSuchProviderException is thrown. The "scheme" part of the URL string (Refer RFC 1738) is used to locate the Store protocol.

Parameters:
url - URLName that represents the desired Store
Returns:
a closed Store object
Throws:
NoSuchProviderException - If a provider for the given URLName is not found.
See Also:
getFolder(URLName), URLName

public Store getStore(Provider provider) throws NoSuchProviderException
获取 Provider 指定的 store 的实例。实例化该 store 并将其返回。
provider | 将被实例化的 Store Provider
return | 实例化的 Store
Throws | NoSuchProviderException: 如果未找到给定 Provider 的提供者。
英文文档：

getStore

public Store getStore(Provider provider)
               throws NoSuchProviderException
Get an instance of the store specified by Provider. Instantiates the store and returns it.

Parameters:
provider - Store Provider that will be instantiated
Returns:
Instantiated Store
Throws:
NoSuchProviderException - If a provider for the given Provider is not found.

public Folder getFolder(URLName url) throws MessagingException
获取给定 URLName 的关闭的 Folder 对象。如果无法获得请求的 Folder 对象，则返回 null。

使用 URL 字符串的 "scheme" 部分（请参考 RFC 1738）定位 Store 协议。该 Store 使用 URL 字符串的剩余部分（根据 RFC 1738，这部分是 "schemepart"），以与协议相关的方式定位和实例化相应的 Folder 对象。

注意，RFC 1738 还指定了基于 IP 的协议（IMAP4、POP3，等等）的 "schemepart" 的语法。基于 IP 的邮件 Store 的 Provider 应该实现该语法来引用 Folder。

url | 表示所需文件夹的 URLName
return
en
Folder
Throws | NoSuchProviderException: 如果未找到给定 URLName 的提供者。
Throws | MessagingException: 如果无法定位或创建 Folder。
See also | getStore(URLName), javax.mail.URLName
英文文档：

getFolder

public Folder getFolder(URLName url)
                 throws MessagingException
Get a closed Folder object for the given URLName. If the requested Folder object cannot be obtained, null is returned.

The "scheme" part of the URL string (Refer RFC 1738) is used to locate the Store protocol. The rest of the URL string (that is, the "schemepart", as per RFC 1738) is used by that Store in a protocol dependent manner to locate and instantiate the appropriate Folder object.

Note that RFC 1738 also specifies the syntax for the "schemepart" for IP-based protocols (IMAP4, POP3, etc.). Providers of IP-based mail Stores should implement that syntax for referring to Folders.

Parameters:
url - URLName that represents the desired folder
Returns:
Folder
Throws:
NoSuchProviderException - If a provider for the given URLName is not found.
MessagingException - if the Folder could not be located or created.
See Also:
getStore(URLName), URLName

public Transport getTransport() throws NoSuchProviderException
获取实现此用户所需的 Transport 协议的 Transport 对象。mail.transport.protocol 属性指定所需协议。如果无法获得适当的 Transport 对象，则抛出 MessagingException。
return | Transport 对象
Throws | NoSuchProviderException: 如果未找到提供者。
英文文档：

getTransport

public Transport getTransport()
                       throws NoSuchProviderException
Get a Transport object that implements this user's desired Transport protcol. The mail.transport.protocol property specifies the desired protocol. If an appropriate Transport object cannot be obtained, MessagingException is thrown.

Returns:
a Transport object
Throws:
NoSuchProviderException - If the provider is not found.

public Transport getTransport(String protocol) throws NoSuchProviderException
获取实现指定协议的 Transport 对象。如果无法获得适当的 Transport 对象，则返回 null。
return | Transport 对象
Throws | NoSuchProviderException: 如果未找到给定协议的提供者。
英文文档：

getTransport

public Transport getTransport(String protocol)
                       throws NoSuchProviderException
Get a Transport object that implements the specified protocol. If an appropriate Transport object cannot be obtained, null is returned.

Returns:
a Transport object
Throws:
NoSuchProviderException - If provider for the given protocol is not found.

public Transport getTransport(URLName url) throws NoSuchProviderException
获取给定 URLName 的 Transport 对象。如果无法获得请求的 Transport 对象，则抛出 NoSuchProviderException。 使用 URL 字符串的 "scheme" 部分（请参考 RFC 1738）定位 Transport 协议。

url | 表示所需 Transport 的 URLName
return | 关闭的 Transport 对象
Throws | NoSuchProviderException: 如果未找到给定 URLName 的提供者。
See also | javax.mail.URLName
英文文档：

getTransport

public Transport getTransport(URLName url)
                       throws NoSuchProviderException
Get a Transport object for the given URLName. If the requested Transport object cannot be obtained, NoSuchProviderException is thrown. The "scheme" part of the URL string (Refer RFC 1738) is used to locate the Transport protocol.

Parameters:
url - URLName that represents the desired Transport
Returns:
a closed Transport object
Throws:
NoSuchProviderException - If a provider for the given URLName is not found.
See Also:
URLName

public Transport getTransport(Provider provider) throws NoSuchProviderException
获取 Provider 中指定的 transport 的实例。实例化该 transport 并将其返回。
provider | 将被实例化的 Transport Provider
return | 实例化的 Transport
Throws | NoSuchProviderException: 如果未找到给定 Provider 的提供者。
英文文档：

getTransport

public Transport getTransport(Provider provider)
                       throws NoSuchProviderException
Get an instance of the transport specified in the Provider. Instantiates the transport and returns it.

Parameters:
provider - Transport Provider that will be instantiated
Returns:
Instantiated Transport
Throws:
NoSuchProviderException - If provider for the given provider is not found.

public Transport getTransport(Address address) throws NoSuchProviderException
获取可将 Message 传输到指定地址类型的 Transport 对象。
address |
return | Transport 对象
Throws | NoSuchProviderException: 如果未找到 Address 类型的提供者。
See also | javax.mail.Address
英文文档：

getTransport

public Transport getTransport(Address address)
                       throws NoSuchProviderException
Get a Transport object that can transport a Message to the specified address type.

Parameters:
address -
Returns:
A Transport object
Throws:
NoSuchProviderException - If provider for the Address type is not found
See Also:
Address

public void setPasswordAuthentication(URLName url, PasswordAuthentication pw)
保存此（store 或 transport）URLName 的 PasswordAuthentication。如果 pw 为 null，则移除与该 URLName 对应的条目。

这通常仅供 store 或 transport 实现使用，以允许在某个会话的多次使用之间共享验证信息。

英文文档：

setPasswordAuthentication

public void setPasswordAuthentication(URLName url,
                                      PasswordAuthentication pw)
Save a PasswordAuthentication for this (store or transport) URLName. If pw is null the entry corresponding to the URLName is removed.

This is normally used only by the store or transport implementations to allow authentication information to be shared among multiple uses of a session.

public PasswordAuthentication getPasswordAuthentication(URLName url)
返回此（store 或 transport）URLName 保存的任何 PasswordAuthentication。通常仅供 store 或 transport 实现使用。
return 与该 URLName 对应的 PasswordAuthentication
英文文档：

getPasswordAuthentication

public PasswordAuthentication getPasswordAuthentication(URLName url)
Return any saved PasswordAuthentication for this (store or transport) URLName. Normally used only by store or transport implementations.

Returns:
the PasswordAuthentication corresponding to the URLName

public PasswordAuthentication requestPasswordAuthentication(java.net.InetAddress addr, int port, String protocol, String prompt, String defaultUserName)
回调应用程序以获取所需的用户名和密码。应用程序应该提供一个对话框，类似于：

Connecting to <protocol> mail service on host <addr>, port <port>.
<prompt>

User Name:<defaultUserName>
Password:

addr | 主机的 InetAddress。可以为 null。
protocol | 协议方案（比如 imap、pop3，等等）
prompt | 作为提示一部分显示的其他所有 String；可以为 null。
defaultUserName | 默认用户名。可以为 null。
return | authenticator 收集的验证；可以为 null。
英文文档：

requestPasswordAuthentication

public PasswordAuthentication requestPasswordAuthentication(InetAddress addr,
                                                            int port,
                                                            String protocol,
                                                            String prompt,
                                                            String defaultUserName)
Call back to the application to get the needed user name and password. The application should put up a dialog something like:

 Connecting to <protocol> mail service on host <addr>, port <port>.
 <prompt>

 User Name: <defaultUserName>
 Password:

Parameters:
addr - InetAddress of the host. may be null.
protocol - protocol scheme (e.g. imap, pop3, etc.)
prompt - any additional String to show as part of the prompt; may be null.
defaultUserName - the default username. may be null.
Returns:
the authentication which was collected by the authenticator; may be null.

public java.util.Properties getProperties()
返回与此 Session 关联的 Properties 对象。
return Properties 对象
英文文档：

getProperties

public Properties getProperties()
Returns the Properties object associated with this Session

Returns:
Properties object

public String getProperty(String name)
返回指定属性的值。如果此属性不存在，则返回 null。
return 作为属性值的字符串
英文文档：

getProperty

public String getProperty(String name)
Returns the value of the specified property. Returns null if this property does not exist.

Returns:
String that is the property value

public void addProvider(Provider provider)
向会话添加提供者。
provider 要添加的提供者
since
en
JavaMail 1.4
英文文档：

addProvider

public void addProvider(Provider provider)
Add a provider to the session.

Parameters:
provider - the provider to add
Since:
JavaMail 1.4

public void setProtocolForAddress(String addresstype, String protocol)
设置用于指定类型地址的默认传输协议。默认值通常由 javamail.default.address.map 或 javamail.address.map 文件或资源设置。
addresstype | 地址类型
protocol | 协议名称
since
en
JavaMail 1.4
See also | getTransport(Address)
英文文档：

setProtocolForAddress

public void setProtocolForAddress(String addresstype,
                                  String protocol)
Set the default transport protocol to use for addresses of the specified type. Normally the default is set by the javamail.default.address.map or javamail.address.map files or resources.

Parameters:
addresstype - type of address
protocol - name of protocol
Since:
JavaMail 1.4
See Also:
getTransport(Address)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Store (Java EE 5)

javax.mail
Class Store

java.lang.Object
    extended by  javax.mail.Service
        extended by  javax.mail.Store

public abstract class Store
extends Service

Extends: Service

模拟消息存储及其访问协议的抽象类，用于存储和获取消息。子类提供实际实现。

注意，Store 扩展了 Service 类，该类提供了许多用于命名 store、连接 store 和侦听连接事件的常用方法。

version | 1.28, 07/05/04
See also | javax.mail.Service, javax.mail.event.ConnectionEvent, javax.mail.event.StoreEvent
英文文档：

An abstract class that models a message store and its access protocol, for storing and retrieving messages. Subclasses provide actual implementations.

Note that Store extends the Service class, which provides many common methods for naming stores, connecting to stores, and listening to connection events.

Version:
1.28, 07/05/04
Author:
John Mani, Bill Shannon
See Also:
Service, ConnectionEvent, StoreEvent

Field Summary
Fields inherited from class javax.mail.Service
debug, session, url
Constructor Summary
protected Store(Session session, URLName urlname)
Constructor.
Method Summary
void | addFolderListener(FolderListener l) Add a listener for Folder events on any Folder object obtained from this Store.
void | addStoreListener(StoreListener l) Add a listener for StoreEvents on this Store.
abstract Folder | getDefaultFolder() Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.
abstract Folder | getFolder(String name) Return the Folder object corresponding to the given name.
abstract Folder | getFolder(URLName url) Return a closed Folder object, corresponding to the given URLName.
Folder[] | getPersonalNamespaces() Return a set of folders representing the personal namespaces for the current user.
Folder[] | getSharedNamespaces() Return a set of folders representing the shared namespaces.
Folder[] | getUserNamespaces(String user) Return a set of folders representing the namespaces for user.
protected void | notifyFolderListeners(int type, Folder folder) Notify all FolderListeners.
protected void | notifyFolderRenamedListeners(Folder oldF, Folder newF) Notify all FolderListeners about the renaming of a folder.
protected void | notifyStoreListeners(int type, String message) Notify all StoreListeners.
void | removeFolderListener(FolderListener l) Remove a listener for Folder events.
void | removeStoreListener(StoreListener l) Remove a listener for Store events.
Methods inherited from class javax.mail.Service
addConnectionListener, close, connect, connect, connect, connect, finalize, getURLName, isConnected, notifyConnectionListeners, protocolConnect, queueEvent, removeConnectionListener, setConnected, setURLName, toString
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

protected Store(Session session, URLName urlname)
构造方法。
session | 此 Store 的 Session 对象。
urlname | 要用于此 Store 的 URLName 对象
英文文档：

Store

protected Store(Session session,
                URLName urlname)
Constructor.

Parameters:
session - Session object for this Store.
urlname - URLName object to be used for this Store
Method Detail

abstract public Folder getDefaultFolder() throws MessagingException
返回表示 Store 呈现给用户的默认名称空间的“根”的 Folder 对象。
return | 根 Folder
Throws | IllegalStateException: 如果未连接此 Store。
英文文档：

getDefaultFolder

public abstract Folder getDefaultFolder()
                                 throws MessagingException
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.

Returns:
the root Folder
Throws:
IllegalStateException - if this Store is not connected.
MessagingException

abstract public Folder getFolder(String name) throws MessagingException
返回与给定名称相对应的 Folder 对象。注意，即使指定文件夹在物理上并不存在于该 Store 之上，也会返回一个 Folder 对象。该 Folder 对象上的 exists() 方法指示此文件夹是否实际存在。

Store 不缓存 Folder 对象，因此用相同的名称多次调用此方法将返回许多不同的 Folder 对象。

name | Folder 的名称。在某些 Store 中，名称可以是绝对路径，如果它以层次结构分界符开始。否则它将被解释为相对于此名称空间“根”的路径。
return | Folder 对象
Throws | IllegalStateException: 如果未连接此 Store。
See also | exists, create
英文文档：

getFolder

public abstract Folder getFolder(String name)
                          throws MessagingException
Return the Folder object corresponding to the given name. Note that a Folder object is returned even if the named folder does not physically exist on the Store. The exists() method on the folder object indicates whether this folder really exists.

Folder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct Folder objects.

Parameters:
name - The name of the Folder. In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Else it is interpreted relative to the 'root' of this namespace.
Returns:
Folder object
Throws:
IllegalStateException - if this Store is not connected.
MessagingException
See Also:
Folder.exists(), Folder.create(int)

abstract public Folder getFolder(URLName url) throws MessagingException
返回与给定 URLName 相对应的已关闭 Folder 对象。给定 URLName 中指定的 store 应该引用此 Store 对象。

此方法的实现可使用 URLName 上的 getFile() 方法获得实际文件夹的名称，并使用该名称创建该文件夹。

url | 表示文件夹的 URLName
Throws | IllegalStateException: 如果未连接此 Store。
return | Folder 对象
See also | javax.mail.URLName
英文文档：

getFolder

public abstract Folder getFolder(URLName url)
                          throws MessagingException
Return a closed Folder object, corresponding to the given URLName. The store specified in the given URLName should refer to this Store object.

Implementations of this method may obtain the name of the actual folder using the getFile() method on URLName, and use that name to create the folder.

Parameters:
url - URLName that denotes a folder
Returns:
Folder object
Throws:
IllegalStateException - if this Store is not connected.
MessagingException
See Also:
URLName

public Folder[] getPersonalNamespaces() throws MessagingException
返回表示当前用户的个人 名称空间的文件夹集合。个人名称空间是被认为存在于经过验证用户的个人范围内的名称集合。通常，只有经过验证的用户能够访问其个人名称空间中的邮件文件夹。如果用户存在 INBOX，则它必须出现在该用户的个人名称空间中。一般情况下，每个 Store 中的每个用户都应该只有一个个人名称空间。

此实现返回一个带有单个条目的数组，该条目包含 getDefaultFolder 方法的返回值。子类应该重写此方法，以返回相应的信息。

Throws | IllegalStateException: 如果未连接此 Store。
return | Folder 对象数组
since
en
JavaMail 1.2
英文文档：

getPersonalNamespaces

public Folder[] getPersonalNamespaces()
                               throws MessagingException
Return a set of folders representing the personal namespaces for the current user. A personal namespace is a set of names that is considered within the personal scope of the authenticated user. Typically, only the authenticated user has access to mail folders in their personal namespace. If an INBOX exists for a user, it must appear within the user's personal namespace. In the typical case, there should be only one personal namespace for each user in each Store.

This implementation returns an array with a single entry containing the return value of the getDefaultFolder method. Subclasses should override this method to return appropriate information.

Returns:
array of Folder objects
Throws:
IllegalStateException - if this Store is not connected.
MessagingException
Since:
JavaMail 1.2

public Folder[] getUserNamespaces(String user) throws MessagingException
返回表示 user 的名称空间的文件夹集合。返回的名称空间表示该用户的个人名称空间。要访问其他用户的名称空间中的邮件文件夹，必须得到目前经过验证的用户显式授予的访问权。例如，对于经理而言，通常要为其秘书授予对其邮件文件夹的访问权。

此实现返回一个空数组。子类应该重写此方法，以返回相应的信息。

Throws | IllegalStateException: 如果未连接此 Store。
return | Folder 对象数组
since
en
JavaMail 1.2
英文文档：

getUserNamespaces

public Folder[] getUserNamespaces(String user)
                           throws MessagingException
Return a set of folders representing the namespaces for user. The namespaces returned represent the personal namespaces for the user. To access mail folders in the other user's namespace, the currently authenticated user must be explicitly granted access rights. For example, it is common for a manager to grant to their secretary access rights to their mail folders.

This implementation returns an empty array. Subclasses should override this method to return appropriate information.

Returns:
array of Folder objects
Throws:
IllegalStateException - if this Store is not connected.
MessagingException
Since:
JavaMail 1.2

public Folder[] getSharedNamespaces() throws MessagingException
返回表示共享 名称空间的文件夹集合。共享名称空间是由打算在用户之间共享且不存在于用户的个人名称空间中的邮件文件夹组成的名称空间。

此实现返回一个空数组。子类应该重写此方法，以返回相应的信息。

Throws | IllegalStateException: 如果未连接此 Store。
return | Folder 对象数组
since
en
JavaMail 1.2
英文文档：

getSharedNamespaces

public Folder[] getSharedNamespaces()
                             throws MessagingException
Return a set of folders representing the shared namespaces. A shared namespace is a namespace that consists of mail folders that are intended to be shared amongst users and do not exist within a user's personal namespace.

This implementation returns an empty array. Subclasses should override this method to return appropriate information.

Returns:
array of Folder objects
Throws:
IllegalStateException - if this Store is not connected.
MessagingException
Since:
JavaMail 1.2

public void addStoreListener(StoreListener l)
为此 Store 上的 StoreEvent 添加侦听器。

此处提供的默认实现将此侦听器添加到 StoreListener 的内部列表。

l | Store 事件的 Listener
See also | javax.mail.event.StoreEvent
英文文档：

addStoreListener

public void addStoreListener(StoreListener l)
Add a listener for StoreEvents on this Store.

The default implementation provided here adds this listener to an internal list of StoreListeners.

Parameters:
l - the Listener for Store events
See Also:
StoreEvent

public void removeStoreListener(StoreListener l)
移除 Store 事件侦听器。

此处提供的默认实现将从 StoreListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addStoreListener
英文文档：

removeStoreListener

public void removeStoreListener(StoreListener l)
Remove a listener for Store events.

The default implementation provided here removes this listener from the internal list of StoreListeners.

Parameters:
l - the listener
See Also:
addStoreListener(javax.mail.event.StoreListener)

protected void notifyStoreListeners(int type, String message)
通知所有 StoreListener。Store 实现应该使用此方法广播 StoreEvent。

提供的默认实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 StoreListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

英文文档：

notifyStoreListeners

protected void notifyStoreListeners(int type,
                                    String message)
Notify all StoreListeners. Store implementations are expected to use this method to broadcast StoreEvents.

The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered StoreListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

public void addFolderListener(FolderListener l)
为从此 Store 中获得的任何 Folder 对象上的 Folder 事件添加侦听器。向受影响的 Folder 上的 FolderListener 以及包含 Store 上的 FolderListener 传送 FolderEvent。

此处提供的默认实现将此侦听器添加到 FolderListener 的内部列表。

l | Folder 事件的 Listener
See also | javax.mail.event.FolderEvent
英文文档：

addFolderListener

public void addFolderListener(FolderListener l)
Add a listener for Folder events on any Folder object obtained from this Store. FolderEvents are delivered to FolderListeners on the affected Folder as well as to FolderListeners on the containing Store.

The default implementation provided here adds this listener to an internal list of FolderListeners.

Parameters:
l - the Listener for Folder events
See Also:
FolderEvent

public void removeFolderListener(FolderListener l)
移除 Folder 事件侦听器。

此处提供的默认实现将从 FolderListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addFolderListener
英文文档：

removeFolderListener

public void removeFolderListener(FolderListener l)
Remove a listener for Folder events.

The default implementation provided here removes this listener from the internal list of FolderListeners.

Parameters:
l - the listener
See Also:
addFolderListener(javax.mail.event.FolderListener)

protected void notifyFolderListeners(int type, Folder folder)
通知所有 FolderListener。Store 实现应该使用此方法广播 Folder 事件。

提供的默认实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 FolderListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

type | FolderEvent 的类型
folder | 受影响的 Folder
See also | notifyFolderRenamedListeners
英文文档：

notifyFolderListeners

protected void notifyFolderListeners(int type,
                                     Folder folder)
Notify all FolderListeners. Store implementations are expected to use this method to broadcast Folder events.

The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered FolderListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

Parameters:
type - type of FolderEvent
folder - affected Folder
See Also:
notifyFolderRenamedListeners(javax.mail.Folder, javax.mail.Folder)

protected void notifyFolderRenamedListeners(Folder oldF, Folder newF)
通知所有 FolderListener 有关文件夹重命名的信息。Store 实现应该使用此方法广播 Folder 事件，指示文件夹的重命名。

提供的默认实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 FolderListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

oldF | 将被重命名的文件夹
newF | 表示新名称的文件夹。
since
en
JavaMail 1.1
英文文档：

notifyFolderRenamedListeners

protected void notifyFolderRenamedListeners(Folder oldF,
                                            Folder newF)
Notify all FolderListeners about the renaming of a folder. Store implementations are expected to use this method to broadcast Folder events indicating the renaming of folders.

The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered FolderListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

Parameters:
oldF - the folder being renamed
newF - the folder representing the new name.
Since:
JavaMail 1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Transport (Java EE 5)

javax.mail
Class Transport

java.lang.Object
    extended by  javax.mail.Service
        extended by  javax.mail.Transport

public abstract class Transport
extends Service

Extends: Service

模拟消息传输的抽象类。子类提供实际实现。

注意，Transport 扩展了 Service 类，该类提供了许多用于命名 transport、连接 transport 和侦听连接事件的常用方法。

version | 1.40, 07/05/17
See also | javax.mail.Service, javax.mail.event.ConnectionEvent, javax.mail.event.TransportEvent
英文文档：

An abstract class that models a message transport. Subclasses provide actual implementations.

Note that Transport extends the Service class, which provides many common methods for naming transports, connecting to transports, and listening to connection events.

Version:
1.40, 07/05/17
Author:
John Mani, Max Spivak, Bill Shannon
See Also:
Service, ConnectionEvent, TransportEvent

Field Summary
Fields inherited from class javax.mail.Service
debug, session, url
Constructor Summary
Transport(Session session, URLName urlname)
Constructor.
Method Summary
void | addTransportListener(TransportListener l) Add a listener for Transport events.
protected void | notifyTransportListeners(int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg) Notify all TransportListeners.
void | removeTransportListener(TransportListener l) Remove a listener for Transport events.
static void | send(Message msg) Send a message.
static void | send(Message msg, Address[] addresses) Send the message to the specified addresses, ignoring any recipients specified in the message itself.
abstract void | sendMessage(Message msg, Address[] addresses) Send the Message to the specified list of addresses.
Methods inherited from class javax.mail.Service
addConnectionListener, close, connect, connect, connect, connect, finalize, getURLName, isConnected, notifyConnectionListeners, protocolConnect, queueEvent, removeConnectionListener, setConnected, setURLName, toString
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public Transport(Session session, URLName urlname)
构造方法。
session | 此 Transport 的 Session 对象。
urlname | 要用于此 Transport 的 URLName 对象
英文文档：

Transport

public Transport(Session session,
                 URLName urlname)
Constructor.

Parameters:
session - Session object for this Transport.
urlname - URLName object to be used for this Transport
Method Detail

public static void send(Message msg) throws MessagingException
发送一条消息。使用对应于每个地址的消息传输，将消息发送到该消息中指定的所有接收方地址（Message 方法 getAllRecipients 返回的地址）。send 方法在发送消息之前对该消息调用 saveChanges 方法。

如果在消息提交期间 Transport 检测到任何无效接收方地址，则抛出 SendFailedException。客户端可通过检查该异常获得有关该失败的更多详细信息。该消息是否仍然成功发送到任何有效地址取决于 Transport 实现。有关更多详细信息，请参见 SendFailedException。还要注意的是，这里的成功并不意味着该消息被成功传送给最终接收方，因为失败可能发生在后面的传送阶段中。一旦 Transport 接受传送给接收方的消息，就应该通过另一个机制（如返回不可传送的消息）向用户报告后面发生的失败。

注意，send 是创建和管理其自身连接的静态方法。忽略且不使用所有与用来调用此方法的任何 Transport 实例关联的连接。应该只使用 Transport.send(msg); 的形式调用此方法，并且决不应该使用实例变量调用此方法。

msg | 要发送的消息
Throws | SendFailedException: 如果无法将消息发送给部分或全部接收方。
Throws | MessagingException:
See also | saveChanges, getAllRecipients, send(Message, Address[]), javax.mail.SendFailedException
英文文档：

send

public static void send(Message msg)
                 throws MessagingException
Send a message. The message will be sent to all recipient addresses specified in the message (as returned from the Message method getAllRecipients), using message transports appropriate to each address. The send method calls the saveChanges method on the message before sending it.

If any of the recipient addresses is detected to be invalid by the Transport during message submission, a SendFailedException is thrown. Clients can get more detail about the failure by examining the exception. Whether or not the message is still sent succesfully to any valid addresses depends on the Transport implementation. See SendFailedException for more details. Note also that success does not imply that the message was delivered to the ultimate recipient, as failures may occur in later stages of delivery. Once a Transport accepts a message for delivery to a recipient, failures that occur later should be reported to the user via another mechanism, such as returning the undeliverable message.

Note that send is a static method that creates and manages its own connection. Any connection associated with any Transport instance used to invoke this method is ignored and not used. This method should only be invoked using the form Transport.send(msg);, and should never be invoked using an instance variable.

Parameters:
msg - the message to send
Throws:
SendFailedException - if the message could not be sent to some or any of the recipients.
MessagingException
See Also:
Message.saveChanges(),
Message.getAllRecipients(),
send(Message, Address[]),
SendFailedException

public static void send(Message msg, Address[] addresses) throws MessagingException
将消息发送到指定地址，同时忽略该消息本身中指定的任何接收方。send 方法在发送消息之前对该消息调用 saveChanges 方法。

msg | 要发送的消息
addresses | 消息要发送到的地址
Throws | SendFailedException: 如果无法将消息发送给部分或全部接收方。
Throws | MessagingException:
See also | saveChanges, send(Message), javax.mail.SendFailedException
英文文档：

send

public static void send(Message msg,
                        Address[] addresses)
                 throws MessagingException
Send the message to the specified addresses, ignoring any recipients specified in the message itself. The send method calls the saveChanges method on the message before sending it.

Parameters:
msg - the message to send
addresses - the addresses to which to send the message
Throws:
SendFailedException - if the message could not be sent to some or any of the recipients.
MessagingException
See Also:
Message.saveChanges(), send(Message), SendFailedException

abstract public void sendMessage(Message msg, Address[] addresses) throws MessagingException
将 Message 发送到指定地址列表。向此 Transport 上注册的所有 TransportListener 传送指示传送状态的相应 TransportEvent。此外，如果存在任何无效地址，则抛出 SendFailedException。该消息是否仍然成功发送到任何有效地址取决于 Transport 实现。

与静态 send 方法不同，sendMessage 方法不 对消息调用 saveChanges 方法；调用者应该这样做。

msg | 将被发送的 Message
addresses | 此消息要发送到的地址的数组
Throws | SendFailedException: 如果由于无效地址导致发送失败。
Throws | MessagingException: 如果连接停用或未处于连接状态
See also | javax.mail.event.TransportEvent
英文文档：

sendMessage

public abstract void sendMessage(Message msg,
                                 Address[] addresses)
                          throws MessagingException
Send the Message to the specified list of addresses. An appropriate TransportEvent indicating the delivery status is delivered to any TransportListener registered on this Transport. Also, if any of the addresses is invalid, a SendFailedException is thrown. Whether or not the message is still sent succesfully to any valid addresses depends on the Transport implementation.

Unlike the static send method, the sendMessage method does not call the saveChanges method on the message; the caller should do so.

Parameters:
msg - The Message to be sent
addresses - array of addresses to send this message to
Throws:
SendFailedException - if the send failed because of invalid addresses.
MessagingException - if the connection is dead or not in the connected state
See Also:
TransportEvent

public void addTransportListener(TransportListener l)
添加 Transport 事件侦听器。

此处提供的默认实现将此侦听器添加到 TransportListener 的内部列表。

l | Transport 事件的 Listener
See also | javax.mail.event.TransportEvent
英文文档：

addTransportListener

public void addTransportListener(TransportListener l)
Add a listener for Transport events.

The default implementation provided here adds this listener to an internal list of TransportListeners.

Parameters:
l - the Listener for Transport events
See Also:
TransportEvent

public void removeTransportListener(TransportListener l)
移除 Transport 事件侦听器。

此处提供的默认实现将从 TransportListener 的内部列表中移除此侦听器。

l | 侦听器
See also | addTransportListener
英文文档：

removeTransportListener

public void removeTransportListener(TransportListener l)
Remove a listener for Transport events.

The default implementation provided here removes this listener from the internal list of TransportListeners.

Parameters:
l - the listener
See Also:
addTransportListener(javax.mail.event.TransportListener)

protected void notifyTransportListeners(int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg)
通知所有 TransportListener。Transport 实现应该使用此方法广播 TransportEvent。

提供的默认实现将该事件加入到内部事件队列。事件分发程序线程取消队列中事件的排队，并将其分发给注册的 TransportListener。注意，事件分发发生在不同的线程中，因此避免了可能出现的死锁问题。

英文文档：

notifyTransportListeners

protected void notifyTransportListeners(int type,
                                        Address[] validSent,
                                        Address[] validUnsent,
                                        Address[] invalid,
                                        Message msg)
Notify all TransportListeners. Transport implementations are expected to use this method to broadcast TransportEvents.

The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered TransportListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


URLName (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail
Class URLName

java.lang.Object
    extended by  javax.mail.URLName

public class URLName
extends Object

URL 的名称。此类表示一个 URL 名称，它还提供基本解析功能以解析大多数 Internet 标准 URL 方案。

注意，此类与 java.net.URL 的不同在于此类只表示 URL 名称，不模拟到 URL 的连接。

version 1.19, 07/05/04
英文文档：

The name of a URL. This class represents a URL name and also provides the basic parsing functionality to parse most internet standard URL schemes.

Note that this class differs from java.net.URL in that this class just represents the name of a URL, it does not model the connection to a URL.

Version:
1.19, 07/05/04
Author:
Christopher Cotton, Bill Shannon

Field Summary
protected  String fullURL
The full version of the URL
Constructor Summary
URLName(String url)
Construct a URLName from the string.
URLName(String protocol, String host, int port, String file, String username, String password)
Creates a URLName object from the specified protocol, host, port number, file, username, and password.
URLName(URL url)
Construct a URLName from a java.net.URL object.
Method Summary
boolean | equals(Object obj) Compares two URLNames.
String | getFile() Returns the file name of this URLName.
String | getHost() Returns the host of this URLName.
String | getPassword() Returns the password of this URLName.
int | getPort() Returns the port number of this URLName.
String | getProtocol() Returns the protocol of this URLName.
String | getRef() Returns the reference of this URLName.
URL | getURL() Constructs a URL from the URLName.
String | getUsername() Returns the user name of this URLName.
int | hashCode() Compute the hash code for this URLName.
protected void | parseString(String url) Method which does all of the work of parsing the string.
String | toString() Constructs a string representation of this URLName.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

fullURL

protected String fullURL
The full version of the URL

Constructor Detail

public URLName(String protocol, String host, int port, String file, String username, String password)
根据指定协议、主机、端口号、文件、用户名和密码创建 URLName 对象。将端口号指定为 -1，指示 URL 应该使用协议的默认端口。
英文文档：

URLName

public URLName(String protocol,
               String host,
               int port,
               String file,
               String username,
               String password)
Creates a URLName object from the specified protocol, host, port number, file, username, and password. Specifying a port number of -1 indicates that the URL should use the default port for the protocol.

public URLName(java.net.URL url)
根据 java.net.URL 对象构造 URLName。
英文文档：

URLName

public URLName(URL url)
Construct a URLName from a java.net.URL object.

public URLName(String url)
根据字符串构造 URLName。解析出所有可能的信息（协议、主机、端口、文件、用户名和密码）。
英文文档：

URLName

public URLName(String url)
Construct a URLName from the string. Parses out all the possible information (protocol, host, port, file, username, password).

Method Detail

public String toString()
构造此 URLName 的字符串表示形式。
英文文档：

toString

public String toString()
Constructs a string representation of this URLName.

Overrides:
toString in class Object

protected void parseString(String url)
完成解析字符串的所有工作的方法。
英文文档：

parseString

protected void parseString(String url)
Method which does all of the work of parsing the string.

public int getPort()
返回此 URLName 的端口号。如果未设置端口，则返回 -1。
英文文档：

getPort

public int getPort()
Returns the port number of this URLName. Returns -1 if the port is not set.

public String getProtocol()
返回此 URLName 的协议。如果此 URLName 没有协议，则返回 null。
英文文档：

getProtocol

public String getProtocol()
Returns the protocol of this URLName. Returns null if this URLName has no protocol.

public String getFile()
返回此 URLName 的文件名。如果此 URLName 没有文件名，则返回 null。
英文文档：

getFile

public String getFile()
Returns the file name of this URLName. Returns null if this URLName has no file name.

public String getRef()
返回此 URLName 的引用。如果此 URLName 没有引用，则返回 null。
英文文档：

getRef

public String getRef()
Returns the reference of this URLName. Returns null if this URLName has no reference.

public String getHost()
返回此 URLName 的主机。如果此 URLName 没有主机，则返回 null。
英文文档：

getHost

public String getHost()
Returns the host of this URLName. Returns null if this URLName has no host.

public String getUsername()
返回此 URLName 的用户名。如果此 URLName 没有用户名，则返回 null。
英文文档：

getUsername

public String getUsername()
Returns the user name of this URLName. Returns null if this URLName has no user name.

public String getPassword()
返回此 URLName 的密码。如果此 URLName 没有密码，则返回 null。
英文文档：

getPassword

public String getPassword()
Returns the password of this URLName. Returns null if this URLName has no password.

public java.net.URL getURL() throws java.net.MalformedURLException
根据 URLName 构造 URL。
英文文档：

getURL

public URL getURL()
           throws MalformedURLException
Constructs a URL from the URLName.

Throws:
MalformedURLException

public boolean equals(Object obj)
比较两个 URLName。当且仅当参数不为 null，并且是一个与此对象表示相同 URLName 的 URLName 对象时，结果才为 true。如果两个 URLName 对象拥有相同协议、相同主机、相同主机端口号、相同用户名，并在主机上拥有相同的文件，则两个对象是相等的。如果两个 URLName 对象均为 null，则字段（主机、用户名和文件）也被认为是相同的。

如果名称是相等的（不区分大小写），或者用主机名查找它们都获得成功，并且它们都引用相同的 IP 地址，则主机被认为是相等的。

注意，URLName 没有特定协议的默认端口号的信息，因此 "imap://host" 和 "imap://host:143" 比较起来可能是不相等的。

还要注意的是，比较中不包括密码字段，也不包括追加到文件名中的任何引用字段。

英文文档：

equals

public boolean equals(Object obj)
Compares two URLNames. The result is true if and only if the argument is not null and is a URLName object that represents the same URLName as this object. Two URLName objects are equal if they have the same protocol and the same host, the same port number on the host, the same username, and the same file on the host. The fields (host, username, file) are also considered the same if they are both null.

Hosts are considered equal if the names are equal (case independent) or if host name lookups for them both succeed and they both reference the same IP address.

Note that URLName has no knowledge of default port numbers for particular protocols, so "imap://host" and "imap://host:143" would not compare as equal.

Note also that the password field is not included in the comparison, nor is any reference field appended to the filename.

Overrides:
equals in class Object

public int hashCode()
计算此 URLName 的哈希码。
英文文档：

hashCode

public int hashCode()
Compute the hash code for this URLName.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AuthenticationFailedException (Java EE 5)

javax.mail
Class AuthenticationFailedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.AuthenticationFailedException
All Implemented Interfaces:
Serializable
public class AuthenticationFailedException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当由于验证失败（例如，错误的用户名或密码）而导致 Store 或 Transport 对象上的 connect 方法失败时，抛出此异常。
英文文档：

This exception is thrown when the connect method on a Store or Transport object fails due to an authentication failure (e.g., bad user name or password).

Author:
Bill Shannon
See Also:
Serialized Form

Constructor Summary
AuthenticationFailedException()
Constructor
AuthenticationFailedException(String message)
Constructor
Method Summary
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public AuthenticationFailedException()
Constructor
英文文档：

AuthenticationFailedException

public AuthenticationFailedException()
Constructor

public AuthenticationFailedException(String message)
Constructor
message 详细的错误消息
英文文档：

AuthenticationFailedException

public AuthenticationFailedException(String message)
Constructor

Parameters:
message - The detailed error message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FolderClosedException (Java EE 5)

javax.mail
Class FolderClosedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.FolderClosedException
All Implemented Interfaces:
Serializable
public class FolderClosedException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当在 Messaging 对象上调用某个方法而拥有该对象的 Folder 由于某个原因已经停用时，抛出此异常。

在抛出该异常后，该 Folder 被重置为 "closed" 状态。该 Folder 拥有的所有 Messaging 对象都应被认为是无效的。可使用 "open" 方法重新打开该 Folder 以重新建立失去的连接。

getMessage() 方法返回更详细的有关导致此异常的错误的信息。

英文文档：

This exception is thrown when a method is invoked on a Messaging object and the Folder that owns that object has died due to some reason.

Following the exception, the Folder is reset to the "closed" state. All messaging objects owned by the Folder should be considered invalid. The Folder can be reopened using the "open" method to reestablish the lost connection.

The getMessage() method returns more detailed information about the error that caused this exception.

Author:
John Mani
See Also:
Serialized Form

Constructor Summary
FolderClosedException(Folder folder)
Constructor
FolderClosedException(Folder folder, String message)
Constructor
Method Summary
 Folder getFolder()
Returns the dead Folder object
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public FolderClosedException(Folder folder)
Constructor
folder Folder
英文文档：

FolderClosedException

public FolderClosedException(Folder folder)
Constructor

Parameters:
folder - the Folder

public FolderClosedException(Folder folder, String message)
Constructor
folder | Folder
message | 详细的错误消息
英文文档：

FolderClosedException

public FolderClosedException(Folder folder,
                             String message)
Constructor

Parameters:
folder - the Folder
message - the detailed error message
Method Detail

public Folder getFolder()
返回停用的 Folder 对象。
英文文档：

getFolder

public Folder getFolder()
Returns the dead Folder object

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FolderNotFoundException (Java EE 5)

javax.mail
Class FolderNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.FolderNotFoundException
All Implemented Interfaces:
Serializable
public class FolderNotFoundException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当对不存在的文件夹调用 Folder 方法时，这些方法会抛出此异常。
英文文档：

This exception is thrown by Folder methods, when those methods are invoked on a non existent folder.

Author:
John Mani
See Also:
Serialized Form

Constructor Summary
FolderNotFoundException()
Constructs a MessagingException with no detail message.
FolderNotFoundException(Folder folder)
Constructs a MessagingException with the specified folder.
FolderNotFoundException(Folder folder, String s)
Constructs a MessagingException with the specified folder and the specified detail message.
FolderNotFoundException(String s, Folder folder)
Constructs a MessagingException with the specified detail message and the specified folder.
Method Summary
 Folder getFolder()
Returns the offending Folder object.
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public FolderNotFoundException()
构造不带详细消息的 MessagingException。
英文文档：

FolderNotFoundException

public FolderNotFoundException()
Constructs a MessagingException with no detail message.

public FolderNotFoundException(Folder folder)
构造带指定文件夹的 MessagingException。
folder Folder
since
en
JavaMail 1.2
英文文档：

FolderNotFoundException

public FolderNotFoundException(Folder folder)
Constructs a MessagingException with the specified folder.

Parameters:
folder - the Folder
Since:
JavaMail 1.2

public FolderNotFoundException(Folder folder, String s)
构造带指定文件夹和指定详细消息的 MessagingException。
folder | Folder
s | 详细信息
since
en
JavaMail 1.2
英文文档：

FolderNotFoundException

public FolderNotFoundException(Folder folder,
                               String s)
Constructs a MessagingException with the specified folder and the specified detail message.

Parameters:
folder - the Folder
s - the detail message
Since:
JavaMail 1.2

public FolderNotFoundException(String s, Folder folder)
构造带指定详细消息和指定文件夹的 MessagingException。
s | 详细信息
folder | Folder
英文文档：

FolderNotFoundException

public FolderNotFoundException(String s,
                               Folder folder)
Constructs a MessagingException with the specified detail message and the specified folder.

Parameters:
s - the detail message
folder - the Folder
Method Detail

public Folder getFolder()
返回有问题的 Folder 对象。
return Folder 对象。注意，返回的值可以为 null。
英文文档：

getFolder

public Folder getFolder()
Returns the offending Folder object.

Returns:
the Folder object. Note that the returned value can be null.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IllegalWriteException (Java EE 5)

javax.mail
Class IllegalWriteException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.IllegalWriteException
All Implemented Interfaces:
Serializable
public class IllegalWriteException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当试图编写任何 Messaging 对象的只读属性时，抛出该异常。
英文文档：

The exception thrown when a write is attempted on a read-only attribute of any Messaging object.

Author:
John Mani
See Also:
Serialized Form

Constructor Summary
IllegalWriteException()
Constructs a IllegalWriteException with no detail message.
IllegalWriteException(String s)
Constructs a IllegalWriteException with the specified detail message.
Method Summary
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public IllegalWriteException()
构造不带详细消息的 IllegalWriteException。
英文文档：

IllegalWriteException

public IllegalWriteException()
Constructs a IllegalWriteException with no detail message.

public IllegalWriteException(String s)
构造带指定详细消息的 IllegalWriteException。
s 详细信息
英文文档：

IllegalWriteException

public IllegalWriteException(String s)
Constructs a IllegalWriteException with the specified detail message.

Parameters:
s - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageRemovedException (Java EE 5)

javax.mail
Class MessageRemovedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.MessageRemovedException
All Implemented Interfaces:
Serializable
public class MessageRemovedException
extends MessagingException

The exception thrown when an invalid method is invoked on an expunged Message. The only valid methods on an expunged Message are isExpunged() and getMessageNumber().

Author:
John Mani
See Also:
Message.isExpunged(), Message.getMessageNumber(), Serialized Form

Constructor Summary
MessageRemovedException()
Constructs a MessageRemovedException with no detail message.
MessageRemovedException(String s)
Constructs a MessageRemovedException with the specified detail message.
Method Summary
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MessageRemovedException

public MessageRemovedException()
Constructs a MessageRemovedException with no detail message.

MessageRemovedException

public MessageRemovedException(String s)
Constructs a MessageRemovedException with the specified detail message.

Parameters:
s - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature

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


MessagingException (Java EE 5)

javax.mail
Class MessagingException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AuthenticationFailedException, FolderClosedException, FolderNotFoundException, IllegalWriteException, MessageRemovedException, MethodNotSupportedException, NoSuchProviderException, ParseException, ReadOnlyFolderException, SearchException, SendFailedException, StoreClosedException
public class MessagingException
extends Exception

Extends: Throwable > Exception
Extended by: AuthenticationFailedException, FolderClosedException, FolderNotFoundException, IllegalWriteException, MessageRemovedException, MethodNotSupportedException, NoSuchProviderException, ParseException, ReadOnlyFolderException, SearchException, SendFailedException, StoreClosedException

Messaging 类抛出的所有异常的基类。
英文文档：

The base class for all exceptions thrown by the Messaging classes

Author:
John Mani, Bill Shannon
See Also:
Serialized Form

Constructor Summary
MessagingException()
Constructs a MessagingException with no detail message.
MessagingException(String s)
Constructs a MessagingException with the specified detail message.
MessagingException(String s, Exception e)
Constructs a MessagingException with the specified Exception and detail message.
Method Summary
Throwable | getCause() Overrides the getCause method of Throwable to return the next exception in the chain of nested exceptions.
Exception | getNextException() Get the next exception chained to this one.
boolean | setNextException(Exception ex) Add an exception to the end of the chain.
String | toString() Override toString method to provide information on nested exceptions.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public MessagingException()
构造不带详细消息的 MessagingException。
英文文档：

MessagingException

public MessagingException()
Constructs a MessagingException with no detail message.

public MessagingException(String s)
构造带指定详细消息的 MessagingException。
s 详细信息
英文文档：

MessagingException

public MessagingException(String s)
Constructs a MessagingException with the specified detail message.

Parameters:
s - the detail message

public MessagingException(String s, Exception e)
构造带指定 Exception 和详细消息的 MessagingException。指定的异常链接到此异常。
s | 详细信息
e | 嵌入的异常
See also | getNextException, setNextException, getCause
英文文档：

MessagingException

public MessagingException(String s,
                          Exception e)
Constructs a MessagingException with the specified Exception and detail message. The specified exception is chained to this exception.

Parameters:
s - the detail message
e - the embedded exception
See Also:
getNextException(),
setNextException(java.lang.Exception),
getCause()
Method Detail

public Exception getNextException()
获取链接此异常链的下一个异常。如果下一个异常是 MessagingException，则该链可以进一步扩展。
return 下一个 Exception；如果不存在，则返回 null。
英文文档：

getNextException

public Exception getNextException()
Get the next exception chained to this one. If the next exception is a MessagingException, the chain may extend further.

Returns:
next Exception, null if none.

public Throwable getCause()
重写 Throwable 的 getCause 方法，以返回嵌套异常链中的下一个异常。
return 下一个 Exception；如果不存在，则返回 null。
英文文档：

getCause

public Throwable getCause()
Overrides the getCause method of Throwable to return the next exception in the chain of nested exceptions.

Overrides:
getCause in class Throwable
Returns:
next Exception, null if none.

public boolean setNextException(Exception ex)
将异常添加到链的末尾。如果末尾的异常不是 MessagingException，则无法将此异常添加到末尾。
ex | Exception 链的新末尾
return | 如果添加了此 Exception，则返回 true；否则返回 false。
英文文档：

setNextException

public boolean setNextException(Exception ex)
Add an exception to the end of the chain. If the end is not a MessagingException, this exception cannot be added to the end.

Parameters:
ex - the new end of the Exception chain
Returns:
true if this Exception was added, false otherwise.

public String toString()
重写 toString 方法，以提供关于嵌套异常的信息。
英文文档：

toString

public String toString()
Override toString method to provide information on nested exceptions.

Overrides:
toString in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MethodNotSupportedException (Java EE 5)

javax.mail
Class MethodNotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.MethodNotSupportedException
All Implemented Interfaces:
Serializable
public class MethodNotSupportedException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当某个方法不受实现支持时，抛出该异常。
英文文档：

The exception thrown when a method is not supported by the implementation

Author:
John Mani
See Also:
Serialized Form

Constructor Summary
MethodNotSupportedException()
Constructs a MethodNotSupportedException with no detail message.
MethodNotSupportedException(String s)
Constructs a MethodNotSupportedException with the specified detail message.
Method Summary
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public MethodNotSupportedException()
构造不带详细消息的 MethodNotSupportedException。
英文文档：

MethodNotSupportedException

public MethodNotSupportedException()
Constructs a MethodNotSupportedException with no detail message.

public MethodNotSupportedException(String s)
构造带指定详细消息的 MethodNotSupportedException。
s 详细信息
英文文档：

MethodNotSupportedException

public MethodNotSupportedException(String s)
Constructs a MethodNotSupportedException with the specified detail message.

Parameters:
s - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoSuchProviderException (Java EE 5)

javax.mail
Class NoSuchProviderException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.NoSuchProviderException
All Implemented Interfaces:
Serializable
public class NoSuchProviderException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当 Session 试图实例化不存在的 Provider 时，抛出此异常。
英文文档：

This exception is thrown when Session attempts to instantiate a Provider that doesn't exist.

Author:
Max Spivak
See Also:
Serialized Form

Constructor Summary
NoSuchProviderException()
Constructor.
NoSuchProviderException(String message)
Constructor.
Method Summary
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public NoSuchProviderException()
构造方法。
英文文档：

NoSuchProviderException

public NoSuchProviderException()
Constructor.

public NoSuchProviderException(String message)
构造方法。
message 详细的错误消息
英文文档：

NoSuchProviderException

public NoSuchProviderException(String message)
Constructor.

Parameters:
message - The detailed error message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReadOnlyFolderException (Java EE 5)

javax.mail
Class ReadOnlyFolderException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.ReadOnlyFolderException
All Implemented Interfaces:
Serializable
public class ReadOnlyFolderException
extends MessagingException

Extends: Throwable > Exception > MessagingException

如果试图对标记为只读的文件夹进行读写访问，则抛出此异常。

getMessage() 方法返回更详细的有关导致此异常的错误的信息。

英文文档：

This exception is thrown when an attempt is made to open a folder read-write access when the folder is marked read-only.

The getMessage() method returns more detailed information about the error that caused this exception.

Author:
Jim Glennon
See Also:
Serialized Form

Constructor Summary
ReadOnlyFolderException(Folder folder)
Constructs a MessagingException with the specified folder.
ReadOnlyFolderException(Folder folder, String message)
Constructs a MessagingException with the specified folder and the specified detail message.
Method Summary
 Folder getFolder()
Returns the dead Folder object.
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ReadOnlyFolderException(Folder folder)
构造带指定文件夹的 MessagingException。
folder Folder
since
en
JavaMail 1.2
英文文档：

ReadOnlyFolderException

public ReadOnlyFolderException(Folder folder)
Constructs a MessagingException with the specified folder.

Parameters:
folder - the Folder
Since:
JavaMail 1.2

public ReadOnlyFolderException(Folder folder, String message)
构造带指定文件夹和指定详细消息的 MessagingException。
folder | Folder
message | 详细的错误消息
since
en
JavaMail 1.2
英文文档：

ReadOnlyFolderException

public ReadOnlyFolderException(Folder folder,
                               String message)
Constructs a MessagingException with the specified folder and the specified detail message.

Parameters:
folder - the Folder
message - the detailed error message
Since:
JavaMail 1.2
Method Detail

public Folder getFolder()
返回停止运行的 Folder 对象。
since
en
JavaMail 1.2
英文文档：

getFolder

public Folder getFolder()
Returns the dead Folder object.

Since:
JavaMail 1.2
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SendFailedException (Java EE 5)

javax.mail
Class SendFailedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.SendFailedException
All Implemented Interfaces:
Serializable
public class SendFailedException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当该消息无法发送时，抛出此异常。

该异常包括那些消息无法发送到的地址，以及消息发送到的有效地址和消息未发送到的有效地址。

See also send, sendMessage, javax.mail.event.TransportEvent
英文文档：

This exception is thrown when the message cannot be sent.

The exception includes those addresses to which the message could not be sent as well as the valid addresses to which the message was sent and valid addresses to which the message was not sent.

Author:
John Mani, Max Spivak
See Also:
Transport.send(javax.mail.Message), Transport.sendMessage(javax.mail.Message, javax.mail.Address[]), TransportEvent, Serialized Form

Field Summary
protected Address[] | invalid
protected Address[] | validSent
protected Address[] | validUnsent
Constructor Summary
SendFailedException()
Constructs a SendFailedException with no detail message.
SendFailedException(String s)
Constructs a SendFailedException with the specified detail message.
SendFailedException(String s, Exception e)
Constructs a SendFailedException with the specified Exception and detail message.
SendFailedException(String msg, Exception ex, Address[] validSent, Address[] validUnsent, Address[] invalid)
Constructs a SendFailedException with the specified string and the specified address objects.
Method Summary
Address[] | getInvalidAddresses() Return the addresses to which this message could not be sent.
Address[] | getValidSentAddresses() Return the addresses to which this message was sent succesfully.
Address[] | getValidUnsentAddresses() Return the addresses that are valid but to which this message was not sent.
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, 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

英文文档：

invalid

protected transient Address[] invalid

英文文档：

validSent

protected transient Address[] validSent

英文文档：

validUnsent

protected transient Address[] validUnsent
Constructor Detail

public SendFailedException()
构造不带详细消息的 SendFailedException。
英文文档：

SendFailedException

public SendFailedException()
Constructs a SendFailedException with no detail message.

public SendFailedException(String s)
构造带指定详细消息的 SendFailedException。
s 详细信息
英文文档：

SendFailedException

public SendFailedException(String s)
Constructs a SendFailedException with the specified detail message.

Parameters:
s - the detail message

public SendFailedException(String s, Exception e)
构造带指定 Exception 和详细消息的 SendFailedException。指定的异常链接到此异常。
s | 详细信息
e | 嵌入的异常
See also | getNextException, setNextException
英文文档：

SendFailedException

public SendFailedException(String s,
                           Exception e)
Constructs a SendFailedException with the specified Exception and detail message. The specified exception is chained to this exception.

Parameters:
s - the detail message
e - the embedded exception
See Also:
MessagingException.getNextException(), MessagingException.setNextException(java.lang.Exception)

public SendFailedException(String msg, Exception ex, Address[] validSent, Address[] validUnsent, Address[] invalid)
构造带指定字符串和指定地址对象的 SendFailedException。
msg | 详细信息
ex | 嵌入的异常
validSent | 消息发送到的有效地址
validUnsent | 消息未发送到的有效地址
invalid | 无效地址
See also | getNextException, setNextException
英文文档：

SendFailedException

public SendFailedException(String msg,
                           Exception ex,
                           Address[] validSent,
                           Address[] validUnsent,
                           Address[] invalid)
Constructs a SendFailedException with the specified string and the specified address objects.

Parameters:
msg - the detail message
ex - the embedded exception
validSent - valid addresses to which message was sent
validUnsent - valid addresses to which message was not sent
invalid - the invalid addresses
See Also:
MessagingException.getNextException(), MessagingException.setNextException(java.lang.Exception)
Method Detail

public Address[] getValidSentAddresses()
返回此消息成功发送到的地址。
return 成功将消息发送到的地址，或者返回 null
英文文档：

getValidSentAddresses

public Address[] getValidSentAddresses()
Return the addresses to which this message was sent succesfully.

Returns:
Addresses to which the message was sent successfully or null

public Address[] getValidUnsentAddresses()
返回未向其发送此消息的有效地址。
return 有效但未能成功将消息发送到的地址，或者返回 null
英文文档：

getValidUnsentAddresses

public Address[] getValidUnsentAddresses()
Return the addresses that are valid but to which this message was not sent.

Returns:
Addresses that are valid but to which the message was not sent successfully or null

public Address[] getInvalidAddresses()
返回无法向其发送此消息的地址。
return 消息发送失败的地址，或者返回 null；
英文文档：

getInvalidAddresses

public Address[] getInvalidAddresses()
Return the addresses to which this message could not be sent.

Returns:
Addresses to which the message sending failed or null;
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StoreClosedException (Java EE 5)

javax.mail
Class StoreClosedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.StoreClosedException
All Implemented Interfaces:
Serializable
public class StoreClosedException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当在 Messaging 对象上调用某个方法而拥有该对象的 Store 由于某个原因已经停用时，抛出此异常。此异常应该被视为致命错误；尤其是，属于该 Store 的所有 Messaging 对象都必须被认为是无效的。

可以对停用的 Store 对象调用 connect 方法来获取它。

getMessage() 方法返回更详细的有关导致此异常的错误的信息。

英文文档：

This exception is thrown when a method is invoked on a Messaging object and the Store that owns that object has died due to some reason. This exception should be treated as a fatal error; in particular any messaging object belonging to that Store must be considered invalid.

The connect method may be invoked on the dead Store object to revive it.

The getMessage() method returns more detailed information about the error that caused this exception.

Author:
John Mani
See Also:
Serialized Form

Constructor Summary
StoreClosedException(Store store)
Constructor
StoreClosedException(Store store, String message)
Constructor
Method Summary
 Store getStore()
Returns the dead Store object
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public StoreClosedException(Store store)
Constructor
store 停用的 Store 对象
英文文档：

StoreClosedException

public StoreClosedException(Store store)
Constructor

Parameters:
store - The dead Store object

public StoreClosedException(Store store, String message)
Constructor
store | 停用的 Store 对象
message | 详细的错误消息
英文文档：

StoreClosedException

public StoreClosedException(Store store,
                            String message)
Constructor

Parameters:
store - The dead Store object
message - The detailed error message
Method Detail

public Store getStore()
返回停用的 Store 对象。
英文文档：

getStore

public Store getStore()
Returns the dead Store object

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.mail.event (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.mail.event

Listeners and events for the JavaMail API.

See:
Description

Interface Summary
ConnectionListener | This is the Listener interface for Connection events.
FolderListener | This is the Listener interface for Folder events.
MessageChangedListener | This is the Listener interface for MessageChanged events
MessageCountListener | This is the Listener interface for MessageCount events.
StoreListener | This is the Listener interface for Store Notifications.
TransportListener | This is the Listener interface for Transport events

Class Summary
ConnectionAdapter | The adapter which receives connection events.
ConnectionEvent | This class models Connection events.
FolderAdapter | The adapter which receives Folder events.
FolderEvent | This class models Folder existence events.
MailEvent | Common base class for mail events, defining the dispatch method.
MessageChangedEvent | This class models Message change events.
MessageCountAdapter | The adapter which receives MessageCount events.
MessageCountEvent | This class notifies changes in the number of messages in a folder.
StoreEvent | This class models notifications from the Store connection.
TransportAdapter | The adapter which receives Transport events.
TransportEvent | This class models Transport events.

Package javax.mail.event Description

Listeners and events for the JavaMail API. This package defines listener classes and event classes used by the classes defined in the javax.mail package.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.mail.event Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.mail.event

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.mail.event.ConnectionAdapter (implements javax.mail.event.ConnectionListener)
    • java.util.EventObject (implements java.io.Serializable)
      • javax.mail.event.MailEvent
        • javax.mail.event.ConnectionEvent
        • javax.mail.event.FolderEvent
        • javax.mail.event.MessageChangedEvent
        • javax.mail.event.MessageCountEvent
        • javax.mail.event.StoreEvent
        • javax.mail.event.TransportEvent
    • javax.mail.event.FolderAdapter (implements javax.mail.event.FolderListener)
    • javax.mail.event.MessageCountAdapter (implements javax.mail.event.MessageCountListener)
    • javax.mail.event.TransportAdapter (implements javax.mail.event.TransportListener)

Interface Hierarchy

  • java.util.EventListener
    • javax.mail.event.ConnectionListener
    • javax.mail.event.FolderListener
    • javax.mail.event.MessageChangedListener
    • javax.mail.event.MessageCountListener
    • javax.mail.event.StoreListener
    • javax.mail.event.TransportListener
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ConnectionListener (Java EE 5)

javax.mail.event
Interface ConnectionListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
ConnectionAdapter
public interface ConnectionListener
extends EventListener

Implements: java.util.EventListener
Implemented by: ConnectionAdapter

Connection 事件的 Listener 接口。
英文文档：

This is the Listener interface for Connection events.

Author:
John Mani

Method Summary
void | closed(ConnectionEvent e) Invoked when a Store/Folder/Transport is closed.
void | disconnected(ConnectionEvent e) Invoked when a Store is disconnected.
void | opened(ConnectionEvent e) Invoked when a Store/Folder/Transport is opened.

Method Detail

public void opened(ConnectionEvent e)
当 Store/Folder/Transport 打开时调用。
英文文档：

opened

void opened(ConnectionEvent e)
Invoked when a Store/Folder/Transport is opened.

public void disconnected(ConnectionEvent e)
当 Store 断开时调用。注意，文件夹不能被断开，因此文件夹不会激发此事件
英文文档：

disconnected

void disconnected(ConnectionEvent e)
Invoked when a Store is disconnected. Note that a folder cannot be disconnected, so a folder will not fire this event

public void closed(ConnectionEvent e)
当 Store/Folder/Transport 关闭时调用。
英文文档：

closed

void closed(ConnectionEvent e)
Invoked when a Store/Folder/Transport is closed.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FolderListener (Java EE 5)

javax.mail.event
Interface FolderListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
FolderAdapter
public interface FolderListener
extends EventListener

Implements: java.util.EventListener
Implemented by: FolderAdapter

这是 Folder 事件的 Listener 接口。
英文文档：

This is the Listener interface for Folder events.

Author:
John Mani

Method Summary
void | folderCreated(FolderEvent e) Invoked when a Folder is created.
void | folderDeleted(FolderEvent e) Invoked when a folder is deleted.
void | folderRenamed(FolderEvent e) Invoked when a folder is renamed.

Method Detail

public void folderCreated(FolderEvent e)
创建文件夹时调用。
英文文档：

folderCreated

void folderCreated(FolderEvent e)
Invoked when a Folder is created.

public void folderDeleted(FolderEvent e)
删除文件夹时调用。
英文文档：

folderDeleted

void folderDeleted(FolderEvent e)
Invoked when a folder is deleted.

public void folderRenamed(FolderEvent e)
重命名文件夹时调用。
英文文档：

folderRenamed

void folderRenamed(FolderEvent e)
Invoked when a folder is renamed.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageChangedListener (Java EE 5)

javax.mail.event
Interface MessageChangedListener

All Superinterfaces:
EventListener
public interface MessageChangedListener
extends EventListener

Implements: java.util.EventListener

这是 MessageChanged 事件的 Listener 接口
英文文档：

This is the Listener interface for MessageChanged events

Author:
John Mani

Method Summary
 void messageChanged(MessageChangedEvent e)
Invoked when a message is changed.

Method Detail

public void messageChanged(MessageChangedEvent e)
当消息被更改时调用。更改类型指定更改的内容。
See also FLAGS_CHANGED, ENVELOPE_CHANGED
英文文档：

messageChanged

void messageChanged(MessageChangedEvent e)
Invoked when a message is changed. The change-type specifies what changed.

See Also:
MessageChangedEvent.FLAGS_CHANGED, MessageChangedEvent.ENVELOPE_CHANGED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageCountListener (Java EE 5)

javax.mail.event
Interface MessageCountListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
MessageCountAdapter
public interface MessageCountListener
extends EventListener

Implements: java.util.EventListener
Implemented by: MessageCountAdapter

这是 MessageCount 事件的 Listener 接口。
英文文档：

This is the Listener interface for MessageCount events.

Author:
John Mani

Method Summary
void | messagesAdded(MessageCountEvent e) Invoked when messages are added into a folder.
void | messagesRemoved(MessageCountEvent e) Invoked when messages are removed (expunged) from a folder.

Method Detail

public void messagesAdded(MessageCountEvent e)
将消息添加到文件夹中时调用。
英文文档：

messagesAdded

void messagesAdded(MessageCountEvent e)
Invoked when messages are added into a folder.

public void messagesRemoved(MessageCountEvent e)
从文件夹中移除（擦除）消息时调用。
英文文档：

messagesRemoved

void messagesRemoved(MessageCountEvent e)
Invoked when messages are removed (expunged) from a folder.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StoreListener (Java EE 5)

javax.mail.event
Interface StoreListener

All Superinterfaces:
EventListener
public interface StoreListener
extends EventListener

Implements: java.util.EventListener

这是 Store 通知的 Listener 接口。
英文文档：

This is the Listener interface for Store Notifications.

Author:
John Mani

Method Summary
 void notification(StoreEvent e)
Invoked when the Store generates a notification event.

Method Detail

public void notification(StoreEvent e)
当 Store 生成一个通知事件时调用。
See also ALERT, NOTICE
英文文档：

notification

void notification(StoreEvent e)
Invoked when the Store generates a notification event.

See Also:
StoreEvent.ALERT, StoreEvent.NOTICE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransportListener (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.event
Interface TransportListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
TransportAdapter
public interface TransportListener
extends EventListener

Implements: java.util.EventListener
Implemented by: TransportAdapter

这是 Transport 事件的 Listener 接口。
See also javax.mail.Transport, javax.mail.event.TransportEvent
英文文档：

This is the Listener interface for Transport events

Author:
John Mani, Max Spivak
See Also:
Transport, TransportEvent

Method Summary
void | messageDelivered(TransportEvent e) Invoked when a Message is succesfully delivered.
void | messageNotDelivered(TransportEvent e) Invoked when a Message is not delivered.
void | messagePartiallyDelivered(TransportEvent e) Invoked when a Message is partially delivered.

Method Detail

public void messageDelivered(TransportEvent e)
当 Message 被成功传送时调用。
e
en
TransportEvent
英文文档：

messageDelivered

void messageDelivered(TransportEvent e)
Invoked when a Message is succesfully delivered.

Parameters:
e - TransportEvent

public void messageNotDelivered(TransportEvent e)
当 Message 未被传送时调用。
e
en
TransportEvent
See also javax.mail.event.TransportEvent
英文文档：

messageNotDelivered

void messageNotDelivered(TransportEvent e)
Invoked when a Message is not delivered.

Parameters:
e - TransportEvent
See Also:
TransportEvent

public void messagePartiallyDelivered(TransportEvent e)
当 Message 被部分传送时调用。
e
en
TransportEvent
See also javax.mail.event.TransportEvent
英文文档：

messagePartiallyDelivered

void messagePartiallyDelivered(TransportEvent e)
Invoked when a Message is partially delivered.

Parameters:
e - TransportEvent
See Also:
TransportEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConnectionAdapter (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.event
Class ConnectionAdapter

java.lang.Object
    extended by  javax.mail.event.ConnectionAdapter
All Implemented Interfaces:
EventListener, ConnectionListener
public abstract class ConnectionAdapter
extends Object
implements ConnectionListener

Implements: ConnectionListener

接收连接事件的适配器。此类中的方法为空；提供此类是为了方便，通过扩展此类和重写感兴趣的方法，可以轻松创建侦听器。
英文文档：

The adapter which receives connection events. The methods in this class are empty; this class is provided as a convenience for easily creating listeners by extending this class and overriding only the methods of interest.

Author:
John Mani

Constructor Summary
ConnectionAdapter()
Method Summary
void | closed(ConnectionEvent e) Invoked when a Store/Folder/Transport is closed.
void | disconnected(ConnectionEvent e) Invoked when a Store is disconnected.
void | opened(ConnectionEvent e) Invoked when a Store/Folder/Transport is opened.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ConnectionAdapter()
英文文档：

ConnectionAdapter

public ConnectionAdapter()
Method Detail

public void opened(ConnectionEvent e)
英文文档：

opened

public void opened(ConnectionEvent e)
Description copied from interface: ConnectionListener
Invoked when a Store/Folder/Transport is opened.

Specified by:
opened in interface ConnectionListener

public void disconnected(ConnectionEvent e)
英文文档：

disconnected

public void disconnected(ConnectionEvent e)
Description copied from interface: ConnectionListener
Invoked when a Store is disconnected. Note that a folder cannot be disconnected, so a folder will not fire this event

Specified by:
disconnected in interface ConnectionListener

public void closed(ConnectionEvent e)
英文文档：

closed

public void closed(ConnectionEvent e)
Description copied from interface: ConnectionListener
Invoked when a Store/Folder/Transport is closed.

Specified by:
closed in interface ConnectionListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConnectionEvent (Java EE 5)

javax.mail.event
Class ConnectionEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.mail.event.MailEvent
            extended by  javax.mail.event.ConnectionEvent
All Implemented Interfaces:
Serializable
public class ConnectionEvent
extends MailEvent

Extends: java.util.EventObject > MailEvent

此类模拟 Connection 事件。
英文文档：

This class models Connection events.

Author:
John Mani
See Also:
Serialized Form

Field Summary
static int | CLOSED A connection was closed.
static int | DISCONNECTED A connection was disconnected (not currently used).
static int | OPENED A connection was opened.
protected int | type The event type.
Fields inherited from class java.util.EventObject
source
Constructor Summary
ConnectionEvent(Object source, int type)
Constructor
Method Summary
void | dispatch(Object listener) Invokes the appropriate ConnectionListener method
int | getType() Return the type of this event
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

OPENED

public static final int OPENED
A connection was opened.

See Also:
Constant Field Values

英文文档：

DISCONNECTED

public static final int DISCONNECTED
A connection was disconnected (not currently used).

See Also:
Constant Field Values

英文文档：

CLOSED

public static final int CLOSED
A connection was closed.

See Also:
Constant Field Values

英文文档：

type

protected int type
The event type.

Constructor Detail

public ConnectionEvent(Object source, int type)
Constructor
source 源对象
英文文档：

ConnectionEvent

public ConnectionEvent(Object source,
                       int type)
Constructor

Parameters:
source - The source object
Method Detail

public int getType()
返回此事件的类型
return 类型
英文文档：

getType

public int getType()
Return the type of this event

Returns:
type

public void dispatch(Object listener)
调用相应的 ConnectionListener 方法
英文文档：

dispatch

public void dispatch(Object listener)
Invokes the appropriate ConnectionListener method

Specified by:
dispatch in class MailEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FolderAdapter (Java EE 5)

javax.mail.event
Class FolderAdapter

java.lang.Object
    extended by  javax.mail.event.FolderAdapter
All Implemented Interfaces:
EventListener, FolderListener
public abstract class FolderAdapter
extends Object
implements FolderListener

Implements: FolderListener

接收 Folder 事件的适配器。此类中的方法为空；提供此类是为了方便，通过扩展此类和重写感兴趣的方法，可以轻松创建侦听器。
英文文档：

The adapter which receives Folder events. The methods in this class are empty; this class is provided as a convenience for easily creating listeners by extending this class and overriding only the methods of interest.

Author:
John Mani

Constructor Summary
FolderAdapter()
Method Summary
void | folderCreated(FolderEvent e) Invoked when a Folder is created.
void | folderDeleted(FolderEvent e) Invoked when a folder is deleted.
void | folderRenamed(FolderEvent e) Invoked when a folder is renamed.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FolderAdapter()
英文文档：

FolderAdapter

public FolderAdapter()
Method Detail

public void folderCreated(FolderEvent e)
英文文档：

folderCreated

public void folderCreated(FolderEvent e)
Description copied from interface: FolderListener
Invoked when a Folder is created.

Specified by:
folderCreated in interface FolderListener

public void folderRenamed(FolderEvent e)
英文文档：

folderRenamed

public void folderRenamed(FolderEvent e)
Description copied from interface: FolderListener
Invoked when a folder is renamed.

Specified by:
folderRenamed in interface FolderListener

public void folderDeleted(FolderEvent e)
英文文档：

folderDeleted

public void folderDeleted(FolderEvent e)
Description copied from interface: FolderListener
Invoked when a folder is deleted.

Specified by:
folderDeleted in interface FolderListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FolderEvent (Java EE 5)

javax.mail.event
Class FolderEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.mail.event.MailEvent
            extended by  javax.mail.event.FolderEvent
All Implemented Interfaces:
Serializable
public class FolderEvent
extends MailEvent

Extends: java.util.EventObject > MailEvent

此类模拟 Folder 存在 事件。FolderEvent 被传送给 FolderListener，FolderListener 在受影响的 Folder 和包含它的 Store 上注册。

服务提供者通知客户这些事件的能力各不相同。最低限度是，服务提供者必须通知在发生操作的同一个 Store 或 Folder 对象上注册的侦听器。当更改由同一虚拟机中其他对象上的操作产生，或者由同一个主机或其他主机中的其他客户端产生时，服务提供者也可能会通知侦听器。此类通知不是必需的，通常不受邮件协议（包括 IMAP）支持。

英文文档：

This class models Folder existence events. FolderEvents are delivered to FolderListeners registered on the affected Folder as well as the containing Store.

Service providers vary widely in their ability to notify clients of these events. At a minimum, service providers must notify listeners registered on the same Store or Folder object on which the operation occurs. Service providers may also notify listeners when changes are made through operations on other objects in the same virtual machine, or by other clients in the same or other hosts. Such notifications are not required and are typically not supported by mail protocols (including IMAP).

Author:
John Mani, Bill Shannon
See Also:
Serialized Form

Field Summary
static int | CREATED The folder was created.
static int | DELETED The folder was deleted.
protected Folder | folder The folder the event occurred on.
protected Folder | newFolder The folder that represents the new name, in case of a RENAMED event.
static int | RENAMED The folder was renamed.
protected int | type The event type.
Fields inherited from class java.util.EventObject
source
Constructor Summary
FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
Constructor.
FolderEvent(Object source, Folder folder, int type)
Constructor.
Method Summary
void | dispatch(Object listener) Invokes the appropriate FolderListener method
Folder | getFolder() Return the affected folder.
Folder | getNewFolder() If this event indicates that a folder is renamed, (i.e, the event type is RENAMED), then this method returns the Folder object representing the new name.
int | getType() Return the type of this event.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

CREATED

public static final int CREATED
The folder was created.

See Also:
Constant Field Values

英文文档：

DELETED

public static final int DELETED
The folder was deleted.

See Also:
Constant Field Values

英文文档：

RENAMED

public static final int RENAMED
The folder was renamed.

See Also:
Constant Field Values

英文文档：

type

protected int type
The event type.

英文文档：

folder

protected transient Folder folder
The folder the event occurred on.

英文文档：

newFolder

protected transient Folder newFolder
The folder that represents the new name, in case of a RENAMED event.

Since:
JavaMail 1.1
Constructor Detail

public FolderEvent(Object source, Folder folder, int type)
构造方法。

source | 事件源
folder | 受影响的文件夹
type | 事件类型
英文文档：

FolderEvent

public FolderEvent(Object source,
                   Folder folder,
                   int type)
Constructor.

Parameters:
source - The source of the event
folder - The affected folder
type - The event type

public FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
构造方法。用于 RENAMED 事件。
source | 事件源
oldFolder | 重命名的文件夹
newFolder | 表示新名称的文件夹
type | 事件类型
since
en
JavaMail 1.1
英文文档：

FolderEvent

public FolderEvent(Object source,
                   Folder oldFolder,
                   Folder newFolder,
                   int type)
Constructor. Use for RENAMED events.

Parameters:
source - The source of the event
oldFolder - The folder that is renamed
newFolder - The folder that represents the new name
type - The event type
Since:
JavaMail 1.1
Method Detail

public int getType()
返回此事件的类型。
return 类型
英文文档：

getType

public int getType()
Return the type of this event.

Returns:
type

public Folder getFolder()
返回受影响的文件夹。
return | 受影响的文件夹
See also | getNewFolder
英文文档：

getFolder

public Folder getFolder()
Return the affected folder.

Returns:
the affected folder
See Also:
getNewFolder()

public Folder getNewFolder()
如果此事件指示一个文件夹被重命名（即，事件类型为 RENAMED），则此方法返回表示新名称的 Folder 对象。

getFolder() 方法返回重命名的文件夹。

return | 表示新名称的文件夹。
since
en
JavaMail 1.1
See also | getFolder
英文文档：

getNewFolder

public Folder getNewFolder()
If this event indicates that a folder is renamed, (i.e, the event type is RENAMED), then this method returns the Folder object representing the new name.

The getFolder() method returns the folder that is renamed.

Returns:
Folder representing the new name.
Since:
JavaMail 1.1
See Also:
getFolder()

public void dispatch(Object listener)
调用相应的 FolderListener 方法
英文文档：

dispatch

public void dispatch(Object listener)
Invokes the appropriate FolderListener method

Specified by:
dispatch in class MailEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MailEvent (Java EE 5)

javax.mail.event
Class MailEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.mail.event.MailEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConnectionEvent, FolderEvent, MessageChangedEvent, MessageCountEvent, StoreEvent, TransportEvent
public abstract class MailEvent
extends EventObject

Extends: java.util.EventObject
Extended by: ConnectionEvent, FolderEvent, MessageChangedEvent, MessageCountEvent, StoreEvent, TransportEvent

邮件事件的公共基类，定义指派方法。
英文文档：

Common base class for mail events, defining the dispatch method.

Author:
Bill Shannon
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
MailEvent(Object source)
Method Summary
abstract  void dispatch(Object listener)
This method invokes the appropriate method on a listener for this event.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public MailEvent(Object source)
英文文档：

MailEvent

public MailEvent(Object source)
Method Detail

abstract public void dispatch(Object listener)
此方法对此事件的侦听器调用相应的方法。子类提供该实现。
英文文档：

dispatch

public abstract void dispatch(Object listener)
This method invokes the appropriate method on a listener for this event. Subclasses provide the implementation.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageChangedEvent (Java EE 5)

javax.mail.event
Class MessageChangedEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.mail.event.MailEvent
            extended by  javax.mail.event.MessageChangedEvent
All Implemented Interfaces:
Serializable
public class MessageChangedEvent
extends MailEvent

Extends: java.util.EventObject > MailEvent

此类模拟 Message 更改事件。
英文文档：

This class models Message change events.

Author:
John Mani
See Also:
Serialized Form

Field Summary
static int | ENVELOPE_CHANGED The message's envelope (headers, but not body) changed.
static int | FLAGS_CHANGED The message's flags changed.
protected Message | msg The message that changed.
protected int | type The event type.
Fields inherited from class java.util.EventObject
source
Constructor Summary
MessageChangedEvent(Object source, int type, Message msg)
Constructor.
Method Summary
void | dispatch(Object listener) Invokes the appropriate MessageChangedListener method.
Message | getMessage() Return the changed Message.
int | getMessageChangeType() Return the type of this event.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

FLAGS_CHANGED

public static final int FLAGS_CHANGED
The message's flags changed.

See Also:
Constant Field Values

英文文档：

ENVELOPE_CHANGED

public static final int ENVELOPE_CHANGED
The message's envelope (headers, but not body) changed.

See Also:
Constant Field Values

英文文档：

type

protected int type
The event type.

英文文档：

msg

protected transient Message msg
The message that changed.

Constructor Detail

public MessageChangedEvent(Object source, int type, Message msg)
构造方法。
source | 拥有消息的文件夹
type | 更改类型
msg | 更改的消息
英文文档：

MessageChangedEvent

public MessageChangedEvent(Object source,
                           int type,
                           Message msg)
Constructor.

Parameters:
source - The folder that owns the message
type - The change type
msg - The changed message
Method Detail

public int getMessageChangeType()
返回此事件的类型。
return 类型
英文文档：

getMessageChangeType

public int getMessageChangeType()
Return the type of this event.

Returns:
type

public Message getMessage()
返回更改的消息。
return 消息
英文文档：

getMessage

public Message getMessage()
Return the changed Message.

Returns:
the message

public void dispatch(Object listener)
调用相应的 MessageChangedListener 方法。
英文文档：

dispatch

public void dispatch(Object listener)
Invokes the appropriate MessageChangedListener method.

Specified by:
dispatch in class MailEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageCountAdapter (Java EE 5)

javax.mail.event
Class MessageCountAdapter

java.lang.Object
    extended by  javax.mail.event.MessageCountAdapter
All Implemented Interfaces:
EventListener, MessageCountListener
public abstract class MessageCountAdapter
extends Object
implements MessageCountListener

Implements: MessageCountListener

接收 MessageCount 事件的适配器。此类中的方法为空；提供此类是为了方便，通过扩展此类和重写感兴趣的方法，可以轻松创建侦听器。
英文文档：

The adapter which receives MessageCount events. The methods in this class are empty; this class is provided as a convenience for easily creating listeners by extending this class and overriding only the methods of interest.

Author:
John Mani

Constructor Summary
MessageCountAdapter()
Method Summary
void | messagesAdded(MessageCountEvent e) Invoked when messages are added into a folder.
void | messagesRemoved(MessageCountEvent e) Invoked when messages are removed (expunged) from a folder.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MessageCountAdapter()
英文文档：

MessageCountAdapter

public MessageCountAdapter()
Method Detail

public void messagesAdded(MessageCountEvent e)
英文文档：

messagesAdded

public void messagesAdded(MessageCountEvent e)
Description copied from interface: MessageCountListener
Invoked when messages are added into a folder.

Specified by:
messagesAdded in interface MessageCountListener

public void messagesRemoved(MessageCountEvent e)
英文文档：

messagesRemoved

public void messagesRemoved(MessageCountEvent e)
Description copied from interface: MessageCountListener
Invoked when messages are removed (expunged) from a folder.

Specified by:
messagesRemoved in interface MessageCountListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageCountEvent (Java EE 5)

javax.mail.event
Class MessageCountEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.mail.event.MailEvent
            extended by  javax.mail.event.MessageCountEvent
All Implemented Interfaces:
Serializable
public class MessageCountEvent
extends MailEvent

Extends: java.util.EventObject > MailEvent

此类通知文件夹中消息数量的更改。

注意，在某些时刻或某些操作之后，一些文件夹类型可能只传送 MessageCountEvent。尤其是 IMAP，当客户端发出一个新命令时，它将只通知 MessageCountEvent 的客户端。有关详细信息，请参考 RFC 2060 http://www.ietf.org/rfc/rfc2060.txt。通过不定期地调用 getMessageCount 或 isConnected 方法，客户端可以“轮询”文件夹以请求任何形式的这类通知。

英文文档：

This class notifies changes in the number of messages in a folder.

Note that some folder types may only deliver MessageCountEvents at certain times or after certain operations. IMAP in particular will only notify the client of MessageCountEvents when a client issues a new command. Refer to RFC 2060 http://www.ietf.org/rfc/rfc2060.txt for details. A client may want "poll" the folder by occasionally calling the getMessageCount or isConnected methods to solicit any such notifications.

Author:
John Mani
See Also:
Serialized Form

Field Summary
static int | ADDED The messages were added to their folder
protected Message[] | msgs The messages.
protected boolean | removed If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this.
static int | REMOVED The messages were removed from their folder
protected int | type The event type.
Fields inherited from class java.util.EventObject
source
Constructor Summary
MessageCountEvent(Folder folder, int type, boolean removed, Message[] msgs)
Constructor.
Method Summary
void | dispatch(Object listener) Invokes the appropriate MessageCountListener method.
Message[] | getMessages() Return the array of messages added or removed.
int | getType() Return the type of this event.
boolean | isRemoved() Indicates whether this event is the result of an explicit expunge by this client, or due to an expunge from external sources.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

ADDED

public static final int ADDED
The messages were added to their folder

See Also:
Constant Field Values

英文文档：

REMOVED

public static final int REMOVED
The messages were removed from their folder

See Also:
Constant Field Values

英文文档：

type

protected int type
The event type.

英文文档：

removed

protected boolean removed
If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this. If false, this event is the result of an expunge by external sources.

英文文档：

msgs

protected transient Message[] msgs
The messages.

Constructor Detail

public MessageCountEvent(Folder folder, int type, boolean removed, Message[] msgs)
构造方法。
folder | 包含文件夹
type | 事件类型
removed | 如果为 true，此事件是此客户端显式擦除的结果，而且此文件夹中的消息已为此重新编号。如果为 false，则此事件是外部源擦除的结果。
msgs | 添加/移除的消息
英文文档：

MessageCountEvent

public MessageCountEvent(Folder folder,
                         int type,
                         boolean removed,
                         Message[] msgs)
Constructor.

Parameters:
folder - The containing folder
type - The event type
removed - If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this. If false, this event is the result of an expunge by external sources.
msgs - The messages added/removed
Method Detail

public int getType()
返回此事件的类型。
return 类型
英文文档：

getType

public int getType()
Return the type of this event.

Returns:
type

public boolean isRemoved()
指示此事件是此客户端显式擦除的结果还是由外部源擦除引起的。如果为 true，此事件是由显式擦除引起的，并且此文件夹中的所有剩余消息都为此重新编号。如果为 false，则此事件是由外部擦除引起的。

注意，只有当此事件的类型为 REMOVED 时，此方法才有效

英文文档：

isRemoved

public boolean isRemoved()
Indicates whether this event is the result of an explicit expunge by this client, or due to an expunge from external sources. If true, this event is due to an explicit expunge and hence all remaining messages in this folder have been renumbered. If false, this event is due to an external expunge.

Note that this method is valid only if the type of this event is REMOVED

public Message[] getMessages()
返回添加或移除的消息数组。
return 消息数组
英文文档：

getMessages

public Message[] getMessages()
Return the array of messages added or removed.

Returns:
array of messages

public void dispatch(Object listener)
调用相应的 MessageCountListener 方法。
英文文档：

dispatch

public void dispatch(Object listener)
Invokes the appropriate MessageCountListener method.

Specified by:
dispatch in class MailEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StoreEvent (Java EE 5)

javax.mail.event
Class StoreEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.mail.event.MailEvent
            extended by  javax.mail.event.StoreEvent
All Implemented Interfaces:
Serializable
public class StoreEvent
extends MailEvent

Extends: java.util.EventObject > MailEvent

此类模拟来自 Store 连接的通知。这些通知可以是 ALERT 或 NOTICE。ALERT 必须以一种能引起用户注意该消息的方式呈现给用户。
英文文档：

This class models notifications from the Store connection. These notifications can be ALERTS or NOTICES. ALERTS must be presented to the user in a fashion that calls the user's attention to the message.

Author:
John Mani
See Also:
Serialized Form

Field Summary
static int | ALERT Indicates that this message is an ALERT.
protected String | message The message text to be presented to the user.
static int | NOTICE Indicates that this message is a NOTICE.
protected int | type The event type.
Fields inherited from class java.util.EventObject
source
Constructor Summary
StoreEvent(Store store, int type, String message)
Constructor.
Method Summary
void | dispatch(Object listener) Invokes the appropriate StoreListener method.
String | getMessage() Get the message from the Store.
int | getMessageType() Return the type of this event.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

ALERT

public static final int ALERT
Indicates that this message is an ALERT.

See Also:
Constant Field Values

英文文档：

NOTICE

public static final int NOTICE
Indicates that this message is a NOTICE.

See Also:
Constant Field Values

英文文档：

type

protected int type
The event type.

英文文档：

message

protected String message
The message text to be presented to the user.

Constructor Detail

public StoreEvent(Store store, int type, String message)
构造方法。
store 源 Store
英文文档：

StoreEvent

public StoreEvent(Store store,
                  int type,
                  String message)
Constructor.

Parameters:
store - The source Store
Method Detail

public int getMessageType()
返回此事件的类型。
return | 类型
See also | ALERT, NOTICE
英文文档：

getMessageType

public int getMessageType()
Return the type of this event.

Returns:
type
See Also:
ALERT, NOTICE

public String getMessage()
获取来自 Store 的消息。
return 来自 Store 的消息
英文文档：

getMessage

public String getMessage()
Get the message from the Store.

Returns:
message from the Store

public void dispatch(Object listener)
调用相应的 StoreListener 方法。
英文文档：

dispatch

public void dispatch(Object listener)
Invokes the appropriate StoreListener method.

Specified by:
dispatch in class MailEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransportAdapter (Java EE 5)

javax.mail.event
Class TransportAdapter

java.lang.Object
    extended by  javax.mail.event.TransportAdapter
All Implemented Interfaces:
EventListener, TransportListener
public abstract class TransportAdapter
extends Object
implements TransportListener

Implements: TransportListener

接收 Transport 事件的适配器。此类中的方法为空；提供此类是为了方便，通过扩展此类和重写感兴趣的方法，可以轻松创建侦听器。
英文文档：

The adapter which receives Transport events. The methods in this class are empty; this class is provided as a convenience for easily creating listeners by extending this class and overriding only the methods of interest.

Author:
John Mani

Constructor Summary
TransportAdapter()
Method Summary
void | messageDelivered(TransportEvent e) Invoked when a Message is succesfully delivered.
void | messageNotDelivered(TransportEvent e) Invoked when a Message is not delivered.
void | messagePartiallyDelivered(TransportEvent e) Invoked when a Message is partially delivered.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public TransportAdapter()
英文文档：

TransportAdapter

public TransportAdapter()
Method Detail

public void messageDelivered(TransportEvent e)
英文文档：

messageDelivered

public void messageDelivered(TransportEvent e)
Description copied from interface: TransportListener
Invoked when a Message is succesfully delivered.

Specified by:
messageDelivered in interface TransportListener
Parameters:
e - TransportEvent

public void messageNotDelivered(TransportEvent e)
英文文档：

messageNotDelivered

public void messageNotDelivered(TransportEvent e)
Description copied from interface: TransportListener
Invoked when a Message is not delivered.

Specified by:
messageNotDelivered in interface TransportListener
Parameters:
e - TransportEvent
See Also:
TransportEvent

public void messagePartiallyDelivered(TransportEvent e)
英文文档：

messagePartiallyDelivered

public void messagePartiallyDelivered(TransportEvent e)
Description copied from interface: TransportListener
Invoked when a Message is partially delivered.

Specified by:
messagePartiallyDelivered in interface TransportListener
Parameters:
e - TransportEvent
See Also:
TransportEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransportEvent (Java EE 5)

javax.mail.event
Class TransportEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.mail.event.MailEvent
            extended by  javax.mail.event.TransportEvent
All Implemented Interfaces:
Serializable
public class TransportEvent
extends MailEvent

Extends: java.util.EventObject > MailEvent

此类模拟 Transport 事件。
See also javax.mail.Transport, javax.mail.event.TransportListener
英文文档：

This class models Transport events.

Author:
John Mani, Max Spivak
See Also:
Transport, TransportListener, Serialized Form

Field Summary
protected Address[] | invalid
static int | MESSAGE_DELIVERED Message has been successfully delivered to all recipients by the transport firing this event. validSent[] contains all the addresses this transport sent to successfully. validUnsent[] and invalid[] should be null,
static int | MESSAGE_NOT_DELIVERED Message was not sent for some reason. validSent[] should be null.
static int | MESSAGE_PARTIALLY_DELIVERED Message was successfully sent to some recipients but not to all.
protected Message | msg
protected int | type The event type.
protected Address[] | validSent
protected Address[] | validUnsent
Fields inherited from class java.util.EventObject
source
Constructor Summary
TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg)
Constructor.
Method Summary
void | dispatch(Object listener) Invokes the appropriate TransportListener method.
Address[] | getInvalidAddresses() Return the addresses to which this message could not be sent.
Message | getMessage() Get the Message object associated with this Transport Event.
int | getType() Return the type of this event.
Address[] | getValidSentAddresses() Return the addresses to which this message was sent succesfully.
Address[] | getValidUnsentAddresses() Return the addresses that are valid but to which this message was not sent.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

MESSAGE_DELIVERED

public static final int MESSAGE_DELIVERED
Message has been successfully delivered to all recipients by the transport firing this event. validSent[] contains all the addresses this transport sent to successfully. validUnsent[] and invalid[] should be null,

See Also:
Constant Field Values

英文文档：

MESSAGE_NOT_DELIVERED

public static final int MESSAGE_NOT_DELIVERED
Message was not sent for some reason. validSent[] should be null. validUnsent[] may have addresses that are valid (but the message wasn't sent to them). invalid[] should likely contain invalid addresses.

See Also:
Constant Field Values

英文文档：

MESSAGE_PARTIALLY_DELIVERED

public static final int MESSAGE_PARTIALLY_DELIVERED
Message was successfully sent to some recipients but not to all. validSent[] holds addresses of recipients to whom the message was sent. validUnsent[] holds valid addresses to which the message was not sent. invalid[] holds invalid addresses, if any.

See Also:
Constant Field Values

英文文档：

type

protected int type
The event type.

英文文档：

validSent

protected transient Address[] validSent

英文文档：

validUnsent

protected transient Address[] validUnsent

英文文档：

invalid

protected transient Address[] invalid

英文文档：

msg

protected transient Message msg
Constructor Detail

public TransportEvent(Transport transport, int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg)
构造方法。
transport Transport 对象
英文文档：

TransportEvent

public TransportEvent(Transport transport,
                      int type,
                      Address[] validSent,
                      Address[] validUnsent,
                      Address[] invalid,
                      Message msg)
Constructor.

Parameters:
transport - The Transport object
Method Detail

public int getType()
返回此事件的类型。
return 类型
英文文档：

getType

public int getType()
Return the type of this event.

Returns:
type

public Address[] getValidSentAddresses()
返回此消息成功发送到的地址。
return 成功将消息发送到的地址，或者返回 null
英文文档：

getValidSentAddresses

public Address[] getValidSentAddresses()
Return the addresses to which this message was sent succesfully.

Returns:
Addresses to which the message was sent successfully or null

public Address[] getValidUnsentAddresses()
返回未向其发送此消息的有效地址。
return 有效但未能成功将消息发送到的地址，或者返回 null
英文文档：

getValidUnsentAddresses

public Address[] getValidUnsentAddresses()
Return the addresses that are valid but to which this message was not sent.

Returns:
Addresses that are valid but to which the message was not sent successfully or null

public Address[] getInvalidAddresses()
返回无法向其发送此消息的地址。
return 消息发送失败的地址，或者返回 null
英文文档：

getInvalidAddresses

public Address[] getInvalidAddresses()
Return the addresses to which this message could not be sent.

Returns:
Addresses to which the message sending failed or null

public Message getMessage()
获取与此 TransportEvent 关联的 Message 对象。
return Message 对象
since
en
JavaMail 1.2
英文文档：

getMessage

public Message getMessage()
Get the Message object associated with this Transport Event.

Returns:
the Message object
Since:
JavaMail 1.2

public void dispatch(Object listener)
调用相应的 TransportListener 方法。
英文文档：

dispatch

public void dispatch(Object listener)
Invokes the appropriate TransportListener method.

Specified by:
dispatch in class MailEvent
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.mail.internet (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.mail.internet

Classes specific to Internet mail systems.

See:
Description

Interface Summary
MimePart | The MimePart interface models an Entity as defined by MIME (RFC2045, Section 2.4).
SharedInputStream | An InputStream that is backed by data that can be shared by multiple readers may implement this interface.

Class Summary
ContentDisposition | This class represents a MIME ContentDisposition value.
ContentType | This class represents a MIME ContentType value.
HeaderTokenizer | This class tokenizes RFC822 and MIME headers into the basic symbols specified by RFC822 and MIME.
HeaderTokenizer.Token | The Token class represents tokens returned by the HeaderTokenizer.
InternetAddress | This class represents an Internet email address using the syntax of RFC822.
InternetHeaders | InternetHeaders is a utility class that manages RFC822 style headers.
InternetHeaders.InternetHeader | An individual internet header.
MailDateFormat | Formats and parses date specification based on the draft-ietf-drums-msg-fmt-08 dated January 26, 2000.
MimeBodyPart | This class represents a MIME body part.
MimeMessage | This class represents a MIME style email message.
MimeMessage.RecipientType | This inner class extends the javax.mail.Message.RecipientType class to add additional RecipientTypes.
MimeMultipart | The MimeMultipart class is an implementation of the abstract Multipart class that uses MIME conventions for the multipart data.
MimePartDataSource | A utility class that implements a DataSource out of a MimePart.
MimeUtility | This is a utility class that provides various MIME related functionality.
NewsAddress | This class models an RFC1036 newsgroup address.
ParameterList | This class holds MIME parameters (attribute-value pairs).
PreencodedMimeBodyPart | A MimeBodyPart that handles data that has already been encoded.

Exception Summary
AddressException | The exception thrown when a wrongly formatted address is encountered.
ParseException | The exception thrown due to an error in parsing RFC822 or MIME headers

Package javax.mail.internet Description

Classes specific to Internet mail systems. This package supports features that are specific to Internet mail systems based on the MIME standard (RFC 2045, RFC 2046, and RFC 2047). The IMAP, SMTP, and POP3 protocols use MimeMessages.

The JavaMail API specification requires support for the following properties, which must be set in the System properties. The properties are always set as strings; the Type column describes how the string is interpreted. For example, use (in J2SE 1.2 and newer)

        System.setProperty("mail.mime.address.strict", "false");
to set the mail.mime.address.strict property, which is of type boolean.

Name | Type | Description
mail.mime.address.strict | boolean | The mail.mime.address.strict session property controls the parsing of address headers. By default, strict parsing of address headers is done. If this property is set to "false", strict parsing is not done and many illegal addresses that sometimes occur in real messages are allowed. See the InternetAddress class for details.
mail.mime.charset | String | The mail.mime.charset System property can be used to specify the default MIME charset to use for encoded words and text parts that don't otherwise specify a charset. Normally, the default MIME charset is derived from the default Java charset, as specified in the file.encoding System property. Most applications will have no need to explicitly set the default MIME charset. In cases where the default MIME charset to be used for mail messages is different than the charset used for files stored on the system, this property should be set.
mail.mime.decodetext.strict | boolean | The mail.mime.decodetext.strict property controls decoding of MIME encoded words. The MIME spec requires that encoded words start at the beginning of a whitespace separated word. Some mailers incorrectly include encoded words in the middle of a word. If the mail.mime.decodetext.strict System property is set to "false", an attempt will be made to decode these illegal encoded words. The default is true.
mail.mime.encodeeol.strict | boolean | The mail.mime.encodeeol.strict property controls the choice of Content-Transfer-Encoding for MIME parts that are not of type "text". Often such parts will contain textual data for which an encoding that allows normal end of line conventions is appropriate. In rare cases, such a part will appear to contain entirely textual data, but will require an encoding that preserves CR and LF characters without change. If the mail.mime.encodeeol.strict System property is set to "true", such an encoding will be used when necessary. The default is false.
mail.mime.decodefilename | boolean | If set to "true", the getFileName method uses the MimeUtility method decodeText to decode any non-ASCII characters in the filename. Note that this decoding violates the MIME specification, but is useful for interoperating with some mail clients that use this convention. The default is false.
mail.mime.encodefilename | boolean | If set to "true", the setFileName method uses the MimeUtility method encodeText to encode any non-ASCII characters in the filename. Note that this encoding violates the MIME specification, but is useful for interoperating with some mail clients that use this convention. The default is false.
mail.mime.decodeparameters | boolean | If set to "true", non-ASCII parameters in a ParameterList, e.g., in a Content-Type header, will be encoded as specified by RFC 2231. The default is false.
mail.mime.encodeparameters | boolean | If set to "true", non-ASCII parameters in a ParameterList, e.g., in a Content-Type header, will be decoded as specified by RFC 2231. The default is false.
mail.mime.multipart. ignoremissingendboundary | boolean | Normally, when parsing a multipart MIME message, a message that is missing the final end boundary line is not considered an error. The data simply ends at the end of the input. Note that messages of this form violate the MIME specification. If the property mail.mime.multipart.ignoremissingendboundary is set to false, such messages are considered an error and a MesagingException will be thrown when parsing such a message.
mail.mime.multipart. ignoremissingboundaryparameter | boolean | If the Content-Type header for a multipart content does not have a boundary parameter, the multipart parsing code will look for the first line in the content that looks like a boundary line and extract the boundary parameter from the line. If this property is set to "false", a MessagingException will be thrown if the Content-Type header doesn't specify a boundary parameter. The default is true.

The following properties are supported by Sun's implementation of JavaMail, but are not currently a required part of the specification. As above, these must be set as System properties. The names, types, defaults, and semantics of these properties may change in future releases.

Name | Type | Description
mail.mime.base64.ignoreerrors | boolean | If set to "true", the BASE64 decoder will ignore errors in the encoded data, returning EOF. This may be useful when dealing with improperly encoded messages that contain extraneous data at the end of the encoded stream. Note however that errors anywhere in the stream will cause the decoder to stop decoding so this should be used with extreme caution. The default is false.
mail.mime.foldtext | boolean | If set to "true", header fields containing just text such as the Subject and Content-Description header fields, and long parameter values in structured headers such as Content-Type will be folded (broken into 76 character lines) when set and unfolded when read. The default is true.
mail.mime.setcontenttypefilename | boolean | If set to "true", the setFileName method will also set the name parameter on the Content-Type header to the specified filename. This supports interoperability with some old mail clients. The default is true.
mail.mime.setdefaulttextcharset | boolean | When updating the headers of a message, a body part with a text content type but no charset parameter will have a charset parameter added to it if this property is set to "true". The default is true.
mail.mime.applefilenames | boolean | Apple Mail incorrectly encodes filenames that contain spaces, forgetting to quote the parameter value. If this property is set to "true", JavaMail will try to detect this situation when parsing parameters and work around it. The default is false.
mail.alternates | String | A string containing other email addresses that the current user is known by. The MimeMessage reply method will eliminate any of these addresses from the recipient list in the message it constructs, to avoid sending the reply back to the sender.
mail.replyallcc | boolean | If set to "true", the MimeMessage reply method will put all recipients except the original sender in the Cc list of the newly constructed message. Normally, recipients in the To header of the original message will also appear in the To list of the newly constructed message.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.mail.internet Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.mail.internet

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.mail.Address (implements java.io.Serializable)
      • javax.mail.internet.InternetAddress (implements java.lang.Cloneable)
      • javax.mail.internet.NewsAddress
    • javax.mail.BodyPart (implements javax.mail.Part)
      • javax.mail.internet.MimeBodyPart (implements javax.mail.internet.MimePart)
        • javax.mail.internet.PreencodedMimeBodyPart
    • javax.mail.internet.ContentDisposition
    • javax.mail.internet.ContentType
    • java.text.Format (implements java.lang.Cloneable, java.io.Serializable)
      • java.text.DateFormat
        • java.text.SimpleDateFormat
          • javax.mail.internet.MailDateFormat
    • javax.mail.Header
      • javax.mail.internet.InternetHeaders.InternetHeader
    • javax.mail.internet.HeaderTokenizer
    • javax.mail.internet.HeaderTokenizer.Token
    • javax.mail.internet.InternetHeaders
    • javax.mail.Message (implements javax.mail.Part)
      • javax.mail.internet.MimeMessage (implements javax.mail.internet.MimePart)
    • javax.mail.Message.RecipientType (implements java.io.Serializable)
      • javax.mail.internet.MimeMessage.RecipientType
    • javax.mail.internet.MimePartDataSource (implements javax.activation.DataSource, javax.mail.MessageAware)
    • javax.mail.internet.MimeUtility
    • javax.mail.Multipart
      • javax.mail.internet.MimeMultipart
    • javax.mail.internet.ParameterList
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.mail.MessagingException
          • javax.mail.internet.ParseException
            • javax.mail.internet.AddressException

Interface Hierarchy

  • javax.mail.Part
    • javax.mail.internet.MimePart
  • javax.mail.internet.SharedInputStream
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


MimePart (Java EE 5)

javax.mail.internet
Interface MimePart

All Superinterfaces:
Part
All Known Implementing Classes:
MimeBodyPart, MimeMessage, PreencodedMimeBodyPart
public interface MimePart
extends Part

Implements: Part
Implemented by: MimeBodyPart, MimeMessage

MimePart 接口建模 MIME（RFC 2045，Section 2.4）定义的实体。

MimePart 扩展了 Part 接口，添加了其他 RFC822 和 MIME 特有的语义和属性。它为 MimeMessage 和 MimeBodyPart 类提供基本接口。

有关 RFC822 和 MIME 头的注意事项

RFC822 和 MIME 头字段只能包含 US-ASCII 字符。如果头包含非 US-ASCII 字符，则它必须根据 RFC 2047 的规则进行编码。此包提供的 MimeUtility 类可以用于实现这一点。setHeader、addHeader 和 addHeaderLine 方法的调用者负责针对特定的头强制执行 MIME 要求。此外，如果这些头字段超过了传输的行长度限制（SMTP 1000 字节），则发送前必须进行折叠（包装）。收到的头可能已经进行了折叠。应用程序负责根据需要折叠和展开头。

See also javax.mail.internet.MimeUtility, javax.mail.Part
英文文档：

The MimePart interface models an Entity as defined by MIME (RFC2045, Section 2.4).

MimePart extends the Part interface to add additional RFC822 and MIME specific semantics and attributes. It provides the base interface for the MimeMessage and MimeBodyPart classes

A note on RFC822 and MIME headers

RFC822 and MIME header fields must contain only US-ASCII characters. If a header contains non US-ASCII characters, it must be encoded as per the rules in RFC 2047. The MimeUtility class provided in this package can be used to to achieve this. Callers of the setHeader, addHeader, and addHeaderLine methods are responsible for enforcing the MIME requirements for the specified headers. In addition, these header fields must be folded (wrapped) before being sent if they exceed the line length limitation for the transport (1000 bytes for SMTP). Received headers may have been folded. The application is responsible for folding and unfolding headers as appropriate.

Author:
John Mani
See Also:
MimeUtility, Part

Field Summary
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
Method Summary
void | addHeaderLine(String line) Add a raw RFC822 header-line.
Enumeration | getAllHeaderLines() Get all header lines as an Enumeration of Strings.
String | getContentID() Get the Content-ID of this part.
String[] | getContentLanguage() Get the language tags specified in the Content-Language header of this MimePart.
String | getContentMD5() Get the Content-MD5 digest of this part.
String | getEncoding() Get the transfer encoding of this part.
String | getHeader(String name, String delimiter) Get the values of all header fields available for this header, returned as a single String, with the values separated by the delimiter.
Enumeration | getMatchingHeaderLines(String[] names) Get matching header lines as an Enumeration of Strings.
Enumeration | getNonMatchingHeaderLines(String[] names) Get non-matching header lines as an Enumeration of Strings.
void | setContentLanguage(String[] languages) Set the Content-Language header of this MimePart.
void | setContentMD5(String md5) Set the Content-MD5 of this part.
void | setText(String text) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".
void | setText(String text, String charset) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.
void | setText(String text, String charset, String subtype) Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.
Methods inherited from interface javax.mail.Part
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader, writeTo

Method Detail

public String getHeader(String name, String delimiter) throws MessagingException
获取此头可用的所有头字段的值，以单个 String 的形式返回，值之间用 delimiter 分隔。如果 delimiter 为 null，则仅返回第一个值。
name | 此头的名称
delimiter | 返回字符串中头之间的分界符
return | 具有此名称的所有头的值字段
Throws | MessagingException:
英文文档：

getHeader

String getHeader(String name,
                 String delimiter)
                 throws MessagingException
Get the values of all header fields available for this header, returned as a single String, with the values separated by the delimiter. If the delimiter is null, only the first value is returned.

Parameters:
name - the name of this header
delimiter - delimiter between fields in returned string
Returns:
the value fields for all headers with this name
Throws:
MessagingException

public void addHeaderLine(String line) throws MessagingException
添加一个原始 RFC822 头行。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

addHeaderLine

void addHeaderLine(String line)
                   throws MessagingException
Add a raw RFC822 header-line.

Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this Part is obtained from a READ_ONLY folder
MessagingException

public java.util.Enumeration<E> getAllHeaderLines() throws MessagingException
以 String 枚举的形式获取所有头行。Header 行是原始 RFC822 头行，包含 "name" 和 "value" 字段。
英文文档：

getAllHeaderLines

Enumeration getAllHeaderLines()
                              throws MessagingException
Get all header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

Throws:
MessagingException

public java.util.Enumeration<E> getMatchingHeaderLines(String[] names) throws MessagingException
以 String 枚举的形式获取匹配的头行。Header 行是原始 RFC822 头行，包含 "name" 和 "value" 字段。
英文文档：

getMatchingHeaderLines

Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

Throws:
MessagingException

public java.util.Enumeration<E> getNonMatchingHeaderLines(String[] names) throws MessagingException
以 String 枚举的形式获取不匹配的头行。Header 行是原始 RFC822 头行，包含 "name" 和 "value" 字段。
英文文档：

getNonMatchingHeaderLines

Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

Throws:
MessagingException

public String getEncoding() throws MessagingException
获取此部分的传输编码。
return | 内容传输编码
Throws | MessagingException:
英文文档：

getEncoding

String getEncoding()
                   throws MessagingException
Get the transfer encoding of this part.

Returns:
content-transfer-encoding
Throws:
MessagingException

public String getContentID() throws MessagingException
获取此部分的 Content-ID。如果不存在，则返回 null。
return 内容 ID
英文文档：

getContentID

String getContentID()
                    throws MessagingException
Get the Content-ID of this part. Returns null if none present.

Returns:
content-ID
Throws:
MessagingException

public String getContentMD5() throws MessagingException
获取此部分的 Content-MD5 摘要。如果不存在，则返回 null。
return 内容 MD5
英文文档：

getContentMD5

String getContentMD5()
                     throws MessagingException
Get the Content-MD5 digest of this part. Returns null if none present.

Returns:
content-MD5
Throws:
MessagingException

public void setContentMD5(String md5) throws MessagingException
设置此部分的 Content-MD5。
md5 | MD5 值
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setContentMD5

void setContentMD5(String md5)
                   throws MessagingException
Set the Content-MD5 of this part.

Parameters:
md5 - the MD5 value
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this Part is obtained from a READ_ONLY folder
MessagingException

public String[] getContentLanguage() throws MessagingException
获取在此 MimePart 的 Content-Language 头中指定的语言标记。Content-Language 头由 RFC 1766 定义。如果此头不可用，则返回 null。
英文文档：

getContentLanguage

String[] getContentLanguage()
                            throws MessagingException
Get the language tags specified in the Content-Language header of this MimePart. The Content-Language header is defined by RFC 1766. Returns null if this header is not available.

Throws:
MessagingException

public void setContentLanguage(String[] languages) throws MessagingException
设置此 MimePart 的 Content-Language 头。Content-Language 头由 RFC 1766 定义。
languages | 语言标记数组
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此 Part 可从 READ_ONLY 文件夹获取
英文文档：

setContentLanguage

void setContentLanguage(String[] languages)
                        throws MessagingException
Set the Content-Language header of this MimePart. The Content-Language header is defined by RFC1766.

Parameters:
languages - array of language tags
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this Part is obtained from a READ_ONLY folder
MessagingException

public void setText(String text) throws MessagingException
使用 MIME 类型 "text/plain" 将给定的 String 设置为此部分内容的便捷方法。如果 string 包含非 US-ASCII 字符，则它将使用平台的默认字符集进行编码。也使用该字符集设置 "charset" 参数。

注意，如果 text 很大，可能会影响性能，因为此方法必须扫描所有字符以确定使用哪种字符集。

如果字符集已知，则使用带有 charset 参数的 setText 方法。

text | 要设置的文本内容
Throws | MessagingException: 如果发生错误
See also | setText(String text, String charset)
英文文档：

setText

void setText(String text)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". If the string contains non US-ASCII characters. it will be encoded using the platform's default charset. The charset is also used to set the "charset" parameter.

Note that there may be a performance penalty if text is large, since this method may have to scan all the characters to determine what charset to use.

If the charset is already known, use the setText method that takes the charset parameter.

Specified by:
setText in interface Part
Parameters:
text - the text content to set
Throws:
MessagingException - if an error occurs
See Also:
setText(String text, String charset)

public void setText(String text, String charset) throws MessagingException
使用 MIME 类型 "text/plain" 和指定字符集将给定 String 设置为此部分内容的便捷方法。给定的 Unicode 字符串将使用指定的字符集进行编码。也使用该字符集设置 "charset" 参数。
text | 要设置的文本内容
charset | 用于文本的字符集
Throws | MessagingException: 如果发生错误
英文文档：

setText

void setText(String text,
             String charset)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set "charset" parameter.

Parameters:
text - the text content to set
charset - the charset to use for the text
Throws:
MessagingException - if an error occurs

public void setText(String text, String charset, String subtype) throws MessagingException
使用基本 MIME 类型 "text" 和指定 MIME 子类型将给定的 String 设置为此部分内容的便捷方法。给定的 Unicode 字符串将使用指定的字符集进行编码。也使用该字符集设置 "charset" 参数。
text | 要设置的文本内容
charset | 用于文本的字符集
subtype | 要使用的 MIME 子类型（如 "html"）
Throws | MessagingException: 如果发生错误
since
en
JavaMail 1.4
英文文档：

setText

void setText(String text,
             String charset,
             String subtype)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.

Parameters:
text - the text content to set
charset - the charset to use for the text
subtype - the MIME subtype to use (e.g., "html")
Throws:
MessagingException - if an error occurs
Since:
JavaMail 1.4
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SharedInputStream (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.internet
Interface SharedInputStream

All Known Implementing Classes:
SharedByteArrayInputStream, SharedFileInputStream
public interface SharedInputStream

Implemented by: SharedByteArrayInputStream, SharedFileInputStream

可供多个 reader 共享的数据所支持的 InputStream 可以实现此接口。这允许此类 InputStream 的用户确定在 InputStream 中的当前位置，并创建表示原 InputStream 数据的子集的新 InputStream。新的 InputStream 将与原 InputStream 访问同一底层数据，不复制数据。

注意，此接口的实现必须确保，在所有共享实例被关闭前，close 方法不关闭任何可能由多个 SharedInputStream 实例共享的底层流。

version 1.5, 07/05/04
since
en
JavaMail 1.2
英文文档：

An InputStream that is backed by data that can be shared by multiple readers may implement this interface. This allows users of such an InputStream to determine the current position in the InputStream, and to create new InputStreams representing a subset of the data in the original InputStream. The new InputStream will access the same underlying data as the original, without copying the data.

Note that implementations of this interface must ensure that the close method does not close any underlying stream that might be shared by multiple instances of SharedInputStream until all shared instances have been closed.

Since:
JavaMail 1.2
Version:
1.5, 07/05/04
Author:
Bill Shannon

Method Summary
long | getPosition() Return the current position in the InputStream, as an offset from the beginning of the InputStream.
InputStream | newStream(long start, long end) Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive).

Method Detail

public long getPosition()
返回 InputStream 中的当前位置，形式为距 InputStream 开头的偏移量。
return 当前位置
英文文档：

getPosition

long getPosition()
Return the current position in the InputStream, as an offset from the beginning of the InputStream.

Returns:
the current position

public java.io.InputStream newStream(long start, long end)
返回表示此 InputStream 数据的子集的新 InputStream，从 start（包括）开始，一直到 end（不包括）结束。start 必须为非负数。如果 end 为 -1，则新流的结束位置与此流相同。返回的 InputStream 也将实现 SharedInputStream 接口。
start | 起始位置
end | 结束位置 + 1
return | 新流
英文文档：

newStream

InputStream newStream(long start,
                      long end)
Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive). start must be non-negative. If end is -1, the new stream ends at the same place as this stream. The returned InputStream will also implement the SharedInputStream interface.

Parameters:
start - the starting position
end - the ending position + 1
Returns:
the new stream
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ContentDisposition (Java EE 5)

javax.mail.internet
Class ContentDisposition

java.lang.Object
    extended by  javax.mail.internet.ContentDisposition

public class ContentDisposition
extends Object

此类表示一个 MIME ContentDisposition 值。它提供一些可将 ContentDisposition 字符串解析成单个组件并生成一个 MIME 样式的 ContentDisposition 字符串的方法。
version 1.9, 07/05/04
英文文档：

This class represents a MIME ContentDisposition value. It provides methods to parse a ContentDisposition string into individual components and to generate a MIME style ContentDisposition string.

Version:
1.9, 07/05/04
Author:
John Mani

Constructor Summary
ContentDisposition()
No-arg Constructor.
ContentDisposition(String s)
Constructor that takes a ContentDisposition string.
ContentDisposition(String disposition, ParameterList list)
Constructor.
Method Summary
String | getDisposition() Return the disposition value.
String | getParameter(String name) Return the specified parameter value.
ParameterList | getParameterList() Return a ParameterList object that holds all the available parameters.
void | setDisposition(String disposition) Set the disposition.
void | setParameter(String name, String value) Set the specified parameter.
void | setParameterList(ParameterList list) Set a new ParameterList.
String | toString() Retrieve a RFC2045 style string representation of this ContentDisposition.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ContentDisposition()
无参数构造方法。
英文文档：

ContentDisposition

public ContentDisposition()
No-arg Constructor.

public ContentDisposition(String disposition, ParameterList list)
构造方法。
disposition
en
disposition
list
en
ParameterList
since
en
JavaMail 1.2
英文文档：

ContentDisposition

public ContentDisposition(String disposition,
                          ParameterList list)
Constructor.

Parameters:
disposition - disposition
list - ParameterList
Since:
JavaMail 1.2

public ContentDisposition(String s) throws ParseException
带有 ContentDisposition 字符串的构造方法。String 被解析为它的组成部分：Dispostion 和参数。如果解析失败，则抛出 ParseException。
s | ContentDisposition 字符串。
Throws | ParseException: 如果解析失败。
since
en
JavaMail 1.2
英文文档：

ContentDisposition

public ContentDisposition(String s)
                   throws ParseException
Constructor that takes a ContentDisposition string. The String is parsed into its constituents: dispostion and parameters. A ParseException is thrown if the parse fails.

Parameters:
s - the ContentDisposition string.
Throws:
ParseException - if the parse fails.
Since:
JavaMail 1.2
Method Detail

public String getDisposition()
返回 disposition 值。
return disposition
since
en
JavaMail 1.2
英文文档：

getDisposition

public String getDisposition()
Return the disposition value.

Returns:
the disposition
Since:
JavaMail 1.2

public String getParameter(String name)
返回指定的参数值。如果此参数不存在，则返回 null。
return 参数值
since
en
JavaMail 1.2
英文文档：

getParameter

public String getParameter(String name)
Return the specified parameter value. Returns null if this parameter is absent.

Returns:
parameter value
Since:
JavaMail 1.2

public ParameterList getParameterList()
返回保存所有可用参数的 ParameterList 对象。如果没有任何参数可用，则返回 null。
return
en
ParameterList
since
en
JavaMail 1.2
英文文档：

getParameterList

public ParameterList getParameterList()
Return a ParameterList object that holds all the available parameters. Returns null if no parameters are available.

Returns:
ParameterList
Since:
JavaMail 1.2

public void setDisposition(String disposition)
设置 disposition。替换现有的 disposition。
disposition disposition
since
en
JavaMail 1.2
英文文档：

setDisposition

public void setDisposition(String disposition)
Set the disposition. Replaces the existing disposition.

Parameters:
disposition - the disposition
Since:
JavaMail 1.2

public void setParameter(String name, String value)
设置指定的参数。如果此参数已经存在，则使用此新值替代它。
name | 参数名称
value | 参数值
since
en
JavaMail 1.2
英文文档：

setParameter

public void setParameter(String name,
                         String value)
Set the specified parameter. If this parameter already exists, it is replaced by this new value.

Parameters:
name - parameter name
value - parameter value
Since:
JavaMail 1.2

public void setParameterList(ParameterList list)
设置一个新的 ParameterList。
list
en
ParameterList
since
en
JavaMail 1.2
英文文档：

setParameterList

public void setParameterList(ParameterList list)
Set a new ParameterList.

Parameters:
list - ParameterList
Since:
JavaMail 1.2

public String toString()
获取此 ContentDisposition 的 RFC2045 样式字符串表示形式。如果转换失败，则返回 null。
return RFC2045 样式字符串
since
en
JavaMail 1.2
英文文档：

toString

public String toString()
Retrieve a RFC2045 style string representation of this ContentDisposition. Returns null if the conversion failed.

Overrides:
toString in class Object
Returns:
RFC2045 style string
Since:
JavaMail 1.2
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ContentType (Java EE 5)

javax.mail.internet
Class ContentType

java.lang.Object
    extended by  javax.mail.internet.ContentType

public class ContentType
extends Object

此类表示一个 MIME ContentType 值。它提供一些可将 ContentType 字符串解析为单个组件并生成一个 MIME 样式的 ContentType 字符串的方法。
version 1.10, 07/05/04
英文文档：

This class represents a MIME ContentType value. It provides methods to parse a ContentType string into individual components and to generate a MIME style ContentType string.

Version:
1.10, 07/05/04
Author:
John Mani

Constructor Summary
ContentType()
No-arg Constructor.
ContentType(String s)
Constructor that takes a Content-Type string.
ContentType(String primaryType, String subType, ParameterList list)
Constructor.
Method Summary
String | getBaseType() Return the MIME type string, without the parameters.
String | getParameter(String name) Return the specified parameter value.
ParameterList | getParameterList() Return a ParameterList object that holds all the available parameters.
String | getPrimaryType() Return the primary type.
String | getSubType() Return the subType.
boolean | match(ContentType cType) Match with the specified ContentType object.
boolean | match(String s) Match with the specified content-type string.
void | setParameter(String name, String value) Set the specified parameter.
void | setParameterList(ParameterList list) Set a new ParameterList.
void | setPrimaryType(String primaryType) Set the primary type.
void | setSubType(String subType) Set the subType.
String | toString() Retrieve a RFC2045 style string representation of this Content-Type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ContentType()
无参数构造方法。
英文文档：

ContentType

public ContentType()
No-arg Constructor.

public ContentType(String primaryType, String subType, ParameterList list)
构造方法。
primaryType 基本类型
subType
en
subType
list
en
ParameterList
英文文档：

ContentType

public ContentType(String primaryType,
                   String subType,
                   ParameterList list)
Constructor.

Parameters:
primaryType - primary type
subType - subType
list - ParameterList

public ContentType(String s) throws ParseException
带有 Content-Type 字符串的构造方法。String 被解析为它的组成部分：primaryType、subType 和参数。如果解析失败，则抛出 ParseException。
s | Content-Type 字符串。
Throws | ParseException: 如果解析失败。
英文文档：

ContentType

public ContentType(String s)
            throws ParseException
Constructor that takes a Content-Type string. The String is parsed into its constituents: primaryType, subType and parameters. A ParseException is thrown if the parse fails.

Parameters:
s - the Content-Type string.
Throws:
ParseException - if the parse fails.
Method Detail

public String getPrimaryType()
返回基本类型。
return 基本类型
英文文档：

getPrimaryType

public String getPrimaryType()
Return the primary type.

Returns:
the primary type

public String getSubType()
返回 subType。
return subType
英文文档：

getSubType

public String getSubType()
Return the subType.

Returns:
the subType

public String getBaseType()
返回 MIME 类型的字符串，不带参数。返回的值通常是 primaryType、'/' 字符和 secondaryType 连接而成的字符串。
return 类型
英文文档：

getBaseType

public String getBaseType()
Return the MIME type string, without the parameters. The returned value is basically the concatenation of the primaryType, the '/' character and the secondaryType.

Returns:
the type

public String getParameter(String name)
返回指定的参数值。如果此参数不存在，则返回 null。
return 参数值
英文文档：

getParameter

public String getParameter(String name)
Return the specified parameter value. Returns null if this parameter is absent.

Returns:
parameter value

public ParameterList getParameterList()
返回保存所有可用参数的 ParameterList 对象。如果没有任何参数可用，则返回 null。
return
en
ParameterList
英文文档：

getParameterList

public ParameterList getParameterList()
Return a ParameterList object that holds all the available parameters. Returns null if no parameters are available.

Returns:
ParameterList

public void setPrimaryType(String primaryType)
设置基本类型。重写现有的基本类型。
primaryType 基本类型
英文文档：

setPrimaryType

public void setPrimaryType(String primaryType)
Set the primary type. Overrides existing primary type.

Parameters:
primaryType - primary type

public void setSubType(String subType)
设置 subType。替换现有的 subType。
subType subType
英文文档：

setSubType

public void setSubType(String subType)
Set the subType. Replaces the existing subType.

Parameters:
subType - the subType

public void setParameter(String name, String value)
设置指定的参数。如果此参数已经存在，则使用此新值替代它。
name | 参数名称
value | 参数值
英文文档：

setParameter

public void setParameter(String name,
                         String value)
Set the specified parameter. If this parameter already exists, it is replaced by this new value.

Parameters:
name - parameter name
value - parameter value

public void setParameterList(ParameterList list)
设置一个新的 ParameterList。
list
en
ParameterList
英文文档：

setParameterList

public void setParameterList(ParameterList list)
Set a new ParameterList.

Parameters:
list - ParameterList

public String toString()
获取此 Content-Type 的 RFC2045 样式的字符串表示形式。如果转换失败，则返回 null。
return RFC2045 样式字符串
英文文档：

toString

public String toString()
Retrieve a RFC2045 style string representation of this Content-Type. Returns null if the conversion failed.

Overrides:
toString in class Object
Returns:
RFC2045 style string

public boolean match(ContentType cType)
匹配指定的 ContentType 对象。此方法仅比较 primaryType 和 subType。忽略两个操作数的参数。

例如，当比较 ContentType 的 "text/plain" 和 "text/plain; charset=foobar" 时，此方法将返回 true。 如果任一操作数的 subType 是特殊字符 '*'，则匹配过程中将忽略 subtype。例如，当比较 ContentType 的 "text/plain" 和 "text/*" 时，此方法将返回 true。

cType 与此比较的 ContentType
英文文档：

match

public boolean match(ContentType cType)
Match with the specified ContentType object. This method compares only the primaryType and subType . The parameters of both operands are ignored.

For example, this method will return true when comparing the ContentTypes for "text/plain" and "text/plain; charset=foobar". If the subType of either operand is the special character '*', then the subtype is ignored during the match. For example, this method will return true when comparing the ContentTypes for "text/plain" and "text/*"

Parameters:
cType - ContentType to compare this against

public boolean match(String s)
匹配指定的内容类型字符串。此方法仅比较 primaryType 和 subType。忽略两个操作数的参数。

例如，当比较 ContentType 的 "text/plain" 和 "text/plain; charset=foobar" 时，此方法将返回 true。 如果任一操作数的 subType 是特殊字符 '*'，则匹配过程中将忽略 subtype。例如，当比较 ContentType 的 "text/plain" 和 "text/*" 时，此方法将返回 true。

英文文档：

match

public boolean match(String s)
Match with the specified content-type string. This method compares only the primaryType and subType . The parameters of both operands are ignored.

For example, this method will return true when comparing the ContentType for "text/plain" with "text/plain; charset=foobar". If the subType of either operand is the special character '*', then the subtype is ignored during the match. For example, this method will return true when comparing the ContentType for "text/plain" with "text/*"

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HeaderTokenizer (Java EE 5)

javax.mail.internet
Class HeaderTokenizer

java.lang.Object
    extended by  javax.mail.internet.HeaderTokenizer

public class HeaderTokenizer
extends Object

Inner classes: HeaderTokenizer.Token

此类将 RFC822 和 MIME 的头标记成 RFC822 和 MIME 指定的基本符号。

此类处理折叠头（即嵌入了 CRLF SPACE 序列的头）。在返回的标记中移除折叠。

version 1.11, 07/05/04
英文文档：

This class tokenizes RFC822 and MIME headers into the basic symbols specified by RFC822 and MIME.

This class handles folded headers (ie headers with embedded CRLF SPACE sequences). The folds are removed in the returned tokens.

Version:
1.11, 07/05/04
Author:
John Mani

Nested Class Summary
static class HeaderTokenizer.Token
The Token class represents tokens returned by the HeaderTokenizer.
Field Summary
static String | MIME MIME specials
static String | RFC822 RFC822 specials
Constructor Summary
HeaderTokenizer(String header)
Constructor.
HeaderTokenizer(String header, String delimiters)
Constructor.
HeaderTokenizer(String header, String delimiters, boolean skipComments)
Constructor that takes a rfc822 style header.
Method Summary
String | getRemainder() Return the rest of the Header.
HeaderTokenizer.Token | next() Parses the next token from this String.
HeaderTokenizer.Token | peek() Peek at the next token, without actually removing the token from the parse stream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

RFC822

public static final String RFC822
RFC822 specials

See Also:
Constant Field Values

英文文档：

MIME

public static final String MIME
MIME specials

See Also:
Constant Field Values
Constructor Detail

public HeaderTokenizer(String header, String delimiters, boolean skipComments)
带有 rfc822 样式头的构造方法。
header | 要标记的 rfc822 头
delimiters | 用于分隔 ATOM 的分界符字符集。这些字符通常是 RFC822 或 MIME
skipComments | 如果为 true，则跳过注释且不将它作为标记返回
英文文档：

HeaderTokenizer

public HeaderTokenizer(String header,
                       String delimiters,
                       boolean skipComments)
Constructor that takes a rfc822 style header.

Parameters:
header - The rfc822 header to be tokenized
delimiters - Set of delimiter characters to be used to delimit ATOMS. These are usually RFC822 or MIME
skipComments - If true, comments are skipped and not returned as tokens

public HeaderTokenizer(String header, String delimiters)
构造方法。注释被忽略且不作为标记返回。
header | 被标记的头
delimiters | 要使用的分界符。
英文文档：

HeaderTokenizer

public HeaderTokenizer(String header,
                       String delimiters)
Constructor. Comments are ignored and not returned as tokens

Parameters:
header - The header that is tokenized
delimiters - The delimiters to be used

public HeaderTokenizer(String header)
构造方法。使用 RFC822 定义的分界符 RFC822 来分隔 ATOM。注释同样被跳过且不作为标记返回。
英文文档：

HeaderTokenizer

public HeaderTokenizer(String header)
Constructor. The RFC822 defined delimiters - RFC822 - are used to delimit ATOMS. Also comments are skipped and not returned as tokens

Method Detail

public HeaderTokenizer.Token next() throws ParseException
解析此 String 的下一个标记。

客户端循环调用 next() 来解析后续标记，直到返回 EOF Token 为止。

return | 下一个 Token
Throws | ParseException: 如果解析失败
英文文档：

next

public HeaderTokenizer.Token next()
                           throws ParseException
Parses the next token from this String.

Clients sit in a loop calling next() to parse successive tokens until an EOF Token is returned.

Returns:
the next Token
Throws:
ParseException - if the parse fails

public HeaderTokenizer.Token peek() throws ParseException
查看下一个标记，但没有从解析流中实际移除标记。多次调用此方法将返回后续的标记，直到调用 next() 为止。

return | 下一个 Token
Throws | ParseException: 如果解析失败
英文文档：

peek

public HeaderTokenizer.Token peek()
                           throws ParseException
Peek at the next token, without actually removing the token from the parse stream. Invoking this method multiple times will return successive tokens, until next() is called.

Returns:
the next Token
Throws:
ParseException - if the parse fails

public String getRemainder()
返回其余的头。
return 其余的头 (String)；如果已到头的末尾，则返回 null。
英文文档：

getRemainder

public String getRemainder()
Return the rest of the Header.

Returns:
String rest of header. null is returned if we are already at end of header
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HeaderTokenizer.Token (Java EE 5)

javax.mail.internet
Class HeaderTokenizer.Token

java.lang.Object
    extended by  javax.mail.internet.HeaderTokenizer.Token
Enclosing class:
HeaderTokenizer
public static class HeaderTokenizer.Token
extends Object

Contained within: HeaderTokenizer

Token 类表示 HeaderTokenizer 返回的标记。
英文文档：

The Token class represents tokens returned by the HeaderTokenizer.

Field Summary
static int | ATOM Token type indicating an ATOM.
static int | COMMENT Token type indicating a comment.
static int | EOF Token type indicating end of input.
static int | QUOTEDSTRING Token type indicating a quoted string.
Constructor Summary
HeaderTokenizer.Token(int type, String value)
Constructor.
Method Summary
int | getType() Return the type of the token.
String | getValue() Returns the value of the token just read.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

ATOM

public static final int ATOM
Token type indicating an ATOM.

See Also:
Constant Field Values

英文文档：

QUOTEDSTRING

public static final int QUOTEDSTRING
Token type indicating a quoted string. The value field contains the string without the quotes.

See Also:
Constant Field Values

英文文档：

COMMENT

public static final int COMMENT
Token type indicating a comment. The value field contains the comment string without the comment start and end symbols.

See Also:
Constant Field Values

英文文档：

EOF

public static final int EOF
Token type indicating end of input.

See Also:
Constant Field Values
Constructor Detail

public HeaderTokenizer.Token(int type, String value)
构造方法。
type | Token 类型
value | Token 值
英文文档：

HeaderTokenizer.Token

public HeaderTokenizer.Token(int type,
                             String value)
Constructor.

Parameters:
type - Token type
value - Token value
Method Detail

public int getType()
返回标记的类型。如果标记表示分界符或控制字符，则类型是该字符本身，并转换为整数。否则，其值是下列值之一：
  • ATOM ASCII 字符序列，由空格、CTL、"("、<"> 或指定的特殊字符分隔
  • QUOTEDSTRING 包含在引号内的 ASCII 字符序列
  • COMMENT 包含在 "(" 和 ")" 内的 ASCII 字符序列
  • EOF 头的末尾
英文文档：

getType

public int getType()
Return the type of the token. If the token represents a delimiter or a control character, the type is that character itself, converted to an integer. Otherwise, it's value is one of the following:
  • ATOM A sequence of ASCII characters delimited by either SPACE, CTL, "(", <"> or the specified SPECIALS
  • QUOTEDSTRING A sequence of ASCII characters within quotes
  • COMMENT A sequence of ASCII characters within "(" and ")".
  • EOF End of header

public String getValue()
返回刚刚读取的标记值。当前标记是一个带引号的字符串时，此字段将包含该字符串的正文，不带引号。当前标记是一个注释时，此字段将包含该注释的正文。
return 标记值
英文文档：

getValue

public String getValue()
Returns the value of the token just read. When the current token is a quoted string, this field contains the body of the string, without the quotes. When the current token is a comment, this field contains the body of the comment.

Returns:
token value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InternetAddress (Java EE 5)

javax.mail.internet
Class InternetAddress

java.lang.Object
    extended by  javax.mail.Address
        extended by  javax.mail.internet.InternetAddress
All Implemented Interfaces:
Serializable, Cloneable
public class InternetAddress
extends Address
implements Cloneable

Extends: Address
Implements: Cloneable

此类表示使用 RFC822 语法的 Internet 电子邮件地址。典型的地址语法形式为 "user@host.domain" 或 "Personal Name "。
英文文档：

This class represents an Internet email address using the syntax of RFC822. Typical address syntax is of the form "user@host.domain" or "Personal Name ".

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected String | address
protected String | encodedPersonal The RFC 2047 encoded version of the personal name.
protected String | personal The personal name.
Constructor Summary
InternetAddress()
Default constructor.
InternetAddress(String address)
Constructor.
InternetAddress(String address, boolean strict)
Parse the given string and create an InternetAddress.
InternetAddress(String address, String personal)
Construct an InternetAddress given the address and personal name.
InternetAddress(String address, String personal, String charset)
Construct an InternetAddress given the address and personal name.
Method Summary
Object | clone() Return a copy of this InternetAddress object.
boolean | equals(Object a) The equality operator.
String | getAddress() Get the email address.
InternetAddress[] | getGroup(boolean strict) Return the members of a group address.
static InternetAddress | getLocalAddress(Session session) Return an InternetAddress object representing the current user.
String | getPersonal() Get the personal name.
String | getType() Return the type of this address.
int | hashCode() Compute a hash code for the address.
boolean | isGroup() Indicates whether this address is an RFC 822 group address.
static InternetAddress[] | parse(String addresslist) Parse the given comma separated sequence of addresses into InternetAddress objects.
static InternetAddress[] | parse(String addresslist, boolean strict) Parse the given sequence of addresses into InternetAddress objects.
static InternetAddress[] | parseHeader(String addresslist, boolean strict) Parse the given sequence of addresses into InternetAddress objects.
void | setAddress(String address) Set the email address.
void | setPersonal(String name) Set the personal name.
void | setPersonal(String name, String charset) Set the personal name.
String | toString() Convert this address into a RFC 822 / RFC 2047 encoded address.
static String | toString(Address[] addresses) Convert the given array of InternetAddress objects into a comma separated sequence of address strings.
static String | toString(Address[] addresses, int used) Convert the given array of InternetAddress objects into a comma separated sequence of address strings.
String | toUnicodeString() Returns a properly formatted address (RFC 822 syntax) of Unicode characters.
void | validate() Validate that this address conforms to the syntax rules of RFC 822.
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

address

protected String address

英文文档：

personal

protected String personal
The personal name.

英文文档：

encodedPersonal

protected String encodedPersonal
The RFC 2047 encoded version of the personal name.

This field and the personal field track each other, so if a subclass sets one of these fields directly, it should set the other to null, so that it is suitably recomputed.

Constructor Detail

public InternetAddress()
默认构造方法。
英文文档：

InternetAddress

public InternetAddress()
Default constructor.

public InternetAddress(String address) throws AddressException
构造方法。

解析给定的字符串并创建一个 InternetAddress。有关解析的详细信息，请参见 parse 方法。使用“严格”解析来解析地址。当 strict 为 true 时，此构造方法不执行 InternetAddress(String address, boolean strict) 构造方法所做的额外语法检查。此构造方法等效于 InternetAddress(address, false)。

address | RFC822 格式的地址
Throws | AddressException: 如果解析失败
英文文档：

InternetAddress

public InternetAddress(String address)
                throws AddressException
Constructor.

Parse the given string and create an InternetAddress. See the parse method for details of the parsing. The address is parsed using "strict" parsing. This constructor does not perform the additional syntax checks that the InternetAddress(String address, boolean strict) constructor does when strict is true. This constructor is equivalent to InternetAddress(address, false).

Parameters:
address - the address in RFC822 format
Throws:
AddressException - if the parse failed

public InternetAddress(String address, boolean strict) throws AddressException
解析给定的字符串并创建一个 InternetAddress。如果 strict 为 false，则不检查地址的详细语法。
address | RFC822 格式的地址
strict | 强制执行 RFC822 语法
Throws | AddressException: 如果解析失败
since
en
JavaMail 1.3
英文文档：

InternetAddress

public InternetAddress(String address,
                       boolean strict)
                throws AddressException
Parse the given string and create an InternetAddress. If strict is false, the detailed syntax of the address isn't checked.

Parameters:
address - the address in RFC822 format
strict - enforce RFC822 syntax
Throws:
AddressException - if the parse failed
Since:
JavaMail 1.3

public InternetAddress(String address, String personal) throws java.io.UnsupportedEncodingException
根据给定地址和个人姓名构造 InternetAddress。假设地址在语法上是有效的 RFC822 地址。
address | RFC822 格式的地址
personal | 个人姓名
英文文档：

InternetAddress

public InternetAddress(String address,
                       String personal)
                throws UnsupportedEncodingException
Construct an InternetAddress given the address and personal name. The address is assumed to be a syntactically valid RFC822 address.

Parameters:
address - the address in RFC822 format
personal - the personal name
Throws:
UnsupportedEncodingException

public InternetAddress(String address, String personal, String charset) throws java.io.UnsupportedEncodingException
根据给定地址和个人姓名构造 InternetAddress。假设地址在语法上是有效的 RFC822 地址。
address | RFC822 格式的地址
personal | 个人姓名
charset | 姓名的 MIME 字符集。
英文文档：

InternetAddress

public InternetAddress(String address,
                       String personal,
                       String charset)
                throws UnsupportedEncodingException
Construct an InternetAddress given the address and personal name. The address is assumed to be a syntactically valid RFC822 address.

Parameters:
address - the address in RFC822 format
personal - the personal name
charset - the MIME charset for the name
Throws:
UnsupportedEncodingException
Method Detail

public Object clone()
返回此 InternetAddress 对象的副本。
since
en
JavaMail 1.2
英文文档：

clone

public Object clone()
Return a copy of this InternetAddress object.

Overrides:
clone in class Object
Since:
JavaMail 1.2

public String getType()
返回此地址的类型。InternetAddress 的类型为 "rfc822"。
英文文档：

getType

public String getType()
Return the type of this address. The type of an InternetAddress is "rfc822".

Specified by:
getType in class Address
Returns:
address type
See Also:
InternetAddress

public void setAddress(String address)
设置电子邮件地址。
address 电子邮件地址
英文文档：

setAddress

public void setAddress(String address)
Set the email address.

Parameters:
address - email address

public void setPersonal(String name, String charset) throws java.io.UnsupportedEncodingException
设置个人姓名。如果姓名包含非 US-ASCII 字符，则根据 RFC 2047 使用指定的字符集编码姓名。如果姓名仅包含 US-ASCII 字符集，则不进行任何编码且姓名按原样使用。

name | 个人姓名
charset | 用于根据 RFC 2047 编码姓名的 MIME 字符集
Throws | java.io.UnsupportedEncodingException: 如果字符集编码失败。
See also | setPersonal(String)
英文文档：

setPersonal

public void setPersonal(String name,
                        String charset)
                 throws UnsupportedEncodingException
Set the personal name. If the name contains non US-ASCII characters, then the name will be encoded using the specified charset as per RFC 2047. If the name contains only US-ASCII characters, no encoding is done and the name is used as is.

Parameters:
name - personal name
charset - MIME charset to be used to encode the name as per RFC 2047
Throws:
UnsupportedEncodingException - if the charset encoding fails.
See Also:
setPersonal(String)

public void setPersonal(String name) throws java.io.UnsupportedEncodingException
设置个人姓名。如果姓名包含非 US-ASCII 字符，则姓名将使用平台的默认字符集进行编码。如果姓名仅包含 US-ASCII 字符，则不进行任何编码，姓名按原样使用。

name | 个人姓名
Throws | java.io.UnsupportedEncodingException: 如果字符集编码失败。
See also | setPersonal(String name, String charset)
英文文档：

setPersonal

public void setPersonal(String name)
                 throws UnsupportedEncodingException
Set the personal name. If the name contains non US-ASCII characters, then the name will be encoded using the platform's default charset. If the name contains only US-ASCII characters, no encoding is done and the name is used as is.

Parameters:
name - personal name
Throws:
UnsupportedEncodingException - if the charset encoding fails.
See Also:
setPersonal(String name, String charset)

public String getAddress()
获取电子邮件地址。
return 电子邮件地址
英文文档：

getAddress

public String getAddress()
Get the email address.

Returns:
email address

public String getPersonal()
获取个人姓名。如果姓名根据 RFC 2047 进行编码，则它将被解码并转换为 Unicode。如果解码或转换失败，则原数据按原样返回。
return 个人姓名
英文文档：

getPersonal

public String getPersonal()
Get the personal name. If the name is encoded as per RFC 2047, it is decoded and converted into Unicode. If the decoding or conversion fails, the raw data is returned as is.

Returns:
personal name

public String toString()
将此地址转换为 RFC 822 / RFC 2047 编码地址。所得字符串仅包含 US-ASCII 字符，因此对于邮件是安全的。
return 可能的编码地址字符串
英文文档：

toString

public String toString()
Convert this address into a RFC 822 / RFC 2047 encoded address. The resulting string contains only US-ASCII characters, and hence is mail-safe.

Specified by:
toString in class Address
Returns:
possibly encoded address string

public String toUnicodeString()
返回以 Unicode 字符表示的格式正确的地址（RFC 822 语法）。
return Unicode 地址字符串
since
en
JavaMail 1.2
英文文档：

toUnicodeString

public String toUnicodeString()
Returns a properly formatted address (RFC 822 syntax) of Unicode characters.

Returns:
Unicode address string
Since:
JavaMail 1.2

public boolean equals(Object a)
相等性运算符。
英文文档：

equals

public boolean equals(Object a)
The equality operator.

Specified by:
equals in class Address
Parameters:
a - Address object

public int hashCode()
计算地址的哈希码。
英文文档：

hashCode

public int hashCode()
Compute a hash code for the address.

Overrides:
hashCode in class Object

public static String toString(Address[] addresses)
将给定的 InternetAddress 对象数组转换为以逗号分隔的地址字符串序列。所得字符串仅包含 US-ASCII 字符，因此对于邮件是安全的。

addresses | InternetAddress 对象数组
Throws | ClassCastException,: 如果给定数组中的任何地址对象不是 InternetAddress 对象。注意，这是一个 RuntimeException。
return | 以逗号分隔的地址字符串
英文文档：

toString

public static String toString(Address[] addresses)
Convert the given array of InternetAddress objects into a comma separated sequence of address strings. The resulting string contains only US-ASCII characters, and hence is mail-safe.

Parameters:
addresses - array of InternetAddress objects
Returns:
comma separated string of addresses
Throws:
ClassCastException, - if any address object in the given array is not an InternetAddress object. Note that this is a RuntimeException.

public static String toString(Address[] addresses, int used)
将给定的 InternetAddress 对象数组转换为以逗号分隔的地址字符串序列。所得字符串仅包含 US-ASCII 字符，因此对于邮件是安全的。

'used' 参数指定要插入所得地址序列字符串的字段中已经使用的字符位置编号。它用于确定所得地址序列字符串中的换行位置。

addresses | InternetAddress 对象数组
used | 要插入地址字符串的字段中已经使用的字符位置编号。
Throws | ClassCastException,: 如果给定数组中的任何地址对象不是 InternetAddress 对象。注意，这是一个 RuntimeException。
return | 以逗号分隔的地址字符串
英文文档：

toString

public static String toString(Address[] addresses,
                              int used)
Convert the given array of InternetAddress objects into a comma separated sequence of address strings. The resulting string contains only US-ASCII characters, and hence is mail-safe.

The 'used' parameter specifies the number of character positions already taken up in the field into which the resulting address sequence string is to be inserted. It is used to determine the line-break positions in the resulting address sequence string.

Parameters:
addresses - array of InternetAddress objects
used - number of character positions already used, in the field into which the address string is to be inserted.
Returns:
comma separated string of addresses
Throws:
ClassCastException, - if any address object in the given array is not an InternetAddress object. Note that this is a RuntimeException.

public static InternetAddress getLocalAddress(Session session)
返回表示当前用户的 InternetAddress 对象。完整的电子邮件地址可能在 "mail.from" 属性中指定。如果未设置，则可以尝试查看 "mail.user" 和 "mail.host" 属性。如果这些属性都未设置，则尝试使用 "user.name" 属性和 InetAddress.getLocalHost 方法。忽略访问此信息时出现的安全异常。如果不能确定电子邮件地址，则返回 null。
session | 用于属性查找的 Session 对象
return | 当前用户的电子邮件地址
英文文档：

getLocalAddress

public static InternetAddress getLocalAddress(Session session)
Return an InternetAddress object representing the current user. The entire email address may be specified in the "mail.from" property. If not set, the "mail.user" and "mail.host" properties are tried. If those are not set, the "user.name" property and InetAddress.getLocalHost method are tried. Security exceptions that may occur while accessing this information are ignored. If it is not possible to determine an email address, null is returned.

Parameters:
session - Session object used for property lookup
Returns:
current user's email address

public static InternetAddress[] parse(String addresslist) throws AddressException
将给定的以逗号分隔的地址序列解析为 InternetAddress 对象。地址必须遵守 RFC822 语法。
addresslist | 以逗号分隔的地址字符串
return | InternetAddress 对象数组
Throws | AddressException: 如果解析失败
英文文档：

parse

public static InternetAddress[] parse(String addresslist)
                               throws AddressException
Parse the given comma separated sequence of addresses into InternetAddress objects. Addresses must follow RFC822 syntax.

Parameters:
addresslist - comma separated address strings
Returns:
array of InternetAddress objects
Throws:
AddressException - if the parse failed

public static InternetAddress[] parse(String addresslist, boolean strict) throws AddressException
将给定的地址序列解析为 InternetAddress 对象。如果 strict 为 false，则以空格分隔的简单电子邮件地址也允许解析。如果 strict 为 true，则将强制执行许多（但不是全部）RFC822 语法规则。特别是，即使 strict 为 true，由简单名字（没有 "@domain" 部分）组成的地址也允许解析。这种“非法”地址在实际消息中是不常见的。

非严格解析通常用于解析人为输入的邮件地址列表。严格解析通常用于解析邮件消息中的地址头。

addresslist | 以逗号分隔的地址字符串
strict | 强制执行 RFC822 语法
return | InternetAddress 对象数组
Throws | AddressException: 如果解析失败
英文文档：

parse

public static InternetAddress[] parse(String addresslist,
                                      boolean strict)
                               throws AddressException
Parse the given sequence of addresses into InternetAddress objects. If strict is false, simple email addresses separated by spaces are also allowed. If strict is true, many (but not all) of the RFC822 syntax rules are enforced. In particular, even if strict is true, addresses composed of simple names (with no "@domain" part) are allowed. Such "illegal" addresses are not uncommon in real messages.

Non-strict parsing is typically used when parsing a list of mail addresses entered by a human. Strict parsing is typically used when parsing address headers in mail messages.

Parameters:
addresslist - comma separated address strings
strict - enforce RFC822 syntax
Returns:
array of InternetAddress objects
Throws:
AddressException - if the parse failed

public static InternetAddress[] parseHeader(String addresslist, boolean strict) throws AddressException
将给定的地址序列解析为 InternetAddress 对象。如果 strict 为 false，则不强制执行用于各个地址的全部语法规则。如果 strict 为 true，则将强制执行许多（但不是全部）RFC822 语法规则。

为了更好地支持实际消息中的“无效”地址范围，此方法强制执行的语法规则比 strict 标志为 false 时的 parse 方法要少，但比 strict 标志为 true 时的该方法要多。如果 strict 标志为 false，而且在分离电子邮件地址时解析成功，则不检查地址本身的语法。

addresslist | 以逗号分隔的地址字符串
strict | 强制执行 RFC822 语法
return | InternetAddress 对象数组
Throws | AddressException: 如果解析失败
since
en
JavaMail 1.3
英文文档：

parseHeader

public static InternetAddress[] parseHeader(String addresslist,
                                            boolean strict)
                                     throws AddressException
Parse the given sequence of addresses into InternetAddress objects. If strict is false, the full syntax rules for individual addresses are not enforced. If strict is true, many (but not all) of the RFC822 syntax rules are enforced.

To better support the range of "invalid" addresses seen in real messages, this method enforces fewer syntax rules than the parse method when the strict flag is false and enforces more rules when the strict flag is true. If the strict flag is false and the parse is successful in separating out an email address or addresses, the syntax of the addresses themselves is not checked.

Parameters:
addresslist - comma separated address strings
strict - enforce RFC822 syntax
Returns:
array of InternetAddress objects
Throws:
AddressException - if the parse failed
Since:
JavaMail 1.3

public void validate() throws AddressException
验证此地址是否符合 RFC 822 的语法规则。当前实现检查许多（但不是全部）语法规则。注意，即使地址的语法可能正确，也不保证具有该名称的邮箱存在。
Throws AddressException: 如果地址无效。
since
en
JavaMail 1.3
英文文档：

validate

public void validate()
              throws AddressException
Validate that this address conforms to the syntax rules of RFC 822. The current implementation checks many, but not all, syntax rules. Note that even though the syntax of the address may be correct, there's no guarantee that a mailbox of that name exists.

Throws:
AddressException - if the address isn't valid.
Since:
JavaMail 1.3

public boolean isGroup()
指示此地址是否为 RFC 822 组地址。注意，组地址不同于大多数邮件服务器所支持的邮件列表地址。组地址很少使用；有关详细信息，请参见 RFC 822。
return 如果此地址表示一个组地址，则返回 true
since
en
JavaMail 1.3
英文文档：

isGroup

public boolean isGroup()
Indicates whether this address is an RFC 822 group address. Note that a group address is different than the mailing list addresses supported by most mail servers. Group addresses are rarely used; see RFC 822 for details.

Returns:
true if this address represents a group
Since:
JavaMail 1.3

public InternetAddress[] getGroup(boolean strict) throws AddressException
返回组地址的成员。一个组可以有 0 个、1 个或多个成员。如果此地址不是一个组地址，则返回 null。strict 参数控制是否使用严格的 RFC 822 规则来解析组列表。使用 parseHeader 方法完成解析。
return | InternetAddress 对象数组或 null
Throws | AddressException: 如果无法解析组列表。
since
en
JavaMail 1.3
英文文档：

getGroup

public InternetAddress[] getGroup(boolean strict)
                           throws AddressException
Return the members of a group address. A group may have zero, one, or more members. If this address is not a group, null is returned. The strict parameter controls whether the group list is parsed using strict RFC 822 rules or not. The parsing is done using the parseHeader method.

Returns:
array of InternetAddress objects, or null
Throws:
AddressException - if the group list can't be parsed
Since:
JavaMail 1.3
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InternetHeaders (Java EE 5)

javax.mail.internet
Class InternetHeaders

java.lang.Object
    extended by  javax.mail.internet.InternetHeaders

public class InternetHeaders
extends Object

Inner classes: InternetHeaders.InternetHeader

InternetHeaders 是一个管理 RFC822 样式头的实用工具类。如果给定一个 RFC822 格式的消息流，此类将读取各行，直到指示头结束的空行为止。输入流位于正文的起始处。行存储在对象内，可以被提取为 String 或 javax.mail.Header 对象。

此类主要供服务提供者使用。MimeMessage 和 MimeBody 使用此类保存它们的头。

有关 RFC822 和 MIME 头的注意事项

RFC822 和 MIME 头字段只能包含 US-ASCII 字符。如果头包含非 US-ASCII 字符，则它必须根据 RFC 2047 的规则进行编码。此包提供的 MimeUtility 类可以用于实现这一点。setHeader、addHeader 和 addHeaderLine 方法的调用者负责针对特定的头强制执行 MIME 要求。此外，如果这些头字段超过了传输的行长度限制（SMTP 1000 字节），则发送前必须进行折叠（包装）。收到的头可能已经进行了折叠。应用程序负责根据需要折叠和展开头。

See also javax.mail.internet.MimeUtility
英文文档：

InternetHeaders is a utility class that manages RFC822 style headers. Given an RFC822 format message stream, it reads lines until the blank line that indicates end of header. The input stream is positioned at the start of the body. The lines are stored within the object and can be extracted as either Strings or Header objects.

This class is mostly intended for service providers. MimeMessage and MimeBody use this class for holding their headers.

A note on RFC822 and MIME headers

RFC822 and MIME header fields must contain only US-ASCII characters. If a header contains non US-ASCII characters, it must be encoded as per the rules in RFC 2047. The MimeUtility class provided in this package can be used to to achieve this. Callers of the setHeader, addHeader, and addHeaderLine methods are responsible for enforcing the MIME requirements for the specified headers. In addition, these header fields must be folded (wrapped) before being sent if they exceed the line length limitation for the transport (1000 bytes for SMTP). Received headers may have been folded. The application is responsible for folding and unfolding headers as appropriate.

Author:
John Mani, Bill Shannon
See Also:
MimeUtility

Nested Class Summary
protected static class InternetHeaders.InternetHeader
An individual internet header.
Field Summary
protected  List headers
The actual list of Headers, including placeholder entries.
Constructor Summary
InternetHeaders()
Create an empty InternetHeaders object.
InternetHeaders(InputStream is)
Read and parse the given RFC822 message stream till the blank line separating the header from the body.
Method Summary
void | addHeader(String name, String value) Add a header with the specified name and value to the header list.
void | addHeaderLine(String line) Add an RFC822 header line to the header store.
Enumeration | getAllHeaderLines() Return all the header lines as an Enumeration of Strings.
Enumeration | getAllHeaders() Return all the headers as an Enumeration of Header objects.
String[] | getHeader(String name) Return all the values for the specified header.
String | getHeader(String name, String delimiter) Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.
Enumeration | getMatchingHeaderLines(String[] names) Return all matching header lines as an Enumeration of Strings.
Enumeration | getMatchingHeaders(String[] names) Return all matching Header objects.
Enumeration | getNonMatchingHeaderLines(String[] names) Return all non-matching header lines
Enumeration | getNonMatchingHeaders(String[] names) Return all non-matching Header objects.
void | load(InputStream is) Read and parse the given RFC822 message stream till the blank line separating the header from the body.
void | removeHeader(String name) Remove all header entries that match the given name
void | setHeader(String name, String value) Change the first header line that matches name to have value, adding a new header if no existing header matches.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

headers

protected List headers
The actual list of Headers, including placeholder entries. Placeholder entries are Headers with a null value and are never seen by clients of the InternetHeaders class. Placeholder entries are used to keep track of the preferred order of headers. Headers are never actually removed from the list, they're converted into placeholder entries. New headers are added after existing headers of the same name (or before in the case of Received and Return-Path headers). If no existing header or placeholder for the header is found, new headers are added after the special placeholder with the name ":".

Since:
JavaMail 1.4
Constructor Detail

public InternetHeaders()
创建空 InternetHeaders 对象。插入占位符条目以指示头的首选顺序。
英文文档：

InternetHeaders

public InternetHeaders()
Create an empty InternetHeaders object. Placeholder entries are inserted to indicate the preferred order of headers.

public InternetHeaders(java.io.InputStream is) throws MessagingException
读取和解析给定的 RFC822 消息流，直到分隔头与正文的空白行为止。输入流位于正文的起始处。头行进行内部存储。

为了提高效率，将 BufferedInputStream 包装成实际输入流并作为参数传递。

不插入占位符条目，保留头原来的顺序。

is RFC822 输入流
英文文档：

InternetHeaders

public InternetHeaders(InputStream is)
                throws MessagingException
Read and parse the given RFC822 message stream till the blank line separating the header from the body. The input stream is left positioned at the start of the body. The header lines are stored internally.

For efficiency, wrap a BufferedInputStream around the actual input stream and pass it as the parameter.

No placeholder entries are inserted; the original order of the headers is preserved.

Parameters:
is - RFC822 input stream
Throws:
MessagingException
Method Detail

public void load(java.io.InputStream is) throws MessagingException
读取和解析给定的 RFC822 消息流，直到分隔头与正文的空白行为止。将头行存储在此 InternetHeaders 对象内。保留头行的顺序。

注意，头行被添加到此 InternetHeaders 对象中，因此此对象中的任何现有头将不会受到影响。头将按顺序添加到现有头列表的末尾。

is RFC822 输入流
英文文档：

load

public void load(InputStream is)
          throws MessagingException
Read and parse the given RFC822 message stream till the blank line separating the header from the body. Store the header lines inside this InternetHeaders object. The order of header lines is preserved.

Note that the header lines are added into this InternetHeaders object, so any existing headers in this object will not be affected. Headers are added to the end of the existing list of headers, in order.

Parameters:
is - RFC822 input stream
Throws:
MessagingException

public String[] getHeader(String name)
返回指定头的所有值。值为 String 对象。如果不存在指定名称的头，则返回 null。
name | 头名称
return | 头值数组；如果没有，则返回 null
英文文档：

getHeader

public String[] getHeader(String name)
Return all the values for the specified header. The values are String objects. Returns null if no headers with the specified name exist.

Parameters:
name - header name
Returns:
array of header values, or null if none

public String getHeader(String name, String delimiter)
获取具有此头名称的所有头，以单个 String 返回，且头之间用 delimiter 分隔。如果 delimiter 为 null，则仅返回第一个头。如果不存在指定名称的头，则返回 null。
name | 头名称
delimiter | 分界符
return | 具有此名称的所有头的值字段；如果没有，则返回 null
英文文档：

getHeader

public String getHeader(String name,
                        String delimiter)
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter. If the delimiter is null, only the first header is returned. Returns null if no headers with the specified name exist.

Parameters:
name - header name
delimiter - delimiter
Returns:
the value fields for all headers with this name, or null if none

public void setHeader(String name, String value)
将匹配 name 的第一个头行更改为值 value；如果现有的头都不匹配，则添加一个新的头。移除第一个匹配头以外的所有匹配头。

注意，RFC822 头只能包含 US-ASCII 字符

name | 头名称
value | 头值
英文文档：

setHeader

public void setHeader(String name,
                      String value)
Change the first header line that matches name to have value, adding a new header if no existing header matches. Remove all matching headers but the first.

Note that RFC822 headers can only contain US-ASCII characters

Parameters:
name - header name
value - header value

public void addHeader(String name, String value)
将带有指定名称和值的头添加到头列表中。

当前实现了解大多数常见头的首选顺序，并会以此顺序插入头。此外，它了解 Received 头应以相反的顺序插入（最新的头在最旧的头之前），而且它们应该出现在头的起始处，其前面只可能是 Return-Path 头。

注意，RFC822 头只能包含 US-ASCII 字符。

name | 头名称
value | 头值
英文文档：

addHeader

public void addHeader(String name,
                      String value)
Add a header with the specified name and value to the header list.

The current implementation knows about the preferred order of most well-known headers and will insert headers in that order. In addition, it knows that Received headers should be inserted in reverse order (newest before oldest), and that they should appear at the beginning of the headers, preceeded only by a possible Return-Path header.

Note that RFC822 headers can only contain US-ASCII characters.

Parameters:
name - header name
value - header value

public void removeHeader(String name)
移除其名称与给定名称匹配的所有头条目
name 头名称
英文文档：

removeHeader

public void removeHeader(String name)
Remove all header entries that match the given name

Parameters:
name - header name

public java.util.Enumeration<E> getAllHeaders()
将所有头作为 javax.mail.Header 对象的枚举返回。
return Header 对象
英文文档：

getAllHeaders

public Enumeration getAllHeaders()
Return all the headers as an Enumeration of Header objects.

Returns:
Header objects

public java.util.Enumeration<E> getMatchingHeaders(String[] names)
返回所有匹配的 javax.mail.Header 对象。
return 匹配的 Header 对象
英文文档：

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] names)
Return all matching Header objects.

Returns:
matching Header objects

public java.util.Enumeration<E> getNonMatchingHeaders(String[] names)
返回所有不匹配的 javax.mail.Header 对象。
return 不匹配的 Header 对象
英文文档：

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] names)
Return all non-matching Header objects.

Returns:
non-matching Header objects

public void addHeaderLine(String line)
将 RFC822 头行添加到头存储库中。如果行以空格或制表符开始（连续行），则将它添加到列表的最后一个头行之后。否则，将新的头行添加到列表。

注意，RFC822 头只能包含 US-ASCII 字符

line 原始的 RFC822 头行
英文文档：

addHeaderLine

public void addHeaderLine(String line)
Add an RFC822 header line to the header store. If the line starts with a space or tab (a continuation line), add it to the last header line in the list. Otherwise, append the new header line to the list.

Note that RFC822 headers can only contain US-ASCII characters

Parameters:
line - raw RFC822 header line

public java.util.Enumeration<E> getAllHeaderLines()
将所有头行作为 Strings 枚举返回。
英文文档：

getAllHeaderLines

public Enumeration getAllHeaderLines()
Return all the header lines as an Enumeration of Strings.

public java.util.Enumeration<E> getMatchingHeaderLines(String[] names)
将所有匹配的头行作为 String 枚举返回。
英文文档：

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
Return all matching header lines as an Enumeration of Strings.

public java.util.Enumeration<E> getNonMatchingHeaderLines(String[] names)
返回所有不匹配的头行
英文文档：

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
Return all non-matching header lines

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InternetHeaders.InternetHeader (Java EE 5)

javax.mail.internet
Class InternetHeaders.InternetHeader

java.lang.Object
    extended by  javax.mail.Header
        extended by  javax.mail.internet.InternetHeaders.InternetHeader
Enclosing class:
InternetHeaders
protected static final class InternetHeaders.InternetHeader
extends Header

Extends: Header
Contained within: InternetHeaders

一个单独的 Internet 头。此类仅供 InternetHeaders 的子类使用。

带有 null 值的 InternetHeader 对象被用作具有该名称的头的占位符，以保留头的顺序。占位符 InternetHeader 对象带有名称 ":" 标记默认情况下在头列表中添加新头的位置。

since
en
JavaMail 1.4
英文文档：

An individual internet header. This class is only used by subclasses of InternetHeaders.

An InternetHeader object with a null value is used as a placeholder for headers of that name, to preserve the order of headers. A placeholder InternetHeader object with a name of ":" marks the location in the list of headers where new headers are added by default.

Since:
JavaMail 1.4

Field Summary
Fields inherited from class javax.mail.Header
name, value
Constructor Summary
InternetHeaders.InternetHeader(String l)
Constructor that takes a line and splits out the header name.
InternetHeaders.InternetHeader(String n, String v)
Constructor that takes a header name and value.
Method Summary
 String getValue()
Return the "value" part of the header line.
Methods inherited from class javax.mail.Header
getName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public InternetHeaders.InternetHeader(String l)
带有一行并拆分头名称的构造方法。
英文文档：

InternetHeaders.InternetHeader

public InternetHeaders.InternetHeader(String l)
Constructor that takes a line and splits out the header name.

public InternetHeaders.InternetHeader(String n, String v)
带有头名称和值的构造方法。
英文文档：

InternetHeaders.InternetHeader

public InternetHeaders.InternetHeader(String n,
                                      String v)
Constructor that takes a header name and value.

Method Detail

public String getValue()
返回头行的 "value" 部分。
英文文档：

getValue

public String getValue()
Return the "value" part of the header line.

Overrides:
getValue in class Header
Returns:
value of the header
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MailDateFormat (Java EE 5)

javax.mail.internet
Class MailDateFormat

java.lang.Object
    extended by  java.text.Format
        extended by  java.text.DateFormat
            extended by  java.text.SimpleDateFormat
                extended by  javax.mail.internet.MailDateFormat
All Implemented Interfaces:
Serializable, Cloneable
public class MailDateFormat
extends SimpleDateFormat

Extends: java.text.Format > java.text.DateFormat > java.text.SimpleDateFormat

基于 2000 年 1 月 26 日的 draft-ietf-drums-msg-fmt-08 的格式化和解析日期规范。它是 RFC822 的后续规范。

此类不带模式字符串。它总是基于下面的规范格式化日期。

3.3 日期和时间规范

日期和时间出现在消息的几个头字段中。这部分指定完整的日期和时间规范的语法。尽管整个日期-时间规范允许使用多个空格，但建议在日期-时间规范中需要 FWS 的地方仅使用一个空格，在 FWS 为可选的地方不使用空格；一些原来的实现可能无法正确解释出现的其他多个空格。

date-time = [ day-of-week "," ] date FWS time [CFWS]

day-of-week = ([FWS] day-name) / obs-day-of-week

day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"

date = day month year

year = 4*DIGIT / obs-year

month = (FWS month-name FWS) / obs-month

month-name = "Jan" / "Feb" / "Mar" / "Apr" /
"May" / "Jun" / "Jul" / "Aug" /
"Sep" / "Oct" / "Nov" / "Dec"

day = ([FWS] 1*2DIGIT) / obs-day

time = time-of-day FWS zone

time-of-day = hour ":"minute [ ":"second ]

hour = 2DIGIT / obs-hour

minute = 2DIGIT / obs-minute

second = 2DIGIT / obs-second

zone = (( "+" / "-" ) 4DIGIT) / obs-zone

day 是一月中某一天的数字表示。year 是以公元表示的任意年份数值。

time-of-day 指定自指示日期的午夜开始的小时、分钟和秒数（可选）。

date 和 time-of-day 应该表示本地时间。

zone 指定距 date 和 time-of-day 表示的协调世界时（UTC，以前称为“格林威治标准时”）的偏移量。"+" 或 "-" 指示 time-of-day 是提前还是落后于世界时。前两个数字指示与世界时相差的小时数，最后两个数字指示与世界时相差的分钟数。（因此，+hhmm 表示 +(hh * 60 + mm) 分钟，-hhmm 表示 -(hh * 60 + mm) 分钟）。应该使用 "+0000" 形式指示以世界时表示的时区。虽然 "-0000" 也表示世界时，但它用于指示时间是在基于本地时区（而非世界时）的系统中生成的。

日期-时间规范必须在语意上有效。也就是说，day-of-week（如果包含）必须是日期表示的天，数字 day-of-month 必须介于 1 和指定的月（在指定的年中）所允许的天数之间，time-of-day 必须在 00:00:00 到 23:59:60 范围内（秒数允许闰秒，请参见 [STD-12]），zone 必须在 -9959 到 +9959 范围内。

since
en
JavaMail 1.2
英文文档：

Formats and parses date specification based on the draft-ietf-drums-msg-fmt-08 dated January 26, 2000. This is a followup spec to RFC822.

This class does not take pattern strings. It always formats the date based on the specification below.

3.3 Date and Time Specification

Date and time occur in several header fields of a message. This section specifies the syntax for a full date and time specification. Though folding whitespace is permitted throughout the date-time specification, it is recommended that only a single space be used where FWS is required and no space be used where FWS is optional in the date-time specification; some older implementations may not interpret other occurrences of folding whitespace correctly.

date-time = [ day-of-week "," ] date FWS time [CFWS]

day-of-week = ([FWS] day-name) / obs-day-of-week

day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"

date = day month year

year = 4*DIGIT / obs-year

month = (FWS month-name FWS) / obs-month

month-name = "Jan" / "Feb" / "Mar" / "Apr" /
             "May" / "Jun" / "Jul" / "Aug" /
             "Sep" / "Oct" / "Nov" / "Dec"

day = ([FWS] 1*2DIGIT) / obs-day

time = time-of-day FWS zone

time-of-day = hour ":" minute [ ":" second ]

hour = 2DIGIT / obs-hour

minute = 2DIGIT / obs-minute

second = 2DIGIT / obs-second

zone = (( "+" / "-" ) 4DIGIT) / obs-zone

The day is the numeric day of the month. The year is any numeric year in the common era.

The time-of-day specifies the number of hours, minutes, and optionally seconds since midnight of the date indicated.

The date and time-of-day SHOULD express local time.

The zone specifies the offset from Coordinated Universal Time (UTC, formerly referred to as "Greenwich Mean Time") that the date and time-of-day represent. The "+" or "-" indicates whether the time-of-day is ahead of or behind Universal Time. The first two digits indicate the number of hours difference from Universal Time, and the last two digits indicate the number of minutes difference from Universal Time. (Hence, +hhmm means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm) minutes). The form "+0000" SHOULD be used to indicate a time zone at Universal Time. Though "-0000" also indicates Universal Time, it is used to indicate that the time was generated on a system that may be in a local time zone other than Universal Time.

A date-time specification MUST be semantically valid. That is, the day-of-the week (if included) MUST be the day implied by the date, the numeric day-of-month MUST be between 1 and the number of days allowed for the specified month (in the specified year), the time-of-day MUST be in the range 00:00:00 through 23:59:60 (the number of seconds allowing for a leap second; see [STD-12]), and the zone MUST be within the range -9959 through +9959.

Since:
JavaMail 1.2
Author:
Max Spivak
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.text.DateFormat
DateFormat.Field
Field Summary
Fields inherited from class java.text.DateFormat
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
Constructor Summary
MailDateFormat()
Method Summary
StringBuffer | format(Date date, StringBuffer dateStrBuf, FieldPosition fieldPosition) Formats the given date in the format specified by draft-ietf-drums-msg-fmt-08 in the current TimeZone.
Date | parse(String text, ParsePosition pos) Parses the given date in the format specified by draft-ietf-drums-msg-fmt-08 in the current TimeZone.
void | setCalendar(Calendar newCalendar) Don't allow setting the calendar
void | setNumberFormat(NumberFormat newNumberFormat) Don't allow setting the NumberFormat
Methods inherited from class java.text.SimpleDateFormat
applyLocalizedPattern, applyPattern, clone, equals, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPattern
Methods inherited from class java.text.DateFormat
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setLenient, setTimeZone
Methods inherited from class java.text.Format
format, parseObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MailDateFormat()
英文文档：

MailDateFormat

public MailDateFormat()
Method Detail

public StringBuffer format(java.util.Date date, StringBuffer dateStrBuf, java.text.FieldPosition fieldPosition)
将给定的日期按照当前 TimeZone 中 draft-ietf-drums-msg-fmt-08 所指定的格式进行格式化。
date | Date 对象
dateStrBuf | 格式化字符串
fieldPosition | 当前字段的位置
return | StringBuffer 格式化 String
since
en
JavaMail 1.2
英文文档：

format

public StringBuffer format(Date date,
                           StringBuffer dateStrBuf,
                           FieldPosition fieldPosition)
Formats the given date in the format specified by draft-ietf-drums-msg-fmt-08 in the current TimeZone.

Overrides:
format in class SimpleDateFormat
Parameters:
date - the Date object
dateStrBuf - the formatted string
fieldPosition - the current field position
Returns:
StringBuffer the formatted String
Since:
JavaMail 1.2

public java.util.Date parse(String text, java.text.ParsePosition pos)
将给定的日期按照当前 TimeZone 中 draft-ietf-drums-msg-fmt-08 所指定的格式进行解析。
text | 要解析的格式化日期
pos | 当前解析位置
return | 在 Date 对象中解析的日期 (Date)
since
en
JavaMail 1.2
英文文档：

parse

public Date parse(String text,
                  ParsePosition pos)
Parses the given date in the format specified by draft-ietf-drums-msg-fmt-08 in the current TimeZone.

Overrides:
parse in class SimpleDateFormat
Parameters:
text - the formatted date to be parsed
pos - the current parse position
Returns:
Date the parsed date in a Date object
Since:
JavaMail 1.2

public void setCalendar(java.util.Calendar newCalendar)
不允许设置日历
英文文档：

setCalendar

public void setCalendar(Calendar newCalendar)
Don't allow setting the calendar

Overrides:
setCalendar in class DateFormat

public void setNumberFormat(java.text.NumberFormat newNumberFormat)
不允许设置 NumberFormat
英文文档：

setNumberFormat

public void setNumberFormat(NumberFormat newNumberFormat)
Don't allow setting the NumberFormat

Overrides:
setNumberFormat in class DateFormat
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeBodyPart (Java EE 5)

javax.mail.internet
Class MimeBodyPart

java.lang.Object
    extended by  javax.mail.BodyPart
        extended by  javax.mail.internet.MimeBodyPart
All Implemented Interfaces:
MimePart, Part
Direct Known Subclasses:
PreencodedMimeBodyPart
public class MimeBodyPart
extends BodyPart
implements MimePart

Extends: BodyPart
Implements: MimePart
Extended by: PreencodedMimeBodyPart

此类表示 MIME 正文部分。它实现 BodyPart 抽象类和 MimePart 接口。MimeBodyPart 包含在 MimeMultipart 对象中。

MimeBodyPart 使用 InternetHeaders 类解析和存储该正文部分的头。

有关 RFC 822 和 MIME 头的注意事项

RFC 822 头字段只能包含 US-ASCII 字符。通过解码非 ASCII 字符，MIME 允许这些字符存在于特定头的特定部分。RFC 2047 指定实现此操作的规则。此包提供的 MimeUtility 类可以用来实现这一点。setHeader、addHeader 和 addHeaderLine 方法的调用者负责针对特定的头强制执行 MIME 要求。此外，如果这些头字段超过了传输的行长度限制（SMTP 1000 字节），则发送前必须进行折叠（包装）。收到的头可能已经进行了折叠。应用程序负责根据需要折叠和展开头。

See also javax.mail.Part, javax.mail.internet.MimePart, javax.mail.internet.MimeUtility
英文文档：

This class represents a MIME body part. It implements the BodyPart abstract class and the MimePart interface. MimeBodyParts are contained in MimeMultipart objects.

MimeBodyPart uses the InternetHeaders class to parse and store the headers of that body part.

A note on RFC 822 and MIME headers

RFC 822 header fields must contain only US-ASCII characters. MIME allows non ASCII characters to be present in certain portions of certain headers, by encoding those characters. RFC 2047 specifies the rules for doing this. The MimeUtility class provided in this package can be used to to achieve this. Callers of the setHeader, addHeader, and addHeaderLine methods are responsible for enforcing the MIME requirements for the specified headers. In addition, these header fields must be folded (wrapped) before being sent if they exceed the line length limitation for the transport (1000 bytes for SMTP). Received headers may have been folded. The application is responsible for folding and unfolding headers as appropriate.

Author:
John Mani, Bill Shannon, Kanwar Oberoi
See Also:
Part, MimePart, MimeUtility

Field Summary
protected byte[] | content Byte array that holds the bytes of the content of this Part.
protected InputStream | contentStream If the data for this body part was supplied by an InputStream that implements the SharedInputStream interface, contentStream is another such stream representing the content of this body part.
protected DataHandler | dh The DataHandler object representing this Part's content.
protected InternetHeaders | headers The InternetHeaders object that stores all the headers of this body part.
Fields inherited from class javax.mail.BodyPart
parent
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
Constructor Summary
MimeBodyPart()
An empty MimeBodyPart object is created.
MimeBodyPart(InputStream is)
Constructs a MimeBodyPart by reading and parsing the data from the specified input stream.
MimeBodyPart(InternetHeaders headers, byte[] content)
Constructs a MimeBodyPart using the given header and content bytes.
Method Summary
void | addHeader(String name, String value) Add this value to the existing values for this header_name.
void | addHeaderLine(String line) Add a header line to this body part
void | attachFile(File file) Use the specified file to provide the data for this part.
void | attachFile(String file) Use the specified file to provide the data for this part.
Enumeration | getAllHeaderLines() Get all header lines as an Enumeration of Strings.
Enumeration | getAllHeaders() Return all the headers from this Message as an Enumeration of Header objects.
Object | getContent() Return the content as a Java object.
String | getContentID() Returns the value of the "Content-ID" header field.
String[] | getContentLanguage() Get the languages specified in the Content-Language header of this MimePart.
String | getContentMD5() Return the value of the "Content-MD5" header field.
protected InputStream | getContentStream() Produce the raw bytes of the content.
String | getContentType() Returns the value of the RFC 822 "Content-Type" header field.
DataHandler | getDataHandler() Return a DataHandler for this body part's content.
String | getDescription() Returns the "Content-Description" header field of this body part.
String | getDisposition() Returns the value of the "Content-Disposition" header field.
String | getEncoding() Returns the content transfer encoding from the "Content-Transfer-Encoding" header field.
String | getFileName() Get the filename associated with this body part.
String[] | getHeader(String name) Get all the headers for this header_name.
String | getHeader(String name, String delimiter) Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.
InputStream | getInputStream() Return a decoded input stream for this body part's "content".
int | getLineCount() Return the number of lines for the content of this Part.
Enumeration | getMatchingHeaderLines(String[] names) Get matching header lines as an Enumeration of Strings.
Enumeration | getMatchingHeaders(String[] names) Return matching headers from this Message as an Enumeration of Header objects.
Enumeration | getNonMatchingHeaderLines(String[] names) Get non-matching header lines as an Enumeration of Strings.
Enumeration | getNonMatchingHeaders(String[] names) Return non-matching headers from this Message as an Enumeration of Header objects.
InputStream | getRawInputStream() Return an InputStream to the raw data with any Content-Transfer-Encoding intact.
int | getSize() Return the size of the content of this body part in bytes.
boolean | isMimeType(String mimeType) Is this Part of the specified MIME type?
void | removeHeader(String name) Remove all headers with this name.
void | saveFile(File file) Save the contents of this part in the specified file.
void | saveFile(String file) Save the contents of this part in the specified file.
void | setContent(Multipart mp) This method sets the body part's content to a Multipart object.
void | setContent(Object o, String type) A convenience method for setting this body part's content.
void | setContentID(String cid) Set the "Content-ID" header field of this body part.
void | setContentLanguage(String[] languages) Set the Content-Language header of this MimePart.
void | setContentMD5(String md5) Set the "Content-MD5" header field of this body part.
void | setDataHandler(DataHandler dh) This method provides the mechanism to set this body part's content.
void | setDescription(String description) Set the "Content-Description" header field for this body part.
void | setDescription(String description, String charset) Set the "Content-Description" header field for this body part.
void | setDisposition(String disposition) Set the "Content-Disposition" header field of this body part.
void | setFileName(String filename) Set the filename associated with this body part, if possible.
void | setHeader(String name, String value) Set the value for this header_name.
void | setText(String text) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".
void | setText(String text, String charset) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.
void | setText(String text, String charset, String subtype) Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.
protected void | updateHeaders() Examine the content of this body part and update the appropriate MIME headers.
void | writeTo(OutputStream os) Output the body part as an RFC 822 format stream.
Methods inherited from class javax.mail.BodyPart
getParent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

dh

protected DataHandler dh
The DataHandler object representing this Part's content.

英文文档：

content

protected byte[] content
Byte array that holds the bytes of the content of this Part.

英文文档：

contentStream

protected InputStream contentStream
If the data for this body part was supplied by an InputStream that implements the SharedInputStream interface, contentStream is another such stream representing the content of this body part. In this case, content will be null.

Since:
JavaMail 1.2

英文文档：

headers

protected InternetHeaders headers
The InternetHeaders object that stores all the headers of this body part.

Constructor Detail

public MimeBodyPart()
创建一个空 MimeBodyPart 对象。此正文部分可以由构造 multipart 消息的客户端填充。
英文文档：

MimeBodyPart

public MimeBodyPart()
An empty MimeBodyPart object is created. This body part maybe filled in by a client constructing a multipart message.

public MimeBodyPart(java.io.InputStream is) throws MessagingException
通过读取和解析指定输入流中的数据来构造 MimeBodyPart。解析器将使用给定输入流末尾之前的数据。输入流必须从有效 MIME 正文部分的开头开始，至该正文部分的末尾结束。

注意，分隔正文部分的“边界”字符串不能包含在输入流中。这是因为 MimeMultipart 解析器将从 multipart 流中提取每个正文部分的字节，并将它们放入此构造方法中，不带分界符字符串。

is 正文部分 InputStream
英文文档：

MimeBodyPart

public MimeBodyPart(InputStream is)
             throws MessagingException
Constructs a MimeBodyPart by reading and parsing the data from the specified input stream. The parser consumes data till the end of the given input stream. The input stream must start at the beginning of a valid MIME body part and must terminate at the end of that body part.

Note that the "boundary" string that delimits body parts must not be included in the input stream. The intention is that the MimeMultipart parser will extract each body part's bytes from a multipart stream and feed them into this constructor, without the delimiter strings.

Parameters:
is - the body part Input Stream
Throws:
MessagingException

public MimeBodyPart(InternetHeaders headers, byte[] content) throws MessagingException
使用给定的头和内容字节构造 MimeBodyPart。

供提供者使用。

headers | 此部分的头
content | 表示此部分正文的字节。
英文文档：

MimeBodyPart

public MimeBodyPart(InternetHeaders headers,
                    byte[] content)
             throws MessagingException
Constructs a MimeBodyPart using the given header and content bytes.

Used by providers.

Parameters:
headers - The header of this part
content - bytes representing the body of this part.
Throws:
MessagingException
Method Detail

public int getSize() throws MessagingException
返回此正文部分的内容大小（以字节为单位）。如果无法确定大小，则返回 -1。

注意，此数值可能不是内容大小的准确度量，可能没有考虑内容的传输编码。

此实现返回 content 数组（如果非 null）的大小；如果 contentStream 非 null，且 available 方法返回一个正数，则它返回该数作为该大小。否则，它返回 -1。

return 以字节为单位的大小；如果未知，则返回 -1。
英文文档：

getSize

public int getSize()
            throws MessagingException
Return the size of the content of this body part in bytes. Return -1 if the size cannot be determined.

Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.

This implementation returns the size of the content array (if not null), or, if contentStream is not null, and the available method returns a positive number, it returns that number as the size. Otherwise, it returns -1.

Specified by:
getSize in interface Part
Returns:
size in bytes, or -1 if not known
Throws:
MessagingException

public int getLineCount() throws MessagingException
返回此 Part 内容的行数。如果无法确定此数值，则返回 -1。

注意，此数值可能不是内容长度的准确度量，可能没有考虑内容的传输编码。

此实现返回 -1。

return 行数；如果未知，则返回 -1。
英文文档：

getLineCount

public int getLineCount()
                 throws MessagingException
Return the number of lines for the content of this Part. Return -1 if this number cannot be determined.

Note that this number may not be an exact measure of the content length and may or may not account for any transfer encoding of the content.

This implementation returns -1.

Specified by:
getLineCount in interface Part
Returns:
number of lines, or -1 if not known
Throws:
MessagingException

public String getContentType() throws MessagingException
返回 RFC 822 "Content-Type" 头字段的值。它表示此正文部分内容的内容类型。此值不得为 null。如果此字段不可用，则应该返回 "text/plain"。

此实现使用 getHeader(name) 获取必需的头字段。

return 此正文部分的 Content-Type。
英文文档：

getContentType

public String getContentType()
                      throws MessagingException
Returns the value of the RFC 822 "Content-Type" header field. This represents the content type of the content of this body part. This value must not be null. If this field is unavailable, "text/plain" should be returned.

This implementation uses getHeader(name) to obtain the requisite header field.

Specified by:
getContentType in interface Part
Returns:
Content-Type of this body part
Throws:
MessagingException
See Also:
DataHandler

public boolean isMimeType(String mimeType) throws MessagingException
此 Part 是指定的 MIME 类型吗？此方法仅比较 primaryType 和 subType。忽略内容类型参数。

例如，当比较内容类型的 "text/plain" 部分与 "text/plain; charset=foobar" 时，此方法将返回 true。

如果 mimeType 的 subType 是特殊字符 '*'，则比较过程中将忽略 subtype。

英文文档：

isMimeType

public boolean isMimeType(String mimeType)
                   throws MessagingException
Is this Part of the specified MIME type? This method compares only the primaryType and subType. The parameters of the content types are ignored.

For example, this method will return true when comparing a Part of content type "text/plain" with "text/plain; charset=foobar".

If the subType of mimeType is the special character '*', then the subtype is ignored during the comparison.

Specified by:
isMimeType in interface Part
Throws:
MessagingException

public String getDisposition() throws MessagingException
返回 "Content-Disposition" 头字段的值。这表示此部分的 disposition。disposition 描述各部分应该如何展示给用户。

如果 Content-Disposition 字段不可用，则返回 null。

此实现使用 getHeader(name) 获取必需的头字段。

See also headers
英文文档：

getDisposition

public String getDisposition()
                      throws MessagingException
Returns the value of the "Content-Disposition" header field. This represents the disposition of this part. The disposition describes how the part should be presented to the user.

If the Content-Disposition field is unavailable, null is returned.

This implementation uses getHeader(name) to obtain the requisite header field.

Specified by:
getDisposition in interface Part
Returns:
disposition of this part, or null if unknown
Throws:
MessagingException
See Also:
headers

public void setDisposition(String disposition) throws MessagingException
设置此正文部分的 "Content-Disposition" 头字段。如果 disposition 为 null，则移除所有现有的 "Content-Disposition" 头字段。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
英文文档：

setDisposition

public void setDisposition(String disposition)
                    throws MessagingException
Set the "Content-Disposition" header field of this body part. If the disposition is null, any existing "Content-Disposition" header field is removed.

Specified by:
setDisposition in interface Part
Parameters:
disposition - disposition of this part
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException
See Also:
Part.ATTACHMENT, Part.INLINE, Part.setFileName(java.lang.String)

public String getEncoding() throws MessagingException
返回 "Content-Transfer-Encoding" 头字段中的内容传输编码。如果头不可用或其值不存在，则返回 null。

此实现使用 getHeader(name) 获取必需的头字段。

See also headers
英文文档：

getEncoding

public String getEncoding()
                   throws MessagingException
Returns the content transfer encoding from the "Content-Transfer-Encoding" header field. Returns null if the header is unavailable or its value is absent.

This implementation uses getHeader(name) to obtain the requisite header field.

Specified by:
getEncoding in interface MimePart
Returns:
content-transfer-encoding
Throws:
MessagingException
See Also:
headers

public String getContentID() throws MessagingException
返回 "Content-ID" 头字段的值。如果字段不可用或其值不存在，则返回 null。

此实现使用 getHeader(name) 获取必需的头字段。

英文文档：

getContentID

public String getContentID()
                    throws MessagingException
Returns the value of the "Content-ID" header field. Returns null if the field is unavailable or its value is absent.

This implementation uses getHeader(name) to obtain the requisite header field.

Specified by:
getContentID in interface MimePart
Returns:
content-ID
Throws:
MessagingException

public void setContentID(String cid) throws MessagingException
设置此正文部分的 "Content-ID" 头字段。如果 cid 参数为 null，则移除所有现有的 "Content-ID"。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
Throws | MessagingException:
since
en
JavaMail 1.3
英文文档：

setContentID

public void setContentID(String cid)
                  throws MessagingException
Set the "Content-ID" header field of this body part. If the cid parameter is null, any existing "Content-ID" is removed.

Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException
Since:
JavaMail 1.3

public String getContentMD5() throws MessagingException
返回 "Content-MD5" 头字段的值。如果此字段不可用或其值不存在，则返回 null。

此实现使用 getHeader(name) 获取必需的头字段。

英文文档：

getContentMD5

public String getContentMD5()
                     throws MessagingException
Return the value of the "Content-MD5" header field. Returns null if this field is unavailable or its value is absent.

This implementation uses getHeader(name) to obtain the requisite header field.

Specified by:
getContentMD5 in interface MimePart
Returns:
content-MD5
Throws:
MessagingException

public void setContentMD5(String md5) throws MessagingException
设置此正文部分的 "Content-MD5" 头字段。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
英文文档：

setContentMD5

public void setContentMD5(String md5)
                   throws MessagingException
Set the "Content-MD5" header field of this body part.

Specified by:
setContentMD5 in interface MimePart
Parameters:
md5 - the MD5 value
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException

public String[] getContentLanguage() throws MessagingException
获取在此 MimePart 的 Content-Language 头中指定的语言。Content-Language 头由 RFC 1766 定义。如果此头不可用或其值不存在，则返回 null。

此实现使用 getHeader(name) 获取必需的头字段。

英文文档：

getContentLanguage

public String[] getContentLanguage()
                            throws MessagingException
Get the languages specified in the Content-Language header of this MimePart. The Content-Language header is defined by RFC 1766. Returns null if this header is not available or its value is absent.

This implementation uses getHeader(name) to obtain the requisite header field.

Specified by:
getContentLanguage in interface MimePart
Throws:
MessagingException

public void setContentLanguage(String[] languages) throws MessagingException
设置此 MimePart 的 Content-Language 头。Content-Language 头由 RFC 1766 定义。
languages 语言标记数组
英文文档：

setContentLanguage

public void setContentLanguage(String[] languages)
                        throws MessagingException
Set the Content-Language header of this MimePart. The Content-Language header is defined by RFC 1766.

Specified by:
setContentLanguage in interface MimePart
Parameters:
languages - array of language tags
Throws:
IllegalWriteException - if the underlying implementation does not support modification
MessagingException

public String getDescription() throws MessagingException
返回此正文部分的 "Content-Description" 头字段。这通常包括一些与此部分关联的描述性信息。如果此字段不可用或其值不存在，则返回 null。

如果 Content-Description 字段根据 RFC 2047 进行编码，则它将被解码并转换为 Unicode。如果解码或转换失败，则原数据按原样返回。

此实现使用 getHeader(name) 获取必需的头字段。

return 内容描述
英文文档：

getDescription

public String getDescription()
                      throws MessagingException
Returns the "Content-Description" header field of this body part. This typically associates some descriptive information with this part. Returns null if this field is unavailable or its value is absent.

If the Content-Description field is encoded as per RFC 2047, it is decoded and converted into Unicode. If the decoding or conversion fails, the raw data is returned as is.

This implementation uses getHeader(name) to obtain the requisite header field.

Specified by:
getDescription in interface Part
Returns:
content description
Throws:
MessagingException

public void setDescription(String description) throws MessagingException
设置此正文部分的 "Content-Description" 头字段。如果 description 参数为 null，则移除所有现有的 "Content-Description" 字段。

如果 description 包含非 US-ASCII 字符，则它将使用平台的默认字符集进行编码。如果 description 仅包含 US-ASCII 字符，则不进行编码，它将按原样使用。

注意，如果字符集编码处理失败，则抛出 MessagingException，并且在 MessagingException 的嵌套异常链中包含 UnsupportedEncodingException。

description | 内容描述
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
Throws | MessagingException: 其他情况；如果字符集转换失败，则可能在异常链中包含 UnsupportedEncodingException。
英文文档：

setDescription

public void setDescription(String description)
                    throws MessagingException
Set the "Content-Description" header field for this body part. If the description parameter is null, then any existing "Content-Description" fields are removed.

If the description contains non US-ASCII characters, it will be encoded using the platform's default charset. If the description contains only US-ASCII characters, no encoding is done and it is used as is.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

Specified by:
setDescription in interface Part
Parameters:
description - content description
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException - otherwise; an UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.

public void setDescription(String description, String charset) throws MessagingException
设置此正文部分的 "Content-Description" 头字段。如果 description 参数为 null，则移除所有现有的 "Content-Description" 字段。

如果 description 包含非 US-ASCII 字符，则它将使用特定的字符集进行编码。如果 description 仅包含 US-ASCII 字符，则不进行编码，它将按原样使用。

注意，如果字符集编码处理失败，则抛出 MessagingException，并且在 MessagingException 的嵌套异常链中包含 UnsupportedEncodingException。

description | 描述
charset | 编码的字符集
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
Throws | MessagingException: 其他情况；如果字符集转换失败，则可能在异常链中包含 UnsupportedEncodingException。
英文文档：

setDescription

public void setDescription(String description,
                           String charset)
                    throws MessagingException
Set the "Content-Description" header field for this body part. If the description parameter is null, then any existing "Content-Description" fields are removed.

If the description contains non US-ASCII characters, it will be encoded using the specified charset. If the description contains only US-ASCII characters, no encoding is done and it is used as is.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

Parameters:
description - Description
charset - Charset for encoding
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException - otherwise; an UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.

public String getFileName() throws MessagingException
获取与此正文部分关联的文件名称。

返回此正文部分的 "Content-Disposition" 头字段的 "filename" 参数的值。如果不可用，则返回此正文部分的 "Content-Type" 头字段的 "name" 参数的值。如果都不存在，则返回 null。

如果 mail.mime.encodefilename 系统属性设置为 true，则将使用 MimeUtility.decodeText 方法解码文件名称。尽管 MIME 规范不支持此编码，但许多邮件程序使用此技术支持在文件名称中使用非 ASCII 字符。此属性的默认值为 false。

return 文件名称
英文文档：

getFileName

public String getFileName()
                   throws MessagingException
Get the filename associated with this body part.

Returns the value of the "filename" parameter from the "Content-Disposition" header field of this body part. If its not available, returns the value of the "name" parameter from the "Content-Type" header field of this body part. Returns null if both are absent.

If the mail.mime.encodefilename System property is set to true, the MimeUtility.decodeText method will be used to decode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.

Specified by:
getFileName in interface Part
Returns:
filename
Throws:
MessagingException

public void setFileName(String filename) throws MessagingException
如果可能，设置与此正文部分关联的文件名称。

设置此正文部分的 "Content-Disposition" 头字段的 "filename" 参数。为了与原来的邮件程序兼容，还要设置 "Content-Type" 头的 "name" 参数。

如果 mail.mime.encodefilename 系统属性设置为 true，则将使用 MimeUtility.encodeText 方法编码文件名称。尽管 MIME 规范不支持此编码，但许多邮件程序使用此技术支持在文件名称中使用非 ASCII 字符。此属性的默认值为 false。

Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
英文文档：

setFileName

public void setFileName(String filename)
                 throws MessagingException
Set the filename associated with this body part, if possible.

Sets the "filename" parameter of the "Content-Disposition" header field of this body part. For compatibility with older mailers, the "name" parameter of the "Content-Type" header is also set.

If the mail.mime.encodefilename System property is set to true, the MimeUtility.encodeText method will be used to encode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.

Specified by:
setFileName in interface Part
Parameters:
filename - Filename to associate with this part
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException

public java.io.InputStream getInputStream() throws java.io.IOException, MessagingException
返回用于此正文部分 "content" 的解码输入流。

此实现从 DataHandler 获取输入流。即它调用 getDataHandler().getInputStream();

return | InputStream
Throws | MessagingException:
Throws | java.io.IOException: 此异常通常由 DataHandler 抛出。有关更多信息，请参考 javax.activation.DataHandler 的文档。
See also | getContentStream, getInputStream
英文文档：

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  MessagingException
Return a decoded input stream for this body part's "content".

This implementation obtains the input stream from the DataHandler. That is, it invokes getDataHandler().getInputStream();

Specified by:
getInputStream in interface Part
Returns:
an InputStream
Throws:
MessagingException
IOException - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.
See Also:
getContentStream(), DataHandler.getInputStream()

protected java.io.InputStream getContentStream() throws MessagingException
生成内容的原始字节。在为内容创建 DataHandler 对象时使用此方法。能为 Part 内容提供单独输入流的子类可能要重写此方法。

See also content, getContentStream
英文文档：

getContentStream

protected InputStream getContentStream()
                                throws MessagingException
Produce the raw bytes of the content. This method is used when creating a DataHandler object for the content. Subclasses that can provide a separate input stream for just the Part content might want to override this method.

Throws:
MessagingException
See Also:
content, MimeMessage.getContentStream()

public java.io.InputStream getRawInputStream() throws MessagingException
将 InputStream 作为原始数据返回，保持所有 Content-Transfer-Encoding 不变。如果 "Content-Transfer-Encoding" 头不正确或者被破坏（将导致 getInputStream 方法或 getContent 方法无法返回正确的数据），则此方法很有用。在这种情况下，应用程序可以使用此方法自己尝试解码原始数据。

此实现调用 getContentStream 方法。

since
en
JavaMail 1.2
See also getInputStream, getContentStream
英文文档：

getRawInputStream

public InputStream getRawInputStream()
                              throws MessagingException
Return an InputStream to the raw data with any Content-Transfer-Encoding intact. This method is useful if the "Content-Transfer-Encoding" header is incorrect or corrupt, which would prevent the getInputStream method or getContent method from returning the correct data. In such a case the application may use this method and attempt to decode the raw data itself.

This implementation simply calls the getContentStream method.

Throws:
MessagingException
Since:
JavaMail 1.2
See Also:
getInputStream(), getContentStream()

public DataHandler getDataHandler() throws MessagingException
返回用于此正文部分的内容的 DataHandler。

在此提供的实现与 MimeMessage 中实现的作用类似。

See also getDataHandler
英文文档：

getDataHandler

public DataHandler getDataHandler()
                           throws MessagingException
Return a DataHandler for this body part's content.

The implementation provided here works just like the the implementation in MimeMessage.

Specified by:
getDataHandler in interface Part
Returns:
DataHandler for the content
Throws:
MessagingException
See Also:
MimeMessage.getDataHandler()

public Object getContent() throws java.io.IOException, MessagingException
以 Java 对象的形式返回内容。返回对象的类型当然取决于内容本身。例如，text/plain 内容的本机格式通常为 String 对象。"multipart" 内容的本机格式通常为 Multipart 子类。对于 DataHandler 系统未知的内容类型，将输入流作为内容返回。

此实现从 DataHandler 获取内容。即它调用 getDataHandler().getContent()；如果内容为 Multipart 或 Message 对象，并且是通过解析流创建的，则该对象被缓存并在后续调用中返回，以防止丢失对内容所做的修改。

return | 对象
Throws | MessagingException:
Throws | java.io.IOException: 此异常通常由 DataHandler 抛出。有关更多信息，请参考 javax.activation.DataHandler 的文档。
英文文档：

getContent

public Object getContent()
                  throws IOException,
                         MessagingException
Return the content as a Java object. The type of the object returned is of course dependent on the content itself. For example, the native format of a text/plain content is usually a String object. The native format for a "multipart" content is always a Multipart subclass. For content types that are unknown to the DataHandler system, an input stream is returned as the content.

This implementation obtains the content from the DataHandler. That is, it invokes getDataHandler().getContent(); If the content is a Multipart or Message object and was created by parsing a stream, the object is cached and returned in subsequent calls so that modifications to the content will not be lost.

Specified by:
getContent in interface Part
Returns:
Object
Throws:
MessagingException
IOException - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.
See Also:
DataHandler.getContent()

public void setDataHandler(DataHandler dh) throws MessagingException
此方法提供设置此正文部分的内容的机制。给定的 DataHandler 对象应该包装实际的内容。
dh | 内容的 DataHandler
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
英文文档：

setDataHandler

public void setDataHandler(DataHandler dh)
                    throws MessagingException
This method provides the mechanism to set this body part's content. The given DataHandler object should wrap the actual content.

Specified by:
setDataHandler in interface Part
Parameters:
dh - The DataHandler for the content
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException

public void setContent(Object o, String type) throws MessagingException
设置此正文部分的内容的便捷方法。

内容被包装在 DataHandler 对象中。注意，指定类型的 DataContentHandler 类必须可用于 JavaMail 实现，此方法才能正常运行。也就是说，要实现 setContent(foobar, "application/x-foobar")，就应该安装用于 "application/x-foobar" 的 DataContentHandler。有关更多信息，请参考 Java Activation Framework。

o | 内容对象
type | 对象的 Mime 类型
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
英文文档：

setContent

public void setContent(Object o,
                       String type)
                throws MessagingException
A convenience method for setting this body part's content.

The content is wrapped in a DataHandler object. Note that a DataContentHandler class for the specified type should be available to the JavaMail implementation for this to work right. That is, to do setContent(foobar, "application/x-foobar"), a DataContentHandler for "application/x-foobar" should be installed. Refer to the Java Activation Framework for more information.

Specified by:
setContent in interface Part
Parameters:
o - the content object
type - Mime type of the object
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException

public void setText(String text) throws MessagingException
使用 MIME 类型 "text/plain" 将给定的 String 设置为此部分内容的便捷方法。如果字符串包含非 US-ASCII 字符，则它将使用平台的默认字符集进行编码。也使用该字符集设置 "charset" 参数。

注意，如果 text 很大，可能会影响性能，因为此方法必须扫描所有字符以确定使用哪种字符集。

如果字符集已知，则使用带有 charset 参数的 setText 方法。

text | 要设置的文本内容
Throws | MessagingException: 如果发生错误
See also | setText(String text, String charset)
英文文档：

setText

public void setText(String text)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". If the string contains non US-ASCII characters, it will be encoded using the platform's default charset. The charset is also used to set the "charset" parameter.

Note that there may be a performance penalty if text is large, since this method may have to scan all the characters to determine what charset to use.

If the charset is already known, use the setText method that takes the charset parameter.

Specified by:
setText in interface MimePart
Specified by:
setText in interface Part
Parameters:
text - the text content to set
Throws:
MessagingException - if an error occurs
See Also:
setText(String text, String charset)

public void setText(String text, String charset) throws MessagingException
使用 MIME 类型 "text/plain" 和指定字符集将给定 String 设置为此部分内容的便捷方法。给定的 Unicode 字符串将使用指定的字符集进行编码。也使用该字符集设置 "charset" 参数。
text | 要设置的文本内容
charset | 用于文本的字符集
Throws | MessagingException: 如果发生错误
英文文档：

setText

public void setText(String text,
                    String charset)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.

Specified by:
setText in interface MimePart
Parameters:
text - the text content to set
charset - the charset to use for the text
Throws:
MessagingException - if an error occurs

public void setText(String text, String charset, String subtype) throws MessagingException
使用基本 MIME 类型 "text" 和指定 MIME 子类型将给定的 String 设置为此部分内容的便捷方法。给定的 Unicode 字符串将使用指定的字符集进行编码。也使用该字符集设置 "charset" 参数。
text | 要设置的文本内容
charset | 用于文本的字符集
subtype | 要使用的 MIME 子类型（如 "html"）
Throws | MessagingException: 如果发生错误
since
en
JavaMail 1.4
英文文档：

setText

public void setText(String text,
                    String charset,
                    String subtype)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.

Specified by:
setText in interface MimePart
Parameters:
text - the text content to set
charset - the charset to use for the text
subtype - the MIME subtype to use (e.g., "html")
Throws:
MessagingException - if an error occurs
Since:
JavaMail 1.4

public void setContent(Multipart mp) throws MessagingException
此方法将正文部分的内容设置为 Multipart 对象。
mp | 为 Message 的内容的 multipart 对象。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值。
Throws | IllegalStateException: 如果此正文部分可从 READ_ONLY 文件夹获取。
英文文档：

setContent

public void setContent(Multipart mp)
                throws MessagingException
This method sets the body part's content to a Multipart object.

Specified by:
setContent in interface Part
Parameters:
mp - The multipart object that is the Message's content
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values.
IllegalStateException - if this body part is obtained from a READ_ONLY folder.
MessagingException

public void attachFile(java.io.File file) throws java.io.IOException, MessagingException
使用指定的文件为此部分提供数据。file 的名称用作此部分的文件名称，file 中的数据用作此部分的数据。将针对文件数据选择适当的编码。
file | 要附加的 File 对象
Throws | java.io.IOException: 与访问文件有关的错误
Throws | MessagingException: 与消息有关的错误
since
en
JavaMail 1.4
英文文档：

attachFile

public void attachFile(File file)
                throws IOException,
                       MessagingException
Use the specified file to provide the data for this part. The simple file name is used as the file name for this part and the data in the file is used as the data for this part. The encoding will be chosen appropriately for the file data.

Parameters:
file - the File object to attach
Throws:
IOException - errors related to accessing the file
MessagingException - message related errors
Since:
JavaMail 1.4

public void attachFile(String file) throws java.io.IOException, MessagingException
使用指定的文件为此部分提供数据。file 的名称用作此部分的文件名称，file 中的数据用作此部分的数据。将针对文件数据选择适当的编码。
file | 要附加的文件名
Throws | java.io.IOException: 与访问文件有关的错误
Throws | MessagingException: 与消息有关的错误
since
en
JavaMail 1.4
英文文档：

attachFile

public void attachFile(String file)
                throws IOException,
                       MessagingException
Use the specified file to provide the data for this part. The simple file name is used as the file name for this part and the data in the file is used as the data for this part. The encoding will be chosen appropriately for the file data.

Parameters:
file - the name of the file to attach
Throws:
IOException - errors related to accessing the file
MessagingException - message related errors
Since:
JavaMail 1.4

public void saveFile(java.io.File file) throws java.io.IOException, MessagingException
将此部分的内容保存在指定的文件中。解码内容并保存，不包括任何 MIME 头。
file | 要写入的 File 对象
Throws | java.io.IOException: 与访问文件有关的错误
Throws | MessagingException: 与消息有关的错误
since
en
JavaMail 1.4
英文文档：

saveFile

public void saveFile(File file)
              throws IOException,
                     MessagingException
Save the contents of this part in the specified file. The content is decoded and saved, without any of the MIME headers.

Parameters:
file - the File object to write to
Throws:
IOException - errors related to accessing the file
MessagingException - message related errors
Since:
JavaMail 1.4

public void saveFile(String file) throws java.io.IOException, MessagingException
将此部分的内容保存在指定的文件中。解码内容并保存，不包括任何 MIME 头。
file | 要写入的文件名
Throws | java.io.IOException: 与访问文件有关的错误
Throws | MessagingException: 与消息有关的错误
since
en
JavaMail 1.4
英文文档：

saveFile

public void saveFile(String file)
              throws IOException,
                     MessagingException
Save the contents of this part in the specified file. The content is decoded and saved, without any of the MIME headers.

Parameters:
file - the name of the file to write to
Throws:
IOException - errors related to accessing the file
MessagingException - message related errors
Since:
JavaMail 1.4

public void writeTo(java.io.OutputStream os) throws java.io.IOException, MessagingException
以 RFC 822 格式流的形式输出正文部分。
Throws | MessagingException:
Throws | java.io.IOException: 如果写入流时发生错误，或者 javax.activation 层发生错误。
See also | writeTo
英文文档：

writeTo

public void writeTo(OutputStream os)
             throws IOException,
                    MessagingException
Output the body part as an RFC 822 format stream.

Specified by:
writeTo in interface Part
Throws:
MessagingException
IOException - if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
See Also:
DataHandler.writeTo(java.io.OutputStream)

public String[] getHeader(String name) throws MessagingException
获取此 header_name 的所有头。注意，如果某些头包含非 US-ASCII 字符并且应该解码，则可以根据 RFC 2047 进行编码。
name | 头名称
return | 头数组
See also | javax.mail.internet.MimeUtility
英文文档：

getHeader

public String[] getHeader(String name)
                   throws MessagingException
Get all the headers for this header_name. Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.

Specified by:
getHeader in interface Part
Parameters:
name - name of header
Returns:
array of headers
Throws:
MessagingException
See Also:
MimeUtility

public String getHeader(String name, String delimiter) throws MessagingException
获取具有此头名称的所有头，以单个 String 的形式返回，头之间用 delimiter 隔开。如果 delimiter 为 null，则仅返回第一个头。
name | 此头的名称
delimiter | 返回字符串中头之间的分界符
return | 具有此名称的所有头的值字段
Throws | MessagingException:
英文文档：

getHeader

public String getHeader(String name,
                        String delimiter)
                 throws MessagingException
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter. If the delimiter is null, only the first header is returned.

Specified by:
getHeader in interface MimePart
Parameters:
name - the name of this header
delimiter - delimiter between fields in returned string
Returns:
the value fields for all headers with this name
Throws:
MessagingException

public void setHeader(String name, String value) throws MessagingException
设置此 header_name 的值。使用此新值替换所有现有的头值。注意，RFC 822 头只能包含 US-ASCII 字符，因此包含非 US-ASCII 字符的头必须根据 RFC 2047 的规则进行编码。
name | 头名称
value | 头值
See also | javax.mail.internet.MimeUtility
英文文档：

setHeader

public void setHeader(String name,
                      String value)
               throws MessagingException
Set the value for this header_name. Replaces all existing header values with this new value. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must be encoded as per the rules of RFC 2047.

Specified by:
setHeader in interface Part
Parameters:
name - header name
value - header value
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
See Also:
MimeUtility

public void addHeader(String name, String value) throws MessagingException
将此值添加到此 header_name 的现有值中。注意，RFC 822 头只能包含 US-ASCII 字符，因此包含非 US-ASCII 字符的头必须根据 RFC 2047 的规则进行编码。
name | 头名称
value | 头值
See also | javax.mail.internet.MimeUtility
英文文档：

addHeader

public void addHeader(String name,
                      String value)
               throws MessagingException
Add this value to the existing values for this header_name. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must be encoded as per the rules of RFC 2047.

Specified by:
addHeader in interface Part
Parameters:
name - header name
value - header value
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
See Also:
MimeUtility

public void removeHeader(String name) throws MessagingException
移除具有此名称的所有头。
英文文档：

removeHeader

public void removeHeader(String name)
                  throws MessagingException
Remove all headers with this name.

Specified by:
removeHeader in interface Part
Parameters:
name - the name of this header
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

public java.util.Enumeration<E> getAllHeaders() throws MessagingException
以 Header 对象的枚举形式返回此 Message 中的所有头。
英文文档：

getAllHeaders

public Enumeration getAllHeaders()
                          throws MessagingException
Return all the headers from this Message as an Enumeration of Header objects.

Specified by:
getAllHeaders in interface Part
Returns:
enumeration of Header objects
Throws:
MessagingException

public java.util.Enumeration<E> getMatchingHeaders(String[] names) throws MessagingException
以 Header 对象的枚举形式返回此 Message 中的匹配头。

英文文档：

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] names)
                               throws MessagingException
Return matching headers from this Message as an Enumeration of Header objects.

Specified by:
getMatchingHeaders in interface Part
Returns:
enumeration of Header objects
Throws:
MessagingException

public java.util.Enumeration<E> getNonMatchingHeaders(String[] names) throws MessagingException
以 Header 对象的枚举形式返回此 Message 中不匹配的头。
英文文档：

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] names)
                                  throws MessagingException
Return non-matching headers from this Message as an Enumeration of Header objects.

Specified by:
getNonMatchingHeaders in interface Part
Returns:
enumeration of Header objects
Throws:
MessagingException

public void addHeaderLine(String line) throws MessagingException
将头行添加到此正文部分
英文文档：

addHeaderLine

public void addHeaderLine(String line)
                   throws MessagingException
Add a header line to this body part

Specified by:
addHeaderLine in interface MimePart
Throws:
IllegalWriteException - if the underlying implementation does not support modification
MessagingException

public java.util.Enumeration<E> getAllHeaderLines() throws MessagingException
以 String 枚举的形式获取所有头行。Header 行是原始 RFC 822 头行，包含 "name" 和 "value" 字段。
英文文档：

getAllHeaderLines

public Enumeration getAllHeaderLines()
                              throws MessagingException
Get all header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.

Specified by:
getAllHeaderLines in interface MimePart
Throws:
MessagingException

public java.util.Enumeration<E> getMatchingHeaderLines(String[] names) throws MessagingException
以 String 枚举的形式获取匹配的头行。Header 行是原始 RFC 822 头行，包含 "name" 和 "value" 字段。
英文文档：

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.

Specified by:
getMatchingHeaderLines in interface MimePart
Throws:
MessagingException

public java.util.Enumeration<E> getNonMatchingHeaderLines(String[] names) throws MessagingException
以 String 枚举的形式获取不匹配的头行。Header 行是原始 RFC 822 头行，包含 "name" 和 "value" 字段。
英文文档：

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.

Specified by:
getNonMatchingHeaderLines in interface MimePart
Throws:
MessagingException

protected void updateHeaders() throws MessagingException
检查此正文部分的内容并更新相应的 MIME 头。这里要设置的典型头是 Content-Type 和 Content-Transfer-Encoding。在两种情况下需要更新头：
- 邮件应用程序创建的消息当然需要在某一时刻激活此方法以填充其内部头。
- 从 Store 读取的消息已经从此存储库中获得了它的所有头，因此不需要此方法。但是，如果此消息可编辑，并且已经对其内容或消息结构进行了某些编辑，则需要重新同步头。
在这两种情况下，此方法通常都由 Message.saveChanges 方法调用。
英文文档：

updateHeaders

protected void updateHeaders()
                      throws MessagingException
Examine the content of this body part and update the appropriate MIME headers. Typical headers that get set here are Content-Type and Content-Transfer-Encoding. Headers might need to be updated in two cases:
- A message being crafted by a mail application will certainly need to activate this method at some point to fill up its internal headers.
- A message read in from a Store will have obtained all its headers from the store, and so doesn't need this. However, if this message is editable and if any edits have been made to either the content or message structure, we might need to resync our headers.
In both cases this method is typically called by the Message.saveChanges method.

Throws:
MessagingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeMessage (Java EE 5)

javax.mail.internet
Class MimeMessage

java.lang.Object
    extended by  javax.mail.Message
        extended by  javax.mail.internet.MimeMessage
All Implemented Interfaces:
MimePart, Part
public class MimeMessage
extends Message
implements MimePart

Extends: Message
Implements: MimePart
Inner classes: MimeMessage.RecipientType

此类表示 MIME 样式的电子邮件消息。它实现 Message 抽象类和 MimePart 接口。

要创建新 MIME 样式消息的客户端将实例化一个空 MimeMessage 对象，然后用相应的属性和内容填充它。

实现 MIME 兼容后端存储的服务提供者可能要创建 MimeMessage 的子类并重写某些方法，以提供特定的实现。最简单的情况可能是提供者生成一个 MIME 样式的输入流，然后让此类解析该流。

MimeMessage 使用 InternetHeaders 类解析并存储消息的顶层 RFC 822 头。

mail.mime.address.strict 会话属性控制地址头的解析。默认情况下，执行严格的地址头解析操作。如果此属性设置为 "false"，则不执行严格解析，允许在实际消息中偶尔存在一些非法地址。有关详细信息，请参见 InternetAddress 类。

有关 RFC 822 和 MIME 头的注意事项

RFC 822 头字段只能包含 US-ASCII 字符。通过解码非 ASCII 字符，MIME 允许这些字符存在于特定头的特定部分。RFC 2047 指定实现此操作的规则。此包提供的 MimeUtility 类可以用来实现这一点。setHeader、addHeader 和 addHeaderLine 方法的调用者负责针对指定的头强制执行 MIME 要求。此外，如果这些头字段超过了传输的行长度限制（SMTP 为 1000 字节），则发送前必须进行折叠（包装）。收到的头可能已经进行了折叠。应用程序负责根据需要折叠和展开头。

See also javax.mail.internet.MimeUtility, javax.mail.Part, javax.mail.Message, javax.mail.internet.MimePart, javax.mail.internet.InternetAddress
英文文档：

This class represents a MIME style email message. It implements the Message abstract class and the MimePart interface.

Clients wanting to create new MIME style messages will instantiate an empty MimeMessage object and then fill it with appropriate attributes and content.

Service providers that implement MIME compliant backend stores may want to subclass MimeMessage and override certain methods to provide specific implementations. The simplest case is probably a provider that generates a MIME style input stream and leaves the parsing of the stream to this class.

MimeMessage uses the InternetHeaders class to parse and store the top level RFC 822 headers of a message.

The mail.mime.address.strict session property controls the parsing of address headers. By default, strict parsing of address headers is done. If this property is set to "false", strict parsing is not done and many illegal addresses that sometimes occur in real messages are allowed. See the InternetAddress class for details.

A note on RFC 822 and MIME headers

RFC 822 header fields must contain only US-ASCII characters. MIME allows non ASCII characters to be present in certain portions of certain headers, by encoding those characters. RFC 2047 specifies the rules for doing this. The MimeUtility class provided in this package can be used to to achieve this. Callers of the setHeader, addHeader, and addHeaderLine methods are responsible for enforcing the MIME requirements for the specified headers. In addition, these header fields must be folded (wrapped) before being sent if they exceed the line length limitation for the transport (1000 bytes for SMTP). Received headers may have been folded. The application is responsible for folding and unfolding headers as appropriate.

Author:
John Mani, Bill Shannon, Max Spivak, Kanwar Oberoi
See Also:
MimeUtility, Part, Message, MimePart, InternetAddress

Nested Class Summary
static class MimeMessage.RecipientType
This inner class extends the javax.mail.Message.RecipientType class to add additional RecipientTypes.
Field Summary
protected byte[] | content Byte array that holds the bytes of this Message's content.
protected InputStream | contentStream If the data for this message was supplied by an InputStream that implements the SharedInputStream interface, contentStream is another such stream representing the content of this message.
protected DataHandler | dh The DataHandler object representing this Message's content.
protected Flags | flags The Flags for this message.
protected InternetHeaders | headers The InternetHeaders object that stores the header of this message.
protected boolean | modified A flag indicating whether the message has been modified.
protected boolean | saved Does the saveChanges method need to be called on this message?
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
Constructor Summary
protected | MimeMessage(Folder folder, InputStream is, int msgnum) Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.
protected | MimeMessage(Folder folder, int msgnum) Constructs an empty MimeMessage object with the given Folder and message number.
protected | MimeMessage(Folder folder, InternetHeaders headers, byte[] content, int msgnum) Constructs a MimeMessage from the given InternetHeaders object and content.
 | MimeMessage(MimeMessage source) Constructs a new MimeMessage with content initialized from the source MimeMessage.
 | MimeMessage(Session session) Default constructor.
 | MimeMessage(Session session, InputStream is) Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.
Method Summary
void | addFrom(Address[] addresses) Add the specified addresses to the existing "From" field.
void | addHeader(String name, String value) Add this value to the existing values for this header_name.
void | addHeaderLine(String line) Add a raw RFC 822 header-line.
void | addRecipients(Message.RecipientType type, Address[] addresses) Add the given addresses to the specified recipient type.
void | addRecipients(Message.RecipientType type, String addresses) Add the given addresses to the specified recipient type.
protected InternetHeaders | createInternetHeaders(InputStream is) Create and return an InternetHeaders object that loads the headers from the given InputStream.
protected MimeMessage | createMimeMessage(Session session) Create and return a MimeMessage object.
Enumeration | getAllHeaderLines() Get all header lines as an Enumeration of Strings.
Enumeration | getAllHeaders() Return all the headers from this Message as an enumeration of Header objects.
Address[] | getAllRecipients() Get all the recipient addresses for the message.
Object | getContent() Return the content as a Java object.
String | getContentID() Returns the value of the "Content-ID" header field.
String[] | getContentLanguage() Get the languages specified in the "Content-Language" header field of this message.
String | getContentMD5() Return the value of the "Content-MD5" header field.
protected InputStream | getContentStream() Produce the raw bytes of the content.
String | getContentType() Returns the value of the RFC 822 "Content-Type" header field.
DataHandler | getDataHandler() Return a DataHandler for this Message's content.
String | getDescription() Returns the "Content-Description" header field of this Message.
String | getDisposition() Returns the value of the "Content-Disposition" header field.
String | getEncoding() Returns the content transfer encoding from the "Content-Transfer-Encoding" header field.
String | getFileName() Get the filename associated with this Message.
Flags | getFlags() Return a Flags object containing the flags for this message.
Address[] | getFrom() Returns the value of the RFC 822 "From" header fields.
String[] | getHeader(String name) Get all the headers for this header_name.
String | getHeader(String name, String delimiter) Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.
InputStream | getInputStream() Return a decoded input stream for this Message's "content".
int | getLineCount() Return the number of lines for the content of this message.
Enumeration | getMatchingHeaderLines(String[] names) Get matching header lines as an Enumeration of Strings.
Enumeration | getMatchingHeaders(String[] names) Return matching headers from this Message as an Enumeration of Header objects.
String | getMessageID() Returns the value of the "Message-ID" header field.
Enumeration | getNonMatchingHeaderLines(String[] names) Get non-matching header lines as an Enumeration of Strings.
Enumeration | getNonMatchingHeaders(String[] names) Return non-matching headers from this Message as an Enumeration of Header objects.
InputStream | getRawInputStream() Return an InputStream to the raw data with any Content-Transfer-Encoding intact.
Date | getReceivedDate() Returns the Date on this message was received.
Address[] | getRecipients(Message.RecipientType type) Returns the recepients specified by the type.
Address[] | getReplyTo() Return the value of the RFC 822 "Reply-To" header field.
Address | getSender() Returns the value of the RFC 822 "Sender" header field.
Date | getSentDate() Returns the value of the RFC 822 "Date" field.
int | getSize() Return the size of the content of this message in bytes.
String | getSubject() Returns the value of the "Subject" header field.
boolean | isMimeType(String mimeType) Is this Part of the specified MIME type?
boolean | isSet(Flags.Flag flag) Check whether the flag specified in the flag argument is set in this message.
protected void | parse(InputStream is) Parse the InputStream setting the headers and content fields appropriately.
void | removeHeader(String name) Remove all headers with this name.
Message | reply(boolean replyToAll) Get a new Message suitable for a reply to this message.
void | saveChanges() Updates the appropriate header fields of this message to be consistent with the message's contents.
void | setContent(Multipart mp) This method sets the Message's content to a Multipart object.
void | setContent(Object o, String type) A convenience method for setting this Message's content.
void | setContentID(String cid) Set the "Content-ID" header field of this Message.
void | setContentLanguage(String[] languages) Set the "Content-Language" header of this MimePart.
void | setContentMD5(String md5) Set the "Content-MD5" header field of this Message.
void | setDataHandler(DataHandler dh) This method provides the mechanism to set this part's content.
void | setDescription(String description) Set the "Content-Description" header field for this Message.
void | setDescription(String description, String charset) Set the "Content-Description" header field for this Message.
void | setDisposition(String disposition) Set the "Content-Disposition" header field of this Message.
void | setFileName(String filename) Set the filename associated with this part, if possible.
void | setFlags(Flags flag, boolean set) Set the flags for this message.
void | setFrom() Set the RFC 822 "From" header field using the value of the InternetAddress.getLocalAddress method.
void | setFrom(Address address) Set the RFC 822 "From" header field.
void | setHeader(String name, String value) Set the value for this header_name.
void | setRecipients(Message.RecipientType type, Address[] addresses) Set the specified recipient type to the given addresses.
void | setRecipients(Message.RecipientType type, String addresses) Set the specified recipient type to the given addresses.
void | setReplyTo(Address[] addresses) Set the RFC 822 "Reply-To" header field.
void | setSender(Address address) Set the RFC 822 "Sender" header field.
void | setSentDate(Date d) Set the RFC 822 "Date" header field.
void | setSubject(String subject) Set the "Subject" header field.
void | setSubject(String subject, String charset) Set the "Subject" header field.
void | setText(String text) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".
void | setText(String text, String charset) Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.
void | setText(String text, String charset, String subtype) Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.
protected void | updateHeaders() Called by the saveChanges method to actually update the MIME headers.
protected void | updateMessageID() Update the Message-ID header.
void | writeTo(OutputStream os) Output the message as an RFC 822 format stream.
void | writeTo(OutputStream os, String[] ignoreList) Output the message as an RFC 822 format stream, without specified headers.
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

dh

protected DataHandler dh
The DataHandler object representing this Message's content.

英文文档：

content

protected byte[] content
Byte array that holds the bytes of this Message's content.

英文文档：

contentStream

protected InputStream contentStream
If the data for this message was supplied by an InputStream that implements the SharedInputStream interface, contentStream is another such stream representing the content of this message. In this case, content will be null.

Since:
JavaMail 1.2

英文文档：

headers

protected InternetHeaders headers
The InternetHeaders object that stores the header of this message.

英文文档：

flags

protected Flags flags
The Flags for this message.

英文文档：

modified

protected boolean modified
A flag indicating whether the message has been modified. If the message has not been modified, any data in the content array is assumed to be valid and is used directly in the writeTo method. This flag is set to true when an empty message is created or when the saveChanges method is called.

Since:
JavaMail 1.2

英文文档：

saved

protected boolean saved
Does the saveChanges method need to be called on this message? This flag is set to false by the public constructor and set to true by the saveChanges method. The writeTo method checks this flag and calls the saveChanges method as necessary. This avoids the common mistake of forgetting to call the saveChanges method on a newly constructed message.

Since:
JavaMail 1.2
Constructor Detail

public MimeMessage(Session session)
默认构造方法。创建一个空消息对象。headers 字段被设置为空 InternetHeaders 对象。flags 字段被设置为空 Flags 对象。modified 标志设置为 true。
英文文档：

MimeMessage

public MimeMessage(Session session)
Default constructor. An empty message object is created. The headers field is set to an empty InternetHeaders object. The flags field is set to an empty Flags object. The modified flag is set to true.

public MimeMessage(Session session, java.io.InputStream is) throws MessagingException
通过读取和解析指定 MIME InputStream 中的数据构造 MimeMessage。InputStream 将留在消息的数据末尾。注意，输入流解析在此构造方法内完成。

输入流包含带有头和数据的完整 MIME 格式化消息。

session | 此消息的会话对象
is | 消息输入流。
Throws | MessagingException:
英文文档：

MimeMessage

public MimeMessage(Session session,
                   InputStream is)
            throws MessagingException
Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream. The InputStream will be left positioned at the end of the data for the message. Note that the input stream parse is done within this constructor itself.

The input stream contains an entire MIME formatted message with headers and data.

Parameters:
session - Session object for this message
is - the message input stream
Throws:
MessagingException

public MimeMessage(MimeMessage source) throws MessagingException
使用根据 source MimeMessage 初始化的内容构造新 MimeMessage。新消息与原消息无关。

注：当前实现比严格要求时效率要低，复制数据的次数也更多。

source | 要从中复制内容的消息
Throws | MessagingException:
since
en
JavaMail 1.2
英文文档：

MimeMessage

public MimeMessage(MimeMessage source)
            throws MessagingException
Constructs a new MimeMessage with content initialized from the source MimeMessage. The new message is independent of the original.

Note: The current implementation is rather inefficient, copying the data more times than strictly necessary.

Parameters:
source - the message to copy content from
Throws:
MessagingException
Since:
JavaMail 1.2

protected MimeMessage(Folder folder, int msgnum)
使用给定的 Folder 和消息编号构造空 MimeMessage 对象。

此方法供提供者创建 MimeMessage 的子类。

英文文档：

MimeMessage

protected MimeMessage(Folder folder,
                      int msgnum)
Constructs an empty MimeMessage object with the given Folder and message number.

This method is for providers subclassing MimeMessage.

protected MimeMessage(Folder folder, java.io.InputStream is, int msgnum) throws MessagingException
通过读取和解析指定 MIME InputStream 中的数据构造 MimeMessage。InputStream 将留在消息的数据末尾。注意，输入流解析在此构造方法内完成。

此方法供提供者创建 MimeMessage 的子类。

folder | 包含文件夹。
is | 消息输入流。
msgnum | 文件夹中此消息的消息编号
Throws | MessagingException:
英文文档：

MimeMessage

protected MimeMessage(Folder folder,
                      InputStream is,
                      int msgnum)
               throws MessagingException
Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream. The InputStream will be left positioned at the end of the data for the message. Note that the input stream parse is done within this constructor itself.

This method is for providers subclassing MimeMessage.

Parameters:
folder - The containing folder.
is - the message input stream
msgnum - Message number of this message within its folder
Throws:
MessagingException

protected MimeMessage(Folder folder, InternetHeaders headers, byte[] content, int msgnum) throws MessagingException
根据给定的 InternetHeaders 对象和内容构造 MimeMessage。 此方法供提供者创建 MimeMessage 的子类。
folder | 包含文件夹。
headers | 头
content | 消息内容
msgnum | 文件夹中此消息的消息编号
Throws | MessagingException:
英文文档：

MimeMessage

protected MimeMessage(Folder folder,
                      InternetHeaders headers,
                      byte[] content,
                      int msgnum)
               throws MessagingException
Constructs a MimeMessage from the given InternetHeaders object and content. This method is for providers subclassing MimeMessage.

Parameters:
folder - The containing folder.
headers - The headers
content - The message content
msgnum - Message number of this message within its folder
Throws:
MessagingException
Method Detail

protected void parse(java.io.InputStream is) throws MessagingException
解析 InputStream，相应地设置 headers 和 content 字段。同时重置 modified 标志。

此方法供解析 InputStream 时需要控制的子类使用。

is | 消息输入流
Throws | MessagingException:
英文文档：

parse

protected void parse(InputStream is)
              throws MessagingException
Parse the InputStream setting the headers and content fields appropriately. Also resets the modified flag.

This method is intended for use by subclasses that need to control when the InputStream is parsed.

Parameters:
is - The message input stream
Throws:
MessagingException

public Address[] getFrom() throws MessagingException
返回 RFC 822 "From" 头字段的值。如果此头字段不存在，则使用 "Sender" 头字段。如果 "Sender" 头字段也不存在，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | Address 对象
Throws | MessagingException:
See also | headers
英文文档：

getFrom

public Address[] getFrom()
                  throws MessagingException
Returns the value of the RFC 822 "From" header fields. If this header field is absent, the "Sender" header field is used. If the "Sender" header field is also absent, null is returned.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getFrom in class Message
Returns:
Address object
Throws:
MessagingException
See Also:
headers

public void setFrom(Address address) throws MessagingException
设置 RFC 822 "From" 头字段。使用给定地址替换所有现有值。如果 address 为 null，则移除此头。
address | 此消息的发送方
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setFrom

public void setFrom(Address address)
             throws MessagingException
Set the RFC 822 "From" header field. Any existing values are replaced with the given address. If address is null, this header is removed.

Specified by:
setFrom in class Message
Parameters:
address - the sender of this message
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public void setFrom() throws MessagingException
使用 InternetAddress.getLocalAddress 方法的值设置 RFC 822 "From" 头字段。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setFrom

public void setFrom()
             throws MessagingException
Set the RFC 822 "From" header field using the value of the InternetAddress.getLocalAddress method.

Specified by:
setFrom in class Message
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public void addFrom(Address[] addresses) throws MessagingException
将指定的地址添加到现有 "From" 字段中。如果 "From" 字段还不存在，则创建它。
addresses | 此消息的发送方
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

addFrom

public void addFrom(Address[] addresses)
             throws MessagingException
Add the specified addresses to the existing "From" field. If the "From" field does not already exist, it is created.

Specified by:
addFrom in class Message
Parameters:
addresses - the senders of this message
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public Address getSender() throws MessagingException
返回 RFC 822 "Sender" 头字段的值。如果 "Sender" 头字段不存在，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | Address 对象
Throws | MessagingException:
since
en
JavaMail 1.3
See also | headers
英文文档：

getSender

public Address getSender()
                  throws MessagingException
Returns the value of the RFC 822 "Sender" header field. If the "Sender" header field is absent, null is returned.

This implementation uses the getHeader method to obtain the requisite header field.

Returns:
Address object
Throws:
MessagingException
Since:
JavaMail 1.3
See Also:
headers

public void setSender(Address address) throws MessagingException
设置 RFC 822 "Sender" 头字段。使用给定地址替换所有现有值。如果 address 为 null，则移除此头。
address | 此消息的发送方
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
since
en
JavaMail 1.3
英文文档：

setSender

public void setSender(Address address)
               throws MessagingException
Set the RFC 822 "Sender" header field. Any existing values are replaced with the given address. If address is null, this header is removed.

Parameters:
address - the sender of this message
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
Since:
JavaMail 1.3

public Address[] getRecipients(Message.RecipientType type) throws MessagingException
返回此类型指定的接收方。类型与相应的 RFC 822 头之间的映射关系如下：
        Message.RecipientType.TO		"To"
        Message.RecipientType.CC		"Cc"
        Message.RecipientType.BCC		"Bcc"
        MimeMessage.RecipientType.NEWSGROUPS	"Newsgroups"

如果此类型指定的头未找到或其值为空，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

type | 接收方类型
return | Address 对象数组
Throws | MessagingException: 如果无法获取头
Throws | AddressException: 如果头的格式不正确
See also | headers, TO, CC, BCC, NEWSGROUPS
英文文档：

getRecipients

public Address[] getRecipients(Message.RecipientType type)
                        throws MessagingException
Returns the recepients specified by the type. The mapping between the type and the corresponding RFC 822 header is as follows:
                Message.RecipientType.TO                "To"
                Message.RecipientType.CC                "Cc"
                Message.RecipientType.BCC               "Bcc"
                MimeMessage.RecipientType.NEWSGROUPS    "Newsgroups"

Returns null if the header specified by the type is not found or if its value is empty.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getRecipients in class Message
Parameters:
type - Type of recepient
Returns:
array of Address objects
Throws:
MessagingException - if header could not be retrieved
AddressException - if the header is misformatted
See Also:
headers, Message.RecipientType.TO, Message.RecipientType.CC, Message.RecipientType.BCC, MimeMessage.RecipientType.NEWSGROUPS

public Address[] getAllRecipients() throws MessagingException
获取该消息的所有接收方地址。提取 TO、CC、BCC 和 NEWSGROUPS 接收方。
return | Address 对象数组
Throws | MessagingException:
See also | TO, CC, BCC, NEWSGROUPS
英文文档：

getAllRecipients

public Address[] getAllRecipients()
                           throws MessagingException
Get all the recipient addresses for the message. Extracts the TO, CC, BCC, and NEWSGROUPS recipients.

Overrides:
getAllRecipients in class Message
Returns:
array of Address objects
Throws:
MessagingException
See Also:
Message.RecipientType.TO, Message.RecipientType.CC, Message.RecipientType.BCC, MimeMessage.RecipientType.NEWSGROUPS

public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
将指定的接收方类型设置为给定的地址。如果地址参数为 null，则移除相应的接收方字段。
type | 接收方类型
addresses | 地址
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
See also | getRecipients
英文文档：

setRecipients

public void setRecipients(Message.RecipientType type,
                          Address[] addresses)
                   throws MessagingException
Set the specified recipient type to the given addresses. If the address parameter is null, the corresponding recipient field is removed.

Specified by:
setRecipients in class Message
Parameters:
type - Recipient type
addresses - Addresses
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
See Also:
getRecipients(javax.mail.Message.RecipientType)

public void setRecipients(Message.RecipientType type, String addresses) throws MessagingException
将指定的接收方类型设置为给定的地址。如果地址参数为 null，则移除相应的接收方字段。
type | 接收方类型
addresses | 地址
Throws | AddressException: 如果尝试解析地址字符串失败
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
since
en
JavaMail 1.2
See also | getRecipients
英文文档：

setRecipients

public void setRecipients(Message.RecipientType type,
                          String addresses)
                   throws MessagingException
Set the specified recipient type to the given addresses. If the address parameter is null, the corresponding recipient field is removed.

Parameters:
type - Recipient type
addresses - Addresses
Throws:
AddressException - if the attempt to parse the addresses String fails
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
Since:
JavaMail 1.2
See Also:
getRecipients(javax.mail.Message.RecipientType)

public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException
将给定的地址添加到指定的接收方类型中。
type | 接收方类型
addresses | 地址
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

addRecipients

public void addRecipients(Message.RecipientType type,
                          Address[] addresses)
                   throws MessagingException
Add the given addresses to the specified recipient type.

Specified by:
addRecipients in class Message
Parameters:
type - Recipient type
addresses - Addresses
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public void addRecipients(Message.RecipientType type, String addresses) throws MessagingException
将给定的地址添加到指定的接收方类型中。
type | 接收方类型
addresses | 地址
Throws | AddressException: 如果尝试解析地址字符串失败
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
since
en
JavaMail 1.2
英文文档：

addRecipients

public void addRecipients(Message.RecipientType type,
                          String addresses)
                   throws MessagingException
Add the given addresses to the specified recipient type.

Parameters:
type - Recipient type
addresses - Addresses
Throws:
AddressException - if the attempt to parse the addresses String fails
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
Since:
JavaMail 1.2

public Address[] getReplyTo() throws MessagingException
返回 RFC 822 "Reply-To" 头字段的值。如果此头不可用或其值不存在，则调用 getFrom 方法并返回其值。 此实现使用 getHeader 方法获取必需的头字段。
Throws | MessagingException:
See also | headers
英文文档：

getReplyTo

public Address[] getReplyTo()
                     throws MessagingException
Return the value of the RFC 822 "Reply-To" header field. If this header is unavailable or its value is absent, then the getFrom method is called and its value is returned. This implementation uses the getHeader method to obtain the requisite header field.

Overrides:
getReplyTo in class Message
Returns:
addresses to which replies should be directed
Throws:
MessagingException
See Also:
headers

public void setReplyTo(Address[] addresses) throws MessagingException
设置 RFC 822 "Reply-To" 头字段。如果地址参数为 null，则移除此头。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setReplyTo

public void setReplyTo(Address[] addresses)
                throws MessagingException
Set the RFC 822 "Reply-To" header field. If the address parameter is null, this header is removed.

Overrides:
setReplyTo in class Message
Parameters:
addresses - addresses to which replies should be directed
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
MethodNotSupportedException - if the underlying implementation does not support setting this attribute

public String getSubject() throws MessagingException
返回 "Subject" 头字段的值。如果 subject 字段不可用或其值不存在，则返回 null。

如果 subject 根据 RFC 2047 进行编码，则它将被解码并转换为 Unicode。如果解码或转换失败，则原始数据按原样返回。

此实现使用 getHeader 方法获取必需的头字段。

return
en
Subject
Throws | MessagingException:
See also | headers
英文文档：

getSubject

public String getSubject()
                  throws MessagingException
Returns the value of the "Subject" header field. Returns null if the subject field is unavailable or its value is absent.

If the subject is encoded as per RFC 2047, it is decoded and converted into Unicode. If the decoding or conversion fails, the raw data is returned as is.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getSubject in class Message
Returns:
Subject
Throws:
MessagingException
See Also:
headers

public void setSubject(String subject) throws MessagingException
设置 "Subject" 头字段。如果 subject 包含非 US-ASCII 字符，则它将使用平台的默认字符集进行编码。如果 subject 仅包含 US-ASCII 字符，则不进行编码，它将按原样使用。如果 subject 为 null，则移除现有的 "Subject" 字段。

应用程序必须确保 subject 不包含任何换行符。

注意，如果字符集编码处理失败，则抛出 MessagingException，并且在 MessagingException 的嵌套异常链中包含 UnsupportedEncodingException。

subject | Subject
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException.: 如果字符集转换失败，则可能在异常链中包含 UnsupportedEncodingException。
英文文档：

setSubject

public void setSubject(String subject)
                throws MessagingException
Set the "Subject" header field. If the subject contains non US-ASCII characters, it will be encoded using the platform's default charset. If the subject contains only US-ASCII characters, no encoding is done and it is used as-is. If the subject is null, the existing "Subject" field is removed.

The application must ensure that the subject does not contain any line breaks.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

Specified by:
setSubject in class Message
Parameters:
subject - The subject
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException. - An UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.
MessagingException

public void setSubject(String subject, String charset) throws MessagingException
设置 "Subject" 头字段。如果 subject 包含非 US-ASCII 字符，则它将使用特定的字符集进行编码。如果 subject 仅包含 US-ASCII 字符，则不进行编码，它将按原样使用。如果 subject 为 null，则移除现有的 "Subject" 头字段。

应用程序必须确保 subject 不包含任何换行符。

注意，如果字符集编码处理失败，则抛出 MessagingException，并且在 MessagingException 的嵌套异常链中包含 UnsupportedEncodingException。

subject | Subject
charset | 字符集
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException.: 如果字符集转换失败，则可能在异常链中包含 UnsupportedEncodingException。
英文文档：

setSubject

public void setSubject(String subject,
                       String charset)
                throws MessagingException
Set the "Subject" header field. If the subject contains non US-ASCII characters, it will be encoded using the specified charset. If the subject contains only US-ASCII characters, no encoding is done and it is used as-is. If the subject is null, the existing "Subject" header field is removed.

The application must ensure that the subject does not contain any line breaks.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

Parameters:
subject - The subject
charset - The charset
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException. - An UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.
MessagingException

public java.util.Date getSentDate() throws MessagingException
返回 RFC 822 "Date" 字段的值。这是发送此消息的日期。如果此字段不可用或其值不存在，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | 发送日期
Throws | MessagingException:
英文文档：

getSentDate

public Date getSentDate()
                 throws MessagingException
Returns the value of the RFC 822 "Date" field. This is the date on which this message was sent. Returns null if this field is unavailable or its value is absent.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getSentDate in class Message
Returns:
The sent Date
Throws:
MessagingException

public void setSentDate(java.util.Date d) throws MessagingException
设置 RFC 822 "Date" 头字段。这是消息的创建者指示消息已完成并准备传送的日期。如果日期参数为 null，则移除现有的 "Date" 字段。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setSentDate

public void setSentDate(Date d)
                 throws MessagingException
Set the RFC 822 "Date" header field. This is the date on which the creator of the message indicates that the message is complete and ready for delivery. If the date parameter is null, the existing "Date" field is removed.

Specified by:
setSentDate in class Message
Parameters:
d - the sent date of this message
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public java.util.Date getReceivedDate() throws MessagingException
返回收到此消息的日期。如果无法获取此日期，则返回 null。

注意，RFC 822 未定义接收日期的字段。因此，只有提供此日期的实现才需要返回一个有效值。

此实现返回 null。

return | 收到此消息的日期
Throws | MessagingException:
英文文档：

getReceivedDate

public Date getReceivedDate()
                     throws MessagingException
Returns the Date on this message was received. Returns null if this date cannot be obtained.

Note that RFC 822 does not define a field for the received date. Hence only implementations that can provide this date need return a valid value.

This implementation returns null.

Specified by:
getReceivedDate in class Message
Returns:
the date this message was received
Throws:
MessagingException

public int getSize() throws MessagingException
返回此消息的内容大小（以字节为单位）。如果无法确定大小，则返回 -1。

注意，此数值可能不是内容大小的准确度量，可能没有考虑内容的传输编码。

此实现返回 content 数组（如果非 null）的大小；如果 contentStream 非 null，且 available 方法返回一个正数，则它返回该数作为该大小。否则，它返回 -1。

return | 内容大小（以字节为单位）
Throws | MessagingException:
英文文档：

getSize

public int getSize()
            throws MessagingException
Return the size of the content of this message in bytes. Return -1 if the size cannot be determined.

Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.

This implementation returns the size of the content array (if not null), or, if contentStream is not null, and the available method returns a positive number, it returns that number as the size. Otherwise, it returns -1.

Specified by:
getSize in interface Part
Returns:
size of content in bytes
Throws:
MessagingException

public int getLineCount() throws MessagingException
返回此消息内容的行数。如果无法确定此数值，则返回 -1。

注意，此数值可能不是内容长度的准确度量，可能没有考虑内容的传输编码。

此实现返回 -1。

return | 内容的行数。
Throws | MessagingException:
英文文档：

getLineCount

public int getLineCount()
                 throws MessagingException
Return the number of lines for the content of this message. Return -1 if this number cannot be determined.

Note that this number may not be an exact measure of the content length and may or may not account for any transfer encoding of the content.

This implementation returns -1.

Specified by:
getLineCount in interface Part
Returns:
number of lines in the content.
Throws:
MessagingException

public String getContentType() throws MessagingException
返回 RFC 822 "Content-Type" 头字段的值。它表示此消息内容的内容类型。此值不得为 null。如果此字段不可用，则应该返回 "text/plain"。

此实现使用 getHeader 方法获取必需的头字段。

return | 此部分的 ContentType
Throws | MessagingException:
See also | javax.activation.DataHandler
英文文档：

getContentType

public String getContentType()
                      throws MessagingException
Returns the value of the RFC 822 "Content-Type" header field. This represents the content-type of the content of this message. This value must not be null. If this field is unavailable, "text/plain" should be returned.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getContentType in interface Part
Returns:
The ContentType of this part
Throws:
MessagingException
See Also:
DataHandler

public boolean isMimeType(String mimeType) throws MessagingException
此 Part 是指定的 MIME 类型吗？此方法仅比较 primaryType 和 subType。忽略内容类型参数。

例如，当比较内容类型的 "text/plain" 部分与 "text/plain; charset=foobar" 时，此方法将返回 true。

如果 mimeType 的 subType 是特殊字符 '*'，则比较过程中将忽略 subtype。

英文文档：

isMimeType

public boolean isMimeType(String mimeType)
                   throws MessagingException
Is this Part of the specified MIME type? This method compares only the primaryType and subType. The parameters of the content types are ignored.

For example, this method will return true when comparing a Part of content type "text/plain" with "text/plain; charset=foobar".

If the subType of mimeType is the special character '*', then the subtype is ignored during the comparison.

Specified by:
isMimeType in interface Part
Throws:
MessagingException

public String getDisposition() throws MessagingException
返回 "Content-Disposition" 头字段的值。这表示此部分的 disposition。disposition 描述各部分应该如何展示给用户。

如果 Content-Disposition 字段不可用，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | 此部分的 disposition；如果未知，则返回 null
Throws | MessagingException:
英文文档：

getDisposition

public String getDisposition()
                      throws MessagingException
Returns the value of the "Content-Disposition" header field. This represents the disposition of this part. The disposition describes how the part should be presented to the user.

If the Content-Disposition field is unavailable, null is returned.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getDisposition in interface Part
Returns:
disposition of this part, or null if unknown
Throws:
MessagingException
See Also:
Part.ATTACHMENT, Part.INLINE, Part.getFileName()

public void setDisposition(String disposition) throws MessagingException
设置此 Message 的 "Content-Disposition" 头字段。如果 disposition 为 null，则移除所有现有的 "Content-Disposition" 头字段。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setDisposition

public void setDisposition(String disposition)
                    throws MessagingException
Set the "Content-Disposition" header field of this Message. If disposition is null, any existing "Content-Disposition" header field is removed.

Specified by:
setDisposition in interface Part
Parameters:
disposition - disposition of this part
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
See Also:
Part.ATTACHMENT, Part.INLINE, Part.setFileName(java.lang.String)

public String getEncoding() throws MessagingException
返回 "Content-Transfer-Encoding" 头字段中的内容传输编码。如果头不可用或其值不存在，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | 内容传输编码
Throws | MessagingException:
英文文档：

getEncoding

public String getEncoding()
                   throws MessagingException
Returns the content transfer encoding from the "Content-Transfer-Encoding" header field. Returns null if the header is unavailable or its value is absent.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getEncoding in interface MimePart
Returns:
content-transfer-encoding
Throws:
MessagingException

public String getContentID() throws MessagingException
返回 "Content-ID" 头字段的值。如果字段不可用或其值不存在，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | 内容 ID
Throws | MessagingException:
英文文档：

getContentID

public String getContentID()
                    throws MessagingException
Returns the value of the "Content-ID" header field. Returns null if the field is unavailable or its value is absent.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getContentID in interface MimePart
Returns:
content-ID
Throws:
MessagingException

public void setContentID(String cid) throws MessagingException
设置此 Message 的 "Content-ID" 头字段。如果 cid 参数为 null，则移除所有现有的 "Content-ID"。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setContentID

public void setContentID(String cid)
                  throws MessagingException
Set the "Content-ID" header field of this Message. If the cid parameter is null, any existing "Content-ID" is removed.

Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public String getContentMD5() throws MessagingException
返回 "Content-MD5" 头字段的值。如果此字段不可用或其值不存在，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | 内容 MD5
Throws | MessagingException:
英文文档：

getContentMD5

public String getContentMD5()
                     throws MessagingException
Return the value of the "Content-MD5" header field. Returns null if this field is unavailable or its value is absent.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getContentMD5 in interface MimePart
Returns:
content-MD5
Throws:
MessagingException

public void setContentMD5(String md5) throws MessagingException
设置此 Message 的 "Content-MD5" 头字段。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setContentMD5

public void setContentMD5(String md5)
                   throws MessagingException
Set the "Content-MD5" header field of this Message.

Specified by:
setContentMD5 in interface MimePart
Parameters:
md5 - the MD5 value
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public String getDescription() throws MessagingException
返回此 Message 的 "Content-Description" 头字段。这通常包括一些与此部分关联的描述性信息。如果此字段不可用或其值不存在，则返回 null。

如果 Content-Description 字段根据 RFC 2047 进行编码，则它将被解码并转换为 Unicode。如果解码或转换失败，则原始数据按原样返回。

此实现使用 getHeader 方法获取必需的头字段。

return | 内容描述
Throws | MessagingException:
英文文档：

getDescription

public String getDescription()
                      throws MessagingException
Returns the "Content-Description" header field of this Message. This typically associates some descriptive information with this part. Returns null if this field is unavailable or its value is absent.

If the Content-Description field is encoded as per RFC 2047, it is decoded and converted into Unicode. If the decoding or conversion fails, the raw data is returned as-is

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getDescription in interface Part
Returns:
content-description
Throws:
MessagingException

public void setDescription(String description) throws MessagingException
设置此 Message 的 "Content-Description" 头字段。如果 description 参数为 null，则移除所有现有的 "Content-Description" 字段。

如果 description 包含非 US-ASCII 字符，则它将使用平台的默认字符集进行编码。如果 description 仅包含 US-ASCII 字符，则不进行编码，它将按原样使用。

注意，如果字符集编码处理失败，则抛出 MessagingException，并且在 MessagingException 的嵌套异常链中包含 UnsupportedEncodingException。

description | 内容描述
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException.: 如果字符集转换失败，则可能在异常链中包含 UnsupportedEncodingException。
英文文档：

setDescription

public void setDescription(String description)
                    throws MessagingException
Set the "Content-Description" header field for this Message. If the description parameter is null, then any existing "Content-Description" fields are removed.

If the description contains non US-ASCII characters, it will be encoded using the platform's default charset. If the description contains only US-ASCII characters, no encoding is done and it is used as-is.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

Specified by:
setDescription in interface Part
Parameters:
description - content-description
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException. - An UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.
MessagingException

public void setDescription(String description, String charset) throws MessagingException
设置此 Message 的 "Content-Description" 头字段。如果 description 参数为 null，则移除所有现有的 "Content-Description" 字段。

如果 description 包含非 US-ASCII 字符，则它将使用特定的字符集进行编码。如果 description 仅包含 US-ASCII 字符，则不进行编码，它将按原样使用。

注意，如果字符集编码处理失败，则抛出 MessagingException，并且在 MessagingException 的嵌套异常链中包含 UnsupportedEncodingException。

description | 描述
charset | 编码的字符集
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException.: 如果字符集转换失败，则可能在异常链中包含 UnsupportedEncodingException。
英文文档：

setDescription

public void setDescription(String description,
                           String charset)
                    throws MessagingException
Set the "Content-Description" header field for this Message. If the description parameter is null, then any existing "Content-Description" fields are removed.

If the description contains non US-ASCII characters, it will be encoded using the specified charset. If the description contains only US-ASCII characters, no encoding is done and it is used as-is.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

Parameters:
description - Description
charset - Charset for encoding
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException. - An UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.
MessagingException

public String[] getContentLanguage() throws MessagingException
获取在此 Message 的 "Content-Language" 头字段中指定的语言。Content-Language 头由 RFC 1766 定义。如果此字段不可用或其值不存在，则返回 null。

此实现使用 getHeader 方法获取必需的头字段。

return | Content-Language 头的值。
Throws | MessagingException:
英文文档：

getContentLanguage

public String[] getContentLanguage()
                            throws MessagingException
Get the languages specified in the "Content-Language" header field of this message. The Content-Language header is defined by RFC 1766. Returns null if this field is unavailable or its value is absent.

This implementation uses the getHeader method to obtain the requisite header field.

Specified by:
getContentLanguage in interface MimePart
Returns:
value of content-language header.
Throws:
MessagingException

public void setContentLanguage(String[] languages) throws MessagingException
设置此 MimePart 的 "Content-Language" 头。Content-Language 头由 RFC 1766 定义。
languages | 语言标记数组
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setContentLanguage

public void setContentLanguage(String[] languages)
                        throws MessagingException
Set the "Content-Language" header of this MimePart. The Content-Language header is defined by RFC 1766.

Specified by:
setContentLanguage in interface MimePart
Parameters:
languages - array of language tags
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public String getMessageID() throws MessagingException
返回 "Message-ID" 头字段的值。如果此字段不可用或其值不存在，则返回 null。

这里提供的默认实现使用 getHeader 方法返回 "Message-ID" 字段的值。

return
en
Message-ID
Throws | MessagingException: 如果获取此字段导致任何异常。
since
en
JavaMail 1.1
See also | javax.mail.search.MessageIDTerm
英文文档：

getMessageID

public String getMessageID()
                    throws MessagingException
Returns the value of the "Message-ID" header field. Returns null if this field is unavailable or its value is absent.

The default implementation provided here uses the getHeader method to return the value of the "Message-ID" field.

Returns:
Message-ID
Throws:
MessagingException - if the retrieval of this field causes any exception.
Since:
JavaMail 1.1
See Also:
MessageIDTerm

public String getFileName() throws MessagingException
获取与此 Message 关联的文件名称。

根据此消息的 "Content-Disposition" 头字段返回 "filename" 参数的值。如果不可用，则返回此 BodyPart 的 "Content-Type" 头字段的 "name" 参数的值。如果都不存在，则返回 null。

如果 mail.mime.encodefilename 系统属性设置为 true，则将使用 MimeUtility.decodeText 方法解码文件名称。尽管 MIME 规范不支持此编码，但许多邮件程序使用此技术支持在文件名称中使用非 ASCII 字符。此属性的默认值为 false。

return | 文件名称
Throws | MessagingException:
英文文档：

getFileName

public String getFileName()
                   throws MessagingException
Get the filename associated with this Message.

Returns the value of the "filename" parameter from the "Content-Disposition" header field of this message. If it's not available, returns the value of the "name" parameter from the "Content-Type" header field of this BodyPart. Returns null if both are absent.

If the mail.mime.encodefilename System property is set to true, the MimeUtility.decodeText method will be used to decode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.

Specified by:
getFileName in interface Part
Returns:
filename
Throws:
MessagingException

public void setFileName(String filename) throws MessagingException
如果可能，设置与此部分关联的文件名称。

设置此 Message 的 "Content-Disposition" 头字段的 "filename" 参数。

如果 mail.mime.encodefilename 系统属性设置为 true，则将使用 MimeUtility.encodeText 方法编码文件名称。尽管 MIME 规范不支持此编码，但许多邮件程序使用此技术支持在文件名称中使用非 ASCII 字符。此属性的默认值为 false。

Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setFileName

public void setFileName(String filename)
                 throws MessagingException
Set the filename associated with this part, if possible.

Sets the "filename" parameter of the "Content-Disposition" header field of this message.

If the mail.mime.encodefilename System property is set to true, the MimeUtility.encodeText method will be used to encode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.

Specified by:
setFileName in interface Part
Parameters:
filename - Filename to associate with this part
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public java.io.InputStream getInputStream() throws java.io.IOException, MessagingException
返回用于此 Message 的 "content" 的解码输入流。

此实现从 DataHandler 获取输入流，即它调用 getDataHandler().getInputStream()。

return | InputStream
Throws | MessagingException:
Throws | java.io.IOException: 此异常通常由 DataHandler 抛出。有关更多信息，请参考 javax.activation.DataHandler 的文档。
See also | getContentStream, getInputStream
英文文档：

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  MessagingException
Return a decoded input stream for this Message's "content".

This implementation obtains the input stream from the DataHandler, that is, it invokes getDataHandler().getInputStream().

Specified by:
getInputStream in interface Part
Returns:
an InputStream
Throws:
MessagingException
IOException - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.
See Also:
getContentStream(), DataHandler.getInputStream()

protected java.io.InputStream getContentStream() throws MessagingException
生成内容的原始字节。在解析时调用此方法为内容创建 DataHandler 对象。能为消息内容提供单独输入流的子类可能要重写此方法。

如果 contentStream 不为 null，则此实现返回 SharedInputStream。否则，返回从 content byte 数组构造的 ByteArrayInputStream。

See also content
英文文档：

getContentStream

protected InputStream getContentStream()
                                throws MessagingException
Produce the raw bytes of the content. This method is used during parsing, to create a DataHandler object for the content. Subclasses that can provide a separate input stream for just the message content might want to override this method.

This implementation returns a SharedInputStream, if contentStream is not null. Otherwise, it returns a ByteArrayInputStream constructed out of the content byte array.

Throws:
MessagingException
See Also:
content

public java.io.InputStream getRawInputStream() throws MessagingException
将 InputStream 作为原始数据返回，保持所有 Content-Transfer-Encoding 不变。如果 "Content-Transfer-Encoding" 头不正确或者被破坏（将导致 getInputStream 方法或 getContent 方法无法返回正确的数据），则此方法很有用。在这种情况下，应用程序可以使用此方法自己尝试解码原始数据。

此实现调用 getContentStream 方法。

since
en
JavaMail 1.2
See also getInputStream, getContentStream
英文文档：

getRawInputStream

public InputStream getRawInputStream()
                              throws MessagingException
Return an InputStream to the raw data with any Content-Transfer-Encoding intact. This method is useful if the "Content-Transfer-Encoding" header is incorrect or corrupt, which would prevent the getInputStream method or getContent method from returning the correct data. In such a case the application may use this method and attempt to decode the raw data itself.

This implementation simply calls the getContentStream method.

Throws:
MessagingException
Since:
JavaMail 1.2
See Also:
getInputStream(), getContentStream()

public DataHandler getDataHandler() throws MessagingException
返回处理此 Message 内容的 DataHandler。

这里提供的实现的工作方式如下：注意，使用 getContentStream 方法生成内容的字节流。还要注意，任何传输解码都是在此方法内自动完成的。

getDataHandler() {
if (dh == null) {
dh = new DataHandler(new MimePartDataSource(this));
      }
return dh;
  }

class MimePartDataSource implements DataSource {
public getInputStream() {
return MimeUtility.decode(
             getContentStream(), getEncoding());
      }

        ....
  }

Throws MessagingException:
英文文档：

getDataHandler

public DataHandler getDataHandler()
                           throws MessagingException
Return a DataHandler for this Message's content.

The implementation provided here works as follows. Note the use of the getContentStream method to generate the byte stream for the content. Also note that any transfer-decoding is done automatically within this method.

  getDataHandler() {
      if (dh == null) {
          dh = new DataHandler(new MimePartDataSource(this));
      }
      return dh;
  }

  class MimePartDataSource implements DataSource {
      public getInputStream() {
          return MimeUtility.decode(
                     getContentStream(), getEncoding());
      }

                ....
  }

Specified by:
getDataHandler in interface Part
Returns:
DataHandler for the content
Throws:
MessagingException

public Object getContent() throws java.io.IOException, MessagingException
以 Java 对象的形式返回内容。此对象的类型取决于内容本身。例如，"text/plain" 内容的本机格式通常为 String 对象。"multipart" 消息的本机格式通常为 Multipart 子类。对于 DataHandler 系统未知的内容类型，将输入流作为内容返回。

此实现从 DataHandler 获取内容，即它调用 getDataHandler().getContent()。如果内容为 Multipart 或 Message 对象且通过解析流创建，则该对象被缓存并在后续调用中返回，以防止丢失对内容所做的修改。

return | 对象
Throws | MessagingException:
Throws | java.io.IOException: 此异常通常由 DataHandler 抛出。有关更多信息，请参考 javax.activation.DataHandler 的文档。
See also | javax.mail.Part, getContent
英文文档：

getContent

public Object getContent()
                  throws IOException,
                         MessagingException
Return the content as a Java object. The type of this object is dependent on the content itself. For example, the native format of a "text/plain" content is usually a String object. The native format for a "multipart" message is always a Multipart subclass. For content types that are unknown to the DataHandler system, an input stream is returned as the content.

This implementation obtains the content from the DataHandler, that is, it invokes getDataHandler().getContent(). If the content is a Multipart or Message object and was created by parsing a stream, the object is cached and returned in subsequent calls so that modifications to the content will not be lost.

Specified by:
getContent in interface Part
Returns:
Object
Throws:
MessagingException
IOException - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.
See Also:
Part, DataHandler.getContent()

public void setDataHandler(DataHandler dh) throws MessagingException
此方法提供设置此部分内容的机制。给定的 DataHandler 对象应该包装实际的内容。
dh | 用于内容的 DataHandler。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setDataHandler

public void setDataHandler(DataHandler dh)
                    throws MessagingException
This method provides the mechanism to set this part's content. The given DataHandler object should wrap the actual content.

Specified by:
setDataHandler in interface Part
Parameters:
dh - The DataHandler for the content.
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public void setContent(Object o, String type) throws MessagingException
设置此 Message 的内容的便捷方法。

内容被包装在 DataHandler 对象中。注意，为了正常运行，指定类型的 DataContentHandler 类应该可用于 JavaMail 实现，即要执行 setContent(foobar, "application/x-foobar")，必须安装 "application/x-foobar" 的 DataContentHandler。有关更多信息，请参考 Java Activation Framework。

o | 内容对象
type | 对象的 Mime 类型
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setContent

public void setContent(Object o,
                       String type)
                throws MessagingException
A convenience method for setting this Message's content.

The content is wrapped in a DataHandler object. Note that a DataContentHandler class for the specified type should be available to the JavaMail implementation for this to work right. i.e., to do setContent(foobar, "application/x-foobar"), a DataContentHandler for "application/x-foobar" should be installed. Refer to the Java Activation Framework for more information.

Specified by:
setContent in interface Part
Parameters:
o - the content object
type - Mime type of the object
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public void setText(String text) throws MessagingException
使用 MIME 类型 "text/plain" 将给定的 String 设置为此部分内容的便捷方法。如果 string 包含非 US-ASCII 字符，则它将使用平台的默认字符集进行编码。也使用该字符集设置 "charset" 参数。

注意，如果 text 很大，可能会影响性能，因为此方法必须扫描所有字符以确定使用哪种字符集。

如果字符集已知，则使用带有 charset 参数的 setText 方法。

text | 要设置的文本内容
Throws | MessagingException: 如果发生错误
See also | setText(String text, String charset)
英文文档：

setText

public void setText(String text)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". If the string contains non US-ASCII characters. it will be encoded using the platform's default charset. The charset is also used to set the "charset" parameter.

Note that there may be a performance penalty if text is large, since this method may have to scan all the characters to determine what charset to use.

If the charset is already known, use the setText method that takes the charset parameter.

Specified by:
setText in interface MimePart
Specified by:
setText in interface Part
Parameters:
text - the text content to set
Throws:
MessagingException - if an error occurs
See Also:
setText(String text, String charset)

public void setText(String text, String charset) throws MessagingException
使用 MIME 类型 "text/plain" 和指定字符集将给定 String 设置为此部分内容的便捷方法。给定的 Unicode 字符串将使用指定的字符集进行编码。也使用该字符集设置 "charset" 参数。
text | 要设置的文本内容
charset | 用于文本的字符集
Throws | MessagingException: 如果发生错误
英文文档：

setText

public void setText(String text,
                    String charset)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.

Specified by:
setText in interface MimePart
Parameters:
text - the text content to set
charset - the charset to use for the text
Throws:
MessagingException - if an error occurs

public void setText(String text, String charset, String subtype) throws MessagingException
使用基本 MIME 类型 "text" 和指定 MIME 子类型将给定的 String 设置为此部分内容的便捷方法。给定的 Unicode 字符串将使用指定的字符集进行编码。也使用该字符集设置 "charset" 参数。
text | 要设置的文本内容
charset | 用于文本的字符集
subtype | 要使用的 MIME 子类型（如 "html"）
Throws | MessagingException: 如果发生错误
since
en
JavaMail 1.4
英文文档：

setText

public void setText(String text,
                    String charset,
                    String subtype)
             throws MessagingException
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.

Specified by:
setText in interface MimePart
Parameters:
text - the text content to set
charset - the charset to use for the text
subtype - the MIME subtype to use (e.g., "html")
Throws:
MessagingException - if an error occurs
Since:
JavaMail 1.4

public void setContent(Multipart mp) throws MessagingException
此方法将 Message 的内容设置为 Multipart 对象。
mp | 为 Message 的内容的 multipart 对象。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setContent

public void setContent(Multipart mp)
                throws MessagingException
This method sets the Message's content to a Multipart object.

Specified by:
setContent in interface Part
Parameters:
mp - The multipart object that is the Message's content
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public Message reply(boolean replyToAll) throws MessagingException
获取一个适用于回复此消息的新 Message。新的 Message 将恰当设置其属性和头。注意，这个新消息对象为空，即它没有 "content"。这些必须由客户端恰当地填充。

如果设置了 replyToAll，则新的 Message 将发送给此消息的所有接收方。否则，回复将只发送给此消息的发送方（使用 getReplyTo 方法的值）。

"Subject" 字段使用原主题加上前缀 "Re:" 填充（除非它已经以 "Re:" 开头）。如果此消息中有 "Message-Id" 头，则在新的消息中设置 "In-Reply-To" 头。在此消息中设置 ANSWERED 标志。 当前实现还将在新消息中设置 "References" 头，以包含此消息中的 "References" 头（如果没有，则是 "In-Reply-To" 头）的内容，以及此消息中 "Message-Id" 头的内容，如 RFC 2822 中所述。

replyToAll | 回复应该发送给此消息的所有接收方
return | 回复 Message
Throws | MessagingException:
英文文档：

reply

public Message reply(boolean replyToAll)
              throws MessagingException
Get a new Message suitable for a reply to this message. The new Message will have its attributes and headers set up appropriately. Note that this new message object will be empty, i.e., it will not have a "content". These will have to be suitably filled in by the client.

If replyToAll is set, the new Message will be addressed to all recipients of this message. Otherwise, the reply will be addressed to only the sender of this message (using the value of the getReplyTo method).

The "Subject" field is filled in with the original subject prefixed with "Re:" (unless it already starts with "Re:"). The "In-Reply-To" header is set in the new message if this message has a "Message-Id" header. The ANSWERED flag is set in this message. The current implementation also sets the "References" header in the new message to include the contents of the "References" header (or, if missing, the "In-Reply-To" header) in this message, plus the contents of the "Message-Id" header of this message, as described in RFC 2822.

Specified by:
reply in class Message
Parameters:
replyToAll - reply should be sent to all recipients of this message
Returns:
the reply Message
Throws:
MessagingException

public void writeTo(java.io.OutputStream os) throws java.io.IOException, MessagingException
以 RFC 822 格式流的形式输出消息。

注意，根据消息的构造方式的不同，此方法可能会使用不同的行终止约定。通常，输出应通过适当的 FilterOutputStream 发送，FilterOutputStream 将行终止符转换为需要的格式：若要与 MIME 兼容或用于 Internet 协议，则转换为 CRLF 格式；若要在本地文本文件中存储，则转换为本地平台的行终止符。

此实现调用 writeTo(OutputStream, String[]) 方法，且忽略列表为 null。

Throws | java.io.IOException: 如果写入流时发生错误，或者 javax.activation 层发生错误。
Throws | MessagingException:
See also | writeTo
英文文档：

writeTo

public void writeTo(OutputStream os)
             throws IOException,
                    MessagingException
Output the message as an RFC 822 format stream.

Note that, depending on how the messag was constructed, it may use a variety of line termination conventions. Generally the output should be sent through an appropriate FilterOutputStream that converts the line terminators to the desired form, either CRLF for MIME compatibility and for use in Internet protocols, or the local platform's line terminator for storage in a local text file.

This implementation calls the writeTo(OutputStream, String[]) method with a null ignore list.

Specified by:
writeTo in interface Part
Throws:
IOException - if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
MessagingException
See Also:
DataHandler.writeTo(java.io.OutputStream)

public void writeTo(java.io.OutputStream os, String[] ignoreList) throws java.io.IOException, MessagingException
以 RFC 822 格式流的形式输出消息，不带指定的头。如果未设置 saved 标志，则调用 saveChanges 方法。如果未设置 modified 标志且 content 数组不为 null，则在写入适当的消息头后，直接写入 content 数组。
Throws | MessagingException:
Throws | java.io.IOException: 如果写入流时发生错误，或者 javax.activation 层发生错误。
See also | writeTo
英文文档：

writeTo

public void writeTo(OutputStream os,
                    String[] ignoreList)
             throws IOException,
                    MessagingException
Output the message as an RFC 822 format stream, without specified headers. If the saved flag is not set, the saveChanges method is called. If the modified flag is not set and the content array is not null, the content array is written directly, after writing the appropriate message headers.

Throws:
MessagingException
IOException - if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
See Also:
DataHandler.writeTo(java.io.OutputStream)

public String[] getHeader(String name) throws MessagingException
获取此 header_name 的所有头。注意，如果某些头包含非 US-ASCII 字符并且应该解码，则可以根据 RFC 2047 进行编码。

此实现从 headers InternetHeaders 对象获取头。

name | 头名称
return | 头数组
Throws | MessagingException:
See also | javax.mail.internet.MimeUtility
英文文档：

getHeader

public String[] getHeader(String name)
                   throws MessagingException
Get all the headers for this header_name. Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.

This implementation obtains the headers from the headers InternetHeaders object.

Specified by:
getHeader in interface Part
Parameters:
name - name of header
Returns:
array of headers
Throws:
MessagingException
See Also:
MimeUtility

public String getHeader(String name, String delimiter) throws MessagingException
获取具有此头名称的所有头，以单个 String 的形式返回，头之间用 delimiter 隔开。如果 delimiter 为 null，则仅返回第一个头。
name | 此头的名称
delimiter | 值之间的分隔符
return | 具有此名称的所有头的值字段
Throws | MessagingException:
英文文档：

getHeader

public String getHeader(String name,
                        String delimiter)
                 throws MessagingException
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter. If the delimiter is null, only the first header is returned.

Specified by:
getHeader in interface MimePart
Parameters:
name - the name of this header
delimiter - separator between values
Returns:
the value fields for all headers with this name
Throws:
MessagingException

public void setHeader(String name, String value) throws MessagingException
设置此 header_name 的值。使用此新值替换所有现有的头值。注意，RFC 822 头只能包含 US-ASCII 字符，因此包含非 US-ASCII 字符的头必须已经由调用者根据 RFC 2047 的规则进行了编码。
name | 头名称
value | 头值
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
See also | javax.mail.internet.MimeUtility
英文文档：

setHeader

public void setHeader(String name,
                      String value)
               throws MessagingException
Set the value for this header_name. Replaces all existing header values with this new value. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must have been encoded by the caller as per the rules of RFC 2047.

Specified by:
setHeader in interface Part
Parameters:
name - header name
value - header value
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
See Also:
MimeUtility

public void addHeader(String name, String value) throws MessagingException
将此值添加到此 header_name 的现有值中。注意，RFC 822 头只能包含 US-ASCII 字符，因此包含非 US-ASCII 字符的头必须已经根据 RFC 2047 的规则进行了编码。
name | 头名称
value | 头值
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
See also | javax.mail.internet.MimeUtility
英文文档：

addHeader

public void addHeader(String name,
                      String value)
               throws MessagingException
Add this value to the existing values for this header_name. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must have been encoded as per the rules of RFC 2047.

Specified by:
addHeader in interface Part
Parameters:
name - header name
value - header value
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
See Also:
MimeUtility

public void removeHeader(String name) throws MessagingException
移除具有此名称的所有头。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

removeHeader

public void removeHeader(String name)
                  throws MessagingException
Remove all headers with this name.

Specified by:
removeHeader in interface Part
Parameters:
name - the name of this header
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public java.util.Enumeration<E> getAllHeaders() throws MessagingException
以 Header 对象的枚举形式返回此 Message 中的所有头。

注意，如果某些头包含非 US-ASCII 字符并且应该解码，则可以根据 RFC 2047 进行编码。

此实现从 headers InternetHeaders 对象获取头。

return | 头对象数组
Throws | MessagingException:
See also | javax.mail.internet.MimeUtility
英文文档：

getAllHeaders

public Enumeration getAllHeaders()
                          throws MessagingException
Return all the headers from this Message as an enumeration of Header objects.

Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.

This implementation obtains the headers from the headers InternetHeaders object.

Specified by:
getAllHeaders in interface Part
Returns:
array of header objects
Throws:
MessagingException
See Also:
MimeUtility

public java.util.Enumeration<E> getMatchingHeaders(String[] names) throws MessagingException
以 Header 对象的枚举形式返回此 Message 中的匹配头。此实现从 headers InternetHeaders 对象获取头。
Throws MessagingException:
英文文档：

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] names)
                               throws MessagingException
Return matching headers from this Message as an Enumeration of Header objects. This implementation obtains the headers from the headers InternetHeaders object.

Specified by:
getMatchingHeaders in interface Part
Returns:
enumeration of Header objects
Throws:
MessagingException

public java.util.Enumeration<E> getNonMatchingHeaders(String[] names) throws MessagingException
以 Header 对象的枚举形式返回此 Message 中不匹配的头。此实现从 headers InternetHeaders 对象获取头。
Throws MessagingException:
英文文档：

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] names)
                                  throws MessagingException
Return non-matching headers from this Message as an Enumeration of Header objects. This implementation obtains the header from the headers InternetHeaders object.

Specified by:
getNonMatchingHeaders in interface Part
Returns:
enumeration of Header objects
Throws:
MessagingException

public void addHeaderLine(String line) throws MessagingException
添加一个原始 RFC 822 头行。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

addHeaderLine

public void addHeaderLine(String line)
                   throws MessagingException
Add a raw RFC 822 header-line.

Specified by:
addHeaderLine in interface MimePart
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

public java.util.Enumeration<E> getAllHeaderLines() throws MessagingException
以 String 枚举的形式获取所有头行。Header 行是原始 RFC 822 头行，包含 "name" 和 "value" 字段。
Throws MessagingException:
英文文档：

getAllHeaderLines

public Enumeration getAllHeaderLines()
                              throws MessagingException
Get all header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header-line, containing both the "name" and "value" field.

Specified by:
getAllHeaderLines in interface MimePart
Throws:
MessagingException

public java.util.Enumeration<E> getMatchingHeaderLines(String[] names) throws MessagingException
以 String 枚举的形式获取匹配的头行。Header 行是原始 RFC 822 头行，包含 "name" 和 "value" 字段。
Throws MessagingException:
英文文档：

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header-line, containing both the "name" and "value" field.

Specified by:
getMatchingHeaderLines in interface MimePart
Throws:
MessagingException

public java.util.Enumeration<E> getNonMatchingHeaderLines(String[] names) throws MessagingException
以 String 枚举的形式获取不匹配的头行。Header 行是原始 RFC 822 头行，包含 "name" 和 "value" 字段。
Throws MessagingException:
英文文档：

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header-line, containing both the "name" and "value" field.

Specified by:
getNonMatchingHeaderLines in interface MimePart
Throws:
MessagingException

public Flags getFlags() throws MessagingException
返回包含此消息的标志的 Flags 对象。

注意，返回的是内部 Flags 对象的副本，因此修改返回的 Flags 对象将不会影响此消息的标志。

return | 包含此消息标志的 Flags 对象。
Throws | MessagingException:
See also | javax.mail.Flags
英文文档：

getFlags

public Flags getFlags()
               throws MessagingException
Return a Flags object containing the flags for this message.

Note that a clone of the internal Flags object is returned, so modifying the returned Flags object will not affect the flags of this message.

Specified by:
getFlags in class Message
Returns:
Flags object containing the flags for this message
Throws:
MessagingException
See Also:
Flags

public boolean isSet(Flags.Flag flag) throws MessagingException
检查此消息中是否设置了 flag 参数中指定的标志。

此实现检查此消息的内部 flags 对象。

flag | 标志
return | 此消息指定标志的值
Throws | MessagingException:
See also | javax.mail.Flags.Flag, ANSWERED, DELETED, DRAFT, FLAGGED, RECENT, SEEN
英文文档：

isSet

public boolean isSet(Flags.Flag flag)
              throws MessagingException
Check whether the flag specified in the flag argument is set in this message.

This implementation checks this message's internal flags object.

Overrides:
isSet in class Message
Parameters:
flag - the flag
Returns:
value of the specified flag for this message
Throws:
MessagingException
See Also:
Flags.Flag, Flags.Flag.ANSWERED, Flags.Flag.DELETED, Flags.Flag.DRAFT, Flags.Flag.FLAGGED, Flags.Flag.RECENT, Flags.Flag.SEEN

public void setFlags(Flags flag, boolean set) throws MessagingException
设置此消息的标志。

此实现修改 flags 字段。

Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

setFlags

public void setFlags(Flags flag,
                     boolean set)
              throws MessagingException
Set the flags for this message.

This implementation modifies the flags field.

Specified by:
setFlags in class Message
Parameters:
flag - Flags object containing the flags to be set
set - the value to be set
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
See Also:
MessageChangedEvent

public void saveChanges() throws MessagingException
更新此消息相应的头字段，使其与消息的内容保持一致。如果此消息包含在某个文件夹中，则对此消息进行的所有更改都会提交到该包含文件夹中。

如果消息的头或内容的任何部分发生更改，则必须调用 saveChanges 确保这些更改是永久性的。否则，任何这样的修改可能被保存，也可能不被保存，具体取决于文件夹实现。

不应该修改从设置为 READ_ONLY 的文件夹获取的消息，也不应对这些消息调用 saveChanges。

此方法将 modified 标志设置为 true，将 save 标志设置为 true，然后调用 updateHeaders 方法。

Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

saveChanges

public void saveChanges()
                 throws MessagingException
Updates the appropriate header fields of this message to be consistent with the message's contents. If this message is contained in a Folder, any changes made to this message are committed to the containing folder.

If any part of a message's headers or contents are changed, saveChanges must be called to ensure that those changes are permanent. Otherwise, any such modifications may or may not be saved, depending on the folder implementation.

Messages obtained from folders opened READ_ONLY should not be modified and saveChanges should not be called on such messages.

This method sets the modified flag to true, the save flag to true, and then calls the updateHeaders method.

Specified by:
saveChanges in class Message
Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

protected void updateMessageID() throws MessagingException
更新 Message-ID 头。此方法由 updateHeaders 调用，并且只允许子类重写选择 Message-ID 的算法。
since
en
JavaMail 1.4
英文文档：

updateMessageID

protected void updateMessageID()
                        throws MessagingException
Update the Message-ID header. This method is called by the updateHeaders and allows a subclass to override only the algorithm for choosing a Message-ID.

Throws:
MessagingException
Since:
JavaMail 1.4

protected void updateHeaders() throws MessagingException
由 saveChanges 方法调用，以实际更新 MIME 头。这里的实现设置 Content-Transfer-Encoding 头（如果需要且还未设置）、MIME-Version 头和 Message-ID 头。另外，如果此消息的内容为 MimeMultipart，则调用 updateHeaders 方法。
Throws | IllegalWriteException: 如果底层实现不支持修改
Throws | IllegalStateException: 如果此消息是从 READ_ONLY 文件夹获取的。
Throws | MessagingException:
英文文档：

updateHeaders

protected void updateHeaders()
                      throws MessagingException
Called by the saveChanges method to actually update the MIME headers. The implementation here sets the Content-Transfer-Encoding header (if needed and not already set), the MIME-Version header and the Message-ID header. Also, if the content of this message is a MimeMultipart, it's updateHeaders method is called.

Throws:
IllegalWriteException - if the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

protected InternetHeaders createInternetHeaders(java.io.InputStream is) throws MessagingException
创建并返回从给定 InputStream 加载头的 InternetHeaders 对象。子类可重写此方法，以返回 InternetHeaders 的子类（如有必要）。此实现只是构造和返回 InternetHeaders 对象。
is | 要从中读取头的 InputStream
Throws | MessagingException:
since
en
JavaMail 1.2
英文文档：

createInternetHeaders

protected InternetHeaders createInternetHeaders(InputStream is)
                                         throws MessagingException
Create and return an InternetHeaders object that loads the headers from the given InputStream. Subclasses can override this method to return a subclass of InternetHeaders, if necessary. This implementation simply constructs and returns an InternetHeaders object.

Parameters:
is - the InputStream to read the headers from
Throws:
MessagingException
Since:
JavaMail 1.2

protected MimeMessage createMimeMessage(Session session) throws MessagingException
创建并返回 MimeMessage 对象。回复方法使用此方法创建将会返回的 MimeMessage 对象。子类可以重写此方法，以返回 MimeMessage 的子类。此实现使用提供的 Session 构造并返回 MimeMessage 对象。
session | 用于新消息的 Session
return | 新的 MimeMessage 对象
since
en
JavaMail 1.4
英文文档：

createMimeMessage

protected MimeMessage createMimeMessage(Session session)
                                 throws MessagingException
Create and return a MimeMessage object. The reply method uses this method to create the MimeMessage object that it will return. Subclasses can override this method to return a subclass of MimeMessage. This implementation simply constructs and returns a MimeMessage object using the supplied Session.

Parameters:
session - the Session to use for the new message
Returns:
the new MimeMessage object
Throws:
MessagingException
Since:
JavaMail 1.4
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


MimeMessage.RecipientType (Java EE 5)

javax.mail.internet
Class MimeMessage.RecipientType

java.lang.Object
    extended by  javax.mail.Message.RecipientType
        extended by  javax.mail.internet.MimeMessage.RecipientType
All Implemented Interfaces:
Serializable
Enclosing class:
MimeMessage
public static class MimeMessage.RecipientType
extends Message.RecipientType

Extends: Message.RecipientType
Contained within: MimeMessage

此内部类扩展 javax.mail.Message.RecipientType 类，添加了其他 RecipientType。目前在这里定义的一个附加 RecipientType 是 NEWSGROUPS。
See also javax.mail.Message.RecipientType
英文文档：

This inner class extends the javax.mail.Message.RecipientType class to add additional RecipientTypes. The one additional RecipientType currently defined here is NEWSGROUPS.

See Also:
Message.RecipientType, Serialized Form

Field Summary
static MimeMessage.RecipientType NEWSGROUPS
The "Newsgroup" (Usenet news) recipients.
Fields inherited from class javax.mail.Message.RecipientType
BCC, CC, TO, type
Constructor Summary
protected MimeMessage.RecipientType(String type)
Method Summary
protected  Object readResolve()
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class.
Methods inherited from class javax.mail.Message.RecipientType
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

NEWSGROUPS

public static final MimeMessage.RecipientType NEWSGROUPS
The "Newsgroup" (Usenet news) recipients.

Constructor Detail

protected MimeMessage.RecipientType(String type)
英文文档：

MimeMessage.RecipientType

protected MimeMessage.RecipientType(String type)
Method Detail

protected Object readResolve() throws java.io.ObjectStreamException
英文文档：

readResolve

protected Object readResolve()
                      throws ObjectStreamException
Description copied from class: Message.RecipientType
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class. Subclasses must implement their own readResolve method that checks for their known instances before calling this super method.

Overrides:
readResolve in class Message.RecipientType
Throws:
ObjectStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeMultipart (Java EE 5)

javax.mail.internet
Class MimeMultipart

java.lang.Object
    extended by  javax.mail.Multipart
        extended by  javax.mail.internet.MimeMultipart

public class MimeMultipart
extends Multipart

Extends: Multipart

MimeMultipart 类是针对 multipart 数据使用 MIME 约定的抽象 Multipart 类的一个实现。

MimeMultipart 从基本类型为 "multipart" 的 MimePart 中获取（通过调用该部分的 getContent() 方法），也可以通过客户端作为新建 MimeMessage 的一部分创建。

默认的 multipart 子类型为 "mixed"。其他 multipart 子类型（如 "alternative"、"related"，等等）可以作为 MimeMultipart 的子类实现，需要一些额外的方法来实现该类型 multipart 内容的其他语义。服务提供者、邮件 JavaBean 编写者和邮件客户端将编写许多这种子类型及其命令 Bean，并将它们安装在 JavaBeans Activation Framework 中，以便任何 JavaMail 实现及其客户端能透明地找到并使用这些类。因此，MIME multipart 处理程序的处理方式与任何其他类型的处理程序一样，要将提供multipart 处理程序的过程从 JavaMail API 中分离出来。如果缺少这些附加的 MimeMultipart 子类，所有子类型的 MIME multipart 数据都将显示为 MimeMultipart 对象。

通过使用 MimeMultipart(String subtype) 构造方法，应用程序可以直接构造任意子类型的 MIME multipart 对象。例如，要创建 "multipart/alternative" 对象，则使用 new MimeMultipart("alternative")。

mail.mime.multipart.ignoremissingendboundary 属性可以设置为 false，在这种情况下，如果 multipart 数据不能以所需的结束边界行结尾，则抛出 MessagingException。如果此属性设置为 true 或没有设置，则缺少结束边界不会被视为错误，最终的正文部分将在数据末尾结束。

mail.mime.multipart.ignoremissingboundaryparameter 系统属性可以设置为 false，在这种情况下，如果 Content-Type 的 MimeMultipart 不包括 boundary 参数，则抛出 MessagingException。如果此属性设置为 true 或没有设置，则 multipart 解析代码将查找一个类似边界行的行，并将此行用作分隔各部分的边界。

version 1.48, 07/05/15
英文文档：

The MimeMultipart class is an implementation of the abstract Multipart class that uses MIME conventions for the multipart data.

A MimeMultipart is obtained from a MimePart whose primary type is "multipart" (by invoking the part's getContent() method) or it can be created by a client as part of creating a new MimeMessage.

The default multipart subtype is "mixed". The other multipart subtypes, such as "alternative", "related", and so on, can be implemented as subclasses of MimeMultipart with additional methods to implement the additional semantics of that type of multipart content. The intent is that service providers, mail JavaBean writers and mail clients will write many such subclasses and their Command Beans, and will install them into the JavaBeans Activation Framework, so that any JavaMail implementation and its clients can transparently find and use these classes. Thus, a MIME multipart handler is treated just like any other type handler, thereby decoupling the process of providing multipart handlers from the JavaMail API. Lacking these additional MimeMultipart subclasses, all subtypes of MIME multipart data appear as MimeMultipart objects.

An application can directly construct a MIME multipart object of any subtype by using the MimeMultipart(String subtype) constructor. For example, to create a "multipart/alternative" object, use new MimeMultipart("alternative").

The mail.mime.multipart.ignoremissingendboundary property may be set to false to cause a MessagingException to be thrown if the multipart data does not end with the required end boundary line. If this property is set to true or not set, missing end boundaries are not considered an error and the final body part ends at the end of the data.

The mail.mime.multipart.ignoremissingboundaryparameter System property may be set to false to cause a MessagingException to be thrown if the Content-Type of the MimeMultipart does not include a boundary parameter. If this property is set to true or not set, the multipart parsing code will look for a line that looks like a bounary line and use that as the boundary separating the parts.

Version:
1.48, 07/05/15
Author:
John Mani, Bill Shannon, Max Spivak

Field Summary
protected DataSource | ds The DataSource supplying our InputStream.
protected boolean | parsed Have we parsed the data from our InputStream yet?
Fields inherited from class javax.mail.Multipart
contentType, parent, parts
Constructor Summary
MimeMultipart()
Default constructor.
MimeMultipart(DataSource ds)
Constructs a MimeMultipart object and its bodyparts from the given DataSource.
MimeMultipart(String subtype)
Construct a MimeMultipart object of the given subtype.
Method Summary
void | addBodyPart(BodyPart part) Adds a Part to the multipart.
void | addBodyPart(BodyPart part, int index) Adds a BodyPart at position index.
protected InternetHeaders | createInternetHeaders(InputStream is) Create and return an InternetHeaders object that loads the headers from the given InputStream.
protected MimeBodyPart | createMimeBodyPart(InputStream is) Create and return a MimeBodyPart object to represent a body part parsed from the InputStream.
protected MimeBodyPart | createMimeBodyPart(InternetHeaders headers, byte[] content) Create and return a MimeBodyPart object to represent a body part parsed from the InputStream.
BodyPart | getBodyPart(int index) Get the specified BodyPart.
BodyPart | getBodyPart(String CID) Get the MimeBodyPart referred to by the given ContentID (CID).
int | getCount() Return the number of enclosed BodyPart objects.
String | getPreamble() Get the preamble text, if any, that appears before the first body part of this multipart.
boolean | isComplete() Return true if the final boundary line for this multipart was seen.
protected void | parse() Parse the InputStream from our DataSource, constructing the appropriate MimeBodyParts.
boolean | removeBodyPart(BodyPart part) Remove the specified part from the multipart message.
void | removeBodyPart(int index) Remove the part at specified location (starting from 0).
void | setPreamble(String preamble) Set the preamble text to be included before the first body part.
void | setSubType(String subtype) Set the subtype.
protected void | updateHeaders() Update headers.
void | writeTo(OutputStream os) Iterates through all the parts and outputs each MIME part separated by a boundary.
Methods inherited from class javax.mail.Multipart
getContentType, getParent, setMultipartDataSource, setParent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

ds

protected DataSource ds
The DataSource supplying our InputStream.

英文文档：

parsed

protected boolean parsed
Have we parsed the data from our InputStream yet? Defaults to true; set to false when our constructor is given a DataSource with an InputStream that we need to parse.

Constructor Detail

public MimeMultipart()
默认构造方法。创建一个空 MimeMultipart 对象。其内容类型设置为 "multipart/mixed"。将生成唯一的边界字符串，并且此字符串将设置为 contentType 字段的 "boundary" 参数。

可以随后添加 MimeBodyParts。

英文文档：

MimeMultipart

public MimeMultipart()
Default constructor. An empty MimeMultipart object is created. Its content type is set to "multipart/mixed". A unique boundary string is generated and this string is setup as the "boundary" parameter for the contentType field.

MimeBodyParts may be added later.

public MimeMultipart(String subtype)
构造给定子类型的 MimeMultipart 对象。将生成唯一的边界字符串，并且此字符串将设置为 contentType 字段的 "boundary" 参数。

可以随后添加 MimeBodyPart。

英文文档：

MimeMultipart

public MimeMultipart(String subtype)
Construct a MimeMultipart object of the given subtype. A unique boundary string is generated and this string is setup as the "boundary" parameter for the contentType field.

MimeBodyParts may be added later.

public MimeMultipart(DataSource ds) throws MessagingException
根据给定 DataSource 构造 MimeMultipart 对象及其 bodypart。

此构造方法处理的是一种特殊情况，即给定的 DataSource 是一个 MultipartDataSource 对象。在这种情况下，此方法仅调用带有 MultipartDataSource 对象的超类（即 Multipart）构造方法。

在其他情况下，DataSource 被假定为提供一个 MIME multipart 字节流。parsed 标志设置为 false。当需要正文部分的数据时，解析器从此 DataSource 的内容类型中提取 "boundary" 参数，跳过 'preamble' 并读取终止边界之前的字节，然后为此流的每个部分创建 MimeBodyPart。

ds DataSource，可以是 MultipartDataSource
英文文档：

MimeMultipart

public MimeMultipart(DataSource ds)
              throws MessagingException
Constructs a MimeMultipart object and its bodyparts from the given DataSource.

This constructor handles as a special case the situation where the given DataSource is a MultipartDataSource object. In this case, this method just invokes the superclass (i.e., Multipart) constructor that takes a MultipartDataSource object.

Otherwise, the DataSource is assumed to provide a MIME multipart byte stream. The parsed flag is set to false. When the data for the body parts are needed, the parser extracts the "boundary" parameter from the content type of this DataSource, skips the 'preamble' and reads bytes till the terminating boundary and creates MimeBodyParts for each part of the stream.

Parameters:
ds - DataSource, can be a MultipartDataSource
Throws:
MessagingException
Method Detail

public void setSubType(String subtype) throws MessagingException
设置子类型。只应该对客户端创建的新 MimeMultipart 对象调用此方法。这种 multipart 对象的默认子类型为 "mixed"。

subtype 子类型
英文文档：

setSubType

public void setSubType(String subtype)
                throws MessagingException
Set the subtype. This method should be invoked only on a new MimeMultipart object created by the client. The default subtype of such a multipart object is "mixed".

Parameters:
subtype - Subtype
Throws:
MessagingException

public int getCount() throws MessagingException
返回封闭 BodyPart 对象的数量。
return 部分数
英文文档：

getCount

public int getCount()
             throws MessagingException
Return the number of enclosed BodyPart objects.

Overrides:
getCount in class Multipart
Returns:
number of parts
Throws:
MessagingException
See Also:
Multipart.parts

public BodyPart getBodyPart(int index) throws MessagingException
获取指定的 BodyPart。BodyPart 从 0 开始编号。
index | 所需 BodyPart 的索引
return | Part
Throws | MessagingException: 如果不存在这种 BodyPart
英文文档：

getBodyPart

public BodyPart getBodyPart(int index)
                     throws MessagingException
Get the specified BodyPart. BodyParts are numbered starting at 0.

Overrides:
getBodyPart in class Multipart
Parameters:
index - the index of the desired BodyPart
Returns:
the Part
Throws:
MessagingException - if no such BodyPart exists

public BodyPart getBodyPart(String CID) throws MessagingException
获取给定 ContentID (CID) 所引用的 MimeBodyPart。如果未找到该部分，则返回 null。
CID | 所需部分的 ContentID
return | Part
英文文档：

getBodyPart

public BodyPart getBodyPart(String CID)
                     throws MessagingException
Get the MimeBodyPart referred to by the given ContentID (CID). Returns null if the part is not found.

Parameters:
CID - the ContentID of the desired part
Returns:
the Part
Throws:
MessagingException

public boolean removeBodyPart(BodyPart part) throws MessagingException
从 multipart 消息中移除指定的部分。将所有部分向移除部分移动一位。
part | 要移除的部分
return | 如果移除了 part，则返回 true；否则返回 false
Throws | MessagingException: 如果不存在此类 Part
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

removeBodyPart

public boolean removeBodyPart(BodyPart part)
                       throws MessagingException
Remove the specified part from the multipart message. Shifts all the parts after the removed part down one.

Overrides:
removeBodyPart in class Multipart
Parameters:
part - The part to remove
Returns:
true if part removed, false otherwise
Throws:
MessagingException - if no such Part exists
IllegalWriteException - if the underlying implementation does not support modification of existing values

public void removeBodyPart(int index) throws MessagingException
移除指定位置（从 0 开始）的部分。将所有部分向移除部分移动一位。
index | 要移除部分的索引
Throws | MessagingException:
Throws | IndexOutOfBoundsException: 如果给定索引超出范围。
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

removeBodyPart

public void removeBodyPart(int index)
                    throws MessagingException
Remove the part at specified location (starting from 0). Shifts all the parts after the removed part down one.

Overrides:
removeBodyPart in class Multipart
Parameters:
index - Index of the part to remove
Throws:
MessagingException
IndexOutOfBoundsException - if the given index is out of range.
IllegalWriteException - if the underlying implementation does not support modification of existing values

public void addBodyPart(BodyPart part) throws MessagingException
将 Part 添加到 multipart。BodyPart 将被添加到现有的 Part 列表。
part | 要添加的 Part
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

addBodyPart

public void addBodyPart(BodyPart part)
                 throws MessagingException
Adds a Part to the multipart. The BodyPart is appended to the list of existing Parts.

Overrides:
addBodyPart in class Multipart
Parameters:
part - The Part to be appended
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

public void addBodyPart(BodyPart part, int index) throws MessagingException
在 index 处添加 BodyPart。如果 index 不是列表中的最后一个，则后续部分将向上移。如果 index 大于现有的部分数，则将在末尾添加 BodyPart。
part | 要插入的 BodyPart
index | 插入部分的位置
Throws | MessagingException:
Throws | IllegalWriteException: 如果底层实现不支持修改现有值
英文文档：

addBodyPart

public void addBodyPart(BodyPart part,
                        int index)
                 throws MessagingException
Adds a BodyPart at position index. If index is not the last one in the list, the subsequent parts are shifted up. If index is larger than the number of parts present, the BodyPart is appended to the end.

Overrides:
addBodyPart in class Multipart
Parameters:
part - The BodyPart to be inserted
index - Location where to insert the part
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

public boolean isComplete() throws MessagingException
如果遇到此 multipart 的最终边界线，则返回 true。解析 multipart 内容时，如果在遇到最终 multipart 边界行之前已到达输入末尾，则子类将（在默认情况下）终止解析，而且没有任何错误。在这种情况下，此方法将返回 false。（如果系统属性 "mail.mime.multipart.ignoremissingendboundary" 设置为 false，则解析此类消息将改为抛出 MessagingException。）
return 如果遇到最终边界行，则返回 true
since
en
JavaMail 1.4
英文文档：

isComplete

public boolean isComplete()
                   throws MessagingException
Return true if the final boundary line for this multipart was seen. When parsing multipart content, this class will (by default) terminate parsing with no error if the end of input is reached before seeing the final multipart boundary line. In such a case, this method will return false. (If the System property "mail.mime.multipart.ignoremissingendboundary" is set to false, parsing such a message will instead throw a MessagingException.)

Returns:
true if the final boundary line was seen
Throws:
MessagingException
Since:
JavaMail 1.4

public String getPreamble() throws MessagingException
获取导言文本（如果有），它位于此 multipart 的第一个正文部分的前面。有些协议（如 IMAP）将不允许访问导言文本。
return 导言文本；如果没有导言，则返回 null
since
en
JavaMail 1.4
英文文档：

getPreamble

public String getPreamble()
                   throws MessagingException
Get the preamble text, if any, that appears before the first body part of this multipart. Some protocols, such as IMAP, will not allow access to the preamble text.

Returns:
the preamble text, or null if no preamble
Throws:
MessagingException
Since:
JavaMail 1.4

public void setPreamble(String preamble) throws MessagingException
将导言文本设置为包含在第一个正文部分前面。应用程序通常不应该包含任何导言文本。在某些情况下，包含带有针对准 MIME 软件用户的说明的导言文本会很有用。导言文本应该是完整的行，包括新行。
preamble 导言文本
since
en
JavaMail 1.4
英文文档：

setPreamble

public void setPreamble(String preamble)
                 throws MessagingException
Set the preamble text to be included before the first body part. Applications should generally not include any preamble text. In some cases it may be helpful to include preamble text with instructions for users of pre-MIME software. The preamble text should be complete lines, including newlines.

Parameters:
preamble - the preamble text
Throws:
MessagingException
Since:
JavaMail 1.4

protected void updateHeaders() throws MessagingException
更新头。这里的默认实现仅对头的每个子 BodyPart 调用 updateHeaders 方法。

注意，在创建新的空 MimeMultipart 对象时，boundary 参数已经设置。

对包含此 Multipart 的 Message 对象调用 saveChanges 方法时，调用此方法。这通常作为 Message 发送过程的一部分完成，但是要注意，客户端可以随意调用此方法任意次数。因此，如果对于特定 MimeMultipart 子类，头更新过程开销很大，则它会自己跟踪其内部状态是否真正发生了更改，并只在必要时更新头。

英文文档：

updateHeaders

protected void updateHeaders()
                      throws MessagingException
Update headers. The default implementation here just calls the updateHeaders method on each of its children BodyParts.

Note that the boundary parameter is already set up when a new and empty MimeMultipart object is created.

This method is called when the saveChanges method is invoked on the Message object containing this Multipart. This is typically done as part of the Message send process, however note that a client is free to call it any number of times. So if the header updating process is expensive for a specific MimeMultipart subclass, then it might itself want to track whether its internal state actually did change, and do the header updating only if necessary.

Throws:
MessagingException

public void writeTo(java.io.OutputStream os) throws java.io.IOException, MessagingException
迭代所有部分并输出边界分隔的每个 MIME 部分。
英文文档：

writeTo

public void writeTo(OutputStream os)
             throws IOException,
                    MessagingException
Iterates through all the parts and outputs each MIME part separated by a boundary.

Specified by:
writeTo in class Multipart
Throws:
IOException - if an IO related exception occurs
MessagingException

protected void parse() throws MessagingException
解析 DataSource 的 InputStream，构造相应的 MimeBodyPart。parsed 标志设置为 true，为 true 时不进行任何输入。此方法供所有其他需要正文部分数据的方法调用，以确保数据已经被解析。
since
en
JavaMail 1.2
英文文档：

parse

protected void parse()
              throws MessagingException
Parse the InputStream from our DataSource, constructing the appropriate MimeBodyParts. The parsed flag is set to true, and if true on entry nothing is done. This method is called by all other methods that need data for the body parts, to make sure the data has been parsed.

Throws:
MessagingException
Since:
JavaMail 1.2

protected InternetHeaders createInternetHeaders(java.io.InputStream is) throws MessagingException
创建并返回从给定 InputStream 加载头的 InternetHeaders 对象。子类可重写此方法，以返回 InternetHeaders 的子类（如有必要）。此实现只是构造和返回 InternetHeaders 对象。
is | 要从中读取头的 InputStream
Throws | MessagingException:
since
en
JavaMail 1.2
英文文档：

createInternetHeaders

protected InternetHeaders createInternetHeaders(InputStream is)
                                         throws MessagingException
Create and return an InternetHeaders object that loads the headers from the given InputStream. Subclasses can override this method to return a subclass of InternetHeaders, if necessary. This implementation simply constructs and returns an InternetHeaders object.

Parameters:
is - the InputStream to read the headers from
Throws:
MessagingException
Since:
JavaMail 1.2

protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content) throws MessagingException
创建并返回一个 MimeBodyPart 对象，表示解析 InputStream 的正文部分。子类可重写此方法，以返回 MimeBodyPart 的子类（如果需要）。此实现只是构造和返回 MimeBodyPart 对象。
headers | 正文部分的头
content | 正文部分的内容
Throws | MessagingException:
since
en
JavaMail 1.2
英文文档：

createMimeBodyPart

protected MimeBodyPart createMimeBodyPart(InternetHeaders headers,
                                          byte[] content)
                                   throws MessagingException
Create and return a MimeBodyPart object to represent a body part parsed from the InputStream. Subclasses can override this method to return a subclass of MimeBodyPart, if necessary. This implementation simply constructs and returns a MimeBodyPart object.

Parameters:
headers - the headers for the body part
content - the content of the body part
Throws:
MessagingException
Since:
JavaMail 1.2

protected MimeBodyPart createMimeBodyPart(java.io.InputStream is) throws MessagingException
创建并返回一个 MimeBodyPart 对象，表示解析 InputStream 的正文部分。子类可重写此方法，以返回 MimeBodyPart 的子类（如果需要）。此实现只是构造和返回 MimeBodyPart 对象。
is | 包含正文部分的 InputStream
Throws | MessagingException:
since
en
JavaMail 1.2
英文文档：

createMimeBodyPart

protected MimeBodyPart createMimeBodyPart(InputStream is)
                                   throws MessagingException
Create and return a MimeBodyPart object to represent a body part parsed from the InputStream. Subclasses can override this method to return a subclass of MimeBodyPart, if necessary. This implementation simply constructs and returns a MimeBodyPart object.

Parameters:
is - InputStream containing the body part
Throws:
MessagingException
Since:
JavaMail 1.2
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimePartDataSource (Java EE 5)

javax.mail.internet
Class MimePartDataSource

java.lang.Object
    extended by  javax.mail.internet.MimePartDataSource
All Implemented Interfaces:
DataSource, MessageAware
public class MimePartDataSource
extends Object
implements DataSource, MessageAware

Implements: DataSource, MessageAware

实现 MimePart 中的 DataSource 的实用工具类。此类主要供服务提供者使用。
See also javax.mail.internet.MimePart, javax.activation.DataSource
英文文档：

A utility class that implements a DataSource out of a MimePart. This class is primarily meant for service providers.

Author:
John Mani
See Also:
MimePart, DataSource

Field Summary
protected  MimePart part
The MimePart that provides the data for this DataSource.
Constructor Summary
MimePartDataSource(MimePart part)
Constructor, that constructs a DataSource from a MimePart.
Method Summary
String | getContentType() Returns the content-type of this DataSource.
InputStream | getInputStream() Returns an input stream from this MimePart.
MessageContext | getMessageContext() Return the MessageContext for the current part.
String | getName() DataSource method to return a name.
OutputStream | getOutputStream() DataSource method to return an output stream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

part

protected MimePart part
The MimePart that provides the data for this DataSource.

Since:
JavaMail 1.4
Constructor Detail

public MimePartDataSource(MimePart part)
构造方法，根据 MimePart 构造 DataSource。
英文文档：

MimePartDataSource

public MimePartDataSource(MimePart part)
Constructor, that constructs a DataSource from a MimePart.

Method Detail

public java.io.InputStream getInputStream() throws java.io.IOException
返回此 MimePart 的输入流。

此方法根据此 MimePart 的 Content-Transfer-Encoding 属性的不同应用相应的传输编码。因此，返回的输入流是已解码的字节流。

此实现使用 getContentStream() 方法从 Part 中获取原始内容，并使用 MimeUtility.decode() 方法对它进行解码。

return | 已解码的输入流
See also | getContentStream, getContentStream, decode
英文文档：

getInputStream

public InputStream getInputStream()
                           throws IOException
Returns an input stream from this MimePart.

This method applies the appropriate transfer-decoding, based on the Content-Transfer-Encoding attribute of this MimePart. Thus the returned input stream is a decoded stream of bytes.

This implementation obtains the raw content from the Part using the getContentStream() method and decodes it using the MimeUtility.decode() method.

Specified by:
getInputStream in interface DataSource
Returns:
decoded input stream
Throws:
IOException
See Also:
MimeMessage.getContentStream(),
MimeBodyPart.getContentStream(),
MimeUtility.decode(java.io.InputStream, java.lang.String)

public java.io.OutputStream getOutputStream() throws java.io.IOException
返回输出流的 DataSource 方法。

此实现抛出 UnknownServiceException。

英文文档：

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
DataSource method to return an output stream.

This implementation throws the UnknownServiceException.

Specified by:
getOutputStream in interface DataSource
Returns:
an OutputStream
Throws:
IOException

public String getContentType()
返回此 DataSource 的内容类型。

此实现仅对 MimePart 调用 getContentType 方法。

英文文档：

getContentType

public String getContentType()
Returns the content-type of this DataSource.

This implementation just invokes the getContentType method on the MimePart.

Specified by:
getContentType in interface DataSource
Returns:
the MIME Type

public String getName()
返回名称的 DataSource 方法。

此实现仅返回一个空字符串。

英文文档：

getName

public String getName()
DataSource method to return a name.

This implementation just returns an empty string.

Specified by:
getName in interface DataSource
Returns:
the name of the object.

public MessageContext getMessageContext()
返回当前部分的 MessageContext。
since
en
JavaMail 1.1
英文文档：

getMessageContext

public MessageContext getMessageContext()
Return the MessageContext for the current part.

Specified by:
getMessageContext in interface MessageAware
Since:
JavaMail 1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeUtility (Java EE 5)

javax.mail.internet
Class MimeUtility

java.lang.Object
    extended by  javax.mail.internet.MimeUtility

public class MimeUtility
extends Object

这是一个提供各种与 MIME 相关的功能的实用工具类。

提供了一组方法，可以根据 RFC 2047 编码和解码 MIME 头。关于处理此类头的方式简述如下：

RFC 822 邮件头只能包含 US-ASCII 字符。包含非 US-ASCII 字符的头必须进行编码，使其仅包含 US-ASCII 字符。此过程通常需要使用 BASE64 或 QP 来编码某些字符。RFC 2047 详细描述了这一点。

在 Java 中，String 包含（16 位）Unicode 字符。ASCII 是 Unicode 的一个子集（占用范围为 0 - 127）。仅包含 ASCII 字符的 String 对于邮件是安全的。如果 String 包含非 US-ASCII 字符，则它必须进行编码。此步骤比较复杂的地方在于，Unicode 还不是广泛使用的字符集，因此应该先将 String 通过字符集编码转换为另一种字符集，然后再进行传输编码。

注意，要获取对于邮件安全的 String 的实际字节（比如，要通过 SMTP 发送邮件），必须执行

    byte[] bytes = string.getBytes("iso-8859-1");

MimeMessage 及 MimeBodyPart 上的 setHeader 和 addHeader 方法假定给定的头值为仅包含 US-ASCII 字符的 Unicode 字符串。因此，这些方法的调用者必须确保它们传递的值不包含非 US-ASCII 字符。此类中的方法帮助实现这一点。

MimeMessage 和 MimeBodyPart 上的 getHeader 方法系列返回原始头值。它们可能根据 RFC 2047 进行了编码，如果是这样，则必须解码成 Unicode String。此类中的方法帮助实现这一点。

几个系统属性用于控制严格遵守 MIME 规范。注意，这些属性不是会话属性，但必须作为系统属性进行全局设置。

mail.mime.decodetext.strict 属性控制 MIME 编码字符的解码。MIME 规范要求该编码字符以空格分隔的单词开始。有些邮件程序在单词的中间包含了编码字符，这是不正确的。如果 mail.mime.decodetext.strict 系统属性设置为 "false"，则将尝试解码这些非法编码字符。默认值为 true。

mail.mime.encodeeol.strict 属性控制选择类型不为 "text" 的 MIME 部分的 Content-Transfer-Encoding。这些部分经常包含文本数据，适合允许普通行结尾转换的编码。在很少的情况下，这些部分包含整个文本数据，但需要可保持 CR 和 LF 字符不变的编码操作。如果 mail.mime.encodeeol.strict 系统属性设置为 "true"，则必要时将使用这种编码。默认值为 false。

此外，使用 mail.mime.charset 系统属性可以指定用于编码字符和文本部分的默认 MIME 字符集（若没有指定其他字符集）。通常，默认的 MIME 字符集派生自默认的 Java 字符集，该字符集在 file.encoding 系统属性中指定。大多数应用程序不需要明确设置默认的 MIME 字符集。如果要用于邮件消息的默认 MIME 字符集与用于存储在系统中的文件的字符集不同，则应该设置此属性。

version 1.60, 07/05/15
英文文档：

This is a utility class that provides various MIME related functionality.

There are a set of methods to encode and decode MIME headers as per RFC 2047. A brief description on handling such headers is given below:

RFC 822 mail headers must contain only US-ASCII characters. Headers that contain non US-ASCII characters must be encoded so that they contain only US-ASCII characters. Basically, this process involves using either BASE64 or QP to encode certain characters. RFC 2047 describes this in detail.

In Java, Strings contain (16 bit) Unicode characters. ASCII is a subset of Unicode (and occupies the range 0 - 127). A String that contains only ASCII characters is already mail-safe. If the String contains non US-ASCII characters, it must be encoded. An additional complexity in this step is that since Unicode is not yet a widely used charset, one might want to first charset-encode the String into another charset and then do the transfer-encoding.

Note that to get the actual bytes of a mail-safe String (say, for sending over SMTP), one must do

        byte[] bytes = string.getBytes("iso-8859-1");

The setHeader and addHeader methods on MimeMessage and MimeBodyPart assume that the given header values are Unicode strings that contain only US-ASCII characters. Hence the callers of those methods must insure that the values they pass do not contain non US-ASCII characters. The methods in this class help do this.

The getHeader family of methods on MimeMessage and MimeBodyPart return the raw header value. These might be encoded as per RFC 2047, and if so, must be decoded into Unicode Strings. The methods in this class help to do this.

Several System properties control strict conformance to the MIME spec. Note that these are not session properties but must be set globally as System properties.

The mail.mime.decodetext.strict property controls decoding of MIME encoded words. The MIME spec requires that encoded words start at the beginning of a whitespace separated word. Some mailers incorrectly include encoded words in the middle of a word. If the mail.mime.decodetext.strict System property is set to "false", an attempt will be made to decode these illegal encoded words. The default is true.

The mail.mime.encodeeol.strict property controls the choice of Content-Transfer-Encoding for MIME parts that are not of type "text". Often such parts will contain textual data for which an encoding that allows normal end of line conventions is appropriate. In rare cases, such a part will appear to contain entirely textual data, but will require an encoding that preserves CR and LF characters without change. If the mail.mime.encodeeol.strict System property is set to "true", such an encoding will be used when necessary. The default is false.

In addition, the mail.mime.charset System property can be used to specify the default MIME charset to use for encoded words and text parts that don't otherwise specify a charset. Normally, the default MIME charset is derived from the default Java charset, as specified in the file.encoding System property. Most applications will have no need to explicitly set the default MIME charset. In cases where the default MIME charset to be used for mail messages is different than the charset used for files stored on the system, this property should be set.

Version:
1.60, 07/05/15
Author:
John Mani, Bill Shannon

Field Summary
static int ALL
Method Summary
static InputStream | decode(InputStream is, String encoding) Decode the given input stream.
static String | decodeText(String etext) Decode "unstructured" headers, that is, headers that are defined as '*text' as per RFC 822.
static String | decodeWord(String eword) The string is parsed using the rules in RFC 2047 for parsing an "encoded-word".
static OutputStream | encode(OutputStream os, String encoding) Wrap an encoder around the given output stream.
static OutputStream | encode(OutputStream os, String encoding, String filename) Wrap an encoder around the given output stream.
static String | encodeText(String text) Encode a RFC 822 "text" token into mail-safe form as per RFC 2047.
static String | encodeText(String text, String charset, String encoding) Encode a RFC 822 "text" token into mail-safe form as per RFC 2047.
static String | encodeWord(String word) Encode a RFC 822 "word" token into mail-safe form as per RFC 2047.
static String | encodeWord(String word, String charset, String encoding) Encode a RFC 822 "word" token into mail-safe form as per RFC 2047.
static String | fold(int used, String s) Fold a string at linear whitespace so that each line is no longer than 76 characters, if possible.
static String | getDefaultJavaCharset() Get the default charset corresponding to the system's current default locale.
static String | getEncoding(DataHandler dh) Same as getEncoding(DataSource) except that instead of reading the data from an InputStream it uses the writeTo method to examine the data.
static String | getEncoding(DataSource ds) Get the content-transfer-encoding that should be applied to the input stream of this datasource, to make it mailsafe.
static String | javaCharset(String charset) Convert a MIME charset name into a valid Java charset name.
static String | mimeCharset(String charset) Convert a java charset into its MIME charset name.
static String | quote(String word, String specials) A utility method to quote a word, if the word contains any characters from the specified 'specials' list.
static String | unfold(String s) Unfold a folded header.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

ALL

public static final int ALL
See Also:
Constant Field Values
Method Detail

public static String getEncoding(DataSource ds)
获取应该用于此数据源的输入流的内容转换编码，使其对于邮件是安全的。

这里使用的算法如下：

  • 如果此数据源的基本类型为 "text"，而且其输入流中的所有字节为 US-ASCII，则编码为 "7bit"。如果超过一半的字节为非 US-ASCII，则编码为 "base64"。如果不到一半的字节为非 US-ASCII，则编码为 "quoted-printable"。
  • 如果此数据源的基本类型不是 "text"，若其输入流中的所有字节为 US-ASCII，则编码为 "7bit"。只要有一个非 US-ASCII 字符，编码就是 "base64"。
ds
en
DataSource
return 编码。为 "7bit"、"quoted-printable" 或 "base64"。
英文文档：

getEncoding

public static String getEncoding(DataSource ds)
Get the content-transfer-encoding that should be applied to the input stream of this datasource, to make it mailsafe.

The algorithm used here is:

  • If the primary type of this datasource is "text" and if all the bytes in its input stream are US-ASCII, then the encoding is "7bit". If more than half of the bytes are non-US-ASCII, then the encoding is "base64". If less than half of the bytes are non-US-ASCII, then the encoding is "quoted-printable".
  • If the primary type of this datasource is not "text", then if all the bytes of its input stream are US-ASCII, the encoding is "7bit". If there is even one non-US-ASCII character, the encoding is "base64".

Parameters:
ds - DataSource
Returns:
the encoding. This is either "7bit", "quoted-printable" or "base64"

public static String getEncoding(DataHandler dh)
与 getEncoding(DataSource) 相同，区别在于它不是从 InputStream 中读取数据，而是使用 writeTo 方法检查数据。这在使用对象和 MIME 类型（例如，一个 "text/plain" String）创建 DataHandler 时（一般情况）效率更高。在需要 InputStream 的情况下，DataHandler 将使用一个线程、一对管道流和 writeTo 方法生成数据。

since
en
JavaMail 1.2
英文文档：

getEncoding

public static String getEncoding(DataHandler dh)
Same as getEncoding(DataSource) except that instead of reading the data from an InputStream it uses the writeTo method to examine the data. This is more efficient in the common case of a DataHandler created with an object and a MIME type (for example, a "text/plain" String) because all the I/O is done in this thread. In the case requiring an InputStream the DataHandler uses a thread, a pair of pipe streams, and the writeTo method to produce the data.

Since:
JavaMail 1.2

public static java.io.InputStream decode(java.io.InputStream is, String encoding) throws MessagingException
解码给定的输入流。返回的 InputStream 为已解码的输入流。这里支持所有 RFC 2045 中定义的编码。包括 "base64"、"quoted-printable"、"7bit"、"8bit" 和 "binary"。此外，还支持 "uuencode"。
is | 输入流
encoding | 流的编码。
return | 已解码的输入流。
英文文档：

decode

public static InputStream decode(InputStream is,
                                 String encoding)
                          throws MessagingException
Decode the given input stream. The Input stream returned is the decoded input stream. All the encodings defined in RFC 2045 are supported here. They include "base64", "quoted-printable", "7bit", "8bit", and "binary". In addition, "uuencode" is also supported.

Parameters:
is - input stream
encoding - the encoding of the stream.
Returns:
decoded input stream.
Throws:
MessagingException

public static java.io.OutputStream encode(java.io.OutputStream os, String encoding) throws MessagingException
用编码器包装给定的输出流。这里支持所有 RFC 2045 中定义的编码。包括 "base64"、"quoted-printable"、"7bit"、"8bit" 和 "binary"。此外，还支持 "uuencode"。
os | 输出流
encoding | 流的编码。
return | 应用指定编码的输出流。
英文文档：

encode

public static OutputStream encode(OutputStream os,
                                  String encoding)
                           throws MessagingException
Wrap an encoder around the given output stream. All the encodings defined in RFC 2045 are supported here. They include "base64", "quoted-printable", "7bit", "8bit" and "binary". In addition, "uuencode" is also supported.

Parameters:
os - output stream
encoding - the encoding of the stream.
Returns:
output stream that applies the specified encoding.
Throws:
MessagingException

public static java.io.OutputStream encode(java.io.OutputStream os, String encoding, String filename) throws MessagingException
用编码器包装给定的输出流。这里支持所有 RFC 2045 中定义的编码。包括 "base64"、"quoted-printable"、"7bit"、"8bit" 和 "binary"。此外，还支持 "uuencode"。filename 参数与 "uuencode" 编码一起使用，包含在已编码的输出中。
os | 输出流
encoding | 流的编码。
filename | 将被编码的文件的名称（仅与 uuencode 一起使用）
return | 应用于指定编码的输出流。
since
en
JavaMail 1.2
英文文档：

encode

public static OutputStream encode(OutputStream os,
                                  String encoding,
                                  String filename)
                           throws MessagingException
Wrap an encoder around the given output stream. All the encodings defined in RFC 2045 are supported here. They include "base64", "quoted-printable", "7bit", "8bit" and "binary". In addition, "uuencode" is also supported. The filename parameter is used with the "uuencode" encoding and is included in the encoded output.

Parameters:
os - output stream
encoding - the encoding of the stream.
filename - name for the file being encoded (only used with uuencode)
Returns:
output stream that applies the specified encoding.
Throws:
MessagingException
Since:
JavaMail 1.2

public static String encodeText(String text) throws java.io.UnsupportedEncodingException
根据 RFC 2047，将 RFC 822 "text" 标记编码为对于邮件安全的形式。

对于非 US-ASCII 字符，将检查给定的 Unicode 字符串。如果该字符串仅包含 US-ASCII 字符，则按原样返回。如果字符串包含非 US-ASCII 字符，它首先将使用平台的默认字符集进行字符编码，然后使用 B 或 Q 编码传输编码。所得字节将作为仅包含 ASCII 字符的 Unicode 字符串返回。

注意，此方法应该仅用于编码“非结构化”RFC 822 头。

用法示例：

MimePart part = ...
String rawvalue = "FooBar Mailer, Japanese version 1.1"
try {
// If we know for sure that rawvalue contains only US-ASCII
// characters, we can skip the encoding part
part.setHeader("X-mailer", MimeUtility.encodeText(rawvalue));
} catch (UnsupportedEncodingException e) {
// encoding failure
} catch (MessagingException me) {
// setHeader() failure
  }

text | Unicode 字符串
return | 仅包含 US-ASCII 字符的 Unicode 字符串
Throws | java.io.UnsupportedEncodingException: 如果编码失败
英文文档：

encodeText

public static String encodeText(String text)
                         throws UnsupportedEncodingException
Encode a RFC 822 "text" token into mail-safe form as per RFC 2047.

The given Unicode string is examined for non US-ASCII characters. If the string contains only US-ASCII characters, it is returned as-is. If the string contains non US-ASCII characters, it is first character-encoded using the platform's default charset, then transfer-encoded using either the B or Q encoding. The resulting bytes are then returned as a Unicode string containing only ASCII characters.

Note that this method should be used to encode only "unstructured" RFC 822 headers.

Example of usage:

  MimePart part = ...
  String rawvalue = "FooBar Mailer, Japanese version 1.1"
  try {
    // If we know for sure that rawvalue contains only US-ASCII
    // characters, we can skip the encoding part
    part.setHeader("X-mailer", MimeUtility.encodeText(rawvalue));
  } catch (UnsupportedEncodingException e) {
    // encoding failure
  } catch (MessagingException me) {
   // setHeader() failure
  }

Parameters:
text - Unicode string
Returns:
Unicode string containing only US-ASCII characters
Throws:
UnsupportedEncodingException - if the encoding fails

public static String encodeText(String text, String charset, String encoding) throws java.io.UnsupportedEncodingException
根据 RFC 2047，将 RFC 822 "text" 标记编码为对于邮件安全的形式。

对于非 US-ASCII 字符，将检查给定的 Unicode 字符串。如果该字符串仅包含 US-ASCII 字符，则按原样返回。如果字符串包含非 US-ASCII 字符，它首先将使用指定的字符集进行字符编码，然后使用 B 或 Q 编码传输编码。所得字节将作为仅包含 ASCII 字符的 Unicode 字符串返回。

注意，此方法应该仅用于编码“非结构化”RFC 822 头。

text | 头值
charset | 字符集。如果此参数为 null，则使用平台的默认字符集。
encoding | 要使用的编码。当前支持的值为 "B" 和 "Q"。如果此参数为 null，则在大部分字符使用 ASCII 字符集编码时使用 "Q" 编码；其他情况使用 "B" 编码。
return | 仅包含 US-ASCII 字符的 Unicode 字符串
英文文档：

encodeText

public static String encodeText(String text,
                                String charset,
                                String encoding)
                         throws UnsupportedEncodingException
Encode a RFC 822 "text" token into mail-safe form as per RFC 2047.

The given Unicode string is examined for non US-ASCII characters. If the string contains only US-ASCII characters, it is returned as-is. If the string contains non US-ASCII characters, it is first character-encoded using the specified charset, then transfer-encoded using either the B or Q encoding. The resulting bytes are then returned as a Unicode string containing only ASCII characters.

Note that this method should be used to encode only "unstructured" RFC 822 headers.

Parameters:
text - the header value
charset - the charset. If this parameter is null, the platform's default chatset is used.
encoding - the encoding to be used. Currently supported values are "B" and "Q". If this parameter is null, then the "Q" encoding is used if most of characters to be encoded are in the ASCII charset, otherwise "B" encoding is used.
Returns:
Unicode string containing only US-ASCII characters
Throws:
UnsupportedEncodingException

public static String decodeText(String etext) throws java.io.UnsupportedEncodingException
解码“非结构化”头，即根据 RFC 822 定义为 '*text' 的头。

使用 RFC 2047 第 6.1 节中指定的算法对字符串进行解码。如果任何序列的字符集转换失败，则抛出 UnsupportedEncodingException。如果 String 不是 RFC 2047 样式的编码头，则按原样返回。

用法示例：

MimePart part = ...
String rawvalue = null;
String  value = null;
try {
if ((rawvalue = part.getHeader("X-mailer")[0]) != null)
value = MimeUtility.decodeText(rawvalue);
} catch (UnsupportedEncodingException e) {
// Don't care
value = rawvalue;
} catch (MessagingException me) { }

return value;

etext | 可能的编码值
Throws | java.io.UnsupportedEncodingException: 如果字符集转换失败。
英文文档：

decodeText

public static String decodeText(String etext)
                         throws UnsupportedEncodingException
Decode "unstructured" headers, that is, headers that are defined as '*text' as per RFC 822.

The string is decoded using the algorithm specified in RFC 2047, Section 6.1. If the charset-conversion fails for any sequence, an UnsupportedEncodingException is thrown. If the String is not an RFC 2047 style encoded header, it is returned as-is

Example of usage:

  MimePart part = ...
  String rawvalue = null;
  String  value = null;
  try {
    if ((rawvalue = part.getHeader("X-mailer")[0]) != null)
      value = MimeUtility.decodeText(rawvalue);
  } catch (UnsupportedEncodingException e) {
      // Don't care
      value = rawvalue;
  } catch (MessagingException me) { }

  return value;

Parameters:
etext - the possibly encoded value
Throws:
UnsupportedEncodingException - if the charset conversion failed.

public static String encodeWord(String word) throws java.io.UnsupportedEncodingException
根据 RFC 2047，将 RFC 822 "word" 标记编码为对于邮件安全的形式。

对于非 US-ASCII 字符，将检查给定的 Unicode 字符串。如果该字符串仅包含 US-ASCII 字符，则按原样返回。如果字符串包含非 US-ASCII 字符，它首先将使用平台的默认字符集进行字符编码，然后使用 B 或 Q 编码传输编码。所得字节将作为仅包含 ASCII 字符的 Unicode 字符串返回。

此方法在创建 RFC 822 "phrases" 时使用。例如，InternetAddress 类使用此方法编码其 'phrase' 组件。

word | Unicode 字符串
return | 仅包含 US-ASCII 字符的 Unicode 字符串数组。
Throws | java.io.UnsupportedEncodingException: 如果编码失败
英文文档：

encodeWord

public static String encodeWord(String word)
                         throws UnsupportedEncodingException
Encode a RFC 822 "word" token into mail-safe form as per RFC 2047.

The given Unicode string is examined for non US-ASCII characters. If the string contains only US-ASCII characters, it is returned as-is. If the string contains non US-ASCII characters, it is first character-encoded using the platform's default charset, then transfer-encoded using either the B or Q encoding. The resulting bytes are then returned as a Unicode string containing only ASCII characters.

This method is meant to be used when creating RFC 822 "phrases". The InternetAddress class, for example, uses this to encode it's 'phrase' component.

Parameters:
word - Unicode string
Returns:
Array of Unicode strings containing only US-ASCII characters.
Throws:
UnsupportedEncodingException - if the encoding fails

public static String encodeWord(String word, String charset, String encoding) throws java.io.UnsupportedEncodingException
根据 RFC 2047，将 RFC 822 "word" 标记编码为对于邮件安全的形式。

对于非 US-ASCII 字符，将检查给定的 Unicode 字符串。如果该字符串仅包含 US-ASCII 字符，则按原样返回。如果字符串包含非 US-ASCII 字符，它首先将使用指定的字符集进行字符编码，然后使用 B 或 Q 编码传输编码。所得字节将作为仅包含 ASCII 字符的 Unicode 字符串返回。

word | Unicode 字符串
charset | MIME 字符集
encoding | 要使用的编码。当前支持的值为 "B" 和 "Q"。如果此参数为 null，则在大部分字符使用 ASCII 字符集编码时使用 "Q" 编码；其他情况使用 "B" 编码。
return | 仅包含 US-ASCII 字符的 Unicode 字符串
Throws | java.io.UnsupportedEncodingException: 如果编码失败
英文文档：

encodeWord

public static String encodeWord(String word,
                                String charset,
                                String encoding)
                         throws UnsupportedEncodingException
Encode a RFC 822 "word" token into mail-safe form as per RFC 2047.

The given Unicode string is examined for non US-ASCII characters. If the string contains only US-ASCII characters, it is returned as-is. If the string contains non US-ASCII characters, it is first character-encoded using the specified charset, then transfer-encoded using either the B or Q encoding. The resulting bytes are then returned as a Unicode string containing only ASCII characters.

Parameters:
word - Unicode string
charset - the MIME charset
encoding - the encoding to be used. Currently supported values are "B" and "Q". If this parameter is null, then the "Q" encoding is used if most of characters to be encoded are in the ASCII charset, otherwise "B" encoding is used.
Returns:
Unicode string containing only US-ASCII characters
Throws:
UnsupportedEncodingException - if the encoding fails

public static String decodeWord(String eword) throws ParseException, java.io.UnsupportedEncodingException
使用 RFC 2047 中解析 "encoded-word" 的规则来解析字符串。如果解析失败，则抛出 ParseException。否则，对它进行传输解码，然后通过字符集转换变为 Unicode。如果字符集转换失败，则抛出 UnsupportedEncodingException。

eword | 编码值
Throws | ParseException: 如果字符串不是根据 RFC 2047 解析的 encoded-word
Throws | java.io.UnsupportedEncodingException: 如果字符集转换失败。
英文文档：

decodeWord

public static String decodeWord(String eword)
                         throws ParseException,
                                UnsupportedEncodingException
The string is parsed using the rules in RFC 2047 for parsing an "encoded-word". If the parse fails, a ParseException is thrown. Otherwise, it is transfer-decoded, and then charset-converted into Unicode. If the charset-conversion fails, an UnsupportedEncodingException is thrown.

Parameters:
eword - the encoded value
Throws:
ParseException - if the string is not an encoded-word as per RFC 2047.
UnsupportedEncodingException - if the charset conversion failed.

public static String quote(String word, String specials)
一个给单词加引号的实用工具方法，只要该单词包含指定 'specials' 列表中的任意字符即可。

HeaderTokenizer 类定义两组特殊的分界符 - MIME 和 RFC 822。

此方法通常在生成 RFC 822 和 MIME 头字段时使用。

word | 要加引号的单词
specials | 特殊字符的集合
return | 可能的引用单词
See also | MIME, RFC822
英文文档：

quote

public static String quote(String word,
                           String specials)
A utility method to quote a word, if the word contains any characters from the specified 'specials' list.

The HeaderTokenizer class defines two special sets of delimiters - MIME and RFC 822.

This method is typically used during the generation of RFC 822 and MIME header fields.

Parameters:
word - word to be quoted
specials - the set of special characters
Returns:
the possibly quoted word
See Also:
HeaderTokenizer.MIME, HeaderTokenizer.RFC822

public static String fold(int used, String s)
如果可能，在连续的空白处折叠字符串，使每行的字符数不大于 76 个。如果有 76 个以上的连续非空白字符，则字符串在此序列后的第一个空白处进行折叠。参数 used 指示在当前行中使用的字符数，它通常为头名称的长度。

注意，字符串中的换行符没有被转义；应该对它们进行转义。

used | 目前在行中使用的字符数
s | 要折叠的字符串
return | 已折叠的字符串
since
en
JavaMail 1.4
英文文档：

fold

public static String fold(int used,
                          String s)
Fold a string at linear whitespace so that each line is no longer than 76 characters, if possible. If there are more than 76 non-whitespace characters consecutively, the string is folded at the first whitespace after that sequence. The parameter used indicates how many characters have been used in the current line; it is usually the length of the header name.

Note that line breaks in the string aren't escaped; they probably should be.

Parameters:
used - characters used in line so far
s - the string to fold
Returns:
the folded string
Since:
JavaMail 1.4

public static String unfold(String s)
展开已折叠的头。移除所有未经转义的换行符和空格前面的换行符。
s | 要展开的字符串
return | 已展开的字符串
since
en
JavaMail 1.4
英文文档：

unfold

public static String unfold(String s)
Unfold a folded header. Any line breaks that aren't escaped and are followed by whitespace are removed.

Parameters:
s - the string to unfold
Returns:
the unfolded string
Since:
JavaMail 1.4

public static String javaCharset(String charset)
将 MIME 字符集名称转换为有效的 Java 字符集名称。

charset | MIME 字符集名称
return | 等效的 Java 字符集。如果没有可用的合适映射，则传入的字符集就是返回的字符集。
英文文档：

javaCharset

public static String javaCharset(String charset)
Convert a MIME charset name into a valid Java charset name.

Parameters:
charset - the MIME charset name
Returns:
the Java charset equivalent. If a suitable mapping is not available, the passed in charset is itself returned.

public static String mimeCharset(String charset)
将 Java 字符集转换为它的 MIME 字符集名称。

注意，以后的 JDK 版本（1.2 以后）可能会提供此功能，届时将不再需要此方法。

charset | JDK 字符集
return | MIME/IANA 等效字符集。如果没有合适映射，则传入的字符集就是返回的字符集。
since
en
JavaMail 1.1
英文文档：

mimeCharset

public static String mimeCharset(String charset)
Convert a java charset into its MIME charset name.

Note that a future version of JDK (post 1.2) might provide this functionality, in which case, we may deprecate this method then.

Parameters:
charset - the JDK charset
Returns:
the MIME/IANA equivalent. If a mapping is not possible, the passed in charset itself is returned.
Since:
JavaMail 1.1

public static String getDefaultJavaCharset()
获取与系统的当前默认语言环境对应的默认字符集。如果设置了 mail.mime.charset 系统属性，则返回与此 MIME 字符集对应的系统字符集。

return 系统默认语言环境的默认字符集，作为 Java 字符集。（不是 MIME 字符集）
since
en
JavaMail 1.1
英文文档：

getDefaultJavaCharset

public static String getDefaultJavaCharset()
Get the default charset corresponding to the system's current default locale. If the System property mail.mime.charset is set, a system charset corresponding to this MIME charset will be returned.

Returns:
the default charset of the system's default locale, as a Java charset. (NOT a MIME charset)
Since:
JavaMail 1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NewsAddress (Java EE 5)

javax.mail.internet
Class NewsAddress

java.lang.Object
    extended by  javax.mail.Address
        extended by  javax.mail.internet.NewsAddress
All Implemented Interfaces:
Serializable
public class NewsAddress
extends Address

Extends: Address

此类模拟 RFC1036 新闻组地址。
英文文档：

This class models an RFC1036 newsgroup address.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected String | host
protected String | newsgroup
Constructor Summary
NewsAddress()
Default constructor.
NewsAddress(String newsgroup)
Construct a NewsAddress with the given newsgroup.
NewsAddress(String newsgroup, String host)
Construct a NewsAddress with the given newsgroup and host.
Method Summary
boolean | equals(Object a) The equality operator.
String | getHost() Get the host.
String | getNewsgroup() Get the newsgroup.
String | getType() Return the type of this address.
int | hashCode() Compute a hash code for the address.
static NewsAddress[] | parse(String newsgroups) Parse the given comma separated sequence of newsgroup into NewsAddress objects.
void | setHost(String host) Set the host.
void | setNewsgroup(String newsgroup) Set the newsgroup.
String | toString() Convert this address into a RFC 1036 address.
static String | toString(Address[] addresses) Convert the given array of NewsAddress objects into a comma separated sequence of address strings.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

newsgroup

protected String newsgroup

英文文档：

host

protected String host
Constructor Detail

public NewsAddress()
默认构造方法。
英文文档：

NewsAddress

public NewsAddress()
Default constructor.

public NewsAddress(String newsgroup)
构造带给定新闻组的 NewsAddress。
newsgroup 新闻组
英文文档：

NewsAddress

public NewsAddress(String newsgroup)
Construct a NewsAddress with the given newsgroup.

Parameters:
newsgroup - the newsgroup

public NewsAddress(String newsgroup, String host)
构造带给定新闻组和主机的 NewsAddress。
newsgroup | 新闻组
host | 主机
英文文档：

NewsAddress

public NewsAddress(String newsgroup,
                   String host)
Construct a NewsAddress with the given newsgroup and host.

Parameters:
newsgroup - the newsgroup
host - the host
Method Detail

public String getType()
返回此地址的类型。NewsAddress 的类型为 "news"。
英文文档：

getType

public String getType()
Return the type of this address. The type of a NewsAddress is "news".

Specified by:
getType in class Address
Returns:
address type
See Also:
InternetAddress

public void setNewsgroup(String newsgroup)
设置新闻组。
newsgroup 新闻组
英文文档：

setNewsgroup

public void setNewsgroup(String newsgroup)
Set the newsgroup.

Parameters:
newsgroup - the newsgroup

public String getNewsgroup()
获取新闻组。
return 新闻组
英文文档：

getNewsgroup

public String getNewsgroup()
Get the newsgroup.

Returns:
newsgroup

public void setHost(String host)
设置主机。
host 主机
英文文档：

setHost

public void setHost(String host)
Set the host.

Parameters:
host - the host

public String getHost()
获取主机。
return 主机
英文文档：

getHost

public String getHost()
Get the host.

Returns:
host

public String toString()
将此地址转换为 RFC 1036 地址。
return 新闻组
英文文档：

toString

public String toString()
Convert this address into a RFC 1036 address.

Specified by:
toString in class Address
Returns:
newsgroup

public boolean equals(Object a)
相等性运算符。
英文文档：

equals

public boolean equals(Object a)
The equality operator.

Specified by:
equals in class Address
Parameters:
a - Address object

public int hashCode()
计算地址的哈希码。
英文文档：

hashCode

public int hashCode()
Compute a hash code for the address.

Overrides:
hashCode in class Object

public static String toString(Address[] addresses)
将给定的 NewsAddress 对象数组转换为以逗号分隔的地址字符串序列。所得字符串仅包含 US-ASCII 字符，因此对于邮件是安全的。
addresses | NewsAddress 对象数组
Throws | ClassCastException,: 如果给定数组中的任何地址对象不是 NewsAddress 对象。注意，这是一个 RuntimeException。
return | 以逗号分隔的地址字符串
英文文档：

toString

public static String toString(Address[] addresses)
Convert the given array of NewsAddress objects into a comma separated sequence of address strings. The resulting string contains only US-ASCII characters, and hence is mail-safe.

Parameters:
addresses - array of NewsAddress objects
Returns:
comma separated address strings
Throws:
ClassCastException, - if any address object in the given array is not a NewsAddress objects. Note that this is a RuntimeException.

public static NewsAddress[] parse(String newsgroups) throws AddressException
将给定的以逗号分隔的新闻组序列解析为 NewsAddress 对象。
newsgroups | 以逗号分隔的新闻组字符串
return | NewsAddress 对象数组
Throws | AddressException: 如果解析失败
英文文档：

parse

public static NewsAddress[] parse(String newsgroups)
                           throws AddressException
Parse the given comma separated sequence of newsgroup into NewsAddress objects.

Parameters:
newsgroups - comma separated newsgroup string
Returns:
array of NewsAddress objects
Throws:
AddressException - if the parse failed
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterList (Java EE 5)

javax.mail.internet
Class ParameterList

java.lang.Object
    extended by  javax.mail.internet.ParameterList

public class ParameterList
extends Object

此类保存 MIME 参数（属性-值对）。mail.mime.encodeparameters 和 mail.mime.decodeparameters 系统属性控制是否支持 RFC 2231 指定的编码参数。默认情况下，不支持此类编码参数。

而且，在当前实现中将系统属性 mail.mime.decodeparameters.strict 设置为 "true" 将导致在解码已编码参数期间检测到错误时抛出 ParseException。默认情况下，如果发生任何解码错误，则使用原来的（未解码的）字符串。

version 1.17, 07/05/04
英文文档：

This class holds MIME parameters (attribute-value pairs). The mail.mime.encodeparameters and mail.mime.decodeparameters System properties control whether encoded parameters, as specified by RFC 2231, are supported. By default, such encoded parameters are not supported.

Also, in the current implementation, setting the System property mail.mime.decodeparameters.strict to "true" will cause a ParseException to be thrown for errors detected while decoding encoded parameters. By default, if any decoding errors occur, the original (undecoded) string is used.

Version:
1.17, 07/05/04
Author:
John Mani, Bill Shannon

Constructor Summary
ParameterList()
No-arg Constructor.
ParameterList(String s)
Constructor that takes a parameter-list string.
Method Summary
String | get(String name) Returns the value of the specified parameter.
Enumeration | getNames() Return an enumeration of the names of all parameters in this list.
void | remove(String name) Removes the specified parameter from this ParameterList.
void | set(String name, String value) Set a parameter.
void | set(String name, String value, String charset) Set a parameter.
int | size() Return the number of parameters in this list.
String | toString() Convert this ParameterList into a MIME String.
String | toString(int used) Convert this ParameterList into a MIME String.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ParameterList()
无参数构造方法。
英文文档：

ParameterList

public ParameterList()
No-arg Constructor.

public ParameterList(String s) throws ParseException
带参数列表字符串的构造方法。String 被解析，参数将在内部收集和存储。如果解析失败，则抛出 ParseException。注意，空参数列表字符串是有效的，它将被解析为空 ParameterList。
s | 参数列表字符串。
Throws | ParseException: 如果解析失败。
英文文档：

ParameterList

public ParameterList(String s)
              throws ParseException
Constructor that takes a parameter-list string. The String is parsed and the parameters are collected and stored internally. A ParseException is thrown if the parse fails. Note that an empty parameter-list string is valid and will be parsed into an empty ParameterList.

Parameters:
s - the parameter-list string.
Throws:
ParseException - if the parse fails.
Method Detail

public int size()
返回此列表中的参数数量。
return 参数的数量。
英文文档：

size

public int size()
Return the number of parameters in this list.

Returns:
number of parameters.

public String get(String name)
返回指定参数的值。注意，参数名称不区分大小写。
name | 参数名称。
return | 参数值。如果此参数不存在，则返回 null。
英文文档：

get

public String get(String name)
Returns the value of the specified parameter. Note that parameter names are case-insensitive.

Parameters:
name - parameter name.
Returns:
Value of the parameter. Returns null if the parameter is not present.

public void set(String name, String value)
设置参数。如果此参数已经存在，则使用此新值替代它。
name | 参数名称。
value | 参数值。
英文文档：

set

public void set(String name,
                String value)
Set a parameter. If this parameter already exists, it is replaced by this new value.

Parameters:
name - name of the parameter.
value - value of the parameter.

public void set(String name, String value, String charset)
设置参数。如果此参数已经存在，则使用此新值替代它。如果 mail.mime.encodeparameters 系统属性为 true，且参数值为非 ASCII，则使用 RFC 2231 指定的字符集对此参数进行编码。
name | 参数名称。
value | 参数值。
charset | 参数值的字符集。
since
en
JavaMail 1.4
英文文档：

set

public void set(String name,
                String value,
                String charset)
Set a parameter. If this parameter already exists, it is replaced by this new value. If the mail.mime.encodeparameters System property is true, and the parameter value is non-ASCII, it will be encoded with the specified charset, as specified by RFC 2231.

Parameters:
name - name of the parameter.
value - value of the parameter.
charset - charset of the parameter value.
Since:
JavaMail 1.4

public void remove(String name)
从此 ParameterList 中移除指定的参数。如果此参数不存在，则此方法不执行任何操作。
name 参数名称。
英文文档：

remove

public void remove(String name)
Removes the specified parameter from this ParameterList. This method does nothing if the parameter is not present.

Parameters:
name - name of the parameter.

public java.util.Enumeration<E> getNames()
返回此列表中所有参数名称的枚举。
return 此列表中所有参数名称的枚举。
英文文档：

getNames

public Enumeration getNames()
Return an enumeration of the names of all parameters in this list.

Returns:
Enumeration of all parameter names in this list.

public String toString()
将此 ParameterList 转换为 MIME String。如果为空列表，则返回空字符串。
return 字符串
英文文档：

toString

public String toString()
Convert this ParameterList into a MIME String. If this is an empty list, an empty string is returned.

Overrides:
toString in class Object
Returns:
String

public String toString(int used)
将此 ParameterList 转换为 MIME String。如果为空列表，则返回空字符串。 'used' 参数指定要插入所得参数列表的字段中已经使用的字符位置编号。它用于确定折叠所得参数列表的位置。
used | 要插入参数列表的字段中已经使用的字符位置编号。
return | 字符串
英文文档：

toString

public String toString(int used)
Convert this ParameterList into a MIME String. If this is an empty list, an empty string is returned. The 'used' parameter specifies the number of character positions already taken up in the field into which the resulting parameter list is to be inserted. It's used to determine where to fold the resulting parameter list.

Parameters:
used - number of character positions already used, in the field into which the parameter list is to be inserted.
Returns:
String
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PreencodedMimeBodyPart (Java EE 5)

javax.mail.internet
Class PreencodedMimeBodyPart

java.lang.Object
    extended by  javax.mail.BodyPart
        extended by  javax.mail.internet.MimeBodyPart
            extended by  javax.mail.internet.PreencodedMimeBodyPart
All Implemented Interfaces:
MimePart, Part
public class PreencodedMimeBodyPart
extends MimeBodyPart

Extends: BodyPart > MimeBodyPart

处理已编码数据的 MimeBodyPart。此类在构造消息并附加已编码（例如，使用 base64 编码）数据时很有用。数据可能已经通过应用程序进行编码，也可能已经以编码形式存储在文件或数据库中。在创建此对象时提供编码。数据通过使用 setText、setContent 或 setDataHandler 方法以常规方式连接到此对象。
since
en
JavaMail 1.4
英文文档：

A MimeBodyPart that handles data that has already been encoded. This class is useful when constructing a message and attaching data that has already been encoded (for example, using base64 encoding). The data may have been encoded by the application, or may have been stored in a file or database in encoded form. The encoding is supplied when this object is created. The data is attached to this object in the usual fashion, by using the setText, setContent, or setDataHandler methods.

Since:
JavaMail 1.4

Field Summary
Fields inherited from class javax.mail.internet.MimeBodyPart
content, contentStream, dh, headers
Fields inherited from class javax.mail.BodyPart
parent
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
Constructor Summary
PreencodedMimeBodyPart(String encoding)
Create a PreencodedMimeBodyPart that assumes the data is encoded using the specified encoding.
Method Summary
String | getEncoding() Returns the content transfer encoding specified when this object was created.
protected void | updateHeaders() Force the Content-Transfer-Encoding header to use the encoding that was specified when this object was created.
void | writeTo(OutputStream os) Output the body part as an RFC 822 format stream.
Methods inherited from class javax.mail.internet.MimeBodyPart
addHeader, addHeaderLine, attachFile, attachFile, getAllHeaderLines, getAllHeaders, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getSize, isMimeType, removeHeader, saveFile, saveFile, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setHeader, setText, setText, setText
Methods inherited from class javax.mail.BodyPart
getParent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public PreencodedMimeBodyPart(String encoding)
创建一个 PreencodedMimeBodyPart，它假定数据使用指定的编码进行编码。编码必须是支持 MIME 的 Content-Transfer-Encoding。
英文文档：

PreencodedMimeBodyPart

public PreencodedMimeBodyPart(String encoding)
Create a PreencodedMimeBodyPart that assumes the data is encoded using the specified encoding. The encoding must be a MIME supported Content-Transfer-Encoding.

Method Detail

public String getEncoding() throws MessagingException
返回创建此对象时所指定的内容传输编码。
英文文档：

getEncoding

public String getEncoding()
                   throws MessagingException
Returns the content transfer encoding specified when this object was created.

Specified by:
getEncoding in interface MimePart
Overrides:
getEncoding in class MimeBodyPart
Returns:
content-transfer-encoding
Throws:
MessagingException
See Also:
MimeBodyPart.headers

public void writeTo(java.io.OutputStream os) throws java.io.IOException, MessagingException
以 RFC 822 格式流的形式输出正文部分。
Throws | MessagingException:
Throws | java.io.IOException: 如果写入流时发生错误，或者 javax.activation 层发生错误。
See also | writeTo
英文文档：

writeTo

public void writeTo(OutputStream os)
             throws IOException,
                    MessagingException
Output the body part as an RFC 822 format stream.

Specified by:
writeTo in interface Part
Overrides:
writeTo in class MimeBodyPart
Throws:
MessagingException
IOException - if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
See Also:
DataHandler.writeTo(java.io.OutputStream)

protected void updateHeaders() throws MessagingException
强制 Content-Transfer-Encoding 头使用创建此对象时所指定的编码。
英文文档：

updateHeaders

protected void updateHeaders()
                      throws MessagingException
Force the Content-Transfer-Encoding header to use the encoding that was specified when this object was created.

Overrides:
updateHeaders in class MimeBodyPart
Throws:
MessagingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AddressException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.internet
Class AddressException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.internet.ParseException
                    extended by  javax.mail.internet.AddressException
All Implemented Interfaces:
Serializable
public class AddressException
extends ParseException

Extends: Throwable > Exception > MessagingException > ParseException

遇到格式错误的地址时抛出的异常。
英文文档：

The exception thrown when a wrongly formatted address is encountered.

Author:
Bill Shannon, Max Spivak
See Also:
Serialized Form

Field Summary
protected int | pos The index in the string where the error occurred, or -1 if not known.
protected String | ref The string being parsed.
Constructor Summary
AddressException()
Constructs an AddressException with no detail message.
AddressException(String s)
Constructs an AddressException with the specified detail message.
AddressException(String s, String ref)
Constructs an AddressException with the specified detail message and reference info.
AddressException(String s, String ref, int pos)
Constructs an AddressException with the specified detail message and reference info.
Method Summary
int | getPos() Get the position with the reference string where the error was detected (-1 if not relevant).
String | getRef() Get the string that was being parsed when the error was detected (null if not relevant).
String | toString() Override toString method to provide information on nested exceptions.
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, 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

英文文档：

ref

protected String ref
The string being parsed.

英文文档：

pos

protected int pos
The index in the string where the error occurred, or -1 if not known.

Constructor Detail

public AddressException()
构造不带详细消息的 AddressException。
英文文档：

AddressException

public AddressException()
Constructs an AddressException with no detail message.

public AddressException(String s)
构造带指定详细消息的 AddressException。
s 详细信息
英文文档：

AddressException

public AddressException(String s)
Constructs an AddressException with the specified detail message.

Parameters:
s - the detail message

public AddressException(String s, String ref)
构造带指定详细消息和参考信息的 AddressException。
s 详细信息
英文文档：

AddressException

public AddressException(String s,
                        String ref)
Constructs an AddressException with the specified detail message and reference info.

Parameters:
s - the detail message

public AddressException(String s, String ref, int pos)
构造带指定详细消息和参考信息的 AddressException。
s 详细信息
英文文档：

AddressException

public AddressException(String s,
                        String ref,
                        int pos)
Constructs an AddressException with the specified detail message and reference info.

Parameters:
s - the detail message
Method Detail

public String getRef()
获取当检测到错误时正被解析的字符串（如果不相关，则为 null）。
英文文档：

getRef

public String getRef()
Get the string that was being parsed when the error was detected (null if not relevant).

public int getPos()
获取检测到错误的引用字符串的位置（如果不相关，则为 -1）。
英文文档：

getPos

public int getPos()
Get the position with the reference string where the error was detected (-1 if not relevant).

public String toString()
英文文档：

toString

public String toString()
Description copied from class: MessagingException
Override toString method to provide information on nested exceptions.

Overrides:
toString in class MessagingException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ParseException (Java EE 5)

javax.mail.internet
Class ParseException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.internet.ParseException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AddressException
public class ParseException
extends MessagingException

Extends: Throwable > Exception > MessagingException
Extended by: AddressException

由于解析 RFC822 或 MIME 头出现错误而抛出的异常。
英文文档：

The exception thrown due to an error in parsing RFC822 or MIME headers

Author:
John Mani
See Also:
Serialized Form

Constructor Summary
ParseException()
Constructs a ParseException with no detail message.
ParseException(String s)
Constructs a ParseException with the specified detail message.
Method Summary
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ParseException()
构造不带详细消息的 ParseException。
英文文档：

ParseException

public ParseException()
Constructs a ParseException with no detail message.

public ParseException(String s)
构造带指定详细消息的 ParseException。
s 详细信息
英文文档：

ParseException

public ParseException(String s)
Constructs a ParseException with the specified detail message.

Parameters:
s - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.mail.search (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.mail.search

Message search terms for the JavaMail API.

See:
Description

Class Summary
AddressStringTerm | This abstract class implements string comparisons for Message addresses.
AddressTerm | This class implements Message Address comparisons.
AndTerm | This class implements the logical AND operator on individual SearchTerms.
BodyTerm | This class implements searches on a Message Body.
ComparisonTerm | This class models the comparison operator.
DateTerm | This class implements comparisons for Dates
FlagTerm | This class implements comparisons for Message Flags.
FromStringTerm | This class implements string comparisons for the From Address header.
FromTerm | This class implements comparisons for the From Address header.
HeaderTerm | This class implements comparisons for Message headers.
IntegerComparisonTerm | This class implements comparisons for integers.
MessageIDTerm | This term models the RFC822 "MessageId" - a message-id for Internet messages that is supposed to be unique per message.
MessageNumberTerm | This class implements comparisons for Message numbers.
NotTerm | This class implements the logical NEGATION operator.
OrTerm | This class implements the logical OR operator on individual SearchTerms.
ReceivedDateTerm | This class implements comparisons for the Message Received date
RecipientStringTerm | This class implements string comparisons for the Recipient Address headers.
RecipientTerm | This class implements comparisons for the Recipient Address headers.
SearchTerm | Search criteria are expressed as a tree of search-terms, forming a parse-tree for the search expression.
SentDateTerm | This class implements comparisons for the Message SentDate.
SizeTerm | This class implements comparisons for Message sizes.
StringTerm | This class implements the match method for Strings.
SubjectTerm | This class implements comparisons for the Message Subject header.

Exception Summary
SearchException The exception thrown when a Search expression could not be handled.

Package javax.mail.search Description

Message search terms for the JavaMail API. This package defines classes that can be used to construct a search expression to search a folder for messages matching the expression; see the search method on javax.mail.Folder. See SearchTerm.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.mail.search Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.mail.search

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.mail.search.SearchTerm (implements java.io.Serializable)
      • javax.mail.search.AddressTerm
        • javax.mail.search.FromTerm
        • javax.mail.search.RecipientTerm
      • javax.mail.search.AndTerm
      • javax.mail.search.ComparisonTerm
        • javax.mail.search.DateTerm
          • javax.mail.search.ReceivedDateTerm
          • javax.mail.search.SentDateTerm
        • javax.mail.search.IntegerComparisonTerm
          • javax.mail.search.MessageNumberTerm
          • javax.mail.search.SizeTerm
      • javax.mail.search.FlagTerm
      • javax.mail.search.NotTerm
      • javax.mail.search.OrTerm
      • javax.mail.search.StringTerm
        • javax.mail.search.AddressStringTerm
          • javax.mail.search.FromStringTerm
          • javax.mail.search.RecipientStringTerm
        • javax.mail.search.BodyTerm
        • javax.mail.search.HeaderTerm
        • javax.mail.search.MessageIDTerm
        • javax.mail.search.SubjectTerm
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.mail.MessagingException
          • javax.mail.search.SearchException
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


AddressStringTerm (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.search
Class AddressStringTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
            extended by  javax.mail.search.AddressStringTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FromStringTerm, RecipientStringTerm
public abstract class AddressStringTerm
extends StringTerm

Extends: SearchTerm > StringTerm
Extended by: FromStringTerm, RecipientStringTerm

此抽象类实现 Message 地址的字符串比较。

注意，此类与 AddressTerm 类不同，此类比较的是地址字符串，而不是 Address 对象。

since
en
JavaMail 1.1
英文文档：

This abstract class implements string comparisons for Message addresses.

Note that this class differs from the AddressTerm class in that this class does comparisons on address strings rather than Address objects.

Since:
JavaMail 1.1
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
Constructor Summary
protected AddressStringTerm(String pattern)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
protected boolean | match(Address a) Check whether the address pattern specified in the constructor is a substring of the string representation of the given Address object.
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, hashCode, match
Methods inherited from class javax.mail.search.SearchTerm
match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected AddressStringTerm(String pattern)
构造方法。
pattern 要比较的地址模式。
英文文档：

AddressStringTerm

protected AddressStringTerm(String pattern)
Constructor.

Parameters:
pattern - the address pattern to be compared.
Method Detail

protected boolean match(Address a)
检查在构造方法中指定的地址模式是否是给定 Address 对象的字符串表示形式的子字符串。

注意，如果给定 Address 对象的字符串表示形式包含字符集或传输编码，那么在匹配过程中必须将编码考虑在内。

a | 比较将应用于此 Address 对象。
return | 如果匹配成功，则返回 true；否则返回 false。
英文文档：

match

protected boolean match(Address a)
Check whether the address pattern specified in the constructor is a substring of the string representation of the given Address object.

Note that if the string representation of the given Address object contains charset or transfer encodings, the encodings must be accounted for, during the match process.

Parameters:
a - The comparison is applied to this Address object.
Returns:
true if the match succeeds, otherwise false.

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class StringTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AddressTerm (Java EE 5)

javax.mail.search
Class AddressTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.AddressTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FromTerm, RecipientTerm
public abstract class AddressTerm
extends SearchTerm

Extends: SearchTerm
Extended by: FromTerm, RecipientTerm

此类实现 Message Address 比较。
英文文档：

This class implements Message Address comparisons.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  Address address
The address.
Constructor Summary
protected AddressTerm(Address address)
Method Summary
boolean | equals(Object obj) Equality comparison.
Address | getAddress() Return the address to match with.
int | hashCode() Compute a hashCode for this object.
protected boolean | match(Address a) Match against the argument Address.
Methods inherited from class javax.mail.search.SearchTerm
match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

address

protected Address address
The address.

Constructor Detail

protected AddressTerm(Address address)
英文文档：

AddressTerm

protected AddressTerm(Address address)
Method Detail

public Address getAddress()
返回要匹配的地址。
英文文档：

getAddress

public Address getAddress()
Return the address to match with.

protected boolean match(Address a)
与参数 Address 进行匹配。
英文文档：

match

protected boolean match(Address a)
Match against the argument Address.

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class Object

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AndTerm (Java EE 5)

javax.mail.search
Class AndTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.AndTerm
All Implemented Interfaces:
Serializable
public final class AndTerm
extends SearchTerm

Extends: SearchTerm

此类实现单个 SearchTermsThis 上的逻辑 AND 运算符。
英文文档：

This class implements the logical AND operator on individual SearchTerms.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  SearchTerm[] terms
The array of terms on which the AND operator should be applied.
Constructor Summary
AndTerm(SearchTerm[] t)
Constructor that takes an array of SearchTerms.
AndTerm(SearchTerm t1, SearchTerm t2)
Constructor that takes two terms.
Method Summary
boolean | equals(Object obj) Equality comparison.
SearchTerm[] | getTerms() Return the search terms.
int | hashCode() Compute a hashCode for this object.
boolean | match(Message msg) The AND operation.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

terms

protected SearchTerm[] terms
The array of terms on which the AND operator should be applied.

Constructor Detail

public AndTerm(SearchTerm t1, SearchTerm t2)
带有两个条目的构造方法。
t1 | 第一个条目
t2 | 第二个条目
英文文档：

AndTerm

public AndTerm(SearchTerm t1,
               SearchTerm t2)
Constructor that takes two terms.

Parameters:
t1 - first term
t2 - second term

public AndTerm(SearchTerm[] t)
带 SearchTerm 数组的构造方法。
t 条目数组
英文文档：

AndTerm

public AndTerm(SearchTerm[] t)
Constructor that takes an array of SearchTerms.

Parameters:
t - array of terms
Method Detail

public SearchTerm[] getTerms()
返回搜索条目。
英文文档：

getTerms

public SearchTerm[] getTerms()
Return the search terms.

public boolean match(Message msg)
AND 操作。

构造方法中指定的条目将应用于给定的对象，AND 运算符应用于这些条目的结果。

msg | 指定的 SearchTerm 将应用于此 Message，AND 运算符应用于其结果。
return | 如果 AND 运算成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The AND operation.

The terms specified in the constructor are applied to the given object and the AND operator is applied to their results.

Specified by:
match in class SearchTerm
Parameters:
msg - The specified SearchTerms are applied to this Message and the AND operator is applied to their results.
Returns:
true if the AND succeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class Object

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BodyTerm (Java EE 5)

javax.mail.search
Class BodyTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
            extended by  javax.mail.search.BodyTerm
All Implemented Interfaces:
Serializable
public final class BodyTerm
extends StringTerm

Extends: SearchTerm > StringTerm

此类实现对 Message Body 的搜索。搜索 MIME 类型为 "text/*" 的消息的所有部分。
英文文档：

This class implements searches on a Message Body. All parts of the message that are of MIME type "text/*" are searched.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
Constructor Summary
BodyTerm(String pattern)
Constructor
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public BodyTerm(String pattern)
Constructor
pattern 要搜索的 String
英文文档：

BodyTerm

public BodyTerm(String pattern)
Constructor

Parameters:
pattern - The String to search for
Method Detail

public boolean match(Message msg)
匹配方法。
msg | 模式搜索将应用于此 Message 的正文
return | 如果找到该模式，返回 true；否则返回 false
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - The pattern search is applied on this Message's body
Returns:
true if the pattern is found; otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class StringTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ComparisonTerm (Java EE 5)

javax.mail.search
Class ComparisonTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.ComparisonTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DateTerm, IntegerComparisonTerm
public abstract class ComparisonTerm
extends SearchTerm

Extends: SearchTerm
Extended by: DateTerm, IntegerComparisonTerm

此类模拟比较运算符。这是一个抽象类；子类实现对不同数据类型的比较。
英文文档：

This class models the comparison operator. This is an abstract class; subclasses implement comparisons for different datatypes.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected int | comparison The comparison.
static int | EQ
static int | GE
static int | GT
static int | LE
static int | LT
static int | NE
Constructor Summary
ComparisonTerm()
Method Summary
boolean | equals(Object obj) Equality comparison.
int | hashCode() Compute a hashCode for this object.
Methods inherited from class javax.mail.search.SearchTerm
match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

LE

public static final int LE
See Also:
Constant Field Values

英文文档：

LT

public static final int LT
See Also:
Constant Field Values

英文文档：

EQ

public static final int EQ
See Also:
Constant Field Values

英文文档：

NE

public static final int NE
See Also:
Constant Field Values

英文文档：

GT

public static final int GT
See Also:
Constant Field Values

英文文档：

GE

public static final int GE
See Also:
Constant Field Values

英文文档：

comparison

protected int comparison
The comparison.

Constructor Detail

public ComparisonTerm()
英文文档：

ComparisonTerm

public ComparisonTerm()
Method Detail

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class Object

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DateTerm (Java EE 5)

javax.mail.search
Class DateTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.ComparisonTerm
            extended by  javax.mail.search.DateTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ReceivedDateTerm, SentDateTerm
public abstract class DateTerm
extends ComparisonTerm

Extends: SearchTerm > ComparisonTerm
Extended by: ReceivedDateTerm, SentDateTerm

此类实现 Date 的比较。
英文文档：

This class implements comparisons for Dates

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  Date date
The date.
Fields inherited from class javax.mail.search.ComparisonTerm
comparison, EQ, GE, GT, LE, LT, NE
Constructor Summary
protected DateTerm(int comparison, Date date)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
int | getComparison() Return the type of comparison.
Date | getDate() Return the Date to compare with.
int | hashCode() Compute a hashCode for this object.
protected boolean | match(Date d) The date comparison method.
Methods inherited from class javax.mail.search.SearchTerm
match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

date

protected Date date
The date.

Constructor Detail

protected DateTerm(int comparison, java.util.Date date)
构造方法。
comparison | 比较类型
date | 要进行比较的 Date
英文文档：

DateTerm

protected DateTerm(int comparison,
                   Date date)
Constructor.

Parameters:
comparison - the comparison type
date - The Date to be compared against
Method Detail

public java.util.Date getDate()
返回要与之比较的 Date。
英文文档：

getDate

public Date getDate()
Return the Date to compare with.

public int getComparison()
返回比较类型。
英文文档：

getComparison

public int getComparison()
Return the type of comparison.

protected boolean match(java.util.Date d)
日期比较方法。
d | 将构造方法中的日期与此日期进行比较
return | 如果日期匹配，返回 true；否则返回 false
英文文档：

match

protected boolean match(Date d)
The date comparison method.

Parameters:
d - the date in the constructor is compared with this date
Returns:
true if the dates match, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class ComparisonTerm

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class ComparisonTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FlagTerm (Java EE 5)

javax.mail.search
Class FlagTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.FlagTerm
All Implemented Interfaces:
Serializable
public final class FlagTerm
extends SearchTerm

Extends: SearchTerm

此类实现 Message Flag 的比较。
英文文档：

This class implements comparisons for Message Flags.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected Flags | flags Flags object containing the flags to test.
protected boolean | set Indicates whether to test for the presence or absence of the specified Flag.
Constructor Summary
FlagTerm(Flags flags, boolean set)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
Flags | getFlags() Return the Flags to test.
boolean | getTestSet() Return true if testing whether the flags are set.
int | hashCode() Compute a hashCode for this object.
boolean | match(Message msg) The comparison method.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

set

protected boolean set
Indicates whether to test for the presence or absence of the specified Flag. If true, then test whether all the specified flags are present, else test whether all the specified flags are absent.

英文文档：

flags

protected Flags flags
Flags object containing the flags to test.

Constructor Detail

public FlagTerm(Flags flags, boolean set)
构造方法。
flags | 包含要检查的标志的 Flag 对象
set | 要检查的标志设置
英文文档：

FlagTerm

public FlagTerm(Flags flags,
                boolean set)
Constructor.

Parameters:
flags - Flags object containing the flags to check for
set - the flag setting to check for
Method Detail

public Flags getFlags()
返回要测试的 Flag。
英文文档：

getFlags

public Flags getFlags()
Return the Flags to test.

public boolean getTestSet()
如果正在测试是否设置了标志，返回 true。
英文文档：

getTestSet

public boolean getTestSet()
Return true if testing whether the flags are set.

public boolean match(Message msg)
比较方法。
msg | 标志比较将应用于此 Message
return | 如果比较成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The comparison method.

Specified by:
match in class SearchTerm
Parameters:
msg - The flag comparison is applied to this Message
Returns:
true if the comparson succeeds, otherwise false.

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class Object

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FromStringTerm (Java EE 5)

javax.mail.search
Class FromStringTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
            extended by  javax.mail.search.AddressStringTerm
                extended by  javax.mail.search.FromStringTerm
All Implemented Interfaces:
Serializable
public final class FromStringTerm
extends AddressStringTerm

Extends: SearchTerm > StringTerm > AddressStringTerm

此类实现 From Address 头的字符串比较。

注意，此类与 FromTerm 不同，此类比较的是地址字符串，而不是 Address 对象。字符串比较是不区分大小写的。

since
en
JavaMail 1.1
英文文档：

This class implements string comparisons for the From Address header.

Note that this class differs from the FromTerm class in that this class does comparisons on address strings rather than Address objects. The string comparisons are case-insensitive.

Since:
JavaMail 1.1
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
Constructor Summary
FromStringTerm(String pattern)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) Check whether the address string specified in the constructor is a substring of the From address of this Message.
Methods inherited from class javax.mail.search.AddressStringTerm
match
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FromStringTerm(String pattern)
构造方法。
pattern 要比较的地址模式。
英文文档：

FromStringTerm

public FromStringTerm(String pattern)
Constructor.

Parameters:
pattern - the address pattern to be compared.
Method Detail

public boolean match(Message msg)
检查构造方法中指定的地址字符串是否是此 Message 的 From 地址的子字符串。
msg | 比较将应用于此 Message 的 From 地址。
return | 如果匹配成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
Check whether the address string specified in the constructor is a substring of the From address of this Message.

Specified by:
match in class SearchTerm
Parameters:
msg - The comparison is applied to this Message's From address.
Returns:
true if the match succeeds, otherwise false.

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class AddressStringTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FromTerm (Java EE 5)

javax.mail.search
Class FromTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.AddressTerm
            extended by  javax.mail.search.FromTerm
All Implemented Interfaces:
Serializable
public final class FromTerm
extends AddressTerm

Extends: SearchTerm > AddressTerm

此类实现 From Address 头部的比较。
英文文档：

This class implements comparisons for the From Address header.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.AddressTerm
address
Constructor Summary
FromTerm(Address address)
Constructor
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The address comparator.
Methods inherited from class javax.mail.search.AddressTerm
getAddress, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FromTerm(Address address)
Constructor
address 要比较的 Address
英文文档：

FromTerm

public FromTerm(Address address)
Constructor

Parameters:
address - The Address to be compared
Method Detail

public boolean match(Message msg)
地址比较器。
msg | 地址比较将应用于此 Message
return | 如果比较成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The address comparator.

Specified by:
match in class SearchTerm
Parameters:
msg - The address comparison is applied to this Message
Returns:
true if the comparison succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class AddressTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HeaderTerm (Java EE 5)

javax.mail.search
Class HeaderTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
            extended by  javax.mail.search.HeaderTerm
All Implemented Interfaces:
Serializable
public final class HeaderTerm
extends StringTerm

Extends: SearchTerm > StringTerm

此类实现 Message 头的比较。比较是不区分大小写的。
英文文档：

This class implements comparisons for Message headers. The comparison is case-insensitive.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  String headerName
The name of the header.
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
Constructor Summary
HeaderTerm(String headerName, String pattern)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
String | getHeaderName() Return the name of the header to compare with.
int | hashCode() Compute a hashCode for this object.
boolean | match(Message msg) The header match method.
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

headerName

protected String headerName
The name of the header.

Constructor Detail

public HeaderTerm(String headerName, String pattern)
构造方法。
headerName | 头的名称
pattern | 要搜索的模式
英文文档：

HeaderTerm

public HeaderTerm(String headerName,
                  String pattern)
Constructor.

Parameters:
headerName - The name of the header
pattern - The pattern to search for
Method Detail

public String getHeaderName()
返回要与之比较的头名称。
英文文档：

getHeaderName

public String getHeaderName()
Return the name of the header to compare with.

public boolean match(Message msg)
头匹配方法。
msg | 匹配将应用于此 Message 的头
return | 如果匹配成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The header match method.

Specified by:
match in class SearchTerm
Parameters:
msg - The match is applied to this Message's header
Returns:
true if the match succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class StringTerm

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class StringTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntegerComparisonTerm (Java EE 5)

javax.mail.search
Class IntegerComparisonTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.ComparisonTerm
            extended by  javax.mail.search.IntegerComparisonTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MessageNumberTerm, SizeTerm
public abstract class IntegerComparisonTerm
extends ComparisonTerm

Extends: SearchTerm > ComparisonTerm
Extended by: MessageNumberTerm, SizeTerm

此类实现整数比较。
英文文档：

This class implements comparisons for integers.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  int number
The number.
Fields inherited from class javax.mail.search.ComparisonTerm
comparison, EQ, GE, GT, LE, LT, NE
Constructor Summary
protected IntegerComparisonTerm(int comparison, int number)
Method Summary
boolean | equals(Object obj) Equality comparison.
int | getComparison() Return the type of comparison.
int | getNumber() Return the number to compare with.
int | hashCode() Compute a hashCode for this object.
protected boolean | match(int i)
Methods inherited from class javax.mail.search.SearchTerm
match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

number

protected int number
The number.

Constructor Detail

protected IntegerComparisonTerm(int comparison, int number)
英文文档：

IntegerComparisonTerm

protected IntegerComparisonTerm(int comparison,
                                int number)
Method Detail

public int getNumber()
返回要与之比较的数字。
英文文档：

getNumber

public int getNumber()
Return the number to compare with.

public int getComparison()
返回比较类型。
英文文档：

getComparison

public int getComparison()
Return the type of comparison.

protected boolean match(int i)
英文文档：

match

protected boolean match(int i)

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class ComparisonTerm

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class ComparisonTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageIDTerm (Java EE 5)

javax.mail.search
Class MessageIDTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
            extended by  javax.mail.search.MessageIDTerm
All Implemented Interfaces:
Serializable
public final class MessageIDTerm
extends StringTerm

Extends: SearchTerm > StringTerm

此条目模拟 RFC822 “MessageId” - Internet 消息的“消息-ID”值对，每个消息都有唯一的“消息-ID”值对。根据给定的 MessageId，客户端可以使用此条目在文件夹中搜索对应的消息。

MessageId 被表示为一个 String。

英文文档：

This term models the RFC822 "MessageId" - a message-id for Internet messages that is supposed to be unique per message. Clients can use this term to search a folder for a message given its MessageId.

The MessageId is represented as a String.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
Constructor Summary
MessageIDTerm(String msgid)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MessageIDTerm(String msgid)
构造方法。
msgid 要搜索的 msgid
英文文档：

MessageIDTerm

public MessageIDTerm(String msgid)
Constructor.

Parameters:
msgid - the msgid to search for
Method Detail

public boolean match(Message msg)
匹配方法。
msg | 匹配将应用于此 Message 的 Message-ID 头
return | 如果匹配成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - the match is applied to this Message's Message-ID header
Returns:
true if the match succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class StringTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageNumberTerm (Java EE 5)

javax.mail.search
Class MessageNumberTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.ComparisonTerm
            extended by  javax.mail.search.IntegerComparisonTerm
                extended by  javax.mail.search.MessageNumberTerm
All Implemented Interfaces:
Serializable
public final class MessageNumberTerm
extends IntegerComparisonTerm

Extends: SearchTerm > ComparisonTerm > IntegerComparisonTerm

此类模拟 Message 编号的比较。
英文文档：

This class implements comparisons for Message numbers.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.IntegerComparisonTerm
number
Fields inherited from class javax.mail.search.ComparisonTerm
comparison, EQ, GE, GT, LE, LT, NE
Constructor Summary
MessageNumberTerm(int number)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.IntegerComparisonTerm
getComparison, getNumber, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MessageNumberTerm(int number)
构造方法。
number Message 编号
英文文档：

MessageNumberTerm

public MessageNumberTerm(int number)
Constructor.

Parameters:
number - the Message number
Method Detail

public boolean match(Message msg)
匹配方法。
msg | Message 编号将与此 Message 相匹配
return | 如果匹配成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - the Message number is matched with this Message
Returns:
true if the match succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class IntegerComparisonTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotTerm (Java EE 5)

javax.mail.search
Class NotTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.NotTerm
All Implemented Interfaces:
Serializable
public final class NotTerm
extends SearchTerm

Extends: SearchTerm

此类实现逻辑 NEGATION 运算符。
英文文档：

This class implements the logical NEGATION operator.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  SearchTerm term
The search term to negate.
Constructor Summary
NotTerm(SearchTerm t)
Method Summary
boolean | equals(Object obj) Equality comparison.
SearchTerm | getTerm() Return the term to negate.
int | hashCode() Compute a hashCode for this object.
boolean | match(Message msg) This method applies a specific match criterion to the given message and returns the result.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

term

protected SearchTerm term
The search term to negate.

Constructor Detail

public NotTerm(SearchTerm t)
英文文档：

NotTerm

public NotTerm(SearchTerm t)
Method Detail

public SearchTerm getTerm()
返回要求反的条目。
英文文档：

getTerm

public SearchTerm getTerm()
Return the term to negate.

public boolean match(Message msg)
英文文档：

match

public boolean match(Message msg)
Description copied from class: SearchTerm
This method applies a specific match criterion to the given message and returns the result.

Specified by:
match in class SearchTerm
Parameters:
msg - The match criterion is applied on this message
Returns:
true, it the match succeeds, false if the match fails

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class Object

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OrTerm (Java EE 5)

javax.mail.search
Class OrTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.OrTerm
All Implemented Interfaces:
Serializable
public final class OrTerm
extends SearchTerm

Extends: SearchTerm

此类实现单个 SearchTerm 上的逻辑 OR 运算符。
英文文档：

This class implements the logical OR operator on individual SearchTerms.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  SearchTerm[] terms
The array of terms on which the OR operator should be applied.
Constructor Summary
OrTerm(SearchTerm[] t)
Constructor that takes an array of SearchTerms.
OrTerm(SearchTerm t1, SearchTerm t2)
Constructor that takes two operands.
Method Summary
boolean | equals(Object obj) Equality comparison.
SearchTerm[] | getTerms() Return the search terms.
int | hashCode() Compute a hashCode for this object.
boolean | match(Message msg) The OR operation.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

terms

protected SearchTerm[] terms
The array of terms on which the OR operator should be applied.

Constructor Detail

public OrTerm(SearchTerm t1, SearchTerm t2)
带两个操作数的构造方法。
t1 | 第一个条目
t2 | 第二个条目
英文文档：

OrTerm

public OrTerm(SearchTerm t1,
              SearchTerm t2)
Constructor that takes two operands.

Parameters:
t1 - first term
t2 - second term

public OrTerm(SearchTerm[] t)
带 SearchTerm 数组的构造方法。
t 搜索条目数组
英文文档：

OrTerm

public OrTerm(SearchTerm[] t)
Constructor that takes an array of SearchTerms.

Parameters:
t - array of search terms
Method Detail

public SearchTerm[] getTerms()
返回搜索条目。
英文文档：

getTerms

public SearchTerm[] getTerms()
Return the search terms.

public boolean match(Message msg)
OR 运算。

构造方法中指定的条目将应用于给定的对象，OR 运算符应用于这些条目的结果。

msg | 指定的 SearchTerm 将应用于此 Message，OR 运算符应用于其结果。
return | 如果 OR 运算成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The OR operation.

The terms specified in the constructor are applied to the given object and the OR operator is applied to their results.

Specified by:
match in class SearchTerm
Parameters:
msg - The specified SearchTerms are applied to this Message and the OR operator is applied to their results.
Returns:
true if the OR succeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class Object

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ReceivedDateTerm (Java EE 5)

javax.mail.search
Class ReceivedDateTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.ComparisonTerm
            extended by  javax.mail.search.DateTerm
                extended by  javax.mail.search.ReceivedDateTerm
All Implemented Interfaces:
Serializable
public final class ReceivedDateTerm
extends DateTerm

Extends: SearchTerm > ComparisonTerm > DateTerm

此类实现 Message Received 日期的比较
英文文档：

This class implements comparisons for the Message Received date

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.DateTerm
date
Fields inherited from class javax.mail.search.ComparisonTerm
comparison, EQ, GE, GT, LE, LT, NE
Constructor Summary
ReceivedDateTerm(int comparison, Date date)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.DateTerm
getComparison, getDate, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ReceivedDateTerm(int comparison, java.util.Date date)
构造方法。
comparison | Comparison 类型
date | 要比较的日期
英文文档：

ReceivedDateTerm

public ReceivedDateTerm(int comparison,
                        Date date)
Constructor.

Parameters:
comparison - the Comparison type
date - the date to be compared
Method Detail

public boolean match(Message msg)
匹配方法。
msg | 日期比较器将应用于此 Message 的发送日期
return | 如果比较成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - the date comparator is applied to this Message's sent date
Returns:
true if the comparison succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class DateTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RecipientStringTerm (Java EE 5)

javax.mail.search
Class RecipientStringTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
            extended by  javax.mail.search.AddressStringTerm
                extended by  javax.mail.search.RecipientStringTerm
All Implemented Interfaces:
Serializable
public final class RecipientStringTerm
extends AddressStringTerm

Extends: SearchTerm > StringTerm > AddressStringTerm

此类实现 Recipient Address 头的字符串比较。

注意，此类与 RecipientTerm 类不同，此类比较的是地址字符串，而不是 Address 对象。字符串比较是不区分大小写的。

since
en
JavaMail 1.1
英文文档：

This class implements string comparisons for the Recipient Address headers.

Note that this class differs from the RecipientTerm class in that this class does comparisons on address strings rather than Address objects. The string comparisons are case-insensitive.

Since:
JavaMail 1.1
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
Constructor Summary
RecipientStringTerm(Message.RecipientType type, String pattern)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
Message.RecipientType | getRecipientType() Return the type of recipient to match with.
int | hashCode() Compute a hashCode for this object.
boolean | match(Message msg) Check whether the address specified in the constructor is a substring of the recipient address of this Message.
Methods inherited from class javax.mail.search.AddressStringTerm
match
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public RecipientStringTerm(Message.RecipientType type, String pattern)
构造方法。
type | 接收方类型
pattern | 要比较的地址模式。
英文文档：

RecipientStringTerm

public RecipientStringTerm(Message.RecipientType type,
                           String pattern)
Constructor.

Parameters:
type - the recipient type
pattern - the address pattern to be compared.
Method Detail

public Message.RecipientType getRecipientType()
返回要与之匹配的接收方类型。
英文文档：

getRecipientType

public Message.RecipientType getRecipientType()
Return the type of recipient to match with.

public boolean match(Message msg)
检查构造方法中指定的地址是否是此 Message 的接收方地址的子字符串。
msg | 比较将应用于此 Message 的接收方地址。
return | 如果匹配成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
Check whether the address specified in the constructor is a substring of the recipient address of this Message.

Specified by:
match in class SearchTerm
Parameters:
msg - The comparison is applied to this Message's recipient address.
Returns:
true if the match succeeds, otherwise false.

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class AddressStringTerm

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class StringTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RecipientTerm (Java EE 5)

javax.mail.search
Class RecipientTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.AddressTerm
            extended by  javax.mail.search.RecipientTerm
All Implemented Interfaces:
Serializable
public final class RecipientTerm
extends AddressTerm

Extends: SearchTerm > AddressTerm

此类实现 Recipient Address 头的比较。
英文文档：

This class implements comparisons for the Recipient Address headers.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected  Message.RecipientType type
The recipient type.
Fields inherited from class javax.mail.search.AddressTerm
address
Constructor Summary
RecipientTerm(Message.RecipientType type, Address address)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
Message.RecipientType | getRecipientType() Return the type of recipient to match with.
int | hashCode() Compute a hashCode for this object.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.AddressTerm
getAddress, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

type

protected Message.RecipientType type
The recipient type.

Constructor Detail

public RecipientTerm(Message.RecipientType type, Address address)
构造方法。
type | 接收方类型
address | 要与之匹配的地址
英文文档：

RecipientTerm

public RecipientTerm(Message.RecipientType type,
                     Address address)
Constructor.

Parameters:
type - the recipient type
address - the address to match for
Method Detail

public Message.RecipientType getRecipientType()
返回要与之匹配的接收方类型。
英文文档：

getRecipientType

public Message.RecipientType getRecipientType()
Return the type of recipient to match with.

public boolean match(Message msg)
匹配方法。
msg | 地址匹配将应用于此 Message 的接收方地址
return | 如果匹配成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - The address match is applied to this Message's recepient address
Returns:
true if the match succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class AddressTerm

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class AddressTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SearchTerm (Java EE 5)

javax.mail.search
Class SearchTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AddressTerm, AndTerm, ComparisonTerm, FlagTerm, NotTerm, OrTerm, StringTerm
public abstract class SearchTerm
extends Object
implements Serializable

Implements: java.io.Serializable
Extended by: AddressTerm, AndTerm, ComparisonTerm, FlagTerm, NotTerm, OrTerm, StringTerm

搜索条件被表示为一个搜索条目树，形成搜索表达式的解析树。

搜索条目由此类表示。这是一个抽象类；子类实现具体的匹配方法。

搜索条目是可序列化的，这允许在会话之间存储搜索条目。 警告：此类的序列化对象可能与以后的 JavaMail API 版本不兼容。当前的序列化支持适用于短期存储。

警告：在 JDK 1.1 系统上，包含引用 Message.RecipientType 类型对象的搜索条目将无法正常反序列化。虽然无需抛出任何异常就可以对这些对象进行反序列化，但是生成的对象不符合 Message.RecipientType 类的类型安全枚举 协定。对这些对象进行适当的反序列化依赖于对 readReplace 方法的支持，该方法已经添加到 JDK 1.2 中。

英文文档：

Search criteria are expressed as a tree of search-terms, forming a parse-tree for the search expression.

Search-terms are represented by this class. This is an abstract class; subclasses implement specific match methods.

Search terms are serializable, which allows storing a search term between sessions. Warning: Serialized objects of this class may not be compatible with future JavaMail API releases. The current serialization support is appropriate for short term storage.

Warning: Search terms that include references to objects of type Message.RecipientType will not be deserialized correctly on JDK 1.1 systems. While these objects will be deserialized without throwing any exceptions, the resulting objects violate the type-safe enum contract of the Message.RecipientType class. Proper deserialization of these objects depends on support for the readReplace method, added in JDK 1.2.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Constructor Summary
SearchTerm()
Method Summary
abstract  boolean match(Message msg)
This method applies a specific match criterion to the given message and returns the result.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SearchTerm()
英文文档：

SearchTerm

public SearchTerm()
Method Detail

abstract public boolean match(Message msg)
此方法对给定消息应用特定匹配条件，并返回结果。
msg | 匹配条件将应用于此消息
return | 如果匹配成功，则返回 true；匹配失败则返回 false。
英文文档：

match

public abstract boolean match(Message msg)
This method applies a specific match criterion to the given message and returns the result.

Parameters:
msg - The match criterion is applied on this message
Returns:
true, it the match succeeds, false if the match fails
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SentDateTerm (Java EE 5)

javax.mail.search
Class SentDateTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.ComparisonTerm
            extended by  javax.mail.search.DateTerm
                extended by  javax.mail.search.SentDateTerm
All Implemented Interfaces:
Serializable
public final class SentDateTerm
extends DateTerm

Extends: SearchTerm > ComparisonTerm > DateTerm

此类实现 Message SentDate 的比较。
英文文档：

This class implements comparisons for the Message SentDate.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.DateTerm
date
Fields inherited from class javax.mail.search.ComparisonTerm
comparison, EQ, GE, GT, LE, LT, NE
Constructor Summary
SentDateTerm(int comparison, Date date)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.DateTerm
getComparison, getDate, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SentDateTerm(int comparison, java.util.Date date)
构造方法。
comparison | Comparison 类型
date | 要比较的日期
英文文档：

SentDateTerm

public SentDateTerm(int comparison,
                    Date date)
Constructor.

Parameters:
comparison - the Comparison type
date - the date to be compared
Method Detail

public boolean match(Message msg)
匹配方法。
msg | 日期比较器将应用于此 Message 的发送日期
return | 如果比较成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - the date comparator is applied to this Message's sent date
Returns:
true if the comparison succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class DateTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SizeTerm (Java EE 5)

javax.mail.search
Class SizeTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.ComparisonTerm
            extended by  javax.mail.search.IntegerComparisonTerm
                extended by  javax.mail.search.SizeTerm
All Implemented Interfaces:
Serializable
public final class SizeTerm
extends IntegerComparisonTerm

Extends: SearchTerm > ComparisonTerm > IntegerComparisonTerm

此类实现 Message 大小的比较。
英文文档：

This class implements comparisons for Message sizes.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.IntegerComparisonTerm
number
Fields inherited from class javax.mail.search.ComparisonTerm
comparison, EQ, GE, GT, LE, LT, NE
Constructor Summary
SizeTerm(int comparison, int size)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.IntegerComparisonTerm
getComparison, getNumber, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SizeTerm(int comparison, int size)
构造方法。
comparison | Comparison 类型
size | 大小
英文文档：

SizeTerm

public SizeTerm(int comparison,
                int size)
Constructor.

Parameters:
comparison - the Comparison type
size - the size
Method Detail

public boolean match(Message msg)
匹配方法。
msg | 大小比较器将应用于此 Message 的大小
return | 如果大小相等，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - the size comparator is applied to this Message's size
Returns:
true if the size is equal, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class IntegerComparisonTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringTerm (Java EE 5)

javax.mail.search
Class StringTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AddressStringTerm, BodyTerm, HeaderTerm, MessageIDTerm, SubjectTerm
public abstract class StringTerm
extends SearchTerm

Extends: SearchTerm
Extended by: AddressStringTerm, BodyTerm, HeaderTerm, MessageIDTerm, SubjectTerm

此类实现 String 的匹配方法。当前的实现仅提供子字符串匹配。我们可以添加比较（比如 strcmp ……）。
英文文档：

This class implements the match method for Strings. The current implementation provides only for substring matching. We could add comparisons (like strcmp ...).

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
protected boolean | ignoreCase Ignore case when comparing?
protected String | pattern The pattern.
Constructor Summary
protected | StringTerm(String pattern)
protected | StringTerm(String pattern, boolean ignoreCase)
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | getIgnoreCase() Return true if we should ignore case when matching.
String | getPattern() Return the string to match with.
int | hashCode() Compute a hashCode for this object.
protected boolean | match(String s)
Methods inherited from class javax.mail.search.SearchTerm
match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

pattern

protected String pattern
The pattern.

英文文档：

ignoreCase

protected boolean ignoreCase
Ignore case when comparing?

Constructor Detail

protected StringTerm(String pattern)
英文文档：

StringTerm

protected StringTerm(String pattern)

protected StringTerm(String pattern, boolean ignoreCase)
英文文档：

StringTerm

protected StringTerm(String pattern,
                     boolean ignoreCase)
Method Detail

public String getPattern()
返回要与之匹配的字符串。
英文文档：

getPattern

public String getPattern()
Return the string to match with.

public boolean getIgnoreCase()
如果匹配时应该忽略大小写，则返回 true。
英文文档：

getIgnoreCase

public boolean getIgnoreCase()
Return true if we should ignore case when matching.

protected boolean match(String s)
英文文档：

match

protected boolean match(String s)

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class Object

public int hashCode()
计算此对象的 hashCode。
英文文档：

hashCode

public int hashCode()
Compute a hashCode for this object.

Overrides:
hashCode in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SubjectTerm (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.search
Class SubjectTerm

java.lang.Object
    extended by  javax.mail.search.SearchTerm
        extended by  javax.mail.search.StringTerm
            extended by  javax.mail.search.SubjectTerm
All Implemented Interfaces:
Serializable
public final class SubjectTerm
extends StringTerm

Extends: SearchTerm > StringTerm

此类实现 Message Subject 头的比较。比较是不区分大小写的。
英文文档：

This class implements comparisons for the Message Subject header. The comparison is case-insensitive.

Author:
Bill Shannon, John Mani
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
Constructor Summary
SubjectTerm(String pattern)
Constructor.
Method Summary
boolean | equals(Object obj) Equality comparison.
boolean | match(Message msg) The match method.
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, hashCode, match
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SubjectTerm(String pattern)
构造方法。
pattern 要搜索的模式
英文文档：

SubjectTerm

public SubjectTerm(String pattern)
Constructor.

Parameters:
pattern - the pattern to search for
Method Detail

public boolean match(Message msg)
匹配方法。
msg | 模式匹配将应用于此 Message 的主题头部
return | 如果模式匹配成功，则返回 true；否则返回 false。
英文文档：

match

public boolean match(Message msg)
The match method.

Specified by:
match in class SearchTerm
Parameters:
msg - the pattern match is applied to this Message's subject header
Returns:
true if the pattern match succeeds, otherwise false

public boolean equals(Object obj)
相等性比较。
英文文档：

equals

public boolean equals(Object obj)
Equality comparison.

Overrides:
equals in class StringTerm
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SearchException (Java EE 5)

javax.mail.search
Class SearchException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.mail.MessagingException
                extended by  javax.mail.search.SearchException
All Implemented Interfaces:
Serializable
public class SearchException
extends MessagingException

Extends: Throwable > Exception > MessagingException

当无法处理 Search 表达式时抛出此异常。
英文文档：

The exception thrown when a Search expression could not be handled.

Author:
John Mani
See Also:
Serialized Form

Constructor Summary
SearchException()
Constructs a SearchException with no detail message.
SearchException(String s)
Constructs a SearchException with the specified detail message.
Method Summary
Methods inherited from class javax.mail.MessagingException
getCause, getNextException, setNextException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public SearchException()
构造不带详细消息的 SearchException。
英文文档：

SearchException

public SearchException()
Constructs a SearchException with no detail message.

public SearchException(String s)
构造带指定详细消息的 SearchException。
s 详细信息
英文文档：

SearchException

public SearchException(String s)
Constructs a SearchException with the specified detail message.

Parameters:
s - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.mail.util (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.mail.util

Utility classes.

See:
Description

Class Summary
ByteArrayDataSource | A DataSource backed by a byte array.
SharedByteArrayInputStream | A ByteArrayInputStream that implements the SharedInputStream interface, allowing the underlying byte array to be shared between multiple readers.
SharedFileInputStream | A SharedFileInputStream is a BufferedInputStream that buffers data from the file and supports the mark and reset methods.

Package javax.mail.util Description

Utility classes. This package specifies utility classes that are useful with other JavaMail APIs.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.mail.util Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.mail.util

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.mail.util.ByteArrayDataSource (implements javax.activation.DataSource)
    • java.io.InputStream (implements java.io.Closeable)
      • java.io.ByteArrayInputStream
        • javax.mail.util.SharedByteArrayInputStream (implements javax.mail.internet.SharedInputStream)
      • java.io.FilterInputStream
        • java.io.BufferedInputStream
          • javax.mail.util.SharedFileInputStream (implements javax.mail.internet.SharedInputStream)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ByteArrayDataSource (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.util
Class ByteArrayDataSource

java.lang.Object
    extended by  javax.mail.util.ByteArrayDataSource
All Implemented Interfaces:
DataSource
public class ByteArrayDataSource
extends Object
implements DataSource

Implements: DataSource

byte 数组支持的 DataSource。可以直接传入 byte 数组，也可以根据一个 InputStream 或 String 初始化 byte 数组。
since
en
JavaMail 1.4
英文文档：

A DataSource backed by a byte array. The byte array may be passed in directly, or may be initialized from an InputStream or a String.

Since:
JavaMail 1.4
Author:
John Mani, Bill Shannon, Max Spivak

Constructor Summary
ByteArrayDataSource(byte[] data, String type)
Create a ByteArrayDataSource with data from the specified byte array and with the specified MIME type.
ByteArrayDataSource(InputStream is, String type)
Create a ByteArrayDataSource with data from the specified InputStream and with the specified MIME type.
ByteArrayDataSource(String data, String type)
Create a ByteArrayDataSource with data from the specified String and with the specified MIME type.
Method Summary
String | getContentType() Get the MIME content type of the data.
InputStream | getInputStream() Return an InputStream for the data.
String | getName() Get the name of the data.
OutputStream | getOutputStream() Return an OutputStream for the data.
void | setName(String name) Set the name of the data.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ByteArrayDataSource(java.io.InputStream is, String type) throws java.io.IOException
使用指定 InputStream 的数据和指定的 MIME 类型创建 ByteArrayDataSource。完整地读取 InputStream 并将数据存储在一个 byte 数组中。
is | InputStream
type | MIME 类型
Throws | java.io.IOException: 读取流时出现错误
英文文档：

ByteArrayDataSource

public ByteArrayDataSource(InputStream is,
                           String type)
                    throws IOException
Create a ByteArrayDataSource with data from the specified InputStream and with the specified MIME type. The InputStream is read completely and the data is stored in a byte array.

Parameters:
is - the InputStream
type - the MIME type
Throws:
IOException - errors reading the stream

public ByteArrayDataSource(byte[] data, String type)
使用指定 byte 数组的数据和指定的 MIME 类型创建 ByteArrayDataSource。
data | 数据
type | MIME 类型
英文文档：

ByteArrayDataSource

public ByteArrayDataSource(byte[] data,
                           String type)
Create a ByteArrayDataSource with data from the specified byte array and with the specified MIME type.

Parameters:
data - the data
type - the MIME type

public ByteArrayDataSource(String data, String type) throws java.io.IOException
使用指定 String 的数据和指定的 MIME 类型创建 ByteArrayDataSource。MIME 类型应该包含一个 charset 参数，它指定字符串要使用的字符集。如果未包含该参数，则使用默认的字符集。
data | String
type | MIME 类型
Throws | java.io.IOException: 读取 String 时出现错误
英文文档：

ByteArrayDataSource

public ByteArrayDataSource(String data,
                           String type)
                    throws IOException
Create a ByteArrayDataSource with data from the specified String and with the specified MIME type. The MIME type should include a charset parameter specifying the charset to be used for the string. If the parameter is not included, the default charset is used.

Parameters:
data - the String
type - the MIME type
Throws:
IOException - errors reading the String
Method Detail

public java.io.InputStream getInputStream() throws java.io.IOException
返回数据的 InputStream。注意，每次调用此方法时，都返回一个新流。
return | InputStream
Throws | java.io.IOException: 如果还没有设置任何数据
英文文档：

getInputStream

public InputStream getInputStream()
                           throws IOException
Return an InputStream for the data. Note that a new stream is returned each time this method is called.

Specified by:
getInputStream in interface DataSource
Returns:
the InputStream
Throws:
IOException - if no data has been set

public java.io.OutputStream getOutputStream() throws java.io.IOException
返回数据的 OutputStream。不支持写入数据；总是抛出 IOException。
Throws java.io.IOException: 始终
英文文档：

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Return an OutputStream for the data. Writing the data is not supported; an IOException is always thrown.

Specified by:
getOutputStream in interface DataSource
Returns:
an OutputStream
Throws:
IOException - always

public String getContentType()
获取数据的 MIME 内容类型。
return MIME 类型
英文文档：

getContentType

public String getContentType()
Get the MIME content type of the data.

Specified by:
getContentType in interface DataSource
Returns:
the MIME type

public String getName()
获取数据名称。默认情况下，返回一个空字符串 ("")。
return 此数据的名称
英文文档：

getName

public String getName()
Get the name of the data. By default, an empty string ("") is returned.

Specified by:
getName in interface DataSource
Returns:
the name of this data

public void setName(String name)
设置数据名称。
name 此数据的名称
英文文档：

setName

public void setName(String name)
Set the name of the data.

Parameters:
name - the name of this data
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SharedByteArrayInputStream (Java EE 5)

javax.mail.util
Class SharedByteArrayInputStream

java.lang.Object
    extended by  java.io.InputStream
        extended by  java.io.ByteArrayInputStream
            extended by  javax.mail.util.SharedByteArrayInputStream
All Implemented Interfaces:
Closeable, SharedInputStream
public class SharedByteArrayInputStream
extends ByteArrayInputStream
implements SharedInputStream

Extends: java.io.InputStream > java.io.ByteArrayInputStream
Implements: SharedInputStream

实现 SharedInputStream 接口的 ByteArrayInputStream，允许在多个 reader 之间共享底层 byte 数组。
version 1.5, 07/05/04
since
en
JavaMail 1.4
英文文档：

A ByteArrayInputStream that implements the SharedInputStream interface, allowing the underlying byte array to be shared between multiple readers.

Since:
JavaMail 1.4
Version:
1.5, 07/05/04
Author:
Bill Shannon

Field Summary
protected  int start
Position within shared buffer that this stream starts at.
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
Constructor Summary
SharedByteArrayInputStream(byte[] buf)
Create a SharedByteArrayInputStream representing the entire byte array.
SharedByteArrayInputStream(byte[] buf, int offset, int length)
Create a SharedByteArrayInputStream representing the part of the byte array from offset for length bytes.
Method Summary
long | getPosition() Return the current position in the InputStream, as an offset from the beginning of the InputStream.
InputStream | newStream(long start, long end) Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive).
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, reset, skip
Methods inherited from class java.io.InputStream
read
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

start

protected int start
Position within shared buffer that this stream starts at.

Constructor Detail

public SharedByteArrayInputStream(byte[] buf)
创建一个表示整个 byte 数组的 SharedByteArrayInputStream。
buf byte 数组
英文文档：

SharedByteArrayInputStream

public SharedByteArrayInputStream(byte[] buf)
Create a SharedByteArrayInputStream representing the entire byte array.

Parameters:
buf - the byte array

public SharedByteArrayInputStream(byte[] buf, int offset, int length)
创建一个表示部分 byte 数组（从 offset 开始的 length 个字节）的 SharedByteArrayInputStream。
buf | byte 数组
offset | byte 数组中距离第一个字节的偏移量
length | 要包含的字节数
英文文档：

SharedByteArrayInputStream

public SharedByteArrayInputStream(byte[] buf,
                                  int offset,
                                  int length)
Create a SharedByteArrayInputStream representing the part of the byte array from offset for length bytes.

Parameters:
buf - the byte array
offset - offset in byte array to first byte to include
length - number of bytes to include
Method Detail

public long getPosition()
返回 InputStream 中的当前位置，形式为距 InputStream 开头的偏移量。
return 当前位置
英文文档：

getPosition

public long getPosition()
Return the current position in the InputStream, as an offset from the beginning of the InputStream.

Specified by:
getPosition in interface SharedInputStream
Returns:
the current position

public java.io.InputStream newStream(long start, long end)
返回表示此 InputStream 数据的子集的新 InputStream，从 start（包括）开始，一直到 end（不包括）结束。start 必须为非负数。如果 end 为 -1，则新流的结束位置与此流相同。返回的 InputStream 也将实现 SharedInputStream 接口。
start | 起始位置
end | 结束位置 + 1
return | 新流
英文文档：

newStream

public InputStream newStream(long start,
                             long end)
Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive). start must be non-negative. If end is -1, the new stream ends at the same place as this stream. The returned InputStream will also implement the SharedInputStream interface.

Specified by:
newStream in interface SharedInputStream
Parameters:
start - the starting position
end - the ending position + 1
Returns:
the new stream
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SharedFileInputStream (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.mail.util
Class SharedFileInputStream

java.lang.Object
    extended by  java.io.InputStream
        extended by  java.io.FilterInputStream
            extended by  java.io.BufferedInputStream
                extended by  javax.mail.util.SharedFileInputStream
All Implemented Interfaces:
Closeable, SharedInputStream
public class SharedFileInputStream
extends BufferedInputStream
implements SharedInputStream

Extends: java.io.InputStream > java.io.FilterInputStream > java.io.BufferedInputStream
Implements: SharedInputStream

SharedFileInputStream 是一个 BufferedInputStream，对来自文件的数据进行缓冲并支持 mark 和 reset 方法。它也支持 newStream 方法，该方法允许创建表示文件子集的其他流。RandomAccessFile 对象用于访问文件数据。

注意，当 SharedFileInputStream 关闭时，使用 newStream 方法创建的所有流也会关闭。这允许 SharedFileInputStream 对象的创建者控制对底层文件的访问，并确保在必要时底层文件是关闭的，以避免泄漏文件描述符。还要注意，此行为与 SharedInputStream 的要求存在冲突，在以后的版本中可能更改。

since
en
JavaMail 1.4
英文文档：

A SharedFileInputStream is a BufferedInputStream that buffers data from the file and supports the mark and reset methods. It also supports the newStream method that allows you to create other streams that represent subsets of the file. A RandomAccessFile object is used to access the file data.

Note that when the SharedFileInputStream is closed, all streams created with the newStream method are also closed. This allows the creator of the SharedFileInputStream object to control access to the underlying file and ensure that it is closed when needed, to avoid leaking file descriptors. Note also that this behavior contradicts the requirements of SharedInputStream and may change in a future release.

Since:
JavaMail 1.4
Author:
Bill Shannon

Field Summary
protected long | bufpos The file offset that corresponds to the first byte in the read buffer.
protected int | bufsize The normal size of the read buffer.
protected long | datalen The amount of data in this subset of the file.
protected RandomAccessFile | in The file containing the data.
protected long | start The file offset of the start of data in this subset of the file.
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
Constructor Summary
SharedFileInputStream(File file)
Creates a SharedFileInputStream for the file.
SharedFileInputStream(File file, int size)
Creates a SharedFileInputStream with the specified buffer size.
SharedFileInputStream(String file)
Creates a SharedFileInputStream for the named file
SharedFileInputStream(String file, int size)
Creates a SharedFileInputStream with the specified buffer size.
Method Summary
int | available() Returns the number of bytes that can be read from this input stream without blocking.
void | close() Closes this input stream and releases any system resources associated with the stream.
protected void | finalize() Force this stream to close.
long | getPosition() Return the current position in the InputStream, as an offset from the beginning of the InputStream.
void | mark(int readlimit) See the general contract of the mark method of InputStream.
boolean | markSupported() Tests if this input stream supports the mark and reset methods.
InputStream | newStream(long start, long end) Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive).
int | read() See the general contract of the read method of InputStream.
int | read(byte[] b, int off, int len) Reads bytes from this stream into the specified byte array, starting at the given offset.
void | reset() See the general contract of the reset method of InputStream.
long | skip(long n) See the general contract of the skip method of InputStream.
Methods inherited from class java.io.FilterInputStream
read
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

in

protected RandomAccessFile in
The file containing the data. Shared by all related SharedFileInputStreams.

英文文档：

bufsize

protected int bufsize
The normal size of the read buffer.

英文文档：

bufpos

protected long bufpos
The file offset that corresponds to the first byte in the read buffer.

英文文档：

start

protected long start
The file offset of the start of data in this subset of the file.

英文文档：

datalen

protected long datalen
The amount of data in this subset of the file.

Constructor Detail

public SharedFileInputStream(java.io.File file) throws java.io.IOException
为文件创建一个 SharedFileInputStream。
file 文件
英文文档：

SharedFileInputStream

public SharedFileInputStream(File file)
                      throws IOException
Creates a SharedFileInputStream for the file.

Parameters:
file - the file
Throws:
IOException

public SharedFileInputStream(String file) throws java.io.IOException
为指定文件创建一个 SharedFileInputStream。
file 文件
英文文档：

SharedFileInputStream

public SharedFileInputStream(String file)
                      throws IOException
Creates a SharedFileInputStream for the named file

Parameters:
file - the file
Throws:
IOException

public SharedFileInputStream(java.io.File file, int size) throws java.io.IOException
创建一个具有指定缓冲区大小的 SharedFileInputStream。
file | 文件
size | 缓冲区的大小。
Throws | IllegalArgumentException: 如果 size <= 0
英文文档：

SharedFileInputStream

public SharedFileInputStream(File file,
                             int size)
                      throws IOException
Creates a SharedFileInputStream with the specified buffer size.

Parameters:
file - the file
size - the buffer size.
Throws:
IllegalArgumentException - if size <= 0.
IOException

public SharedFileInputStream(String file, int size) throws java.io.IOException
创建一个具有指定缓冲区大小的 SharedFileInputStream。
file | 文件
size | 缓冲区的大小。
Throws | IllegalArgumentException: 如果 size <= 0
英文文档：

SharedFileInputStream

public SharedFileInputStream(String file,
                             int size)
                      throws IOException
Creates a SharedFileInputStream with the specified buffer size.

Parameters:
file - the file
size - the buffer size.
Throws:
IllegalArgumentException - if size <= 0.
IOException
Method Detail

public int read() throws java.io.IOException
参见 InputStream 的 read 方法的常规协定。
return | 下一个数据字节，如果到达流末尾，则返回 -1。
Throws | java.io.IOException: 如果发生 I/O 错误。
英文文档：

read

public int read()
         throws IOException
See the general contract of the read method of InputStream.

Overrides:
read in class BufferedInputStream
Returns:
the next byte of data, or -1 if the end of the stream is reached.
Throws:
IOException - if an I/O error occurs.

public int read(byte[] b, int off, int len) throws java.io.IOException
从此流中给定的偏移量处读取各字节并存入指定的 byte 数组中。

此方法实现 java.io.InputStream 类相应 read 方法的常规协定。

b | 目标缓冲区。
off | 开始存储字节处的偏移量。
len | 要读取的最大字节数。
return | 读取的字节数；如果已到达流末尾，则返回 -1。
Throws | java.io.IOException: 如果发生 I/O 错误。
英文文档：

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Reads bytes from this stream into the specified byte array, starting at the given offset.

This method implements the general contract of the corresponding read method of the InputStream class.

Overrides:
read in class BufferedInputStream
Parameters:
b - destination buffer.
off - offset at which to start storing bytes.
len - maximum number of bytes to read.
Returns:
the number of bytes read, or -1 if the end of the stream has been reached.
Throws:
IOException - if an I/O error occurs.

public long skip(long n) throws java.io.IOException
参见 InputStream 的 skip 方法的常规协定。
n | 要跳过的字节数。
return | 跳过的实际字节数。
Throws | java.io.IOException: 如果发生 I/O 错误。
英文文档：

skip

public long skip(long n)
          throws IOException
See the general contract of the skip method of InputStream.

Overrides:
skip in class BufferedInputStream
Parameters:
n - the number of bytes to be skipped.
Returns:
the actual number of bytes skipped.
Throws:
IOException - if an I/O error occurs.

public int available() throws java.io.IOException
返回可以不受阻塞地从此输入流中读取的字节数。
return | 不发生阻塞地从此输入流读取的字节数。
Throws | java.io.IOException: 如果发生 I/O 错误。
英文文档：

available

public int available()
              throws IOException
Returns the number of bytes that can be read from this input stream without blocking.

Overrides:
available in class BufferedInputStream
Returns:
the number of bytes that can be read from this input stream without blocking.
Throws:
IOException - if an I/O error occurs.

public void mark(int readlimit)
参见 InputStream 的 mark 方法的常规协定。
readlimit | 在标记位置变为无效之前可以读取字节的最大限制。
See also | reset()
英文文档：

mark

public void mark(int readlimit)
See the general contract of the mark method of InputStream.

Overrides:
mark in class BufferedInputStream
Parameters:
readlimit - the maximum limit of bytes that can be read before the mark position becomes invalid.
See Also:
reset()

public void reset() throws java.io.IOException
参见 InputStream 的 reset 方法的常规协定。

如果 markpos 为 -1（尚未设置标记，或者标记已失效），则抛出 IOException。否则将 pos 设置为与 markpos 相等。

Throws | java.io.IOException: 如果未标记此流或该标记失效。
See also | mark(int)
英文文档：

reset

public void reset()
           throws IOException
See the general contract of the reset method of InputStream.

If markpos is -1 (no mark has been set or the mark has been invalidated), an IOException is thrown. Otherwise, pos is set equal to markpos.

Overrides:
reset in class BufferedInputStream
Throws:
IOException - if this stream has not been marked or if the mark has been invalidated.
See Also:
mark(int)

public boolean markSupported()
测试此输入流是否支持 mark 和 reset 方法。SharedFileInputStream 的 markSupported 方法返回 true。
return | 一个 boolean 值，指示此流类型是否支持 mark 和 reset 方法。
See also | mark(int), reset()
英文文档：

markSupported

public boolean markSupported()
Tests if this input stream supports the mark and reset methods. The markSupported method of SharedFileInputStream returns true.

Overrides:
markSupported in class BufferedInputStream
Returns:
a boolean indicating if this stream type supports the mark and reset methods.
See Also:
InputStream.mark(int), InputStream.reset()

public void close() throws java.io.IOException
关闭此输入流并释放与该流关联的所有系统资源。
Throws java.io.IOException: 如果发生 I/O 错误。
英文文档：

close

public void close()
           throws IOException
Closes this input stream and releases any system resources associated with the stream.

Specified by:
close in interface Closeable
Overrides:
close in class BufferedInputStream
Throws:
IOException - if an I/O error occurs.

public long getPosition()
返回 InputStream 中的当前位置，形式为距 InputStream 开头的偏移量。
return 当前位置
英文文档：

getPosition

public long getPosition()
Return the current position in the InputStream, as an offset from the beginning of the InputStream.

Specified by:
getPosition in interface SharedInputStream
Returns:
the current position

public java.io.InputStream newStream(long start, long end)
返回表示此 InputStream 数据的子集的新 InputStream，从 start（包括）开始，一直到 end（不包括）结束。start 必须为非负数。如果 end 为 -1，则新流的结束位置与此流相同。返回的 InputStream 也将实现 SharedInputStream 接口。
start | 起始位置
end | 结束位置 + 1
return | 新流
英文文档：

newStream

public InputStream newStream(long start,
                             long end)
Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive). start must be non-negative. If end is -1, the new stream ends at the same place as this stream. The returned InputStream will also implement the SharedInputStream interface.

Specified by:
newStream in interface SharedInputStream
Parameters:
start - the starting position
end - the ending position + 1
Returns:
the new stream

protected void finalize() throws Throwable
强制关闭此流。
英文文档：

finalize

protected void finalize()
                 throws Throwable
Force this stream to close.

Overrides:
finalize in class Object
Throws:
Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.management.j2ee (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.management.j2ee

Provides the J2EE Management Enterprise Bean component (MEJB) interfaces.

See:
Description

Interface Summary
ListenerRegistration | ListenerRegistration defines the methods which clients of the MEJB use to add and remove event listeners.
Management | The Management interface provides the APIs to navigate and manipulate managed objects.
ManagementHome | The required home interface for the J2EE Management EJB component (MEJB).

Package javax.management.j2ee Description

Provides the J2EE Management Enterprise Bean component (MEJB) interfaces.

Package Specification

  • JSR 77, J2EE Management

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.management.j2ee Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.management.j2ee

Package Hierarchies:
All Packages

Interface Hierarchy

  • java.rmi.Remote
    • javax.ejb.EJBHome
      • javax.management.j2ee.ManagementHome
    • javax.ejb.EJBObject
      • javax.management.j2ee.Management
  • java.io.Serializable
    • javax.management.j2ee.ListenerRegistration
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ListenerRegistration (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.management.j2ee
Interface ListenerRegistration

All Superinterfaces:
Serializable
public interface ListenerRegistration
extends Serializable

Implements: java.io.Serializable

ListenerRegistration 定义 MEJB 的客户端用于添加和移除事件侦听器的方法。
英文文档：

ListenerRegistration defines the methods which clients of the MEJB use to add and remove event listeners.

Author:
Hans Hrasna

Method Summary
void | addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) Add a listener to a registered managed object.
void | removeNotificationListener(ObjectName name, NotificationListener listener) Remove a listener from a registered managed object.

Method Detail

public void addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, Object handback) throws javax.management.InstanceNotFoundException, java.rmi.RemoteException
向已注册的管理对象添加侦听器。
name | 管理对象的名称，将在该对象上添加侦听器。
listener | 侦听器对象，它将处理已注册的管理对象所发出的通知。
filter | 过滤器对象。如果 filter 为 null，则处理通知前不执行过滤。
handback | 发出通知时要发送到侦听器的上下文。
Throws | javax.management.InstanceNotFoundException: 如果提供的管理对象与任何已注册管理对象都不匹配。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

addNotificationListener

void addNotificationListener(ObjectName name,
                             NotificationListener listener,
                             NotificationFilter filter,
                             Object handback)
                             throws InstanceNotFoundException,
                                    RemoteException
Add a listener to a registered managed object.

Parameters:
name - The name of the managed object on which the listener should be added.
listener - The listener object which will handle the notifications emitted by the registered managed object.
filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a notification is emitted.
Throws:
InstanceNotFoundException - The managed object name provided does not match any of the registered managed objects.
RemoteException - A communication exception occurred during the execution of a remote method call

public void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener) throws javax.management.InstanceNotFoundException, javax.management.ListenerNotFoundException, java.rmi.RemoteException
从已注册管理对象中移除一个侦听器。
name | 管理对象的名称，将在该对象上移除侦听器。
listener | 侦听器对象，它将处理已注册的管理对象所发出的通知。此方法将移除与此侦听器相关的所有信息。
Throws | javax.management.InstanceNotFoundException: 如果提供的管理对象与任何已注册管理对象都不匹配。
Throws | javax.management.ListenerNotFoundException: 如果该侦听器未在管理对象中注册。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       RemoteException
Remove a listener from a registered managed object.

Parameters:
name - The name of the managed object on which the listener should be removed.
listener - The listener object which will handle the notifications emitted by the registered managed object. This method will remove all the information related to this listener.
Throws:
InstanceNotFoundException - The managed object name provided does not match any of the registered managed objects.
ListenerNotFoundException - The listener is not registered in the managed object.
RemoteException - A communication exception occurred during the execution of a remote method call
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Management (Java EE 5)

javax.management.j2ee
Interface Management

All Superinterfaces:
EJBObject, Remote
public interface Management
extends EJBObject

Implements: EJBObject

Management 接口提供导航和操作管理对象的 API。J2EE Management EJB 组件 (MEJB) 必须将此接口作为其远程接口实现。
英文文档：

The Management interface provides the APIs to navigate and manipulate managed objects. The J2EE Management EJB component (MEJB) must implement this as its remote interface.

Author:
Hans Hrasna

Method Summary
Object | getAttribute(ObjectName name, String attribute) Gets the value of a specific attribute of a named managed object.
AttributeList | getAttributes(ObjectName name, String[] attributes) Enables the values of several attributes of a named managed object.
String | getDefaultDomain() Returns the default domain name of this MEJB.
ListenerRegistration | getListenerRegistry() Returns the listener registry implementation for this MEJB.
Integer | getMBeanCount() Returns the number of managed objects registered in the MEJB.
MBeanInfo | getMBeanInfo(ObjectName name) This method discovers the attributes and operations that a managed object exposes for management.
Object | invoke(ObjectName name, String operationName, Object[] params, String[] signature) Invokes an operation on a managed object.
boolean | isRegistered(ObjectName name) Checks whether a managed object, identified by its object name, is already registered with the MEJB.
Set | queryNames(ObjectName name, QueryExp query) Gets the names of managed objects controlled by the MEJB.
void | setAttribute(ObjectName name, Attribute attribute) Sets the value of a specific attribute of a named managed object.
AttributeList | setAttributes(ObjectName name, AttributeList attributes) Sets the values of several attributes of a named managed object.
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove

Method Detail

public java.util.Set<E> queryNames(javax.management.ObjectName name, javax.management.QueryExp query) throws java.rmi.RemoteException
获取 MEJB 所控制的管理对象的名称。此方法允许获取以下任意内容：所有管理对象的名称，与 ObjectName 匹配的模式所指定的管理对象集合的名称，以及一个特定的管理对象名称（等效于测试管理对象是否被注册）。当对象名称为 null 或未指定域和键属性时，选择所有对象。它返回所选择的管理对象的 J2EEObjectNames 集合。
name | 对象名称模式，标识要获取的管理对象。如果为 null 或未指定域和键属性，则获取所有已注册的管理对象。
return | 一个集合，包含所选择管理对象的 ObjectName。如果没有满足该查询的管理对象，则返回一个空集合。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

queryNames

Set queryNames(ObjectName name,
               QueryExp query)
               throws RemoteException
Gets the names of managed objects controlled by the MEJB. This method enables any of the following to be obtained: The names of all managed objects, the names of a set of managed objects specified by pattern matching on the ObjectName, a specific managed object name (equivalent to testing whether a managed object is registered). When the object name is null or no domain and key properties are specified, all objects are selected. It returns the set of J2EEObjectNames for the managed objects selected.

Parameters:
name - The object name pattern identifying the managed objects to be retrieved. If null or no domain and key properties are specified, all the managed objects registered will be retrieved.
Returns:
A set containing the ObjectNames for the managed objects selected. If no managed object satisfies the query, an empty set is returned.
Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public boolean isRegistered(javax.management.ObjectName name) throws java.rmi.RemoteException
检查某个管理对象（通过其对象名称标识）是否已向 MEJB 注册。
name | 要检查的管理对象的对象名称。
return | 如果已在 MEJB 中注册了该管理对象，则返回 true；否则返回 false。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

isRegistered

boolean isRegistered(ObjectName name)
                     throws RemoteException
Checks whether a managed object, identified by its object name, is already registered with the MEJB.

Parameters:
name - The object name of the managed object to be checked.
Returns:
True if the managed object is already registered in the MEJB, false otherwise.
Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public Integer getMBeanCount() throws java.rmi.RemoteException
返回已在 MEJB 中注册的管理对象数。
Throws java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

getMBeanCount

Integer getMBeanCount()
                      throws RemoteException
Returns the number of managed objects registered in the MEJB.

Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name) throws javax.management.IntrospectionException, javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
此方法发现管理对象为管理而公开的属性和操作。
name | 要分析的管理对象的名称
return | 一个 MBeanInfo 实例，允许获取此管理对象的所有属性和操作。
Throws | javax.management.IntrospectionException: 如果在 introspection 期间出现异常。
Throws | javax.management.InstanceNotFoundException: 如果未找到指定的管理对象。
Throws | javax.management.ReflectionException: 试图在管理对象上执行反射时发生异常
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

getMBeanInfo

MBeanInfo getMBeanInfo(ObjectName name)
                       throws IntrospectionException,
                              InstanceNotFoundException,
                              ReflectionException,
                              RemoteException
This method discovers the attributes and operations that a managed object exposes for management.

Parameters:
name - The name of the managed object to analyze
Returns:
An instance of MBeanInfo allowing the retrieval of all attributes and operations of this managed object.
Throws:
IntrospectionException - An exception occurs during introspection.
InstanceNotFoundException - The managed object specified is not found.
ReflectionException - An exception occurred when trying to perform reflection on a managed object
RemoteException - A communication exception occurred during the execution of a remote method call

public Object getAttribute(javax.management.ObjectName name, String attribute) throws javax.management.MBeanException, javax.management.AttributeNotFoundException, javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
获取指定管理对象的特定属性值。管理对象通过其对象名称标识。
name | 管理对象的对象名称，要通过该对象名称获取管理对象的属性。
attribute | 指定要获取的属性名称的 String。
return | 检索到的属性值。
Throws | javax.management.AttributeNotFoundException: 如果指定的属性在管理对象中无法访问。
Throws | javax.management.MBeanException: 包装管理对象的获取方法所抛出的异常。
Throws | javax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throws | javax.management.ReflectionException: 试图调用 Dynamic MBean 的 getAttribute 方法时发生异常
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

getAttribute

Object getAttribute(ObjectName name,
                    String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException,
                           RemoteException
Gets the value of a specific attribute of a named managed object. The managed object is identified by its object name.

Parameters:
name - The object name of the managed object from which the attribute is to be retrieved.
attribute - A String specifying the name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute.
Throws:
AttributeNotFoundException - The attribute specified is not accessible in the managed object.
MBeanException - Wraps an exception thrown by the managed object's getter.
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
ReflectionException - An exception occurred when trying to invoke the getAttribute method of a Dynamic MBean
RemoteException - A communication exception occurred during the execution of a remote method call

public javax.management.AttributeList getAttributes(javax.management.ObjectName name, String[] attributes) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
获取指定管理对象的多个属性值。管理对象通过其对象名称标识。
name | 管理对象的对象名称，通过该对象名称获取管理对象的属性。
attributes | 要检索的属性列表。
return | 检索到的属性列表。
Throws | javax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throws | javax.management.ReflectionException: 试图调用 Dynamic MBean 的 getAttributes 方法时发生异常。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

getAttributes

AttributeList getAttributes(ObjectName name,
                            String[] attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   RemoteException
Enables the values of several attributes of a named managed object. The managed object is identified by its object name.

Parameters:
name - The object name of the managed object from which the attributes are retrieved.
attributes - A list of the attributes to be retrieved.
Returns:
The list of the retrieved attributes.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
ReflectionException - An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
RemoteException - A communication exception occurred during the execution of a remote method call

public void setAttribute(javax.management.ObjectName name, javax.management.Attribute attribute) throws javax.management.InstanceNotFoundException, javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException, java.rmi.RemoteException
设置指定管理对象的特定属性值。管理对象通过其对象名称标识。
name | 要设置其属性的管理对象的名称。
attribute | 要设置的属性的标识及其要设置成的值。
Throws | javax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throws | javax.management.AttributeNotFoundException: 如果指定的属性在管理对象中无法访问。
Throws | javax.management.InvalidAttributeValueException: 如果为该属性指定的值无效。
Throws | javax.management.MBeanException: 包装管理对象的设置方法所抛出的异常。
Throws | javax.management.ReflectionException: 试图调用 Dynamic MBean 的 setAttribute 方法时发生异常。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

setAttribute

void setAttribute(ObjectName name,
                  Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException,
                         RemoteException
Sets the value of a specific attribute of a named managed object. The managed object is identified by its object name.

Parameters:
name - The name of the managed object within which the attribute is to be set.
attribute - The identification of the attribute to be set and the value it is to be set to.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
AttributeNotFoundException - The attribute specified is not accessible in the managed object.
InvalidAttributeValueException - The value specified for the attribute is not valid.
MBeanException - Wraps an exception thrown by the managed object's setter.
ReflectionException - An exception occurred when trying to invoke the setAttribute method of a Dynamic MBean.
RemoteException - A communication exception occurred during the execution of a remote method call

public javax.management.AttributeList setAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
设置指定管理对象的多个属性值。管理对象通过其对象名称标识。
name | 要设置其属性的管理对象的对象名称。
attributes | 属性列表：要设置的属性的标识和这些属性要设置的值。
return | 已设置的属性的列表，以及它们的新值。
Throws | javax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throws | javax.management.ReflectionException: 试图调用 Dynamic MBean 的 setAttributes 方法时发生异常。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

setAttributes

AttributeList setAttributes(ObjectName name,
                            AttributeList attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   RemoteException
Sets the values of several attributes of a named managed object. The managed object is identified by its object name.

Parameters:
name - The object name of the managed object within which the attributes are to be set.
attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
Returns:
The list of attributes that were set, with their new values.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
ReflectionException - An exception occurred when trying to invoke the setAttributes method of a Dynamic MBean.
RemoteException - A communication exception occurred during the execution of a remote method call

public Object invoke(javax.management.ObjectName name, String operationName, Object[] params, String[] signature) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException, java.rmi.RemoteException
对管理对象调用某个操作。
name | 管理对象的对象名称，将对该管理对象调用方法。
operationName | 要调用的操作名。
params | 一个数组，包含调用操作时要设置的参数
signature | 包含操作签名的数组。用于加载类对象的类加载器与用于加载管理对象（要对其调用操作）的类加载器相同。
return | 该操作返回的对象，表示对指定管理对象调用该操作的结果。
Throws | javax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throws | javax.management.MBeanException: 包装对管理对象调用的方法所抛出的异常。
Throws | javax.management.ReflectionException: 包装试图调用该方法时所抛出的 java.lang.Exception。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

invoke

Object invoke(ObjectName name,
              String operationName,
              Object[] params,
              String[] signature)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException,
                     RemoteException
Invokes an operation on a managed object.

Parameters:
name - The object name of the managed object on which the method is to be invoked.
operationName - The name of the operation to be invoked.
params - An array containing the parameters to be set when the operation is invoked
signature - An array containing the signature of the operation. The class objects will be loaded using the same class loader as the one used for loading the managed object on which the operation was invoked.
Returns:
The object returned by the operation, which represents the result of invoking the operation on the managed object specified.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
MBeanException - Wraps an exception thrown by the managed object's invoked method.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method.
RemoteException - A communication exception occurred during the execution of a remote method call

public String getDefaultDomain() throws java.rmi.RemoteException
返回此 MEJB 的默认域名。
Throws java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

getDefaultDomain

String getDefaultDomain()
                        throws RemoteException
Returns the default domain name of this MEJB.

Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public ListenerRegistration getListenerRegistry() throws java.rmi.RemoteException
返回此 MEJB 的侦听器注册表实现。侦听器注册表实现的方法使客户端能在管理对象中添加和移除事件通知侦听器
return | javax.management.j2ee.ListenerRegistration 的实现。
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

getListenerRegistry

ListenerRegistration getListenerRegistry()
                                         throws RemoteException
Returns the listener registry implementation for this MEJB. The listener registry implements the methods that enable clints to add and remove event notification listeners managed objects

Returns:
An implementation of javax.management.j2ee.ListenerRegistration
Throws:
RemoteException - A communication exception occurred during the execution of a remote method call
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagementHome (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.management.j2ee
Interface ManagementHome

All Superinterfaces:
EJBHome, Remote
public interface ManagementHome
extends EJBHome

Implements: EJBHome

J2EE Management EJB 组件 (MEJB) 所需的 home 接口。J2EE 客户端必须能使用指定的 create() 方法创建一个兼容的会话对象。
英文文档：

The required home interface for the J2EE Management EJB component (MEJB). A J2EE client must be able to create a compliant session object using the specified create() method.

Author:
Hans Hrasna

Method Summary
 Management create()
Creates an MEJB session object which provides access to the J2EE Management Model
Methods inherited from interface javax.ejb.EJBHome
getEJBMetaData, getHomeHandle, remove, remove

Method Detail

public Management create() throws CreateException, java.rmi.RemoteException
创建一个 MEJB 会话对象，它提供对 J2EE Management Model 的访问。
return | 一个实现 javax.management.j2ee.Management 的 MEJB 会话对象
Throws | CreateExceotion: 指示创建 EJB 对象失败
Throws | java.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档：

create

Management create()
                  throws CreateException,
                         RemoteException
Creates an MEJB session object which provides access to the J2EE Management Model

Returns:
An MEJB session object which implements javax.management.j2ee.Management
Throws:
CreateExceotion - Indicates a failure to create the EJB object
RemoteException - A communication exception occurred during the execution of a remote method call
CreateException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.management.j2ee.statistics (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.management.j2ee.statistics

Provides the standard interfaces for accessing performance data from J2EE managed objects Package Specification JSR 77, J2EE Management Related Documentation For overviews, tutorials, examples, guides, and tool documentation, please see: J2EE Tools See:
Description

Interface Summary
BoundaryStatistic | Specifies standard measurements of the upper and lower limits of the value of an attribute.
BoundedRangeStatistic | The BoundedRangeStatistic model aggregates the attributes of RangeStatistic and BoundaryStatistic and provides standard measurements of a range that has fixed limits.
CountStatistic | Specifies standard count measurements.
EJBStats | Specifies statistics provided by all EJB component types.
EntityBeanStats | Specifies statistics provided by entity beans.
JavaMailStats | Specifies the statistics provided by a JavaMail resource.
JCAConnectionPoolStats | Specifies the statistics provided by a JCA Connection Pool
JCAConnectionStats | Specifies the statistics provided by a JCA connection
JCAStats | Specifies statistics provided by a JCA resource
JDBCConnectionPoolStats | Specifies the statistics provided by a JDBC connection pool.
JDBCConnectionStats | Specifies the statistics provided by all (pooled and non-pooled) JDBC connections.
JDBCStats | Statistics provided by a JDBC resource
JMSConnectionStats | Specifies the statistics provided by a JMS connection
JMSConsumerStats | Specifies the statistics provided by a JMS message consumer
JMSEndpointStats | Specifies the statistics provided by a JMS message producer or a JMS message consumer.
JMSProducerStats | Specifies the statistics provided by a JMS message producer
JMSSessionStats | Specifies the statistics provided by a JMS session.
JMSStats | Specifies the statistics provided by a JMS Resource
JTAStats | Specifies the statistics provided by a JTA resource.
JVMStats | Specifies the statistics provided by a Java VM.
MessageDrivenBeanStats | Specifies the statistics provided by a message driven bean.
RangeStatistic | Specifies standard measurements of the lowest and highest values an attribute has held as well as its current value.
ServletStats | Specifies the statistics provided by a Servlet.
SessionBeanStats | Specifies the statistics provided by session beans of both stateful and stateless types.
StatefulSessionBeanStats | Specifies the statistics provided by a stateful session bean.
StatelessSessionBeanStats | Specifies the statistics provided by a stateless session bean.
Statistic | The Statistic model and its sub-models specify the data models which are requried to be used to provide the performance data described by the specific attributes in the Stats models.
Stats | The Stats model and its submodels specify performance data attributes for each of the specific managed object types.
TimeStatistic | Specifies standard timing measurements.
URLStats | Specifies the statistics provided by a URL resource.

Package javax.management.j2ee.statistics Description

Provides the standard interfaces for accessing performance data from J2EE managed objects

Package Specification

  • JSR 77, J2EE Management

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • J2EE Tools

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.management.j2ee.statistics Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.management.j2ee.statistics

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.management.j2ee.statistics.JavaMailStats
  • javax.management.j2ee.statistics.Statistic
    • javax.management.j2ee.statistics.BoundaryStatistic
      • javax.management.j2ee.statistics.BoundedRangeStatistic (also extends javax.management.j2ee.statistics.RangeStatistic)
    • javax.management.j2ee.statistics.CountStatistic
    • javax.management.j2ee.statistics.RangeStatistic
      • javax.management.j2ee.statistics.BoundedRangeStatistic (also extends javax.management.j2ee.statistics.BoundaryStatistic)
    • javax.management.j2ee.statistics.TimeStatistic
  • javax.management.j2ee.statistics.Stats
    • javax.management.j2ee.statistics.EJBStats
      • javax.management.j2ee.statistics.EntityBeanStats
      • javax.management.j2ee.statistics.MessageDrivenBeanStats
      • javax.management.j2ee.statistics.SessionBeanStats
        • javax.management.j2ee.statistics.StatefulSessionBeanStats
        • javax.management.j2ee.statistics.StatelessSessionBeanStats
    • javax.management.j2ee.statistics.JCAConnectionStats
      • javax.management.j2ee.statistics.JCAConnectionPoolStats
    • javax.management.j2ee.statistics.JCAStats
    • javax.management.j2ee.statistics.JDBCConnectionStats
      • javax.management.j2ee.statistics.JDBCConnectionPoolStats
    • javax.management.j2ee.statistics.JDBCStats
    • javax.management.j2ee.statistics.JMSConnectionStats
    • javax.management.j2ee.statistics.JMSEndpointStats
      • javax.management.j2ee.statistics.JMSConsumerStats
      • javax.management.j2ee.statistics.JMSProducerStats
    • javax.management.j2ee.statistics.JMSSessionStats
    • javax.management.j2ee.statistics.JMSStats
    • javax.management.j2ee.statistics.JTAStats
    • javax.management.j2ee.statistics.JVMStats
    • javax.management.j2ee.statistics.ServletStats
    • javax.management.j2ee.statistics.URLStats
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


BoundaryStatistic (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.management.j2ee.statistics
Interface BoundaryStatistic

All Superinterfaces:
Statistic
All Known Subinterfaces:
BoundedRangeStatistic
public interface BoundaryStatistic
extends Statistic

Implements: Statistic
Implemented by: BoundedRangeStatistic

指定测量某一属性值的上限和下限的标准方法。
英文文档：

Specifies standard measurements of the upper and lower limits of the value of an attribute.

Method Summary
long | getLowerBound() The lower limit of the value of this attribute.The upper limit of the value of this attribute.
long | getUpperBound() The upper limit of the value of this attribute.
Methods inherited from interface javax.management.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit

Method Detail

public long getUpperBound()
此属性值的上限。
英文文档：

getUpperBound

long getUpperBound()
The upper limit of the value of this attribute.

public long getLowerBound()
此属性值的下限。此属性值的上限。
英文文档：

getLowerBound

long getLowerBound()
The lower limit of the value of this attribute.The upper limit of the value of this attribute.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BoundedRangeStatistic (Java EE 5)

javax.management.j2ee.statistics
Interface BoundedRangeStatistic

All Superinterfaces:
BoundaryStatistic, RangeStatistic, Statistic
public interface BoundedRangeStatistic
extends BoundaryStatistic, RangeStatistic

Implements: BoundaryStatistic, RangeStatistic

BoundedRangeStatistic 模型聚合 RangeStatistic 和 BoundaryStatistic 的属性，并提供测量具有固定限制的范围的标准方法。
英文文档：

The BoundedRangeStatistic model aggregates the attributes of RangeStatistic and BoundaryStatistic and provides standard measurements of a range that has fixed limits.

Method Summary
Methods inherited from interface javax.management.j2ee.statistics.BoundaryStatistic
getLowerBound, getUpperBound
Methods inherited from interface javax.management.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit
Methods inherited from interface javax.management.j2ee.statistics.RangeStatistic
getCurrent, getHighWaterMark, getLowWaterMark
Methods inherited from interface javax.management.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CountStatistic (Java EE 5)

javax.management.j2ee.statistics
Interface CountStatistic

All Superinterfaces:
Statistic
public interface CountStatistic
extends Statistic

Implements: Statistic

指定标准计数测量。
英文文档：

Specifies standard count measurements.

Method Summary
 long getCount()
The count since the last reset.
Methods inherited from interface javax.management.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit

Method Detail

public long getCount()
计数从上一次重置开始计算。
英文文档：

getCount

long getCount()
The count since the last reset.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBStats (Java EE 5)

javax.management.j2ee.statistics
Interface EJBStats

All Superinterfaces:
Stats
All Known Subinterfaces:
EntityBeanStats, MessageDrivenBeanStats, SessionBeanStats, StatefulSessionBeanStats, StatelessSessionBeanStats
public interface EJBStats
extends Stats

Implements: Stats
Implemented by: EntityBeanStats, MessageDrivenBeanStats, SessionBeanStats

指定所有 EJB 组件类型提供的统计信息。
英文文档：

Specifies statistics provided by all EJB component types.

Method Summary
CountStatistic | getCreateCount() Number of times create was called.
CountStatistic | getRemoveCount() Number of times remove was called.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public CountStatistic getCreateCount()
调用 create 的次数。
英文文档：

getCreateCount

CountStatistic getCreateCount()
Number of times create was called.

public CountStatistic getRemoveCount()
调用 remove 的次数。
英文文档：

getRemoveCount

CountStatistic getRemoveCount()
Number of times remove was called.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityBeanStats (Java EE 5)

javax.management.j2ee.statistics
Interface EntityBeanStats

All Superinterfaces:
EJBStats, Stats
public interface EntityBeanStats
extends EJBStats

Implements: EJBStats

指定实体 Bean 提供的统计信息。
英文文档：

Specifies statistics provided by entity beans.

Method Summary
RangeStatistic | getPooledCount() Number of beans in the pooled state.
RangeStatistic | getReadyCount() Number of beans in the ready state.
Methods inherited from interface javax.management.j2ee.statistics.EJBStats
getCreateCount, getRemoveCount
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public RangeStatistic getReadyCount()
处于就绪状态的 Bean 数。
英文文档：

getReadyCount

RangeStatistic getReadyCount()
Number of beans in the ready state.

public RangeStatistic getPooledCount()
处于已入池状态的 Bean 数。
英文文档：

getPooledCount

RangeStatistic getPooledCount()
Number of beans in the pooled state.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JavaMailStats (Java EE 5)

javax.management.j2ee.statistics
Interface JavaMailStats

public interface JavaMailStats

指定 JavaMail 资源提供的统计信息。
英文文档：

Specifies the statistics provided by a JavaMail resource.

Method Summary
 CountStatistic getSentMailCount()
The number of mail messages sent.

Method Detail

public CountStatistic getSentMailCount()
已发送的邮件消息数。
英文文档：

getSentMailCount

CountStatistic getSentMailCount()
The number of mail messages sent.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JCAConnectionPoolStats (Java EE 5)

javax.management.j2ee.statistics
Interface JCAConnectionPoolStats

All Superinterfaces:
JCAConnectionStats, Stats
public interface JCAConnectionPoolStats
extends JCAConnectionStats

Implements: JCAConnectionStats

指定 JCA 连接池提供的统计信息。
英文文档：

Specifies the statistics provided by a JCA Connection Pool

Method Summary
CountStatistic | getCloseCount() The number of connections closed
CountStatistic | getCreateCount() The number of connections created
BoundedRangeStatistic | getFreePoolSize() The number of free connections in the pool
BoundedRangeStatistic | getPoolSize() The size of the connection pool
RangeStatistic | getWaitingThreadCount() The number of threads waiting for a connection
Methods inherited from interface javax.management.j2ee.statistics.JCAConnectionStats
getConnectionFactory, getManagedConnectionFactory, getUseTime, getWaitTime
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public CountStatistic getCloseCount()
已关闭的连接数。
return
en
CountStatistic
英文文档：

getCloseCount

CountStatistic getCloseCount()
The number of connections closed

Returns:
CountStatistic

public CountStatistic getCreateCount()
已创建的连接数。
return
en
CountStatistic
英文文档：

getCreateCount

CountStatistic getCreateCount()
The number of connections created

Returns:
CountStatistic

public BoundedRangeStatistic getFreePoolSize()
池中空闲的连接数。
return
en
BoundedRangeStatistic
英文文档：

getFreePoolSize

BoundedRangeStatistic getFreePoolSize()
The number of free connections in the pool

Returns:
BoundedRangeStatistic

public BoundedRangeStatistic getPoolSize()
连接池的大小。
return
en
BoundedRangeStatistic
英文文档：

getPoolSize

BoundedRangeStatistic getPoolSize()
The size of the connection pool

Returns:
BoundedRangeStatistic

public RangeStatistic getWaitingThreadCount()
等待连接的线程数。
return
en
BoundedRangeStatistic
英文文档：

getWaitingThreadCount

RangeStatistic getWaitingThreadCount()
The number of threads waiting for a connection

Returns:
BoundedRangeStatistic
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JCAConnectionStats (Java EE 5)

javax.management.j2ee.statistics
Interface JCAConnectionStats

All Superinterfaces:
Stats
All Known Subinterfaces:
JCAConnectionPoolStats
public interface JCAConnectionStats
extends Stats

Implements: Stats
Implemented by: JCAConnectionPoolStats

指定 JCA 连接提供的统计信息。
英文文档：

Specifies the statistics provided by a JCA connection

Method Summary
String | getConnectionFactory() Returns the associated JCAConnectionFactory OBJECT_NAME
String | getManagedConnectionFactory() Returns the associated JCAManagedConnectionFactory OBJECT_NAME
TimeStatistic | getUseTime() Returns the time spent using a connection
TimeStatistic | getWaitTime() Returns the time spent waiting for a connection to be available
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public String getConnectionFactory()
返回关联的 JCAConnectionFactory OBJECT_NAME。
return 标识此连接的连接工厂的管理对象的 OBJECT_NAME (String)。
英文文档：

getConnectionFactory

String getConnectionFactory()
Returns the associated JCAConnectionFactory OBJECT_NAME

Returns:
String the OBJECT_NAME of the managed object that identifies the connection factory for this connection

public String getManagedConnectionFactory()
返回关联的 JCAManagedConnectionFactory OBJECT_NAME。
return 标识此连接管理连接工厂的管理对象的 OBJECT_NAME (String)。
英文文档：

getManagedConnectionFactory

String getManagedConnectionFactory()
Returns the associated JCAManagedConnectionFactory OBJECT_NAME

Returns:
String the OBJECT_NAME of the managed object that identifies the managed connection factory for this connection

public TimeStatistic getWaitTime()
返回等待可用连接所花费的时间。
return
en
TimeStatistic
英文文档：

getWaitTime

TimeStatistic getWaitTime()
Returns the time spent waiting for a connection to be available

Returns:
TimeStatistic

public TimeStatistic getUseTime()
返回使用连接所花费的时间。
return
en
TimeStatistic
英文文档：

getUseTime

TimeStatistic getUseTime()
Returns the time spent using a connection

Returns:
TimeStatistic
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JCAStats (Java EE 5)

javax.management.j2ee.statistics
Interface JCAStats

All Superinterfaces:
Stats
public interface JCAStats
extends Stats

Implements: Stats

指定 JCA 资源提供的统计信息。
英文文档：

Specifies statistics provided by a JCA resource

Method Summary
JCAConnectionPoolStats[] | getConnectionPools() Returns an array of JCAConnectionPool Stats that provide statistics about the connection pools associated with the referencing JCA resource statistics
JCAConnectionStats[] | getConnections() Returns an array of JCAConnectionStats that provide statistics about the non-pooled connections associated with the referencing JCA resource statistics
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public JCAConnectionStats[] getConnections()
返回一个 JCAConnectionStats 数组，它提供与引用的 JCA 资源统计信息关联的非入池连接的统计信息。
return
en
JCAConnectionStats []
英文文档：

getConnections

JCAConnectionStats[] getConnections()
Returns an array of JCAConnectionStats that provide statistics about the non-pooled connections associated with the referencing JCA resource statistics

Returns:
JCAConnectionStats []

public JCAConnectionPoolStats[] getConnectionPools()
返回一个 JCAConnectionPoolStats 数组，它提供与引用的 JCA 资源统计信息关联的连接池的统计信息。
return
en
JCAConnectionPoolStats []
英文文档：

getConnectionPools

JCAConnectionPoolStats[] getConnectionPools()
Returns an array of JCAConnectionPool Stats that provide statistics about the connection pools associated with the referencing JCA resource statistics

Returns:
JCAConnectionPoolStats []
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JDBCConnectionPoolStats (Java EE 5)

javax.management.j2ee.statistics
Interface JDBCConnectionPoolStats

All Superinterfaces:
JDBCConnectionStats, Stats
public interface JDBCConnectionPoolStats
extends JDBCConnectionStats

Implements: JDBCConnectionStats

指定 JDBC 连接池提供的统计信息。
英文文档：

Specifies the statistics provided by a JDBC connection pool.

Method Summary
CountStatistic | getCloseCount() Number of connections closed.
CountStatistic | getCreateCount() Number of connections created.
BoundedRangeStatistic | getFreePoolSize() Number of free connections in the pool.
BoundedRangeStatistic | getPoolSize() Size of the connection pool.
RangeStatistic | getWaitingThreadCount() Number of threads waiting for a connection.
Methods inherited from interface javax.management.j2ee.statistics.JDBCConnectionStats
getJdbcDataSource, getUseTime, getWaitTime
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public CountStatistic getCreateCount()
已创建的连接数。
英文文档：

getCreateCount

CountStatistic getCreateCount()
Number of connections created.

public CountStatistic getCloseCount()
已关闭的连接数。
英文文档：

getCloseCount

CountStatistic getCloseCount()
Number of connections closed.

public BoundedRangeStatistic getPoolSize()
连接池的大小。
英文文档：

getPoolSize

BoundedRangeStatistic getPoolSize()
Size of the connection pool.

public BoundedRangeStatistic getFreePoolSize()
池中空闲的连接数。
英文文档：

getFreePoolSize

BoundedRangeStatistic getFreePoolSize()
Number of free connections in the pool.

public RangeStatistic getWaitingThreadCount()
等待连接的线程数。
英文文档：

getWaitingThreadCount

RangeStatistic getWaitingThreadCount()
Number of threads waiting for a connection.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JDBCConnectionStats (Java EE 5)

javax.management.j2ee.statistics
Interface JDBCConnectionStats

All Superinterfaces:
Stats
All Known Subinterfaces:
JDBCConnectionPoolStats
public interface JDBCConnectionStats
extends Stats

Implements: Stats
Implemented by: JDBCConnectionPoolStats

指定所有（入池式和非入池）JDBC 连接提供的统计信息。
英文文档：

Specifies the statistics provided by all (pooled and non-pooled) JDBC connections.

Method Summary
String | getJdbcDataSource() Identifies the JDBC driver for the corresponding JDBCConnection.
TimeStatistic | getUseTime() Time spent using a connection.
TimeStatistic | getWaitTime() Time spent waiting for a connection to be available.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public String getJdbcDataSource()
标识相应 JDBCConnection 的 JDBC 驱动程序。
英文文档：

getJdbcDataSource

String getJdbcDataSource()
Identifies the JDBC driver for the corresponding JDBCConnection.

public TimeStatistic getWaitTime()
等待可用连接所花费的时间。
英文文档：

getWaitTime

TimeStatistic getWaitTime()
Time spent waiting for a connection to be available.

public TimeStatistic getUseTime()
使用某个连接所花费的时间。
英文文档：

getUseTime

TimeStatistic getUseTime()
Time spent using a connection.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JDBCStats (Java EE 5)

javax.management.j2ee.statistics
Interface JDBCStats

All Superinterfaces:
Stats
public interface JDBCStats
extends Stats

Implements: Stats

JDBC 资源提供的统计信息。
英文文档：

Statistics provided by a JDBC resource

Author:
Hans Hrasna

Method Summary
JDBCConnectionPoolStats[] | getConnectionPools()
JDBCConnectionStats[] | getConnections()
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public JDBCConnectionStats[] getConnections()
英文文档：

getConnections

JDBCConnectionStats[] getConnections()

public JDBCConnectionPoolStats[] getConnectionPools()
英文文档：

getConnectionPools

JDBCConnectionPoolStats[] getConnectionPools()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSConnectionStats (Java EE 5)

javax.management.j2ee.statistics
Interface JMSConnectionStats

All Superinterfaces:
Stats
public interface JMSConnectionStats
extends Stats

Implements: Stats

指定 JMS 连接提供的统计信息。
英文文档：

Specifies the statistics provided by a JMS connection

Author:
Hans Hrasna

Method Summary
JMSSessionStats[] | getSessions() Returns an array of JMSSessionStats that provide statistics about the sessions associated with the referencing JMSConnectionStats.
boolean | isTransactional() Returns the transactional state of this JMS connection.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public JMSSessionStats[] getSessions()
返回一个 JMSSessionStats 数组，它提供与引用的 JMSConnectionStats 关联的会话的统计信息。
英文文档：

getSessions

JMSSessionStats[] getSessions()
Returns an array of JMSSessionStats that provide statistics about the sessions associated with the referencing JMSConnectionStats.

public boolean isTransactional()
返回此 JMS 连接的事务状态。如果为 true，则表示此 JMS 连接是事务型的。
英文文档：

isTransactional

boolean isTransactional()
Returns the transactional state of this JMS connection. If true, indicates that this JMS connection is transactional.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSConsumerStats (Java EE 5)

javax.management.j2ee.statistics
Interface JMSConsumerStats

All Superinterfaces:
JMSEndpointStats, Stats
public interface JMSConsumerStats
extends JMSEndpointStats

Implements: JMSEndpointStats

指定 JMS 消息使用方提供的统计信息。
英文文档：

Specifies the statistics provided by a JMS message consumer

Author:
Hans Hrasna

Method Summary
 String getOrigin()
Returns a string that encapsulates the identity of a message origin
Methods inherited from interface javax.management.j2ee.statistics.JMSEndpointStats
getExpiredMessageCount, getMessageCount, getMessageWaitTime, getPendingMessageCount
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public String getOrigin()
返回封装消息源的身份的字符串。
英文文档：

getOrigin

String getOrigin()
Returns a string that encapsulates the identity of a message origin

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSEndpointStats (Java EE 5)

javax.management.j2ee.statistics
Interface JMSEndpointStats

All Superinterfaces:
Stats
All Known Subinterfaces:
JMSConsumerStats, JMSProducerStats
public interface JMSEndpointStats
extends Stats

Implements: Stats
Implemented by: JMSConsumerStats, JMSProducerStats

指定 JMS 消息生成方或 JMS 消息使用方提供的统计信息。
英文文档：

Specifies the statistics provided by a JMS message producer or a JMS message consumer.

Method Summary
CountStatistic | getExpiredMessageCount() Number of messages that expired before delivery.
CountStatistic | getMessageCount() Number of messages sent or received.
TimeStatistic | getMessageWaitTime() Time spent by a message before being delivered.
CountStatistic | getPendingMessageCount() Number of pending messages.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public CountStatistic getMessageCount()
发送或收到的消息数。
英文文档：

getMessageCount

CountStatistic getMessageCount()
Number of messages sent or received.

public CountStatistic getPendingMessageCount()
挂起的消息数。
英文文档：

getPendingMessageCount

CountStatistic getPendingMessageCount()
Number of pending messages.

public CountStatistic getExpiredMessageCount()
传送之前过期的消息数。
英文文档：

getExpiredMessageCount

CountStatistic getExpiredMessageCount()
Number of messages that expired before delivery.

public TimeStatistic getMessageWaitTime()
消息传送之前所花费的时间。
英文文档：

getMessageWaitTime

TimeStatistic getMessageWaitTime()
Time spent by a message before being delivered.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSProducerStats (Java EE 5)

javax.management.j2ee.statistics
Interface JMSProducerStats

All Superinterfaces:
JMSEndpointStats, Stats
public interface JMSProducerStats
extends JMSEndpointStats

Implements: JMSEndpointStats

指定 JMS 消息生成方提供的统计信息。
英文文档：

Specifies the statistics provided by a JMS message producer

Author:
Hans Hrasna

Method Summary
 String getDestination()
Returns a string that encapsulates the identity of the message destination
Methods inherited from interface javax.management.j2ee.statistics.JMSEndpointStats
getExpiredMessageCount, getMessageCount, getMessageWaitTime, getPendingMessageCount
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public String getDestination()
返回封装消息目的地的身份的字符串。
英文文档：

getDestination

String getDestination()
Returns a string that encapsulates the identity of the message destination

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSSessionStats (Java EE 5)

javax.management.j2ee.statistics
Interface JMSSessionStats

All Superinterfaces:
Stats
public interface JMSSessionStats
extends Stats

Implements: Stats

指定 JMS 会话提供的统计信息。
英文文档：

Specifies the statistics provided by a JMS session.

Author:
Hans Hrasna

Method Summary
JMSConsumerStats[] | getConsumers() Returns an array of JMSConsumerStats that provide statistics about the message consumers associated with the referencing JMS session statistics.
CountStatistic | getDurableSubscriptionCount() Number of durable subscriptions.
CountStatistic | getExpiredMessageCount() Number of expired messages.
CountStatistic | getMessageCount() Number of messages exchanged.
TimeStatistic | getMessageWaitTime() Time spent by a message before being delivered.
CountStatistic | getPendingMessageCount() Number of pending messages.
JMSProducerStats[] | getProducers() Returns an array of JMSProducerStats that provide statistics about the message producers associated with the referencing JMS session statistics.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public JMSProducerStats[] getProducers()
返回一个 JMSProducerStats 数组，它提供与引用的 JMS 会话统计信息关联的消息生成方的统计信息。
英文文档：

getProducers

JMSProducerStats[] getProducers()
Returns an array of JMSProducerStats that provide statistics about the message producers associated with the referencing JMS session statistics.

public JMSConsumerStats[] getConsumers()
返回一个 JMSConsumerStats 数组，它提供与引用的 JMS 会话统计信息关联的消息使用方的统计信息。
英文文档：

getConsumers

JMSConsumerStats[] getConsumers()
Returns an array of JMSConsumerStats that provide statistics about the message consumers associated with the referencing JMS session statistics.

public CountStatistic getMessageCount()
已交换的消息数。
英文文档：

getMessageCount

CountStatistic getMessageCount()
Number of messages exchanged.

public CountStatistic getPendingMessageCount()
挂起的消息数。
英文文档：

getPendingMessageCount

CountStatistic getPendingMessageCount()
Number of pending messages.

public CountStatistic getExpiredMessageCount()
已过期的消息数。
英文文档：

getExpiredMessageCount

CountStatistic getExpiredMessageCount()
Number of expired messages.

public TimeStatistic getMessageWaitTime()
消息传送之前所花费的时间。
英文文档：

getMessageWaitTime

TimeStatistic getMessageWaitTime()
Time spent by a message before being delivered.

public CountStatistic getDurableSubscriptionCount()
持久订阅的数量。
英文文档：

getDurableSubscriptionCount

CountStatistic getDurableSubscriptionCount()
Number of durable subscriptions.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JMSStats (Java EE 5)

javax.management.j2ee.statistics
Interface JMSStats

All Superinterfaces:
Stats
public interface JMSStats
extends Stats

Implements: Stats

指定 JMS 资源提供的统计信息。
英文文档：

Specifies the statistics provided by a JMS Resource

Author:
Hans Hrasna

Method Summary
 JMSConnectionStats[] getConnections()
Returns an array of JMSConnectionStats that provide statistics about the connections associated with the referencing JMS resource.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public JMSConnectionStats[] getConnections()
返回一个 JMSConnectionStats 数组，它提供与引用的 JMS 资源关联的连接的统计信息。
英文文档：

getConnections

JMSConnectionStats[] getConnections()
Returns an array of JMSConnectionStats that provide statistics about the connections associated with the referencing JMS resource.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JTAStats (Java EE 5)

javax.management.j2ee.statistics
Interface JTAStats

All Superinterfaces:
Stats
public interface JTAStats
extends Stats

Implements: Stats

指定 JTA 资源提供的统计信息。
英文文档：

Specifies the statistics provided by a JTA resource.

Method Summary
CountStatistic | getActiveCount() Number of active transactions.
CountStatistic | getCommittedCount() Number of committed transactions.
CountStatistic | getRolledbackCount() Number of rolled-back transactions.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public CountStatistic getActiveCount()
活动事务数。
英文文档：

getActiveCount

CountStatistic getActiveCount()
Number of active transactions.

public CountStatistic getCommittedCount()
已提交的事务数。
英文文档：

getCommittedCount

CountStatistic getCommittedCount()
Number of committed transactions.

public CountStatistic getRolledbackCount()
已回滚的事务数。
英文文档：

getRolledbackCount

CountStatistic getRolledbackCount()
Number of rolled-back transactions.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JVMStats (Java EE 5)

javax.management.j2ee.statistics
Interface JVMStats

All Superinterfaces:
Stats
public interface JVMStats
extends Stats

Implements: Stats

指定 Java VM 提供的统计信息。
英文文档：

Specifies the statistics provided by a Java VM.

Method Summary
BoundedRangeStatistic | getHeapSize() Size of the JVM's heap.
CountStatistic | getUpTime() Amount of time the JVM has been running.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public CountStatistic getUpTime()
JVM 已经运行的时间量。
英文文档：

getUpTime

CountStatistic getUpTime()
Amount of time the JVM has been running.

public BoundedRangeStatistic getHeapSize()
JVM 堆的大小。
英文文档：

getHeapSize

BoundedRangeStatistic getHeapSize()
Size of the JVM's heap.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageDrivenBeanStats (Java EE 5)

javax.management.j2ee.statistics
Interface MessageDrivenBeanStats

All Superinterfaces:
EJBStats, Stats
public interface MessageDrivenBeanStats
extends EJBStats

Implements: EJBStats

指定消息驱动 Bean 提供的统计信息。
英文文档：

Specifies the statistics provided by a message driven bean.

Method Summary
 CountStatistic getMessageCount()
Number of messages received.
Methods inherited from interface javax.management.j2ee.statistics.EJBStats
getCreateCount, getRemoveCount
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public CountStatistic getMessageCount()
收到的消息数。
英文文档：

getMessageCount

CountStatistic getMessageCount()
Number of messages received.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RangeStatistic (Java EE 5)

javax.management.j2ee.statistics
Interface RangeStatistic

All Superinterfaces:
Statistic
All Known Subinterfaces:
BoundedRangeStatistic
public interface RangeStatistic
extends Statistic

Implements: Statistic
Implemented by: BoundedRangeStatistic

指定测量某个属性保存的最小值、最大值及其当前值的标准方法。
英文文档：

Specifies standard measurements of the lowest and highest values an attribute has held as well as its current value.

Method Summary
long | getCurrent() The current value of this attribute.
long | getHighWaterMark() The highest value this attribute has held since the beginning of the measurement.
long | getLowWaterMark() The lowest value this attribute has held since the beginning of the measurement.
Methods inherited from interface javax.management.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit

Method Detail

public long getHighWaterMark()
此属性自测量开始以来所保存的最大值。
英文文档：

getHighWaterMark

long getHighWaterMark()
The highest value this attribute has held since the beginning of the measurement.

public long getLowWaterMark()
此属性自测量开始以来所保存的最小值。
英文文档：

getLowWaterMark

long getLowWaterMark()
The lowest value this attribute has held since the beginning of the measurement.

public long getCurrent()
此属性的当前值。
英文文档：

getCurrent

long getCurrent()
The current value of this attribute.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletStats (Java EE 5)

javax.management.j2ee.statistics
Interface ServletStats

All Superinterfaces:
Stats
public interface ServletStats
extends Stats

Implements: Stats

指定 Servlet 提供的统计信息。
英文文档：

Specifies the statistics provided by a Servlet.

Method Summary
 TimeStatistic getServiceTime()
Execution times for the methods.
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public TimeStatistic getServiceTime()
执行方法的次数。
英文文档：

getServiceTime

TimeStatistic getServiceTime()
Execution times for the methods.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SessionBeanStats (Java EE 5)

javax.management.j2ee.statistics
Interface SessionBeanStats

All Superinterfaces:
EJBStats, Stats
All Known Subinterfaces:
StatefulSessionBeanStats, StatelessSessionBeanStats
public interface SessionBeanStats
extends EJBStats

Implements: EJBStats
Implemented by: StatefulSessionBeanStats, StatelessSessionBeanStats

指定有状态和无状态类型的会话 Bean 所提供的统计信息。
英文文档：

Specifies the statistics provided by session beans of both stateful and stateless types.

Method Summary
 RangeStatistic getMethodReadyCount()
Number of beans in the method-ready state.
Methods inherited from interface javax.management.j2ee.statistics.EJBStats
getCreateCount, getRemoveCount
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public RangeStatistic getMethodReadyCount()
处于方法就绪 (method-ready) 状态的 Bean 数。
英文文档：

getMethodReadyCount

RangeStatistic getMethodReadyCount()
Number of beans in the method-ready state.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StatefulSessionBeanStats (Java EE 5)

javax.management.j2ee.statistics
Interface StatefulSessionBeanStats

All Superinterfaces:
EJBStats, SessionBeanStats, Stats
public interface StatefulSessionBeanStats
extends SessionBeanStats

Implements: SessionBeanStats

指定有状态会话 Bean 提供的统计信息。
英文文档：

Specifies the statistics provided by a stateful session bean.

Method Summary
 RangeStatistic getPassiveCount()
Number of beans that are in the passive state.
Methods inherited from interface javax.management.j2ee.statistics.SessionBeanStats
getMethodReadyCount
Methods inherited from interface javax.management.j2ee.statistics.EJBStats
getCreateCount, getRemoveCount
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Method Detail

public RangeStatistic getPassiveCount()
处于被动状态的 Bean 数。
英文文档：

getPassiveCount

RangeStatistic getPassiveCount()
Number of beans that are in the passive state.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StatelessSessionBeanStats (Java EE 5)

javax.management.j2ee.statistics
Interface StatelessSessionBeanStats

All Superinterfaces:
EJBStats, SessionBeanStats, Stats
public interface StatelessSessionBeanStats
extends SessionBeanStats

Implements: SessionBeanStats

指定无状态会话 Bean 提供的统计信息。
英文文档：

Specifies the statistics provided by a stateless session bean.

Method Summary
Methods inherited from interface javax.management.j2ee.statistics.SessionBeanStats
getMethodReadyCount
Methods inherited from interface javax.management.j2ee.statistics.EJBStats
getCreateCount, getRemoveCount
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Statistic (Java EE 5)

javax.management.j2ee.statistics
Interface Statistic

All Known Subinterfaces:
BoundaryStatistic, BoundedRangeStatistic, CountStatistic, RangeStatistic, TimeStatistic
public interface Statistic

Implemented by: BoundaryStatistic, CountStatistic, RangeStatistic, TimeStatistic

Statistic 模型及其子模型指定一些数据模型，这些数据模型用于提供 Stats 模型中的特定属性所描述的性能数据。
英文文档：

The Statistic model and its sub-models specify the data models which are requried to be used to provide the performance data described by the specific attributes in the Stats models.

Method Summary
String | getDescription() A human-readable description of the Statistic.
long | getLastSampleTime() The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
String | getName() The name of this Statistic.
long | getStartTime() The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
String | getUnit() The unit of measurement for this Statistic.

Method Detail

public String getName()
此 Statistic 的名称。
英文文档：

getName

String getName()
The name of this Statistic.

public String getUnit()
此 Statistic 的测量单位。TimeStatistic 测量的有效值包括 "HOUR"、"MINUTE"、"SECOND"、"MILLISECOND"、"MICROSECOND" 和 "NANOSECOND"。
英文文档：

getUnit

String getUnit()
The unit of measurement for this Statistic. Valid values for TimeStatistic measurements are "HOUR", "MINUTE", "SECOND", "MILLISECOND", "MICROSECOND" and "NANOSECOND".

public String getDescription()
Statistic 的可读描述。
英文文档：

getDescription

String getDescription()
A human-readable description of the Statistic.

public long getStartTime()
第一次测量的时间表示为一个 long，它的值是自 1970 年 1 月 1 日 00:00:00 以来的毫秒数。
英文文档：

getStartTime

long getStartTime()
The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.

public long getLastSampleTime()
最后一次测量的时间表示为一个 long，它的值是自 1970 年 1 月 1 日 00:00:00 以来的毫秒数。
英文文档：

getLastSampleTime

long getLastSampleTime()
The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Stats (Java EE 5)

javax.management.j2ee.statistics
Interface Stats

All Known Subinterfaces:
EJBStats, EntityBeanStats, JCAConnectionPoolStats, JCAConnectionStats, JCAStats, JDBCConnectionPoolStats, JDBCConnectionStats, JDBCStats, JMSConnectionStats, JMSConsumerStats, JMSEndpointStats, JMSProducerStats, JMSSessionStats, JMSStats, JTAStats, JVMStats, MessageDrivenBeanStats, ServletStats, SessionBeanStats, StatefulSessionBeanStats, StatelessSessionBeanStats, URLStats
public interface Stats

Implemented by: EJBStats, JCAConnectionStats, JCAStats, JDBCConnectionStats, JDBCStats, JMSConnectionStats, JMSEndpointStats, JMSSessionStats, JMSStats, JTAStats, JVMStats, ServletStats, URLStats

Stats 模型及其子模型指定每个特定管理对象类型的性能数据属性。
英文文档：

The Stats model and its submodels specify performance data attributes for each of the specific managed object types.

Method Summary
Statistic | getStatistic(String statisticName) Get a Statistic by name.
String[] | getStatisticNames() Returns an array of Strings which are the names of the attributes from the specific Stats submodel that this object supports.
Statistic[] | getStatistics() Returns an array containing all of the Statistic objects supported by this Stats object.

Method Detail

public Statistic getStatistic(String statisticName)
通过名称获取 Statistic。
英文文档：

getStatistic

Statistic getStatistic(String statisticName)
Get a Statistic by name.

public String[] getStatisticNames()
返回一个 String 数组，它是此对象支持的特定 Stats 子模型的属性名称。列表中指定的属性必须对应于将返回相应类型的 Statistic 对象的属性，这些对象包含有效的性能数据。对于不包含在 statisticNames 列表中的 Stats 子模型，返回的属性值必须为 null。对于 statisticNames 列表中的每个名称，统计信息列表中必须有一个相同名称的 Statistic。
英文文档：

getStatisticNames

String[] getStatisticNames()
Returns an array of Strings which are the names of the attributes from the specific Stats submodel that this object supports. Attributes named in the list must correspond to attributes that will return a Statistic object of the appropriate type which contains valid performance data. The return value of attributes in the Stats submodel that are not included in the statisticNames list must be null. For each name in the statisticNames list there must be one Statistic with the same name in the statistics list.

public Statistic[] getStatistics()
返回一个包含此 Stats 对象支持的所有 Statistic 对象的数组。
英文文档：

getStatistics

Statistic[] getStatistics()
Returns an array containing all of the Statistic objects supported by this Stats object.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TimeStatistic (Java EE 5)

javax.management.j2ee.statistics
Interface TimeStatistic

All Superinterfaces:
Statistic
public interface TimeStatistic
extends Statistic

Implements: Statistic

指定标准计时测量。
英文文档：

Specifies standard timing measurements.

Method Summary
long | getCount() Number of times the operation was invoked since the beginning of this measurement.
long | getMaxTime() The maximum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
long | getMinTime() The minimum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
long | getTotalTime() This is the sum total of time taken to complete every invocation of this operation since the beginning of this measurement.
Methods inherited from interface javax.management.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit

Method Detail

public long getCount()
自此测量开始以来，调用此操作的时间。
英文文档：

getCount

long getCount()
Number of times the operation was invoked since the beginning of this measurement.

public long getMaxTime()
自此测量开始以来，完成此操作的一次调用所花费的最大时间量。
英文文档：

getMaxTime

long getMaxTime()
The maximum amount of time taken to complete one invocation of this operation since the beginning of this measurement.

public long getMinTime()
自此测量开始以来，完成此操作的一次调用所花费的最小时间量。
英文文档：

getMinTime

long getMinTime()
The minimum amount of time taken to complete one invocation of this operation since the beginning of this measurement.

public long getTotalTime()
自此测量开始以来，每次完成调用此操作所费时间的总和。用 totalTime 除以该数将得到此操作的平均执行时间。
英文文档：

getTotalTime

long getTotalTime()
This is the sum total of time taken to complete every invocation of this operation since the beginning of this measurement. Dividing totalTime by count will give you the average execution time for this operation.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


URLStats (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.management.j2ee.statistics
Interface URLStats

All Superinterfaces:
Stats
public interface URLStats
extends Stats

Implements: Stats

指定 URL 资源提供的统计信息。
英文文档：

Specifies the statistics provided by a URL resource.

Method Summary
Methods inherited from interface javax.management.j2ee.statistics.Stats
getStatistic, getStatisticNames, getStatistics

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.persistence (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.persistence

The javax.persistence package contains the classes and interfaces that define the contracts between a persistence provider and the managed classes and the clients of the Java Persistence API.

See:
Description

Interface Summary
EntityManager | Interface used to interact with the persistence context.
EntityManagerFactory | The EntityManagerFactory interface is used by the application to obtain an application-managed entity manager.
EntityTransaction | The EntityTransaction interface is used to control resource transactions on resource-local entity managers.
Query | Interface used to control query execution.

Class Summary
Persistence Bootstrap class that is used to obtain an EntityManagerFactory.

Enum Summary
CascadeType | Defines the set of cascadable operations that are propagated to the associated entity.
DiscriminatorType | Defines supported types of the discriminator column.
EnumType | Defines mapping for the enumerated types.
FetchType | Defines strategies for fetching data from the database.
FlushModeType | Flush mode setting.
GenerationType | Defines the types of primary key generation.
InheritanceType | Defines inheritance strategy options.
LockModeType | Lock modes that can be specified by means of the EntityManager.lock() method.
PersistenceContextType | Specifies whether a transaction-scoped or extended persistence context is to be used in PersistenceContext.
TemporalType | Type used to indicate a specific mapping of Date or Calendar.

Exception Summary
EntityExistsException | Thrown by the persistence provider when EntityManager.persist(Object) is called and the entity already exists.
EntityNotFoundException | Thrown by the persistence provider when an entity reference obtained by EntityManager.getReference(Class,Object) is accessed but the entity does not exist.
NonUniqueResultException | Thrown by the persistence provider when getSingleResult() is executed on a query and there is more than one result from the query.
NoResultException | Thrown by the persistence provider when getSingleResult() is executed on a query and there is no result to return.
OptimisticLockException | Thrown by the persistence provider when an optimistic locking conflict occurs.
PersistenceException | Thrown by the persistence provider when a problem occurs.
RollbackException | Thrown by the persistence provider when the EntityTransaction.commit() fails.
TransactionRequiredException | Thrown by the persistence provider when a transaction is required but is not active.

Annotation Types Summary
AssociationOverride | This annotation is used to override a many-to-one or one-to-one mapping of property or field for an entity relationship.
AssociationOverrides | This annotation is used to override mappings of multiple many-to-one or one-to-one relationship properties or fields.
AttributeOverride | The AttributeOverride annotation is used to override the mapping of a Basic (whether explicit or default) property or field or Id property or field.
AttributeOverrides | Is used to override mappings of multiple properties or fields.
Basic | The Basic annotation is the simplest type of mapping to a database column.
Column | Is used to specify a mapped column for a persistent property or field.
ColumnResult | References name of a column in the SELECT clause of a SQL query - i.e., column alias, if applicable.
DiscriminatorColumn | Is used to define the discriminator column for the SINGLE_TABLE and JOINED inheritance mapping strategies.
DiscriminatorValue | Is used to specify the value of the discriminator column for entities of the given type.
Embeddable | Defines a class whose instances are stored as an intrinsic part of an owning entity and share the identity of the entity.
Embedded | Defines a persistent field or property of an entity whose value is an instance of an embeddable class.
EmbeddedId | Is applied to a persistent field or property of an entity class or mapped superclass to denote a composite primary key that is an embeddable class.
Entity | Specifies that the class is an entity.
EntityListeners | Specifies the callback listener classes to be used for an entity or mapped superclass.
EntityResult | References an entity in the SELECT clause of a SQL query.
Enumerated | Specifies that a persistent property or field should be persisted as a enumerated type.
ExcludeDefaultListeners | Specifies that the invocation of default listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
ExcludeSuperclassListeners | Specifies that the invocation of superclass listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
FieldResult | Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class.
GeneratedValue | Provides for the specification of generation strategies for the values of primary keys.
Id | Specifies the primary key property or field of an entity.
IdClass | Specifies a composite primary key class that is mapped to multiple fields or properties of the entity.
Inheritance | Defines the inheritance strategy to be used for an entity class hierarchy.
JoinColumn | Is used to specify a mapped column for joining an entity association.
JoinColumns | Defines mapping for the composite foreign keys.
JoinTable | This annotation is used in the mapping of associations.
Lob | Specifies that a persistent property or field should be persisted as a large object to a database-supported large object type.
ManyToMany | Defines a many-valued association with many-to-many multiplicity.
ManyToOne | This annotation defines a single-valued association to another entity class that has many-to-one multiplicity.
MapKey | Is used to specify the map key for associations of type Map.
MappedSuperclass | Designates a class whose mapping information is applied to the entities that inherit from it.
NamedNativeQueries | Is used to specify an array of native SQL named queries.
NamedNativeQuery | Is used to specify a native SQL named query.
NamedQueries | Specifies an array of named Java Persistence query language queries.
NamedQuery | Is used to specify a named query in the Java Persistence query language, which is a static query expressed in metadata.
OneToMany | Defines a many-valued association with one-to-many multiplicity.
OneToOne | This annotation defines a single-valued association to another entity that has one-to-one multiplicity.
OrderBy | This annotation specifies the ordering of the elements of a collection valued association at the point when the association is retrieved.
PersistenceContext | Expresses a dependency on an EntityManager persistence context.
PersistenceContexts | Declares one or more PersistenceContext annotations.
PersistenceProperty | Describes a single container or persistence provider property.
PersistenceUnit | Expresses a dependency on an EntityManagerFactory.
PersistenceUnits | Declares one or more PersistenceUnit annotations.
PostLoad | Is used to specify callback methods for the corresponding lifecycle event.
PostPersist | Is used to specify callback methods for the corresponding lifecycle event.
PostRemove | Is used to specify callback methods for the corresponding lifecycle event.
PostUpdate | Is used to specify callback methods for the corresponding lifecycle event.
PrePersist | Is used to specify callback methods for the corresponding lifecycle event.
PreRemove | Is used to specify callback methods for the corresponding lifecycle event.
PreUpdate | Is used to specify callback methods for the corresponding lifecycle event.
PrimaryKeyJoinColumn | This annotation specifies a primary key column that is used as a foreign key to join to another table.
PrimaryKeyJoinColumns | This annotation groups PrimaryKeyJoinColumn annotations.
QueryHint | An implementation-specific Query hint.
SecondaryTable | This annotation is used to specify a secondary table for the annotated entity class.
SecondaryTables | This annotation is used to specify multiple secondary tables for an entity.
SequenceGenerator | This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
SqlResultSetMapping | This annotation is used to specify the mapping of the result of a native SQL query.
SqlResultSetMappings | This annotation is used to define one or more SqlResultSetMapping.
Table | This annotation specifies the primary table for the annotated entity.
TableGenerator | This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
Temporal | This annotation must be specified for persistent fields or properties of type Date and Calendar.
Transient | This annotation specifies that the property or field is not persistent.
UniqueConstraint | This annotation is used to specify that a unique constraint is to be included in the generated DDL for a primary or secondary table.
Version | This annotation specifies the version field or property of an entity class that serves as its optimistic lock value.

Package javax.persistence Description

The javax.persistence package contains the classes and interfaces that define the contracts between a persistence provider and the managed classes and the clients of the Java Persistence API.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.persistence Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.persistence

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.persistence.Persistence
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.persistence.PersistenceException
            • javax.persistence.EntityExistsException
            • javax.persistence.EntityNotFoundException
            • javax.persistence.NonUniqueResultException
            • javax.persistence.NoResultException
            • javax.persistence.OptimisticLockException
            • javax.persistence.RollbackException
            • javax.persistence.TransactionRequiredException

Interface Hierarchy

  • javax.persistence.EntityManager
  • javax.persistence.EntityManagerFactory
  • javax.persistence.EntityTransaction
  • javax.persistence.Query

Annotation Type Hierarchy

  • javax.persistence.AssociationOverride (implements java.lang.annotation.Annotation)
  • javax.persistence.AssociationOverrides (implements java.lang.annotation.Annotation)
  • javax.persistence.AttributeOverride (implements java.lang.annotation.Annotation)
  • javax.persistence.AttributeOverrides (implements java.lang.annotation.Annotation)
  • javax.persistence.Basic (implements java.lang.annotation.Annotation)
  • javax.persistence.Column (implements java.lang.annotation.Annotation)
  • javax.persistence.ColumnResult (implements java.lang.annotation.Annotation)
  • javax.persistence.DiscriminatorColumn (implements java.lang.annotation.Annotation)
  • javax.persistence.DiscriminatorValue (implements java.lang.annotation.Annotation)
  • javax.persistence.Embeddable (implements java.lang.annotation.Annotation)
  • javax.persistence.Embedded (implements java.lang.annotation.Annotation)
  • javax.persistence.EmbeddedId (implements java.lang.annotation.Annotation)
  • javax.persistence.Entity (implements java.lang.annotation.Annotation)
  • javax.persistence.EntityListeners (implements java.lang.annotation.Annotation)
  • javax.persistence.EntityResult (implements java.lang.annotation.Annotation)
  • javax.persistence.Enumerated (implements java.lang.annotation.Annotation)
  • javax.persistence.ExcludeDefaultListeners (implements java.lang.annotation.Annotation)
  • javax.persistence.ExcludeSuperclassListeners (implements java.lang.annotation.Annotation)
  • javax.persistence.FieldResult (implements java.lang.annotation.Annotation)
  • javax.persistence.GeneratedValue (implements java.lang.annotation.Annotation)
  • javax.persistence.Id (implements java.lang.annotation.Annotation)
  • javax.persistence.IdClass (implements java.lang.annotation.Annotation)
  • javax.persistence.Inheritance (implements java.lang.annotation.Annotation)
  • javax.persistence.JoinColumn (implements java.lang.annotation.Annotation)
  • javax.persistence.JoinColumns (implements java.lang.annotation.Annotation)
  • javax.persistence.JoinTable (implements java.lang.annotation.Annotation)
  • javax.persistence.Lob (implements java.lang.annotation.Annotation)
  • javax.persistence.ManyToMany (implements java.lang.annotation.Annotation)
  • javax.persistence.ManyToOne (implements java.lang.annotation.Annotation)
  • javax.persistence.MapKey (implements java.lang.annotation.Annotation)
  • javax.persistence.MappedSuperclass (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedNativeQueries (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedNativeQuery (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedQueries (implements java.lang.annotation.Annotation)
  • javax.persistence.NamedQuery (implements java.lang.annotation.Annotation)
  • javax.persistence.OneToMany (implements java.lang.annotation.Annotation)
  • javax.persistence.OneToOne (implements java.lang.annotation.Annotation)
  • javax.persistence.OrderBy (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceContext (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceContexts (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceProperty (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceUnit (implements java.lang.annotation.Annotation)
  • javax.persistence.PersistenceUnits (implements java.lang.annotation.Annotation)
  • javax.persistence.PostLoad (implements java.lang.annotation.Annotation)
  • javax.persistence.PostPersist (implements java.lang.annotation.Annotation)
  • javax.persistence.PostRemove (implements java.lang.annotation.Annotation)
  • javax.persistence.PostUpdate (implements java.lang.annotation.Annotation)
  • javax.persistence.PrePersist (implements java.lang.annotation.Annotation)
  • javax.persistence.PreRemove (implements java.lang.annotation.Annotation)
  • javax.persistence.PreUpdate (implements java.lang.annotation.Annotation)
  • javax.persistence.PrimaryKeyJoinColumn (implements java.lang.annotation.Annotation)
  • javax.persistence.PrimaryKeyJoinColumns (implements java.lang.annotation.Annotation)
  • javax.persistence.QueryHint (implements java.lang.annotation.Annotation)
  • javax.persistence.SecondaryTable (implements java.lang.annotation.Annotation)
  • javax.persistence.SecondaryTables (implements java.lang.annotation.Annotation)
  • javax.persistence.SequenceGenerator (implements java.lang.annotation.Annotation)
  • javax.persistence.SqlResultSetMapping (implements java.lang.annotation.Annotation)
  • javax.persistence.SqlResultSetMappings (implements java.lang.annotation.Annotation)
  • javax.persistence.Table (implements java.lang.annotation.Annotation)
  • javax.persistence.TableGenerator (implements java.lang.annotation.Annotation)
  • javax.persistence.Temporal (implements java.lang.annotation.Annotation)
  • javax.persistence.Transient (implements java.lang.annotation.Annotation)
  • javax.persistence.UniqueConstraint (implements java.lang.annotation.Annotation)
  • javax.persistence.Version (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.persistence.CascadeType
      • javax.persistence.DiscriminatorType
      • javax.persistence.EnumType
      • javax.persistence.FetchType
      • javax.persistence.FlushModeType
      • javax.persistence.GenerationType
      • javax.persistence.InheritanceType
      • javax.persistence.LockModeType
      • javax.persistence.PersistenceContextType
      • javax.persistence.TemporalType
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


EntityManager (Java EE 5)

javax.persistence
Interface EntityManager

public interface EntityManager

用于与持久性上下文交互的接口。

EntityManager 实例与持久性上下文关联。持久性上下文是一组实体实例，其中任何持久实体身份都对应一个唯一的实体实例。在持久性上下文中，可以管理实体实例及其生命周期。此接口定义用于与持久性上下文交互的方法。EntityManager API 用于创建和移除持久性实体实例，根据主键查找实体以及对实体进行查询。

可以由给定 EntityManager 实例管理的实体集是由持久性单元定义的。持久性单元定义与应用程序相关或应用程序组合的所有类的集合，以及那些必须同时映射到单个数据库的类。

since
en
Java Persistence 1.0
英文文档：

Interface used to interact with the persistence context.

An EntityManager instance is associated with a persistence context. A persistence context is a set of entity instances in which for any persistent entity identity there is a unique entity instance. Within the persistence context, the entity instances and their lifecycle are managed. This interface defines the methods that are used to interact with the persistence context. The EntityManager API is used to create and remove persistent entity instances, to find entities by their primary key, and to query over entities.

The set of entities that can be managed by a given EntityManager instance is defined by a persistence unit. A persistence unit defines the set of all classes that are related or grouped by the application, and which must be colocated in their mapping to a single database.

Since:
Java Persistence 1.0

Method Summary
 void clear()
Clear the persistence context, causing all managed entities to become detached.
 void close()
Close an application-managed EntityManager.
 boolean contains(Object entity)
Check if the instance belongs to the current persistence context.
 Query createNamedQuery(String name)
Create an instance of Query for executing a named query (in the Java Persistence query language or in native SQL).
 Query createNativeQuery(String sqlString)
Create an instance of Query for executing a native SQL statement, e.g., for update or delete.
 Query createNativeQuery(String sqlString, Class resultClass)
Create an instance of Query for executing a native SQL query.
 Query createNativeQuery(String sqlString, String resultSetMapping)
Create an instance of Query for executing a native SQL query.
 Query createQuery(String qlString)
Create an instance of Query for executing a Java Persistence query language statement.
<T> T
find(Class<T> entityClass, Object primaryKey)
Find by primary key.
 void flush()
Synchronize the persistence context to the underlying database.
 Object getDelegate()
Return the underlying provider object for the EntityManager, if available.
 FlushModeType getFlushMode()
Get the flush mode that applies to all objects contained in the persistence context.
<T> T
getReference(Class<T> entityClass, Object primaryKey)
Get an instance, whose state may be lazily fetched.
 EntityTransaction getTransaction()
Returns the resource-level transaction object.
 boolean isOpen()
Determine whether the EntityManager is open.
 void joinTransaction()
Indicate to the EntityManager that a JTA transaction is active.
 void lock(Object entity, LockModeType lockMode)
Set the lock mode for an entity object contained in the persistence context.
<T> T
merge(T entity)
Merge the state of the given entity into the current persistence context.
 void persist(Object entity)
Make an entity instance managed and persistent.
 void refresh(Object entity)
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.
 void remove(Object entity)
Remove the entity instance.
 void setFlushMode(FlushModeType flushMode)
Set the flush mode that applies to all objects contained in the persistence context.

Method Detail

public void persist(Object entity)
使实体实例被管理并持久化。
entity |
Throws | EntityExistsException: 如果实体已经存在。（调用持久操作时，可能抛出 EntityExistsException；刷新或提交时，可能抛出 EntityExistsException 或另一个 PersistenceException。）
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | IllegalArgumentException: 如果不是实体
Throws | TransactionRequiredException: 如果对 PersistenceContextType.TRANSACTION 类型的容器管理的实体管理器调用，但没有事务。
英文文档：

persist

void persist(Object entity)
Make an entity instance managed and persistent.

Parameters:
entity -
Throws:
EntityExistsException - if the entity already exists. (The EntityExistsException may be thrown when the persist operation is invoked, or the EntityExistsException or another PersistenceException may be thrown at flush or commit time.)
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if not an entity
TransactionRequiredException - if invoked on a container-managed entity manager of type PersistenceContextType.TRANSACTION and there is no transaction.

英文文档：

merge

<T> T merge(T entity)
Merge the state of the given entity into the current persistence context.

Parameters:
entity -
Returns:
the instance that the state was merged to
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if instance is not an entity or is a removed entity
TransactionRequiredException - if invoked on a container-managed entity manager of type PersistenceContextType.TRANSACTION and there is no transaction.

public void remove(Object entity)
移除实体实例。
entity |
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | IllegalArgumentException: 如果不是实体或者为已脱离的实体
Throws | TransactionRequiredException: 如果对 PersistenceContextType.TRANSACTION 类型的容器管理的实体管理器调用，但没有事务。
英文文档：

remove

void remove(Object entity)
Remove the entity instance.

Parameters:
entity -
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if not an entity or if a detached entity
TransactionRequiredException - if invoked on a container-managed entity manager of type PersistenceContextType.TRANSACTION and there is no transaction.

英文文档：

find

<T> T find(Class<T> entityClass,
           Object primaryKey)
Find by primary key.

Parameters:
entityClass -
primaryKey -
Returns:
the found entity instance or null if the entity does not exist
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if the first argument does not denote an entity type or the second argument is not a valid type for that entity's primary key

英文文档：

getReference

<T> T getReference(Class<T> entityClass,
                   Object primaryKey)
Get an instance, whose state may be lazily fetched. If the requested instance does not exist in the database, throws EntityNotFoundException when the instance state is first accessed. (The persistence provider runtime is permitted to throw EntityNotFoundException when getReference(java.lang.Class, java.lang.Object) is called.) The application should not expect that the instance state will be available upon detachment, unless it was accessed by the application while the entity manager was open.

Parameters:
entityClass -
primaryKey -
Returns:
the found entity instance
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if the first argument does not denote an entity type or the second argument is not a valid type for that entity's primary key
EntityNotFoundException - if the entity state cannot be accessed

public void flush()
使持久性上下文与底层数据库同步。
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | TransactionRequiredException: 如果没有事务
Throws | PersistenceException: 如果刷新失败
英文文档：

flush

void flush()
Synchronize the persistence context to the underlying database.

Throws:
IllegalStateException - if this EntityManager has been closed.
TransactionRequiredException - if there is no transaction
PersistenceException - if the flush fails

public void setFlushMode(FlushModeType flushMode)
设置应用于持久性上下文中包含的所有对象的刷新模式。
flushMode |
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
英文文档：

setFlushMode

void setFlushMode(FlushModeType flushMode)
Set the flush mode that applies to all objects contained in the persistence context.

Parameters:
flushMode -
Throws:
IllegalStateException - if this EntityManager has been closed.

public FlushModeType getFlushMode()
获取应用于持久性上下文中包含的所有对象的刷新模式。
return | 刷新模式
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
英文文档：

getFlushMode

FlushModeType getFlushMode()
Get the flush mode that applies to all objects contained in the persistence context.

Returns:
flush mode
Throws:
IllegalStateException - if this EntityManager has been closed.

public void lock(Object entity, LockModeType lockMode)
设置持久性上下文中包含的实体对象的锁定模式。
entity |
lockMode |
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | PersistenceException: 如果执行了不受支持的锁定调用
Throws | IllegalArgumentException: 如果实例不是实体，或者是已脱离的实体
Throws | TransactionRequiredException: 如果没有事务
英文文档：

lock

void lock(Object entity,
          LockModeType lockMode)
Set the lock mode for an entity object contained in the persistence context.

Parameters:
entity -
lockMode -
Throws:
IllegalStateException - if this EntityManager has been closed.
PersistenceException - if an unsupported lock call is made
IllegalArgumentException - if the instance is not an entity or is a detached entity
TransactionRequiredException - if there is no transaction

public void refresh(Object entity)
从数据库刷新实例的状态，重写对实体所作的更改（如果有）。
entity |
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | IllegalArgumentException: 如果不是实体或者实体不受管理
Throws | TransactionRequiredException: 如果对 PersistenceContextType.TRANSACTION 类型的容器管理的实体管理器调用，但没有事务。
Throws | EntityNotFoundException: 如果数据库中不再存在该实体。
英文文档：

refresh

void refresh(Object entity)
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.

Parameters:
entity -
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if not an entity or entity is not managed
TransactionRequiredException - if invoked on a container-managed entity manager of type PersistenceContextType.TRANSACTION and there is no transaction.
EntityNotFoundException - if the entity no longer exists in the database.

public void clear()
清除持久性上下文，使所有被管理的实体变为脱离实体。尚未刷新到数据库的实体更改不具有持久性。
Throws IllegalStateException: 如果已经关闭了此 EntityManager。
英文文档：

clear

void clear()
Clear the persistence context, causing all managed entities to become detached. Changes made to entities that have not been flushed to the database will not be persisted.

Throws:
IllegalStateException - if this EntityManager has been closed.

public boolean contains(Object entity)
检查实例是否属于当前持久性上下文。
entity |
return | 如果实例属于当前持久性上下文，则返回 true。
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | IllegalArgumentException: 如果不是实体
英文文档：

contains

boolean contains(Object entity)
Check if the instance belongs to the current persistence context.

Parameters:
entity -
Returns:
true if the instance belongs to the current persistence context.
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if not an entity

public Query createQuery(String qlString)
创建 Query 实例以执行 Java Persistence 查询语言语句。
qlString | Java Persistence 查询语言查询字符串
return | 新的查询实例
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | IllegalArgumentException: 如果查询字符串无效
英文文档：

createQuery

Query createQuery(String qlString)
Create an instance of Query for executing a Java Persistence query language statement.

Parameters:
qlString - a Java Persistence query language query string
Returns:
the new query instance
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if query string is not valid

public Query createNamedQuery(String name)
创建 Query 实例以执行指定的查询（使用 Java Persistence 查询语言或本机 SQL）。
name | 元数据中定义的查询名称
return | 新的查询实例
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | IllegalArgumentException: 如果查询没有使用给定的名称定义
英文文档：

createNamedQuery

Query createNamedQuery(String name)
Create an instance of Query for executing a named query (in the Java Persistence query language or in native SQL).

Parameters:
name - the name of a query defined in metadata
Returns:
the new query instance
Throws:
IllegalStateException - if this EntityManager has been closed.
IllegalArgumentException - if a query has not been defined with the given name

public Query createNativeQuery(String sqlString)
创建 Query 实例以执行本机 SQL 语句，例如，更新或删除。
sqlString | 本机 SQL 查询字符串
return | 新的查询实例
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
英文文档：

createNativeQuery

Query createNativeQuery(String sqlString)
Create an instance of Query for executing a native SQL statement, e.g., for update or delete.

Parameters:
sqlString - a native SQL query string
Returns:
the new query instance
Throws:
IllegalStateException - if this EntityManager has been closed.

public Query createNativeQuery(String sqlString, Class<T> resultClass)
创建 Query 实例以执行本机 SQL 查询。
sqlString | 本机 SQL 查询字符串
resultClass | 结果实例的类
return | 新的查询实例
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
英文文档：

createNativeQuery

Query createNativeQuery(String sqlString,
                        Class resultClass)
Create an instance of Query for executing a native SQL query.

Parameters:
sqlString - a native SQL query string
resultClass - the class of the resulting instance(s)
Returns:
the new query instance
Throws:
IllegalStateException - if this EntityManager has been closed.

public Query createNativeQuery(String sqlString, String resultSetMapping)
创建 Query 实例以执行本机 SQL 查询。
sqlString | 本机 SQL 查询字符串
resultSetMapping | 结果集映射的名称
return | 新的查询实例
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
英文文档：

createNativeQuery

Query createNativeQuery(String sqlString,
                        String resultSetMapping)
Create an instance of Query for executing a native SQL query.

Parameters:
sqlString - a native SQL query string
resultSetMapping - the name of the result set mapping
Returns:
the new query instance
Throws:
IllegalStateException - if this EntityManager has been closed.

public void joinTransaction()
指示 EntityManager JTA 事务处于活动状态。此方法应该对管理 JTA 应用程序的 EntityManager（在活动事务的作用域以外创建）调用，以使其与当前的 JTA 事务关联。
Throws | IllegalStateException: 如果已经关闭了此 EntityManager。
Throws | TransactionRequiredException: 如果没有事务。
英文文档：

joinTransaction

void joinTransaction()
Indicate to the EntityManager that a JTA transaction is active. This method should be called on a JTA application managed EntityManager that was created outside the scope of the active transaction to associate it with the current JTA transaction.

Throws:
IllegalStateException - if this EntityManager has been closed.
TransactionRequiredException - if there is no transaction.

public Object getDelegate()
返回 EntityManager 的底层提供者对象（如果存在）。此方法的结果与实现有关。
Throws IllegalStateException: 如果已经关闭了此 EntityManager。
英文文档：

getDelegate

Object getDelegate()
Return the underlying provider object for the EntityManager, if available. The result of this method is implementation specific.

Throws:
IllegalStateException - if this EntityManager has been closed.

public void close()
关闭应用程序管理的 EntityManager。调用 close 方法后，EntityManager 实例的所有方法以及从中获得的任何 Query 对象都将对 getTransaction 和 isOpen（返回 false）抛出 IllegalStateException 异常。如果在 EntityManager 与活动事务关联时调用此方法，则持久性上下文保持被管理状态，直到事务完成为止。
Throws IllegalStateException: 如果 EntityManager 是容器管理的，或者已经关闭。
英文文档：

close

void close()
Close an application-managed EntityManager. After the close method has been invoked, all methods on the EntityManager instance and any Query objects obtained from it will throw the IllegalStateException except for getTransaction and isOpen (which will return false). If this method is called when the EntityManager is associated with an active transaction, the persistence context remains managed until the transaction completes.

Throws:
IllegalStateException - if the EntityManager is container-managed or has been already closed..

public boolean isOpen()
确定 EntityManager 是否打开。
return 在 EntityManager 关闭前返回 true。
英文文档：

isOpen

boolean isOpen()
Determine whether the EntityManager is open.

Returns:
true until the EntityManager has been closed.

public EntityTransaction getTransaction()
返回资源级的事务对象。EntityTransaction 实例可以连续使用，以开始和提交多个事务。
return | EntityTransaction 实例
Throws | IllegalStateException: 如果对 JTA EntityManager 调用。
英文文档：

getTransaction

EntityTransaction getTransaction()
Returns the resource-level transaction object. The EntityTransaction instance may be used serially to begin and commit multiple transactions.

Returns:
EntityTransaction instance
Throws:
IllegalStateException - if invoked on a JTA EntityManager.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityManagerFactory (Java EE 5)

javax.persistence
Interface EntityManagerFactory

public interface EntityManagerFactory

应用程序使用 EntityManagerFactory 接口获取应用程序管理的实体管理器。使用实体管理器工厂完成应用程序和/或应用程序关闭时，应用程序应该关闭实体管理器工厂。关闭 EntityManagerFactory 后，它的所有实体管理器应该视为处于已关闭状态。
since
en
Java Persistence 1.0
英文文档：

The EntityManagerFactory interface is used by the application to obtain an application-managed entity manager. When the application has finished using the entity manager factory, and/or at application shutdown, the application should close the entity manager factory. Once an EntityManagerFactory has been closed, all its entity managers are considered to be in the closed state.

Since:
Java Persistence 1.0

Method Summary
void | close() Close the factory, releasing any resources that it holds.
EntityManager | createEntityManager() Create a new EntityManager.
EntityManager | createEntityManager(Map map) Create a new EntityManager with the specified Map of properties.
boolean | isOpen() Indicates whether or not this factory is open.

Method Detail

public EntityManager createEntityManager()
创建新的 EntityManager。每次调用此方法时都返回一个新的 EntityManager 实例。isOpen 方法将对返回的实例返回 true。
英文文档：

createEntityManager

EntityManager createEntityManager()
Create a new EntityManager. This method returns a new EntityManager instance each time it is invoked. The isOpen method will return true on the returned instance.

public EntityManager createEntityManager(java.util.Map<K, V> map)
创建带指定属性 Map 的新 EntityManager。每次调用此方法时都返回一个新的 EntityManager 实例。isOpen 方法将对返回的实例返回 true。
英文文档：

createEntityManager

EntityManager createEntityManager(Map map)
Create a new EntityManager with the specified Map of properties. This method returns a new EntityManager instance each time it is invoked. The isOpen method will return true on the returned instance.

public void close()
关闭工厂，释放它占用的所有资源。关闭工厂实例之后，对其调用的所有方法都将抛出 IllegalStateException（isOpen 除外，它返回 false）。关闭 EntityManagerFactory 后，它的所有实体管理器应该视为处于已关闭状态。
英文文档：

close

void close()
Close the factory, releasing any resources that it holds. After a factory instance is closed, all methods invoked on it will throw an IllegalStateException, except for isOpen, which will return false. Once an EntityManagerFactory has been closed, all its entity managers are considered to be in the closed state.

public boolean isOpen()
指示此工厂是否处于打开状态。在调用 close 之前返回 true。
英文文档：

isOpen

boolean isOpen()
Indicates whether or not this factory is open. Returns true until a call to close has been made.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityTransaction (Java EE 5)

javax.persistence
Interface EntityTransaction

public interface EntityTransaction

EntityTransaction 接口，用于控制本地资源实体管理器的资源事务。getTransaction EntityManager.getTransaction() 方法返回 EntityTransaction 接口。
since
en
Java Persistence 1.0
英文文档：

The EntityTransaction interface is used to control resource transactions on resource-local entity managers. The EntityManager.getTransaction() method returns the EntityTransaction interface.

Since:
Java Persistence 1.0

Method Summary
void | begin() Start the resource transaction.
void | commit() Commit the current transaction, writing any unflushed changes to the database.
boolean | getRollbackOnly() Determine whether the current transaction has been marked for rollback.
boolean | isActive() Indicate whether a transaction is in progress.
void | rollback() Roll back the current transaction
void | setRollbackOnly() Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.

Method Detail

public void begin()
开始资源事务。
Throws IllegalStateException: 如果 #isActive() 为 true。
英文文档：

begin

void begin()
Start the resource transaction.

Throws:
IllegalStateException - if isActive() is true.

public void commit()
提交当前事务，将未刷新的更改写入数据库。
Throws | IllegalStateException: 如果 #isActive() 为 false。
Throws | RollbackException: 如果提交失败。
英文文档：

commit

void commit()
Commit the current transaction, writing any unflushed changes to the database.

Throws:
IllegalStateException - if isActive() is false.
RollbackException - if the commit fails.

public void rollback()
回滚当前事务
Throws | IllegalStateException: 如果 #isActive() 为 false。
Throws | PersistenceException: 如果遇到不可预料的错误情况。
英文文档：

rollback

void rollback()
Roll back the current transaction

Throws:
IllegalStateException - if isActive() is false.
PersistenceException - if an unexpected error condition is encountered.

public void setRollbackOnly()
标记当前的事务，使该事务最终只能被回滚。
Throws IllegalStateException: 如果 #isActive() 为 false。
英文文档：

setRollbackOnly

void setRollbackOnly()
Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.

Throws:
IllegalStateException - if isActive() is false.

public boolean getRollbackOnly()
确定当前事务是否标记为回滚。
Throws IllegalStateException: 如果 #isActive() 为 false。
英文文档：

getRollbackOnly

boolean getRollbackOnly()
Determine whether the current transaction has been marked for rollback.

Throws:
IllegalStateException - if isActive() is false.

public boolean isActive()
指示事务是否正在进行。
Throws PersistenceException: 如果遇到不可预料的错误情况。
英文文档：

isActive

boolean isActive()
Indicate whether a transaction is in progress.

Throws:
PersistenceException - if an unexpected error condition is encountered.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Query (Java EE 5)

javax.persistence
Interface Query

public interface Query

用于控制查询执行的接口。
since
en
Java Persistence 1.0
英文文档：

Interface used to control query execution.

Since:
Java Persistence 1.0

Method Summary
int | executeUpdate() Execute an update or delete statement.
List | getResultList() Execute a SELECT query and return the query results as a List.
Object | getSingleResult() Execute a SELECT query that returns a single result.
Query | setFirstResult(int startPosition) Set the position of the first result to retrieve.
Query | setFlushMode(FlushModeType flushMode) Set the flush mode type to be used for the query execution.
Query | setHint(String hintName, Object value) Set an implementation-specific hint.
Query | setMaxResults(int maxResult) Set the maximum number of results to retrieve.
Query | setParameter(int position, Calendar value, TemporalType temporalType) Bind an instance of java.util.Calendar to a positional parameter.
Query | setParameter(int position, Date value, TemporalType temporalType) Bind an instance of java.util.Date to a positional parameter.
Query | setParameter(int position, Object value) Bind an argument to a positional parameter.
Query | setParameter(String name, Calendar value, TemporalType temporalType) Bind an instance of java.util.Calendar to a named parameter.
Query | setParameter(String name, Date value, TemporalType temporalType) Bind an instance of java.util.Date to a named parameter.
Query | setParameter(String name, Object value) Bind an argument to a named parameter.

Method Detail

public java.util.List<E> getResultList()
执行 SELECT 查询并将查询结果作为 List 返回。
return | 结果列表
Throws | IllegalStateException: 如果对 Java Persistence 查询语言 UPDATE 或 DELETE 语句调用
英文文档：

getResultList

List getResultList()
Execute a SELECT query and return the query results as a List.

Returns:
a list of the results
Throws:
IllegalStateException - if called for a Java Persistence query language UPDATE or DELETE statement

public Object getSingleResult()
执行返回单个结果的 SELECT 查询。
return | 结果
Throws | NoResultException: 如果不存在结果
Throws | NonUniqueResultException: 如果有多个结果
Throws | IllegalStateException: 如果对 Java Persistence 查询语言 UPDATE 或 DELETE 语句调用
英文文档：

getSingleResult

Object getSingleResult()
Execute a SELECT query that returns a single result.

Returns:
the result
Throws:
NoResultException - if there is no result
NonUniqueResultException - if more than one result
IllegalStateException - if called for a Java Persistence query language UPDATE or DELETE statement

public int executeUpdate()
执行更新或删除语句。
return | 更新或删除的实体数目
Throws | IllegalStateException: 如果对 Java Persistence 查询语言 SELECT 语句调用
Throws | TransactionRequiredException: 如果没有事务
英文文档：

executeUpdate

int executeUpdate()
Execute an update or delete statement.

Returns:
the number of entities updated or deleted
Throws:
IllegalStateException - if called for a Java Persistence query language SELECT statement
TransactionRequiredException - if there is no transaction

public Query setMaxResults(int maxResult)
设置要获取的结果的最大数目。
maxResult |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果参数为负
英文文档：

setMaxResults

Query setMaxResults(int maxResult)
Set the maximum number of results to retrieve.

Parameters:
maxResult -
Returns:
the same query instance
Throws:
IllegalArgumentException - if argument is negative

public Query setFirstResult(int startPosition)
设置要获取的第一个结果的位置。
startPosition | 第一个结果的起始位置，从 0 开始编号
return | 相同的查询实例
Throws | IllegalArgumentException: 如果参数为负
英文文档：

setFirstResult

Query setFirstResult(int startPosition)
Set the position of the first result to retrieve.

Parameters:
startPosition - the start position of the first result, numbered from 0
Returns:
the same query instance
Throws:
IllegalArgumentException - if argument is negative

public Query setHint(String hintName, Object value)
设置特定于实现的提示。如果提示名称无法识别，则忽略即可。
hintName |
value |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果第二个参数对实现无效
英文文档：

setHint

Query setHint(String hintName,
              Object value)
Set an implementation-specific hint. If the hint name is not recognized, it is silently ignored.

Parameters:
hintName -
value -
Returns:
the same query instance
Throws:
IllegalArgumentException - if the second argument is not valid for the implementation

public Query setParameter(String name, Object value)
将实参绑定到指定形参。
name | 参数名
value |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果形参名称与查询字符串中的形参不对应，或者实参的类型错误
英文文档：

setParameter

Query setParameter(String name,
                   Object value)
Bind an argument to a named parameter.

Parameters:
name - the parameter name
value -
Returns:
the same query instance
Throws:
IllegalArgumentException - if parameter name does not correspond to parameter in query string or argument is of incorrect type

public Query setParameter(String name, java.util.Date value, TemporalType temporalType)
将 java.util.Date 实例绑定到指定的参数。
name |
value |
temporalType |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果参数名称与查询字符串中的参数不对应
英文文档：

setParameter

Query setParameter(String name,
                   Date value,
                   TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter.

Parameters:
name -
value -
temporalType -
Returns:
the same query instance
Throws:
IllegalArgumentException - if parameter name does not correspond to parameter in query string

public Query setParameter(String name, java.util.Calendar value, TemporalType temporalType)
将 java.util.Calendar 实例绑定到指定的参数。
name |
value |
temporalType |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果参数名称与查询字符串中的参数不对应
英文文档：

setParameter

Query setParameter(String name,
                   Calendar value,
                   TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter.

Parameters:
name -
value -
temporalType -
Returns:
the same query instance
Throws:
IllegalArgumentException - if parameter name does not correspond to parameter in query string

public Query setParameter(int position, Object value)
将实参绑定到位置形参。
position |
value |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果位置与查询的位置实参不对应，或者实参的类型错误
英文文档：

setParameter

Query setParameter(int position,
                   Object value)
Bind an argument to a positional parameter.

Parameters:
position -
value -
Returns:
the same query instance
Throws:
IllegalArgumentException - if position does not correspond to positional parameter of query or argument is of incorrect type

public Query setParameter(int position, java.util.Date value, TemporalType temporalType)
将 java.util.Date 实例绑定到位置参数。
position |
value |
temporalType |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果位置与查询的位置参数不对应
英文文档：

setParameter

Query setParameter(int position,
                   Date value,
                   TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter.

Parameters:
position -
value -
temporalType -
Returns:
the same query instance
Throws:
IllegalArgumentException - if position does not correspond to positional parameter of query

public Query setParameter(int position, java.util.Calendar value, TemporalType temporalType)
将 java.util.Calendar 实例绑定到位置参数。
position |
value |
temporalType |
return | 相同的查询实例
Throws | IllegalArgumentException: 如果位置与查询的位置参数不对应
英文文档：

setParameter

Query setParameter(int position,
                   Calendar value,
                   TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter.

Parameters:
position -
value -
temporalType -
Returns:
the same query instance
Throws:
IllegalArgumentException - if position does not correspond to positional parameter of query

public Query setFlushMode(FlushModeType flushMode)
设置执行查询要使用的刷新模式类型。不管实例管理器使用的刷新模式类型如何，此刷新模式类型都将应用于查询。
flushMode
英文文档：

setFlushMode

Query setFlushMode(FlushModeType flushMode)
Set the flush mode type to be used for the query execution. The flush mode type applies to the query regardless of the flush mode type in use for the entity manager.

Parameters:
flushMode -
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Persistence (Java EE 5)

javax.persistence
Class Persistence

java.lang.Object
    extended by  javax.persistence.Persistence

public class Persistence
extends Object

用于获取 EntityManagerFactory 的 Bootstrap 类。
since
en
Java Persistence 1.0
英文文档：

Bootstrap class that is used to obtain an EntityManagerFactory.

Since:
Java Persistence 1.0

Field Summary
static String | PERSISTENCE_PROVIDER
protected static Set<PersistenceProvider> | providers
Constructor Summary
Persistence()
Method Summary
static EntityManagerFactory | createEntityManagerFactory(String persistenceUnitName) Create and return an EntityManagerFactory for the named persistence unit.
static EntityManagerFactory | createEntityManagerFactory(String persistenceUnitName, Map properties) Create and return an EntityManagerFactory for the named persistence unit using the given properties.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

PERSISTENCE_PROVIDER

public static final String PERSISTENCE_PROVIDER
See Also:
Constant Field Values

英文文档：

providers

protected static final Set<PersistenceProvider> providers
Constructor Detail

public Persistence()
英文文档：

Persistence

public Persistence()
Method Detail

public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName)
创建并返回指定持久性单元的 EntityManagerFactory。
persistenceUnitName | 持久性单元的名称
return | 创建根据指定的持久性单元配置的 EntityManager 的工厂
英文文档：

createEntityManagerFactory

public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName)
Create and return an EntityManagerFactory for the named persistence unit.

Parameters:
persistenceUnitName - The name of the persistence unit
Returns:
The factory that creates EntityManagers configured according to the specified persistence unit

public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, java.util.Map<K, V> properties)
使用给定属性创建并返回指定持久性单元的 EntityManagerFactory。
persistenceUnitName | 持久性单元的名称
properties | 创建工厂时使用的其他属性。这些属性值将重写在其他位置配置的任何值。
return | 创建根据指定持久性单元配置的 EntityManager 的工厂。
英文文档：

createEntityManagerFactory

public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName,
                                                              Map properties)
Create and return an EntityManagerFactory for the named persistence unit using the given properties.

Parameters:
persistenceUnitName - The name of the persistence unit
properties - Additional properties to use when creating the factory. The values of these properties override any values that may have been configured elsewhere.
Returns:
The factory that creates EntityManagers configured according to the specified persistence unit.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CascadeType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum CascadeType

java.lang.Object
    extended by  java.lang.Enum<CascadeType>
        extended by  javax.persistence.CascadeType
All Implemented Interfaces:
Serializable, Comparable<CascadeType>
public enum CascadeType
extends Enum<CascadeType>

Extends: Enum<E>

定义传播到关联实体的级联操作集。值 cascade=ALL 等于 cascade={PERSIST, MERGE, REMOVE, REFRESH}。
since
en
Java Persistence 1.0
英文文档：

Defines the set of cascadable operations that are propagated to the associated entity. The value cascade=ALL is equivalent to cascade={PERSIST, MERGE, REMOVE, REFRESH}.

Since:
Java Persistence 1.0

Enum Constant Summary
ALL
          Cascade all operations
MERGE
          Cascade merge operation
PERSIST
          Cascade persist operation
REFRESH
          Cascade refresh operation
REMOVE
          Cascade remove operation

Method Summary
static CascadeType | valueOf(String name) Returns the enum constant of this type with the specified name.
static CascadeType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.

Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

ALL

public static final CascadeType ALL
Cascade all operations

英文文档：

PERSIST

public static final CascadeType PERSIST
Cascade persist operation

英文文档：

MERGE

public static final CascadeType MERGE
Cascade merge operation

英文文档：

REMOVE

public static final CascadeType REMOVE
Cascade remove operation

英文文档：

REFRESH

public static final CascadeType REFRESH
Cascade refresh operation

Method Detail

final public static CascadeType[] values()
英文文档：

values

public static final CascadeType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(CascadeType c : CascadeType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static CascadeType valueOf(String name)
英文文档：

valueOf

public static CascadeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


DiscriminatorType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum DiscriminatorType

java.lang.Object
    extended by  java.lang.Enum<DiscriminatorType>
        extended by  javax.persistence.DiscriminatorType
All Implemented Interfaces:
Serializable, Comparable<DiscriminatorType>
public enum DiscriminatorType
extends Enum<DiscriminatorType>

Extends: Enum<E>

定义鉴别符列支持的类型。
since
en
Java Persistence 1.0
英文文档：

Defines supported types of the discriminator column.

Since:
Java Persistence 1.0

Enum Constant Summary
CHAR
Single character as the discriminator type
INTEGER
Integer as the discriminator type
STRING
String as the discriminator type
Method Summary
static DiscriminatorType | valueOf(String name) Returns the enum constant of this type with the specified name.
static DiscriminatorType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

STRING

public static final DiscriminatorType STRING
String as the discriminator type

英文文档：

CHAR

public static final DiscriminatorType CHAR
Single character as the discriminator type

英文文档：

INTEGER

public static final DiscriminatorType INTEGER
Integer as the discriminator type

Method Detail

final public static DiscriminatorType[] values()
英文文档：

values

public static final DiscriminatorType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(DiscriminatorType c : DiscriminatorType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static DiscriminatorType valueOf(String name)
英文文档：

valueOf

public static DiscriminatorType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


EnumType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum EnumType

java.lang.Object
    extended by  java.lang.Enum<EnumType>
        extended by  javax.persistence.EnumType
All Implemented Interfaces:
Serializable, Comparable<EnumType>
public enum EnumType
extends Enum<EnumType>

Extends: Enum<E>

定义枚举类型的映射。此枚举类型的常量指定如何将持久属性或字段保留为枚举类型。
since
en
Java Persistence 1.0
英文文档：

Defines mapping for the enumerated types. The constants of this enumerated type specify how persistent property or field should be persisted as a enumerated type.

Since:
Java Persistence 1.0

Enum Constant Summary
ORDINAL
Persist enumerated type property or field as an integer
STRING
Persist enumerated type property or field as a string
Method Summary
static EnumType | valueOf(String name) Returns the enum constant of this type with the specified name.
static EnumType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

ORDINAL

public static final EnumType ORDINAL
Persist enumerated type property or field as an integer

英文文档：

STRING

public static final EnumType STRING
Persist enumerated type property or field as a string

Method Detail

final public static EnumType[] values()
英文文档：

values

public static final EnumType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(EnumType c : EnumType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static EnumType valueOf(String name)
英文文档：

valueOf

public static EnumType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


FetchType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum FetchType

java.lang.Object
    extended by  java.lang.Enum<FetchType>
        extended by  javax.persistence.FetchType
All Implemented Interfaces:
Serializable, Comparable<FetchType>
public enum FetchType
extends Enum<FetchType>

Extends: Enum<E>

定义从数据库获取数据的战略。EAGER 战略是必须立即获取数据的持久性提供者运行时的要求。LAZY 战略是第一次访问时应该延迟获取值的持久性提供者运行时的提示。对于指定了 LAZY 战略提示的实现，允许其立即获取数据。需要特别指出的是，延迟获取可能仅对使用基于属性访问的 Basic 映射可用。
示例：
   @Basic(fetch=LAZY)
   protected String getName() { return name; }
since
en
Java Persistence 1.0
英文文档：

Defines strategies for fetching data from the database. The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime that data should be fetched lazily when it is first accessed. The implementation is permitted to eagerly fetch data for which the LAZY strategy hint has been specified. In particular, lazy fetching might only be available for Basic mappings for which property-based access is used.

   Example:
   @Basic(fetch=LAZY)
   protected String getName() { return name; }

Since:
Java Persistence 1.0

Enum Constant Summary
EAGER
Defines that data must be eagerly fetched
LAZY
Defines that data can be lazily fetched
Method Summary
static FetchType | valueOf(String name) Returns the enum constant of this type with the specified name.
static FetchType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

LAZY

public static final FetchType LAZY
Defines that data can be lazily fetched

英文文档：

EAGER

public static final FetchType EAGER
Defines that data must be eagerly fetched

Method Detail

final public static FetchType[] values()
英文文档：

values

public static final FetchType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(FetchType c : FetchType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static FetchType valueOf(String name)
英文文档：

valueOf

public static FetchType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


FlushModeType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum FlushModeType

java.lang.Object
    extended by  java.lang.Enum<FlushModeType>
        extended by  javax.persistence.FlushModeType
All Implemented Interfaces:
Serializable, Comparable<FlushModeType>
public enum FlushModeType
extends Enum<FlushModeType>

Extends: Enum<E>

刷新模式设置。

在事务中执行查询时，如果对 Query 对象设置了 FlushModeType.AUTO，或者持久性上下文的刷新模式设置为 AUTO（默认）并且没有对 Query 对象指定刷新模式设置，则持久性提供者负责确保，对持久性上下文中所有实体状态所作的所有可能影响查询结果的更新对于查询处理都是可见的。持久性提供者实现可能通过将这些实体刷新到数据库（或其他方式）实现这一点。如果设置了 FlushModeType.COMMIT，则对持久性上下文中的实体所作的更新对查询的影响是不明确的。

如果没有处于活动状态的事务，则持久性提供者不得刷新到数据库。

since
en
Java Persistence 1.0
英文文档：

Flush mode setting.

When queries are executed within a transaction, if FlushModeType.AUTO is set on the Query object, or if the flush mode setting for the persistence context is AUTO (the default) and a flush mode setting has not been specified for the Query object, the persistence provider is responsible for ensuring that all updates to the state of all entities in the persistence context which could potentially affect the result of the query are visible to the processing of the query. The persistence provider implementation may achieve this by flushing those entities to the database or by some other means. If FlushModeType.COMMIT is set, the effect of updates made to entities in the persistence context upon queries is unspecified.

If there is no transaction active, the persistence provider must not flush to the database.

Since:
Java Persistence 1.0

Enum Constant Summary
AUTO
(Default) Flushing to occur at query execution
COMMIT
Flushing must occur only at transaction commit
Method Summary
static FlushModeType | valueOf(String name) Returns the enum constant of this type with the specified name.
static FlushModeType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

COMMIT

public static final FlushModeType COMMIT
Flushing must occur only at transaction commit

英文文档：

AUTO

public static final FlushModeType AUTO
(Default) Flushing to occur at query execution

Method Detail

final public static FlushModeType[] values()
英文文档：

values

public static final FlushModeType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(FlushModeType c : FlushModeType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static FlushModeType valueOf(String name)
英文文档：

valueOf

public static FlushModeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


GenerationType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum GenerationType

java.lang.Object
    extended by  java.lang.Enum<GenerationType>
        extended by  javax.persistence.GenerationType
All Implemented Interfaces:
Serializable, Comparable<GenerationType>
public enum GenerationType
extends Enum<GenerationType>

Extends: Enum<E>

定义主键生成的类型。
since
en
Java Persistence 1.0
英文文档：

Defines the types of primary key generation.

Since:
Java Persistence 1.0

Enum Constant Summary
AUTO
Indicates that the persistence provider should pick an appropriate strategy for the particular database.
IDENTITY
Indicates that the persistence provider must assign primary keys for the entity using database identity column.
SEQUENCE
Indicates that the persistence provider must assign primary keys for the entity using database sequence column.
TABLE
Indicates that the persistence provider must assign primary keys for the entity using an underlying database table to ensure uniqueness.
Method Summary
static GenerationType | valueOf(String name) Returns the enum constant of this type with the specified name.
static GenerationType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

TABLE

public static final GenerationType TABLE
Indicates that the persistence provider must assign primary keys for the entity using an underlying database table to ensure uniqueness.

英文文档：

SEQUENCE

public static final GenerationType SEQUENCE
Indicates that the persistence provider must assign primary keys for the entity using database sequence column.

英文文档：

IDENTITY

public static final GenerationType IDENTITY
Indicates that the persistence provider must assign primary keys for the entity using database identity column.

英文文档：

AUTO

public static final GenerationType AUTO
Indicates that the persistence provider should pick an appropriate strategy for the particular database. The AUTO generation strategy may expect a database resource to exist, or it may attempt to create one. A vendor may provide documentation on how to create such resources in the event that it does not support schema generation or cannot create the schema resource at runtime.

Method Detail

final public static GenerationType[] values()
英文文档：

values

public static final GenerationType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(GenerationType c : GenerationType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static GenerationType valueOf(String name)
英文文档：

valueOf

public static GenerationType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


InheritanceType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum InheritanceType

java.lang.Object
    extended by  java.lang.Enum<InheritanceType>
        extended by  javax.persistence.InheritanceType
All Implemented Interfaces:
Serializable, Comparable<InheritanceType>
public enum InheritanceType
extends Enum<InheritanceType>

Extends: Enum<E>

定义继承战略选项。
since
en
Java Persistence 1.0
英文文档：

Defines inheritance strategy options.

Since:
Java Persistence 1.0

Enum Constant Summary
JOINED
A strategy in which fields that are specific to a subclass are mapped to a separate table than the fields that are common to the parent class, and a join is performed to instantiate the subclass.
SINGLE_TABLE
A single table per class hierarchy
TABLE_PER_CLASS
A table per concrete entity class
Method Summary
static InheritanceType | valueOf(String name) Returns the enum constant of this type with the specified name.
static InheritanceType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

SINGLE_TABLE

public static final InheritanceType SINGLE_TABLE
A single table per class hierarchy

英文文档：

TABLE_PER_CLASS

public static final InheritanceType TABLE_PER_CLASS
A table per concrete entity class

英文文档：

JOINED

public static final InheritanceType JOINED
A strategy in which fields that are specific to a subclass are mapped to a separate table than the fields that are common to the parent class, and a join is performed to instantiate the subclass.

Method Detail

final public static InheritanceType[] values()
英文文档：

values

public static final InheritanceType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(InheritanceType c : InheritanceType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static InheritanceType valueOf(String name)
英文文档：

valueOf

public static InheritanceType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


LockModeType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum LockModeType

java.lang.Object
    extended by  java.lang.Enum<LockModeType>
        extended by  javax.persistence.LockModeType
All Implemented Interfaces:
Serializable, Comparable<LockModeType>
public enum LockModeType
extends Enum<LockModeType>

Extends: Enum<E>

可以通过 lock EntityManager.lock() 方法指定的锁定模式。

请求 LockModeType.READ 和 LockModeType.WRITE 类型的锁定的语义如下。

如果事务 T1 对版本化的对象调用 lock(entity, LockModeType.READ)，则实体管理器必须确保不会发生以下任何一种情况：

  • P1（脏读）：事务 T1 修改某行。然后另一个事务 T2 在 T1 提交或回滚之前阅读该行并获取已修改的值。事务 T2 最终成功提交；T1 是否提交或回滚，以及提交或回滚的时间是在 T2 提交之前或之后都无关紧要。
    • P2（不可重复读取）：事务 T1 阅读某行。然后另一个事务 T2 在 T1 提交之前修改或删除了该行。两个事务最终都成功提交。

锁定模式必须总能防止出现情况 P1 和 P2。

此外，对版本化的对象调用 lock(entity, LockModeType.WRITE) 还将强制更新（增量）实体的版本列。

不要求持久性实现支持对非版本化的对象调用 lock EntityManager.lock()。当其不支持此类锁定调用时，必须抛出 PersistenceException。

since
en
Java Persistence 1.0
英文文档：

Lock modes that can be specified by means of the EntityManager.lock() method.

The semantics of requesting locks of type LockModeType.READ and LockModeType.WRITE are the following.

If transaction T1 calls lock(entity, LockModeType.READ) on a versioned object, the entity manager must ensure that neither of the following phenomena can occur:

  • P1 (Dirty read): Transaction T1 modifies a row. Another transaction T2 then reads that row and obtains the modified value, before T1 has committed or rolled back. Transaction T2 eventually commits successfully; it does not matter whether T1 commits or rolls back and whether it does so before or after T2 commits.
    • P2 (Non-repeatable read): Transaction T1 reads a row. Another transaction T2 then modifies or deletes that row, before T1 has committed. Both transactions eventually commit successfully.

Lock modes must always prevent the phenomena P1 and P2.

In addition, calling lock(entity, LockModeType.WRITE) on a versioned object, will also force an update (increment) to the entity's version column.

The persistence implementation is not required to support calling EntityManager.lock() on a non-versioned object. When it cannot support a such lock call, it must throw the PersistenceException.

Since:
Java Persistence 1.0

Enum Constant Summary
READ
Read lock
WRITE
Write lock
Method Summary
static LockModeType | valueOf(String name) Returns the enum constant of this type with the specified name.
static LockModeType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

READ

public static final LockModeType READ
Read lock

英文文档：

WRITE

public static final LockModeType WRITE
Write lock

Method Detail

final public static LockModeType[] values()
英文文档：

values

public static final LockModeType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(LockModeType c : LockModeType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static LockModeType valueOf(String name)
英文文档：

valueOf

public static LockModeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


PersistenceContextType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum PersistenceContextType

java.lang.Object
    extended by  java.lang.Enum<PersistenceContextType>
        extended by  javax.persistence.PersistenceContextType
All Implemented Interfaces:
Serializable, Comparable<PersistenceContextType>
public enum PersistenceContextType
extends Enum<PersistenceContextType>

Extends: Enum<E>

指定在 PersistenceContext 中使用事务范围的持久性上下文还是扩展的持久性上下文。如果未指定 type 元素，则使用事务范围的持久性上下文。
since
en
Java Persistence 1.0
英文文档：

Specifies whether a transaction-scoped or extended persistence context is to be used in PersistenceContext. If the type element is not specified, a transaction-scoped persistence context is used.

Since:
Java Persistence 1.0

Enum Constant Summary
EXTENDED
Extended persistence context
TRANSACTION
Transaction-scoped persistence context
Method Summary
static PersistenceContextType | valueOf(String name) Returns the enum constant of this type with the specified name.
static PersistenceContextType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

TRANSACTION

public static final PersistenceContextType TRANSACTION
Transaction-scoped persistence context

英文文档：

EXTENDED

public static final PersistenceContextType EXTENDED
Extended persistence context

Method Detail

final public static PersistenceContextType[] values()
英文文档：

values

public static final PersistenceContextType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(PersistenceContextType c : PersistenceContextType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static PersistenceContextType valueOf(String name)
英文文档：

valueOf

public static PersistenceContextType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


TemporalType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence
Enum TemporalType

java.lang.Object
    extended by  java.lang.Enum<TemporalType>
        extended by  javax.persistence.TemporalType
All Implemented Interfaces:
Serializable, Comparable<TemporalType>
public enum TemporalType
extends Enum<TemporalType>

Extends: Enum<E>

此类型用于指示 java.util.Date 或 java.util.Calendar 的特定映射。
since
en
Java Persistence 1.0
英文文档：

Type used to indicate a specific mapping of Date or Calendar.

Since:
Java Persistence 1.0

Enum Constant Summary
DATE
Map as java.sql.Date
TIME
Map as java.sql.Time
TIMESTAMP
Map as java.sql.Timestamp
Method Summary
static TemporalType | valueOf(String name) Returns the enum constant of this type with the specified name.
static TemporalType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

DATE

public static final TemporalType DATE
Map as java.sql.Date

英文文档：

TIME

public static final TemporalType TIME
Map as java.sql.Time

英文文档：

TIMESTAMP

public static final TemporalType TIMESTAMP
Map as java.sql.Timestamp

Method Detail

final public static TemporalType[] values()
英文文档：

values

public static final TemporalType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(TemporalType c : TemporalType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static TemporalType valueOf(String name)
英文文档：

valueOf

public static TemporalType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


EntityExistsException (Java EE 5)

javax.persistence
Class EntityExistsException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
                    extended by  javax.persistence.EntityExistsException
All Implemented Interfaces:
Serializable
public class EntityExistsException
extends PersistenceException

Extends: Throwable > Exception > RuntimeException > PersistenceException

当 EntityManager.persist(Object) 被调用并且此实体已存在时，持久性提供者将抛出此异常。当前事务（如果存在活动的事务）将标记为回滚。
since
en
Java Persistence 1.0
See also persist(Object)
英文文档：

Thrown by the persistence provider when EntityManager.persist(Object) is called and the entity already exists. The current transaction, if one is active, will be marked for rollback.

Since:
Java Persistence 1.0
See Also:
EntityManager.persist(Object), Serialized Form

Constructor Summary
EntityExistsException()
Constructs a new EntityExistsException exception with null as its detail message.
EntityExistsException(String message)
Constructs a new EntityExistsException exception with the specified detail message.
EntityExistsException(String message, Throwable cause)
Constructs a new EntityExistsException exception with the specified detail message and cause.
EntityExistsException(Throwable cause)
Constructs a new EntityExistsException exception with the specified 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

public EntityExistsException()
构造详细消息为 null 的新 EntityExistsException 异常。
英文文档：

EntityExistsException

public EntityExistsException()
Constructs a new EntityExistsException exception with null as its detail message.

public EntityExistsException(String message)
构造带指定详细消息的新 EntityExistsException 异常。
message 详细消息。
英文文档：

EntityExistsException

public EntityExistsException(String message)
Constructs a new EntityExistsException exception with the specified detail message.

Parameters:
message - the detail message.

public EntityExistsException(String message, Throwable cause)
构造带指定详细消息和原因的新 EntityExistsException 异常。
message | 详细消息。
cause | 原因。
英文文档：

EntityExistsException

public EntityExistsException(String message,
                             Throwable cause)
Constructs a new EntityExistsException exception with the specified detail message and cause.

Parameters:
message - the detail message.
cause - the cause.

public EntityExistsException(Throwable cause)
构造带指定原因的新 EntityExistsException 异常。
cause 原因。
英文文档：

EntityExistsException

public EntityExistsException(Throwable cause)
Constructs a new EntityExistsException exception with the specified cause.

Parameters:
cause - the cause.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityNotFoundException (Java EE 5)

javax.persistence
Class EntityNotFoundException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
                    extended by  javax.persistence.EntityNotFoundException
All Implemented Interfaces:
Serializable
public class EntityNotFoundException
extends PersistenceException

Extends: Throwable > Exception > RuntimeException > PersistenceException

当访问 getReference EntityManager.getReference(Class,Object) 获得的实体引用但实体不存在时，持久性提供者将抛出此异常。当调用 refresh EntityManager.refresh(Object) 但数据库中不存在该对象时，也会抛出此异常。当前事务（如果存在活动的事务）将标记为回滚。
since
en
Java Persistence 1.0
See also getReference(Class,Object), refresh(Object)
英文文档：

Thrown by the persistence provider when an entity reference obtained by EntityManager.getReference(Class,Object) is accessed but the entity does not exist. Also thrown when EntityManager.refresh(Object) is called and the object no longer exists in the database. The current transaction, if one is active, will be marked for rollback.

Since:
Java Persistence 1.0
See Also:
EntityManager.getReference(Class,Object), EntityManager.refresh(Object), Serialized Form

Constructor Summary
EntityNotFoundException()
Constructs a new EntityNotFoundException exception with null as its detail message.
EntityNotFoundException(String message)
Constructs a new EntityNotFoundException exception with the specified detail message.
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

public EntityNotFoundException()
构造详细消息为 null 的新 EntityNotFoundException 异常。
英文文档：

EntityNotFoundException

public EntityNotFoundException()
Constructs a new EntityNotFoundException exception with null as its detail message.

public EntityNotFoundException(String message)
构造带指定详细消息的新 EntityNotFoundException 异常。
message 详细消息。
英文文档：

EntityNotFoundException

public EntityNotFoundException(String message)
Constructs a new EntityNotFoundException exception with the specified detail message.

Parameters:
message - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NonUniqueResultException (Java EE 5)

javax.persistence
Class NonUniqueResultException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
                    extended by  javax.persistence.NonUniqueResultException
All Implemented Interfaces:
Serializable
public class NonUniqueResultException
extends PersistenceException

Extends: Throwable > Exception > RuntimeException > PersistenceException

对查询执行 getSingleResult getSingleResult()，但查询得到多个结果时，持久性提供者将抛出此异常。此异常不会导致当前事务（如果存在活动的事务）被标记为回滚。
since
en
Java Persistence 1.0
See also getSingleResult()
英文文档：

Thrown by the persistence provider when getSingleResult() is executed on a query and there is more than one result from the query. This exception will not cause the current transaction, if one is active, to be marked for roll back.

Since:
Java Persistence 1.0
See Also:
Query.getSingleResult(), Serialized Form

Constructor Summary
NonUniqueResultException()
Constructs a new NonUniqueResultException exception with null as its detail message.
NonUniqueResultException(String message)
Constructs a new NonUniqueResultException exception with the specified detail message.
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

public NonUniqueResultException()
构造详细消息为 null 的新 NonUniqueResultException 异常。
英文文档：

NonUniqueResultException

public NonUniqueResultException()
Constructs a new NonUniqueResultException exception with null as its detail message.

public NonUniqueResultException(String message)
构造带指定详细消息的新 NonUniqueResultException 异常。
message 详细消息。
英文文档：

NonUniqueResultException

public NonUniqueResultException(String message)
Constructs a new NonUniqueResultException exception with the specified detail message.

Parameters:
message - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NoResultException (Java EE 5)

javax.persistence
Class NoResultException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
                    extended by  javax.persistence.NoResultException
All Implemented Interfaces:
Serializable
public class NoResultException
extends PersistenceException

Extends: Throwable > Exception > RuntimeException > PersistenceException

对查询执行 getSingleResult getSingleResult()，但无结果返回时，持久性提供者将抛出此异常。此异常不会导致当前事务（如果存在活动的事务）被标记为回滚。
since
en
Java Persistence 1.0
See also getSingleResult()
英文文档：

Thrown by the persistence provider when getSingleResult() is executed on a query and there is no result to return. This exception will not cause the current transaction, if one is active, to be marked for roll back.

Since:
Java Persistence 1.0
See Also:
Query.getSingleResult(), Serialized Form

Constructor Summary
NoResultException()
Constructs a new NoResultException exception with null as its detail message.
NoResultException(String message)
Constructs a new NoResultException exception with the specified detail message.
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

public NoResultException()
构造详细消息为 null 的新 NoResultException 异常。
英文文档：

NoResultException

public NoResultException()
Constructs a new NoResultException exception with null as its detail message.

public NoResultException(String message)
构造带指定详细消息的新 NoResultException 异常。
message 详细消息。
英文文档：

NoResultException

public NoResultException(String message)
Constructs a new NoResultException exception with the specified detail message.

Parameters:
message - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


OptimisticLockException (Java EE 5)

javax.persistence
Class OptimisticLockException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
                    extended by  javax.persistence.OptimisticLockException
All Implemented Interfaces:
Serializable
public class OptimisticLockException
extends PersistenceException

Extends: Throwable > Exception > RuntimeException > PersistenceException

发生乐观锁定冲突时，持久性提供者将抛出此异常。此异常可以作为 API 调用（刷新或提交时）的一部分抛出。当前事务（如果存在活动的事务）将标记为回滚。
since
en
Java Persistence 1.0
英文文档：

Thrown by the persistence provider when an optimistic locking conflict occurs. This exception may be thrown as part of an API call, a flush or at commit time. The current transaction, if one is active, will be marked for rollback.

Since:
Java Persistence 1.0
See Also:
Serialized Form

Constructor Summary
OptimisticLockException()
Constructs a new OptimisticLockException exception with null as its detail message.
OptimisticLockException(Object entity)
Constructs a new OptimisticLockException exception with the specified entity.
OptimisticLockException(String message)
Constructs a new OptimisticLockException exception with the specified detail message.
OptimisticLockException(String message, Throwable cause)
Constructs a new OptimisticLockException exception with the specified detail message and cause.
OptimisticLockException(String message, Throwable cause, Object entity)
Constructs a new OptimisticLockException exception with the specified detail message, cause, and entity.
OptimisticLockException(Throwable cause)
Constructs a new OptimisticLockException exception with the specified cause.
Method Summary
 Object getEntity()
Returns the entity that caused this exception.
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

public OptimisticLockException()
构造详细消息为 null 的新 OptimisticLockException 异常。
英文文档：

OptimisticLockException

public OptimisticLockException()
Constructs a new OptimisticLockException exception with null as its detail message.

public OptimisticLockException(String message)
构造带指定详细消息的新 OptimisticLockException 异常。
message 详细消息。
英文文档：

OptimisticLockException

public OptimisticLockException(String message)
Constructs a new OptimisticLockException exception with the specified detail message.

Parameters:
message - the detail message.

public OptimisticLockException(String message, Throwable cause)
构造带指定详细消息和原因的新 OptimisticLockException 异常。
message | 详细消息。
cause | 原因。
英文文档：

OptimisticLockException

public OptimisticLockException(String message,
                               Throwable cause)
Constructs a new OptimisticLockException exception with the specified detail message and cause.

Parameters:
message - the detail message.
cause - the cause.

public OptimisticLockException(Throwable cause)
构造带指定原因的新 OptimisticLockException 异常。
cause 原因。
英文文档：

OptimisticLockException

public OptimisticLockException(Throwable cause)
Constructs a new OptimisticLockException exception with the specified cause.

Parameters:
cause - the cause.

public OptimisticLockException(Object entity)
构造带指定实体的新 OptimisticLockException 异常。
entity 实体。
英文文档：

OptimisticLockException

public OptimisticLockException(Object entity)
Constructs a new OptimisticLockException exception with the specified entity.

Parameters:
entity - the entity.

public OptimisticLockException(String message, Throwable cause, Object entity)
构造带指定详细消息、原因和实体的新 OptimisticLockException 异常。
message | 详细消息。
cause | 原因。
entity | 实体。
英文文档：

OptimisticLockException

public OptimisticLockException(String message,
                               Throwable cause,
                               Object entity)
Constructs a new OptimisticLockException exception with the specified detail message, cause, and entity.

Parameters:
message - the detail message.
cause - the cause.
entity - the entity.
Method Detail

public Object getEntity()
返回导致此异常的实体。
return 实体。
英文文档：

getEntity

public Object getEntity()
Returns the entity that caused this exception.

Returns:
the entity.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceException (Java EE 5)

javax.persistence
Class PersistenceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EntityExistsException, EntityNotFoundException, NonUniqueResultException, NoResultException, OptimisticLockException, RollbackException, TransactionRequiredException
public class PersistenceException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException
Extended by: EntityExistsException, EntityNotFoundException, NonUniqueResultException, NoResultException, OptimisticLockException, RollbackException, TransactionRequiredException

发生问题时，持久性提供者将抛出此异常。所有 PersistenceException 实例（NoResultException 实例和 NonUniqueResultException 实例除外）将导致当前事务（如果存在活动的事务）标记为回滚。
since
en
Java Persistence 1.0
英文文档：

Thrown by the persistence provider when a problem occurs. All instances of PersistenceException except for instances of NoResultException and NonUniqueResultException will cause the current transaction, if one is active, to be marked for rollback.

Since:
Java Persistence 1.0
See Also:
Serialized Form

Constructor Summary
PersistenceException()
Constructs a new PersistenceException exception with null as its detail message.
PersistenceException(String message)
Constructs a new PersistenceException exception with the specified detail message.
PersistenceException(String message, Throwable cause)
Constructs a new PersistenceException exception with the specified detail message and cause.
PersistenceException(Throwable cause)
Constructs a new PersistenceException exception with the specified 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

public PersistenceException()
构造详细消息为 null 的新 PersistenceException 异常。
英文文档：

PersistenceException

public PersistenceException()
Constructs a new PersistenceException exception with null as its detail message.

public PersistenceException(String message)
构造带指定详细消息的新 PersistenceException 异常。
message 详细消息。
英文文档：

PersistenceException

public PersistenceException(String message)
Constructs a new PersistenceException exception with the specified detail message.

Parameters:
message - the detail message.

public PersistenceException(String message, Throwable cause)
构造带指定详细消息和原因的新 PersistenceException 异常。
message | 详细消息。
cause | 原因。
英文文档：

PersistenceException

public PersistenceException(String message,
                            Throwable cause)
Constructs a new PersistenceException exception with the specified detail message and cause.

Parameters:
message - the detail message.
cause - the cause.

public PersistenceException(Throwable cause)
构造带指定原因的新 PersistenceException 异常。
cause 原因。
英文文档：

PersistenceException

public PersistenceException(Throwable cause)
Constructs a new PersistenceException exception with the specified cause.

Parameters:
cause - the cause.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RollbackException (Java EE 5)

javax.persistence
Class RollbackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
                    extended by  javax.persistence.RollbackException
All Implemented Interfaces:
Serializable
public class RollbackException
extends PersistenceException

Extends: Throwable > Exception > RuntimeException > PersistenceException

当 EntityTransaction.commit() 失败时，持久性提供者将抛出此异常。
since
en
Java Persistence 1.0
See also commit()
英文文档：

Thrown by the persistence provider when the EntityTransaction.commit() fails.

Since:
Java Persistence 1.0
See Also:
EntityTransaction.commit(), Serialized Form

Constructor Summary
RollbackException()
Constructs a new RollbackException exception with null as its detail message.
RollbackException(String message)
Constructs a new RollbackException exception with the specified detail message.
RollbackException(String message, Throwable cause)
Constructs a new RollbackException exception with the specified detail message and cause.
RollbackException(Throwable cause)
Constructs a new RollbackException exception with the specified 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

public RollbackException()
构造详细消息为 null 的新 RollbackException 异常。
英文文档：

RollbackException

public RollbackException()
Constructs a new RollbackException exception with null as its detail message.

public RollbackException(String message)
构造带指定详细消息的新 RollbackException 异常。
message 详细消息。
英文文档：

RollbackException

public RollbackException(String message)
Constructs a new RollbackException exception with the specified detail message.

Parameters:
message - the detail message.

public RollbackException(String message, Throwable cause)
构造带指定详细消息和原因的新 RollbackException 异常。
message | 详细消息。
cause | 原因。
英文文档：

RollbackException

public RollbackException(String message,
                         Throwable cause)
Constructs a new RollbackException exception with the specified detail message and cause.

Parameters:
message - the detail message.
cause - the cause.

public RollbackException(Throwable cause)
构造带指定原因的新 RollbackException 异常。
cause 原因。
英文文档：

RollbackException

public RollbackException(Throwable cause)
Constructs a new RollbackException exception with the specified cause.

Parameters:
cause - the cause.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionRequiredException (Java EE 5)

javax.persistence
Class TransactionRequiredException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.persistence.PersistenceException
                    extended by  javax.persistence.TransactionRequiredException
All Implemented Interfaces:
Serializable
public class TransactionRequiredException
extends PersistenceException

Extends: Throwable > Exception > RuntimeException > PersistenceException

请求事务但是没有活动的事务时，持久性提供者将抛出此异常。
since
en
Java Persistence 1.0
英文文档：

Thrown by the persistence provider when a transaction is required but is not active.

Since:
Java Persistence 1.0
See Also:
Serialized Form

Constructor Summary
TransactionRequiredException()
Constructs a new TransactionRequiredException exception with null as its detail message.
TransactionRequiredException(String message)
Constructs a new TransactionRequiredException exception with the specified detail message.
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

public TransactionRequiredException()
构造详细消息为 null 的新 TransactionRequiredException 异常。
英文文档：

TransactionRequiredException

public TransactionRequiredException()
Constructs a new TransactionRequiredException exception with null as its detail message.

public TransactionRequiredException(String message)
构造带指定详细消息的新 TransactionRequiredException 异常。
message 详细消息。
英文文档：

TransactionRequiredException

public TransactionRequiredException(String message)
Constructs a new TransactionRequiredException exception with the specified detail message.

Parameters:
message - the detail message.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


AssociationOverride (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.persistence
Annotation Type AssociationOverride

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface AssociationOverride

This annotation is used to override a many-to-one or one-to-one mapping of property or field for an entity relationship.

The AssociationOverride annotation may be applied to an entity that extends a mapped superclass to override a many-to-one or one-to-one mapping defined by the mapped superclass. If the AssociationOverride annotation is not specified, the join column is mapped the same as in the original mapping.

    Example:
    @MappedSuperclass
    public class Employee {
        ...
        @ManyToOne
        protected Address address;
        ...
    }

    @Entity
    @AssociationOverride(name="address",
        joinColumns=@JoinColumn(name="ADDR_ID"))
    // address field mapping overridden to ADDR_ID fk
    public class PartTimeEmployee extends Employee {
        ...
    }

Since:
Java Persistence 1.0
See Also:
OneToOne, ManyToOne, MappedSuperclass

Required Element Summary
JoinColumn[] | joinColumns The join column that is being mapped to the persistent attribute.
String | name The name of the relationship property whose mapping is being overridden if property-based access is being used, or the name of the relationship field if field-based access is used.

Element Detail

name

public abstract String name
The name of the relationship property whose mapping is being overridden if property-based access is being used, or the name of the relationship field if field-based access is used.

joinColumns

public abstract JoinColumn[] joinColumns
The join column that is being mapped to the persistent attribute. The mapping type will remain the same as is defined in the mapped superclass.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT
Submit a bug or feature

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


AssociationOverrides (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type AssociationOverrides

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface AssociationOverrides

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

此注释用于重写关系属性或字段的多个多对一或一对一映射。

示例：
    @MappedSuperclass
    public class Employee {

        @Id protected Integer id;
        @Version protected Integer version;
        @ManyToOne protected Address address;
        @OneToOne protected Locker locker;

        public Integer getId() { ... }
        public void setId(Integer id) { ... }
        public Address getAddress() { ... }
        public void setAddress(Address address) { ... }
        public Locker getLocker() { ... }
        public void setLocker(Locker locker) { ... }

    }

    @Entity
    @AssociationOverrides({

    @AssociationOverride(name="address",
            joinColumns=@JoinColumn("ADDR_ID")),
        @AttributeOverride(name="locker",
            joinColumns=@JoinColumn("LCKR_ID"))})
    public PartTimeEmployee { ... }
since
en
Java Persistence 1.0
英文文档：

This annotation is used to override mappings of multiple many-to-one or one-to-one relationship properties or fields.

    Example:
    @MappedSuperclass
    public class Employee {

        @Id protected Integer id;
        @Version protected Integer version;
        @ManyToOne protected Address address;
        @OneToOne protected Locker locker;

        public Integer getId() { ... }
        public void setId(Integer id) { ... }
        public Address getAddress() { ... }
        public void setAddress(Address address) { ... }
        public Locker getLocker() { ... }
        public void setLocker(Locker locker) { ... }

    }

    @Entity
    @AssociationOverrides({

    @AssociationOverride(name="address",
            joinColumns=@JoinColumn("ADDR_ID")),
        @AttributeOverride(name="locker",
            joinColumns=@JoinColumn("LCKR_ID"))})
    public PartTimeEmployee { ... }

Since:
Java Persistence 1.0

Required Element Summary
 AssociationOverride[] value
Mapping overrides of relationship properties or fields

Element Detail

abstract public AssociationOverride[] value()
关系属性或字段的映射重写
英文文档：

value

public abstract AssociationOverride[] value
Mapping overrides of relationship properties or fields

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


AttributeOverride (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type AttributeOverride

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface AttributeOverride

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

AttributeOverride 注释用于重写 Basic（不管是显式的还是默认的）属性（或字段）或者 Id 属性（或字段）的映射。

AttributeOverride 注释可以应用于扩展了映射的超类的实体或者嵌入的字段或属性，以重写映射的超类或可嵌入类所定义的基本映射。如果没有指定 AttributeOverride 注释，则列的映射方式与原映射相同。

 示例：

   @MappedSuperclass
   public class Employee {
       @Id protected Integer id;
       @Version protected Integer version;
       protected String address;
       public Integer getId() { ... }
       public void setId(Integer id) { ... }
       public String getAddress() { ... }
       public void setAddress(String address) { ... }
   }

   @Entity
   @AttributeOverride(name="address", column=@Column(name="ADDR"))
   public class PartTimeEmployee extends Employee {
       // address field mapping overridden to ADDR
       protected Float wage();
       public Float getHourlyWage() { ... }
       public void setHourlyWage(Float wage) { ... }
   }
since
en
Java Persistence 1.0
See also javax.persistence.Embedded, javax.persistence.Embeddable, javax.persistence.MappedSuperclass
英文文档：

The AttributeOverride annotation is used to override the mapping of a Basic (whether explicit or default) property or field or Id property or field.

The AttributeOverride annotation may be applied to an entity that extends a mapped superclass or to an embedded field or property to override a basic mapping defined by the mapped superclass or embeddable class. If the AttributeOverride annotation is not specified, the column is mapped the same as in the original mapping.

 Example:

   @MappedSuperclass
   public class Employee {
       @Id protected Integer id;
       @Version protected Integer version;
       protected String address;
       public Integer getId() { ... }
       public void setId(Integer id) { ... }
       public String getAddress() { ... }
       public void setAddress(String address) { ... }
   }

   @Entity
   @AttributeOverride(name="address", column=@Column(name="ADDR"))
   public class PartTimeEmployee extends Employee {
       // address field mapping overridden to ADDR
       protected Float wage();
       public Float getHourlyWage() { ... }
       public void setHourlyWage(Float wage) { ... }
   }

Since:
Java Persistence 1.0
See Also:
Embedded, Embeddable, MappedSuperclass

Required Element Summary
Column | column (Required) The column that is being mapped to the persistent attribute.
String | name (Required) The name of the property whose mapping is being overridden if property-based access is being used, or the name of the field if field-based access is used.

Element Detail

abstract public String name()
（必需）如果使用的是基于属性的访问，则此为映射被重写的属性名称；如果使用的是基于字段的访问，则为字段名称。
英文文档：

name

public abstract String name
(Required) The name of the property whose mapping is being overridden if property-based access is being used, or the name of the field if field-based access is used.

abstract public Column column()
（必需）映射到持久属性的列。映射类型与可嵌入类或映射超类中定义的类型保持一致。
英文文档：

column

public abstract Column column
(Required) The column that is being mapped to the persistent attribute. The mapping type will remain the same as is defined in the embeddable class or mapped superclass.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


AttributeOverrides (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type AttributeOverrides

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface AttributeOverrides

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

此类用于重写多个属性或字段映射。

示例：

 @Embedded
    @AttributeOverrides({
            @AttributeOverride(name="startDate", column=@Column("
                    EMP_START")),
            @AttributeOverride(name="endDate", column=@Column("EMP_END"))
    })
    public EmploymentPeriod getEmploymentPeriod() { ... }
since
en
Java Persistence 1.0
英文文档：

Is used to override mappings of multiple properties or fields.

    Example:

    @Embedded
    @AttributeOverrides({
            @AttributeOverride(name="startDate", column=@Column("
                    EMP_START")),
            @AttributeOverride(name="endDate", column=@Column("EMP_END"))
    })
    public EmploymentPeriod getEmploymentPeriod() { ... }

Since:
Java Persistence 1.0

Required Element Summary
 AttributeOverride[] value
One or more mapping override

Element Detail

abstract public AttributeOverride[] value()
一个或多个映射重写
英文文档：

value

public abstract AttributeOverride[] value
One or more mapping override

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Basic (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Basic

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Basic

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

Basic 注释是数据库列最简单的映射类型。Basic 注释可以应用于以下任意类型的持久属性或实例变量：Java 基本类型、基本类型的包装器、String、java.math.BigInteger、java.math.BigDecimal、java.util.Date、java.util.Calendar、java.sql.Date、java.sql.Time、java.sql.Timestamp、byte[], Byte[], char[], Character[]、枚举以及任何实现 Serializable 的其他类型。

对于这些类型的持久字段和属性，使用 Basic 注释是可选的。

since
en
Java Persistence 1.0
英文文档：

The Basic annotation is the simplest type of mapping to a database column. The Basic annotation can be applied to a persistent property or instance variable of any of the following types: Java primitive types, wrappers of the primitive types, String, java.math.BigInteger, java.math.BigDecimal, java.util.Date, java.util.Calendar, java.sql.Date, java.sql.Time, java.sql.Timestamp, byte[], Byte[], char[], Character[], enums, and any other type that implements Serializable.

The use of the Basic annotation is optional for persistent fields and properties of these types.

Since:
Java Persistence 1.0

Optional Element Summary
FetchType | fetch (Optional) Defines whether the value of the field or property should be lazily loaded or must be eagerly fetched.
boolean | optional (Optional) Defines whether the value of the field or property may be null.

abstract public FetchType fetch()
（可选）定义字段或属性的值是应该延迟加载还是必须立即获取。使用 EAGER 战略是必须立即获取值的持久性提供者运行时的要求。LAZY 战略是持久性提供者运行时的提示。如果没有指定，则默认为 EAGER。
英文文档：

fetch

public abstract FetchType fetch
(Optional) Defines whether the value of the field or property should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the value must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime. If not specified, defaults to EAGER.

Default:
EAGER

abstract public boolean optional()
（可选）定义字段或属性的值是否可以为 null。这是一个提示，基础类型可以忽略；它可以用于模式生成。如果没有指定，则默认为 true。
英文文档：

optional

public abstract boolean optional
(Optional) Defines whether the value of the field or property may be null. This is a hint and is disregarded for primitive types; it may be used in schema generation. If not specified, defaults to true.

Default:
true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Column (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Column

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Column

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

用于指定持久属性或字段的映射列。如果没有指定 Column 注释，则应用默认值。

示例：

示例 1：
@Column(name="DESC", nullable=false, length=512)
public String getDescription() { return description; }

示例 2：
@Column(name="DESC",
columnDefinition="CLOB NOT NULL",
table="EMP_DETAIL")
@Lob
public String getDescription() { return description; }

示例 3：
@Column(name="ORDER_COST", updatable=false, precision=12, scale=2)
public BigDecimal getCost() { return cost; }
since
en
Java Persistence 1.0
英文文档：

Is used to specify a mapped column for a persistent property or field. If no Column annotation is specified, the default values are applied.

Examples:

 Example 1:
 @Column(name="DESC", nullable=false, length=512)
 public String getDescription() { return description; }

 Example 2:
 @Column(name="DESC",
         columnDefinition="CLOB NOT NULL",
         table="EMP_DETAIL")
 @Lob
 public String getDescription() { return description; }

 Example 3:
 @Column(name="ORDER_COST", updatable=false, precision=12, scale=2)
 public BigDecimal getCost() { return cost; }

Since:
Java Persistence 1.0

Optional Element Summary
String | columnDefinition (Optional) The SQL fragment that is used when generating the DDL for the column.
boolean | insertable (Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider.
int | length (Optional) The column length.
String | name (Optional) The name of the column.
boolean | nullable (Optional) Whether the database column is nullable.
int | precision (Optional) The precision for a decimal (exact numeric) column.
int | scale (Optional) The scale for a decimal (exact numeric) column.
String | table (Optional) The name of the table that contains the column.
boolean | unique (Optional) Whether the property is a unique key.
boolean | updatable (Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider.

abstract public String name()
（可选）列名称。默认为属性或字段名称。
英文文档：

name

public abstract String name
(Optional) The name of the column. Defaults to the property or field name.

Default:
""

abstract public boolean unique()
（可选）属性是否为唯一键。这是表格级别的 UniqueConstraint 注释的快捷方式，在唯一的键约束只有一个字段时很有用。除了应用在表格级别指定的约束条件和主键映射引起的约束条件外，还应用此约束条件。
英文文档：

unique

public abstract boolean unique
(Optional) Whether the property is a unique key. This is a shortcut for the UniqueConstraint annotation at the table level and is useful for when the unique key constraint is only a single field. This constraint applies in addition to any constraint entailed by primary key mapping and to constraints specified at the table level.

Default:
false

abstract public boolean nullable()
（可选）数据库列是否可以为 null。
英文文档：

nullable

public abstract boolean nullable
(Optional) Whether the database column is nullable.

Default:
true

abstract public boolean insertable()
（可选）持久性提供者生成的 SQL INSERT 语句中是否包含该列。
英文文档：

insertable

public abstract boolean insertable
(Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider.

Default:
true

abstract public boolean updatable()
（可选）持久性提供者生成的 SQL UPDATE 语句中是否包含该列。
英文文档：

updatable

public abstract boolean updatable
(Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider.

Default:
true

abstract public String columnDefinition()
（可选）生成该列的 DDL 时使用的 SQL 句段。

默认为生成的 SQL，以创建推断类型的列。

英文文档：

columnDefinition

public abstract String columnDefinition
(Optional) The SQL fragment that is used when generating the DDL for the column.

Defaults to the generated SQL to create a column of the inferred type.

Default:
""

abstract public String table()
（可选）包含该列的表格名称。如果不存在，则假设该列位于主表格中。
英文文档：

table

public abstract String table
(Optional) The name of the table that contains the column. If absent the column is assumed to be in the primary table.

Default:
""

abstract public int length()
（可选）列长。（只在使用值为字符串的列时应用。）
英文文档：

length

public abstract int length
(Optional) The column length. (Applies only if a string-valued column is used.)

Default:
255

abstract public int precision()
（可选）十进制（精确数字）列的精度。（只在使用十进制列时应用。）如果在生成此列的 DDL 时使用，则开发人员必须设置此值。
英文文档：

precision

public abstract int precision
(Optional) The precision for a decimal (exact numeric) column. (Applies only if a decimal column is used.) Value must be set by developer if used when generating the DDL for the column.

Default:
0

abstract public int scale()
（可选）十进制（精确数字）列的小数位数。（只在使用十进制列时应用。）
英文文档：

scale

public abstract int scale
(Optional) The scale for a decimal (exact numeric) column. (Applies only if a decimal column is used.)

Default:
0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ColumnResult (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type ColumnResult

@Target(value={})
@Retention(value=RUNTIME)
public @interface ColumnResult

Implements: Annotation
@Target(value={})
@Retention(value=RUNTIME)

SQL 查询的 SELECT 子句中列的引用名称（即列别名，如果适用）。通过在元数据中指定此注释，可以使查询结果中包含标量结果类型。

示例：
   Query q = em.createNativeQuery(
       "SELECT o.id AS order_id, " +
           "o.quantity AS order_quantity, " +
           "o.item AS order_item, " +
           "i.name AS item_name, " +
         "FROM Order o, Item i " +
         "WHERE (order_quantity > 25) AND (order_item = i.id)",
       "OrderResults");

   @SqlResultSetMapping(name="OrderResults",
       entities={
           @EntityResult(entityClass=com.acme.Order.class, fields={
               @FieldResult(name="id", column="order_id"),
               @FieldResult(name="quantity", column="order_quantity"),
               @FieldResult(name="item", column="order_item")})},
       columns={
           @ColumnResult(name="item_name")}
       )
since
en
Java Persistence 1.0
英文文档：

References name of a column in the SELECT clause of a SQL query - i.e., column alias, if applicable. Scalar result types can be included in the query result by specifying this annotation in the metadata.

 Example:
   Query q = em.createNativeQuery(
       "SELECT o.id AS order_id, " +
           "o.quantity AS order_quantity, " +
           "o.item AS order_item, " +
           "i.name AS item_name, " +
         "FROM Order o, Item i " +
         "WHERE (order_quantity > 25) AND (order_item = i.id)",
       "OrderResults");

   @SqlResultSetMapping(name="OrderResults",
       entities={
           @EntityResult(entityClass=com.acme.Order.class, fields={
               @FieldResult(name="id", column="order_id"),
               @FieldResult(name="quantity", column="order_quantity"),
               @FieldResult(name="item", column="order_item")})},
       columns={
           @ColumnResult(name="item_name")}
       )

Since:
Java Persistence 1.0

Required Element Summary
 String name
The name of a column in the SELECT clause of a SQL query

Element Detail

abstract public String name()
SQL 查询的 SELECT 子句中的列名称
英文文档：

name

public abstract String name
The name of a column in the SELECT clause of a SQL query

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


DiscriminatorColumn (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type DiscriminatorColumn

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface DiscriminatorColumn

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

用于为 @link InheritanceType#SINGLE_TABLE SINGLE_TABLE} 和 JOINED 继承映射战略定义鉴别符列。

仅在实体类分层结构的根或应用了不同继承战略的次级分层结构中指定战略和鉴别符列

如果缺少 DiscriminatorColumn 注释，并且需要鉴别符列，则鉴别符列的名称默认为 "DTYPE"，鉴别符类型默认为 DiscriminatorType.STRING。

示例：
     @Entity
     @Table(name="CUST")
     @Inheritance(strategy=SINGLE_TABLE)
     @DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
     public class Customer { ... }

     @Entity
     public class ValuedCustomer extends Customer { ... }
since
en
Java Persistence 1.0
英文文档：

Is used to define the discriminator column for the SINGLE_TABLE and JOINED inheritance mapping strategies.

The strategy and the discriminator column are only specified in the root of an entity class hierarchy or subhierarchy in which a different inheritance strategy is applied

If the DiscriminatorColumn annotation is missing, and a discriminator column is required, the name of the discriminator column defaults to "DTYPE" and the discriminator type to DiscriminatorType.STRING.

     Example:
     @Entity
     @Table(name="CUST")
     @Inheritance(strategy=SINGLE_TABLE)
     @DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
     public class Customer { ... }

     @Entity
     public class ValuedCustomer extends Customer { ... }

Since:
Java Persistence 1.0

Optional Element Summary
String | columnDefinition (Optional) The SQL fragment that is used when generating the DDL for the discriminator column.
DiscriminatorType | discriminatorType (Optional) The type of object/column to use as a class discriminator.
int | length (Optional) The column length for String-based discriminator types.
String | name (Optional) The name of column to be used for the discriminator.

abstract public String name()
（可选）用作鉴别符的列名称。
英文文档：

name

public abstract String name
(Optional) The name of column to be used for the discriminator.

Default:
"DTYPE"

abstract public DiscriminatorType discriminatorType()
（可选）用作类鉴别符的对象/列类型。默认为 DiscriminatorType.STRING。
英文文档：

discriminatorType

public abstract DiscriminatorType discriminatorType
(Optional) The type of object/column to use as a class discriminator. Defaults to DiscriminatorType.STRING.

Default:
STRING

abstract public String columnDefinition()
（可选）生成该鉴别符列时使用的 SQL 句段。

默认为提供者生成的 SQL，以创建指定鉴别符类型的列。

英文文档：

columnDefinition

public abstract String columnDefinition
(Optional) The SQL fragment that is used when generating the DDL for the discriminator column.

Defaults to the provider-generated SQL to create a column of the specified discriminator type.

Default:
""

abstract public int length()
（可选）基于 String 的鉴别符类型的列长。其他鉴别符类型忽略此属性。
英文文档：

length

public abstract int length
(Optional) The column length for String-based discriminator types. Ignored for other discriminator types.

Default:
31
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


DiscriminatorValue (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type DiscriminatorValue

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface DiscriminatorValue

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此类用于指定给定类型实体的鉴别符列的值。DiscriminatorValue 注释只能对具体的实体类指定。如果没有指定 DiscriminatorValue 注释并使用了鉴别符列，则将使用特定于提供者的函数生成表示整个类型的值。如果 DiscriminatorType 为 STRING，则鉴别符值默认为实体名称。

仅在实体类分层结构的根或应用了不同继承战略的次级分层结构中指定继承战略和鉴别符列。如果鉴别符值不是默认的，则应该为分层结构中的每个实体类指定此值。

示例：

    @Entity
    @Table(name="CUST")
    @Inheritance(strategy=SINGLE_TABLE)
    @DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
    @DiscriminatorValue("CUSTOMER")
    public class Customer { ... }

    @Entity
    @DiscriminatorValue("VCUSTOMER")
    public class ValuedCustomer extends Customer { ... }
since
en
Java Persistence 1.0
英文文档：

Is used to specify the value of the discriminator column for entities of the given type. The DiscriminatorValue annotation can only be specified on a concrete entity class. If the DiscriminatorValue annotation is not specified and a discriminator column is used, a provider-specific function will be used to generate a value representing the entity type. If the DiscriminatorType is STRING, the discriminator value default is the entity name.

The inheritance strategy and the discriminator column are only specified in the root of an entity class hierarchy or subhierarchy in which a different inheritance strategy is applied. The discriminator value, if not defaulted, should be specified for each entity class in the hierarchy.

    Example:

    @Entity
    @Table(name="CUST")
    @Inheritance(strategy=SINGLE_TABLE)
    @DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
    @DiscriminatorValue("CUSTOMER")
    public class Customer { ... }

    @Entity
    @DiscriminatorValue("VCUSTOMER")
    public class ValuedCustomer extends Customer { ... }

Since:
Java Persistence 1.0

Required Element Summary
 String value
(Optional) The value that indicates that the row is an entity of the annotated entity type.

Element Detail

abstract public String value()
（可选）表示行是注释的实体类型的值。

如果没有指定 DiscriminatorValue 注释并使用了鉴别符列，则将使用特定于提供者的函数生成表示整个类型的值。如果 DiscriminatorType 为 STRING，则鉴别符值默认为实体名称。

英文文档：

value

public abstract String value
(Optional) The value that indicates that the row is an entity of the annotated entity type.

If the DiscriminatorValue annotation is not specified and a discriminator column is used, a provider-specific function will be used to generate a value representing the entity type. If the DiscriminatorType is STRING, the discriminator value default is the entity name.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Embeddable (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Embeddable

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Embeddable

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

定义符合以下条件的类：其实例存储为拥有实体的内在部分，并共享实体身份。嵌入对象的各个持久属性或字段都映射到实体的数据库表格。只有 Basic、Column、Lob、Temporal 和 Enumerated 映射注释能够以可移植的方式映射注释为 Embeddable 的类的持久字段或属性。

注意，Transient 注释可以用于指定可嵌入类的非持久状态。

since
en
Java Persistence 1.0
英文文档：

Defines a class whose instances are stored as an intrinsic part of an owning entity and share the identity of the entity. Each of the persistent properties or fields of the embedded object is mapped to the database table for the entity. Only Basic, Column, Lob, Temporal, and Enumerated mapping annotations may portably be used to map the persistent fields or properties of classes annotated as Embeddable.

Note that the Transient annotation may be used to designate the non-persistent state of an embeddable class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Embedded (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Embedded

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Embedded

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

定义值为可嵌入类实例的实体的持久字段或属性。可嵌入的类必须注释为 Embeddable。
示例：

   @Embedded
   @AttributeOverrides({
       @AttributeOverride(name="startDate",
           column=@Column("EMP_START")),
       @AttributeOverride(name="endDate", column=@Column("EMP_END"))
   })
   public EmploymentPeriod getEmploymentPeriod() { ... }
since
en
Java Persistence 1.0
英文文档：

Defines a persistent field or property of an entity whose value is an instance of an embeddable class. The embeddable class must be annotated as Embeddable.

   Example:

   @Embedded
   @AttributeOverrides({
       @AttributeOverride(name="startDate",
           column=@Column("EMP_START")),
       @AttributeOverride(name="endDate", column=@Column("EMP_END"))
   })
   public EmploymentPeriod getEmploymentPeriod() { ... }

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


EmbeddedId (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type EmbeddedId

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface EmbeddedId

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此类应用于实体类或映射的超类的持久字段或属性，以说明复合主键为可嵌入的类。可嵌入的类必须注释为 Embeddable。
示例：

    @EmbeddedId
    protected EmployeePK empPK;
since
en
Java Persistence 1.0
英文文档：

Is applied to a persistent field or property of an entity class or mapped superclass to denote a composite primary key that is an embeddable class. The embeddable class must be annotated as Embeddable.

    Example:

    @EmbeddedId
    protected EmployeePK empPK;

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Entity (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Entity

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Entity

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

指定类是一个实体。此注释应用于实体类。
since
en
Java Persistence 1.0
英文文档：

Specifies that the class is an entity. This annotation is applied to the entity class.

Since:
Java Persistence 1.0

Optional Element Summary
 String name
The name of an entity.

abstract public String name()
实体名称。默认为实体类的非限定名称。此名称用于引用查询中的实体。此名称不得为 Java Persistence 查询语言中的保留字面值。
英文文档：

name

public abstract String name
The name of an entity. Defaults to the unqualified name of the entity class. This name is used to refer to the entity in queries. The name must not be a reserved literal in the Java Persistence query language.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


EntityListeners (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type EntityListeners

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface EntityListeners

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

指定要对实体或映射的超类使用的回调侦听器类。此注释可以应用于实体类或映射的超类。
since
en
Java Persistence 1.0
英文文档：

Specifies the callback listener classes to be used for an entity or mapped superclass. This annotation may be applied to an entity class or mapped superclass.

Since:
Java Persistence 1.0

Required Element Summary
 Class[] value
The callback listener classes

Element Detail

abstract public Class<T>[] value()
回调侦听器类
英文文档：

value

public abstract Class[] value
The callback listener classes

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


EntityResult (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type EntityResult

@Target(value={})
@Retention(value=RUNTIME)
public @interface EntityResult

Implements: Annotation
@Target(value={})
@Retention(value=RUNTIME)

引用 SQL 查询的 SELECT 子句中的实体。如果使用此注释，则 SQL 语句应该选择映射到该实体对象的所有列。这应该包括相关实体的外键列。数据不足时返回的结果是不确定的。
示例
   Query q = em.createNativeQuery(
       "SELECT o.id, o.quantity, o.item, i.id, i.name, i.description "+
           "FROM Order o, Item i " +
           "WHERE (o.quantity > 25) AND (o.item = i.id)",
       "OrderItemResults");
   @SqlResultSetMapping(name="OrderItemResults",
       entities={
           @EntityResult(entityClass=com.acme.Order.class),
           @EntityResult(entityClass=com.acme.Item.class)
   })
since
en
Java Persistence 1.0
英文文档：

References an entity in the SELECT clause of a SQL query. If this annotation is used, the SQL statement should select all of the columns that are mapped to the entity object. This should include foreign key columns to related entities. The results obtained when insufficient data is available are undefined.

   Example
   Query q = em.createNativeQuery(
       "SELECT o.id, o.quantity, o.item, i.id, i.name, i.description "+
           "FROM Order o, Item i " +
           "WHERE (o.quantity > 25) AND (o.item = i.id)",
       "OrderItemResults");
   @SqlResultSetMapping(name="OrderItemResults",
       entities={
           @EntityResult(entityClass=com.acme.Order.class),
           @EntityResult(entityClass=com.acme.Item.class)
   })

Since:
Java Persistence 1.0

Required Element Summary
 Class entityClass
The class of the result
Optional Element Summary
String | discriminatorColumn Specifies the column name (or alias) of the column in the SELECT list that is used to determine the type of the entity instance.
FieldResult[] | fields Maps the columns specified in the SELECT list of the query to the properties or fields of the entity class.

Element Detail

abstract public Class<T> entityClass()
结果类
英文文档：

entityClass

public abstract Class entityClass
The class of the result

abstract public FieldResult[] fields()
将查询的 SELECT 列表中指定的列映射到实体类的属性或字段。
英文文档：

fields

public abstract FieldResult[] fields
Maps the columns specified in the SELECT list of the query to the properties or fields of the entity class.

Default:
{}

abstract public String discriminatorColumn()
指定 SELECT 列表中的列名称（或别名），该名称用于确定实体实例的类型。
英文文档：

discriminatorColumn

public abstract String discriminatorColumn
Specifies the column name (or alias) of the column in the SELECT list that is used to determine the type of the entity instance.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Enumerated (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Enumerated

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Enumerated

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

指定应该做为枚举类型保留的持久属性或字段。它可以与 Basic 注释一起使用。
示例：

   public enum EmployeeStatus {FULL_TIME, PART_TIME, CONTRACT}

   public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}

   @Entity public class Employee {
       public EmployeeStatus getStatus() {...}
       @Enumerated(STRING)
       public SalaryRate getPayScale() {...}
       ...
   }
since
en
Java Persistence 1.0
英文文档：

Specifies that a persistent property or field should be persisted as a enumerated type. It may be used in conjunction with the Basic annotation.

   Example:

   public enum EmployeeStatus {FULL_TIME, PART_TIME, CONTRACT}

   public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}

   @Entity public class Employee {
       public EmployeeStatus getStatus() {...}
       @Enumerated(STRING)
       public SalaryRate getPayScale() {...}
       ...
   }

Since:
Java Persistence 1.0

Optional Element Summary
 EnumType value
(Optional) The type used in mapping an enum type.

abstract public EnumType value()
（可选）映射枚举类型时使用的类型。
英文文档：

value

public abstract EnumType value
(Optional) The type used in mapping an enum type.

Default:
ORDINAL
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ExcludeDefaultListeners (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type ExcludeDefaultListeners

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface ExcludeDefaultListeners

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

指定不能对实体类（或映射的超类）及其子类调用默认的侦听器。
since
en
Java Persistence 1.0
英文文档：

Specifies that the invocation of default listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ExcludeSuperclassListeners (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type ExcludeSuperclassListeners

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface ExcludeSuperclassListeners

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

指定不能对实体类（或映射的超类）及其子类调用超类侦听器。
since
en
Java Persistence 1.0
英文文档：

Specifies that the invocation of superclass listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


FieldResult (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type FieldResult

@Target(value={})
@Retention(value=RUNTIME)
public @interface FieldResult

Implements: Annotation
@Target(value={})
@Retention(value=RUNTIME)

此类用于将查询的 SELECT 列表中指定的列映射到实体类的属性或字段。

示例：
   Query q = em.createNativeQuery(
       "SELECT o.id AS order_id, " +
           "o.quantity AS order_quantity, " +
           "o.item AS order_item, " +
         "FROM Order o, Item i " +
         "WHERE (order_quantity > 25) AND (order_item = i.id)",
       "OrderResults");

   @SqlResultSetMapping(name="OrderResults",
       entities={
           @EntityResult(entityClass=com.acme.Order.class, fields={
               @FieldResult(name="id", column="order_id"),
               @FieldResult(name="quantity", column="order_quantity"),
               @FieldResult(name="item", column="order_item")})
       })
since
en
Java Persistence 1.0
英文文档：

Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class.

 Example:
   Query q = em.createNativeQuery(
       "SELECT o.id AS order_id, " +
           "o.quantity AS order_quantity, " +
           "o.item AS order_item, " +
         "FROM Order o, Item i " +
         "WHERE (order_quantity > 25) AND (order_item = i.id)",
       "OrderResults");

   @SqlResultSetMapping(name="OrderResults",
       entities={
           @EntityResult(entityClass=com.acme.Order.class, fields={
               @FieldResult(name="id", column="order_id"),
               @FieldResult(name="quantity", column="order_quantity"),
               @FieldResult(name="item", column="order_item")})
       })

Since:
Java Persistence 1.0

Required Element Summary
String | column Name of the column in the SELECT clause - i.e., column aliases, if applicable.
String | name Name of the persistent field or property of the class.

Element Detail

abstract public String name()
类的持久字段或属性的名称。
英文文档：

name

public abstract String name
Name of the persistent field or property of the class.

abstract public String column()
SELECT 子句中的列的名称，即列别名（如果适用）。
英文文档：

column

public abstract String column
Name of the column in the SELECT clause - i.e., column aliases, if applicable.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


GeneratedValue (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type GeneratedValue

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface GeneratedValue

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

供主键值的生成战略规范使用。GeneratedValue 注释可以与 Id 注释一起应用于实体或映射的超类的主键属性或字段。

示例 1：

     @Id
     @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
     @Column(name="CUST_ID")
     public Long getId() { return id; }

示例 2：

     @Id
     @GeneratedValue(strategy=TABLE, generator="CUST_GEN")
     @Column(name="CUST_ID")
     Long id;
since
en
Java Persistence 1.0
英文文档：

Provides for the specification of generation strategies for the values of primary keys. The GeneratedValue annotation may be applied to a primary key property or field of an entity or mapped superclass in conjunction with the Id annotation.

 Example 1:

     @Id
     @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
     @Column(name="CUST_ID")
     public Long getId() { return id; }

     Example 2:

     @Id
     @GeneratedValue(strategy=TABLE, generator="CUST_GEN")
     @Column(name="CUST_ID")
     Long id;

Since:
Java Persistence 1.0

Optional Element Summary
String | generator (Optional) The name of the primary key generator to use as specified in the SequenceGenerator or TableGenerator annotation.
GenerationType | strategy (Optional) The primary key generation strategy that the persistence provider must use to generate the annotated entity primary key.

abstract public GenerationType strategy()
（可选）主键生成战略，持久性提供者必须使用该战略生成带注释的实体主键。
英文文档：

strategy

public abstract GenerationType strategy
(Optional) The primary key generation strategy that the persistence provider must use to generate the annotated entity primary key.

Default:
AUTO

abstract public String generator()
（可选）SequenceGenerator 或 TableGenerator 注释中指定使用的主键生成器的名称。

默认为持久性提供者提供的 ID 生成器。

英文文档：

generator

public abstract String generator
(Optional) The name of the primary key generator to use as specified in the SequenceGenerator or TableGenerator annotation.

Defaults to the id generator supplied by persistence provider.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Id (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Id

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Id

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

指定实体的主键属性或字段。
示例：

   @Id
   public Long getId() { return id; }
since
en
Java Persistence 1.0
英文文档：

Specifies the primary key property or field of an entity.

   Example:

   @Id
   public Long getId() { return id; }

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


IdClass (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type IdClass

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface IdClass

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

指定映射到实体的多个字段或属性的复合主键类。

主键类中字段或属性的名称必须与实体的主键字段或属性的名称一致，它们的类型也必须相同。

示例：

@IdClass(com.acme.EmployeePK.class)
   @Entity
   public class Employee {
     @Id String empName;
     @Id Date birthDay;
     ...
   }
since
en
Java Persistence 1.0
英文文档：

Specifies a composite primary key class that is mapped to multiple fields or properties of the entity.

The names of the fields or properties in the primary key class and the primary key fields or properties of the entity must correspond and their types must be the same.

   Example:

   @IdClass(com.acme.EmployeePK.class)
   @Entity
   public class Employee {
     @Id String empName;
     @Id Date birthDay;
     ...
   }

Since:
Java Persistence 1.0

Required Element Summary
 Class value
Primary key class

Element Detail

abstract public Class<T> value()
主键类
英文文档：

value

public abstract Class value
Primary key class

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Inheritance (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Inheritance

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Inheritance

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

定义要对实体类分层结构使用的继承战略。它是对实体类分层结构的根实体类指定的。

示例：

   @Entity
   @Inheritance(strategy=JOINED)
   public class Customer { ... }

   @Entity
   public class ValuedCustomer extends Customer { ... }
since
en
Java Persistence 1.0
英文文档：

Defines the inheritance strategy to be used for an entity class hierarchy. It is specified on the entity class that is the root of the entity class hierarchy.

   Example:

   @Entity
   @Inheritance(strategy=JOINED)
   public class Customer { ... }

   @Entity
   public class ValuedCustomer extends Customer { ... }

Since:
Java Persistence 1.0

Optional Element Summary
 InheritanceType strategy
The strategy to be used

abstract public InheritanceType strategy()
要使用的战略
英文文档：

strategy

public abstract InheritanceType strategy
The strategy to be used

Default:
SINGLE_TABLE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


JoinColumn (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type JoinColumn

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface JoinColumn

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此类用于指定连接到实体关联的映射列。
示例：

   @ManyToOne
   @JoinColumn(name="ADDR_ID")
   public Address getAddress() { return address; }
since
en
Java Persistence 1.0
英文文档：

Is used to specify a mapped column for joining an entity association.

   Example:

   @ManyToOne
   @JoinColumn(name="ADDR_ID")
   public Address getAddress() { return address; }

Since:
Java Persistence 1.0

Optional Element Summary
String | columnDefinition (Optional) The SQL fragment that is used when generating the DDL for the column.
boolean | insertable (Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider.
String | name (Optional) The name of the foreign key column.
boolean | nullable (Optional) Whether the foreign key column is nullable.
String | referencedColumnName (Optional) The name of the column referenced by this foreign key column.
String | table (Optional) The name of the table that contains the column.
boolean | unique (Optional) Whether the property is a unique key.
boolean | updatable (Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider.

abstract public String name()
（可选）外键列的名称。它所在的表取决于上下文。如果连接针对 OneToOne 或 Many- ToOne 映射，则外键列位于源实体的表格中。如果连接针对 ManyToMany，则外键位于连接表格中。 默认（仅适用于使用单个连接列时）：以下内容的串接：引用实体的引用关系属性或字段名称；“_”；引用的主键列的名称。如果实体中没有此类引用关系属性或字段，则连接列名称为以下内容的串接：实体的名称：“_”；引用的主键列的名称。
英文文档：

name

public abstract String name
(Optional) The name of the foreign key column. The table in which it is found depends upon the context. If the join is for a OneToOne or Many- ToOne mapping, the foreign key column is in the table of the source entity. If the join is for a ManyToMany, the foreign key is in a join table. Default (only applies if a single join column is used): The concatenation of the following: the name of the referencing relationship property or field of the referencing entity; "_"; the name of the referenced primary key column. If there is no such referencing relationship property or field in the entity, the join column name is formed as the concatenation of the following: the name of the entity; "_"; the name of the referenced primary key column.

Default:
""

abstract public String referencedColumnName()
（可选）此外键列引用的列的名称。使用关系映射时，引用的列位于目标实体的表格中。在 JoinTable 注释内部使用时，引用的键列位于所在实体（如果连接是反向连接定义的一部分，则为反向实体）的实体表格中。 默认（仅适用于使用单个连接列时）：与引用表格的主键列名称相同。
英文文档：

referencedColumnName

public abstract String referencedColumnName
(Optional) The name of the column referenced by this foreign key column. When used with relationship mappings, the referenced column is in the table of the target entity. When used inside a JoinTable annotation, the referenced key column is in the entity table of the owning entity, or inverse entity if the join is part of the inverse join definition. Default (only applies if single join column is being used): The same name as the primary key column of the referenced table.

Default:
""

abstract public boolean unique()
（可选）属性是否为唯一键。这是表格级别的 UniqueConstraint 注释的快捷方式，在唯一的键约束只有一个字段时很有用。主键为外键一部分时，不必为对应于此主键的连接列显式指定此属性。
英文文档：

unique

public abstract boolean unique
(Optional) Whether the property is a unique key. This is a shortcut for the UniqueConstraint annotation at the table level and is useful for when the unique key constraint is only a single field. It is not necessary to explicitly specify this for a join column that corresponds to a primary key that is part of a foreign key.

Default:
false

abstract public boolean nullable()
（可选）外键列是否可为 null。
英文文档：

nullable

public abstract boolean nullable
(Optional) Whether the foreign key column is nullable.

Default:
true

abstract public boolean insertable()
（可选）持久性提供者生成的 SQL INSERT 语句中是否包含该列。
英文文档：

insertable

public abstract boolean insertable
(Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider.

Default:
true

abstract public boolean updatable()
（可选）持久性提供者生成的 SQL UPDATE 语句中是否包含该列。
英文文档：

updatable

public abstract boolean updatable
(Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider.

Default:
true

abstract public String columnDefinition()
（可选）生成该列的 DDL 时使用的 SQL 句段。

默认为为该列生成的 SQL。

英文文档：

columnDefinition

public abstract String columnDefinition
(Optional) The SQL fragment that is used when generating the DDL for the column.

Defaults to the generated SQL for the column.

Default:
""

abstract public String table()
（可选）包含该列的表格的名称。如果没有指定表格，则假设该列位于适用实体的主表格中。
英文文档：

table

public abstract String table
(Optional) The name of the table that contains the column. If a table is not specified, the column is assumed to be in the primary table of the applicable entity.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


JoinColumns (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type JoinColumns

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface JoinColumns

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

定义复合外键的映射。此注释组合了同一关系的 JoinColumn 注释。

使用 JoinColumns 注释时，每个此类 JoinColumn 注释都必须指定 name 和 referencedColumnName 元素。

示例：
    @ManyToOne
    @JoinColumns({
        @JoinColumn(name="ADDR_ID", referencedColumnName="ID"),
        @JoinColumn(name="ADDR_ZIP", referencedColumnName="ZIP")
    })
    public Address getAddress() { return address; }
since
en
Java Persistence 1.0
英文文档：

Defines mapping for the composite foreign keys. This annotation groups JoinColumn annotations for the same relationship.

When the JoinColumns annotation is used, both the name and the referencedColumnName elements must be specified in each such JoinColumn annotation.

    Example:
    @ManyToOne
    @JoinColumns({
        @JoinColumn(name="ADDR_ID", referencedColumnName="ID"),
        @JoinColumn(name="ADDR_ZIP", referencedColumnName="ZIP")
    })
    public Address getAddress() { return address; }

Since:
Java Persistence 1.0

Required Element Summary
 JoinColumn[] value

Element Detail

abstract public JoinColumn[] value()
英文文档：

value

public abstract JoinColumn[] value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


JoinTable (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type JoinTable

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface JoinTable

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此注释在关联映射中使用。它是在多对多关联的拥有端或单向的一对多关联中指定的。

如果缺少 JoinTable 注释，则应用注释元素的默认值。连接表格的名称假定为使用下划线串接起来的关联主表格的表格名称（拥有端在最前面）。

示例：
    @JoinTable(
    name="CUST_PHONE",
    joinColumns=
        @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
    inverseJoinColumns=
        @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
    )
since
en
Java Persistence 1.0
英文文档：

This annotation is used in the mapping of associations. It is specified on the owning side of a many-to-many association, or in a unidirectional one-to-many association.

If the JoinTable annotation is missing, the default values of the annotation elements apply. The name of the join table is assumed to be the table names of the associated primary tables concatenated together (owning side first) using an underscore.

    Example:
    @JoinTable(
    name="CUST_PHONE",
    joinColumns=
        @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
    inverseJoinColumns=
        @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
    )

Since:
Java Persistence 1.0

Optional Element Summary
String | catalog (Optional) The catalog of the table.
JoinColumn[] | inverseJoinColumns (Optional) The foreign key columns of the join table which reference the primary table of the entity that does not own the association (i.e. the inverse side of the association).
JoinColumn[] | joinColumns (Optional) The foreign key columns of the join table which reference the primary table of the entity owning the association (i.e. the owning side of the association).
String | name (Optional) The name of the join table.
String | schema (Optional) The schema of the table.
UniqueConstraint[] | uniqueConstraints (Optional) Unique constraints that are to be placed on the table.

abstract public String name()
（可选）连接表格的名称。

默认为串接起来的两个关联主实体表格的名称（使用下划线分隔）。

英文文档：

name

public abstract String name
(Optional) The name of the join table.

Defaults to the concatenated names of the two associated primary entity tables, separated by an underscore.

Default:
""

abstract public String catalog()
（可选）表格的种类。

默认为默认种类。

英文文档：

catalog

public abstract String catalog
(Optional) The catalog of the table.

Defaults to the default catalog.

Default:
""

abstract public String schema()
（可选）表格的模式。

默认为用户的默认模式。

英文文档：

schema

public abstract String schema
(Optional) The schema of the table.

Defaults to the default schema for user.

Default:
""

abstract public JoinColumn[] joinColumns()
（可选）连接表格的外键列，它们引用拥有关联的实体的主表格（即关联的拥有端）。

使用与 JoinColumn 相同的默认值。

英文文档：

joinColumns

public abstract JoinColumn[] joinColumns
(Optional) The foreign key columns of the join table which reference the primary table of the entity owning the association (i.e. the owning side of the association).

Uses the same defaults as for JoinColumn.

Default:
{}

abstract public JoinColumn[] inverseJoinColumns()
（可选）连接表格的外键列，它们引用不拥有关联的实体的主表格（即关联的反向端）。

使用与 JoinColumn 相同的默认值。

英文文档：

inverseJoinColumns

public abstract JoinColumn[] inverseJoinColumns
(Optional) The foreign key columns of the join table which reference the primary table of the entity that does not own the association (i.e. the inverse side of the association).

Uses the same defaults as for JoinColumn.

Default:
{}

abstract public UniqueConstraint[] uniqueConstraints()
（可选）对表格设置的唯一约束。仅当表格生成生效时使用。

默认为无额外限制。

英文文档：

uniqueConstraints

public abstract UniqueConstraint[] uniqueConstraints
(Optional) Unique constraints that are to be placed on the table. These are only used if table generation is in effect.

Defaults to no additional constraints.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Lob (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Lob

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Lob

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

指定应该作为大对象到支持数据库的大对象类型保留的持久属性或字段。Lob 注释可以与 Basic 注释一起使用。Lob 可以是二进制或字符类型。

Lob 类型是根据持久字段或属性推断的，但字符串和基于字符的类型默认为 Blob。

示例：

   @Lob @Basic(fetch=LAZY)
   @Column(name="REPORT")
   protected String report;
since
en
Java Persistence 1.0
英文文档：

Specifies that a persistent property or field should be persisted as a large object to a database-supported large object type. The Lob annotation may be used in conjunction with the Basic annotation. A Lob may be either a binary or character type.

The Lob type is inferred from the type of the persistent field or property, and except for string and character-based types defaults to Blob.

   Example:

   @Lob @Basic(fetch=LAZY)
   @Column(name="REPORT")
   protected String report;

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManyToMany (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type ManyToMany

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface ManyToMany

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

定义带有多对多多样性的多值关联。如果将 Collection 的元素类型指定为 generic 类型，则不必指定关联的目标实体类；否则必须指定。

每个多对多关联都有两端：拥有端和非拥有端（或反向端）。连接表是对拥有端指定的。如果关联是双向的，则两端都由拥有端指定。

OneToMany 注释的注释元素也适用于 ManyToMany 注释。

示例 1：

在 Customer 类中：

 @ManyToMany
 @JoinTable(name="CUST_PHONES")
 public Set getPhones() { return phones; }

在 PhoneNumber 类中：

@ManyToMany(mappedBy="phones")
public Set getCustomers() { return customers; }
示例 2：

在 Customer 类中：

@ManyToMany(targetEntity=com.acme.PhoneNumber.class)
public Set getPhones() { return phones; }

在 PhoneNumber 类中：

@ManyToMany(targetEntity=com.acme.Customer.class, mappedBy="phones")
public Set getCustomers() { return customers; }

示例 3：

在 Customer 类中：

@ManyToMany
    @JoinTable(name="CUST_PHONE",
        joinColumns=
            @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
        inverseJoinColumns=
            @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
        )
    public Set getPhones() { return phones; }

在 PhoneNumberClass 中：

@ManyToMany(mappedBy="phones")
public Set getCustomers() { return customers; }
since
en
Java Persistence 1.0
英文文档：

Defines a many-valued association with many-to-many multiplicity. If the Collection is defined using generics to specify the element type, the associated target entity class does not need to be specified; otherwise it must be specified.

Every many-to-many association has two sides, the owning side and the non-owning, or inverse, side. The join table is specified on the owning side. If the association is bidirectional, either side may be designated as the owning side.

The same annotation elements for the OneToMany annotation apply to the ManyToMany annotation.

    Example 1:

    In Customer class:

    @ManyToMany
    @JoinTable(name="CUST_PHONES")
    public Set getPhones() { return phones; }

    In PhoneNumber class:

    @ManyToMany(mappedBy="phones")
    public Set getCustomers() { return customers; }

    Example 2:

    In Customer class:

    @ManyToMany(targetEntity=com.acme.PhoneNumber.class)
    public Set getPhones() { return phones; }

    In PhoneNumber class:

    @ManyToMany(targetEntity=com.acme.Customer.class, mappedBy="phones")
    public Set getCustomers() { return customers; }

    Example 3:

    In Customer class:

    @ManyToMany
    @JoinTable(name="CUST_PHONE",
        joinColumns=
            @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
        inverseJoinColumns=
            @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
        )
    public Set getPhones() { return phones; }

    In PhoneNumberClass:

    @ManyToMany(mappedBy="phones")
    public Set getCustomers() { return customers; }

Since:
Java Persistence 1.0

Optional Element Summary
CascadeType[] | cascade (Optional) The operations that must be cascaded to the target of the association.
FetchType | fetch (Optional) Whether the association should be lazily loaded or must be eagerly fetched.
String | mappedBy The field that owns the relationship.
Class | targetEntity (Optional) The entity class that is the target of the association.

abstract public Class<T> targetEntity()
（可选）作为关联目标的实体类。仅当使用 Java generic 定义了 Collection 属性时才是可选的。否则必须指定。

使用 generic 定义时，默认为参数化的 Collection 类型。

英文文档：

targetEntity

public abstract Class targetEntity
(Optional) The entity class that is the target of the association. Optional only if the collection property is defined using Java generics. Must be specified otherwise.

Defaults to the parameterized type of the collection when defined using generics.

Default:
void.class

abstract public CascadeType[] cascade()
（可选）必须串联到关联目标的操作。

默认为不串联任何操作。

英文文档：

cascade

public abstract CascadeType[] cascade
(Optional) The operations that must be cascaded to the target of the association.

Defaults to no operations being cascaded.

Default:
{}

abstract public FetchType fetch()
可选）关联应该延迟加载还是必须立即获取。EAGER 战略是必须立即获取关联实体的持久性提供者运行时的要求。LAZY 战略是持久性提供者运行时的提示。
英文文档：

fetch

public abstract FetchType fetch
(Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistenceprovider runtime that the associatedentities must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime.

Default:
LAZY

abstract public String mappedBy()
拥有关系的字段。只要关系不是单向的，就需要它。
英文文档：

mappedBy

public abstract String mappedBy
The field that owns the relationship. Required unless the relationship is unidirectional.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ManyToOne (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type ManyToOne

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface ManyToOne

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此注释定义对另一个带有多对一多样性的实体类的单值关联。一般不必显式指定目标实体，因为通常可以根据引用的对象类型推断出来。

示例：

     @ManyToOne(optional=false)
     @JoinColumn(name="CUST_ID", nullable=false, updatable=false)
     public Customer getCustomer() { return customer; }
since
en
Java Persistence 1.0
英文文档：

This annotation defines a single-valued association to another entity class that has many-to-one multiplicity. It is not normally necessary to specify the target entity explicitly since it can usually be inferred from the type of the object being referenced.

     Example:

     @ManyToOne(optional=false)
     @JoinColumn(name="CUST_ID", nullable=false, updatable=false)
     public Customer getCustomer() { return customer; }

Since:
Java Persistence 1.0

Optional Element Summary
CascadeType[] | cascade (Optional) The operations that must be cascaded to the target of the association.
FetchType | fetch (Optional) Whether the association should be lazily loaded or must be eagerly fetched.
boolean | optional (Optional) Whether the association is optional.
Class | targetEntity (Optional) The entity class that is the target of the association.

abstract public Class<T> targetEntity()
（可选）作为关联目标的实体类。

默认为存储关联的字段或属性的类型。

英文文档：

targetEntity

public abstract Class targetEntity
(Optional) The entity class that is the target of the association.

Defaults to the type of the field or property that stores the association.

Default:
void.class

abstract public CascadeType[] cascade()
（可选）必须串联到关联目标的操作。

默认情况下，不串联任何操作。

英文文档：

cascade

public abstract CascadeType[] cascade
(Optional) The operations that must be cascaded to the target of the association.

By default no operations are cascaded.

Default:
{}

abstract public FetchType fetch()
（可选）关联应该延迟加载还是必须立即获取。EAGER 战略是必须立即获取关联实体的持久性提供者运行时的要求。LAZY 战略是持久性提供者运行时的提示。
英文文档：

fetch

public abstract FetchType fetch
(Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime.

Default:
EAGER

abstract public boolean optional()
（可选）关联是否是可选的。如果设置为 false，则必须总是存在非 null 关系。
英文文档：

optional

public abstract boolean optional
(Optional) Whether the association is optional. If set to false then a non-null relationship must always exist.

Default:
true
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


MapKey (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type MapKey

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface MapKey

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此类用于指定 java.util.Map 类型的关联的映射键。

如果使用主键以外的持久字段或属性作为映射键，则它应该关联一个唯一性约束。

示例 1：

    @Entity
    public class Department {
        ...
        @OneToMany(mappedBy="department")
        @MapKey(name="empId")
        public Map getEmployees() {... }
        ...
    }

    @Entity
    public class Employee {
        ...
        @Id Integer getEmpid() { ... }
        @ManyToOne
        @JoinColumn(name="dept_id")
        public Department getDepartment() { ... }
        ...
    }

示例 2：

    @Entity
        public class Department {
        ...
        @OneToMany(mappedBy="department")
        @MapKey(name="empPK")
        public Map getEmployees() {... }
        ...
    }

    @Entity
        public class Employee {
        @EmbeddedId public EmployeePK getEmpPK() { ... }
        ...
        @ManyToOne
        @JoinColumn(name="dept_id")
        public Department getDepartment() { ... }
        ...
    }

    @Embeddable
    public class EmployeePK {
        String name;
        Date bday;
    }
since
en
Java Persistence 1.0
英文文档：

Is used to specify the map key for associations of type Map.

If a persistent field or property other than the primary key is used as a map key then it is expected to have a uniqueness constraint associated with it.

    Example 1:

    @Entity
    public class Department {
        ...
        @OneToMany(mappedBy="department")
        @MapKey(name="empId")
        public Map getEmployees() {... }
        ...
    }

    @Entity
    public class Employee {
        ...
        @Id Integer getEmpid() { ... }
        @ManyToOne
        @JoinColumn(name="dept_id")
        public Department getDepartment() { ... }
        ...
    }

    Example 2:

    @Entity
        public class Department {
        ...
        @OneToMany(mappedBy="department")
        @MapKey(name="empPK")
        public Map getEmployees() {... }
        ...
    }

    @Entity
        public class Employee {
        @EmbeddedId public EmployeePK getEmpPK() { ... }
        ...
        @ManyToOne
        @JoinColumn(name="dept_id")
        public Department getDepartment() { ... }
        ...
    }

    @Embeddable
    public class EmployeePK {
        String name;
        Date bday;
    }

Since:
Java Persistence 1.0

Optional Element Summary
 String name
The name of the persistent field or property of the associated entity that is used as the map key.

abstract public String name()
用作映射键的关联实体的持久字段或属性的名称。如果未指定该名称元素，则使用关联实体的主键作为映射键。如果主键是复合主键，并映射成 IdClass，则使用主键类的实例作为键。
英文文档：

name

public abstract String name
The name of the persistent field or property of the associated entity that is used as the map key. If the name element is not specified, the primary key of the associated entity is used as the map key. If the primary key is a composite primary key and is mapped as IdClass, an instance of the primary key class is used as the key.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


MappedSuperclass (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type MappedSuperclass

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface MappedSuperclass

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

指定一个类，该类的映射信息将应用于继承该类的实体。映射的超类没有专门为其定义的表格。

可以以与实体相同的方式映射 MappedSuperclass 注释指定的类，但是映射仅适用于其子类，因为映射的超类本身不存在表格。应用于子类时，继承的映射将在子类表格的上下文中应用。使用 AttributeOverride 和 AssociationOverride 注释或相应的 XML 元素可以重写这种子类中的映射信息。

示例：作为映射的超类的具体类
    @MappedSuperclass
    public class Employee {

        @Id protected Integer empId;
        @Version protected Integer version;
        @ManyToOne @JoinColumn(name="ADDR")
        protected Address address;

        public Integer getEmpId() { ... }
        public void setEmpId(Integer id) { ... }
        public Address getAddress() { ... }
        public void setAddress(Address addr) { ... }
    }

    // Default table is FTEMPLOYEE table
    @Entity
    public class FTEmployee extends Employee {

        // Inherited empId field mapped to FTEMPLOYEE.EMPID
        // Inherited version field mapped to FTEMPLOYEE.VERSION
        // Inherited address field mapped to FTEMPLOYEE.ADDR fk

    // Defaults to FTEMPLOYEE.SALARY

    protected Integer salary;

    public FTEmployee() {}

    public Integer getSalary() { ... }

    public void setSalary(Integer salary) { ... }
    }

    @Entity @Table(name="PT_EMP")
    @AssociationOverride(name="address",

    joincolumns=@JoinColumn(name="ADDR_ID"))
    public class PartTimeEmployee extends Employee {

        // Inherited empId field mapped to PT_EMP.EMPID
        // Inherited version field mapped to PT_EMP.VERSION
        // address field mapping overridden to PT_EMP.ADDR_ID fk
        @Column(name="WAGE")
        protected Float hourlyWage;

        public PartTimeEmployee() {}

        public Float getHourlyWage() { ... }
        public void setHourlyWage(Float wage) { ... }
    }

    Example: Non-entity superclass

    public class Cart {

        // This state is transient
        Integer operationCount;

        public Cart() { operationCount = 0; }
        public Integer getOperationCount() { return operationCount; }
        public void incrementOperationCount() { operationCount++; }
    }

    @Entity
    public class ShoppingCart extends Cart {

        Collection items = new Vector();

        public ShoppingCart() { super(); }

    ...

        @OneToMany
        public Collection getItems() { return items; }
        public void addItem(Item item) {
            items.add(item);
            incrementOperationCount();
        }
    }
since
en
Java Persistence 1.0
英文文档：

Designates a class whose mapping information is applied to the entities that inherit from it. A mapped superclass has no separate table defined for it.

A class designated with the MappedSuperclass annotation can be mapped in the same way as an entity except that the mappings will apply only to its subclasses since no table exists for the mapped superclass itself. When applied to the subclasses the inherited mappings will apply in the context of the subclass tables. Mapping information may be overridden in such subclasses by using the AttributeOverride and AssociationOverride annotations or corresponding XML elements.

    Example: Concrete class as a mapped superclass

    @MappedSuperclass
    public class Employee {

        @Id protected Integer empId;
        @Version protected Integer version;
        @ManyToOne @JoinColumn(name="ADDR")
        protected Address address;

        public Integer getEmpId() { ... }
        public void setEmpId(Integer id) { ... }
        public Address getAddress() { ... }
        public void setAddress(Address addr) { ... }
    }

    // Default table is FTEMPLOYEE table
    @Entity
    public class FTEmployee extends Employee {

        // Inherited empId field mapped to FTEMPLOYEE.EMPID
        // Inherited version field mapped to FTEMPLOYEE.VERSION
        // Inherited address field mapped to FTEMPLOYEE.ADDR fk

    // Defaults to FTEMPLOYEE.SALARY

    protected Integer salary;

    public FTEmployee() {}

    public Integer getSalary() { ... }

    public void setSalary(Integer salary) { ... }
    }

    @Entity @Table(name="PT_EMP")
    @AssociationOverride(name="address",

    joincolumns=@JoinColumn(name="ADDR_ID"))
    public class PartTimeEmployee extends Employee {

        // Inherited empId field mapped to PT_EMP.EMPID
        // Inherited version field mapped to PT_EMP.VERSION
        // address field mapping overridden to PT_EMP.ADDR_ID fk
        @Column(name="WAGE")
        protected Float hourlyWage;

        public PartTimeEmployee() {}

        public Float getHourlyWage() { ... }
        public void setHourlyWage(Float wage) { ... }
    }

    Example: Non-entity superclass

    public class Cart {

        // This state is transient
        Integer operationCount;

        public Cart() { operationCount = 0; }
        public Integer getOperationCount() { return operationCount; }
        public void incrementOperationCount() { operationCount++; }
    }

    @Entity
    public class ShoppingCart extends Cart {

        Collection items = new Vector();

        public ShoppingCart() { super(); }

    ...

        @OneToMany
        public Collection getItems() { return items; }
        public void addItem(Item item) {
            items.add(item);
            incrementOperationCount();
        }
    }

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


NamedNativeQueries (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type NamedNativeQueries

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface NamedNativeQueries

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此类用于指定本机 SQL 指定的查询所组成的数组。查询名称的范围限制在持久性单元内。
since
en
Java Persistence 1.0
英文文档：

Is used to specify an array of native SQL named queries. Query names are scoped to the persistence unit.

Since:
Java Persistence 1.0

Required Element Summary
 NamedNativeQuery[] value
Array of native SQL named queries

Element Detail

abstract public NamedNativeQuery[] value()
本机 SQL 指定的查询所组成的数组
英文文档：

value

public abstract NamedNativeQuery[] value
Array of native SQL named queries

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


NamedNativeQuery (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type NamedNativeQuery

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface NamedNativeQuery

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此类用于指定本机 SQL 指定的查询。查询名称的范围限制在持久性单元内。
since
en
Java Persistence 1.0
英文文档：

Is used to specify a native SQL named query. Query names are scoped to the persistence unit.

Since:
Java Persistence 1.0

Required Element Summary
String | name Is used to refer to the query when using the EntityManager methods that create query objects.
String | query The SQL query string
Optional Element Summary
QueryHint[] | hints Vendor-specific query hints
Class | resultClass The class of the result
String | resultSetMapping The name of a SqlResultSetMapping, as defined in metadata

Element Detail

abstract public String name()
在使用创建查询对象的 EntityManager 方法时用来引用查询。
英文文档：

name

public abstract String name
Is used to refer to the query when using the EntityManager methods that create query objects.

abstract public String query()
SQL 查询字符串
英文文档：

query

public abstract String query
The SQL query string

abstract public QueryHint[] hints()
特定于供应商的查询提示
英文文档：

hints

public abstract QueryHint[] hints
Vendor-specific query hints

Default:
{}

abstract public Class<T> resultClass()
结果类
英文文档：

resultClass

public abstract Class resultClass
The class of the result

Default:
void.class

abstract public String resultSetMapping()
SqlResultSetMapping 名称，在元数据中定义
英文文档：

resultSetMapping

public abstract String resultSetMapping
The name of a SqlResultSetMapping, as defined in metadata

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


NamedQueries (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type NamedQueries

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface NamedQueries

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

指定列出 Java Persistence 查询语言查询的数组。查询名称的范围限制在持久性单元内。
since
en
Java Persistence 1.0
英文文档：

Specifies an array of named Java Persistence query language queries. Query names are scoped to the persistence unit.

Since:
Java Persistence 1.0

Required Element Summary
 NamedQuery[] value
An array of named Java Persistence query language queries.

Element Detail

abstract public NamedQuery[] value()
指定 Java Persistence 查询语言查询所组成的数组。
英文文档：

value

public abstract NamedQuery[] value
An array of named Java Persistence query language queries.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


NamedQuery (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type NamedQuery

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface NamedQuery

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此类用于指定使用 Java Persistence 查询语言编写的指定查询，它在元数据中表示为静态查询。查询名称的范围限制在持久性单元内。

以下是定义使用 Java Persistence 查询语言编写的指定查询的示例：

    @NamedQuery(
            name="findAllCustomersWithName",
            query="SELECT c FROM Customer c WHERE c.name LIKE :custName"
    )

以下是使用指定查询的示例：

    @PersistenceContext
    public EntityManager em;
    ...
    customers = em.createNamedQuery("findAllCustomersWithName")
            .setParameter("custName", "Smith")
            .getResultList();
since
en
Java Persistence 1.0
英文文档：

Is used to specify a named query in the Java Persistence query language, which is a static query expressed in metadata. Query names are scoped to the persistence unit.

The following is an example of the definition of a named query in the Java Persistence query language:

    @NamedQuery(
            name="findAllCustomersWithName",
            query="SELECT c FROM Customer c WHERE c.name LIKE :custName"
    )

The following is an example of the use of a named query:

    @PersistenceContext
    public EntityManager em;
    ...
    customers = em.createNamedQuery("findAllCustomersWithName")
            .setParameter("custName", "Smith")
            .getResultList();

Since:
Java Persistence 1.0

Required Element Summary
String | name Refers to the query when using the EntityManager methods that create query objects.
String | query The query string in the Java Persistence query language
Optional Element Summary
 QueryHint[] hints
Vendor-specific query hints

Element Detail

abstract public String name()
在使用创建查询对象的 EntityManager 方法时引用查询。
英文文档：

name

public abstract String name
Refers to the query when using the EntityManager methods that create query objects.

abstract public String query()
使用 Java Persistence 查询语言编写的查询字符串
英文文档：

query

public abstract String query
The query string in the Java Persistence query language

abstract public QueryHint[] hints()
特定于供应商的查询提示
英文文档：

hints

public abstract QueryHint[] hints
Vendor-specific query hints

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


OneToMany (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type OneToMany

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface OneToMany

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

定义带有一对多多样性的多值关联。

如果将 Collection 的元素类型指定为 generic 类型，则不必指定关联的目标实体类型；否则必须指定目标实体类。

示例 1：使用 generic 的一对多关联

在 Customer 类中：

    @OneToMany(cascade=ALL, mappedBy="customer")
    public Set getOrders() { return orders; }

在 Order 类中：

    @ManyToOne
    @JoinColumn(name="CUST_ID", nullable=false)
    public Customer getCustomer() { return customer; }

示例 2：没有使用 generic 的一对多关联

在 Customer 类中：

    @OneToMany(targetEntity=com.acme.Order.class, cascade=ALL,
            mappedBy="customer")
    public Set getOrders() { return orders; }

在 Order 类中：

    @ManyToOne
    @JoinColumn(name="CUST_ID", nullable=false)
    public Customer getCustomer() { return customer; }
since
en
Java Persistence 1.0
英文文档：

Defines a many-valued association with one-to-many multiplicity.

If the collection is defined using generics to specify the element type, the associated target entity type need not be specified; otherwise the target entity class must be specified.

    Example 1: One-to-Many association using generics

    In Customer class:

    @OneToMany(cascade=ALL, mappedBy="customer")
    public Set getOrders() { return orders; }

    In Order class:

    @ManyToOne
    @JoinColumn(name="CUST_ID", nullable=false)
    public Customer getCustomer() { return customer; }

    Example 2: One-to-Many association without using generics

    In Customer class:

    @OneToMany(targetEntity=com.acme.Order.class, cascade=ALL,
            mappedBy="customer")
    public Set getOrders() { return orders; }

    In Order class:

    @ManyToOne
    @JoinColumn(name="CUST_ID", nullable=false)
    public Customer getCustomer() { return customer; }

Since:
Java Persistence 1.0

Optional Element Summary
CascadeType[] | cascade (Optional) The operations that must be cascaded to the target of the association.
FetchType | fetch (Optional) Whether the association should be lazily loaded or must be eagerly fetched.
String | mappedBy The field that owns the relationship.
Class | targetEntity (Optional) The entity class that is the target of the association.

abstract public Class<T> targetEntity()
（可选）作为关联目标的实体类。仅当使用 Java generic 定义了 Collection 属性时才是可选的。否则必须指定。

使用 generic 定义时，默认为参数化的 Collection 类型。

英文文档：

targetEntity

public abstract Class targetEntity
(Optional) The entity class that is the target of the association. Optional only if the collection property is defined using Java generics. Must be specified otherwise.

Defaults to the parameterized type of the collection when defined using generics.

Default:
void.class

abstract public CascadeType[] cascade()
（可选）必须串联到关联目标的操作。

默认为不串联任何操作。

英文文档：

cascade

public abstract CascadeType[] cascade
(Optional) The operations that must be cascaded to the target of the association.

Defaults to no operations being cascaded.

Default:
{}

abstract public FetchType fetch()
可选）关联应该延迟加载还是必须立即获取。EAGER 战略是必须立即获取关联实体的持久性提供者运行时的要求。LAZY 战略是持久性提供者运行时的提示。
英文文档：

fetch

public abstract FetchType fetch
(Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistenceprovider runtime that the associatedentities must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime.

Default:
LAZY

abstract public String mappedBy()
拥有关系的字段。只要关系不是单向的，就需要它。
英文文档：

mappedBy

public abstract String mappedBy
The field that owns the relationship. Required unless the relationship is unidirectional.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


OneToOne (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type OneToOne

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface OneToOne

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此注释定义对另一个带有一对一多样性的实体的单值关联。一般不必显式指定关联的目标实体，因为通常可以根据引用的对象类型推断出来。
示例 1：映射外键列的一对一关联

在 Customer 类中：

    @OneToOne(optional=false)
    @JoinColumn(
        name="CUSTREC_ID", unique=true, nullable=false, updatable=false)
    public CustomerRecord getCustomerRecord() { return customerRecord; }

在 CustomerRecord 类中：

    @OneToOne(optional=false, mappedBy="customerRecord")
    public Customer getCustomer() { return customer; }

示例 2：假定源和目标共享同一个主键值的一对一关联。

在 Employee 类中：

    @Entity
    public class Employee {
        @Id Integer id;

        @OneToOne @PrimaryKeyJoinColumn
        EmployeeInfo info;
        ...
    }

对于 EmployeeInfo 类：

    @Entity
    public class EmployeeInfo {
        @Id Integer id;
        ...
    }
since
en
Java Persistence 1.0
英文文档：

This annotation defines a single-valued association to another entity that has one-to-one multiplicity. It is not normally necessary to specify the associated target entity explicitly since it can usually be inferred from the type of the object being referenced.

    Example 1: One-to-one association that maps a foreign key column

    On Customer class:

    @OneToOne(optional=false)
    @JoinColumn(
        name="CUSTREC_ID", unique=true, nullable=false, updatable=false)
    public CustomerRecord getCustomerRecord() { return customerRecord; }

    On CustomerRecord class:

    @OneToOne(optional=false, mappedBy="customerRecord")
    public Customer getCustomer() { return customer; }

    Example 2: One-to-one association that assumes both the source and target share the same primary key values.

    On Employee class:

    @Entity
    public class Employee {
        @Id Integer id;

        @OneToOne @PrimaryKeyJoinColumn
        EmployeeInfo info;
        ...
    }

    On EmployeeInfo class:

    @Entity
    public class EmployeeInfo {
        @Id Integer id;
        ...
    }

Since:
Java Persistence 1.0

Optional Element Summary
CascadeType[] | cascade (Optional) The operations that must be cascaded to the target of the association.
FetchType | fetch (Optional) Whether the association should be lazily loaded or must be eagerly fetched.
String | mappedBy (Optional) The field that owns the relationship.
boolean | optional (Optional) Whether the association is optional.
Class | targetEntity (Optional) The entity class that is the target of the association.

abstract public Class<T> targetEntity()
（可选）作为关联目标的实体类。

默认为存储关联的字段或属性的类型。

英文文档：

targetEntity

public abstract Class targetEntity
(Optional) The entity class that is the target of the association.

Defaults to the type of the field or property that stores the association.

Default:
void.class

abstract public CascadeType[] cascade()
（可选）必须串联到关联目标的操作。

默认情况下，不串联任何操作。

英文文档：

cascade

public abstract CascadeType[] cascade
(Optional) The operations that must be cascaded to the target of the association.

By default no operations are cascaded.

Default:
{}

abstract public FetchType fetch()
（可选）关联应该延迟加载还是必须立即获取。EAGER 战略是必须立即获取关联实体的持久性提供者运行时的要求。LAZY 战略是持久性提供者运行时的提示。
英文文档：

fetch

public abstract FetchType fetch
(Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity must be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime.

Default:
EAGER

abstract public boolean optional()
（可选）关联是否是可选的。如果设置为 false，则必须总是存在非 null 关系。
英文文档：

optional

public abstract boolean optional
(Optional) Whether the association is optional. If set to false then a non-null relationship must always exist.

Default:
true

abstract public String mappedBy()
（可选）拥有关系的字段。此元素仅在关联的反向端（非拥有端）指定。
英文文档：

mappedBy

public abstract String mappedBy
(Optional) The field that owns the relationship. This element is only specified on the inverse (non-owning) side of the association.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


OrderBy (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type OrderBy

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface OrderBy

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此注释指定获取关联时，使用 Collection 定义了值的关联元素的排列顺序。

value 排序元素的语法为 orderby_list，如下所示：

orderby_list::= orderby_item [,orderby_item]*
orderby_item::= property_or_field_name [ASC | DESC]

如果没有指定 ASC 或 DESC，则假定为 ASC（升序）。

如果没有指定排序元素，则假定使用关联实体的主键进行排序。

属性或字段名称必须对应于关联类的持久属性或字段名称。排序中使用的属性或字段必须对应于支持比较运算符的列。

示例：

    @Entity public class Course {
     ...
     @ManyToMany
     @OrderBy("lastname ASC")
     public List getStudents() {...};
     ...
    }

    @Entity public class Student {
      ...
      @ManyToMany(mappedBy="students")
      @OrderBy // PK is assumed
      public List getCourses() {...};
      ...
    }
since
en
Java Persistence 1.0
英文文档：

This annotation specifies the ordering of the elements of a collection valued association at the point when the association is retrieved.

The syntax of the value ordering element is an orderby_list, as follows:

    orderby_list::= orderby_item [,orderby_item]*
    orderby_item::= property_or_field_name [ASC | DESC]

If ASC or DESC is not specified, ASC (ascending order) is assumed.

If the ordering element is not specified, ordering by the primary key of the associated entity is assumed.

The property or field name must correspond to that of a persistent property or field of the associated class. The properties or fields used in the ordering must correspond to columns for which comparison operators are supported.

    Example:

    @Entity public class Course {
     ...
     @ManyToMany
     @OrderBy("lastname ASC")
     public List getStudents() {...};
     ...
    }

    @Entity public class Student {
      ...
      @ManyToMany(mappedBy="students")
      @OrderBy // PK is assumed
      public List getCourses() {...};
      ...
    }

Since:
Java Persistence 1.0

Optional Element Summary
 String value
An orderby_list, specified as follows: orderby_list::= orderby_item [,orderby_item]* orderby_item::= property_or_field_name [ASC | DESC] If ASC or DESC is not specified, ASC (ascending order) is assumed.

abstract public String value()
orderby_list，指定如下：
orderby_list::= orderby_item [,orderby_item]*
orderby_item::= property_or_field_name [ASC | DESC]

如果没有指定 ASC 或 DESC，则假定为 ASC（升序）。

如果没有指定排序元素，则假定使用关联实体的主键进行排序。

英文文档：

value

public abstract String value
An orderby_list, specified as follows:
    orderby_list::= orderby_item [,orderby_item]*
    orderby_item::= property_or_field_name [ASC | DESC]

If ASC or DESC is not specified, ASC (ascending order) is assumed.

If the ordering element is not specified, ordering by the primary key of the associated entity is assumed.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PersistenceContext (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PersistenceContext

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface PersistenceContext

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

表示对 EntityManager 持久性上下文的依赖性。
since
en
Java Persistence 1.0
英文文档：

Expresses a dependency on an EntityManager persistence context.

Since:
Java Persistence 1.0

Optional Element Summary
String | name The name by which the entity manager is to be accessed in the environment referencing context, and is not needed when dependency injection is used.
PersistenceProperty[] | properties Used to specify properties for the container or persistence provider.
PersistenceContextType | type Specifies whether this is a transaction-scoped persistence context or an extended persistence context.
String | unitName The name of the persistence unit.

abstract public String name()
在环境引用上下文中访问实体管理器所使用的名称，使用依赖关系注入时不需要此名称。
英文文档：

name

public abstract String name
The name by which the entity manager is to be accessed in the environment referencing context, and is not needed when dependency injection is used.

Default:
""

abstract public String unitName()
持久性单元的名称。如果指定了 unitName 元素，则可以在 JNDI 中访问的实体管理器的持久性单元必须拥有相同的名称。
英文文档：

unitName

public abstract String unitName
The name of the persistence unit. If the unitName element is specified, the persistence unit for the entity manager that is accessible in JNDI must have the same name.

Default:
""

abstract public PersistenceContextType type()
指定这是事务范围的持久性上下文还是扩展的持久性上下文。
英文文档：

type

public abstract PersistenceContextType type
Specifies whether this is a transaction-scoped persistence context or an extended persistence context.

Default:
TRANSACTION

abstract public PersistenceProperty[] properties()
用于指定容器或持久性提供者的属性。此属性集中可以包含特定于供应商的属性。供应商无法识别的属性将被忽略。
英文文档：

properties

public abstract PersistenceProperty[] properties
Used to specify properties for the container or persistence provider. Vendor specific properties may be included in this set of properties. Properties that are not recognized by a vendor are ignored.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PersistenceContexts (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PersistenceContexts

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface PersistenceContexts

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

声明一个或多个 PersistenceContext 注释。它用于表达对容器管理的实体管理器持久性上下文的依赖性。
since
en
Java Persistence 1.0
英文文档：

Declares one or more PersistenceContext annotations. It is used to express a dependency on container-managed entity manager persistence contexts.

Since:
Java Persistence 1.0

Required Element Summary
 PersistenceContext[] value
One or more persistence context

Element Detail

abstract public PersistenceContext[] value()
一个或多个持久性上下文
英文文档：

value

public abstract PersistenceContext[] value
One or more persistence context

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PersistenceProperty (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PersistenceProperty

@Target(value={})
@Retention(value=RUNTIME)
public @interface PersistenceProperty

Implements: Annotation
@Target(value={})
@Retention(value=RUNTIME)

描述单个容器或持久性提供者属性。

该属性集中可以包含特定于供应商的属性，在创建实体管理器时容器会将这些属性传递给持久性提供者。供应商无法识别的属性将被忽略。

since
en
Java Persistence 1.0
英文文档：

Describes a single container or persistence provider property.

Vendor specific properties may be included in the set of properties, and are passed to the persistence provider by the container when the entity manager is created. Properties that are not recognized by a vendor will be ignored.

Since:
Java Persistence 1.0

Required Element Summary
String | name The name of the property
String | value The value of the property

Element Detail

abstract public String name()
属性的名称
英文文档：

name

public abstract String name
The name of the property

abstract public String value()
属性的值
英文文档：

value

public abstract String value
The value of the property

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PersistenceUnit (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PersistenceUnit

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface PersistenceUnit

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

表示对 EntityManagerFactory 的依赖性。
since
en
Java Persistence 1.0
英文文档：

Expresses a dependency on an EntityManagerFactory.

Since:
Java Persistence 1.0

Optional Element Summary
String | name The name by which the entity manager factory is to be accessed in the environment referencing context, and is not needed when dependency injection is used.
String | unitName The name of the persistence unit as defined in the persistence.xml file.

abstract public String name()
在环境引用上下文中访问实体管理器工厂所使用的名称，使用依赖关系注入时不需要此名称。
英文文档：

name

public abstract String name
The name by which the entity manager factory is to be accessed in the environment referencing context, and is not needed when dependency injection is used.

Default:
""

abstract public String unitName()
persistence.xml 文件中定义的持久性单元的名称。如果指定，则可以在 JNDI 中访问的实体管理器工厂的持久性单元必须拥有相同的名称。
英文文档：

unitName

public abstract String unitName
The name of the persistence unit as defined in the persistence.xml file. If specified, the persistence unit for the entity manager factory that is accessible in JNDI must have the same name.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PersistenceUnits (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PersistenceUnits

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface PersistenceUnits

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

声明一个或多个 PersistenceUnit 注释。
since
en
Java Persistence 1.0
英文文档：

Declares one or more PersistenceUnit annotations.

Since:
Java Persistence 1.0

Required Element Summary
 PersistenceUnit[] value
One or more PersistenceUnit annotations.

Element Detail

abstract public PersistenceUnit[] value()
一个或多个 PersistenceUnit 注释。
英文文档：

value

public abstract PersistenceUnit[] value
One or more PersistenceUnit annotations.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PostLoad (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PostLoad

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PostLoad

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

此类用于指定相应生命周期事件的回调方法。此注释可以应用于实体类、映射的超类、回调侦听器类的方法。
since
en
Java Persistence 1.0
英文文档：

Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PostPersist (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PostPersist

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PostPersist

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

此类用于指定相应生命周期事件的回调方法。此注释可以应用于实体类、映射的超类、回调侦听器类的方法。
since
en
Java Persistence 1.0
英文文档：

Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PostRemove (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PostRemove

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PostRemove

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

此类用于指定相应生命周期事件的回调方法。此注释可以应用于实体类、映射的超类、回调侦听器类的方法。
since
en
Java Persistence 1.0
英文文档：

Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PostUpdate (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PostUpdate

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PostUpdate

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

此类用于指定相应生命周期事件的回调方法。此注释可以应用于实体类、映射的超类、回调侦听器类的方法。
since
en
Java Persistence 1.0
英文文档：

Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PrePersist (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PrePersist

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PrePersist

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

此类用于指定相应生命周期事件的回调方法。此注释可以应用于实体类、映射的超类、回调侦听器类的方法。
since
en
Java Persistence 1.0
英文文档：

Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PreRemove (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PreRemove

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PreRemove

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

此类用于指定相应生命周期事件的回调方法。此注释可以应用于实体类、映射的超类、回调侦听器类的方法。
since
en
Java Persistence 1.0
英文文档：

Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PreUpdate (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PreUpdate

@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface PreUpdate

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)

此类用于指定相应生命周期事件的回调方法。此注释可以应用于实体类、映射的超类、回调侦听器类的方法。
since
en
Java Persistence 1.0
英文文档：

Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class.

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PrimaryKeyJoinColumn (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PrimaryKeyJoinColumn

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface PrimaryKeyJoinColumn

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

此注释指定用作外键连接另一个表格的主键列。

它用于将 JOINED 映射战略中的实体子类的主表格连接到其超类的主表格；它在 SecondaryTable 注释中用于将从属表格连接到主表格；它还可以在 OneToOne 映射使用，其中引用实体的主键用作被引用实体的外键。

如果在 JOINED 映射战略中没有为子类指定任何 PrimaryKeyJoinColumn 注释，则假定外键列的名称与超类主表格的主键列相同

示例：Customer 和 ValuedCustomer 子类

    @Entity
    @Table(name="CUST")
    @Inheritance(strategy=JOINED)
    @DiscriminatorValue("CUST")
    public class Customer { ... }

    @Entity
    @Table(name="VCUST")
    @DiscriminatorValue("VCUST")
    @PrimaryKeyJoinColumn(name="CUST_ID")
    public class ValuedCustomer extends Customer { ... }
since
en
Java Persistence 1.0
英文文档：

This annotation specifies a primary key column that is used as a foreign key to join to another table.

It is used to join the primary table of an entity subclass in the JOINED mapping strategy to the primary table of its superclass; it is used within a SecondaryTable annotation to join a secondary table to a primary table; and it may be used in a OneToOne mapping in which the primary key of the referencing entity is used as a foreign key to the referenced entity.

If no PrimaryKeyJoinColumn annotation is specified for a subclass in the JOINED mapping strategy, the foreign key columns are assumed to have the same names as the primary key columns of the primary table of the superclass

    Example: Customer and ValuedCustomer subclass

    @Entity
    @Table(name="CUST")
    @Inheritance(strategy=JOINED)
    @DiscriminatorValue("CUST")
    public class Customer { ... }

    @Entity
    @Table(name="VCUST")
    @DiscriminatorValue("VCUST")
    @PrimaryKeyJoinColumn(name="CUST_ID")
    public class ValuedCustomer extends Customer { ... }

Since:
Java Persistence 1.0

Optional Element Summary
String | columnDefinition (Optional) The SQL fragment that is used when generating the DDL for the column.
String | name The name of the primary key column of the current table.
String | referencedColumnName (Optional) The name of the primary key column of the table being joined to.

abstract public String name()
当前表格的主键列的名称。

默认为与超类主表格（JOINED 映射战略）的主键列相同的名称；与主表格（SecondaryTable 映射）的主键列相同的名称；或者与引用实体（OneToOne 映射）表格的主键列相同的名称。

英文文档：

name

public abstract String name
The name of the primary key column of the current table.

Defaults to the same name as the primary key column of the primary table of the superclass (JOINED mapping strategy); the same name as the primary key column of the primary table (SecondaryTable mapping); or the same name as the primary key column for the table for the referencing entity (OneToOne mapping)

Default:
""

abstract public String referencedColumnName()
（可选）连接的表格的主键列名称。

默认为与超类主表格（JOINED 映射战略）的主键列相同的名称；与主表格（SecondaryTable 映射）的主键列相同的名称；或者与引用实体（OneToOne 映射）表格的主键列相同的名称。

英文文档：

referencedColumnName

public abstract String referencedColumnName
(Optional) The name of the primary key column of the table being joined to.

Defaults to the same name as the primary key column of the primary table of the superclass (JOINED mapping strategy); the same name as the primary key column of the primary table (SecondaryTable mapping); or the same name as the primary key column for the table for the referencing entity (OneToOne mapping)

Default:
""

abstract public String columnDefinition()
（可选）生成该列的 DDL 时使用的 SQL 句段。对于 OneToOne 主键关联不应指定此属性。

默认为生成的 SQL，以创建推断类型的列。

英文文档：

columnDefinition

public abstract String columnDefinition
(Optional) The SQL fragment that is used when generating the DDL for the column. This should not be specified for a OneToOne primary key association.

Defaults to the generated SQL to create a column of the inferred type.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


PrimaryKeyJoinColumns (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type PrimaryKeyJoinColumns

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface PrimaryKeyJoinColumns

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

此注释组合 PrimaryKeyJoinColumn 注释。它用于映射复合外键。
示例 1：ValuedCustomer 子类

    @Entity
    @Table(name="VCUST")
    @DiscriminatorValue("VCUST")
    @PrimaryKeyJoinColumns({
        @PrimaryKeyJoinColumn(name="CUST_ID",
            referencedColumnName="ID"),
        @PrimaryKeyJoinColumn(name="CUST_TYPE",
            referencedColumnName="TYPE")
    })
    public class ValuedCustomer extends Customer { ... }
since
en
Java Persistence 1.0
英文文档：

This annotation groups PrimaryKeyJoinColumn annotations. It is used to map composite foreign keys.

    Example 1: ValuedCustomer subclass

    @Entity
    @Table(name="VCUST")
    @DiscriminatorValue("VCUST")
    @PrimaryKeyJoinColumns({
        @PrimaryKeyJoinColumn(name="CUST_ID",
            referencedColumnName="ID"),
        @PrimaryKeyJoinColumn(name="CUST_TYPE",
            referencedColumnName="TYPE")
    })
    public class ValuedCustomer extends Customer { ... }

Since:
Java Persistence 1.0

Required Element Summary
 PrimaryKeyJoinColumn[] value
One or more PrimaryKeyJoinColumn annotations.

Element Detail

abstract public PrimaryKeyJoinColumn[] value()
一个或多个 PrimaryKeyJoinColumn 注释。
英文文档：

value

public abstract PrimaryKeyJoinColumn[] value
One or more PrimaryKeyJoinColumn annotations.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


QueryHint (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type QueryHint

@Target(value={})
@Retention(value=RUNTIME)
public @interface QueryHint

Implements: Annotation
@Target(value={})
@Retention(value=RUNTIME)

特定于实现的 Query 提示。
since
en
Java Persistence 1.0
英文文档：

An implementation-specific Query hint.

Since:
Java Persistence 1.0

Required Element Summary
String | name Name of the hint
String | value Value of the hint

Element Detail

abstract public String name()
提示名称
英文文档：

name

public abstract String name
Name of the hint

abstract public String value()
提示值
英文文档：

value

public abstract String value
Value of the hint

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SecondaryTable (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type SecondaryTable

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface SecondaryTable

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此注释用于为带注释的实体类指定从属表格。指定一个或多个从属表格表示跨多个表格存储实体类的数据。

如果没有指定任何 SecondaryTable 注释，则假定实体的所有持久字段或属性都映射到主表格。如果没有指定任何主键连接列，则假设连接列引用主表格的主键列，并且其名称和类型与所引用的主表格的主键列相同。

示例 1：包含单个主键列的单个从属表格。

    @Entity
    @Table(name="CUSTOMER")
    @SecondaryTable(name="CUST_DETAIL",
        pkJoinColumns=@PrimaryKeyJoinColumn(name="CUST_ID"))
    public class Customer { ... }

示例 2：包含多个主键列的单个从属表格。

    @Entity
    @Table(name="CUSTOMER")
    @SecondaryTable(name="CUST_DETAIL",
        pkJoinColumns={
            @PrimaryKeyJoinColumn(name="CUST_ID"),
            @PrimaryKeyJoinColumn(name="CUST_TYPE")})
    public class Customer { ... }
since
en
Java Persistence 1.0
英文文档：

This annotation is used to specify a secondary table for the annotated entity class. Specifying one or more secondary tables indicates that the data for the entity class is stored across multiple tables.

If no SecondaryTable annotation is specified, it is assumed that all persistent fields or properties of the entity are mapped to the primary table. If no primary key join columns are specified, the join columns are assumed to reference the primary key columns of the primary table, and have the same names and types as the referenced primary key columns of the primary table.

 Example 1: Single secondary table with a single primary key column.

    @Entity
    @Table(name="CUSTOMER")
    @SecondaryTable(name="CUST_DETAIL",
        pkJoinColumns=@PrimaryKeyJoinColumn(name="CUST_ID"))
    public class Customer { ... }

    Example 2: Single secondary table with multiple primary key columns.

    @Entity
    @Table(name="CUSTOMER")
    @SecondaryTable(name="CUST_DETAIL",
        pkJoinColumns={
            @PrimaryKeyJoinColumn(name="CUST_ID"),
            @PrimaryKeyJoinColumn(name="CUST_TYPE")})
    public class Customer { ... }

Since:
Java Persistence 1.0

Required Element Summary
 String name
(Required) The name of the table.
Optional Element Summary
String | catalog (Optional) The catalog of the table.
PrimaryKeyJoinColumn[] | pkJoinColumns (Optional) The columns that are used to join with the primary table.
String | schema (Optional) The schema of the table.
UniqueConstraint[] | uniqueConstraints (Optional) Unique constraints that are to be placed on the table.

Element Detail

abstract public String name()
（必须）表格名称。
英文文档：

name

public abstract String name
(Required) The name of the table.

abstract public String catalog()
（可选）表格种类。

默认为默认种类。

英文文档：

catalog

public abstract String catalog
(Optional) The catalog of the table.

Defaults to the default catalog.

Default:
""

abstract public String schema()
（可选）表格模式。

默认为用户的默认模式。

英文文档：

schema

public abstract String schema
(Optional) The schema of the table.

Defaults to the default schema for user.

Default:
""

abstract public PrimaryKeyJoinColumn[] pkJoinColumns()
（可选）用来连接主表格的列。

默认为与主表格中的主键列具有相同名称的列

英文文档：

pkJoinColumns

public abstract PrimaryKeyJoinColumn[] pkJoinColumns
(Optional) The columns that are used to join with the primary table.

Defaults to the column(s) of the same name(s) as the primary key column(s) in the primary table

Default:
{}

abstract public UniqueConstraint[] uniqueConstraints()
（可选）对表格设置的唯一约束。通常仅当表格生成生效时使用。除了应用 Column 和 JoinColumn 注释中指定的约束条件和主键映射引起的约束条件外，还应用这些约束条件。

默认为无额外限制。

英文文档：

uniqueConstraints

public abstract UniqueConstraint[] uniqueConstraints
(Optional) Unique constraints that are to be placed on the table. These are typically only used if table generation is in effect. These constraints apply in addition to any constraints specified by the Column and JoinColumn annotations and constraints entailed by primary key mappings.

Defaults to no additional constraints.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SecondaryTables (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type SecondaryTables

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface SecondaryTables

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此注释用于为实体类指定多个从属表格。
示例 1：多个从属表格，假定所有表格中的主键列名称相同。

@Entity
    @Table(name="EMPLOYEE")
    @SecondaryTables({
        @SecondaryTable(name="EMP_DETAIL"),
        @SecondaryTable(name="EMP_HIST")
    })
    public class Employee { ... }

示例 2：指定了不同主键列的多个从属表格。

 @Entity
    @Table(name="EMPLOYEE")
    @SecondaryTables({
        @SecondaryTable(name="EMP_DETAIL",
            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPL_ID")),
        @SecondaryTable(name="EMP_HIST",
            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPLOYEE_ID"))
    })
    public class Employee { ... }
since
en
Java Persistence 1.0
英文文档：

This annotation is used to specify multiple secondary tables for an entity.

    Example 1: Multiple secondary tables assuming primary key columns are named the same in all tables.

    @Entity
    @Table(name="EMPLOYEE")
    @SecondaryTables({
        @SecondaryTable(name="EMP_DETAIL"),
        @SecondaryTable(name="EMP_HIST")
    })
    public class Employee { ... }

    Example 2: Multiple secondary tables with differently named primary key columns.

    @Entity
    @Table(name="EMPLOYEE")
    @SecondaryTables({
        @SecondaryTable(name="EMP_DETAIL",
            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPL_ID")),
        @SecondaryTable(name="EMP_HIST",
            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPLOYEE_ID"))
    })
    public class Employee { ... }

Since:
Java Persistence 1.0

Required Element Summary
 SecondaryTable[] value
The secondary tables for an entity.

Element Detail

abstract public SecondaryTable[] value()
实体的从属表格。
英文文档：

value

public abstract SecondaryTable[] value
The secondary tables for an entity.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SequenceGenerator (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type SequenceGenerator

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface SequenceGenerator

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

此注释定义为 GeneratedValue 注释指定生成器元素时可以通过名称引用的主键生成器。可以对实体类或主键字段或属性指定序列生成器。生成器名称的范围对于持久性单元是全局的（跨所有生成器类型）。
示例：

 @SequenceGenerator(name="EMP_SEQ", allocationSize=25)
since
en
Java Persistence 1.0
英文文档：

This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation. A sequence generator may be specified on the entity class or on the primary key field or property. The scope of the generator name is global to the persistence unit (across all generator types).

   Example:

   @SequenceGenerator(name="EMP_SEQ", allocationSize=25)

Since:
Java Persistence 1.0

Required Element Summary
 String name
(Required) A unique generator name that can be referenced by one or more classes to be the generator for primary key values.
Optional Element Summary
int | allocationSize (Optional) The amount to increment by when allocating sequence numbers from the sequence.
int | initialValue (Optional) The value from which the sequence object is to start generating.
String | sequenceName (Optional) The name of the database sequence object from which to obtain primary key values.

Element Detail

abstract public String name()
（必需）可以被将用作主键值生成器的一个或多个类引用的唯一生成器名称。
英文文档：

name

public abstract String name
(Required) A unique generator name that can be referenced by one or more classes to be the generator for primary key values.

abstract public String sequenceName()
（可选）可以从中获取主键值的数据库序列对象名称。

默认为提供者选择的值。

英文文档：

sequenceName

public abstract String sequenceName
(Optional) The name of the database sequence object from which to obtain primary key values.

Defaults to a provider-chosen value.

Default:
""

abstract public int initialValue()
（可选）开始生成序列对象的值。
英文文档：

initialValue

public abstract int initialValue
(Optional) The value from which the sequence object is to start generating.

Default:
1

abstract public int allocationSize()
（可选）从序列分配序列号时递增的量。
英文文档：

allocationSize

public abstract int allocationSize
(Optional) The amount to increment by when allocating sequence numbers from the sequence.

Default:
50
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SqlResultSetMapping (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type SqlResultSetMapping

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface SqlResultSetMapping

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此注释用于指定本机 SQL 查询结果的映射。
示例：

Query q = em.createNativeQuery(
        "SELECT o.id AS order_id, " +
            "o.quantity AS order_quantity, " +
            "o.item AS order_item, " +
            "i.name AS item_name, " +
        "FROM Order o, Item i " +
        "WHERE (order_quantity > 25) AND (order_item = i.id)",
    "OrderResults");

    @SqlResultSetMapping(name="OrderResults",
        entities={
            @EntityResult(entityClass=com.acme.Order.class, fields={
                @FieldResult(name="id", column="order_id"),
                @FieldResult(name="quantity", column="order_quantity"),
                @FieldResult(name="item", column="order_item")})},
        columns={
            @ColumnResult(name="item_name")}
    )
since
en
Java Persistence 1.0
英文文档：

This annotation is used to specify the mapping of the result of a native SQL query.

    Example:

    Query q = em.createNativeQuery(
        "SELECT o.id AS order_id, " +
            "o.quantity AS order_quantity, " +
            "o.item AS order_item, " +
            "i.name AS item_name, " +
        "FROM Order o, Item i " +
        "WHERE (order_quantity > 25) AND (order_item = i.id)",
    "OrderResults");

    @SqlResultSetMapping(name="OrderResults",
        entities={
            @EntityResult(entityClass=com.acme.Order.class, fields={
                @FieldResult(name="id", column="order_id"),
                @FieldResult(name="quantity", column="order_quantity"),
                @FieldResult(name="item", column="order_item")})},
        columns={
            @ColumnResult(name="item_name")}
    )

Since:
Java Persistence 1.0

Required Element Summary
 String name
The name given to the result set mapping, and used to refer to it in the methods of the Query API.
Optional Element Summary
ColumnResult[] | columns Specifies the result set mapping to scalar values.
EntityResult[] | entities Specifies the result set mapping to entities.

Element Detail

abstract public String name()
为结果集映射指定的名称，将在 Query API 的方法中引用。
英文文档：

name

public abstract String name
The name given to the result set mapping, and used to refer to it in the methods of the Query API.

abstract public EntityResult[] entities()
指定映射到实体的结果集。
英文文档：

entities

public abstract EntityResult[] entities
Specifies the result set mapping to entities.

Default:
{}

abstract public ColumnResult[] columns()
指定映射到标量值的结果集。
英文文档：

columns

public abstract ColumnResult[] columns
Specifies the result set mapping to scalar values.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


SqlResultSetMappings (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type SqlResultSetMappings

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface SqlResultSetMappings

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此注释用于定义一个或多个 SqlResultSetMapping。
since
en
Java Persistence 1.0
英文文档：

This annotation is used to define one or more SqlResultSetMapping.

Since:
Java Persistence 1.0

Required Element Summary
 SqlResultSetMapping[] value
One or more SqlResultSetMapping.

Element Detail

abstract public SqlResultSetMapping[] value()
一个或多个 SqlResultSetMapping。
英文文档：

value

public abstract SqlResultSetMapping[] value
One or more SqlResultSetMapping.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Table (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Table

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Table

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)

此注释为注释的实体指定主表格。使用 SecondaryTable 或 SecondaryTables 注释可以指定其他表格。

如果没有为实体类指定 Table 注释，则应用默认值。

示例：

    @Entity
    @Table(name="CUST", schema="RECORDS")
public class Customer { ... }
since
en
Java Persistence 1.0
英文文档：

This annotation specifies the primary table for the annotated entity. Additional tables may be specified using SecondaryTable or SecondaryTables annotation.

If no Table annotation is specified for an entity class, the default values apply.

    Example:

    @Entity
    @Table(name="CUST", schema="RECORDS")
    public class Customer { ... }

Since:
Java Persistence 1.0

Optional Element Summary
String | catalog (Optional) The catalog of the table.
String | name (Optional) The name of the table.
String | schema (Optional) The schema of the table.
UniqueConstraint[] | uniqueConstraints (Optional) Unique constraints that are to be placed on the table.

abstract public String name()
（可选）表格的名称。

默认为实体名称。

英文文档：

name

public abstract String name
(Optional) The name of the table.

Defaults to the entity name.

Default:
""

abstract public String catalog()
（可选）表格种类。

默认为默认种类。

英文文档：

catalog

public abstract String catalog
(Optional) The catalog of the table.

Defaults to the default catalog.

Default:
""

abstract public String schema()
（可选）表格模式。

默认为用户的默认模式。

英文文档：

schema

public abstract String schema
(Optional) The schema of the table.

Defaults to the default schema for user.

Default:
""

abstract public UniqueConstraint[] uniqueConstraints()
（可选）对表格设置的唯一约束。仅当表格生成生效时使用。除了应用 Column 和 JoinColumn 注释中指定的约束条件和主键映射引起的约束条件外，还应用这些约束条件。

默认为无额外限制。

英文文档：

uniqueConstraints

public abstract UniqueConstraint[] uniqueConstraints
(Optional) Unique constraints that are to be placed on the table. These are only used if table generation is in effect. These constraints apply in addition to any constraints specified by the Column and JoinColumn annotations and constraints entailed by primary key mappings.

Defaults to no additional constraints.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


TableGenerator (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type TableGenerator

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface TableGenerator

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)

此注释定义为 GeneratedValue 注释指定生成器元素时可以通过名称引用的主键生成器。可以对实体类或主键字段或属性指定表格生成器。生成器名称的范围对于持久性单元是全局的（跨所有生成器类型）。
示例 1：

    @Entity public class Employee {
        ...
        @TableGenerator(
            name="empGen",
            table="ID_GEN",
            pkColumnName="GEN_KEY",
            valueColumnName="GEN_VALUE",
            pkColumnValue="EMP_ID",
            allocationSize=1)
        @Id
        @GeneratedValue(strategy=TABLE, generator="empGen")
        public int id;
        ...
    }

示例 2：

    @Entity public class Address {
        ...
        @TableGenerator(
            name="addressGen",
            table="ID_GEN",
            pkColumnName="GEN_KEY",
            valueColumnName="GEN_VALUE",
            pkColumnValue="ADDR_ID")
        @Id
        @GeneratedValue(strategy=TABLE, generator="addressGen")
        public int id;
        ...
    }
since
en
Java Persistence 1.0
英文文档：

This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation. A table generator may be specified on the entity class or on the primary key field or property. The scope of the generator name is global to the persistence unit (across all generator types).

    Example 1:

    @Entity public class Employee {
        ...
        @TableGenerator(
            name="empGen",
            table="ID_GEN",
            pkColumnName="GEN_KEY",
            valueColumnName="GEN_VALUE",
            pkColumnValue="EMP_ID",
            allocationSize=1)
        @Id
        @GeneratedValue(strategy=TABLE, generator="empGen")
        public int id;
        ...
    }

    Example 2:

    @Entity public class Address {
        ...
        @TableGenerator(
            name="addressGen",
            table="ID_GEN",
            pkColumnName="GEN_KEY",
            valueColumnName="GEN_VALUE",
            pkColumnValue="ADDR_ID")
        @Id
        @GeneratedValue(strategy=TABLE, generator="addressGen")
        public int id;
        ...
    }

Since:
Java Persistence 1.0

Required Element Summary
 String name
(Required) A unique generator name that can be referenced by one or more classes to be the generator for id values.
Optional Element Summary
int | allocationSize (Optional) The amount to increment by when allocating id numbers from the generator.
String | catalog (Optional) The catalog of the table.
int | initialValue (Optional) The initial value to be used when allocating id numbers from the generator.
String | pkColumnName (Optional) Name of the primary key column in the table.
String | pkColumnValue (Optional) The primary key value in the generator table that distinguishes this set of generated values from others that may be stored in the table.
String | schema (Optional) The schema of the table.
String | table (Optional) Name of table that stores the generated id values.
UniqueConstraint[] | uniqueConstraints (Optional) Unique constraints that are to be placed on the table.
String | valueColumnName (Optional) Name of the column that stores the last value generated.

Element Detail

abstract public String name()
（必需）可以被将用作 ID 值生成器的一个或多个类引用的唯一生成器名称。
英文文档：

name

public abstract String name
(Required) A unique generator name that can be referenced by one or more classes to be the generator for id values.

abstract public String table()
（可选）存储生成的 ID 值的表格的名称。

默认为持久性提供者选择的名称。

英文文档：

table

public abstract String table
(Optional) Name of table that stores the generated id values.

Defaults to a name chosen by persistence provider.

Default:
""

abstract public String catalog()
（可选）表格的种类。

默认为默认种类。

英文文档：

catalog

public abstract String catalog
(Optional) The catalog of the table.

Defaults to the default catalog.

Default:
""

abstract public String schema()
（可选）表格的模式。

默认为用户的默认模式。

英文文档：

schema

public abstract String schema
(Optional) The schema of the table.

Defaults to the default schema for user.

Default:
""

abstract public String pkColumnName()
（可选）表格中的主键列的名称。

默认为提供者选择的名称。

英文文档：

pkColumnName

public abstract String pkColumnName
(Optional) Name of the primary key column in the table.

Defaults to a provider-chosen name.

Default:
""

abstract public String valueColumnName()
（可选）存储最后一个生成值的列的名称。

默认为提供者选择的名称。

英文文档：

valueColumnName

public abstract String valueColumnName
(Optional) Name of the column that stores the last value generated.

Defaults to a provider-chosen name.

Default:
""

abstract public String pkColumnValue()
（可选）生成器表格中的主键值，它使这组生成值区别于可能存储在表格中的其他值。

默认为将提供者选择的值存储在生成器表格的主键列

英文文档：

pkColumnValue

public abstract String pkColumnValue
(Optional) The primary key value in the generator table that distinguishes this set of generated values from others that may be stored in the table.

Defaults to a provider-chosen value to store in the primary key column of the generator table

Default:
""

abstract public int initialValue()
（可选）从生成器分配 ID 编号时要使用的初始值。
英文文档：

initialValue

public abstract int initialValue
(Optional) The initial value to be used when allocating id numbers from the generator.

Default:
0

abstract public int allocationSize()
（可选）从生成器分配 ID 编号时递增的量。
英文文档：

allocationSize

public abstract int allocationSize
(Optional) The amount to increment by when allocating id numbers from the generator.

Default:
50

abstract public UniqueConstraint[] uniqueConstraints()
（可选）对表格设置的唯一约束。仅当表格生成生效时使用。除了主键约束之外，还将应用这些约束。

默认为无额外限制。

英文文档：

uniqueConstraints

public abstract UniqueConstraint[] uniqueConstraints
(Optional) Unique constraints that are to be placed on the table. These are only used if table generation is in effect. These constraints apply in addition to primary key constraints.

Defaults to no additional constraints.

Default:
{}
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Temporal (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Temporal

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Temporal

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

必须对 java.util.Date 和 java.util.Calendar 类型的持久字段或属性指定此注释。只能对这些类型的字段或属性指定此注释。

Temporal 注释可以与 Basic 注释一起使用。

示例：

     @Temporal(DATE)
     protected java.util.Date endDate;
since
en
Java Persistence 1.0
英文文档：

This annotation must be specified for persistent fields or properties of type Date and Calendar. It may only be specified for fields or properties of these types.

The Temporal annotation may be used in conjunction with the Basic annotation.

     Example:

     @Temporal(DATE)
     protected java.util.Date endDate;

Since:
Java Persistence 1.0

Required Element Summary
 TemporalType value
The type used in mapping java.util.Date or java.util.Calendar.

Element Detail

abstract public TemporalType value()
在映射 java.util.Date 或 java.util.Calendar 时使用的类型。
英文文档：

value

public abstract TemporalType value
The type used in mapping java.util.Date or java.util.Calendar.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Transient (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type Transient

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Transient

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此注释指定属性或字段不是持久的。它用于注释实体类、映射的超类、可嵌入类的属性或字段。
示例：
    @Entity
    public class Employee {
        @Id int id;
        @Transient User currentUser;
        ...
    }
since
en
Java Persistence 1.0
英文文档：

This annotation specifies that the property or field is not persistent. It is used to annotate a property or field of an entity class, mapped superclass, or embeddable class.

    Example:
    @Entity
    public class Employee {
        @Id int id;
        @Transient User currentUser;
        ...
    }

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


UniqueConstraint (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.persistence
Annotation Type UniqueConstraint

@Target(value={})
@Retention(value=RUNTIME)
public @interface UniqueConstraint

Implements: Annotation
@Target(value={})
@Retention(value=RUNTIME)

此注释用于指定为主表格或从属表格生成的 DDL 中要包含唯一约束。
    示例：
    @Entity
    @Table(
        name="EMPLOYEE",
        uniqueConstraints=
            @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
    )
    public class Employee { ... }
since
en
Java Persistence 1.0
英文文档：

This annotation is used to specify that a unique constraint is to be included in the generated DDL for a primary or secondary table.

    Example:
    @Entity
    @Table(
        name="EMPLOYEE",
        uniqueConstraints=
            @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
    )
    public class Employee { ... }

Since:
Java Persistence 1.0

Required Element Summary
 String[] columnNames
(Required) An array of the column names that make up the constraint.

Element Detail

abstract public String[] columnNames()
（必须）组成约束的列名称所组成的数组。
英文文档：

columnNames

public abstract String[] columnNames
(Required) An array of the column names that make up the constraint.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


Version (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.persistence
Annotation Type Version

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Version

Implements: Annotation
@Target(value={METHOD, FIELD})
@Retention(value=RUNTIME)

此注释指定实体类的版本字段或属性，以用作乐观锁定值。此版本用于确保执行合并操作时的完整性以及乐观并发控制。

每个类只能使用一个 Version 属性或字段；使用多个 Version 属性或字段的应用程序将不可移植。

Version 属性应该映射到实体类的主表格；将 Version 属性映射到主表格以外的表格的应用程序将不可移植。

版本属性支持以下类型：int、Integer、short、Short、long、Long、Timestamp。

示例：

    @Version
    @Column(name="OPTLOCK")
    protected int getVersionNum() { return versionNum; }
since
en
Java Persistence 1.0
英文文档：

This annotation specifies the version field or property of an entity class that serves as its optimistic lock value. The version is used to ensure integrity when performing the merge operation and for optimistic concurrency control.

Only a single Version property or field should be used per class; applications that use more than one Version property or field will not be portable.

The Version property should be mapped to the primary table for the entity class; applications that map the Version property to a table other than the primary table will not be portable.

The following types are supported for version properties: int, Integer, short, Short, long, Long, Timestamp.

    Example:

    @Version
    @Column(name="OPTLOCK")
    protected int getVersionNum() { return versionNum; }

Since:
Java Persistence 1.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.persistence.spi (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.persistence.spi

The javax.persistence.spi package defines the classes and interfaces that are implemented by the persistence provider and the Java EE container for use by the container, provider, and/or Persistence bootstrap class in deployment and bootstrapping.

See:
Description

Interface Summary
ClassTransformer | A persistence provider supplies an instance of this interface to the PersistenceUnitInfo.addTransformer method.
PersistenceProvider | Interface implemented by a persistence provider.
PersistenceUnitInfo | Interface implemented by the container and used by the persistence provider when creating an EntityManagerFactory.

Enum Summary
PersistenceUnitTransactionType This enum class defines whether the entity managers created by the EntityManagerFactory will be JTA or resource-local entity managers.

Package javax.persistence.spi Description

The javax.persistence.spi package defines the classes and interfaces that are implemented by the persistence provider and the Java EE container for use by the container, provider, and/or Persistence bootstrap class in deployment and bootstrapping.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.persistence.spi Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.persistence.spi

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.persistence.spi.ClassTransformer
  • javax.persistence.spi.PersistenceProvider
  • javax.persistence.spi.PersistenceUnitInfo

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.persistence.spi.PersistenceUnitTransactionType
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ClassTransformer (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.persistence.spi
Interface ClassTransformer

public interface ClassTransformer

持久性提供者向 PersistenceUnitInfo.addTransformer 方法供应此接口的实例。在加载或重定义实体类文件时，将调用供应的转换器实例来转换该实体类文件。转换在 JVM 定义类之前发生。
since
en
Java Persistence 1.0
英文文档：

A persistence provider supplies an instance of this interface to the PersistenceUnitInfo.addTransformer method. The supplied transformer instance will get called to transform entity class files when they are loaded or redefined. The transformation occurs before the class is defined by the JVM.

Since:
Java Persistence 1.0

Method Summary
 byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
Invoked when a class is being loaded or redefined.

Method Detail

英文文档：

transform

byte[] transform(ClassLoader loader,
                 String className,
                 Class<?> classBeingRedefined,
                 ProtectionDomain protectionDomain,
                 byte[] classfileBuffer)
                 throws IllegalClassFormatException
Invoked when a class is being loaded or redefined. The implementation of this method may transform the supplied class file and return a new replacement class file.

Parameters:
loader - The defining loader of the class to be transformed, may be null if the bootstrap loader
className - The name of the class in the internal form of fully qualified class and interface names
classBeingRedefined - If this is a redefine, the class being redefined, otherwise null
protectionDomain - The protection domain of the class being defined or redefined
classfileBuffer - The input byte buffer in class file format - must not be modified
Returns:
A well-formed class file buffer (the result of the transform), or null if no transform is performed
Throws:
IllegalClassFormatException - If the input does not represent a well-formed class file
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


PersistenceProvider (Java EE 5)

javax.persistence.spi
Interface PersistenceProvider

public interface PersistenceProvider

持久性提供者实现的接口。将用于给定 javax.persistence.EntityManager 的此接口实现可以在持久性归档文件中的 persistence.xml 文件中指定。Container 在需要创建 javax.persistence.EntityManagerFactory 时调用此接口；当 Persistence 类在 Container 以外运行时，由 Persistence 类调用此接口。
since
en
Java Persistence 1.0
英文文档：

Interface implemented by a persistence provider. The implementation of this interface that is to be used for a given EntityManager is specified in persistence.xml file in the persistence archive. This interface is invoked by the Container when it needs to create an EntityManagerFactory, or by the Persistence class when running outside the Container.

Since:
Java Persistence 1.0

Method Summary
EntityManagerFactory | createContainerEntityManagerFactory(PersistenceUnitInfo info, Map map) Called by the container when an EntityManagerFactory is to be created.
EntityManagerFactory | createEntityManagerFactory(String emName, Map map) Called by Persistence class when an EntityManagerFactory is to be created.

Method Detail

public EntityManagerFactory createEntityManagerFactory(String emName, java.util.Map<K, V> map)
要创建 javax.persistence.EntityManagerFactory 时由 Persistence 类调用。
emName | 持久性单元的名称
map | 供持久性提供者使用的属性映射。可以使用这些属性重写 persistence.xml 文件中相应元素的值，也可用于指定 persistence.xml 中尚未指定的属性的值。
return | 持久性单元的 EntityManagerFactory；如果提供者不正确，则返回 null
英文文档：

createEntityManagerFactory

EntityManagerFactory createEntityManagerFactory(String emName,
                                                Map map)
Called by Persistence class when an EntityManagerFactory is to be created.

Parameters:
emName - The name of the persistence unit
map - A Map of properties for use by the persistence provider. These properties may be used to override the values of the corresponding elements in the persistence.xml file or specify values for properties not specified in the persistence.xml.
Returns:
EntityManagerFactory for the persistence unit, or null if the provider is not the right provider

public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, java.util.Map<K, V> map)
要创建 javax.persistence.EntityManagerFactory 时由容器调用。
info | 供持久性单元提供者使用的元数据
map | 供持久性提供者使用的集成级属性映射。如果没有集成级属性，则为 null。
return | 元数据所指定的持久性单元的 EntityManagerFactory
英文文档：

createContainerEntityManagerFactory

EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info,
                                                         Map map)
Called by the container when an EntityManagerFactory is to be created.

Parameters:
info - Metadata for use by the persistence provider
map - A Map of integration-level properties for use by the persistence provider. Can be null if there is no integration-level property.
Returns:
EntityManagerFactory for the persistence unit specified by the metadata
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceUnitInfo (Java EE 5)

javax.persistence.spi
Interface PersistenceUnitInfo

public interface PersistenceUnitInfo

容器实现的接口，持久性提供者在创建 javax.persistence.EntityManagerFactory 时使用此接口。
since
en
Java Persistence 1.0
英文文档：

Interface implemented by the container and used by the persistence provider when creating an EntityManagerFactory.

Since:
Java Persistence 1.0

Method Summary
void | addTransformer(ClassTransformer transformer) Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the getClassLoader() method.
boolean | excludeUnlistedClasses() Returns whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes.
ClassLoader | getClassLoader() Returns ClassLoader that the provider may use to load any classes, resources, or open URLs.
List<URL> | getJarFileUrls() Returns a list of URLs for the jar files or exploded jar file directories that the persistence provider must examine for managed classes of the persistence unit.
DataSource | getJtaDataSource() Returns the JTA-enabled data source to be used by the persistence provider.
List<String> | getManagedClassNames() Returns the list of the names of the classes that the persistence provider must add it to its set of managed classes.
List<String> | getMappingFileNames() Returns the list of mapping file names that the persistence provider must load to determine the mappings for the entity classes.
ClassLoader | getNewTempClassLoader() Return a new instance of a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs.
DataSource | getNonJtaDataSource() Returns the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.
String | getPersistenceProviderClassName() Returns the fully qualified name of the persistence provider implementation class.
String | getPersistenceUnitName() Returns the name of the persistence unit.
URL | getPersistenceUnitRootUrl() Returns the URL for the jar file or directory that is the root of the persistence unit.
Properties | getProperties() Returns properties object.
PersistenceUnitTransactionType | getTransactionType() Returns the transaction type of the entity managers created by the EntityManagerFactory.

Method Detail

public String getPersistenceUnitName()
返回持久性单元的名称。对应于 persistence.xml 文件中的名称属性。
return 持久性单元的名称。对应于 persistence.xml 文件中的名称属性。
英文文档：

getPersistenceUnitName

String getPersistenceUnitName()
Returns the name of the persistence unit. Corresponds to the name attribute in the persistence.xml file.

Returns:
The name of the persistence unit. Corresponds to the name attribute in the persistence.xml file.

public String getPersistenceProviderClassName()
返回持久性提供者实现类的完全限定名称。对应于 persistence.xml 文件中的 <provider> 元素。
return 持久性提供者实现类的完全限定名称。对应于 persistence.xml 文件中的 <provider> 元素。
英文文档：

getPersistenceProviderClassName

String getPersistenceProviderClassName()
Returns the fully qualified name of the persistence provider implementation class. Corresponds to the <provider> element in the persistence.xml file.

Returns:
The fully qualified name of the persistence provider implementation class. Corresponds to the <provider> element in the persistence.xml file.

public PersistenceUnitTransactionType getTransactionType()
返回 EntityManagerFactory 创建的实体管理器的事务类型。事务类型对应于 persistence.xml 文件中的事务类型属性。
return EntityManagerFactory 创建的实体管理器的事务类型。事务类型对应于 persistence.xml 文件中的事务类型属性。
英文文档：

getTransactionType

PersistenceUnitTransactionType getTransactionType()
Returns the transaction type of the entity managers created by the EntityManagerFactory. The transaction type corresponds to the transaction-type attribute in the persistence.xml file.

Returns:
The transaction type of the entity managers created by the EntityManagerFactory. The transaction type corresponds to the transaction-type attribute in the persistence.xml file.

public javax.sql.DataSource getJtaDataSource()
返回持久性提供者要使用的支持 JTA 的数据源。数据源对应于 persistence.xml 文件中的 <jta-data-source> 元素，或者在部署时提供，也可能由容器提供。
return 持久性提供者要使用的支持 JTA 的数据源。数据源对应于 persistence.xml 文件中的 <jta-data-source> 元素，或者在部署时提供，也可能由容器提供。
英文文档：

getJtaDataSource

DataSource getJtaDataSource()
Returns the JTA-enabled data source to be used by the persistence provider. The data source corresponds to the <jta-data-source> element in the persistence.xml file or is provided at deployment or by the container.

Returns:
the JTA-enabled data source to be used by the persistence provider. The data source corresponds to the <jta-data-source> element in the persistence.xml file or is provided at deployment or by the container.

public javax.sql.DataSource getNonJtaDataSource()
返回持久性提供者要使用的不支持 JTA 的数据源。数据源对应于 persistence.xml 文件中的 <non-jta-data-source> 元素，或者在部署时提供，也可能由容器提供。
return 持久性提供者要使用的不支持 JTA 的数据源。数据源对应于 persistence.xml 文件中的 <non-jta-data-source> 元素，或者在部署时提供，也可能由容器提供。
英文文档：

getNonJtaDataSource

DataSource getNonJtaDataSource()
Returns the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. The data source corresponds to the named <non-jta-data-source> element in the persistence.xml file or provided at deployment or by the container.

Returns:
The non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. The data source corresponds to the named <non-jta-data-source> element in the persistence.xml file or provided at deployment or by the container.

public java.util.List<E> getMappingFileNames()
返回持久性提供者必须加载以确定实体类映射的映射文件名称列表。映射文件必须是标准的 XML 映射格式，是惟一指定的，并且可通过应用程序类路径加载资源。如果没有指定，则此列表将不会包含在 orm.xml 文件中。每个映射文件名都对应于 persistence.xml 文件中的 <mapping-file> 元素。
return 持久性提供者必须加载以确定实体类映射的映射文件名称列表。映射文件必须是标准的 XML 映射格式，是惟一指定的，并且可通过应用程序类路径加载资源。如果没有指定，则此列表将不会包含在 orm.xml 文件中。每个映射文件名都对应于 persistence.xml 文件中的 <mapping-file> 元素。
英文文档：

getMappingFileNames

List<String> getMappingFileNames()
Returns the list of mapping file names that the persistence provider must load to determine the mappings for the entity classes. The mapping files must be in the standard XML mapping format, be uniquely named and be resource-loadable from the application classpath. This list will not include the orm.xml file if one was specified. Each mapping file name corresponds to a <mapping-file> element in the persistence.xml file.

Returns:
The list of mapping file names that the persistence provider must load to determine the mappings for the entity classes. The mapping files must be in the standard XML mapping format, be uniquely named and be resource-loadable from the application classpath. This list will not include the orm.xml file if one was specified. Each mapping file name corresponds to a <mapping-file> element in the persistence.xml file.

public java.util.List<E> getJarFileUrls()
返回 jar 文件或解压 jar 文件目录的 URL 列表，持久性提供者必须在这些文件（或目录）中寻找持久性单元的管理类。每个 URL 对应于 persistence.xml 文件中指定的 元素。URL 可以是引用 jar 文件或包含解压 jar 文件的目录的 file:URL，也可以是可从中获取 jar 格式的 InputStream 的 URL。
return 引用 jar 文件或目录的 URL 对象列表。
英文文档：

getJarFileUrls

List<URL> getJarFileUrls()
Returns a list of URLs for the jar files or exploded jar file directories that the persistence provider must examine for managed classes of the persistence unit. Each URL corresponds to a named element in the persistence.xml file. A URL will either be a file: URL referring to a jar file or referring to a directory that contains an exploded jar file, or some other URL from which an InputStream in jar format can be obtained.

Returns:
a list of URL objects referring to jar files or directories.

public java.net.URL getPersistenceUnitRootUrl()
返回作为持久性单元的根 jar 文件或根目录的 URL。（如果持久性单元以 WEB-INF/classes 目录为根，则返回该目录的 URL。）URL 可以是引用 jar 文件或包含解压 jar 文件的目录的 file:URL，也可以是可从中获取 jar 格式的 InputStream 的 URL。
return 引用 jar 文件或目录的 URL。
英文文档：

getPersistenceUnitRootUrl

URL getPersistenceUnitRootUrl()
Returns the URL for the jar file or directory that is the root of the persistence unit. (If the persistence unit is rooted in the WEB-INF/classes directory, this will be the URL of that directory.) The URL will either be a file: URL referring to a jar file or referring to a directory that contains an exploded jar file, or some other URL from which an InputStream in jar format can be obtained.

Returns:
a URL referring to a jar file or directory.

public java.util.List<E> getManagedClassNames()
返回类名称列表，持久性提供者必须将该列表中的类添加到其管理类集合。每个名称对应于 persistence.xml 文件中指定的 <class> 元素。
return 类名称列表，持久性提供者必须将该列表中的类添加到其管理类集合。每个名称对应于 persistence.xml 文件中指定的 <class> 元素。
英文文档：

getManagedClassNames

List<String> getManagedClassNames()
Returns the list of the names of the classes that the persistence provider must add it to its set of managed classes. Each name corresponds to a named <class> element in the persistence.xml file.

Returns:
The list of the names of the classes that the persistence provider must add it to its set of managed classes. Each name corresponds to a named <class> element in the persistence.xml file.

public boolean excludeUnlistedClasses()
返回管理类集合中是否要包含持久性单元的根中没有显式列出的类。此值对应于 persistence.xml 文件中的 <exclude-unlisted-classes> 元素。
return 管理类集合中是否要包含持久性单元的根中没有显式列出的类。此值对应于 persistence.xml 文件中的 <exclude-unlisted-classes> 元素。
英文文档：

excludeUnlistedClasses

boolean excludeUnlistedClasses()
Returns whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes. This value corresponds to the <exclude-unlisted-classes> element in the persistence.xml file.

Returns:
Whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes. This value corresponds to the <exclude-unlisted-classes> element in the persistence.xml file.

public java.util.Properties getProperties()
返回属性对象。每个属性对应于 persistence.xml 文件中的一个 <property> 元素
return 属性对象。每个属性对应于 persistence.xml 文件中一个 <property> 元素
英文文档：

getProperties

Properties getProperties()
Returns properties object. Each property corresponds to a <property> element in the persistence.xml file

Returns:
Properties object. Each property corresponds to a <property> element in the persistence.xml file

public ClassLoader getClassLoader()
返回提供者可以用来加载任何类、资源或开放 URL 的 ClassLoader。
return 提供者可以用来加载任何类、资源或开放 URL 的 ClassLoader。
英文文档：

getClassLoader

ClassLoader getClassLoader()
Returns ClassLoader that the provider may use to load any classes, resources, or open URLs.

Returns:
ClassLoader that the provider may use to load any classes, resources, or open URLs.

public void addTransformer(ClassTransformer transformer)
添加提供者供应的转换器，PersistenceUnitInfo#getClassLoader 方法所返回的加载器加载的每个新类定义或类重定义都将调用此转换器。此转换器对 PersistenceUnitInfo#getNewTempClassLoader 方法返回的结果无效。在同一个类加载作用域内，不管有多少个持久性单元包含此类，它都仅转换一次。
transformer Container 在类定义（重定义）时调用的提供者供应的转换器
英文文档：

addTransformer

void addTransformer(ClassTransformer transformer)
Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the getClassLoader() method. The transformer has no effect on the result returned by the getNewTempClassLoader() method. Classes are only transformed once within the same classloading scope, regardless of how many persistence units they may be a part of.

Parameters:
transformer - A provider-supplied transformer that the Container invokes at class-(re)definition time

public ClassLoader getNewTempClassLoader()
返回提供者可以用来临时加载任何类、资源或开放 URL 的 ClassLoader 新实例。此加载器的作用域和类路径与 PersistenceUnitInfo#getClassLoader 返回的加载器的作用域和类路径完全相同。此类加载器加载的任何类对于应用程序组件都不可见。提供者只能在 PersistenceProvider#createContainerEntityManagerFactory 调用的作用域内使用此 ClassLoader。
return 与当前加载器具有相同可见性的临时 ClassLoader
英文文档：

getNewTempClassLoader

ClassLoader getNewTempClassLoader()
Return a new instance of a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs. The scope and classpath of this loader is exactly the same as that of the loader returned by getClassLoader(). None of the classes loaded by this class loader will be visible to application components. The provider may only use this ClassLoader within the scope of the PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map) call.

Returns:
Temporary ClassLoader with same visibility as current loader
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersistenceUnitTransactionType (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.persistence.spi
Enum PersistenceUnitTransactionType

java.lang.Object
    extended by  java.lang.Enum<PersistenceUnitTransactionType>
        extended by  javax.persistence.spi.PersistenceUnitTransactionType
All Implemented Interfaces:
Serializable, Comparable<PersistenceUnitTransactionType>
public enum PersistenceUnitTransactionType
extends Enum<PersistenceUnitTransactionType>

Extends: Enum<E>

此枚举类定义 javax.persistence.EntityManagerFactory 创建的实体管理器是 JTA 还是资源本地的实体管理器。
since
en
Java Persistence 1.0
英文文档：

This enum class defines whether the entity managers created by the EntityManagerFactory will be JTA or resource-local entity managers.

Since:
Java Persistence 1.0

Enum Constant Summary
JTA
JTA entity manager
RESOURCE_LOCAL
resource-local entity manager
Method Summary
static PersistenceUnitTransactionType | valueOf(String name) Returns the enum constant of this type with the specified name.
static PersistenceUnitTransactionType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

JTA

public static final PersistenceUnitTransactionType JTA
JTA entity manager

英文文档：

RESOURCE_LOCAL

public static final PersistenceUnitTransactionType RESOURCE_LOCAL
resource-local entity manager

Method Detail

final public static PersistenceUnitTransactionType[] values()
英文文档：

values

public static final PersistenceUnitTransactionType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(PersistenceUnitTransactionType c : PersistenceUnitTransactionType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static PersistenceUnitTransactionType valueOf(String name)
英文文档：

valueOf

public static PersistenceUnitTransactionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD


javax.resource (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.resource

The javax.resource package is the top-level package for the J2EE Connector API specification.

See:
Description

Interface Summary
Referenceable The Referenceable interface extends the javax.naming.Referenceable interface.

Exception Summary
NotSupportedException | A NotSupportedException is thrown to indicate that callee (resource adapter or application server for system contracts) cannot execute an operation because the operation is not a supported feature.
ResourceException | This is the root interface of the exception hierarchy defined for the Connector architecture.

Package javax.resource Description

The javax.resource package is the top-level package for the J2EE Connector API specification.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.resource Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.resource

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.resource.ResourceException
          • javax.resource.NotSupportedException

Interface Hierarchy

  • javax.naming.Referenceable
    • javax.resource.Referenceable
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Referenceable (Java EE 5)

javax.resource
Interface Referenceable

All Superinterfaces:
Referenceable
All Known Subinterfaces:
ConnectionFactory
public interface Referenceable
extends Referenceable

Implements: javax.naming.Referenceable
Implemented by: ConnectionFactory

Referenceable 接口扩展 javax.naming.Referenceable 接口。它支持用于在 JNDI 名称空间中注册连接工厂的 JNDI Reference 机制。注意，Reference 的实现和结构特定于应用服务器。

需要使用连接工厂接口的实现类来实现 java.io.Serializable 和 javax.resource.Referenceable 接口，以支持 JNDI 注册。

version 0.9
英文文档：

The Referenceable interface extends the javax.naming.Referenceable interface. It enables support for JNDI Reference mechanism for the registration of the connection factory in the JNDI name space. Note that the implementation and structure of Reference is specific to an application server.

The implementation class for a connection factory interface is required to implement both java.io.Serializable and javax.resource.Referenceable interfaces to support JNDI registration.

Version:
0.9
Author:
Rahul Sharma

Method Summary
 void setReference(Reference reference)
Sets the Reference instance.
Methods inherited from interface javax.naming.Referenceable
getReference

Method Detail

public void setReference(javax.naming.Reference reference)
设置 Reference 实例。部署代码调用此方法设置以后可以通过 getReference 方法（在 javax.naming.Referenceable 接口中定义）返回的 Reference。
reference | 一个 Reference 实例
See also | getReference
英文文档：

setReference

void setReference(Reference reference)
Sets the Reference instance. This method is called by the deployment code to set the Reference that can be later returned by the getReference method (as defined in the javax.naming.Referenceable interface).

Parameters:
reference - A Reference instance
See Also:
Referenceable.getReference()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotSupportedException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource
Class NotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.NotSupportedException
All Implemented Interfaces:
Serializable
public class NotSupportedException
extends ResourceException

Extends: Throwable > Exception > ResourceException

抛出 NotSupportedException 表示被调用者（系统协定的资源适配器或应用服务器）无法执行某个操作，因为该操作不是受支持的功能。例如，如果资源适配器的事务处理支持级别为 NO_TRANSACTION，则对 ManagedConnection 对象调用 getXAResource 方法将抛出 NotSupportedException 异常。
version 1.0
英文文档：

A NotSupportedException is thrown to indicate that callee (resource adapter or application server for system contracts) cannot execute an operation because the operation is not a supported feature. For example, if the transaction support level for a resource adapter is NO_TRANSACTION, an invocation of getXAResource method on a ManagedConnection object should throw a NotSupportedException exception.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
NotSupportedException()
Constructs a new instance with null as its detail message.
NotSupportedException(String message)
Constructs a new instance with the specified detail message.
NotSupportedException(String message, String errorCode)
Constructs a new throwable with the specified detail message and error code.
NotSupportedException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
NotSupportedException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public NotSupportedException()
构造一个新实例，其详细消息为 null。
英文文档：

NotSupportedException

public NotSupportedException()
Constructs a new instance with null as its detail message.

public NotSupportedException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

NotSupportedException

public NotSupportedException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public NotSupportedException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

NotSupportedException

public NotSupportedException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public NotSupportedException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

NotSupportedException

public NotSupportedException(String message,
                             Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public NotSupportedException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

NotSupportedException

public NotSupportedException(String message,
                             String errorCode)
Constructs a new throwable with the specified detail message and error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResourceException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource
Class ResourceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ApplicationServerInternalException, CommException, EISSystemException, IllegalStateException, InvalidPropertyException, LocalTransactionException, NotSupportedException, ResourceAdapterInternalException, ResourceAllocationException, ResourceWarning, SecurityException, SharingViolationException, UnavailableException, WorkException
public class ResourceException
extends Exception

Extends: Throwable > Exception
Extended by: ApplicationServerInternalException, CommException, EISSystemException, IllegalStateException, InvalidPropertyException, LocalTransactionException, NotSupportedException, ResourceAdapterInternalException, ResourceAllocationException, ResourceWarning, SecurityException, SharingViolationException, UnavailableException, WorkException

这是为 Connector 架构定义的异常分层结构的根接口。 ResourceException 提供以下信息：
  • 描述错误的特定于资源适配器供应商的字符串。此字符串是一个标准的 Java 异常消息，可以通过 getMessage() 方法获取。
  • 特定于资源适配器供应商的错误代码。
  • 对其他异常的引用。通常，资源异常是某个低级问题导致的。如果适用，可以将此低级异常链接到 ResourceException。注意，此方法已过时，推荐使用 J2SE 版本 1.4 异常链工具。
version 1.0
英文文档：

This is the root interface of the exception hierarchy defined for the Connector architecture. The ResourceException provides the following information:

  • A resource adapter vendor specific string describing the error. This string is a standard Java exception message and is available through getMessage() method.
  • resource adapter vendor specific error code.
  • reference to another exception. Often a resource exception will be result of a lower level problem. If appropriate, this lower level exception can be linked to the ResourceException. Note, this has been deprecated in favor of J2SE release 1.4 exception chaining facility.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
ResourceException()
Constructs a new instance with null as its detail message.
ResourceException(String message)
Constructs a new instance with the specified detail message.
ResourceException(String message, String errorCode)
Create a new throwable with the specified message and error code.
ResourceException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
ResourceException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
String | getErrorCode() Get the error code.
Exception | getLinkedException() Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class..
String | getMessage() Returns a detailed message string describing this exception.
void | setErrorCode(String errorCode) Set the error code.
void | setLinkedException(Exception ex) Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public ResourceException()
构造一个新实例，其详细消息为 null。
英文文档：

ResourceException

public ResourceException()
Constructs a new instance with null as its detail message.

public ResourceException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

ResourceException

public ResourceException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public ResourceException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

ResourceException

public ResourceException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public ResourceException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

ResourceException

public ResourceException(String message,
                         Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public ResourceException(String message, String errorCode)
创建带指定消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

ResourceException

public ResourceException(String message,
                         String errorCode)
Create a new throwable with the specified message and error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Method Detail

public void setErrorCode(String errorCode)
设置错误代码。
errorCode 错误代码。
英文文档：

setErrorCode

public void setErrorCode(String errorCode)
Set the error code.

Parameters:
errorCode - the error code.

public String getErrorCode()
获取错误代码。
return 错误代码。
英文文档：

getErrorCode

public String getErrorCode()
Get the error code.

Returns:
the error code.

public Exception getLinkedException()
获取与此 ResourceException 链接的异常。
return | 链接的 Exception；如果不存在，则返回 null
deprecated | J2SE 1.4 版支持链接异常工具，它允许 throwable 了解导致它抛出的另一个 throwable（如果有）。请参考 java.lang.Throwable 类的 getCause 和 initCause 方法。
英文文档：

getLinkedException

public Exception getLinkedException()
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class..

Get the exception linked to this ResourceException

Returns:
linked Exception, null if none

public void setLinkedException(Exception ex)
将一个链接的 Exception 添加到此 ResourceException。
ex | 链接的 Exception
deprecated | J2SE 1.4 版支持链接异常工具，它允许 throwable 了解导致它抛出的另一个 throwable（如果有）。请参考 java.lang.Throwable 类的 getCause 和 initCause 方法。
英文文档：

setLinkedException

public void setLinkedException(Exception ex)
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.

Add a linked Exception to this ResourceException.

Parameters:
ex - linked Exception

public String getMessage()
返回描述此异常的详细消息字符串。
return 详细消息字符串。
英文文档：

getMessage

public String getMessage()
Returns a detailed message string describing this exception.

Overrides:
getMessage in class Throwable
Returns:
a detailed message string.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.resource.cci (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.resource.cci

The javax.resource.cci package contains API specification for the Common Client Interface (CCI).

See:
Description

Interface Summary
Connection | A Connection represents an application-level handle that is used by a client to access the underlying physical connection.
ConnectionFactory | ConnectionFactory provides an interface for getting connection to an EIS instance.
ConnectionMetaData | The interface ConnectionMetaData provides information about an EIS instance connected through a Connection instance.
ConnectionSpec | ConnectionSpec is used by an application component to pass connection request-specific properties to the ConnectionFactory.
IndexedRecord | IndexedRecord represents an ordered collection of record elements based on the java.util.List interface.
Interaction | The javax.resource.cci.Interaction enables a component to execute EIS functions.
InteractionSpec | An InteractionSpec holds properties for driving an Interaction with an EIS instance.
LocalTransaction | The LocalTransaction defines a transaction demarcation interface for resource manager local transactions.
MappedRecord | The interface javax.resource.cci.MappedRecord is used for key-value map based representation of record elements.
MessageListener | This serves as a request-response message listener type that message endpoints (message-driven beans) may implement.
Record | The javax.resource.cci.Record interface is the base interface for the representation of an input or output to the execute methods defined on an Interaction.
RecordFactory | The RecordFactory interface is used for creating MappedRecord and IndexedRecord instances.
ResourceAdapterMetaData | The interface javax.resource.cci.ResourceAdapterMetaData provides information about capabilities of a resource adapter implementation.
ResultSet | A ResultSet represents tabular data that is retrieved from an EIS instance by the execution of an Interaction..
ResultSetInfo | The interface javax.resource.cci.ResultSetInfo provides information on the support provided for ResultSet by a connected EIS instance.
Streamable | Streamable interface enables a resource adapter to extract data from an input Record or set data into an output Record as a stream of bytes.

Exception Summary
ResourceWarning A ResourceWarning provides information on warnings related to execution of an interaction with an EIS.

Package javax.resource.cci Description

The javax.resource.cci package contains API specification for the Common Client Interface (CCI).

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.resource.cci Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.resource.cci

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.resource.ResourceException
          • javax.resource.cci.ResourceWarning

Interface Hierarchy

  • java.lang.Cloneable
    • javax.resource.cci.Record (also extends java.io.Serializable)
      • javax.resource.cci.IndexedRecord (also extends java.util.List<E>, java.io.Serializable)
      • javax.resource.cci.MappedRecord (also extends java.util.Map<K,V>, java.io.Serializable)
      • javax.resource.cci.ResultSet (also extends java.sql.ResultSet)
  • javax.resource.cci.Connection
  • javax.resource.cci.ConnectionMetaData
  • javax.resource.cci.ConnectionSpec
  • javax.resource.cci.Interaction
  • java.lang.Iterable<T>
    • java.util.Collection<E>
      • java.util.List<E>
        • javax.resource.cci.IndexedRecord (also extends javax.resource.cci.Record, java.io.Serializable)
  • javax.resource.cci.LocalTransaction
  • java.util.Map<K,V>
    • javax.resource.cci.MappedRecord (also extends javax.resource.cci.Record, java.io.Serializable)
  • javax.resource.cci.MessageListener
  • javax.resource.cci.RecordFactory
  • javax.naming.Referenceable
    • javax.resource.Referenceable
      • javax.resource.cci.ConnectionFactory (also extends java.io.Serializable)
  • javax.resource.cci.ResourceAdapterMetaData
  • java.sql.ResultSet
    • javax.resource.cci.ResultSet (also extends javax.resource.cci.Record)
  • javax.resource.cci.ResultSetInfo
  • java.io.Serializable
    • javax.resource.cci.ConnectionFactory (also extends javax.resource.Referenceable)
    • javax.resource.cci.IndexedRecord (also extends java.util.List<E>, javax.resource.cci.Record)
    • javax.resource.cci.InteractionSpec
    • javax.resource.cci.MappedRecord (also extends java.util.Map<K,V>, javax.resource.cci.Record)
    • javax.resource.cci.Record (also extends java.lang.Cloneable)
      • javax.resource.cci.IndexedRecord (also extends java.util.List<E>, java.io.Serializable)
      • javax.resource.cci.MappedRecord (also extends java.util.Map<K,V>, java.io.Serializable)
      • javax.resource.cci.ResultSet (also extends java.sql.ResultSet)
  • javax.resource.cci.Streamable
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Connection (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.cci
Interface Connection

public interface Connection

该 Connection 表示客户端用于访问底层物理连接的应用程序级句柄。与 Connection 实例关联的实际物理连接由 ManagedConnection 实例表示。

通过对 ConnectionFactory 实例使用 getConnection 方法，客户端可以获取 Connection 实例。连接可以与 0 个或多个 Interaction 实例关联。

version | 0.8
See also | javax.resource.cci.ConnectionFactory, javax.resource.cci.Interaction
英文文档：

A Connection represents an application-level handle that is used by a client to access the underlying physical connection. The actual physical connection associated with a Connection instance is represented by a ManagedConnection instance.

A client gets a Connection instance by using the getConnection method on a ConnectionFactory instance. A connection can be associated with zero or more Interaction instances.

Version:
0.8
Author:
Rahul Sharma
See Also:
ConnectionFactory, Interaction

Method Summary
void | close() Initiates close of the connection handle at the application level.
Interaction | createInteraction() Creates an Interaction associated with this Connection.
LocalTransaction | getLocalTransaction() Returns an LocalTransaction instance that enables a component to demarcate resource manager local transactions on the Connection.
ConnectionMetaData | getMetaData() Gets the information on the underlying EIS instance represented through an active connection.
ResultSetInfo | getResultSetInfo() Gets the information on the ResultSet functionality supported by a connected EIS instance.

Method Detail

public Interaction createInteraction() throws ResourceException
创建一个与此 Connection 关联的 Interaction。Interaction 使应用程序能够执行 EIS 功能。
return | Interaction 实例
Throws | ResourceException: 无法创建 Interaction
英文文档：

createInteraction

Interaction createInteraction()
                              throws ResourceException
Creates an Interaction associated with this Connection. An Interaction enables an application to execute EIS functions.

Returns:
Interaction instance
Throws:
ResourceException - Failed to create an Interaction

public LocalTransaction getLocalTransaction() throws ResourceException
返回一个 LocalTransaction 实例，该实例使组件能够在 Connection 上划分资源管理器本地事务。如果资源适配器不允许组件使用 LocalTransaction 接口在 Connection 上划分本地事务，则 getLocalTransaction 方法应该抛出 NotSupportedException。
return | LocalTransaction 实例
Throws | ResourceException: 由于资源适配器错误而无法返回 LocalTransaction 实例
Throws | NotSupportedException: 此 Connection 不支持划分资源管理器本地事务
See also | javax.resource.cci.LocalTransaction
英文文档：

getLocalTransaction

LocalTransaction getLocalTransaction()
                                     throws ResourceException
Returns an LocalTransaction instance that enables a component to demarcate resource manager local transactions on the Connection. If a resource adapter does not allow a component to demarcate local transactions on an Connection using LocalTransaction interface, then the method getLocalTransaction should throw a NotSupportedException.

Returns:
LocalTransaction instance
Throws:
ResourceException - Failed to return a LocalTransaction instance because of a resource adapter error
NotSupportedException - Demarcation of Resource manager local transactions is not supported on this Connection
See Also:
LocalTransaction

public ConnectionMetaData getMetaData() throws ResourceException
获取有关通过活动连接表示的底层 EIS 实例的信息。
return | 代表有关 EIS 实例的信息的 ConnectionMetaData 实例
Throws | ResourceException: 无法获取有关连接的 EIS 实例的信息。错误可能是资源适配器内部错误、特定于 EIS 的错误或者与通信有关的错误。
英文文档：

getMetaData

ConnectionMetaData getMetaData()
                               throws ResourceException
Gets the information on the underlying EIS instance represented through an active connection.

Returns:
ConnectionMetaData instance representing information about the EIS instance
Throws:
ResourceException - Failed to get information about the connected EIS instance. Error can be resource adapter-internal, EIS-specific or communication related.

public ResultSetInfo getResultSetInfo() throws ResourceException
获取连接的 EIS 实例所支持的 ResultSet 功能的有关信息。
return | ResultSetInfo 实例
Throws | ResourceException: 无法获取与 ResultSet 有关的信息
Throws | NotSupportedException: 不支持 ResultSet 功能
英文文档：

getResultSetInfo

ResultSetInfo getResultSetInfo()
                               throws ResourceException
Gets the information on the ResultSet functionality supported by a connected EIS instance.

Returns:
ResultSetInfo instance
Throws:
ResourceException - Failed to get ResultSet related information
NotSupportedException - ResultSet functionality is not supported

public void close() throws ResourceException
在应用程序级别关闭连接句柄。客户端不应该使用关闭的连接与 EIS 交互。
Throws ResourceException: 如果关闭连接句柄失败，则抛出此异常。

对任何无效的连接调用 close（例如，对已经关闭的连接句柄调用 close）也应该抛出此异常。

英文文档：

close

void close()
           throws ResourceException
Initiates close of the connection handle at the application level. A client should not use a closed connection to interact with an EIS.

Throws:
ResourceException - Exception thrown if close on a connection handle fails.

Any invalid connection close invocation--example, calling close on a connection handle that is already closed--should also throw this exception.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConnectionFactory (Java EE 5)

javax.resource.cci
Interface ConnectionFactory

All Superinterfaces:
Referenceable, Serializable
public interface ConnectionFactory
extends Serializable, Referenceable

Implements: java.io.Serializable, Referenceable

ConnectionFactory 提供一个接口，用于获取对 EIS 实例的连接。ConnectionFactory 接口的实现由资源适配器提供。

应用程序代码从 JNDI 名称空间中查找 ConnectionFactory 实例，并使用该实例获取 EIS 连接。

需要使用 ConnectionFactory 的实现类来实现 java.io.Serializable 和 javax.resource.Referenceable 接口，以支持 JNDI 注册。

version | 0.8
See also | javax.resource.cci.Connection, javax.resource.Referenceable
英文文档：

ConnectionFactory provides an interface for getting connection to an EIS instance. An implementation of ConnectionFactory interface is provided by a resource adapter.

Application code looks up a ConnectionFactory instance from JNDI namespace and uses it to get EIS connections.

An implementation class for ConnectionFactory is required to implement java.io.Serializable and javax.resource.Referenceableinterfaces to support JNDI registration.

Version:
0.8
Author:
Rahul Sharma
See Also:
Connection, Referenceable

Method Summary
Connection | getConnection() Gets a connection to an EIS instance.
Connection | getConnection(ConnectionSpec properties) Gets a connection to an EIS instance.
ResourceAdapterMetaData | getMetaData() Gets metadata for the Resource Adapter.
RecordFactory | getRecordFactory() Gets a RecordFactory instance.
Methods inherited from interface javax.resource.Referenceable
setReference
Methods inherited from interface javax.naming.Referenceable
getReference

Method Detail

public Connection getConnection() throws ResourceException
获取对 EIS 实例的连接。当组件希望容器管理 EIS 登录时，应该使用此 getConnection 变体。这种情况称为容器管理的登录。该组件不传递任何安全信息。
return Connection 实例
Throws ResourceException: 无法获取对 EIS 实例的连接。错误情况的示例有：
  • 无效的 ManagedConnectionFactory 配置—示例：无效的服务器名称
  • 应用服务器内部错误—示例：与连接池有关的错误
  • 通信错误
  • 特定于 EIS 的错误—示例：EIS 未激活
  • 资源适配器内部错误
  • 与安全相关的错误；示例：无效用户
  • 无法分配系统资源
英文文档：

getConnection

Connection getConnection()
                         throws ResourceException
Gets a connection to an EIS instance. This getConnection variant should be used when a component wants the container to manage EIS sign-on. This case is termed container-managed sign-on. The component does not pass any security information.

Returns:
Connection instance
Throws:
ResourceException - Failed to get a connection to the EIS instance. Examples of error cases are:
  • Invalid configuration of ManagedConnectionFactory-- example: invalid server name
  • Application server-internal error--example: connection pool related error
  • Communication error
  • EIS-specific error--example: EIS not active
  • Resource adapter-internal error
  • Security related error; example: invalid user
  • Failure to allocate system resources

public Connection getConnection(ConnectionSpec properties) throws ResourceException
获取对 EIS 实例的连接。如果组件需要传递任何特定于资源适配器的安全信息和连接参数，则应该使用带 javax.resource.cci.ConnectionSpec 参数的 getConnection 变体。在组件管理的登录情况下，应用程序组件通过 ConnectionSpec 实例传递安全信息（例如：用户名、密码）。

记住，传递给 getConnection 方法的属性应该特定于客户端（例如：用户名、密码、语言），与目标 EIS 实例的配置（例如：端口号、服务器名称）无关，这一点非常重要。使用创建对 EIS 实例的连接所需的完整属性集配置 ManagedConnectionFactory 实例。

properties | 指定为 ConnectionSpec 实例的 Connection 参数和安全信息
return | Connection 实例
Throws ResourceException: 无法获取对 EIS 实例的连接。错误情况的示例有：
  • 无效的输入参数规范
  • 无效的 ManagedConnectionFactory 配置—示例：无效的服务器名称
  • 应用服务器内部错误—示例：与连接池有关的错误
  • 通信错误
  • 特定于 EIS 的错误—示例：EIS 未激活
  • 资源适配器内部错误
  • 与安全相关的错误；示例：无效用户
  • 无法分配系统资源
See also | javax.resource.cci.ConnectionSpec
英文文档：

getConnection

Connection getConnection(ConnectionSpec properties)
                         throws ResourceException
Gets a connection to an EIS instance. A component should use the getConnection variant with javax.resource.cci.ConnectionSpec parameter, if it needs to pass any resource adapter specific security information and connection parameters. In the component- managed sign-on case, an application component passes security information (example: username, password) through the ConnectionSpec instance.

It is important to note that the properties passed through the getConnection method should be client-specific (example: username, password, language) and not related to the configuration of a target EIS instance (example: port number, server name). The ManagedConnectionFactory instance is configured with complete set of properties required for the creation of a connection to an EIS instance.

Parameters:
properties - Connection parameters and security information specified as ConnectionSpec instance
Returns:
Connection instance
Throws:
ResourceException - Failed to get a connection to the EIS instance. Examples of error cases are:
  • Invalid specification of input parameters
  • Invalid configuration of ManagedConnectionFactory-- example: invalid server name
  • Application server-internal error--example: connection pool related error
  • Communication error
  • EIS-specific error--example: EIS not active
  • Resource adapter-internal error
  • Security related error; example: invalid user
  • Failure to allocate system resources
See Also:
ConnectionSpec

public RecordFactory getRecordFactory() throws ResourceException
获取 RecordFactory 实例。RecordFactory 用于创建一般 Record 实例。
return | RecordFactory RecordFactory 实例
Throws | ResourceException: 无法创建 RecordFactory
Throws | NotSupportedException: 不支持该操作
英文文档：

getRecordFactory

RecordFactory getRecordFactory()
                               throws ResourceException
Gets a RecordFactory instance. The RecordFactory is used for the creation of generic Record instances.

Returns:
RecordFactory RecordFactory instance
Throws:
ResourceException - Failed to create a RecordFactory
NotSupportedException - Operation not supported

public ResourceAdapterMetaData getMetaData() throws ResourceException
获取资源适配器的元数据。注意，该元数据信息是关于 ResourceAdapter 的，不是关于 EIS 实例的。调用此方法不要求建立对 EIS 实例的活动连接。
return | ResourceAdapterMetaData 实例
Throws | ResourceException: 无法获取有关资源适配器的元数据信息
英文文档：

getMetaData

ResourceAdapterMetaData getMetaData()
                                    throws ResourceException
Gets metadata for the Resource Adapter. Note that the metadata information is about the ResourceAdapter and not the EIS instance. An invocation of this method does not require that an active connection to an EIS instance should have been established.

Returns:
ResourceAdapterMetaData instance
Throws:
ResourceException - Failed to get metadata information about the resource adapter
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionMetaData (Java EE 5)

javax.resource.cci
Interface ConnectionMetaData

public interface ConnectionMetaData

接口 ConnectionMetaData 提供有关通过 Connection 实例连接的 EIS 实例的信息。组件调用方法 Connection.getMetaData 获取 ConnectionMetaData 实例。
version | 0.8
See also | javax.resource.cci.Connection, javax.resource.cci.ResultSetInfo
英文文档：

The interface ConnectionMetaData provides information about an EIS instance connected through a Connection instance. A component calls the method Connection.getMetaData to get a ConnectionMetaData instance.

Version:
0.8
Author:
Rahul Sharma
See Also:
Connection, ResultSetInfo

Method Summary
String | getEISProductName() Returns product name of the underlying EIS instance connected through the Connection that produced this metadata.
String | getEISProductVersion() Returns product version of the underlying EIS instance.
String | getUserName() Returns the user name for an active connection as known to the underlying EIS instance.

Method Detail

public String getEISProductName() throws ResourceException
返回通过生成此元数据的 Connection 连接的底层 EIS 实例的产品名称。
return | EIS 实例的产品名称
Throws | ResourceException: 无法获取 EIS 实例的信息
英文文档：

getEISProductName

String getEISProductName()
                         throws ResourceException
Returns product name of the underlying EIS instance connected through the Connection that produced this metadata.

Returns:
Product name of the EIS instance
Throws:
ResourceException - Failed to get the information for the EIS instance

public String getEISProductVersion() throws ResourceException
返回底层 EIS 实例的产品版本。
return | EIS 实例的产品版本。
Throws | ResourceException: 无法获取 EIS 实例的信息
英文文档：

getEISProductVersion

String getEISProductVersion()
                            throws ResourceException
Returns product version of the underlying EIS instance.

Returns:
Product version of an EIS instance.
Throws:
ResourceException - Failed to get the information for the EIS instance

public String getUserName() throws ResourceException
返回底层 EIS 实例已知的活动连接的用户名。该名称对应于安全上下文下建立了对 EIS 实例的连接的资源主体。
return | 代表用户名的字符串
Throws | ResourceException: 无法获取 EIS 实例的信息
英文文档：

getUserName

String getUserName()
                   throws ResourceException
Returns the user name for an active connection as known to the underlying EIS instance. The name corresponds the resource principal under whose security context a connection to the EIS instance has been established.

Returns:
String representing the user name
Throws:
ResourceException - Failed to get the information for the EIS instance
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionSpec (Java EE 5)

javax.resource.cci
Interface ConnectionSpec

public interface ConnectionSpec

应用程序组件使用 ConnectionSpec 将特定于连接请求的属性传递给 ConnectionFactory.getConnection 方法。

建议将 ConnectionSpec 接口作为 JavaBean 实现，以支持各种工具。必须通过获取方法和设置方法模式定义 ConnectionSpec 实现类上的属性。

CCI 规范为 ConnectionSpec 定义一组标准属性。可以在派生接口上定义属性，也可以在空的 ConnectionSpec 接口的实现类上定义属性。此外，资源适配器还可以定义特定于其底层 EIS 的其他属性。

version
en
1.0 Public Draft 1
See also javax.resource.cci.ConnectionFactory
英文文档：

ConnectionSpec is used by an application component to pass connection request-specific properties to the ConnectionFactory. getConnection method.

It is recommended that the ConnectionSpec interface be implemented as a JavaBean to support tools. The properties on the ConnectionSpec implementation class must be defined through the getter and setter methods pattern.

The CCI specification defines a set of standard properties for an ConnectionSpec. The properties are defined either on a derived interface or an implementation class of an empty ConnectionSpec interface. In addition, a resource adapter may define additional properties specific to its underlying EIS.

Version:
1.0 Public Draft 1
Author:
Rahul Sharma
See Also:
ConnectionFactory

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IndexedRecord (Java EE 5)

javax.resource.cci
Interface IndexedRecord

All Superinterfaces:
Cloneable, Collection, Iterable, List, Record, Serializable
public interface IndexedRecord
extends Record, List, Serializable

Implements: Record, java.util.List<E>, java.io.Serializable

IndexedRecord 代表基于 java.util.List 接口的记录元素的有序 Collection。此接口允许客户端根据元素的整数索引（在列表中的位置）访问和搜索列表中的元素。
since 0.8
英文文档：

IndexedRecord represents an ordered collection of record elements based on the java.util.List interface. This interface allows a client to access elements by their integer index (position in the list) and search for elements in the List.

Since:
0.8
Author:
Rahul Sharma

Method Summary
Methods inherited from interface javax.resource.cci.Record
clone, equals, getRecordName, getRecordShortDescription, hashCode, setRecordName, setRecordShortDescription
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Interaction (Java EE 5)

javax.resource.cci
Interface Interaction

public interface Interaction

javax.resource.cci.Interaction 使组件能够执行 EIS 函数。Interaction 实例支持采用以下方式与 EIS 实例交互：
  • 带有输入 Record、输出 Record 和 InteractionSpec 的 execute 方法。此方法执行 InteractionSpec 表示的 EIS 函数并更新输出 Record
  • 带有输入 Record 和 InteractionSpec 的 execute 方法。此方法实现执行 InteractionSpec 表示的 EIS 函数并生成输出 Record 作为返回值。

Interaction 实例是从 Connection 创建的，需要维持与 Connection 实例的关联。close 方法释放 Interaction 的资源适配器维护的所有资源。关闭 Interaction 实例时不应该关闭关联的 Connection 实例。

version | 0.8
since | 0.8
See also | java.sql.ResultSet
英文文档：

The javax.resource.cci.Interaction enables a component to execute EIS functions. An Interaction instance supports the following ways of interacting with an EIS instance:

  • execute method that takes an input Record, output Record and an InteractionSpec. This method executes the EIS function represented by the InteractionSpec and updates the output Record
  • execute method that takes an input Record and an InteractionSpec. This method implementation executes the EIS function represented by the InteractionSpec and produces the output Record as a return value.

An Interaction instance is created from a Connection and is required to maintain its association with the Connection instance. The close method releases all resources maintained by the resource adapter for the Interaction. The close of an Interaction instance should not close the associated Connection instance.

Since:
0.8
Version:
0.8
Author:
Rahul Sharma
See Also:
ResultSet

Method Summary
void | clearWarnings() Clears all the warning reported by this Interaction instance.
void | close() Closes the current Interaction and release all the resources held for this instance by the resource adapter.
Record | execute(InteractionSpec ispec, Record input) Executes an interaction represented by the InteractionSpec.
boolean | execute(InteractionSpec ispec, Record input, Record output) Executes an interaction represented by the InteractionSpec.
Connection | getConnection() Gets the Connection associated with the Interaction.
ResourceWarning | getWarnings() Gets the first ResourceWarning from the chain of warnings associated with this Interaction instance.

Method Detail

public void close() throws ResourceException
关闭当前 Interaction，释放资源适配器为此实例保留的所有资源。关闭 Interaction 实例时不关闭关联的 Connection 实例。建议显式关闭 Interaction 实例，以释放所有占用的资源。
Throws ResourceException: 无法关闭 Interaction 实例。对已关闭的 Interaction 调用 close 也应该抛出该异常。
英文文档：

close

void close()
           throws ResourceException
Closes the current Interaction and release all the resources held for this instance by the resource adapter. The close of an Interaction instance does not close the associated Connection instance. It is recommended that Interaction instances be closed explicitly to free any held resources.

Throws:
ResourceException - Failed to close the Interaction instance. Invoking close on an already closed Interaction should also throw this exception.

public Connection getConnection()
获取与 Interaction 关联的 Connection。
return 与 Interaction 关联的 Connection 实例
英文文档：

getConnection

Connection getConnection()
Gets the Connection associated with the Interaction.

Returns:
Connection instance associated with the Interaction

public boolean execute(InteractionSpec ispec, Record input, Record output) throws ResourceException
执行 InteractionSpec 表示的交互。这种形式的调用获取输入 Record 并更新输出 Record。
ispec | 表示目标 EIS 数据/函数模块的 InteractionSpec
input | 输入 Record
output | 输出 Record
return | 如果成功执行了 EIS 函数并更新了输出 Record，则返回 true；否则返回 false
Throws ResourceException: 如果执行操作失败，则抛出该异常。错误情况的示例有：
  • 资源适配器内部错误、特定于 EIS 的错误或者通信错误
  • 无效的 InteractionSpec、输入或输出记录结构规范
  • 使用输入或输出 Record 时出错
  • 与此 Interaction 关联的无效连接
Throws | NotSupportedException: 不支持该操作
英文文档：

execute

boolean execute(InteractionSpec ispec,
                Record input,
                Record output)
                throws ResourceException
Executes an interaction represented by the InteractionSpec. This form of invocation takes an input Record and updates the output Record.

Parameters:
ispec - InteractionSpec representing a target EIS data/function module
input - Input Record
output - Output Record
Returns:
true if execution of the EIS function has been successful and output Record has been updated; false otherwise
Throws:
ResourceException - Exception if execute operation fails. Examples of error cases are:
  • Resource adapter internal, EIS-specific or communication error
  • Invalid specification of an InteractionSpec, input or output record structure
  • Errors in use of input or output Record
  • Invalid connection associated with this Interaction
NotSupportedException - Operation not supported

public Record execute(InteractionSpec ispec, Record input) throws ResourceException
执行 InteractionSpec 表示的交互。如果成功执行了 Interaction，则这种形式的调用获取输入 Record 并返回输出 Record。
ispec | 表示目标 EIS 数据/函数模块的 InteractionSpec
input | 输入 Record
return | 如果成功执行了 EIS 函数，则返回输出 Record；否则返回 null
Throws ResourceException: 如果执行操作失败，则抛出该异常。错误情况的示例有：
  • 资源适配器内部错误、特定于 EIS 的错误或者通信错误
  • 无效的 InteractionSpec 或输入记录结构规范
  • 使用输入 Record 或创建输出 Record 时出错
  • 与此 Interaction 关联的无效连接
Throws | NotSupportedException: 不支持该操作
英文文档：

execute

Record execute(InteractionSpec ispec,
               Record input)
               throws ResourceException
Executes an interaction represented by the InteractionSpec. This form of invocation takes an input Record and returns an output Record if the execution of the Interaction has been successfull.

Parameters:
ispec - InteractionSpec representing a target EIS data/function module
input - Input Record
Returns:
output Record if execution of the EIS function has been successful; null otherwise
Throws:
ResourceException - Exception if execute operation fails. Examples of error cases are:
  • Resource adapter internal, EIS-specific or communication error
  • Invalid specification of an InteractionSpec or input record structure
  • Errors in use of input Record or creation of an output Record
  • Invalid connection associated with this Interaction
NotSupportedException - Operation not supported

public ResourceWarning getWarnings() throws ResourceException
获取与此 Interaction 实例关联的警告链中的第一个 ResourceWarning。
return | 位于警告链顶部的 ResourceWarning
Throws | ResourceException: 无法获取与 Interaction 关联的 ResourceWarning
英文文档：

getWarnings

ResourceWarning getWarnings()
                            throws ResourceException
Gets the first ResourceWarning from the chain of warnings associated with this Interaction instance.

Returns:
ResourceWarning at top of the warning chain
Throws:
ResourceException - Failed to get ResourceWarnings associated with Interaction

public void clearWarnings() throws ResourceException
清除此 Interaction 实例报告的所有警告。调用此方法后，在为此 Interaction 报告新的警告之前，getWarnings 方法将一直返回 null。
Throws ResourceException: 无法清除与 Interaction 关联的 ResourceWarning
英文文档：

clearWarnings

void clearWarnings()
                   throws ResourceException
Clears all the warning reported by this Interaction instance. After a call to this method, the method getWarnings will return null until a new warning is reported for this Interaction.

Throws:
ResourceException - Failed to clear ResourceWarnings associated with Interaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InteractionSpec (Java EE 5)

javax.resource.cci
Interface InteractionSpec

All Superinterfaces:
Serializable
public interface InteractionSpec
extends Serializable

Implements: java.io.Serializable

InteractionSpec 包含帮助与 EIS 实例建立交互的属性。Interaction 使用 InteractionSpec 在底层 EIS 上执行指定的函数。

CCI 规范为 InteractionSpec 定义一组标准属性。如果某个标准属性未应用于其底层 EIS，则 InteractionSpec 实现不需要支持该属性。

InteractionSpec 实现类必须为其支持的每个属性提供获取方法和设置方法。获取方法和设置方法约定应该基于 Java Bean 设计模式。

标准属性如下所示：

  • FunctionName：EIS 函数的名称
  • InteractionVerb：EIS 实例的交互模式：SYNC_SEND、SYNC_SEND_RECEIVE、SYNC_RECEIVE
  • ExecutionTimeout：Interaction 等待 EIS 执行指定函数的毫秒数

使用以下标准属性为 Interaction 实例提供有关 ResultSet 要求的提示：

  • FetchSize
  • FetchDirection
  • MaxFieldSize
  • ResultSetType
  • ResultSetConcurrency

除了在 InteractionSpec 接口中描述的属性之外，CCI 实现还可以提供其他属性。注意，其他属性的格式和类型特定于 EIS 并且超出了 CCI 规范范围。

需要将 InteractionSpec 接口作为 JavaBean 以支持各种工具。应该通过获取方法和设置方法模式定义 InteractionSpec 实现类上的属性。InteractionSpec 接口的实现类需要实现 java.io.Serializable 接口。

version | 0.8
since | 0.8
See also | javax.resource.cci.Interaction
英文文档：

An InteractionSpec holds properties for driving an Interaction with an EIS instance. An InteractionSpec is used by an Interaction to execute the specified function on an underlying EIS.

The CCI specification defines a set of standard properties for an InteractionSpec. An InteractionSpec implementation is not required to support a standard property if that property does not apply to its underlying EIS.

The InteractionSpec implementation class must provide getter and setter methods for each of its supported properties. The getter and setter methods convention should be based on the Java Beans design pattern.

The standard properties are as follows:

  • FunctionName: name of an EIS function
  • InteractionVerb: mode of interaction with an EIS instance: SYNC_SEND, SYNC_SEND_RECEIVE, SYNC_RECEIVE
  • ExecutionTimeout: the number of milliseconds an Interaction will wait for an EIS to execute the specified function

The following standard properties are used to give hints to an Interaction instance about the ResultSet requirements:

  • FetchSize
  • FetchDirection
  • MaxFieldSize
  • ResultSetType
  • ResultSetConcurrency

A CCI implementation can provide additional properties beyond that described in the InteractionSpec interface. Note that the format and type of the additional properties is specific to an EIS and is outside the scope of the CCI specification.

It is required that the InteractionSpec interface be implemented as a JavaBean for the toolability support. The properties on the InteractionSpec implementation class should be defined through the getter and setter methods pattern. An implementation class for InteractionSpec interface is required to implement the java.io.Serializable interface.

Since:
0.8
Version:
0.8
Author:
Rahul Sharma
See Also:
Interaction

Field Summary
static int | SYNC_RECEIVE The execution of an Interaction results in a synchronous receive of an output Record.
static int | SYNC_SEND Interaction Verb type: The execution of an Interaction does only a send to the target EIS instance.
static int | SYNC_SEND_RECEIVE Interaction Verb type: The execution of an Interaction sends a request to the EIS instance and receives response synchronously.

Field Detail

英文文档：

SYNC_SEND

static final int SYNC_SEND
Interaction Verb type: The execution of an Interaction does only a send to the target EIS instance. The input record is sent to the EIS instance without any synchronous response in terms of an output Record or ResultSet.

See Also:
Constant Field Values

英文文档：

SYNC_SEND_RECEIVE

static final int SYNC_SEND_RECEIVE
Interaction Verb type: The execution of an Interaction sends a request to the EIS instance and receives response synchronously. The input record is sent to the EIS instance with the output received either as Record or CCIResultSet.

See Also:
Constant Field Values

英文文档：

SYNC_RECEIVE

static final int SYNC_RECEIVE
The execution of an Interaction results in a synchronous receive of an output Record. An example is: a session bean gets a method invocation and it uses this SEND_RECEIVE form of interaction to retrieve messages that have been delivered to a message queue.

See Also:
Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalTransaction (Java EE 5)

javax.resource.cci
Interface LocalTransaction

public interface LocalTransaction

LocalTransaction 为资源管理器本地事务定义事务划分接口。注意，此接口用于应用程序级别的本地事务划分。容器使用系统协定级别 LocalTransaction 接口（在 javax.resource.spi 包中定义）进行本地事务管理。

本地事务在资源管理器内部管理。在协调此类事务时不涉及外部事务管理器。

CCI 实现可以（但不需要）实现 LocalTransaction 接口。如果 CCI 实现支持 LocalTransaction 接口，则方法 Connection.getLocalTransaction 应该返回一个 LocalTransaction 实例。然后组件可以使用返回的 LocalTransaction 在底层 EIS 实例上划分资源管理器本地事务（与 Connection 实例关联）。

since | 0.8
See also | javax.resource.cci.Connection
英文文档：

The LocalTransaction defines a transaction demarcation interface for resource manager local transactions. Note that this interface is used for application level local transaction demarcation. The system contract level LocalTransaction interface (as defined in the javax.resource.spi package) is used by the container for local transaction management.

A local transaction is managed internal to a resource manager. There is no external transaction manager involved in the coordination of such transactions.

A CCI implementation can (but is not required to) implement the LocalTransaction interface. If the LocalTransaction interface is supported by a CCI implementation, then the method Connection.getLocalTransaction should return a LocalTransaction instance. A component can then use the returned LocalTransaction to demarcate a resource manager local transaction (associated with the Connection instance) on the underlying EIS instance.

Since:
0.8
Author:
Rahul Sharma
See Also:
Connection

Method Summary
void | begin() Begins a local transaction on an EIS instance.
void | commit() Commits the current local transaction and release all locks held by the underlying EIS instance.
void | rollback() Rollbacks the current resource manager local transaction.

Method Detail

public void begin() throws ResourceException
在 EIS 实例上开始一个本地事务。
Throws ResourceException: 无法开始本地事务。错误情况的示例有：
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 连接已参与本地或 JTA 事务
英文文档：

begin

void begin()
           throws ResourceException
Begins a local transaction on an EIS instance.

Throws:
ResourceException - Failed to begin a local transaction. Examples of error cases are:
  • Resource adapter internal or EIS-specific error
  • Connection is already participating in a local or JTA transaction

public void commit() throws ResourceException
提交当前的本地事务并释放由底层 EIS 实例包含的所有锁。
Throws ResourceException: 无法提交本地事务。错误情况的示例有：
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 违反完整性约束、死锁检测、事务完成期间的通信故障、任何重试要求。
  • 连接参与到活动的 JTA 事务中
  • 无效的事务上下文；在不带活动事务上下文的情况下调用了提交操作
英文文档：

commit

void commit()
            throws ResourceException
Commits the current local transaction and release all locks held by the underlying EIS instance.

Throws:
ResourceException - Failed to commit a local transaction. Examples of error cases are:
  • Resource adapter internal or EIS-specific error
  • Violation of integrity constraints, deadlock detection, communication failure during transaction completion, or any retry requirement
  • Connection is participating in an active JTA transaction
  • Invalid transaction context; commit operation invoked without an active transaction context

public void rollback() throws ResourceException
回滚当前资源管理器本地事务。
Throws ResourceException: 无法回滚本地事务。错误情况的示例有：
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 连接参与到活动的 JTA 事务中
  • 无效的事务上下文；在不带活动事务上下文的情况下调用了回滚操作
英文文档：

rollback

void rollback()
              throws ResourceException
Rollbacks the current resource manager local transaction.

Throws:
ResourceException - Failed to rollback a local transaction. Examples of error cases are:
  • Resource adapter internal or EIS-specific error
  • Connection is participating in an active JTA transaction
  • Invalid transaction context; rollback operation invoked without an active transaction context
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MappedRecord (Java EE 5)

javax.resource.cci
Interface MappedRecord

All Superinterfaces:
Cloneable, Map, Record, Serializable
public interface MappedRecord
extends Record, Map, Serializable

Implements: Record, java.util.Map<K, V>, java.io.Serializable

接口 javax.resource.cci.MappedRecord 用于基于键值映射的记录元素表示形式。MappedRecord 接口扩展 Record 和 java.util.Map 接口。
version 0.8
英文文档：

The interface javax.resource.cci.MappedRecord is used for key-value map based representation of record elements. The MappedRecord interface extends both Record and java.util.Mapinterfaces.

Version:
0.8
Author:
Rahul Sharma

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Method Summary
Methods inherited from interface javax.resource.cci.Record
clone, equals, getRecordName, getRecordShortDescription, hashCode, setRecordName, setRecordShortDescription
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageListener (Java EE 5)

javax.resource.cci
Interface MessageListener

public interface MessageListener

此类作为消息端点（消息驱动的 Bean）可以实现的请求-响应消息侦听器类型。此类允许 EIS 使用请求-响应样式与端点进行通信。
version 1.0
英文文档：

This serves as a request-response message listener type that message endpoints (message-driven beans) may implement. This allows an EIS to communicate with an endpoint using a request-response style.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
 Record onMessage(Record inputData)
This method allows an EIS to call a message endpoint using a request-response style communication.

Method Detail

public Record onMessage(Record inputData) throws ResourceException
此方法允许 EIS 使用请求-响应样式的通信调用消息端点。
inputData | Record 实例。
return | Record 实例或 null。
Throws | ResourceException: 指示一个异常情况。
英文文档：

onMessage

Record onMessage(Record inputData)
                 throws ResourceException
This method allows an EIS to call a message endpoint using a request-response style communication.

Parameters:
inputData - a Record instance.
Returns:
a Record instance or null.
Throws:
ResourceException - indicates an exceptional condition.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Record (Java EE 5)

javax.resource.cci
Interface Record

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
IndexedRecord, MappedRecord, ResultSet
public interface Record
extends Cloneable, Serializable

Implements: Cloneable, java.io.Serializable
Implemented by: IndexedRecord, MappedRecord, ResultSet

javax.resource.cci.Record 接口是一个基本接口，用于表示 Interaction 上定义的 execute 方法的输入或输出。

可以扩展 Record 接口以形成以下表示形式之一：

  • MappedRecord：基于键-值对的 Collection 表示一个记录。此接口基于 java.util.Map
  • IndexedRecord：一个有序且具有索引的 Collection 表示一个记录。此接口基于 java.util.List。
  • 基于 JavaBean 的 EIS 抽象的表示形式：例如，生成的自定义记录表示 ERP 系统中的一个采购订单。
  • javax.resource.cci.ResultSet：此接口扩展 java.sql.ResultSet 和 javax.resource.cci.Record。ResultSet 代表表格数据。

MappedRecord 或 IndexedRecord 可以包含另一个 Record。这意味着可以使用 MappedRecord 和 IndexedRecord 创建任意深度的分层结构。基本 Java 类型用作 MappedRecord 或 IndexedRecord 表示的分层结构的叶元素。

version | 0.8
See also | javax.resource.cci.Interaction, java.sql.ResultSet
英文文档：

The javax.resource.cci.Record interface is the base interface for the representation of an input or output to the execute methods defined on an Interaction.

The Record interface can be extended to form a one of the following representations:

  • MappedRecord: A key-value pair based collection represents a record. This interface is based on the java.util.Map
  • IndexedRecord:An ordered and indexed collection represents a record. This interface is based on the java.util.List.
  • JavaBean based representation of an EIS abstraction: An example is a custom record generated to represent a purchase order in an ERP system.
  • javax.resource.cci.ResultSet: This interface extends both java.sql.ResultSet and javax.resource.cci.Record. A ResultSet represents tabular data.

A MappedRecord or IndexedRecord can contain another Record. This means that MappedRecord and IndexedRecord can be used to create a hierarchical structure of any arbitrary depth. A basic Java type is used as the leaf element of a hierarchical structure represented by a MappedRecord or IndexedRecord.

Version:
0.8
Author:
Rahul Sharma
See Also:
Interaction, ResultSet

Method Summary
Object | clone() Creates and returns a copy of this object.
boolean | equals(Object other) Check if this instance is equal to another Record.
String | getRecordName() Gets the name of the Record.
String | getRecordShortDescription() Gets a short description string for the Record.
int | hashCode() Returns the hash code for the Record instance.
void | setRecordName(String name) Sets the name of the Record.
void | setRecordShortDescription(String description) Sets a short description string for the Record.

Method Detail

public String getRecordName()
获取 Record 的名称。
return 表示 Record 名称的字符串
英文文档：

getRecordName

String getRecordName()
Gets the name of the Record.

Returns:
String representing name of the Record

public void setRecordName(String name)
设置 Record 的名称。
name Record 的名称
英文文档：

setRecordName

void setRecordName(String name)
Sets the name of the Record.

Parameters:
name - Name of the Record

public void setRecordShortDescription(String description)
设置 Record 的简短描述字符串。此属性主要供应用程序开发工具使用。
description Record 的描述
英文文档：

setRecordShortDescription

void setRecordShortDescription(String description)
Sets a short description string for the Record. This property is used primarily by application development tools.

Parameters:
description - Description of the Record

public String getRecordShortDescription()
获取 Record 的简短描述字符串。此属性主要供应用程序开发工具使用。
return 表示 Record 简短描述的字符串
英文文档：

getRecordShortDescription

String getRecordShortDescription()
Gets a short description string for the Record. This property is used primarily by application development tools.

Returns:
String representing a short description of the Record

public boolean equals(Object other)
检查此实例是否等于另一个 Record。
return 如果两个实例相等，则返回 true
英文文档：

equals

boolean equals(Object other)
Check if this instance is equal to another Record.

Overrides:
equals in class Object
Returns:
true if two instances are equal

public int hashCode()
返回 Record 实例的哈希码。
return 哈希码
英文文档：

hashCode

int hashCode()
Returns the hash code for the Record instance.

Overrides:
hashCode in class Object
Returns:
hash code

public Object clone() throws CloneNotSupportedException
创建并返回此对象的一个副本。“副本”的准确含义可能依赖于对象的类。
return | 此实例的一个副本。
Throws | CloneNotSupportedException: 如果该对象的类不支持 Cloneable 接口。重写 clone 方法的子类还可以抛出此异常表示无法复制实例。
英文文档：

clone

Object clone()
             throws CloneNotSupportedException
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object.

Returns:
a clone of this instance.
Throws:
CloneNotSupportedException - If the object's class does not support the Cloneable interface Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RecordFactory (Java EE 5)

javax.resource.cci
Interface RecordFactory

public interface RecordFactory

RecordFactory 接口用于创建 MappedRecord 和 IndexedRecord 实例。注意，RecordFactory 只能用于创建一般记录实例。CCI 实现为 RecordFactory 接口提供实现类。
since | 0.8
See also | javax.resource.cci.IndexedRecord, javax.resource.cci.MappedRecord
英文文档：

The RecordFactory interface is used for creating MappedRecord and IndexedRecord instances. Note that the RecordFactory is only used for creation of generic record instances. A CCI implementation provides an implementation class for the RecordFactory interface.

Since:
0.8
Author:
Rahul Sharma
See Also:
IndexedRecord, MappedRecord

Method Summary
IndexedRecord | createIndexedRecord(String recordName) Creates a IndexedRecord.
MappedRecord | createMappedRecord(String recordName) Creates a MappedRecord.

Method Detail

public MappedRecord createMappedRecord(String recordName) throws ResourceException
创建一个 MappedRecord。该方法采用将由 RecordFactory 创建的记录名称。记录名称用作指向特定记录类型的元信息（存储在元数据存储库中）的指针。
recordName | Record 的名称
return
en
MappedRecord
Throws ResourceException: 无法创建 MappedRecord。错误情况的示例有：
  • 无效的记录名称规范
  • 资源适配器内部错误
  • 无法访问元数据存储库
Throws | NotSupportedException: 不支持该操作
英文文档：

createMappedRecord

MappedRecord createMappedRecord(String recordName)
                                throws ResourceException
Creates a MappedRecord. The method takes the name of the record that is to be created by the RecordFactory. The name of the record acts as a pointer to the meta information (stored in the metadata repository) for a specific record type.

Parameters:
recordName - Name of the Record
Returns:
MappedRecord
Throws:
ResourceException - Failed to create a MappedRecord. Example error cases are:
  • Invalid specification of record name
  • Resource adapter internal error
  • Failed to access metadata repository
NotSupportedException - Operation not supported

public IndexedRecord createIndexedRecord(String recordName) throws ResourceException
创建一个 IndexedRecord。该方法采用将由 RecordFactory 创建的记录名称。记录名称用作指向特定记录类型的元信息（存储在元数据存储库中）的指针。
recordName | Record 的名称
return
en
IndexedRecord
Throws ResourceException: 无法创建 IndexedRecord。错误情况的示例有：
  • 无效的记录名称规范
  • 资源适配器内部错误
  • 无法访问元数据存储库
Throws | NotSupportedException: 不支持该操作
英文文档：

createIndexedRecord

IndexedRecord createIndexedRecord(String recordName)
                                  throws ResourceException
Creates a IndexedRecord. The method takes the name of the record that is to be created by the RecordFactory. The name of the record acts as a pointer to the meta information (stored in the metadata repository) for a specific record type.

Parameters:
recordName - Name of the Record
Returns:
IndexedRecord
Throws:
ResourceException - Failed to create an IndexedRecord. Example error cases are:
  • Invalid specification of record name
  • Resource adapter internal error
  • Failed to access metadata repository
NotSupportedException - Operation not supported
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAdapterMetaData (Java EE 5)

javax.resource.cci
Interface ResourceAdapterMetaData

public interface ResourceAdapterMetaData

接口 javax.resource.cci.ResourceAdapterMetaData 提供有关资源适配器实现的功能的信息。注意，此接口不提供通过资源适配器连接的 EIS 实例的信息。

CCI 客户端使用 ConnectionFactory.getMetaData 获取有关资源适配器的元数据信息。getMetaData 方法不要求建立对 EIS 实例的活动连接。

可以扩展 ResourceAdapterMetaData，以提供更多特定于资源适配器实现的详细信息。

version | 0.8
since | 0.8
See also | javax.resource.cci.ConnectionFactory
英文文档：

The interface javax.resource.cci.ResourceAdapterMetaData provides information about capabilities of a resource adapter implementation. Note that this interface does not provide information about an EIS instance that is connected through the resource adapter.

A CCI client uses a ConnectionFactory.getMetaData to get metadata information about the resource adapter. The getMetaData method does not require that an active connection to an EIS instance should have been established.

The ResourceAdapterMetaData can be extended to provide more information specific to a resource adapter implementation.

Since:
0.8
Version:
0.8
Author:
Rahul Sharma
See Also:
ConnectionFactory

Method Summary
 String getAdapterName()
Gets a tool displayable name of the resource adapter.
 String getAdapterShortDescription()
Gets a tool displayable short desription of the resource adapter.
 String getAdapterVendorName()
Gets the name of the vendor that has provided the resource adapter.
 String getAdapterVersion()
Gets the version of the resource adapter.
 String[] getInteractionSpecsSupported()
Returns an array of fully-qualified names of InteractionSpec types supported by the CCI implementation for this resource adapter.
 String getSpecVersion()
Returns a string representation of the version of the connector architecture specification that is supported by the resource adapter.
 boolean supportsExecuteWithInputAndOutputRecord()
Returns true if the implementation class for the Interaction interface implements public boolean execute(InteractionSpec ispec, Record input, Record output) method; otherwise the method returns false.
 boolean supportsExecuteWithInputRecordOnly()
Returns true if the implementation class for the Interaction interface implements public Record execute(InteractionSpec ispec, Record input) method; otherwise the method returns false.
 boolean supportsLocalTransactionDemarcation()
Returns true if the resource adapter implements the LocalTransaction interface and supports local transaction demarcation on the underlying EIS instance through the LocalTransaction interface.

Method Detail

public String getAdapterVersion()
获取资源适配器的版本。
return 表示资源适配器版本的字符串
英文文档：

getAdapterVersion

String getAdapterVersion()
Gets the version of the resource adapter.

Returns:
String representing version of the resource adapter

public String getAdapterVendorName()
获取已提供资源适配器的供应商名称。
return 代表已提供资源适配器的供应商名称的字符串
英文文档：

getAdapterVendorName

String getAdapterVendorName()
Gets the name of the vendor that has provided the resource adapter.

Returns:
String representing name of the vendor that has provided the resource adapter

public String getAdapterName()
获取资源适配器的工具可显示名称。
return 表示资源适配器名称的字符串
英文文档：

getAdapterName

String getAdapterName()
Gets a tool displayable name of the resource adapter.

Returns:
String representing the name of the resource adapter

public String getAdapterShortDescription()
获取资源适配器的工具可显示简短描述。
return 描述资源适配器的字符串
英文文档：

getAdapterShortDescription

String getAdapterShortDescription()
Gets a tool displayable short desription of the resource adapter.

Returns:
String describing the resource adapter

public String getSpecVersion()
返回资源适配器支持的连接器架构规范版本的字符串表示。
return 表示支持的连接器架构版本的字符串
英文文档：

getSpecVersion

String getSpecVersion()
Returns a string representation of the version of the connector architecture specification that is supported by the resource adapter.

Returns:
String representing the supported version of the connector architecture

public String[] getInteractionSpecsSupported()
返回此资源适配器的 CCI 实现支持的 InteractionSpec 类型的完全限定名称数组。注意，完全限定类名称是 InteractionSpec 的实现类。工具供应商使用此方法查找有关支持的 InteractionSpec 类型的信息。如果 CCI 实现未定义特定的 InteractionSpec 类型，则该方法应该返回长度为 0 的数组。
return | 此资源适配器的 CCI 实现支持的 InteractionSpec 类的完全限定类名称数组
See also | javax.resource.cci.InteractionSpec
英文文档：

getInteractionSpecsSupported

String[] getInteractionSpecsSupported()
Returns an array of fully-qualified names of InteractionSpec types supported by the CCI implementation for this resource adapter. Note that the fully-qualified class name is for the implementation class of an InteractionSpec. This method may be used by tools vendor to find information on the supported InteractionSpec types. The method should return an array of length 0 if the CCI implementation does not define specific InteractionSpec types.

Returns:
Array of fully-qualified class names of InteractionSpec classes supported by this resource adapter's CCI implementation
See Also:
InteractionSpec

public boolean supportsExecuteWithInputAndOutputRecord()
如果 Interaction 接口的实现类实现 public boolean execute(InteractionSpec ispec, Record input, Record output) 方法，则返回 true；否则该方法返回 false。
return | 一个 boolean 值，取决于方法支持
See also | javax.resource.cci.Interaction
英文文档：

supportsExecuteWithInputAndOutputRecord

boolean supportsExecuteWithInputAndOutputRecord()
Returns true if the implementation class for the Interaction interface implements public boolean execute(InteractionSpec ispec, Record input, Record output) method; otherwise the method returns false.

Returns:
boolean depending on method support
See Also:
Interaction

public boolean supportsExecuteWithInputRecordOnly()
如果 Interaction 接口的实现类实现 public Record execute(InteractionSpec ispec, Record input) 方法，则返回 true；否则该方法返回 false。
return | 一个 boolean 值，取决于方法支持
See also | javax.resource.cci.Interaction
英文文档：

supportsExecuteWithInputRecordOnly

boolean supportsExecuteWithInputRecordOnly()
Returns true if the implementation class for the Interaction interface implements public Record execute(InteractionSpec ispec, Record input) method; otherwise the method returns false.

Returns:
boolean depending on method support
See Also:
Interaction

public boolean supportsLocalTransactionDemarcation()
如果资源适配器实现 LocalTransaction 接口，并且支持通过 LocalTransaction 接口在底层 EIS 实例上进行本地事务划分，则返回 true。
return | 如果资源适配器支持通过 LocalTransaction 接口进行资源管理器本地事务划分，则返回 true；否则返回 false
See also | javax.resource.cci.LocalTransaction
英文文档：

supportsLocalTransactionDemarcation

boolean supportsLocalTransactionDemarcation()
Returns true if the resource adapter implements the LocalTransaction interface and supports local transaction demarcation on the underlying EIS instance through the LocalTransaction interface.

Returns:
true if resource adapter supports resource manager local transaction demarcation through LocalTransaction interface; false otherwise
See Also:
LocalTransaction
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResultSet (Java EE 5)

javax.resource.cci
Interface ResultSet

All Superinterfaces:
Cloneable, Record, ResultSet, Serializable
public interface ResultSet
extends Record, ResultSet

Implements: Record, java.sql.ResultSet

表示表格数据的一个 ResultSet，这些数据是通过执行 Interaction 从 EIS 实例中获取的。CCI ResultSet 基于 JDBC ResultSet。

有关 CCI ResultSet 实现的详细要求，请参考 Connectors 1.0 中的 CCI 规范。

since | 0.8
See also | java.sql.ResultSet
英文文档：

A ResultSet represents tabular data that is retrieved from an EIS instance by the execution of an Interaction.. The CCI ResultSet is based on the JDBC ResultSet.

Refer the CCI specification in Connectors 1.0 for detailed requirements on the implementation of a CCI ResultSet.

Since:
0.8
Author:
Rahul Sharma
See Also:
ResultSet

Field Summary
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
Method Summary
Methods inherited from interface javax.resource.cci.Record
clone, equals, getRecordName, getRecordShortDescription, hashCode, setRecordName, setRecordShortDescription
Methods inherited from interface java.sql.ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getShort, getShort, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResultSetInfo (Java EE 5)

javax.resource.cci
Interface ResultSetInfo

public interface ResultSetInfo

接口 javax.resource.cci.ResultSetInfo 提供有关连接的 EIS 实例为 ResultSet 提供的支持的信息。组件调用方法 Connection.getResultInfo 获取 ResultSetInfo 实例。

不要求 CCI 实现支持 javax.resource.cci.ResultSetInfo 接口。只有当 CCI 支持 ResultSet 工具时才提供此接口的实现。

version | 0.9
See also | javax.resource.cci.Connection, java.sql.ResultSet, javax.resource.cci.ConnectionMetaData
英文文档：

The interface javax.resource.cci.ResultSetInfo provides information on the support provided for ResultSet by a connected EIS instance. A component calls the method Connection.getResultInfo to get the ResultSetInfo instance.

A CCI implementation is not required to support javax.resource.cci.ResultSetInfo interface. The implementation of this interface is provided only if the CCI supports the ResultSet facility.

Version:
0.9
Author:
Rahul Sharma
See Also:
Connection, ResultSet, ConnectionMetaData

Method Summary
boolean | deletesAreDetected(int type)
boolean | insertsAreDetected(int type) Indicates whether or not a visible row insert can be detected by calling ResultSet.rowInserted.
boolean | othersDeletesAreVisible(int type) Indicates whether deletes made by others are visible.
boolean | othersInsertsAreVisible(int type) Indicates whether inserts made by others are visible.
boolean | othersUpdatesAreVisible(int type) Indicates whether updates made by others are visible.
boolean | ownDeletesAreVisible(int type)
boolean | ownInsertsAreVisible(int type)
boolean | ownUpdatesAreVisible(int type)
boolean | supportsResultSetType(int type) Indicates whether or not a resource adapter supports a type of ResultSet.
boolean | supportsResultTypeConcurrency(int type, int concurrency) Indicates whether or not a resource adapter supports the concurrency type in combination with the given ResultSet type/
boolean | updatesAreDetected(int type) Indicates whether or not a visible row update can be detected by calling the method ResultSet.rowUpdated.

Method Detail

public boolean updatesAreDetected(int type) throws ResourceException
指示是否可以通过调用 ResultSet.rowUpdated 方法检测可见行的更新。
type | ResultSet 的类型，即 ResultSet.TYPE_XXX
return | 如果检测到结果集类型更改，则返回 true；否则返回 false
Throws | ResourceException: 无法获取信息
See also | rowUpdated
英文文档：

updatesAreDetected

boolean updatesAreDetected(int type)
                           throws ResourceException
Indicates whether or not a visible row update can be detected by calling the method ResultSet.rowUpdated.

Parameters:
type - type of the ResultSet i.e. ResultSet.TYPE_XXX
Returns:
true if changes are detected by the result set type; false otherwise
Throws:
ResourceException - Failed to get the information
See Also:
ResultSet.rowUpdated()

public boolean insertsAreDetected(int type) throws ResourceException
指示是否可以通过调用 ResultSet.rowInserted 检测可见行的插入。
type | ResultSet 的类型，即 ResultSet.TYPE_XXX
return | 如果检测到结果集类型更改，则返回 true；否则返回 false
Throws | ResourceException: 无法获取信息
See also | rowInserted
英文文档：

insertsAreDetected

boolean insertsAreDetected(int type)
                           throws ResourceException
Indicates whether or not a visible row insert can be detected by calling ResultSet.rowInserted.

Parameters:
type - type of the ResultSet i.e. ResultSet.TYPE_XXX
Returns:
true if changes are detected by the result set type; false otherwise
Throws:
ResourceException - Failed to get the information
See Also:
ResultSet.rowInserted()

public boolean deletesAreDetected(int type) throws ResourceException
英文文档：

deletesAreDetected

boolean deletesAreDetected(int type)
                           throws ResourceException
Throws:
ResourceException

public boolean supportsResultSetType(int type) throws ResourceException
指示资源适配器是否支持某个 ResultSet 类型。
type | ResultSet 的类型，即 ResultSet.TYPE_XXX
return | 如果支持 ResultSet 类型，则返回 true；否则返回 false
Throws | ResourceException: 无法获取信息
英文文档：

supportsResultSetType

boolean supportsResultSetType(int type)
                              throws ResourceException
Indicates whether or not a resource adapter supports a type of ResultSet.

Parameters:
type - type of the ResultSet i.e. ResultSet.TYPE_XXX
Returns:
true if ResultSet type supported; false otherwise
Throws:
ResourceException - Failed to get the information

public boolean supportsResultTypeConcurrency(int type, int concurrency) throws ResourceException
指示资源适配器是否支持与给定的 ResultSet 类型组合的并发性类型。
type | ResultSet 的类型，即 ResultSet.TYPE_XXX
concurrency | 在 java.sql.ResultSet 中定义的 ResultSet 并发性类型
return | 如果支持指定的组合，则返回 true；否则返回 false
Throws | ResourceException: 无法获取信息
英文文档：

supportsResultTypeConcurrency

boolean supportsResultTypeConcurrency(int type,
                                      int concurrency)
                                      throws ResourceException
Indicates whether or not a resource adapter supports the concurrency type in combination with the given ResultSet type/

Parameters:
type - type of the ResultSet i.e. ResultSet.TYPE_XXX
concurrency - ResultSet concurrency type defined in java.sql.ResultSet
Returns:
true if the specified combination supported; false otherwise
Throws:
ResourceException - Failed to get the information

public boolean othersUpdatesAreVisible(int type) throws ResourceException
指示其他结果集类型进行的更新是否可见。
type | ResultSet 的类型，即 ResultSet.TYPE_XXX
return | 如果其他结果集类型进行的更新对于 ResultSet 类型是可见的，则返回 true；否则返回 false
Throws | ResourceException: 无法获取信息
英文文档：

othersUpdatesAreVisible

boolean othersUpdatesAreVisible(int type)
                                throws ResourceException
Indicates whether updates made by others are visible.

Parameters:
type - type of the ResultSet i.e. ResultSet.TYPE_XXX
Returns:
true if updates by others are visible for the ResultSet type; false otherwise
Throws:
ResourceException - Failed to get the information

public boolean othersDeletesAreVisible(int type) throws ResourceException
指示其他结果集类型进行的删除是否可见。
type | ResultSet 的类型，即 ResultSet.TYPE_XXX
return | 如果其他结果集类型进行的删除对于 ResultSet 类型是可见的，则返回 true；否则返回 false
Throws | ResourceException: 无法获取信息
英文文档：

othersDeletesAreVisible

boolean othersDeletesAreVisible(int type)
                                throws ResourceException
Indicates whether deletes made by others are visible.

Parameters:
type - type of the ResultSet i.e. ResultSet.TYPE_XXX
Returns:
true if deletes by others are visible for the ResultSet type; false otherwise
Throws:
ResourceException - Failed to get the information

public boolean othersInsertsAreVisible(int type) throws ResourceException
指示其他结果集类型进行的插入是否可见。
type | ResultSet 的类型，即 ResultSet.TYPE_XXX
return | 如果其他结果集类型进行的插入对于 ResultSet 类型是可见的，则返回 true；否则返回 false
Throws | ResourceException: 无法获取信息
英文文档：

othersInsertsAreVisible

boolean othersInsertsAreVisible(int type)
                                throws ResourceException
Indicates whether inserts made by others are visible.

Parameters:
type - type of the ResultSet i.e. ResultSet.TYPE_XXX
Returns:
true if inserts by others are visible for the ResultSet type; false otherwise
Throws:
ResourceException - Failed to get the information

public boolean ownUpdatesAreVisible(int type) throws ResourceException
英文文档：

ownUpdatesAreVisible

boolean ownUpdatesAreVisible(int type)
                             throws ResourceException
Throws:
ResourceException

public boolean ownInsertsAreVisible(int type) throws ResourceException
英文文档：

ownInsertsAreVisible

boolean ownInsertsAreVisible(int type)
                             throws ResourceException
Throws:
ResourceException

public boolean ownDeletesAreVisible(int type) throws ResourceException
英文文档：

ownDeletesAreVisible

boolean ownDeletesAreVisible(int type)
                             throws ResourceException
Throws:
ResourceException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Streamable (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.cci
Interface Streamable

public interface Streamable

Streamable 接口使资源适配器能够从输入 Record 中提取数据，或者将数据置于输出 Record 中作为字节流。

Streamable 接口提供组件在 Record 实例中设置的资源适配器的数据视图。

组件不能直接使用 Streamable 接口。而是通过资源适配器实现使用。组件使用 Record 或任何派生的接口来管理记录。

since | 0.8
See also | javax.resource.cci.Record
英文文档：

Streamable interface enables a resource adapter to extract data from an input Record or set data into an output Record as a stream of bytes.

The Streamable interface provides a resource adapter's view of the data that has been set in a Record instance by a component.

The Streamable interface is not directly used by a component. It is used by a resource adapter implementation. A component uses Record or any derived interfaces to manage records.

Since:
0.8
Author:
Rahul Sharma
See Also:
Record

Method Summary
void | read(InputStream istream) Read data from an InputStream and initialize fields of a Streamable object.
void | write(OutputStream ostream) Write fields of a Streamable object to an OutputStream

Method Detail

public void read(java.io.InputStream istream) throws java.io.IOException
从 InputStream 中读取数据并初始化 Streamable 对象的字段。
istream 表示 Streamable 对象字段特定于资源适配器的内部表示形式的 InputStream
英文文档：

read

void read(InputStream istream)
          throws IOException
Read data from an InputStream and initialize fields of a Streamable object.

Parameters:
istream - InputStream that represents a resource adapter specific internal representation of fields of a Streamable object
Throws:
IOException

public void write(java.io.OutputStream ostream) throws java.io.IOException
将 Streamable 对象的字段写入 OutputStream
ostream 包含 Streamable 对象值的 OutputStream
英文文档：

write

void write(OutputStream ostream)
           throws IOException
Write fields of a Streamable object to an OutputStream

Parameters:
ostream - OutputStream that holds value of a Streamable object
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ResourceWarning (Java EE 5)

javax.resource.cci
Class ResourceWarning

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.cci.ResourceWarning
All Implemented Interfaces:
Serializable
public class ResourceWarning
extends ResourceException

Extends: Throwable > Exception > ResourceException

ResourceWarning 提供与执行 EIS 的交互有关的警告的相关信息。这些警告直接链接到导致报告警告的方法所在的对象。
See also getWarnings
英文文档：

A ResourceWarning provides information on warnings related to execution of an interaction with an EIS. Warnings are silently chained to the object whose method caused it to be reported.

See Also:
Interaction.getWarnings(), Serialized Form

Constructor Summary
ResourceWarning()
Constructs a new instance with null as its detail message.
ResourceWarning(String message)
Constructs a new instance with the specified detail message.
ResourceWarning(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
ResourceWarning(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
ResourceWarning(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
ResourceWarning | getLinkedWarning() Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
void | setLinkedWarning(ResourceWarning warning) Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public ResourceWarning()
构造一个新实例，其详细消息为 null。
英文文档：

ResourceWarning

public ResourceWarning()
Constructs a new instance with null as its detail message.

public ResourceWarning(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

ResourceWarning

public ResourceWarning(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public ResourceWarning(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

ResourceWarning

public ResourceWarning(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public ResourceWarning(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

ResourceWarning

public ResourceWarning(String message,
                       Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public ResourceWarning(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

ResourceWarning

public ResourceWarning(String message,
                       String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Method Detail

public ResourceWarning getLinkedWarning()
获取链接到此 ResourceWarning 对象的警告。
return | 链接中的下一个 ResourceWarning；如果不存在，则为 null。
deprecated | J2SE 1.4 版支持链接异常工具，它允许 throwable 了解导致它抛出的另一个 throwable（如果有）。请参考 java.lang.Throwable 类的 getCause 和 initCause 方法。
英文文档：

getLinkedWarning

public ResourceWarning getLinkedWarning()
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.

Retrieves the warning chained to this ResourceWarning object.

Returns:
next ResourceWarning in the chain; null if none.

public void setLinkedWarning(ResourceWarning warning)
将 ResourceWarning 对象添加到链的末尾。
warning | 要添加到链的 ResourceWarning。
deprecated | J2SE 1.4 版支持链接异常工具，它允许 throwable 了解导致它抛出的另一个 throwable（如果有）。请参考 java.lang.Throwable 类的 getCause 和 initCause 方法。
英文文档：

setLinkedWarning

public void setLinkedWarning(ResourceWarning warning)
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.

Adds an ResourceWarning object to the end of the chain.

Parameters:
warning - ResourceWarning to be added to the chain.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.resource.spi (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.resource.spi

The javax.resource.spi package contains APIs for the system contracts defined in the J2EE Connector Architecture specification.

See:
Description

Interface Summary
ActivationSpec | This interface serves as a marker.
BootstrapContext | This provides a mechanism to pass a bootstrap context to a resource adapter instance when it is bootstrapped.
ConnectionEventListener | The ConnectionEventListener interface provides an event callback mechanism to enable an application server to receive notifications from a ManagedConnection instance.
ConnectionManager | ConnectionManager interface provides a hook for the resource adapter to pass a connection request to the application server.
ConnectionRequestInfo | The ConnectionRequestInfo interface enables a resource adapter to pass its own request specific data structure across the connection request flow.
DissociatableManagedConnection | This is a mix-in interface that may be optionally implemented by a ManagedConnection implementation.
LazyAssociatableConnectionManager | This is a mix-in interface that may be optionally implemented by a ConnectionManager implementation.
LazyEnlistableConnectionManager | This is a mix-in interface that may be optionally implemented by a ConnectionManager implementation.
LazyEnlistableManagedConnection | This is a mix-in interface that may be optionally implemented by a ManagedConnection implementation.
LocalTransaction | LocalTransaction interface provides support for transactions that are managed internal to an EIS resource manager, and do not require an external transaction manager.
ManagedConnection | ManagedConnection instance represents a physical connection to the underlying EIS.
ManagedConnectionFactory | ManagedConnectionFactory instance is a factory of both ManagedConnection and EIS-specific connection factory instances.
ManagedConnectionMetaData | The ManagedConnectionMetaData interface provides information about the underlying EIS instance associated with a ManagedConnection instance.
ResourceAdapter | This represents a resource adapter instance and contains operations for lifecycle management and message endpoint setup.
ResourceAdapterAssociation | This interface specifies the methods to associate a ResourceAdapter object with other objects that implement this interface like ManagedConnectionFactory and ActivationSpec.
ValidatingManagedConnectionFactory | This interface is implemented by a ManagedConnectionFactory instance that supports the ability to validate ManagedConnection objects.
XATerminator | The XATerminator interface is used for transaction completion and crash recovery flows.

Class Summary
ConnectionEvent The ConnectionEvent class provides information about the source of a connection related event.A ConnectionEvent instance contains the following information: Type of the connection event ManagedConnection instance that generated the connection event.

Exception Summary
ApplicationServerInternalException | An ApplicationServerInternalException is thrown by an application server to indicate error conditions specific to an application server.
CommException | This indicates errors related to failed or interrupted communication with an EIS instance.
EISSystemException | An EISSystemException is used to indicate any EIS specific system-level error conditions.
IllegalStateException | An IllegalStateException is thrown from a method if the callee (resource adapter or application server for system contracts) is in an illegal or inappropriate state for the method invocation.
InvalidPropertyException | This exception is thrown to indicate invalid configuration property settings.
LocalTransactionException | A LocalTransactionException represents various error conditions related to the local transaction management contract.
ResourceAdapterInternalException | A ResourceAdapterInternalException indicates any system-level error conditions related to a resource adapter.
ResourceAllocationException | A ResourceAllocationException can be thrown by an application server or resource adapter to indicate any failure to allocate system resources (example: threads, physical connections).
SecurityException | A SecurityException indicates error conditions related to the security contract between an application server and resource adapter.
SharingViolationException | This is thrown to indicate a connection sharing violation.
UnavailableException | This is thrown to indicate that a service is unavailable.

Package javax.resource.spi Description

The javax.resource.spi package contains APIs for the system contracts defined in the J2EE Connector Architecture specification.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.resource.spi Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.resource.spi

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.EventObject (implements java.io.Serializable)
      • javax.resource.spi.ConnectionEvent
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.resource.ResourceException
          • javax.resource.spi.ApplicationServerInternalException
          • javax.resource.spi.CommException
          • javax.resource.spi.EISSystemException
          • javax.resource.spi.IllegalStateException
          • javax.resource.spi.InvalidPropertyException
          • javax.resource.spi.LocalTransactionException
          • javax.resource.spi.ResourceAdapterInternalException
          • javax.resource.spi.ResourceAllocationException
          • javax.resource.spi.SecurityException
          • javax.resource.spi.SharingViolationException
          • javax.resource.spi.UnavailableException

Interface Hierarchy

  • javax.resource.spi.BootstrapContext
  • javax.resource.spi.ConnectionRequestInfo
  • javax.resource.spi.DissociatableManagedConnection
  • java.util.EventListener
    • javax.resource.spi.ConnectionEventListener
  • javax.resource.spi.LazyAssociatableConnectionManager
  • javax.resource.spi.LazyEnlistableConnectionManager
  • javax.resource.spi.LazyEnlistableManagedConnection
  • javax.resource.spi.LocalTransaction
  • javax.resource.spi.ManagedConnection
  • javax.resource.spi.ManagedConnectionMetaData
  • javax.resource.spi.ResourceAdapter
  • javax.resource.spi.ResourceAdapterAssociation
    • javax.resource.spi.ActivationSpec
  • java.io.Serializable
    • javax.resource.spi.ConnectionManager
    • javax.resource.spi.ManagedConnectionFactory
  • javax.resource.spi.ValidatingManagedConnectionFactory
  • javax.resource.spi.XATerminator
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ActivationSpec (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi
Interface ActivationSpec

All Superinterfaces:
ResourceAdapterAssociation
public interface ActivationSpec
extends ResourceAdapterAssociation

Implements: ResourceAdapterAssociation

此接口用作标记器。ActivationSpec 的实例必须为 JavaBean，并且必须能够序列化。它包含消息端点的激活配置信息。
version 1.0
英文文档：

This interface serves as a marker. An instance of an ActivationSpec must be a JavaBean and must be serializable. This holds the activation configuration information for a message endpoint.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
 void validate()
This method may be called by a deployment tool to validate the overall activation configuration information provided by the endpoint deployer.
Methods inherited from interface javax.resource.spi.ResourceAdapterAssociation
getResourceAdapter, setResourceAdapter

Method Detail

public void validate() throws InvalidPropertyException
部署工具可以调用此方法验证端点部署者提供的所有激活配置信息。这有助于更早地捕获激活配置错误，无需等到端点激活时间验证配置。此自我验证检查行为的实现是可选的。
Throws InvalidPropertyException: 指示无效的配置属性设置。
英文文档：

validate

void validate()
              throws InvalidPropertyException
This method may be called by a deployment tool to validate the overall activation configuration information provided by the endpoint deployer. This helps to catch activation configuration errors earlier on without having to wait until endpoint activation time for configuration validation. The implementation of this self-validation check behavior is optional.

Throws:
InvalidPropertyException - indicates invalid configuration property settings.
InvalidPropertyException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BootstrapContext (Java EE 5)

javax.resource.spi
Interface BootstrapContext

public interface BootstrapContext

此类提供一种机制，可以在引导资源适配器实例时将引导上下文传递给该资源适配器实例。引导资源适配器实例也就是对 ResourceAdapter 类调用 (start(BootstrapContext)) 方法。引导上下文包含对资源适配器实例可以使用的有用工具的引用。
version 1.0
英文文档：

This provides a mechanism to pass a bootstrap context to a resource adapter instance when it is bootstrapped. That is, when (start(BootstrapContext)) method on the ResourceAdapter class is invoked. The bootstrap context contains references to useful facilities that could be used by the resource adapter instance.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
Timer | createTimer() Creates a new java.util.Timer instance.
WorkManager | getWorkManager() Provides a handle to a WorkManager instance.
XATerminator | getXATerminator() Provides a handle to a XATerminator instance.

Method Detail

public WorkManager getWorkManager()
提供 WorkManager 实例的一个句柄。资源适配器可以使用 WorkManager 实例完成它的工作（通过提交 Work 实例以便执行）。
return 一个 WorkManager 实例。
英文文档：

getWorkManager

WorkManager getWorkManager()
Provides a handle to a WorkManager instance. The WorkManager instance could be used by a resource adapter to do its work by submitting Work instances for execution.

Returns:
a WorkManager instance.

public XATerminator getXATerminator()
提供 XATerminator 实例的一个句柄。资源适配器可以使用 XATerminator 实例传入 EIS 的事务完成和崩溃恢复调用。
return 一个 XATerminator 实例。
英文文档：

getXATerminator

XATerminator getXATerminator()
Provides a handle to a XATerminator instance. The XATerminator instance could be used by a resource adapter to flow-in transaction completion and crash recovery calls from an EIS.

Returns:
a XATerminator instance.

public java.util.Timer createTimer() throws UnavailableException
创建一个新的 java.util.Timer 实例。Timer 实例可以用来执行定期的 Work 执行或其他任务。
Throws | UnavailableException: 指示 Timer 实例不可用。可以随后重试该请求。
return | 新的 Timer 实例。
英文文档：

createTimer

Timer createTimer()
                  throws UnavailableException
Creates a new java.util.Timer instance. The Timer instance could be used to perform periodic Work executions or other tasks.

Returns:
a new Timer instance.
Throws:
UnavailableException - indicates that a Timer instance is not available. The request may be retried later.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionEventListener (Java EE 5)

javax.resource.spi
Interface ConnectionEventListener

All Superinterfaces:
EventListener
public interface ConnectionEventListener
extends EventListener

Implements: java.util.EventListener

ConnectionEventListener 接口提供一个事件回调机制，使应用服务器能够接收 ManagedConnection 实例的通知。

应用服务器使用这些事件通知管理其连接池，以清除任何无效或已终止的连接以及管理本地事务。

应用服务器实现 ConnectionEventListener 接口。它使用 ManagedConnection.addConnectionEventListener 方法向 ManagedConnection 实例注册连接侦听器。

version | 0.5
See also | javax.resource.spi.ConnectionEvent
英文文档：

The ConnectionEventListener interface provides an event callback mechanism to enable an application server to receive notifications from a ManagedConnection instance.

An application server uses these event notifications to manage its connection pool, to clean up any invalid or terminated connections and to manage local transactions.

An application server implements the ConnectionEventListener interface. It registers a connection listener with a ManagedConnection instance by using ManagedConnection.addConnectionEventListener method.

Version:
0.5
Author:
Rahul Sharma
See Also:
ConnectionEvent

Method Summary
void | connectionClosed(ConnectionEvent event) Notifies that an application component has closed the connection.
void | connectionErrorOccurred(ConnectionEvent event) Notifies a connection related error.
void | localTransactionCommitted(ConnectionEvent event) Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance.
void | localTransactionRolledback(ConnectionEvent event) Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance.
void | localTransactionStarted(ConnectionEvent event) Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance.

Method Detail

public void connectionClosed(ConnectionEvent event)
通知应用程序组件已关闭连接。

ManagedConnection 实例在应用程序组件关闭连接句柄时调用 ConnectionEventListener.connectionClosed 方法通知其注册的侦听器集合。应用服务器使用此连接关闭事件，以将 ManagedConnection 实例放回连接池。

event 描述事件源的事件对象
英文文档：

connectionClosed

void connectionClosed(ConnectionEvent event)
Notifies that an application component has closed the connection.

A ManagedConnection instance notifies its registered set of listeners by calling ConnectionEventListener.connectionClosed method when an application component closes a connection handle. The application server uses this connection close event to put the ManagedConnection instance back in to the connection pool.

Parameters:
event - event object describing the source of the event

public void localTransactionStarted(ConnectionEvent event)
通知 ManagedConnection 实例上已启动资源管理器本地事务。
event 描述事件源的事件对象
英文文档：

localTransactionStarted

void localTransactionStarted(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance.

Parameters:
event - event object describing the source of the event

public void localTransactionCommitted(ConnectionEvent event)
通知 ManagedConnection 实例上已提交资源管理器本地事务。
event 描述事件源的事件对象
英文文档：

localTransactionCommitted

void localTransactionCommitted(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance.

Parameters:
event - event object describing the source of the event

public void localTransactionRolledback(ConnectionEvent event)
通知 ManagedConnection 实例上已回滚资源管理器本地事务。
event 描述事件源的事件对象
英文文档：

localTransactionRolledback

void localTransactionRolledback(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance.

Parameters:
event - event object describing the source of the event

public void connectionErrorOccurred(ConnectionEvent event)
通知与连接有关的错误。 ManagedConnection 实例调用 ConnectionEventListener.connectionErrorOccurred 方法通知其注册的侦听器发生了与物理连接有关的错误。事件通知发生在资源适配器对使用连接句柄向应用程序组件抛出异常之前。 connectionErrorOccurred 方法指示关联的 ManagedConnection 实例当前无效并且不能使用。应用服务器处理连接错误事件通知的方式如下：先启动特定于应用服务器的清除（例如，从连接池中移除 ManagedConnection 实例），然后调用 ManagedConnection.destroy 方法销毁物理连接。
event 描述事件源的事件对象
英文文档：

connectionErrorOccurred

void connectionErrorOccurred(ConnectionEvent event)
Notifies a connection related error. The ManagedConnection instance calls the method ConnectionEventListener.connectionErrorOccurred to notify its registered listeners of the occurrence of a physical connection-related error. The event notification happens just before a resource adapter throws an exception to the application component using the connection handle. The connectionErrorOccurred method indicates that the associated ManagedConnection instance is now invalid and unusable. The application server handles the connection error event notification by initiating application server-specific cleanup (for example, removing ManagedConnection instance from the connection pool) and then calling ManagedConnection.destroy method to destroy the physical connection.

Parameters:
event - event object describing the source of the event
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionManager (Java EE 5)

javax.resource.spi
Interface ConnectionManager

All Superinterfaces:
Serializable
public interface ConnectionManager
extends Serializable

Implements: java.io.Serializable

ConnectionManager 接口为资源适配器提供挂钩，用于将连接请求传递给应用服务器。

应用服务器提供 ConnectionManager 接口的实现。此实现不特定于任何特殊类型的资源适配器或连接工厂接口。

ConnectionManager 实现委托给应用服务器，使之随后能提供服务质量 (QoS) - 安全、连接池管理、事务管理和错误日志记录/跟踪。

应用服务器采用常规方法实现这些服务，与任何资源适配器和特定于 EIS 的机制无关。连接器架构不指定应用服务器实现这些服务的方式；实现是特定于应用服务器的。

应用服务器与其服务挂钩之后，将连接请求委托给 ManagedConnectionFactory 实例，以便创建新的物理连接或者匹配已经存在的物理连接。

ConnectionManager 接口的实现类需要实现 java.io.Serializable 接口。

在非托管应用程序情况下，ConnectionManager 实现类可以由资源适配器（作为默认的 ConnectionManager 实现）提供，也可以由应用程序开发人员提供。在这两种情况下，第三方供应商都可以将 QOS 作为组件提供。

since | 0.6
See also | javax.resource.spi.ManagedConnectionFactory
英文文档：

ConnectionManager interface provides a hook for the resource adapter to pass a connection request to the application server.

An application server provides implementation of the ConnectionManager interface. This implementation is not specific to any particular type of the resource adapter or connection factory interface.

The ConnectionManager implementation delegates to the application server to enable latter to provide quality of services (QoS) - security, connection pool management, transaction management and error logging/tracing.

An application server implements these services in a generic manner, independent of any resource adapter and EIS specific mechanisms. The connector architecture does not specify how an application server implements these services; the implementation is specific to an application server.

After an application server hooks-in its services, the connection request gets delegated to a ManagedConnectionFactory instance either for the creation of a new physical connection or for the matching of an already existing physical connection.

An implementation class for ConnectionManager interface is required to implement the java.io.Serializable interface.

In the non-managed application scenario, the ConnectionManager implementation class can be provided either by a resource adapter (as a default ConnectionManager implementation) or by application developers. In both cases, QOS can be provided as components by third party vendors.

Since:
0.6
Author:
Rahul Sharma
See Also:
ManagedConnectionFactory

Method Summary
 Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo)
The method allocateConnection gets called by the resource adapter's connection factory instance.

Method Detail

public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException

方法 allocateConnection 由资源适配器的连接工厂实例调用。这允许连接工厂实例（由资源适配器提供）将连接请求传递给 ConnectionManager 实例。

connectionRequestInfo 参数表示特定于用于处理连接请求的资源适配器的信息。

mcf | 应用服务器用来委托连接匹配/创建
cxRequestInfo | 连接请求信息
return | 连接特定于 EIS 的连接接口的句柄。
Throws | ResourceException: 一般异常
Throws | ApplicationServerInternalException: 特定于应用服务器的异常
Throws | SecurityException: 与安全有关的错误
Throws | ResourceAllocationException: 无法为连接请求分配系统资源
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况
英文文档：

allocateConnection

Object allocateConnection(ManagedConnectionFactory mcf,
                          ConnectionRequestInfo cxRequestInfo)
                          throws ResourceException

The method allocateConnection gets called by the resource adapter's connection factory instance. This lets connection factory instance (provided by the resource adapter) pass a connection request to the ConnectionManager instance.

The connectionRequestInfo parameter represents information specific to the resource adapter for handling of the connection request.

Parameters:
mcf - used by application server to delegate connection matching/creation
cxRequestInfo - connection request Information
Returns:
connection handle with an EIS specific connection interface.
Throws:
ResourceException - Generic exception
ApplicationServerInternalException - Application server specific exception
SecurityException - Security related error
ResourceAllocationException - Failed to allocate system resources for connection request
ResourceAdapterInternalException - Resource adapter related error condition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionRequestInfo (Java EE 5)

javax.resource.spi
Interface ConnectionRequestInfo

public interface ConnectionRequestInfo

ConnectionRequestInfo 接口使资源适配器能够跨连接请求流传递其特定于请求的数据结构。资源适配器扩展此空接口，以支持其连接请求的数据结构。

通常使用允许资源适配器处理应用程序组件指定的每个连接请求属性（例如，客户端 ID、语言）。应用服务器将这些属性传回给对资源适配器调用的 match/createManagedConnection。在连接请求流期间，这些属性对于应用服务器来说仍然是不透明的。

当 ConnectionRequestInfo 到达 ManagedConnectionFactory 实例上的 match/createManagedConnection 方法之后，资源适配器使用在每个请求上附加的此信息创建连接和进行匹配。

version | 0.8
See also | javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ManagedConnection
英文文档：

The ConnectionRequestInfo interface enables a resource adapter to pass its own request specific data structure across the connection request flow. A resource adapter extends the empty interface to supports its own data structures for connection request.

A typical use allows a resource adapter to handle application component specified per-connection request properties (example - client ID, language). The application server passes these properties back across to match/createManagedConnection calls on the resource adapter. These properties remain opaque to the application server during the connection request flow.

Once the ConnectionRequestInfo reaches match/createManagedConnection methods on the ManagedConnectionFactory instance, resource adapter uses this additional per-request information to do connection creation and matching.

Version:
0.8
Author:
Rahul Sharma
See Also:
ManagedConnectionFactory, ManagedConnection

Method Summary
boolean | equals(Object other) Checks whether this instance is equal to another.
int | hashCode() Returns the hashCode of the ConnectionRequestInfo.

Method Detail

public boolean equals(Object other)
检查此实例是否等于另一个实例。由于 connectionRequestInfo 是特定于资源适配器定义的，因此资源适配器需要实现此方法。质量情况特定于资源适配器。
return 如果两个实例相等，则返回 true。
英文文档：

equals

boolean equals(Object other)
Checks whether this instance is equal to another. Since connectionRequestInfo is defined specific to a resource adapter, the resource adapter is required to implement this method. The conditions for equality are specific to the resource adapter.

Overrides:
equals in class Object
Returns:
True if the two instances are equal.

public int hashCode()
返回 ConnectionRequestInfo 的哈希码。
return 此实例的哈希码
英文文档：

hashCode

int hashCode()
Returns the hashCode of the ConnectionRequestInfo.

Overrides:
hashCode in class Object
Returns:
hash code os this instance
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DissociatableManagedConnection (Java EE 5)

javax.resource.spi
Interface DissociatableManagedConnection

public interface DissociatableManagedConnection

这是一个混合接口，ManagedConnection 实现可以有选择的实现。此接口的实现必须支持延时连接关联优化。
version 1.0
英文文档：

This is a mix-in interface that may be optionally implemented by a ManagedConnection implementation. An implementation of this interface must support the lazy connection association optimization.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
 void dissociateConnections()
This method is called by an application server (that is capable of lazy connection association optimization) in order to dissociate a ManagedConnection instance from all of its connection handles.

Method Detail

public void dissociateConnections() throws ResourceException
此方法由应用服务器（能够进行延时连接关联优化）调用，以便取消 ManagedConnection 实例与其所有连接句柄的关联。
Throws | ResourceException: 如果执行操作失败，则抛出一般异常。
Throws | ResourceAdapterInternalException: 资源适配器内部错误情况
Throws | IllegalStateException: 调用连接清除时处于非法状态。例如，如果正在进行不允许清除连接的 localtransaction 操作。
英文文档：

dissociateConnections

void dissociateConnections()
                           throws ResourceException
This method is called by an application server (that is capable of lazy connection association optimization) in order to dissociate a ManagedConnection instance from all of its connection handles.

Throws:
ResourceException - generic exception if operation fails.
ResourceAdapterInternalException - resource adapter internal error condition
IllegalStateException - Illegal state for calling connection cleanup. Example - if a localtransaction is in progress that doesn't allow connection cleanup.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LazyAssociatableConnectionManager (Java EE 5)

javax.resource.spi
Interface LazyAssociatableConnectionManager

public interface LazyAssociatableConnectionManager

这是一个混合接口，ConnectionManager 实现可以有选择地实现。此接口的实现必须支持延时连接关联优化。
version 1.0
英文文档：

This is a mix-in interface that may be optionally implemented by a ConnectionManager implementation. An implementation of this interface must support the lazy connection association optimization.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
 void associateConnection(Object connection, ManagedConnectionFactory mcf, ConnectionRequestInfo cxReqInfo)
This method is called by a resource adapter (that is capable of lazy connection association optimization) in order to lazily associate a connection object with a ManagedConnection instance.

Method Detail

public void associateConnection(Object connection, ManagedConnectionFactory mcf, ConnectionRequestInfo cxReqInfo) throws ResourceException
此方法由资源适配器（能够进行延时连接关联优化）调用，以便延时将连接对象与 ManagedConnection 实例关联。
connection | 要关联的连接对象。
mcf | 最初用于创建连接对象的 ManagedConnectionFactory 实例。
cxReqInfo | 连接请求信息。该信息必须与最初用来创建连接对象的信息相同。
Throws | ResourceException: 一般异常。
Throws | ApplicationServerInternalException: 特定于应用服务器的异常。
Throws | SecurityException: 与安全有关的错误。
Throws | ResourceAllocationException: 无法为连接请求分配系统资源。
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况。
英文文档：

associateConnection

void associateConnection(Object connection,
                         ManagedConnectionFactory mcf,
                         ConnectionRequestInfo cxReqInfo)
                         throws ResourceException
This method is called by a resource adapter (that is capable of lazy connection association optimization) in order to lazily associate a connection object with a ManagedConnection instance.

Parameters:
connection - the connection object that is to be associated.
mcf - The ManagedConnectionFactory instance that was originally used to create the connection object.
cxReqInfo - connection request information. This information must be the same as that used to originally create the connection object.
Throws:
ResourceException - Generic exception.
ApplicationServerInternalException - Application server specific exception.
SecurityException - Security related error.
ResourceAllocationException - Failed to allocate system resources for connection request.
ResourceAdapterInternalException - Resource adapter related error condition.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LazyEnlistableConnectionManager (Java EE 5)

javax.resource.spi
Interface LazyEnlistableConnectionManager

public interface LazyEnlistableConnectionManager

这是一个混合接口，ConnectionManager 实现可以有选择地实现。此接口的实现必须支持延时事务登记 (enlistment) 优化。
version 1.0
英文文档：

This is a mix-in interface that may be optionally implemented by a ConnectionManager implementation. An implementation of this interface must support the lazy transaction enlistment optimization.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
 void lazyEnlist(ManagedConnection mc)
This method is called by a resource adapter (that is capable of lazy transaction enlistment optimization) in order to lazily enlist a connection object with a XA transaction.

Method Detail

public void lazyEnlist(ManagedConnection mc) throws ResourceException
此方法由资源适配器（能够进行延时事务登记优化）调用，以便使用 XA 事务延时登记连接对象。
mc | 需要延时关联的 ManagedConnection 实例。
Throws | ResourceException: 一般异常。
Throws | ApplicationServerInternalException: 特定于应用服务器的异常。
Throws | ResourceAllocationException: 无法为连接请求分配系统资源。
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况。
英文文档：

lazyEnlist

void lazyEnlist(ManagedConnection mc)
                throws ResourceException
This method is called by a resource adapter (that is capable of lazy transaction enlistment optimization) in order to lazily enlist a connection object with a XA transaction.

Parameters:
mc - The ManagedConnection instance that needs to be lazily associated.
Throws:
ResourceException - Generic exception.
ApplicationServerInternalException - Application server specific exception.
ResourceAllocationException - Failed to allocate system resources for connection request.
ResourceAdapterInternalException - Resource adapter related error condition.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LazyEnlistableManagedConnection (Java EE 5)

javax.resource.spi
Interface LazyEnlistableManagedConnection

public interface LazyEnlistableManagedConnection

这是一个混合接口，ManagedConnection 实现可以有选择地实现。此接口的实现必须支持延时事务登记 (enlistment) 优化。
version 1.0
英文文档：

This is a mix-in interface that may be optionally implemented by a ManagedConnection implementation. An implementation of this interface must support the lazy transaction enlistment optimization.

Version:
1.0
Author:
Ram Jeyaraman

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalTransaction (Java EE 5)

javax.resource.spi
Interface LocalTransaction

public interface LocalTransaction

LocalTransaction 为资源管理器本地事务定义事务划分接口。注意，此接口用于应用程序级别的本地事务划分。容器使用系统协定级别 LocalTransaction 接口（在 javax.resource.spi 包中定义）进行本地事务管理。

本地事务在资源管理器内部管理。在协调此类事务时不涉及外部事务管理器。

CCI 实现可以（但不需要）实现 LocalTransaction 接口。如果 CCI 实现支持 LocalTransaction 接口，则方法 Connection.getLocalTransaction 应该返回一个 LocalTransaction 实例。然后组件可以使用返回的 LocalTransaction 在底层 EIS 实例上划分资源管理器本地事务（与 Connection 实例关联）。

since | 0.8
See also | javax.resource.cci.Connection
英文文档：

LocalTransaction interface provides support for transactions that are managed internal to an EIS resource manager, and do not require an external transaction manager.

A resource adapter implements the javax.resource.spi.LocalTransaction interface to provide support for local transactions that are performed on the underlying resource manager.

If a resource adapter supports the LocalTransaction interface, then the application server can choose to perform local transaction optimization (uses local transaction instead of a JTA transaction for a single resource manager case).

Version:
0.5
Author:
Rahul Sharma
See Also:
ManagedConnection

Method Summary
void | begin() Begin a local transaction
void | commit() Commit a local transaction
void | rollback() Rollback a local transaction

Method Detail

public void begin() throws ResourceException
在 EIS 实例上开始一个本地事务。
Throws ResourceException: 无法开始本地事务。错误情况的示例有：
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 连接已参与本地或 JTA 事务
英文文档：

begin

void begin()
           throws ResourceException
Begin a local transaction

Throws:
ResourceException - generic exception if operation fails
LocalTransactionException - error condition related to local transaction management
ResourceAdapterInternalException - error condition internal to resource adapter
EISSystemException - EIS instance specific error condition

public void commit() throws ResourceException
提交当前的本地事务并释放由底层 EIS 实例包含的所有锁。
Throws ResourceException: 无法提交本地事务。错误情况的示例有：
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 违反完整性约束、死锁检测、事务完成期间的通信故障、任何重试要求。
  • 连接参与到活动的 JTA 事务中
  • 无效的事务上下文；在不带活动事务上下文的情况下调用了提交操作
英文文档：

commit

void commit()
            throws ResourceException
Commit a local transaction

Throws:
ResourceException - generic exception if operation fails
LocalTransactionException - error condition related to local transaction management
ResourceAdapterInternalException - error condition internal to resource adapter
EISSystemException - EIS instance specific error condition

public void rollback() throws ResourceException
回滚当前资源管理器本地事务。
Throws ResourceException: 无法回滚本地事务。错误情况的示例有：
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 连接参与到活动的 JTA 事务中
  • 无效的事务上下文；在不带活动事务上下文的情况下调用了回滚操作
英文文档：

rollback

void rollback()
              throws ResourceException
Rollback a local transaction

Throws:
ResourceException - generic exception if operation fails
LocalTransactionException - error condition related to local transaction management
ResourceAdapterInternalException - error condition internal to resource adapter
EISSystemException - EIS instance specific error condition
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedConnection (Java EE 5)

javax.resource.spi
Interface ManagedConnection

public interface ManagedConnection

ManagedConnection 实例表示与底层 EIS 的物理连接。

ManagedConnection 实例提供对两个接口的访问：javax.transaction.xa.XAResource 和 javax.resource.spi.LocalTransaction。

事务管理器使用 XAResource 接口关联（取消关联）事务与底层 EIS 资源管理器实例，并执行两阶段提交协议。事务管理器不能直接使用 ManagedConnection 接口。有关 XAResource 接口的更多详细信息在 JTA 规范中描述。

应用服务器使用 LocalTransaction 接口管理本地事务。

version | 0.5
See also | javax.resource.spi.ManagedConnectionFactory, javax.transaction.xa.XAResource, javax.resource.spi.LocalTransaction
英文文档：

ManagedConnection instance represents a physical connection to the underlying EIS.

A ManagedConnection instance provides access to a pair of interfaces: javax.transaction.xa.XAResource and javax.resource.spi.LocalTransaction.

XAResource interface is used by the transaction manager to associate and dissociate a transaction with the underlying EIS resource manager instance and to perform two-phase commit protocol. The ManagedConnection interface is not directly used by the transaction manager. More details on the XAResource interface are described in the JTA specification.

The LocalTransaction interface is used by the application server to manage local transactions.

Version:
0.5
Author:
Rahul Sharma
See Also:
ManagedConnectionFactory, XAResource, LocalTransaction

Method Summary
void | addConnectionEventListener(ConnectionEventListener listener) Adds a connection event listener to the ManagedConnection instance.
void | associateConnection(Object connection) Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance.
void | cleanup() Application server calls this method to force any cleanup on the ManagedConnection instance.
void | destroy() Destroys the physical connection to the underlying resource manager.
Object | getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance.
LocalTransaction | getLocalTransaction() Returns an javax.resource.spi.LocalTransaction instance.
PrintWriter | getLogWriter() Gets the log writer for this ManagedConnection instance.
ManagedConnectionMetaData | getMetaData() Gets the metadata information for this connection's underlying EIS resource manager instance.
XAResource | getXAResource() Returns an javax.transaction.xa.XAresource instance.
void | removeConnectionEventListener(ConnectionEventListener listener) Removes an already registered connection event listener from the ManagedConnection instance.
void | setLogWriter(PrintWriter out) Sets the log writer for this ManagedConnection instance.

Method Detail

public Object getConnection(javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
为 ManagedConnection 实例表示的底层物理连接创建一个新的连接句柄。应用程序代码使用此连接句柄引用底层物理连接。采用特定于资源适配器实现的方法，将此连接句柄与其 ManagedConnection 实例关联。

ManagedConnection 使用 Subject 和其他 ConnectionRequest 信息（特定于资源适配器并且对应用服务器不透明）设置物理连接的状态。

subject | 作为 JAAS 主体的安全上下文
cxRequestInfo | ConnectionRequestInfo 实例
return | 表示连接句柄的一般 Object 实例。对于 CCI，ManagedConnection 实例创建的连接句柄的类型为 javax.resource.cci.Connection。
Throws | ResourceException: 如果操作失败，则抛出此一般异常
Throws | ResourceAdapterInternalException: 资源适配器内部错误情况
Throws | SecurityException: 与安全有关的错误情况
Throws | CommException: 与 EIS 实例的通信失败
Throws | EISSystemException: EIS 实例中的内部错误情况（在 EIS 实例涉及设置 ManagedConnection 的状态时使用）
英文文档：

getConnection

Object getConnection(Subject subject,
                     ConnectionRequestInfo cxRequestInfo)
                     throws ResourceException
Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance. This connection handle is used by the application code to refer to the underlying physical connection. This connection handle is associated with its ManagedConnection instance in a resource adapter implementation specific way.

The ManagedConnection uses the Subject and additional ConnectionRequest Info (which is specific to resource adapter and opaque to application server) to set the state of the physical connection.

Parameters:
subject - security context as JAAS subject
cxRequestInfo - ConnectionRequestInfo instance
Returns:
generic Object instance representing the connection handle. For CCI, the connection handle created by a ManagedConnection instance is of the type javax.resource.cci.Connection.
Throws:
ResourceException - generic exception if operation fails
ResourceAdapterInternalException - resource adapter internal error condition
SecurityException - security related error condition
CommException - failed communication with EIS instance
EISSystemException - internal error condition in EIS instance - used if EIS instance is involved in setting state of ManagedConnection

public void destroy() throws ResourceException
销毁与底层资源管理器的物理连接。

为了管理连接池的大小，应用服务器可以显式调用 ManagedConnection.destroy 销毁物理连接。当调用 destroy 方法时，资源适配器应该销毁为此 ManagedConnection 实例分配的所有系统资源。

Throws | ResourceException: 如果操作失败，则抛出此一般异常
Throws | IllegalStateException: 销毁连接时处于非法状态
英文文档：

destroy

void destroy()
             throws ResourceException
Destroys the physical connection to the underlying resource manager.

To manage the size of the connection pool, an application server can explictly call ManagedConnection.destroy to destroy a physical connection. A resource adapter should destroy all allocated system resources for this ManagedConnection instance when the method destroy is called.

Throws:
ResourceException - generic exception if operation failed
IllegalStateException - illegal state for destroying connection

public void cleanup() throws ResourceException
应用服务器调用此方法强制在 ManagedConnection 实例上执行清除。

方法 ManagedConnection.cleanup 启动 ManagedConnection 实例维护的任何特定于客户端的状态的清除。清除应该使使用此 ManagedConnection 实例创建的所有连接句柄无效。清除底层 ManagedConnection 之后，应用程序组件使用连接句柄的任何尝试都将导致异常。

清除 ManagedConnection 总是由应用服务器驱动。还存在正在进行的未完成事务（与 ManagedConnection 实例关联）时，应用服务器不应该调用 ManagedConnection.cleanup。

对已经清除的连接调用 ManagedConnection.cleanup 方法不应该抛出异常。

清除 ManagedConnection 实例将重置其特定于客户端的状态，并准备好将连接放回到连接池中。cleanup 方法不应该使资源适配器关闭物理管道并回收与物理连接关联的系统资源。

Throws | ResourceException: 如果操作失败，则抛出此一般异常
Throws | ResourceAdapterInternalException: 资源适配器内部错误情况
Throws | IllegalStateException: 调用连接清除时处于非法状态。例如，如果正在进行不允许清除连接的 localtransaction 操作。
英文文档：

cleanup

void cleanup()
             throws ResourceException
Application server calls this method to force any cleanup on the ManagedConnection instance.

The method ManagedConnection.cleanup initiates a cleanup of the any client-specific state as maintained by a ManagedConnection instance. The cleanup should invalidate all connection handles that had been created using this ManagedConnection instance. Any attempt by an application component to use the connection handle after cleanup of the underlying ManagedConnection should result in an exception.

The cleanup of ManagedConnection is always driven by an application server. An application server should not invoke ManagedConnection.cleanup when there is an uncompleted transaction (associated with a ManagedConnection instance) in progress.

The invocation of ManagedConnection.cleanup method on an already cleaned-up connection should not throw an exception.

The cleanup of ManagedConnection instance resets its client specific state and prepares the connection to be put back in to a connection pool. The cleanup method should not cause resource adapter to close the physical pipe and reclaim system resources associated with the physical connection.

Throws:
ResourceException - generic exception if operation fails
ResourceAdapterInternalException - resource adapter internal error condition
IllegalStateException - Illegal state for calling connection cleanup. Example - if a localtransaction is in progress that doesn't allow connection cleanup

public void associateConnection(Object connection) throws ResourceException
容器使用此方法更改应用程序级别的连接句柄与 ManagedConneciton 实例的关联。容器应该查找正确的 ManagedConnection 实例并调用 associateConnection 方法。

资源适配器需要实现 associateConnection 方法。ManagedConnection 的方法实现应该取消连接句柄（作为参数传递）与当前关联 ManagedConnection 之间的关联，并将自身与新的连接句柄关联。

connection | 应用程序级别的连接句柄
Throws | ResourceException: 无法将连接句柄与此 ManagedConnection 实例关联
Throws | IllegalStateException: 调用此方法时处于非法状态
Throws | ResourceAdapterInternalException: 资源适配器内部错误情况
英文文档：

associateConnection

void associateConnection(Object connection)
                         throws ResourceException
Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance. The container should find the right ManagedConnection instance and call the associateConnection method.

The resource adapter is required to implement the associateConnection method. The method implementation for a ManagedConnection should dissociate the connection handle (passed as a parameter) from its currently associated ManagedConnection and associate the new connection handle with itself.

Parameters:
connection - Application-level connection handle
Throws:
ResourceException - Failed to associate the connection handle with this ManagedConnection instance
IllegalStateException - Illegal state for invoking this method
ResourceAdapterInternalException - Resource adapter internal error condition

public void addConnectionEventListener(ConnectionEventListener listener)
向 ManagedConnection 实例添加一个连接事件侦听器。

向已注册 ConnectionEventListener 实例通知连接关闭和错误事件，以及 ManagedConnection 上与本地事务相关的事件。

listener 要注册的新 ConnectionEventListener
英文文档：

addConnectionEventListener

void addConnectionEventListener(ConnectionEventListener listener)
Adds a connection event listener to the ManagedConnection instance.

The registered ConnectionEventListener instances are notified of connection close and error events, also of local transaction related events on the Managed Connection.

Parameters:
listener - a new ConnectionEventListener to be registered

public void removeConnectionEventListener(ConnectionEventListener listener)
从 ManagedConnection 实例中移除已经注册的连接事件侦听器。
listener 要移除的已注册连接事件侦听器
英文文档：

removeConnectionEventListener

void removeConnectionEventListener(ConnectionEventListener listener)
Removes an already registered connection event listener from the ManagedConnection instance.

Parameters:
listener - already registered connection event listener to be removed

public XAResource getXAResource() throws ResourceException
返回一个 javax.transaction.xa.XAresource 实例。如果由事务管理器协调的 JTA 事务中正在使用 ManagedConnection 实例，则应用服务器使用事务管理器添加此 XAResource 实例。
return | XAResource 实例
Throws | ResourceException: 如果操作失败，则抛出此一般异常
Throws | NotSupportedException: 如果不支持该操作
Throws | ResourceAdapterInternalException: 资源适配器内部错误情况
英文文档：

getXAResource

XAResource getXAResource()
                         throws ResourceException
Returns an javax.transaction.xa.XAresource instance. An application server enlists this XAResource instance with the Transaction Manager if the ManagedConnection instance is being used in a JTA transaction that is being coordinated by the Transaction Manager.

Returns:
XAResource instance
Throws:
ResourceException - generic exception if operation fails
NotSupportedException - if the operation is not supported
ResourceAdapterInternalException - resource adapter internal error condition

public LocalTransaction getLocalTransaction() throws ResourceException
返回一个 javax.resource.spi.LocalTransaction 实例。容器使用 LocalTransaction 接口管理 RM 实例的本地事务。
return | LocalTransaction 实例
Throws | ResourceException: 如果操作失败，则抛出此一般异常
Throws | NotSupportedException: 如果不支持该操作
Throws | ResourceAdapterInternalException: 资源适配器内部错误情况
英文文档：

getLocalTransaction

LocalTransaction getLocalTransaction()
                                     throws ResourceException
Returns an javax.resource.spi.LocalTransaction instance. The LocalTransaction interface is used by the container to manage local transactions for a RM instance.

Returns:
LocalTransaction instance
Throws:
ResourceException - generic exception if operation fails
NotSupportedException - if the operation is not supported
ResourceAdapterInternalException - resource adapter internal error condition

public ManagedConnectionMetaData getMetaData() throws ResourceException

获取此连接的底层 EIS 资源管理器实例的元数据信息。ManagedConnectionMetaData 接口提供与 ManagedConenction 实例关联的底层 EIS 实例的有关信息。

return | ManagedConnectionMetaData 实例
Throws | ResourceException: 如果操作失败，则抛出此一般异常
Throws | NotSupportedException: 如果不支持该操作
英文文档：

getMetaData

ManagedConnectionMetaData getMetaData()
                                      throws ResourceException

Gets the metadata information for this connection's underlying EIS resource manager instance. The ManagedConnectionMetaData interface provides information about the underlying EIS instance associated with the ManagedConenction instance.

Returns:
ManagedConnectionMetaData instance
Throws:
ResourceException - generic exception if operation fails
NotSupportedException - if the operation is not supported

public void setLogWriter(java.io.PrintWriter out) throws ResourceException
设置此 ManagedConnection 实例的日志 writer。

日志 writer 是一个字符输出流，此 ManagedConnection 实例的所有记录和跟踪消息都将打印到该输出流。应用服务器根据连接池的需要管理输出流与 ManagedConnection 实例的关联。

开始创建 ManagedConnection 对象时，从 ManagedConnectionFactory 中获取与此实例关联的默认日志 writer。应用服务器可以使用 setLogWriter 方法设置特定于此 ManagedConnection 的日志 writer，以记录/跟踪此实例。

out | 要关联的字符输出流
Throws | ResourceException: 如果操作失败，则抛出此一般异常
Throws | ResourceAdapterInternalException: 与资源适配器相关的错误情况
英文文档：

setLogWriter

void setLogWriter(PrintWriter out)
                  throws ResourceException
Sets the log writer for this ManagedConnection instance.

The log writer is a character output stream to which all logging and tracing messages for this ManagedConnection instance will be printed. Application Server manages the association of output stream with the ManagedConnection instance based on the connection pooling requirements.

When a ManagedConnection object is initially created, the default log writer associated with this instance is obtained from the ManagedConnectionFactory. An application server can set a log writer specific to this ManagedConnection to log/trace this instance using setLogWriter method.

Parameters:
out - Character Output stream to be associated
Throws:
ResourceException - generic exception if operation fails
ResourceAdapterInternalException - resource adapter related error condition

public java.io.PrintWriter getLogWriter() throws ResourceException
获取此 ManagedConnection 实例的日志 writer。

日志 writer 是一个字符输出流，此 ManagedConnection 实例的所有记录和跟踪消息都将打印到该输出流。ConnectionManager 根据连接池的需要管理输出流与 ManagedConnection 实例的关联。

与 ManagedConnection 实例关联的日志 writer 可以是 ManagedConnectionFactory（创建此连接）的默认设置，也可以是应用服务器专门为此实例设置的 writer。

return | 与此 ManagedConnection 实例关联的字符输出流
Throws | ResourceException: 如果操作失败，则抛出此一般异常
英文文档：

getLogWriter

PrintWriter getLogWriter()
                         throws ResourceException
Gets the log writer for this ManagedConnection instance.

The log writer is a character output stream to which all logging and tracing messages for this ManagedConnection instance will be printed. ConnectionManager manages the association of output stream with the ManagedConnection instance based on the connection pooling requirements.

The Log writer associated with a ManagedConnection instance can be one set as default from the ManagedConnectionFactory (that created this connection) or one set specifically for this instance by the application server.

Returns:
Character ourput stream associated with this Managed- Connection instance
Throws:
ResourceException - generic exception if operation fails
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedConnectionFactory (Java EE 5)

javax.resource.spi
Interface ManagedConnectionFactory

All Superinterfaces:
Serializable
public interface ManagedConnectionFactory
extends Serializable

Implements: java.io.Serializable

ManagedConnectionFactory 实例是 ManagedConnection 和特定于 EIS 连接工厂实例的工厂。此接口提供匹配和创建 ManagedConnection 实例的方法，以支持连接入池。ManagedConnectionFactory 实例必须是 JavaBean。
version | 0.6
See also | javax.resource.spi.ManagedConnection
英文文档：

ManagedConnectionFactory instance is a factory of both ManagedConnection and EIS-specific connection factory instances. This interface supports connection pooling by providing methods for matching and creation of ManagedConnection instance. A ManagedConnectionFactory instance is required to be a JavaBean.

Version:
0.6
Author:
Rahul Sharma
See Also:
ManagedConnection

Method Summary
Object | createConnectionFactory() Creates a Connection Factory instance.
Object | createConnectionFactory(ConnectionManager cxManager) Creates a Connection Factory instance.
ManagedConnection | createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) Creates a new physical connection to the underlying EIS resource manager.
boolean | equals(Object other) Check if this ManagedConnectionFactory is equal to another ManagedConnectionFactory.
PrintWriter | getLogWriter() Get the log writer for this ManagedConnectionFactory instance.
int | hashCode() Returns the hash code for the ManagedConnectionFactory
ManagedConnection | matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) Returns a matched connection from the candidate set of connections.
void | setLogWriter(PrintWriter out) Set the log writer for this ManagedConnectionFactory instance.

Method Detail

public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
创建一个 Connection Factory 实例。Connection Factory 实例使用传递的 ConnectionManager 进行初始化。在托管情况下，ConnectionManager 由应用服务器提供。
cxManager | 要与创建的 EIS 连接工厂实例关联的 ConnectionManager
return | 特定于 EIS 的 Connection Factory 实例或 javax.resource.cci.ConnectionFactory 实例
Throws | ResourceException: 一般异常
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况
英文文档：

createConnectionFactory

Object createConnectionFactory(ConnectionManager cxManager)
                               throws ResourceException
Creates a Connection Factory instance. The Connection Factory instance gets initialized with the passed ConnectionManager. In the managed scenario, ConnectionManager is provided by the application server.

Parameters:
cxManager - ConnectionManager to be associated with created EIS connection factory instance
Returns:
EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
Throws:
ResourceException - Generic exception
ResourceAdapterInternalException - Resource adapter related error condition

public Object createConnectionFactory() throws ResourceException
创建一个 Connection Factory 实例。Connection Factory 实例使用资源适配器提供的默认 ConnectionManager 进行初始化。
return | 特定于 EIS 的 Connection Factory 实例或 javax.resource.cci.ConnectionFactory 实例
Throws | ResourceException: 一般异常
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况
英文文档：

createConnectionFactory

Object createConnectionFactory()
                               throws ResourceException
Creates a Connection Factory instance. The Connection Factory instance gets initialized with a default ConnectionManager provided by the resource adapter.

Returns:
EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
Throws:
ResourceException - Generic exception
ResourceAdapterInternalException - Resource adapter related error condition

public ManagedConnection createManagedConnection(javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
创建一个连接底层 EIS 资源管理器的新物理连接。

ManagedConnectionFactory 使用安全信息（作为 Subject 传递）和其他 ConnectionRequestInfo（特定于 ResourceAdapter 并且对应用服务器不透明）创建此新连接。

subject | 调用者的安全信息
cxRequestInfo | 特定于其他资源适配器的连接请求信息
Throws | ResourceException: 一般异常
Throws | SecurityException: 与安全有关的错误
Throws | ResourceAllocationException: 无法为连接请求分配系统资源
Throws | ResourceAdapterInternalException: 与资源适配器相关的错误情况
Throws | EISSystemException: EIS 实例中的内部错误情况
return | ManagedConnection 实例
英文文档：

createManagedConnection

ManagedConnection createManagedConnection(Subject subject,
                                          ConnectionRequestInfo cxRequestInfo)
                                          throws ResourceException
Creates a new physical connection to the underlying EIS resource manager.

ManagedConnectionFactory uses the security information (passed as Subject) and additional ConnectionRequestInfo (which is specific to ResourceAdapter and opaque to application server) to create this new connection.

Parameters:
subject - Caller's security information
cxRequestInfo - Additional resource adapter specific connection request information
Returns:
ManagedConnection instance
Throws:
ResourceException - generic exception
SecurityException - security related error
ResourceAllocationException - failed to allocate system resources for connection request
ResourceAdapterInternalException - resource adapter related error condition
EISSystemException - internal error condition in EIS instance

public ManagedConnection matchManagedConnections(java.util.Set<E> connectionSet, javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
返回候选连接集中的匹配连接。

ManagedConnectionFactory 使用安全信息（如 Subject 中的信息）、通过 ConnectionRequestInfo 提供的信息以及特定于其他资源适配器的标准执行匹配。注意，用于匹配的标准是特定于资源适配器的，不是 Connector 规范指定的。

此方法返回一个 ManagedConnection 实例，该实例是处理连接分配请求的最佳匹配。

connectionSet | 候选连接集
subject | 调用者的安全信息
cxRequestInfo | 特定于其他资源适配器的连接请求信息
Throws | ResourceException: 一般异常
Throws | SecurityException: 与安全有关的错误
Throws | ResourceAdapterInternalException: 与资源适配器相关的错误情况
Throws | NotSupportedException: 如果不支持该操作
return | 如果资源适配器找到一个可接受的匹配项，则返回 ManagedConnection；否则返回 null
英文文档：

matchManagedConnections

ManagedConnection matchManagedConnections(Set connectionSet,
                                          Subject subject,
                                          ConnectionRequestInfo cxRequestInfo)
                                          throws ResourceException
Returns a matched connection from the candidate set of connections.

ManagedConnectionFactory uses the security info (as in Subject) and information provided through ConnectionRequestInfo and additional Resource Adapter specific criteria to do matching. Note that criteria used for matching is specific to a resource adapter and is not prescribed by the Connector specification.

This method returns a ManagedConnection instance that is the best match for handling the connection allocation request.

Parameters:
connectionSet - candidate connection set
subject - caller's security information
cxRequestInfo - additional resource adapter specific connection request information
Returns:
ManagedConnection if resource adapter finds an acceptable match otherwise null
Throws:
ResourceException - generic exception
SecurityException - security related error
ResourceAdapterInternalException - resource adapter related error condition
NotSupportedException - if operation is not supported

public void setLogWriter(java.io.PrintWriter out) throws ResourceException
设置此 ManagedConnectionFactory 实例的日志 writer。

日志 writer 是一个字符输出流，此 ManagedConnectionfactory 实例的所有记录和跟踪消息都将打印到该输出流。

ApplicationServer 管理输出流与 ManagedConnectionFactory 的关联。创建 ManagedConnectionFactory 对象时，日志 writer 最初为 null，即禁用日志记录。将日志 writer 与 ManagedConnectionFactory 关联之后，将启用 ManagedConnectionFactory 实例的记录和跟踪。

ManagedConnectionFactory 创建的 ManagedConnection 实例“继承”该日志 writer，ApplicationServer 可以使用 ManagedConnection.setLogWriter 将其重写，以设置特定于 ManagedConnection 的记录和跟踪。

out | 一个 PrintWriter，即用于记录错误和跟踪错误的输出流
Throws | ResourceException: 一般异常
Throws | ResourceAdapterInternalException: 与资源适配器相关的错误情况
英文文档：

setLogWriter

void setLogWriter(PrintWriter out)
                  throws ResourceException
Set the log writer for this ManagedConnectionFactory instance.

The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionfactory instance will be printed.

ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled. Once a log writer is associated with a ManagedConnectionFactory, logging and tracing for ManagedConnectionFactory instance is enabled.

The ManagedConnection instances created by ManagedConnectionFactory "inherits" the log writer, which can be overridden by ApplicationServer using ManagedConnection.setLogWriter to set ManagedConnection specific logging and tracing.

Parameters:
out - PrintWriter - an out stream for error logging and tracing
Throws:
ResourceException - generic exception
ResourceAdapterInternalException - resource adapter related error condition

public java.io.PrintWriter getLogWriter() throws ResourceException
获取此 ManagedConnectionFactory 实例的日志 writer。

日志 writer 是一个字符输出流，此 ManagedConnectionFactory 实例的所有记录和跟踪消息都将打印到该输出流。

ApplicationServer 管理输出流与 ManagedConnectionFactory 的关联。创建 ManagedConnectionFactory 对象时，日志 writer 最初为 null，即禁用日志记录。

return
en
PrintWriter
Throws ResourceException: 一般异常
英文文档：

getLogWriter

PrintWriter getLogWriter()
                         throws ResourceException
Get the log writer for this ManagedConnectionFactory instance.

The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionFactory instance will be printed

ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled.

Returns:
PrintWriter
Throws:
ResourceException - generic exception

public int hashCode()
返回 ManagedConnectionFactory 的哈希码
return ManagedConnectionFactory 的哈希码
英文文档：

hashCode

int hashCode()
Returns the hash code for the ManagedConnectionFactory

Overrides:
hashCode in class Object
Returns:
hash code for the ManagedConnectionFactory

public boolean equals(Object other)
检查此 ManagedConnectionFactory 是否等于另一个 ManagedConnectionFactory。
return 如果两个实例相等，则返回 true
英文文档：

equals

boolean equals(Object other)
Check if this ManagedConnectionFactory is equal to another ManagedConnectionFactory.

Overrides:
equals in class Object
Returns:
true if two instances are equal
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ManagedConnectionMetaData (Java EE 5)

javax.resource.spi
Interface ManagedConnectionMetaData

public interface ManagedConnectionMetaData

ManagedConnectionMetaData 接口提供与 ManagedConnection 实例关联的底层 EIS 实例的有关信息。应用服务器使用此信息获取有关连接的 EIS 实例的运行时信息。

方法 ManagedConnection.getMetaData 返回一个 ManagedConnectionMetaData 实例。

version | 0.8
See also | javax.resource.spi.ManagedConnection
英文文档：

The ManagedConnectionMetaData interface provides information about the underlying EIS instance associated with a ManagedConnection instance. An application server uses this information to get runtime information about a connected EIS instance.

The method ManagedConnection.getMetaData returns a ManagedConnectionMetaData instance.

Version:
0.8
Author:
Rahul Sharma
See Also:
ManagedConnection

Method Summary
String | getEISProductName() Returns Product name of the underlying EIS instance connected through the ManagedConnection.
String | getEISProductVersion() Returns product version of the underlying EIS instance connected through the ManagedConnection.
int | getMaxConnections() Returns maximum limit on number of active concurrent connections that an EIS instance can support across client processes.
String | getUserName() Returns name of the user associated with the ManagedConnection instance.

Method Detail

public String getEISProductName() throws ResourceException
返回通过 ManagedConnection 连接的底层 EIS 实例的产品名称。
return EIS 实例的产品名称。
英文文档：

getEISProductName

String getEISProductName()
                         throws ResourceException
Returns Product name of the underlying EIS instance connected through the ManagedConnection.

Returns:
Product name of the EIS instance.
Throws:
ResourceException

public String getEISProductVersion() throws ResourceException
返回通过 ManagedConnection 连接的底层 EIS 实例的产品版本。
return EIS 实例的产品版本
英文文档：

getEISProductVersion

String getEISProductVersion()
                            throws ResourceException
Returns product version of the underlying EIS instance connected through the ManagedConnection.

Returns:
Product version of the EIS instance
Throws:
ResourceException

public int getMaxConnections() throws ResourceException
返回 EIS 实例可以跨客户端过程支持的活动并发连接的最大限制数量。如果 EIS 实例不了解任何此类限制（或没有此类限制），则它返回 0。
return 活动并发连接的最大限制数量
英文文档：

getMaxConnections

int getMaxConnections()
                      throws ResourceException
Returns maximum limit on number of active concurrent connections that an EIS instance can support across client processes. If an EIS instance does not know about (or does not have) any such limit, it returns a 0.

Returns:
Maximum limit for number of active concurrent connections
Throws:
ResourceException

public String getUserName() throws ResourceException
返回与 ManagedConnection 实例关联的用户名称。该名称对应于安全上下文下建立了对 EIS 实例的连接的资源主体。
return 用户名称
英文文档：

getUserName

String getUserName()
                   throws ResourceException
Returns name of the user associated with the ManagedConnection instance. The name corresponds to the resource principal under whose whose security context, a connection to the EIS instance has been established.

Returns:
name of the user
Throws:
ResourceException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAdapter (Java EE 5)

javax.resource.spi
Interface ResourceAdapter

public interface ResourceAdapter

此类代表一个资源适配器实例，并包含生命周期管理和消息端点设置的操作。此接口的具体实现必须是 JavaBean。
version 1.0
英文文档：

This represents a resource adapter instance and contains operations for lifecycle management and message endpoint setup. A concrete implementation of this interface is required to be a JavaBean.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
void | endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) This is called during the activation of a message endpoint.
void | endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) This is called when a message endpoint is deactivated.
XAResource[] | getXAResources(ActivationSpec[] specs) This method is called by the application server during crash recovery.
void | start(BootstrapContext ctx) This is called when a resource adapter instance is bootstrapped.
void | stop() This is called when a resource adapter instance is undeployed or during application server shutdown.

Method Detail

public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
引导资源适配器实例时调用此方法。这可以在资源适配器部署或应用服务器启动期间进行。这是一个来自应用服务器的启动通知，此方法由应用服务器线程调用。应用服务器线程在未指定的上下文中执行。

在此方法调用期间，ResourceAdapter JavaBean 负责初始化资源适配器实例。在此方法调用期间抛出任何异常都会导致应用服务器终止此特定资源适配器实例的引导过程。

ctx | 一个引导上下文，它包含对资源适配器实例可以使用的有用工具的引用。
Throws | ResourceAdapterInternalException: 指示引导失败。该资源适配器实例不能使用，必须丢弃。
英文文档：

start

void start(BootstrapContext ctx)
           throws ResourceAdapterInternalException
This is called when a resource adapter instance is bootstrapped. This may be during resource adapter deployment or application server startup. This is a startup notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context.

During this method call a ResourceAdapter JavaBean is responsible for initializing the resource adapter instance. Any exception thrown during this method call causes the application server to abort the bootstrap procedure for this specific resource adapter instance.

Parameters:
ctx - a bootstrap context containing references to useful facilities that could be used by a resource adapter instance.
Throws:
ResourceAdapterInternalException - indicates bootstrap failure. The resource adapter instance is unusable and must be discarded.

public void stop()
取消部署资源适配器实例或者应用服务器关闭期间调用此方法。这是一个来自应用服务器的关闭通知，此方法由应用服务器线程调用。应用服务器线程在未指定的上下文中执行。

在此方法调用期间，ResourceAdapter JavaBean 负责按顺序关闭资源适配器实例。此方法抛出的任何异常都不能改变导致调用此方法的应用服务器关闭过程或资源适配器取消部署过程。应用服务器可以记录异常信息，用于错误报告。

英文文档：

stop

void stop()
This is called when a resource adapter instance is undeployed or during application server shutdown. This is a shutdown notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context.

During this method call, a ResourceAdapter JavaBean is responsible for performing an orderly shutdown of the resource adapter instance. Any exception thrown by this method call does not alter the processing of the application server shutdown or resource adapter undeployment that caused this method call. The application server may log the exception information for error reporting purposes.

public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
激活消息端点期间调用此方法。这会使资源适配器执行必要的设置（即使用消息提供者设置消息端点的消息传送）。注意，向消息端点传送消息甚至会在此方法返回之前启动。

仅当此方法成功完成且没有抛出任何异常时，端点激活才视为成功。

endpointFactory | 消息端点工厂实例。
spec | 激活的规范 JavaBean 实例。
Throws | NotSupportedException: 指示由于激活设置信息不正确而拒绝消息端点激活。
英文文档：

endpointActivation

void endpointActivation(MessageEndpointFactory endpointFactory,
                        ActivationSpec spec)
                        throws ResourceException
This is called during the activation of a message endpoint. This causes the resource adapter instance to do the necessary setup (ie., setup message delivery for the message endpoint with a message provider). Note that message delivery to the message endpoint might start even before this method returns.

Endpoint activation is deemed successful only when this method completes successfully without throwing any exceptions.

Parameters:
endpointFactory - a message endpoint factory instance.
spec - an activation spec JavaBean instance.
Throws:
NotSupportedException - indicates message endpoint activation rejection due to incorrect activation setup information.
ResourceException

public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
取消激活消息端点时调用此方法。作为此方法调用的参数传递的实例必须与传入相应 endpointActivation 调用的实例相同。这会使资源适配器停止向消息端点传送消息。

忽略此方法抛出的任何异常。调用此方法之后，将该端点视为不活动。

endpointFactory | 消息端点工厂实例。
spec | 激活的规范 JavaBean 实例。
英文文档：

endpointDeactivation

void endpointDeactivation(MessageEndpointFactory endpointFactory,
                          ActivationSpec spec)
This is called when a message endpoint is deactivated. The instances passed as arguments to this method call should be identical to those passed in for the corresponding endpointActivation call. This causes the resource adapter to stop delivering messages to the message endpoint.

Any exception thrown by this method is ignored. After this method call, the endpoint is deemed inactive.

Parameters:
endpointFactory - a message endpoint factory instance.
spec - an activation spec JavaBean instance.

public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
在崩溃恢复期间应用服务器调用此方法。此方法带有一个 ActivationSpec JavaBean 数组，返回一个 XAResource 对象数组，其中每个对象表示一个唯一的资源管理器。 如果资源适配器未实现 XAResource 接口，则返回 null。否则，它必须返回一个 XAResource 对象数组，其中每个对象都表示一个此端点应用程序使用的唯一资源管理器。 应用服务器使用 XAResource 对象查询所需事务列表中的每个资源管理器。然后，它向参与的资源管理器发送提交决定，以完成每个挂起的事务。
specs | 一个 ActivationSpec JavaBean 数组，其中每个 JavaBean 都对应于系统崩溃之前处于活动状态的已部署端点应用程序。
Throws | ResourceException: 如果由于错误情况导致操作失败，则抛出此一般异常。
return | 一个 XAResource 对象数组，其中每个对象都表示一个唯一的资源管理器。
英文文档：

getXAResources

XAResource[] getXAResources(ActivationSpec[] specs)
                            throws ResourceException
This method is called by the application server during crash recovery. This method takes in an array of ActivationSpec JavaBeans and returns an array of XAResource objects each of which represents a unique resource manager. The resource adapter may return null if it does not implement the XAResource interface. Otherwise, it must return an array of XAResource objects, each of which represents a unique resource manager that was used by the endpoint applications. The application server uses the XAResource objects to query each resource manager for a list of in-doubt transactions. It then completes each pending transaction by sending the commit decision to the participating resource managers.

Parameters:
specs - an array of ActivationSpec JavaBeans each of which corresponds to an deployed endpoint application that was active prior to the system crash.
Returns:
an array of XAResource objects each of which represents a unique resource manager.
Throws:
ResourceException - generic exception if operation fails due to an error condition.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAdapterAssociation (Java EE 5)

javax.resource.spi
Interface ResourceAdapterAssociation

All Known Subinterfaces:
ActivationSpec
public interface ResourceAdapterAssociation

Implemented by: ActivationSpec

此接口指定将 ResourceAdapter 对象与其他实现此接口的对象（如 ManagedConnectionFactory 和 ActivationSpec）关联的方法。
version 1.0
英文文档：

This interface specifies the methods to associate a ResourceAdapter object with other objects that implement this interface like ManagedConnectionFactory and ActivationSpec.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
ResourceAdapter | getResourceAdapter() Get the associated ResourceAdapter object.
void | setResourceAdapter(ResourceAdapter ra) Associate this object with a ResourceAdapter object.

Method Detail

public ResourceAdapter getResourceAdapter()
获取关联的 ResourceAdapter 对象。
return 关联的 ResourceAdapter 对象。
英文文档：

getResourceAdapter

ResourceAdapter getResourceAdapter()
Get the associated ResourceAdapter object.

Returns:
the associated ResourceAdapter object.

public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
将此对象与 ResourceAdapter 对象关联。注意，此方法只能调用一次。也就是说，在此对象的生命周期内不得更改关联。
ra | 要关联的 ResourceAdapter 对象。
Throws | ResourceException: 一般异常。
Throws | ResourceAdapterInternalException: 与资源适配器有关的错误情况。
Throws | IllegalStateException: 指示调用该方法时此对象处于非法状态。例如，在同一对象上多次调用此方法时发生该异常。
英文文档：

setResourceAdapter

void setResourceAdapter(ResourceAdapter ra)
                        throws ResourceException
Associate this object with a ResourceAdapter object. Note, this method must be called exactly once. That is, the association must not change during the lifetime of this object.

Parameters:
ra - ResourceAdapter object to be associated with.
Throws:
ResourceException - generic exception.
ResourceAdapterInternalException - resource adapter related error condition.
IllegalStateException - indicates that this object is in an illegal state for the method invocation. For example, this occurs when this method is called more than once on the same object.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidatingManagedConnectionFactory (Java EE 5)

javax.resource.spi
Interface ValidatingManagedConnectionFactory

public interface ValidatingManagedConnectionFactory

此接口由支持验证 ManagedConnection 对象的 ManagedConnectionFactory 实例实现。

应用服务器可以使用此接口将无效的 ManagedConnection 对象从其连接池中清除。

version 1.0
英文文档：

This interface is implemented by a ManagedConnectionFactory instance that supports the ability to validate ManagedConnection objects.

This may be used by the application server to prune invalid ManagedConnection objects from its connection pool.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
 Set getInvalidConnections(Set connectionSet)
This method returns a set of invalid ManagedConnection objects chosen from a specified set of ManagedConnection objects.

Method Detail

public java.util.Set<E> getInvalidConnections(java.util.Set<E> connectionSet) throws ResourceException
此方法返回从指定的 ManagedConnection 对象集合中选出的无效 ManagedConnection 对象集合。
connectionSet | 需要验证的 ManagedConnection 对象集合。
return | 无效的 ManagedConnection 对象集合。
Throws | ResourceException: 一般异常。
英文文档：

getInvalidConnections

Set getInvalidConnections(Set connectionSet)
                          throws ResourceException
This method returns a set of invalid ManagedConnection objects chosen from a specified set of ManagedConnection objects.

Parameters:
connectionSet - a set of ManagedConnection objects that need to be validated.
Returns:
a set of invalid ManagedConnection objects.
Throws:
ResourceException - generic exception.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XATerminator (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi
Interface XATerminator

public interface XATerminator

XATerminator 接口用于事务完成和崩溃恢复流。

version 1.0
英文文档：

The XATerminator interface is used for transaction completion and crash recovery flows.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
void | commit(Xid xid, boolean onePhase) Commits the global transaction specified by xid.
void | forget(Xid xid) Tells the resource manager to forget about a heuristically completed transaction branch.
int | prepare(Xid xid) Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
Xid[] | recover(int flag) Obtains a list of prepared transaction branches from a resource manager.
void | rollback(Xid xid) Informs the resource manager to roll back work done on behalf of a transaction branch.

Method Detail

public void commit(Xid xid, boolean onePhase) throws XAException
提交 xid 指定的全局事务。
xid | 全局事务标识符
onePhase | 如果为 true，则资源管理器应使用单阶段提交协议提交代表 xid 执行的工作。
Throws | XAException: 发生错误。可能的 XAExceptions 有 XA_HEURHAZ、XA_HEURCOM、XA_HEURRB、XA_HEURMIX、XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。 如果资源管理器不提交事务，并且将参数 onePhase 设置为 true，则资源管理器可能抛出 XA_RB* 异常之一。返回后，资源管理器回滚分支的工作，并释放所有占用的资源。
英文文档：

commit

void commit(Xid xid,
            boolean onePhase)
            throws XAException
Commits the global transaction specified by xid.

Parameters:
xid - A global transaction identifier
onePhase - If true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid.
Throws:
XAException - An error has occurred. Possible XAExceptions are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

If the resource manager did not commit the transaction and the parameter onePhase is set to true, the resource manager may throw one of the XA_RB* exceptions. Upon return, the resource manager has rolled back the branch's work and has released all held resources.

public void forget(Xid xid) throws XAException
告知资源管理器忘记以启发方式完成的事务分支。
xid | 全局事务标识符
Throws | XAException: 发生错误。可能的异常值有 XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。
英文文档：

forget

void forget(Xid xid)
            throws XAException
Tells the resource manager to forget about a heuristically completed transaction branch.

Parameters:
xid - A global transaction identifier.
Throws:
XAException - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

public int prepare(Xid xid) throws XAException
请求资源管理器准备好提交 xid 中指定的事务。
xid | 全局事务标识符
Throws | XAException: 发生错误。可能的异常值有：XA_RB*、XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。
return | 一个值，它指示资源管理器对事务结果的表决。可能的值有：XA_RDONLY 或 XA_OK。这些常量在 javax.transaction.xa.XAResource 接口中定义。如果资源管理器要回滚事务，则应该通过引发 prepare 方法中相应的 XAException 实现这一点。
英文文档：

prepare

int prepare(Xid xid)
            throws XAException
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.

Parameters:
xid - A global transaction identifier.
Returns:
A value indicating the resource manager's vote on the outcome of the transaction. The possible values are: XA_RDONLY or XA_OK. These constants are defined in javax.transaction.xa.XAResource interface. If the resource manager wants to roll back the transaction, it should do so by raising an appropriate XAException in the prepare method.
Throws:
XAException - An error has occurred. Possible exception values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

public Xid[] recover(int flag) throws XAException
从资源管理器获取准备好的事务分支的列表。恢复过程中，事务管理器调用此方法，以获取当前处于准备状态或启发式完成状态的事务分支的列表。
flag | TMSTARTRSCAN、MENDRSCAN、MNOFLAGS 之一。参数中没有设置任何其他标志时，必须使用 MNOFLAGS。这些常量在 javax.transaction.xa.XAResource 接口中定义。
Throws | XAException: 发生错误。可能的值为 XAER_RMERR、XAER_RMFAIL、XAER_INVAL 和 XAER_PROTO。
return | 资源管理器返回当前处于准备状态或启发式完成状态的事务分支的 0 个或多个 XID。如果在操作过程中发生错误，则资源管理器应抛出相应的 XAException。
英文文档：

recover

Xid[] recover(int flag)
              throws XAException
Obtains a list of prepared transaction branches from a resource manager. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states.

Parameters:
flag - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS must be used when no other flags are set in the parameter. These constants are defined in javax.transaction.xa.XAResource interface.
Returns:
The resource manager returns zero or more XIDs of the transaction branches that are currently in a prepared or heuristically completed state. If an error occurs during the operation, the resource manager should throw the appropriate XAException.
Throws:
XAException - An error has occurred. Possible values are XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.

public void rollback(Xid xid) throws XAException
通知资源管理器回滚代表事务分支完成的工作。
xid | 全局事务标识符
Throws | XAException: 发生错误。可能的 XAExceptions 有 XA_HEURHAZ、XA_HEURCOM、XA_HEURRB、XA_HEURMIX、XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。 如果事务分支已经标记为只回滚，则资源管理器抛出 XA_RB* 异常之一。返回后，资源管理器回滚分支的工作，并释放所有占用的资源。
英文文档：

rollback

void rollback(Xid xid)
              throws XAException
Informs the resource manager to roll back work done on behalf of a transaction branch.

Parameters:
xid - A global transaction identifier.
Throws:
XAException - An error has occurred. Possible XAExceptions are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

If the transaction branch is already marked rollback-only the resource manager may throw one of the XA_RB* exceptions. Upon return, the resource manager has rolled back the branch's work and has released all held resources.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ConnectionEvent (Java EE 5)

javax.resource.spi
Class ConnectionEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.resource.spi.ConnectionEvent
All Implemented Interfaces:
Serializable
public class ConnectionEvent
extends EventObject

Extends: java.util.EventObject

ConnectionEvent 类提供与连接有关的事件源的信息。ConnectionEvent 实例包含以下信息：
  • 连接事件的类型
  • 生成连接事件的 ManagedConnection 实例。从 ConnectionEvent.getSource 方法返回的 ManagedConnection 实例。
  • 与 ManagedConnection 实例关联的连接句柄；对于 CONNECTION_CLOSED 事件这是必需的，对于其他事件类型可选。
  • 还可以包含指示与连接有关的错误的异常。注意，异常用于 CONNECTION_ERROR_OCCURRED。

此类定义以下类型的事件通知：

  • CONNECTION_CLOSED
  • LOCAL_TRANSACTION_STARTED
  • LOCAL_TRANSACTION_COMMITTED
  • LOCAL_TRANSACTION_ROLLEDBACK
  • CONNECTION_ERROR_OCCURRED
version | 0.5
See also | javax.resource.spi.ConnectionEventListener
英文文档：

The ConnectionEvent class provides information about the source of a connection related event.A ConnectionEvent instance contains the following information:

  • Type of the connection event
  • ManagedConnection instance that generated the connection event. A ManagedConnection instance is returned from the method ConnectionEvent.getSource.
  • Connection handle associated with the ManagedConnection instance; required for the CONNECTION_CLOSED event and optional for the other event types.
  • Optionally, an exception indicating the connection related error. Note that exception is used for CONNECTION_ERROR_OCCURRED.

This class defines following types of event notifications:

  • CONNECTION_CLOSED
  • LOCAL_TRANSACTION_STARTED
  • LOCAL_TRANSACTION_COMMITTED
  • LOCAL_TRANSACTION_ROLLEDBACK
  • CONNECTION_ERROR_OCCURRED

Version:
0.5
Author:
Rahul Sharma
See Also:
ConnectionEventListener, Serialized Form

Field Summary
static int | CONNECTION_CLOSED Event notification that an application component has closed the connection
static int | CONNECTION_ERROR_OCCURRED Event notification that an error occurred on the connection.
protected int | id Type of the event
static int | LOCAL_TRANSACTION_COMMITTED Event notification that a Resource Manager Local Transaction was committed on the connection
static int | LOCAL_TRANSACTION_ROLLEDBACK Event notification that a Resource Manager Local Transaction was rolled back on the connection
static int | LOCAL_TRANSACTION_STARTED Event notification that a Resource Manager Local Transaction was started on the connection
Fields inherited from class java.util.EventObject
source
Constructor Summary
ConnectionEvent(ManagedConnection source, int eid)
Construct a ConnectionEvent object.
ConnectionEvent(ManagedConnection source, int eid, Exception exception)
Construct a ConnectionEvent object.
Method Summary
Object | getConnectionHandle() Get the connection handle associated with the Managed Connection instance.
Exception | getException() Get the exception.
int | getId() Get the type of event
void | setConnectionHandle(Object connectionHandle) Set the connection handle.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

CONNECTION_CLOSED

public static final int CONNECTION_CLOSED
Event notification that an application component has closed the connection

See Also:
Constant Field Values

英文文档：

LOCAL_TRANSACTION_STARTED

public static final int LOCAL_TRANSACTION_STARTED
Event notification that a Resource Manager Local Transaction was started on the connection

See Also:
Constant Field Values

英文文档：

LOCAL_TRANSACTION_COMMITTED

public static final int LOCAL_TRANSACTION_COMMITTED
Event notification that a Resource Manager Local Transaction was committed on the connection

See Also:
Constant Field Values

英文文档：

LOCAL_TRANSACTION_ROLLEDBACK

public static final int LOCAL_TRANSACTION_ROLLEDBACK
Event notification that a Resource Manager Local Transaction was rolled back on the connection

See Also:
Constant Field Values

英文文档：

CONNECTION_ERROR_OCCURRED

public static final int CONNECTION_ERROR_OCCURRED
Event notification that an error occurred on the connection. This event indicates that the ManagedConnection instance is now invalid and unusable.

See Also:
Constant Field Values

英文文档：

id

protected int id
Type of the event

Constructor Detail

public ConnectionEvent(ManagedConnection source, int eid)
构造一个 ConnectionEvent 对象。异常默认为 null。
source | 作为事件源的 ManagedConnection
eid | Connection 事件类型
英文文档：

ConnectionEvent

public ConnectionEvent(ManagedConnection source,
                       int eid)
Construct a ConnectionEvent object. Exception defaults to null.

Parameters:
source - ManagedConnection that is the source of the event
eid - type of the Connection event

public ConnectionEvent(ManagedConnection source, int eid, Exception exception)
构造一个 ConnectionEvent 对象。
source | 作为事件源的 ManagedConnection
exception | 将对应用程序抛出的异常
eid | Connection 事件类型
英文文档：

ConnectionEvent

public ConnectionEvent(ManagedConnection source,
                       int eid,
                       Exception exception)
Construct a ConnectionEvent object.

Parameters:
source - ManagedConnection that is the source of the event
exception - exception about to be thrown to the application
eid - type of the Connection event
Method Detail

public Object getConnectionHandle()
获取与 ManagedConnection 实例关联的连接句柄。用于 CONNECTION_CLOSED 事件。
return 连接句柄。可以为 null
英文文档：

getConnectionHandle

public Object getConnectionHandle()
Get the connection handle associated with the Managed Connection instance. Used for CONNECTION_CLOSED event.

Returns:
the connection handle. May be null

public void setConnectionHandle(Object connectionHandle)
设置连接句柄。用于 CONNECTION_CLOSED 事件
英文文档：

setConnectionHandle

public void setConnectionHandle(Object connectionHandle)
Set the connection handle. Used for CONNECTION_CLOSED event

public Exception getException()
获取异常。可以为 null。
return 要抛出的异常。
英文文档：

getException

public Exception getException()
Get the exception. May be null.

Returns:
the exception about to be thrown.

public int getId()
获取事件类型。
英文文档：

getId

public int getId()
Get the type of event

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ApplicationServerInternalException (Java EE 5)

javax.resource.spi
Class ApplicationServerInternalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.ApplicationServerInternalException
All Implemented Interfaces:
Serializable
public class ApplicationServerInternalException
extends ResourceException

Extends: Throwable > Exception > ResourceException

应用服务器抛出 ApplicationServerInternalException，指示特定于应用服务器的错误情况。这些错误情况可能与配置相关的错误有关，也可能与应用服务器内部机制的实现有关（例如：连接池、线程管理）。
version 1.0
英文文档：

An ApplicationServerInternalException is thrown by an application server to indicate error conditions specific to an application server. These error conditions can be related to either configuration related errors or implementation of mechanisms internal to an application server (example: connection pooling, thread management).

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
ApplicationServerInternalException()
Constructs a new instance with null as its detail message.
ApplicationServerInternalException(String message)
Constructs a new instance with the specified detail message.
ApplicationServerInternalException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
ApplicationServerInternalException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
ApplicationServerInternalException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public ApplicationServerInternalException()
构造一个新实例，其详细消息为 null。
英文文档：

ApplicationServerInternalException

public ApplicationServerInternalException()
Constructs a new instance with null as its detail message.

public ApplicationServerInternalException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

ApplicationServerInternalException

public ApplicationServerInternalException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public ApplicationServerInternalException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

ApplicationServerInternalException

public ApplicationServerInternalException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public ApplicationServerInternalException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

ApplicationServerInternalException

public ApplicationServerInternalException(String message,
                                          Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public ApplicationServerInternalException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

ApplicationServerInternalException

public ApplicationServerInternalException(String message,
                                          String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CommException (Java EE 5)

javax.resource.spi
Class CommException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.CommException
All Implemented Interfaces:
Serializable
public class CommException
extends ResourceException

Extends: Throwable > Exception > ResourceException

此类指示与 EIS 实例的通信失败或中断有关的错误。此异常类型表示的常见错误情况示例有通信协议错误和由于服务器失败导致的无效连接。
version 1.0
英文文档：

This indicates errors related to failed or interrupted communication with an EIS instance. Examples of common error conditions represented by this exception type are communication protocol error and invalidated connection due to server failure.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
CommException()
Constructs a new instance with null as its detail message.
CommException(String message)
Constructs a new instance with the specified detail message.
CommException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
CommException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
CommException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public CommException()
构造一个新实例，其详细消息为 null。
英文文档：

CommException

public CommException()
Constructs a new instance with null as its detail message.

public CommException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

CommException

public CommException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public CommException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

CommException

public CommException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public CommException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

CommException

public CommException(String message,
                     Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public CommException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

CommException

public CommException(String message,
                     String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EISSystemException (Java EE 5)

javax.resource.spi
Class EISSystemException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.EISSystemException
All Implemented Interfaces:
Serializable
public class EISSystemException
extends ResourceException

Extends: Throwable > Exception > ResourceException

EISSystemException 用于指示任何特定于 EIS 的系统级别的错误情况。常见错误情况如下：EIS 实例故障或不活动、通信故障以及创建新物理连接时发生特定于 EIS 的错误。
version 1.0
英文文档：

An EISSystemException is used to indicate any EIS specific system-level error conditions. The common error conditions are: failure or inactivity of an EIS instance, communication failure and EIS specific error in the creation of a new physical connection.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
EISSystemException()
Constructs a new instance with null as its detail message.
EISSystemException(String message)
Constructs a new instance with the specified detail message.
EISSystemException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
EISSystemException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
EISSystemException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public EISSystemException()
构造一个新实例，其详细消息为 null。
英文文档：

EISSystemException

public EISSystemException()
Constructs a new instance with null as its detail message.

public EISSystemException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

EISSystemException

public EISSystemException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public EISSystemException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

EISSystemException

public EISSystemException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public EISSystemException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

EISSystemException

public EISSystemException(String message,
                          Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public EISSystemException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

EISSystemException

public EISSystemException(String message,
                          String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IllegalStateException (Java EE 5)

javax.resource.spi
Class IllegalStateException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.IllegalStateException
All Implemented Interfaces:
Serializable
public class IllegalStateException
extends ResourceException

Extends: Throwable > Exception > ResourceException

如果被调用者（用于系统协定的资源适配器或应用服务器）处于方法调用的非法状态或不恰当的状态中，则从该方法抛出 IllegalStateException。
version 1.0
英文文档：

An IllegalStateException is thrown from a method if the callee (resource adapter or application server for system contracts) is in an illegal or inappropriate state for the method invocation.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
IllegalStateException()
Constructs a new instance with null as its detail message.
IllegalStateException(String message)
Constructs a new instance with the specified detail message.
IllegalStateException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
IllegalStateException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
IllegalStateException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public IllegalStateException()
构造一个新实例，其详细消息为 null。
英文文档：

IllegalStateException

public IllegalStateException()
Constructs a new instance with null as its detail message.

public IllegalStateException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

IllegalStateException

public IllegalStateException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public IllegalStateException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

IllegalStateException

public IllegalStateException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public IllegalStateException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

IllegalStateException

public IllegalStateException(String message,
                             Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public IllegalStateException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

IllegalStateException

public IllegalStateException(String message,
                             String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidPropertyException (Java EE 5)

javax.resource.spi
Class InvalidPropertyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.InvalidPropertyException
All Implemented Interfaces:
Serializable
public class InvalidPropertyException
extends ResourceException

Extends: Throwable > Exception > ResourceException

抛出此异常指示无效的配置属性设置。
version 0.2
英文文档：

This exception is thrown to indicate invalid configuration property settings.

Version:
0.2
Author:
Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
InvalidPropertyException()
Create a InvalidPropertyException.
InvalidPropertyException(String message)
Create a InvalidPropertyException.
InvalidPropertyException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
InvalidPropertyException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
InvalidPropertyException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
PropertyDescriptor[] | getInvalidPropertyDescriptors() Get the list of invalid properties.
void | setInvalidPropertyDescriptors(PropertyDescriptor[] invalidProperties) Set a list of invalid properties.
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public InvalidPropertyException()
创建一个 InvalidPropertyException。
英文文档：

InvalidPropertyException

public InvalidPropertyException()
Create a InvalidPropertyException.

public InvalidPropertyException(String message)
创建一个 InvalidPropertyException。
message 对异常的描述
英文文档：

InvalidPropertyException

public InvalidPropertyException(String message)
Create a InvalidPropertyException.

Parameters:
message - a description of the exception

public InvalidPropertyException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

InvalidPropertyException

public InvalidPropertyException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public InvalidPropertyException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

InvalidPropertyException

public InvalidPropertyException(String message,
                                Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public InvalidPropertyException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

InvalidPropertyException

public InvalidPropertyException(String message,
                                String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Method Detail

public void setInvalidPropertyDescriptors(java.beans.PropertyDescriptor[] invalidProperties)
设置无效属性列表。
英文文档：

setInvalidPropertyDescriptors

public void setInvalidPropertyDescriptors(PropertyDescriptor[] invalidProperties)
Set a list of invalid properties.

public java.beans.PropertyDescriptor[] getInvalidPropertyDescriptors()
获取无效属性列表。
英文文档：

getInvalidPropertyDescriptors

public PropertyDescriptor[] getInvalidPropertyDescriptors()
Get the list of invalid properties.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalTransactionException (Java EE 5)

javax.resource.spi
Class LocalTransactionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.LocalTransactionException
All Implemented Interfaces:
Serializable
public class LocalTransactionException
extends ResourceException

Extends: Throwable > Exception > ResourceException

LocalTransactionException 表示与本地事务管理协定有关的各种错误情况。Java Transaction API 规范指定用于与基于 XAResource 的事务管理协定有关的异常的 javax.transaction.xa.XAException 类。

LocalTransactionException 用于本地事务管理协定，以指示以下常见错误情况：

  • 执行事务操作时事务上下文无效。例如，对 LocalTransaction 对象调用 commit 方法时没有活动的本地事务就是一种错误情况。
  • 对 LocalTransaction 对象调用 commit 方法期间回滚事务，而不是提交事务。
  • 尝试从已关联某个活动本地事务的 ManagedConnection 上的相同线程开始本地事务。
  • 与本地事务管理有关的任何特定于资源适配器或资源管理器的错误情况。例如，违反资源的完整性、死锁检测、事务完成期间的通信故障、重试要求或资源管理器中的任何内部错误。
version 1.0
英文文档：

A LocalTransactionException represents various error conditions related to the local transaction management contract. The Java Transaction API specification specifies the javax.transaction.xa.XAException class for exceptions related to XAResource based transaction management contract.

The LocalTransactionException is used for the local transaction management contract to indicate the following common error conditions:

  • Invalid transaction context when a transaction operation is executed. For example, calling commit method on LocalTransaction object without an active local transaction is an error condition.
  • Transaction is rolled back instead of getting committed during a commit method call on the LocalTransaction object.
  • An attempt to start a local transaction from the same thread on a ManagedConnection that is already associated with an active local transaction.
  • Any resource adapter or resource manager specific error conditions related to local transaction management. Examples are violation of integrity of resources, deadlock detection, communication failure during transaction completion, retry required or any internal error in a resource manager.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
LocalTransactionException()
Constructs a new instance with null as its detail message.
LocalTransactionException(String message)
Constructs a new instance with the specified detail message.
LocalTransactionException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
LocalTransactionException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
LocalTransactionException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public LocalTransactionException()
构造一个新实例，其详细消息为 null。
英文文档：

LocalTransactionException

public LocalTransactionException()
Constructs a new instance with null as its detail message.

public LocalTransactionException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

LocalTransactionException

public LocalTransactionException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public LocalTransactionException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

LocalTransactionException

public LocalTransactionException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public LocalTransactionException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

LocalTransactionException

public LocalTransactionException(String message,
                                 Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public LocalTransactionException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

LocalTransactionException

public LocalTransactionException(String message,
                                 String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAdapterInternalException (Java EE 5)

javax.resource.spi
Class ResourceAdapterInternalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.ResourceAdapterInternalException
All Implemented Interfaces:
Serializable
public class ResourceAdapterInternalException
extends ResourceException

Extends: Throwable > Exception > ResourceException

ResourceAdapterInternalException 指示与资源适配器有关的任何系统级别的错误情况。此异常类型指示的常见情况如下：
  • 用于创建新物理连接的配置无效。例如，目标 EIS 实例的服务器名称无效。
  • 由于通信协议错误或任何特定于资源适配器实现的错误，而无法创建对 EIS 实例的物理连接。
  • 资源适配器实现的内部错误情况。
version 1.0
英文文档：

A ResourceAdapterInternalException indicates any system-level error conditions related to a resource adapter. The common conditions indicated by this exception type are:

  • Invalid configuration for creation of a new physical connection. An example is invalid server name for a target EIS instance.
  • Failure to create a physical connection to a EIS instance due to communication protocol error or any resource adapter implementation specific error.
  • Error conditions internal to resource adapter implementation.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
ResourceAdapterInternalException()
Constructs a new instance with null as its detail message.
ResourceAdapterInternalException(String message)
Constructs a new instance with the specified detail message.
ResourceAdapterInternalException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
ResourceAdapterInternalException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
ResourceAdapterInternalException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public ResourceAdapterInternalException()
构造一个新实例，其详细消息为 null。
英文文档：

ResourceAdapterInternalException

public ResourceAdapterInternalException()
Constructs a new instance with null as its detail message.

public ResourceAdapterInternalException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

ResourceAdapterInternalException

public ResourceAdapterInternalException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public ResourceAdapterInternalException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

ResourceAdapterInternalException

public ResourceAdapterInternalException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public ResourceAdapterInternalException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

ResourceAdapterInternalException

public ResourceAdapterInternalException(String message,
                                        Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public ResourceAdapterInternalException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

ResourceAdapterInternalException

public ResourceAdapterInternalException(String message,
                                        String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ResourceAllocationException (Java EE 5)

javax.resource.spi
Class ResourceAllocationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.ResourceAllocationException
All Implemented Interfaces:
Serializable
public class ResourceAllocationException
extends ResourceException

Extends: Throwable > Exception > ResourceException

应用服务器或资源适配器可以抛出 ResourceAllocationException 指示任何分配系统资源失败（例如：线程、物理连接）。例如，当上边界达到特定于应用服务器的连接池可以管理的最大物理连接数时的错误情况。
version 1.0
英文文档：

A ResourceAllocationException can be thrown by an application server or resource adapter to indicate any failure to allocate system resources (example: threads, physical connections). An example is error condition when an upper bound is reached on the maximum number of physical connections that can be managed by an application server specific connection pool.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
ResourceAllocationException()
Constructs a new instance with null as its detail message.
ResourceAllocationException(String message)
Constructs a new instance with the specified detail message.
ResourceAllocationException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
ResourceAllocationException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
ResourceAllocationException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public ResourceAllocationException()
构造一个新实例，其详细消息为 null。
英文文档：

ResourceAllocationException

public ResourceAllocationException()
Constructs a new instance with null as its detail message.

public ResourceAllocationException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

ResourceAllocationException

public ResourceAllocationException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public ResourceAllocationException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

ResourceAllocationException

public ResourceAllocationException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public ResourceAllocationException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

ResourceAllocationException

public ResourceAllocationException(String message,
                                   Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public ResourceAllocationException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

ResourceAllocationException

public ResourceAllocationException(String message,
                                   String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SecurityException (Java EE 5)

javax.resource.spi
Class SecurityException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.SecurityException
All Implemented Interfaces:
Serializable
public class SecurityException
extends ResourceException

Extends: Throwable > Exception > ResourceException

SecurityException 指示与应用服务器和资源适配器之间的安全协定有关的错误情况。此异常表示的常见错误情况如下：
  • 通过安全协定传递的安全信息（由 Subject 实例表示）无效，例如，凭据已过期或格式无效。
  • 缺乏对 EIS 或资源适配器中特定安全机制的支持。
  • 由于验证或授权失败而无法创建与 EIS 的连接。
  • 无法验证 EIS 实例的资源主体或者无法建立与底层 EIS 实例的安全关联。
  • 访问控制异常指示访问 EIS 资源或者创建新连接的请求被拒绝。
version 1.0
英文文档：

A SecurityException indicates error conditions related to the security contract between an application server and resource adapter. The common error conditions represented by this exception are:

  • Invalid security information (represented as a Subject instance) passed across the security contract - for example, credentials have expired or have invalid format.
  • Lack of support for a specific security mechanism in an EIS or resource adapter.
  • Failure to create a connection to an EIS because of failed authentication or authorization.
  • Failure to authenticate a resource principal to an EIS instance or failure to establish a secure association with an underlying EIS instance.
  • Access control exception to indicate that a requested access to an EIS resource or a request to create a new connection is denied.

Version:
1.0
Author:
Rahul Sharma, Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
SecurityException()
Constructs a new instance with null as its detail message.
SecurityException(String message)
Constructs a new instance with the specified detail message.
SecurityException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
SecurityException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
SecurityException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public SecurityException()
构造一个新实例，其详细消息为 null。
英文文档：

SecurityException

public SecurityException()
Constructs a new instance with null as its detail message.

public SecurityException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

SecurityException

public SecurityException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public SecurityException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

SecurityException

public SecurityException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public SecurityException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

SecurityException

public SecurityException(String message,
                         Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public SecurityException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

SecurityException

public SecurityException(String message,
                         String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SharingViolationException (Java EE 5)

javax.resource.spi
Class SharingViolationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.SharingViolationException
All Implemented Interfaces:
Serializable
public class SharingViolationException
extends ResourceException

Extends: Throwable > Exception > ResourceException

抛出此异常指示违反连接共享。

应用程序以无法共享的方式使用可共享的连接时，资源适配器将抛出此异常。

version 1.0
英文文档：

This is thrown to indicate a connection sharing violation.

This may be thrown by a resource adapter when an application uses a shareable connection in an unshareable manner.

Version:
1.0
Author:
Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
SharingViolationException()
Constructs a new instance with null as its detail message.
SharingViolationException(String message)
Constructs a new instance with the specified detail message.
SharingViolationException(String message, String errorCode)
Constructs a new throwable with the specified detail message and error code.
SharingViolationException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
SharingViolationException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public SharingViolationException()
构造一个新实例，其详细消息为 null。
英文文档：

SharingViolationException

public SharingViolationException()
Constructs a new instance with null as its detail message.

public SharingViolationException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

SharingViolationException

public SharingViolationException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public SharingViolationException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

SharingViolationException

public SharingViolationException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public SharingViolationException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

SharingViolationException

public SharingViolationException(String message,
                                 Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public SharingViolationException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

SharingViolationException

public SharingViolationException(String message,
                                 String errorCode)
Constructs a new throwable with the specified detail message and error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnavailableException (Java EE 5)

javax.resource.spi
Class UnavailableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.UnavailableException
All Implemented Interfaces:
Serializable
public class UnavailableException
extends ResourceException

Extends: Throwable > Exception > ResourceException

抛出此异常指示某个服务不可用。
version 1.0
英文文档：

This is thrown to indicate that a service is unavailable.

Version:
1.0
Author:
Ram Jeyaraman
See Also:
Serialized Form

Constructor Summary
UnavailableException()
Constructs a new instance with null as its detail message.
UnavailableException(String message)
Constructs a new instance with the specified detail message.
UnavailableException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
UnavailableException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
UnavailableException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public UnavailableException()
构造一个新实例，其详细消息为 null。
英文文档：

UnavailableException

public UnavailableException()
Constructs a new instance with null as its detail message.

public UnavailableException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

UnavailableException

public UnavailableException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public UnavailableException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

UnavailableException

public UnavailableException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public UnavailableException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

UnavailableException

public UnavailableException(String message,
                            Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public UnavailableException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

UnavailableException

public UnavailableException(String message,
                            String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.resource.spi.endpoint (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.resource.spi.endpoint

This package contains system contracts for service endpoint interactions.

See:
Description

Interface Summary
MessageEndpoint | This defines a contract for a message endpoint.
MessageEndpointFactory | This serves as a factory for creating message endpoints.

Package javax.resource.spi.endpoint Description

This package contains system contracts for service endpoint interactions.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.resource.spi.endpoint Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.resource.spi.endpoint

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.resource.spi.endpoint.MessageEndpoint
  • javax.resource.spi.endpoint.MessageEndpointFactory
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


MessageEndpoint (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi.endpoint
Interface MessageEndpoint

public interface MessageEndpoint

此类定义消息端点的协定。此类可以由应用服务器实现。
version 1.0
英文文档：

This defines a contract for a message endpoint. This is implemented by an application server.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
void | afterDelivery() This is called by a resource adapter after a message is delivered.
void | beforeDelivery(Method method) This is called by a resource adapter before a message is delivered.
void | release() This method may be called by the resource adapter to indicate that it no longer needs a proxy endpoint instance.

Method Detail

public void beforeDelivery(Method method) throws NoSuchMethodException, ResourceException
在传送消息之前资源适配器调用此方法。
method | 目标方法的描述。此信息与预期目标方法有关，它使应用服务器能够决定是否在调用此方法期间启动事务处理，具体取决于目标方法的事务处理首选项。对端点调用实际消息传送方法的处理（由应用服务器进行）必须独立于与此描述性方法对象关联的类加载器。
Throws | NoSuchMethodException: 指示目标端点上不存在指定的方法。
Throws | ResourceException: 一般异常。
Throws | ApplicationServerInternalException: 指示应用服务器的错误情况。
Throws | IllegalStateException: 指示方法调用时端点处于非法状态。例如，当不成对地调用 beforeDelivery 和 afterDelivery 方法时会发生这种情况。
Throws | UnavailableException: 指示端点不可用。
英文文档：

beforeDelivery

void beforeDelivery(Method method)
                    throws NoSuchMethodException,
                           ResourceException
This is called by a resource adapter before a message is delivered.

Parameters:
method - description of a target method. This information about the intended target method allows an application server to decide whether to start a transaction during this method call, depending on the transaction preferences of the target method. The processing (by the application server) of the actual message delivery method call on the endpoint must be independent of the class loader associated with this descriptive method object.
Throws:
NoSuchMethodException - indicates that the specified method does not exist on the target endpoint.
ResourceException - generic exception.
ApplicationServerInternalException - indicates an error condition in the application server.
IllegalStateException - indicates that the endpoint is in an illegal state for the method invocation. For example, this occurs when beforeDelivery and afterDelivery method calls are not paired.
UnavailableException - indicates that the endpoint is not available.

public void afterDelivery() throws ResourceException
在传送消息之后资源适配器调用此方法。
Throws | ResourceException: 一般异常。
Throws | ApplicationServerInternalException: 指示应用服务器的错误情况。
Throws | IllegalStateException: 指示方法调用时端点处于非法状态。例如，当不成对地调用 beforeDelivery 和 afterDelivery 方法时会发生这种情况。
Throws | UnavailableException: 指示端点不可用。
英文文档：

afterDelivery

void afterDelivery()
                   throws ResourceException
This is called by a resource adapter after a message is delivered.

Throws:
ResourceException - generic exception.
ApplicationServerInternalException - indicates an error condition in the application server.
IllegalStateException - indicates that the endpoint is in an illegal state for the method invocation. For example, this occurs when beforeDelivery and afterDelivery method calls are not paired.
UnavailableException - indicates that the endpoint is not available.

public void release()
资源适配器可以调用此方法指示它不再需要代理端点实例。应用服务器可以使用此提示进行端点入池决定。
英文文档：

release

void release()
This method may be called by the resource adapter to indicate that it no longer needs a proxy endpoint instance. This hint may be used by the application server for endpoint pooling decisions.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MessageEndpointFactory (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi.endpoint
Interface MessageEndpointFactory

public interface MessageEndpointFactory

此类用于创建消息端点的工厂。
version 1.0
英文文档：

This serves as a factory for creating message endpoints.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
MessageEndpoint | createEndpoint(XAResource xaResource) This is used to create a message endpoint.
boolean | isDeliveryTransacted(Method method) This is used to find out whether message deliveries to a target method on a message listener interface that is implemented by a message endpoint will be transacted or not.

Method Detail

public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException
此方法用于创建消息端点。消息端点应该实现正确的消息侦听器类型。
xaResource | 当消息传送是事务性时，用来获取事务处理通知的可选 XAResource 实例。
return | 消息端点实例。
Throws | UnavailableException: 指示创建消息端点时出现暂时故障。后续尝试创建消息端点可能成功。
英文文档：

createEndpoint

MessageEndpoint createEndpoint(XAResource xaResource)
                               throws UnavailableException
This is used to create a message endpoint. The message endpoint is expected to implement the correct message listener type.

Parameters:
xaResource - an optional XAResource instance used to get transaction notifications when the message delivery is transacted.
Returns:
a message endpoint instance.
Throws:
UnavailableException - indicates a transient failure in creating a message endpoint. Subsequent attempts to create a message endpoint might succeed.

public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
此方法用于确定，传送到目标方法（位于消息端点实现的消息侦听器接口上）的消息是否将是事务性的。 该消息端点可以通过其部署描述符指出其事务性传送首选项（每个方法级别）。在消息端点的生命周期内不得更改消息传送首选项。
method | 目标方法的描述。此信息与预期目标方法有关，它使应用服务器能够确定目标方法调用是否将是事务性的。
Throws | NoSuchMethodException: 指示目标端点上不存在指定的方法。
return | 如果消息端点需要事务性消息传送，则返回 true。
英文文档：

isDeliveryTransacted

boolean isDeliveryTransacted(Method method)
                             throws NoSuchMethodException
This is used to find out whether message deliveries to a target method on a message listener interface that is implemented by a message endpoint will be transacted or not. The message endpoint may indicate its transacted delivery preferences (at a per method level) through its deployment descriptor. The message delivery preferences must not change during the lifetime of a message endpoint.

Parameters:
method - description of a target method. This information about the intended target method allows an application server to find out whether the target method call will be transacted or not.
Returns:
true, if message endpoint requires transacted message delivery.
Throws:
NoSuchMethodException - indicates that the specified method does not exist on the target endpoint.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.resource.spi.security (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.resource.spi.security

The javax.resource.spi.security package contains APIs for the security management contract.

See:
Description

Interface Summary
GenericCredential Deprecated. The preferred way to represent generic credential information is via the org.ietf.jgss.GSSCredential interface in J2SE Version 1.4, which provides similar functionality.

Class Summary
PasswordCredential The class PasswordCredential acts as a holder for username and password.

Package javax.resource.spi.security Description

The javax.resource.spi.security package contains APIs for the security management contract.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.resource.spi.security Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.resource.spi.security

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.resource.spi.security.PasswordCredential (implements java.io.Serializable)

Interface Hierarchy

  • javax.resource.spi.security.GenericCredential
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


GenericCredential (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi.security
Interface GenericCredential

Deprecated. The preferred way to represent generic credential information is via the org.ietf.jgss.GSSCredential interface in J2SE Version 1.4, which provides similar functionality.

接口 javax.resource.spi.security.GenericCredential 定义与安全机制无关的接口，用于访问资源主体的安全凭据。

GenericCredential 接口提供一个 Java 包装器，用于包装安全凭据特定于底层机制的表示形式。例如，可以使用 GenericCredential 接口包装 Kerberos 凭据。

连接器架构不为特定于安全机制的凭据定义任何标准格式和要求。例如，GenericCredential 接口包装的安全凭据可以具有特定于操作系统的本机表示形式。

GenericCredential 接口使资源适配器能够提取有关安全凭据的信息。然后，资源适配器就可以通过以下方法管理资源主体的 EIS 登录：

  • 如果底层 EIS 支持 GenericCredential 实例表示的安全机制类型，则使用特定于 EIS 的方式使用凭据，或者
  • 如果资源适配器和底层 EIS 实例支持 GSS-API，则使用 GSS-API。
version | 0.7
since | 0.7
deprecated
en
The preferred way to represent generic credential information is via the org.ietf.jgss.GSSCredential interface in J2SE Version 1.4, which provides similar functionality.
See also | javax.security.auth.Subject, java.security.Principal
英文文档：

public interface GenericCredential

The interface javax.resource.spi.security.GenericCredential defines a security mechanism independent interface for accessing security credential of a resource principal.

The GenericCredential interface provides a Java wrapper over an underlying mechanism specific representation of a security credential. For example, the GenericCredential interface can be used to wrap Kerberos credentials.

The connector architecture does not define any standard format and requirements for security mechanism specific credentials. For example, a security credential wrapped by a GenericCredential interface can have a native representation specific to an operating system.

The GenericCredential interface enables a resource adapter to extract information about a security credential. The resource adapter can then manage EIS sign-on for a resource principal by either:

  • using the credentials in an EIS specific manner if the underlying EIS supports the security mechanism type represented by the GenericCredential instance, or,
  • using GSS-API if the resource adapter and underlying EIS instance support GSS-API.

Since:
0.7
Version:
0.7
Author:
Rahul Sharma
See Also:
Subject, Principal

Method Summary
boolean | equals(Object another) Deprecated. Tests if this GenericCredential instance refers to the same entity as the supplied object.
byte[] | getCredentialData() Deprecated. Gets security data for a specific security mechanism represented by the GenericCredential.
String | getMechType() Deprecated. Returns the mechanism type for the GenericCredential instance.
String | getName() Deprecated. Returns the name of the resource principal associated with a GenericCredential instance.
int | hashCode() Deprecated. Returns the hash code for this GenericCredential

Method Detail

public String getName()
返回与 GenericCredential 实例关联的资源主体的名称。
return 主体的名称
英文文档：

getName

String getName()
Deprecated.
Returns the name of the resource principal associated with a GenericCredential instance.

Returns:
Name of the principal

public String getMechType()
返回 GenericCredential 实例的机制类型。GenericCredential 的机制类型定义应该与基于 GSS 规范所指定表示形式的对象标识符 (OID) 保持一致。在 GenericCredential 接口中，以 OID 规范的字符串化表示形式返回机制类型。
return 机制类型
英文文档：

getMechType

String getMechType()
Deprecated.
Returns the mechanism type for the GenericCredential instance. The mechanism type definition for GenericCredential should be consistent with the Object Identifier (OID) based representation specified in the GSS specification. In the GenericCredential interface, the mechanism type is returned as a stringified representation of the OID specification.

Returns:
mechanism type

public byte[] getCredentialData() throws SecurityException
获取 GenericCredential 表示的特定安全机制的安全数据。例如验证数据，代表关联的资源主体建立与 EIS 实例的安全关联时需要该数据。

getCredentialData 方法以 byte 数组的形式返回凭据表示形式。注意，连接器架构不为返回的凭据数据定义任何标准格式。

return | byte 数组形式的凭据表示形式。
Throws | SecurityException: 由于与安全有关的错误情况导致操作失败
英文文档：

getCredentialData

byte[] getCredentialData()
                         throws SecurityException
Deprecated.
Gets security data for a specific security mechanism represented by the GenericCredential. An example is authentication data required for establishing a secure association with an EIS instance on behalf of the associated resource principal.

The getCredentialData method returns the credential representation as an array of bytes. Note that the connector architecture does not define any standard format for the returned credential data.

Returns:
credential representation as an array of bytes.
Throws:
SecurityException - Failed operation due to security related error condition

public boolean equals(Object another)
测试此 GenericCredential 实例是否引用了与提供的对象相同的实体。这两个凭据必须通过相同的机制获取，并且必须引用相同的主体。 如果两个 GenericCredential 都引用了同一实体，则返回 true；否则返回 false。
英文文档：

equals

boolean equals(Object another)
Deprecated.
Tests if this GenericCredential instance refers to the same entity as the supplied object. The two credentials must be acquired over the same mechanisms and must refer to the same principal. Returns true if the two GenericCredentials refer to the same entity; false otherwise.

Overrides:
equals in class Object

public int hashCode()
返回此 GenericCredential 的哈希码
return 此 GenericCredential 的哈希码
英文文档：

hashCode

int hashCode()
Deprecated.
Returns the hash code for this GenericCredential

Overrides:
hashCode in class Object
Returns:
hash code for this GenericCredential
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


PasswordCredential (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi.security
Class PasswordCredential

java.lang.Object
    extended by  javax.resource.spi.security.PasswordCredential
All Implemented Interfaces:
Serializable
public final class PasswordCredential
extends Object
implements Serializable

Implements: java.io.Serializable

类 PasswordCredential 充当用户名和密码的保存者。
version | 0.6
since | 0.6
See also | javax.resource.spi.ManagedConnectionFactory
英文文档：

The class PasswordCredential acts as a holder for username and password.

Since:
0.6
Version:
0.6
Author:
Rahul Sharma
See Also:
ManagedConnectionFactory, Serialized Form

Constructor Summary
PasswordCredential(String userName, char[] password)
Creates a new PasswordCredential object from the given user name and password.
Method Summary
boolean | equals(Object other) Compares this PasswordCredential with the specified object for equality.
ManagedConnectionFactory | getManagedConnectionFactory() Gets the target ManagedConnectionFactory for which the user name and password has been set by the application server.
char[] | getPassword() Returns the user password.
String | getUserName() Returns the user name.
int | hashCode() Returns the hash code for this PasswordCredential
void | setManagedConnectionFactory(ManagedConnectionFactory mcf) Sets the target ManagedConenctionFactory instance for which the user name and password has been set by the application server.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public PasswordCredential(String userName, char[] password)
通过给定的用户名和密码创建一个新 PasswordCredential 对象。

注意，在新的 PasswordCredential 对象中存储给定的用户密码之前复制该密码。

userName | 用户名
password | 用户的密码
英文文档：

PasswordCredential

public PasswordCredential(String userName,
                          char[] password)
Creates a new PasswordCredential object from the given user name and password.

Note that the given user password is cloned before it is stored in the new PasswordCredential object.

Parameters:
userName - the user name
password - the user's password
Method Detail

public String getUserName()
返回用户名。
return 用户名
英文文档：

getUserName

public String getUserName()
Returns the user name.

Returns:
the user name

public char[] getPassword()
返回用户密码。

注意，此方法返回到密码的引用。不再需要密码信息后，调用方负责将其归零。

return 密码
英文文档：

getPassword

public char[] getPassword()
Returns the user password.

Note that this method returns a reference to the password. It is the caller's responsibility to zero out the password information after it is no longer needed.

Returns:
the password

public ManagedConnectionFactory getManagedConnectionFactory()
获取应用服务器已经设置了用户名和密码的目标 ManagedConnectionFactory。ManagedConnectionFactory 使用此字段确定它是否应该使用 PasswordCredential 登录目标 EIS 实例。
return 已指定用户名和密码的 ManagedConnectionFactory 实例
英文文档：

getManagedConnectionFactory

public ManagedConnectionFactory getManagedConnectionFactory()
Gets the target ManagedConnectionFactory for which the user name and password has been set by the application server. A ManagedConnection- Factory uses this field to find out whether PasswordCredential should be used by it for sign-on to the target EIS instance.

Returns:
ManagedConnectionFactory instance for which user name and password have been specified

public void setManagedConnectionFactory(ManagedConnectionFactory mcf)
设置应用服务器已经设置了用户名和密码的目标 ManagedConenctionFactory 实例。
mcf 已经指定了用户名和密码的 ManagedConnectionFactory 实例
英文文档：

setManagedConnectionFactory

public void setManagedConnectionFactory(ManagedConnectionFactory mcf)
Sets the target ManagedConenctionFactory instance for which the user name and password has been set by the application server.

Parameters:
mcf - ManagedConnectionFactory instance for which user name and password have been specified

public boolean equals(Object other)
比较此 PasswordCredential 与指定对象的相等性。如果它们的用户名和密码相同，则两个 PasswordCredential 实例相同。
other | 将其与 PasswordCredential 比较的对象
return | 如果指定的对象是 PasswordCredential，且与此实例具有相同的用户名和密码，则为 true。
英文文档：

equals

public boolean equals(Object other)
Compares this PasswordCredential with the specified object for equality. The two PasswordCredential instances are the same if they are equal in username and password.

Overrides:
equals in class Object
Parameters:
other - Object to which PasswordCredential is to be compared
Returns:
true if and if the specified object is a PasswordCredential whose username and password are equal to this instance.

public int hashCode()
返回此 PasswordCredential 的哈希码
return 此 PasswordCredential 的哈希码
英文文档：

hashCode

public int hashCode()
Returns the hash code for this PasswordCredential

Overrides:
hashCode in class Object
Returns:
hash code for this PasswordCredential
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.resource.spi.work (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.resource.spi.work

This package contains APIs for the work management contract.

See:
Description

Interface Summary
Work | This models a Work instance that would be executed by a WorkManager upon submission.
WorkListener | This models a WorkListener instance which would be notified by the WorkManager when the various Work processing events (work accepted, work rejected, work started, work completed) occur.
WorkManager | This interface models a WorkManager which provides a facility to submit Work instances for execution.

Class Summary
ExecutionContext | This class models an execution context (transaction, security, etc) with which the Work instance must be executed.
WorkAdapter | This class is provided as a convenience for easily creating WorkListener instances by extending this class and overriding only those methods of interest.
WorkEvent | This class models the various events that occur during the processing of a Work instance.

Exception Summary
WorkCompletedException | This exception is thrown by a WorkManager to indicate that a submitted Work instance has completed with an exception.
WorkException | A common base class for all Work processing related exceptions.
WorkRejectedException | This exception is thrown by a WorkManager to indicate that a submitted Work instance has been rejected.

Package javax.resource.spi.work Description

This package contains APIs for the work management contract.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.resource.spi.work Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.resource.spi.work

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.EventObject (implements java.io.Serializable)
      • javax.resource.spi.work.WorkEvent
    • javax.resource.spi.work.ExecutionContext
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.resource.ResourceException
          • javax.resource.spi.work.WorkException
            • javax.resource.spi.work.WorkCompletedException
            • javax.resource.spi.work.WorkRejectedException
    • javax.resource.spi.work.WorkAdapter (implements javax.resource.spi.work.WorkListener)

Interface Hierarchy

  • java.util.EventListener
    • javax.resource.spi.work.WorkListener
  • java.lang.Runnable
    • javax.resource.spi.work.Work
  • javax.resource.spi.work.WorkManager
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Work (Java EE 5)

javax.resource.spi.work
Interface Work

All Superinterfaces:
Runnable
public interface Work
extends Runnable

Implements: Runnable

此方法模拟 Work 实例，提交后该实例将由 WorkManager 执行。
version 1.0
英文文档：

This models a Work instance that would be executed by a WorkManager upon submission.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
 void release()
The WorkManager might call this method to hint the active Work instance to complete execution as soon as possible.
Methods inherited from interface java.lang.Runnable
run

Method Detail

public void release()
WorkManager 可以调用此方法提示活动的 Work 实例尽快完成执行。将在单独的线程上，而不是在当前执行 Work 实例的线程上调用此方法。
英文文档：

release

void release()
The WorkManager might call this method to hint the active Work instance to complete execution as soon as possible. This would be called on a seperate thread other than the one currently executing the Work instance.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkListener (Java EE 5)

javax.resource.spi.work
Interface WorkListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
WorkAdapter
public interface WorkListener
extends EventListener

Implements: java.util.EventListener
Implemented by: WorkAdapter

此类模拟 WorkListener 实例，当发生各种 Work 处理事件（接受工作、拒绝工作、工作开始、工作完成）时 WorkManager 将通知该实例。 WorkListener 实例不得进行任何线程假设，并且必须是线程安全的，即可能从任意线程发生通知。此外，该实例不得假设任何通知顺序。
version 1.0
英文文档：

This models a WorkListener instance which would be notified by the WorkManager when the various Work processing events (work accepted, work rejected, work started, work completed) occur. The WorkListener instance must not make any thread assumptions and must be thread-safe ie., a notification could occur from any arbitrary thread. Further, it must not make any assumptions on the ordering of notifications.

Version:
1.0
Author:
Ram Jeyaraman

Method Summary
void | workAccepted(WorkEvent e) Invoked when a Work instance has been accepted.
void | workCompleted(WorkEvent e) Invoked when a Work instance has completed execution.
void | workRejected(WorkEvent e) Invoked when a Work instance has been rejected.
void | workStarted(WorkEvent e) Invoked when a Work instance has started execution.

Method Detail

public void workAccepted(WorkEvent e)
接受 Work 实例时调用。
英文文档：

workAccepted

void workAccepted(WorkEvent e)
Invoked when a Work instance has been accepted.

public void workRejected(WorkEvent e)
拒绝 Work 实例时调用。
英文文档：

workRejected

void workRejected(WorkEvent e)
Invoked when a Work instance has been rejected.

public void workStarted(WorkEvent e)
Work 实例开始执行时调用。这仅仅意味着分配了一个线程。
英文文档：

workStarted

void workStarted(WorkEvent e)
Invoked when a Work instance has started execution. This only means that a thread has been allocated.

public void workCompleted(WorkEvent e)
Work 实例完成执行时调用。
英文文档：

workCompleted

void workCompleted(WorkEvent e)
Invoked when a Work instance has completed execution.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkManager (Java EE 5)

javax.resource.spi.work
Interface WorkManager

public interface WorkManager

此接口模拟 WorkManager，它提供一个提交 Work 实例以供执行的工具。这样用户便不必创建直接执行工作的 Java 线程。此外，这样能更有效将线程资源入池，并能更好地控制线程使用。 Work 处理过程的各种阶段如下：
  • 工作提交：提交 Work 实例以便执行。可能接受 Work 实例，也可能拒绝并将 WorkRejectedException 设置为相应的错误代码。
  • 接受工作：接受提交的 Work 实例。接受的 Work 实例可能开始执行，也可能再次拒绝并将 WorkRejectedException 设置为相应的错误代码。除非指定了启动时间期限，否则不保证开始执行的时间。指定了启动时间时，必须在指定的期限（不是实时保证）内开始执行 Work，否则会失败并抛出错误代码设置为 WorkRejected.TIMED_OUT 的 WorkRejectedException。
  • 拒绝工作：拒绝 Work 实例。在 Work 提交期间，或者在接受 Work 实例之后（但在 Work 实例开始执行之前）可能会拒绝 Work 实例。拒绝的原因可能是内部因素或者启动时间超时。在这两种情况下，都抛出带有相应错误代码（指示原因）的 WorkRejectedException。
  • 开始工作：开始执行 Work 实例。这意味着已经为其执行分配了一个线程。但这并不保证已经安排了分配的线程在 CPU 资源上运行。开始执行之后，分配的线程设置相应的执行上下文（事务、安全等等）并调用 Work.run()。注意，在执行上下文设置或 Work.run() 期间抛出的任何异常将导致处理完成。
  • 工作完成：完成 Work 的执行。执行完成时可能带有异常，也可能没有异常。WorkManager 在 Work 处理（包括执行上下文设置）期间捕获任何异常，并用 WorkCompletedException 包装。
version 1.0
英文文档：

This interface models a WorkManager which provides a facility to submit Work instances for execution. This frees the user from having to create Java threads directly to do work. Further, this allows efficient pooling of thread resources and more control over thread usage. The various stages in Work processing are:

  • work submit: A Work instance is being submitted for execution. The Work instance could either be accepted or rejected with a WorkRejectedException set to an appropriate error code.
  • work accepted: The submitted Work instance has been accepted. The accepted Work instance could either start execution or could be rejected again with a WorkRejectedException set to an appropriate error code. There is no guarantee on when the execution would start unless a start timeout duration is specified. When a start timeout is specified, the Work execution must be started within the specified duration (not a real-time guarantee), failing which a WorkRejectedException set to an error code (WorkRejected.TIMED_OUT) is thrown.
  • work rejected: The Work instance has been rejected. The Work instance could be rejected during Work submittal or after the Work instance has been accepted (but before Work instance starts execution). The rejection could be due to internal factors or start timeout expiration. A WorkRejectedException with an appropriate error code (indicates the reason) is thrown in both cases.
  • work started: The execution of the Work instance has started. This means that a thread has been allocated for its execution. But this does not guarantee that the allocated thread has been scheduled to run on a CPU resource. Once execution is started, the allocated thread sets up an appropriate execution context (transaction , security, etc) and calls Work.run(). Note, any exception thrown during execution context setup or Work.run() leads to completion of processing.
  • work completed: The execution of the Work has been completed. The execution could complete with or without an exception. The WorkManager catches any exception thrown during Work processing (which includes execution context setup), and wraps it with a WorkCompletedException.

Version:
1.0
Author:
Ram Jeyaraman

Field Summary
static long | IMMEDIATE A constant to indicate timeout duration.
static long | INDEFINITE A constant to indicate timeout duration.
static long | UNKNOWN A constant to indicate an unknown start delay duration or other unknown values.
Method Summary
void | doWork(Work work) Accepts a Work instance for processing.
void | doWork(Work work, long startTimeout, ExecutionContext execContext, WorkListener workListener) Accepts a Work instance for processing.
void | scheduleWork(Work work) Accepts a Work instance for processing.
void | scheduleWork(Work work, long startTimeout, ExecutionContext execContext, WorkListener workListener) Accepts a Work instance for processing.
long | startWork(Work work) Accepts a Work instance for processing.
long | startWork(Work work, long startTimeout, ExecutionContext execContext, WorkListener workListener) Accepts a Work instance for processing.

Field Detail

英文文档：

IMMEDIATE

static final long IMMEDIATE
A constant to indicate timeout duration. A zero timeout value indicates an action be performed immediately.

See Also:
Constant Field Values

英文文档：

INDEFINITE

static final long INDEFINITE
A constant to indicate timeout duration. A maximum timeout value indicates that an action be performed arbitrarily without any time constraint.

See Also:
Constant Field Values

英文文档：

UNKNOWN

static final long UNKNOWN
A constant to indicate an unknown start delay duration or other unknown values.

See Also:
Constant Field Values
Method Detail

public void doWork(Work work) throws WorkException
接受 Work 实例以便进行处理。在 Work 实例完成执行前，此调用一直阻塞。不保证接受的 Work 实例何时开始执行，即对开始执行没有时间限制。
work | 要完成的工作单位。时间可长可短。
Throws | WorkRejectedException: 指示进一步处理时拒绝了 Work 实例。这可能是由内部因素引起的。
Throws | WorkCompletedException: 指示 Work 实例完成了执行，但有一个异常。
英文文档：

doWork

void doWork(Work work)
            throws WorkException
Accepts a Work instance for processing. This call blocks until the Work instance completes execution. There is no guarantee on when the accepted Work instance would start execution ie., there is no time constraint to start execution.

Parameters:
work - The unit of work to be done. Could be long or short-lived.
Throws:
WorkRejectedException - indicates that a Work instance has been rejected from further processing. This can occur due to internal factors.
WorkCompletedException - indicates that a Work instance has completed execution with an exception.
WorkException

public void doWork(Work work, long startTimeout, ExecutionContext execContext, WorkListener workListener) throws WorkException
接受 Work 实例以便进行处理。在 Work 实例完成执行前，此调用一直阻塞。
work | 要完成的工作单位。时间可长可短。
startTimeout | 一个时间范围（以毫秒为单位），在这段时间内必须开始执行 Work 实例。否则，Work 实例将被拒绝，并抛出设置为相应错误代码 (WorkRejectedException.TIMED_OUT) 的 WorkRejectedException。注意，此方法不提供实时保证。
execContext | 包含执行上下文的对象，必须使用该上下文执行提交的 Work 实例。
workListener | 当发生多个 Work 处理事件（接受 work、拒绝 work、开始 work、完成 work）时应该通知的对象。
Throws | WorkRejectedException: 指示进一步处理时拒绝了 Work 实例。这可能是由内部因素或者启动时间超时引起的。
Throws | WorkCompletedException: 指示 Work 实例完成了执行，但有一个异常。
英文文档：

doWork

void doWork(Work work,
            long startTimeout,
            ExecutionContext execContext,
            WorkListener workListener)
            throws WorkException
Accepts a Work instance for processing. This call blocks until the Work instance completes execution.

Parameters:
work - The unit of work to be done. Could be long or short-lived.
startTimeout - a time duration (in milliseconds) within which the execution of the Work instance must start. Otherwise, the Work instance is rejected with a WorkRejectedException set to an appropriate error code (WorkRejectedException.TIMED_OUT). Note, this does not offer real-time guarantees.
execContext - an object containing the execution context with which the submitted Work instance must be executed.
workListener - an object which would be notified when the various Work processing events (work accepted, work rejected, work started, work completed) occur.
Throws:
WorkRejectedException - indicates that a Work instance has been rejected from further processing. This can occur due to internal factors or start timeout expiration.
WorkCompletedException - indicates that a Work instance has completed execution with an exception.
WorkException

public long startWork(Work work) throws WorkException
接受 Work 实例以便进行处理。在 Work 实例开始执行但未完成前，此调用一直阻塞。不保证接受的 Work 实例何时开始执行，即对开始执行没有时间限制。
work | 要完成的工作单位。时间可长可短。
return | 从接受 Work 到开始执行的时间（以毫秒为单位）。注意，此方法不提供实时保证。如果启动延迟期限未知，则返回 -1 是有效的。
Throws | WorkRejectedException: 指示进一步处理时拒绝了 Work 实例。这可能是由内部因素引起的。
英文文档：

startWork

long startWork(Work work)
               throws WorkException
Accepts a Work instance for processing. This call blocks until the Work instance starts execution but not until its completion. There is no guarantee on when the accepted Work instance would start execution ie., there is no time constraint to start execution.

Parameters:
work - The unit of work to be done. Could be long or short-lived.
Returns:
the time elapsed (in milliseconds) from Work acceptance until start of execution. Note, this does not offer real-time guarantees. It is valid to return -1, if the actual start delay duration is unknown.
Throws:
WorkRejectedException - indicates that a Work instance has been rejected from further processing. This can occur due to internal factors.
WorkException

public long startWork(Work work, long startTimeout, ExecutionContext execContext, WorkListener workListener) throws WorkException
接受 Work 实例以便进行处理。在 Work 实例开始执行但未完成前，此调用一直阻塞。不保证接受的 Work 实例何时开始执行，即对开始执行没有时间限制。
work | 要完成的工作单位。时间可长可短。
startTimeout | 一个时间范围（以毫秒为单位），在这段时间内必须开始执行 Work 实例。否则，Work 实例将被拒绝，并抛出设置为相应错误代码 (WorkRejectedException.TIMED_OUT) 的 WorkRejectedException。注意，此方法不提供实时保证。
execContext | 包含执行上下文的对象，必须使用该上下文执行提交的 Work 实例。
workListener | 当发生多个 Work 处理事件（接受 work、拒绝 work、开始 work、完成 work）时应该通知的对象。
return | 从接受 Work 到开始执行的时间（以毫秒为单位）。注意，此方法不提供实时保证。如果启动延迟期限未知，则返回 -1 是有效的。
Throws | WorkRejectedException: 指示进一步处理时拒绝了 Work 实例。这可能是由内部因素或者启动时间超时引起的。
英文文档：

startWork

long startWork(Work work,
               long startTimeout,
               ExecutionContext execContext,
               WorkListener workListener)
               throws WorkException
Accepts a Work instance for processing. This call blocks until the Work instance starts execution but not until its completion. There is no guarantee on when the accepted Work instance would start execution ie., there is no time constraint to start execution.

Parameters:
work - The unit of work to be done. Could be long or short-lived.
startTimeout - a time duration (in milliseconds) within which the execution of the Work instance must start. Otherwise, the Work instance is rejected with a WorkRejectedException set to an appropriate error code (WorkRejectedException.TIMED_OUT). Note, this does not offer real-time guarantees.
execContext - an object containing the execution context with which the submitted Work instance must be executed.
workListener - an object which would be notified when the various Work processing events (work accepted, work rejected, work started, work completed) occur.
Returns:
the time elapsed (in milliseconds) from Work acceptance until start of execution. Note, this does not offer real-time guarantees. It is valid to return -1, if the actual start delay duration is unknown.
Throws:
WorkRejectedException - indicates that a Work instance has been rejected from further processing. This can occur due to internal factors or start timeout expiration.
WorkException

public void scheduleWork(Work work) throws WorkException
接受 Work 实例以便进行处理。此调用不会阻塞，接受了 Work 进行处理后便立即返回。不保证提交的 Work 实例何时开始执行，即对开始执行没有时间限制。
work | 要完成的工作单位。时间可长可短。
Throws | WorkRejectedException: 指示进一步处理时拒绝了 Work 实例。这可能是由内部因素引起的。
英文文档：

scheduleWork

void scheduleWork(Work work)
                  throws WorkException
Accepts a Work instance for processing. This call does not block and returns immediately once a Work instance has been accepted for processing. There is no guarantee on when the submitted Work instance would start execution ie., there is no time constraint to start execution.

Parameters:
work - The unit of work to be done. Could be long or short-lived.
Throws:
WorkRejectedException - indicates that a Work instance has been rejected from further processing. This can occur due to internal factors.
WorkException

public void scheduleWork(Work work, long startTimeout, ExecutionContext execContext, WorkListener workListener) throws WorkException
接受 Work 实例以便进行处理。此调用不会阻塞，接受了 Work 进行处理后便立即返回。
work | 要完成的工作单位。时间可长可短。
startTimeout | 一个时间范围（以毫秒为单位），在这段时间内必须开始执行 Work 实例。否则，Work 实例将被拒绝，并抛出设置为相应错误代码 (WorkRejectedException.TIMED_OUT) 的 WorkRejectedException。注意，此方法不提供实时保证。
execContext | 包含执行上下文的对象，必须使用该上下文执行提交的 Work 实例。
workListener | 当发生多个 Work 处理事件（接受 work、拒绝 work、开始 work、完成 work）时应该通知的对象。
Throws | WorkRejectedException: 指示进一步处理时拒绝了 Work 实例。这可能是由内部因素引起的。
英文文档：

scheduleWork

void scheduleWork(Work work,
                  long startTimeout,
                  ExecutionContext execContext,
                  WorkListener workListener)
                  throws WorkException
Accepts a Work instance for processing. This call does not block and returns immediately once a Work instance has been accepted for processing.

Parameters:
work - The unit of work to be done. Could be long or short-lived.
startTimeout - a time duration (in milliseconds) within which the execution of the Work instance must start. Otherwise, the Work instance is rejected with a WorkRejectedException set to an appropriate error code (WorkRejectedException.TIMED_OUT). Note, this does not offer real-time guarantees.
execContext - an object containing the execution context with which the submitted Work instance must be executed.
workListener - an object which would be notified when the various Work processing events (work accepted, work rejected, work started, work completed) occur.
Throws:
WorkRejectedException - indicates that a Work instance has been rejected from further processing. This can occur due to internal factors.
WorkException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExecutionContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi.work
Class ExecutionContext

java.lang.Object
    extended by  javax.resource.spi.work.ExecutionContext

public class ExecutionContext
extends Object

此类模拟执行上下文（事务、安全等等），Work 实例必须使用这些上下文执行。提供此类的目的是为了便于轻松创建 ExecutionContext 实例：只需扩展此类并只重写感兴趣的那些方法。

最好使 ExecutionContext 是类而不是接口的原因如下：

  • 资源适配器不需要实现此类。只需要实现上下文信息（如事务等）。
  • 当 ExecutionContext 类发展时，不必更改资源适配器代码。例如，将来可能会向 ExecutionContext 类添加更多的上下文类型，但不会强制更改资源适配器实现。
version 1.0
英文文档：

This class models an execution context (transaction, security, etc) with which the Work instance must be executed. This class is provided as a convenience for easily creating ExecutionContext instances by extending this class and overriding only those methods of interest.

Some reasons why it is better for ExecutionContext to be a class rather than an interface:

  • There is no need for a resource adapter to implement this class. It only needs to implement the context information like transaction, etc.
  • The resource adapter code does not have to change when the ExecutionContext class evolves. For example, more context types could be added to the ExecutionContext class (in the future) without forcing resource adapter implementations to change.

Version:
1.0
Author:
Ram Jeyaraman

Constructor Summary
ExecutionContext()
Method Summary
long | getTransactionTimeout() Get the transaction timeout value for a imported transaction.
Xid | getXid()
void | setTransactionTimeout(long timeout) Set the transaction timeout value for a imported transaction.
void | setXid(Xid xid) set a transaction context.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ExecutionContext()
英文文档：

ExecutionContext

public ExecutionContext()
Method Detail

public void setXid(Xid xid)
设置事务上下文。
xid 事务上下文。
英文文档：

setXid

public void setXid(Xid xid)
set a transaction context.

Parameters:
xid - transaction context.

public Xid getXid()
英文文档：

getXid

public Xid getXid()

public void setTransactionTimeout(long timeout) throws NotSupportedException
设置导入事务的事务超时值。
timeout | 事务超时值（以秒为单位）。只接受正的非 0 值。其他值都是非法的，将被拒绝并抛出 NotSupportedException。
Throws | NotSupportedException: 抛出该异常指示非法的超时值。
英文文档：

setTransactionTimeout

public void setTransactionTimeout(long timeout)
                           throws NotSupportedException
Set the transaction timeout value for a imported transaction.

Parameters:
timeout - transaction timeout value in seconds. Only positive non-zero values are accepted. Other values are illegal and are rejected with a NotSupportedException.
Throws:
NotSupportedException - thrown to indicate an illegal timeout value.

public long getTransactionTimeout()
获取导入事务的事务超时值。
return 指定的事务超时值（以秒为单位）。未指定超时值或者指定了非法的超时值时，返回值 -1 (WorkManager.UNKNOWN)；此类事务将不会进行常规超时处理。
英文文档：

getTransactionTimeout

public long getTransactionTimeout()
Get the transaction timeout value for a imported transaction.

Returns:
the specified transaction timeout value in seconds. When no timeout value or an illegal timeout value had been specified, a value of -1 (WorkManager.UNKNOWN) is returned; such a transaction is excluded from regular timeout processing.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


WorkAdapter (Java EE 5)

javax.resource.spi.work
Class WorkAdapter

java.lang.Object
    extended by  javax.resource.spi.work.WorkAdapter
All Implemented Interfaces:
EventListener, WorkListener
public class WorkAdapter
extends Object
implements WorkListener

Implements: WorkListener

提供此类的目的是为了便于轻松创建 WorkListener 实例：只需扩展此类并只重写感兴趣的那些方法。
version 1.0
英文文档：

This class is provided as a convenience for easily creating WorkListener instances by extending this class and overriding only those methods of interest.

Version:
1.0
Author:
Ram Jeyaraman

Constructor Summary
WorkAdapter()
Method Summary
void | workAccepted(WorkEvent e) Invoked when a Work instance has been accepted.
void | workCompleted(WorkEvent e) Invoked when a Work instance has completed execution.
void | workRejected(WorkEvent e) Invoked when a Work instance has been rejected.
void | workStarted(WorkEvent e) Invoked when a Work instance has started execution.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public WorkAdapter()
英文文档：

WorkAdapter

public WorkAdapter()
Method Detail

public void workAccepted(WorkEvent e)
接受 Work 实例时调用。
英文文档：

workAccepted

public void workAccepted(WorkEvent e)
Invoked when a Work instance has been accepted.

Specified by:
workAccepted in interface WorkListener

public void workRejected(WorkEvent e)
拒绝 Work 实例时调用。
英文文档：

workRejected

public void workRejected(WorkEvent e)
Invoked when a Work instance has been rejected.

Specified by:
workRejected in interface WorkListener

public void workStarted(WorkEvent e)
Work 实例开始执行时调用。这仅仅意味着分配了一个线程。
英文文档：

workStarted

public void workStarted(WorkEvent e)
Invoked when a Work instance has started execution. This only means that a thread has been allocated.

Specified by:
workStarted in interface WorkListener

public void workCompleted(WorkEvent e)
Work 实例完成执行时调用。
英文文档：

workCompleted

public void workCompleted(WorkEvent e)
Invoked when a Work instance has completed execution.

Specified by:
workCompleted in interface WorkListener
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkEvent (Java EE 5)

javax.resource.spi.work
Class WorkEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.resource.spi.work.WorkEvent
All Implemented Interfaces:
Serializable
public class WorkEvent
extends EventObject

Extends: java.util.EventObject

此类模型在处理 Work 实例期间发生的各种事件。
version 1.0
英文文档：

This class models the various events that occur during the processing of a Work instance.

Version:
1.0
Author:
Ram Jeyaraman
See Also:
Serialized Form

Field Summary
static int | WORK_ACCEPTED Indicates Work instance has been accepted.
static int | WORK_COMPLETED Indicates Work instance has completed execution.
static int | WORK_REJECTED Indicates Work instance has been rejected.
static int | WORK_STARTED Indicates Work instance has started execution.
Fields inherited from class java.util.EventObject
source
Constructor Summary
WorkEvent(Object source, int type, Work work, WorkException exc)
Constructor.
WorkEvent(Object source, int type, Work work, WorkException exc, long startDuration)
Constructor.
Method Summary
WorkException | getException() Return the WorkException.
long | getStartDuration() Return the start interval duration.
int | getType() Return the type of this event.
Work | getWork() Return the Work instance which is the cause of the event.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

WORK_ACCEPTED

public static final int WORK_ACCEPTED
Indicates Work instance has been accepted.

See Also:
Constant Field Values

英文文档：

WORK_REJECTED

public static final int WORK_REJECTED
Indicates Work instance has been rejected.

See Also:
Constant Field Values

英文文档：

WORK_STARTED

public static final int WORK_STARTED
Indicates Work instance has started execution.

See Also:
Constant Field Values

英文文档：

WORK_COMPLETED

public static final int WORK_COMPLETED
Indicates Work instance has completed execution.

See Also:
Constant Field Values
Constructor Detail

public WorkEvent(Object source, int type, Work work, WorkException exc)
构造方法。
source | 最初发生事件的对象。
type | 事件类型。
work | 发生事件的 Work 对象。
exc | 处理 Work 时发生的异常。
英文文档：

WorkEvent

public WorkEvent(Object source,
                 int type,
                 Work work,
                 WorkException exc)
Constructor.

Parameters:
source - The object on which the event initially occurred.
type - The event type.
work - The Work object on which the event occured.
exc - The exception that occured during Work processing.

public WorkEvent(Object source, int type, Work work, WorkException exc, long startDuration)
构造方法。
source | 最初发生事件的对象。
type | 事件类型。
work | 发生事件的 Work 对象。
exc | 处理 Work 时发生的异常。
startDuration | 开始延迟期限（以毫秒为单位）。
英文文档：

WorkEvent

public WorkEvent(Object source,
                 int type,
                 Work work,
                 WorkException exc,
                 long startDuration)
Constructor.

Parameters:
source - The object on which the event initially occurred.
type - The event type.
work - The Work object on which the event occured.
exc - The exception that occured during Work processing.
startDuration - The start delay duration (in milliseconds).
Method Detail

public int getType()
返回此事件的类型。
return 事件类型。
英文文档：

getType

public int getType()
Return the type of this event.

Returns:
the event type.

public Work getWork()
返回作为事件原因的 Work 实例。
return Work 实例。
英文文档：

getWork

public Work getWork()
Return the Work instance which is the cause of the event.

Returns:
the Work instance.

public long getStartDuration()
返回开始时间间隔期限。
return 从接受 Work 开始直到开始执行 Work 所经过的时间（以毫秒为单位）。注意，此方法不提供实时保证。如果实际开始时间间隔期限未知，则返回 -1 是有效的。
英文文档：

getStartDuration

public long getStartDuration()
Return the start interval duration.

Returns:
the time elapsed (in milliseconds) since the Work was accepted, until the Work execution started. Note, this does not offer real-time guarantees. It is valid to return -1, if the actual start interval duration is unknown.

public WorkException getException()
返回 WorkException。根据事件类型返回的实际 WorkException 子类型。
return WorkRejectedException 或 WorkCompletedException（如果有）。
英文文档：

getException

public WorkException getException()
Return the WorkException. The actual WorkException subtype returned depends on the type of the event.

Returns:
a WorkRejectedException or a WorkCompletedException, if any.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkCompletedException (Java EE 5)

javax.resource.spi.work
Class WorkCompletedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.work.WorkException
                    extended by  javax.resource.spi.work.WorkCompletedException
All Implemented Interfaces:
Serializable
public class WorkCompletedException
extends WorkException

Extends: Throwable > Exception > ResourceException > WorkException

此异常由 WorkManager 抛出，指示提交的 Work 实例已完成，但有一个异常。

只能在开始执行 Work 实例之后（即已经为 Work 执行分配线程之后）抛出此异常。分配的线程设置执行上下文（如果已指定），然后调用 Work.run()。

在执行上下文设置或 Work 执行期间（即在 Work.run() 期间）抛出的任何异常都链接到该异常中。

关联的错误代码指示错误情况的本质。可能的错误代码有 WorkException.TX_RECREATE_FAILED、WorkException.TX_CONCURRENT_WORK_DISALLOWED 或 WorkException.UNDEFINED。

version 1.0
英文文档：

This exception is thrown by a WorkManager to indicate that a submitted Work instance has completed with an exception.

This could be thrown only after the execution of a Work instance has started (that is, after a thread has been allocated for Work execution). The allocated thread sets up an execution context (if it has been specified), and then calls Work.run().

Any exception thrown during execution context setup or during Work execution (that is, during Work.run()) is chained within this exception.

An associated error code indicates the nature of the error condition. Possible error codes are WorkException.TX_RECREATE_FAILED, WorkException.TX_CONCURRENT_WORK_DISALLOWED or WorkException.UNDEFINED.

Version:
1.0
Author:
Ram Jeyaraman
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.resource.spi.work.WorkException
INTERNAL, START_TIMED_OUT, TX_CONCURRENT_WORK_DISALLOWED, TX_RECREATE_FAILED, UNDEFINED
Constructor Summary
WorkCompletedException()
Constructs a new instance with null as its detail message.
WorkCompletedException(String message)
Constructs a new instance with the specified detail message.
WorkCompletedException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
WorkCompletedException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
WorkCompletedException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public WorkCompletedException()
构造一个新实例，其详细消息为 null。
英文文档：

WorkCompletedException

public WorkCompletedException()
Constructs a new instance with null as its detail message.

public WorkCompletedException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

WorkCompletedException

public WorkCompletedException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public WorkCompletedException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

WorkCompletedException

public WorkCompletedException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public WorkCompletedException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

WorkCompletedException

public WorkCompletedException(String message,
                              Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public WorkCompletedException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

WorkCompletedException

public WorkCompletedException(String message,
                              String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkException (Java EE 5)

javax.resource.spi.work
Class WorkException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.work.WorkException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
WorkCompletedException, WorkRejectedException
public class WorkException
extends ResourceException

Extends: Throwable > Exception > ResourceException
Extended by: WorkCompletedException, WorkRejectedException

所有与 Work 处理有关的异常的公共基本类。
version 1.0
英文文档：

A common base class for all Work processing related exceptions.

Version:
1.0
Author:
Ram Jeyaraman
See Also:
Serialized Form

Field Summary
static String | INTERNAL Indicates an internal error condition.
static String | START_TIMED_OUT Indicates start timeout expiration.
static String | TX_CONCURRENT_WORK_DISALLOWED Indicates that concurrent work within a transaction is disallowed.
static String | TX_RECREATE_FAILED Indicates a failure in recreating the specified transaction context.
static String | UNDEFINED Undefined error code.
Constructor Summary
WorkException()
Constructs a new instance with null as its detail message.
WorkException(String message)
Constructs a new instance with the specified detail message.
WorkException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
WorkException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
WorkException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

INTERNAL

public static final String INTERNAL
Indicates an internal error condition.

See Also:
Constant Field Values

英文文档：

UNDEFINED

public static final String UNDEFINED
Undefined error code.

See Also:
Constant Field Values

英文文档：

START_TIMED_OUT

public static final String START_TIMED_OUT
Indicates start timeout expiration.

See Also:
Constant Field Values

英文文档：

TX_CONCURRENT_WORK_DISALLOWED

public static final String TX_CONCURRENT_WORK_DISALLOWED
Indicates that concurrent work within a transaction is disallowed. That is, there is already another Work instance associated with the specified transaction context.

See Also:
Constant Field Values

英文文档：

TX_RECREATE_FAILED

public static final String TX_RECREATE_FAILED
Indicates a failure in recreating the specified transaction context.

See Also:
Constant Field Values
Constructor Detail

public WorkException()
构造一个新实例，其详细消息为 null。
英文文档：

WorkException

public WorkException()
Constructs a new instance with null as its detail message.

public WorkException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

WorkException

public WorkException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public WorkException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的链异常
英文文档：

WorkException

public WorkException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public WorkException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的链异常
英文文档：

WorkException

public WorkException(String message,
                     Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public WorkException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

WorkException

public WorkException(String message,
                     String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WorkRejectedException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.resource.spi.work
Class WorkRejectedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.resource.ResourceException
                extended by  javax.resource.spi.work.WorkException
                    extended by  javax.resource.spi.work.WorkRejectedException
All Implemented Interfaces:
Serializable
public class WorkRejectedException
extends WorkException

Extends: Throwable > Exception > ResourceException > WorkException

此异常由 WorkManager 抛出，指示提交的 Work 实例已被拒绝。拒绝的原因可能是内部因素或者启动时间超时。

只能在开始执行 Work 实例之前（即已为 Work 执行分配线程之前）抛出此异常。

关联的错误代码指示错误情况的本质。可能的错误代码有 WorkException.START_TIMED_OUT、WorkException.INTERNAL 或 WorkException.UNDEFINED。

version 1.0
英文文档：

This exception is thrown by a WorkManager to indicate that a submitted Work instance has been rejected. The rejection could be due to internal factors or start timeout expiration.

This could be thrown only before the execution of a Work instance starts (that is, before a thread has been allocated for Work execution).

An associated error code indicates the nature of the error condition. Possible error codes are WorkException.START_TIMED_OUT, WorkException.INTERNAL or WorkException.UNDEFINED.

Version:
1.0
Author:
Ram Jeyaraman
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.resource.spi.work.WorkException
INTERNAL, START_TIMED_OUT, TX_CONCURRENT_WORK_DISALLOWED, TX_RECREATE_FAILED, UNDEFINED
Constructor Summary
WorkRejectedException()
Constructs a new instance with null as its detail message.
WorkRejectedException(String message)
Constructs a new instance with the specified detail message.
WorkRejectedException(String message, String errorCode)
Constructs a new throwable with the specified detail message and an error code.
WorkRejectedException(String message, Throwable cause)
Constructs a new throwable with the specified detail message and cause.
WorkRejectedException(Throwable cause)
Constructs a new throwable with the specified cause.
Method Summary
Methods inherited from class javax.resource.ResourceException
getErrorCode, getLinkedException, getMessage, setErrorCode, setLinkedException
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public WorkRejectedException()
构造一个新实例，其详细消息为 null。
英文文档：

WorkRejectedException

public WorkRejectedException()
Constructs a new instance with null as its detail message.

public WorkRejectedException(String message)
构造带有指定详细消息的新实例。
message 详细消息。
英文文档：

WorkRejectedException

public WorkRejectedException(String message)
Constructs a new instance with the specified detail message.

Parameters:
message - the detail message.

public WorkRejectedException(Throwable cause)
构造带有指定 cause 的新 throwable。
cause Throwable 类型的异常链。
英文文档：

WorkRejectedException

public WorkRejectedException(Throwable cause)
Constructs a new throwable with the specified cause.

Parameters:
cause - a chained exception of type Throwable.

public WorkRejectedException(String message, Throwable cause)
构造带有指定详细消息和 cause 的新 throwable。
message | 详细消息。
cause | Throwable 类型的异常链。
英文文档：

WorkRejectedException

public WorkRejectedException(String message,
                             Throwable cause)
Constructs a new throwable with the specified detail message and cause.

Parameters:
message - the detail message.
cause - a chained exception of type Throwable.

public WorkRejectedException(String message, String errorCode)
创建带指定详细消息和错误代码的新 throwable。
message | 对异常的描述。
errorCode | 指定特定于供应商的错误代码的字符串。
英文文档：

WorkRejectedException

public WorkRejectedException(String message,
                             String errorCode)
Constructs a new throwable with the specified detail message and an error code.

Parameters:
message - a description of the exception.
errorCode - a string specifying the vendor specific error code.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.security.jacc (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.security.jacc

This package contains the Java Authorization Contract for Containers API

See:
Description

Interface Summary
PolicyConfiguration | The methods of this interface are used by containers to create policy statements in a Policy provider.
PolicyContextHandler | This interface defines the methods that must be implemented by handlers that are to be registered and activated by the PolicyContext class.

Class Summary
EJBMethodPermission | Class for EJB method permissions.
EJBRoleRefPermission | Class for EJB isCallerInRole (String reference) permissions.
PolicyConfigurationFactory | Abstract factory and finder class for obtaining the instance of the class that implements the PolicyConfigurationFactory of a provider.
PolicyContext | This utility class is used by containers to communicate policy context identifiers and other policy relevant context to Policy providers.
WebResourcePermission | Class for Servlet web resource permissions.
WebRoleRefPermission | Class for Servlet isUserInRole (String reference) permissions.
WebUserDataPermission | Class for Servlet Web user data permissions.

Exception Summary
PolicyContextException This checked exception is thrown by implementations of the javax.security.jacc.PolicyConfiguration Interface, the javax.security.jacc.PolicyConfigurationFactory abstract class, the javax.security.jacc.PolicyContext utility class, and implementations of the javax.security.jacc.PolicyContextException Interface.

Package javax.security.jacc Description

This package contains the Java Authorization Contract for Containers API

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.security.jacc Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.security.jacc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.security.Permission (implements java.security.Guard, java.io.Serializable)
      • javax.security.jacc.EJBMethodPermission (implements java.io.Serializable)
      • javax.security.jacc.EJBRoleRefPermission (implements java.io.Serializable)
      • javax.security.jacc.WebResourcePermission (implements java.io.Serializable)
      • javax.security.jacc.WebRoleRefPermission (implements java.io.Serializable)
      • javax.security.jacc.WebUserDataPermission (implements java.io.Serializable)
    • javax.security.jacc.PolicyConfigurationFactory
    • javax.security.jacc.PolicyContext
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.security.jacc.PolicyContextException

Interface Hierarchy

  • javax.security.jacc.PolicyConfiguration
  • javax.security.jacc.PolicyContextHandler
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


PolicyConfiguration (Java EE 5)

javax.security.jacc
Interface PolicyConfiguration

public interface PolicyConfiguration

容器使用此接口的方法在 Policy 提供者中创建策略语句。实现 PolicyConfiguration 接口的对象为相应 Policy 提供者的相应策略上下文提供策略语句配置接口。

策略上下文的生命周期定义有三个状态："open"、"inService" 和 "deleted"。策略上下文处于这三种状态之一。

"open" 状态的策略上下文处于配置过程中，可以被 PolicyConfiguration 接口的任何方法操作。处于 "open" 状态的策略上下文不得使用 Policy.refresh 合并到 Policy 提供者执行其访问决定时所使用的策略语句中。为了让关联提供者合并策略上下文的策略语句，策略上下文必须处于 "inService" 状态。调用 commit 方法可以将处于 "open" 状态的策略上下文转换为 "inService" 状态。

处于 "inService" 状态的策略上下文可以合并到关联 Policy 提供者用于执行访问决定的策略语句。当调用提供者的 refresh 方法时，提供者合并包含策略语句的策略上下文。当调用提供者的 refresh 方法时，只能合并状态为 "inService" 的策略上下文，并必须确保置入每个策略上下文服务中的策略语句只包含调用 refresh 时在上下文中定义的那些语句。处于 "inService" 状态的策略上下文无法进行其他配置，可以通过调用 PolicyConfigurationFactory 的 getPolicyConfiguration 方法返回 "open" 状态。

处于 "deleted" 状态的策略上下文不能配置，也不能合并到 Provider。通过调用关联 PolicyConfigurationFactory 的 getPolicyConfiguration 方法，可以回收状态为 "deleted" 的策略上下文，以供后续处理。作为调用 getPolicyConfiguration 的结果返回时，"deleted" 策略上下文将转换为 "open" 状态。

下表说明策略上下文生命周期与 PolicyConfiguration 接口方法之间的对应关系。表的右边 3 列对应于列标题标识的 PolicyConfiguration 状态。这些列单元中的值表示调用相应行最左侧列中标识的方法后得到的下一个状态，或者表示在该列所表示的状态下不支持调用该方法（在此情况下，状态将保持不变）。

PolicyConfiguration 状态表
方法 | 当前状态到下一个状态
 | deleted | open | inService
addToExcludedPolicy | 不支持该操作 | open | 不支持该操作
addToRole | 不支持该操作 | open | 不支持该操作
addToUncheckedPolicy | 不支持该操作 | open | 不支持该操作
commit | 不支持该操作 | inService | inService
delete | deleted | deleted | deleted
getContextID | deleted | open | inService
inService | deleted | open | inService
linkConfiguration | 不支持该操作 | open | 不支持该操作
removeExcludedPolicy | 不支持该操作 | open | 不支持该操作
removeRole | 不支持该操作 | open | 不支持该操作
removeUncheckedPolicy | 不支持该操作 | open | 不支持该操作

要使提供者的实现与多线程环境兼容，可能需要将提供者的 refresh 方法与其 PolicyConfiguration 接口的方法，以及其 PolicyConfigurationFactory 的 getPolicyConfiguration 和 inService 方法相匹配。

See also java.security.Permission, java.security.PermissionCollection, javax.security.jacc.PolicyContextException, javax.security.jacc.PolicyConfigurationFactory
英文文档：

The methods of this interface are used by containers to create policy statements in a Policy provider. An object that implements the PolicyConfiguration interface provides the policy statement configuration interface for a corresponding policy context within the corresponding Policy provider.

The life cycle of a policy context is defined by three states; "open", "inService", and "deleted". A policy context is in one of these three states.

A policy context in the "open" state is in the process of being configured, and may be operated on by any of the methods of the PolicyConfiguration interface. A policy context in the "open" state must not be assimilated at Policy.refresh into the policy statements used by the Policy provider in performing its access decisions. In order for the policy statements of a policy context to be assimilated by the associated provider, the policy context must be in the "inService" state. A policy context in the "open" state is transitioned to the "inService" state by calling the commit method.

A policy context in the "inService" state is available for assimilation into the policy statements being used to perform access decisions by the associated Policy provider. Providers assimilate policy contexts containing policy statements when the refresh method of the provider is called. When a provider's refresh method is called, it must assimilate only those policy contexts whose state is "inService" and it must ensure that the policy statements put into service for each policy context are only those defined in the context at the time of the call to refresh. A policy context in the "inService" state is not available for additional configuration and may be returned to the "open" state by calling the getPolicyConfiguration method of the PolicyConfigurationFactory.

A policy context in the "deleted" state is neither available for configuration, nor is it available for assimilation into the Provider. A policy context whose state is "deleted" may be reclaimed for subsequent processing by calling the getPolicyConfiguration method of the associated PolicyConfigurationFactory. A "deleted" policy context is transitioned to the "open" state when it it returned as a result of a call to getPolicyConfiguration.

The following table captures the correspondence between the policy context life cycle and the methods of the PolicyConfiguration interface. The rightmost 3 columns of the table correspond to the PolicyConfiguration state identified at the head of the column. The values in the cells of these columns indicate the next state resulting from a call to the method identifed in the leftmost column of the corresponding row, or that calling the method is unsupported in the state represented by the column (in which case the state will remain unchanged).

PolicyConfiguration State Table
Method | Current State to Next State
 | deleted | open | inService
addToExcludedPolicy | Unsupported Operation | open | Unsupported Operation
addToRole | Unsupported Operation | open | Unsupported Operation
addToUncheckedPolicy | Unsupported Operation | open | Unsupported Operation
commit | Unsupported Operation | inService | inService
delete | deleted | deleted | deleted
getContextID | deleted | open | inService
inService | deleted | open | inService
linkConfiguration | Unsupported Operation | open | Unsupported Operation
removeExcludedPolicy | Unsupported Operation | open | Unsupported Operation
removeRole | Unsupported Operation | open | Unsupported Operation
removeUncheckedPolicy | Unsupported Operation | open | Unsupported Operation

For a provider implementation to be compatible with multi-threaded environments, it may be necessary to synchronize the refresh method of the provider with the methods of its PolicyConfiguration interface and with the getPolicyConfiguration and inService methods of its PolicyConfigurationFactory.

Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, PermissionCollection, PolicyContextException, PolicyConfigurationFactory

Method Summary
void | addToExcludedPolicy(Permission permission) Used to add a single excluded policy statement to this PolicyConfiguration.
void | addToExcludedPolicy(PermissionCollection permissions) Used to add excluded policy statements to this PolicyConfiguration.
void | addToRole(String roleName, Permission permission) Used to add a single permission to a named role in this PolicyConfiguration.
void | addToRole(String roleName, PermissionCollection permissions) Used to add permissions to a named role in this PolicyConfiguration.
void | addToUncheckedPolicy(Permission permission) Used to add a single unchecked policy statement to this PolicyConfiguration.
void | addToUncheckedPolicy(PermissionCollection permissions) Used to add unchecked policy statements to this PolicyConfiguration.
void | commit() This method is used to set to "inService" the state of the policy context whose interface is this PolicyConfiguration Object.
void | delete() Causes all policy statements to be deleted from this PolicyConfiguration and sets its internal state such that calling any method, other than delete, getContextID, or inService on the PolicyConfiguration will be rejected and cause an UnsupportedOperationException to be thrown.
String | getContextID() This method returns this object's policy context identifier.
boolean | inService() This method is used to determine if the policy context whose interface is this PolicyConfiguration Object is in the "inService" state.
void | linkConfiguration(PolicyConfiguration link) Creates a relationship between this configuration and another such that they share the same principal-to-role mappings.
void | removeExcludedPolicy() Used to remove any excluded policy statements from this PolicyConfiguration.
void | removeRole(String roleName) Used to remove a role and all its permissions from this PolicyConfiguration.
void | removeUncheckedPolicy() Used to remove any unchecked policy statements from this PolicyConfiguration.

Method Detail

public String getContextID() throws PolicyContextException
此方法返回此对象的策略上下文标识符。
return | 此对象的策略上下文标识符。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | PolicyContextException: 如果实现抛出 getContextID 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

getContextID

String getContextID()
                    throws PolicyContextException
This method returns this object's policy context identifier.

Returns:
this object's policy context identifier.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the getContextID method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void addToRole(String roleName, java.security.PermissionCollection permissions) throws PolicyContextException
用于将权限添加到此 PolicyConfiguration 中的指定角色。如果指定的 Role 不存在于 PolicyConfiguration 中，则调用此函数将创建它。

Policy 提供者负责确保添加到角色的所有权限都遵守“映射到角色”的原则。

roleName | 要添加权限的角色的名称。
permissions | 要添加到角色的权限 Collection。Collection 可能是同质 Collection，也可能是异构 Collection。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 addToRole 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

addToRole

void addToRole(String roleName,
               PermissionCollection permissions)
               throws PolicyContextException
Used to add permissions to a named role in this PolicyConfiguration. If the named Role does not exist in the PolicyConfiguration, it is created as a result of the call to this function.

It is the job of the Policy provider to ensure that all the permissions added to a role are granted to principals "mapped to the role".

Parameters:
roleName - the name of the Role to which the permissions are to be added.

permissions - the collection of permissions to be added to the role. The collection may be either a homogenous or heterogenous collection.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the addToRole method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void addToRole(String roleName, java.security.Permission permission) throws PolicyContextException
用于将单个权限添加到此 PolicyConfiguration 中的指定角色。如果指定的 Role 不存在于 PolicyConfiguration 中，则调用此函数将创建它。

Policy 提供者负责确保添加到角色的所有权限都遵守“映射到角色”的原则。

roleName | 要添加权限的角色的名称。
permission | 要添加到角色的权限。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 addToRole 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

addToRole

void addToRole(String roleName,
               Permission permission)
               throws PolicyContextException
Used to add a single permission to a named role in this PolicyConfiguration. If the named Role does not exist in the PolicyConfiguration, it is created as a result of the call to this function.

It is the job of the Policy provider to ensure that all the permissions added to a role are granted to principals "mapped to the role".

Parameters:
roleName - the name of the Role to which the permission is to be added.

permission - the permission to be added to the role.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the addToRole method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void addToUncheckedPolicy(java.security.PermissionCollection permissions) throws PolicyContextException
用于将未经检查的策略语句添加到此 PolicyConfiguration。

permissions | 要作为未经检查的策略语句添加的权限 Collection。Collection 可能是同质 Collection，也可能是异构 Collection。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 addToUncheckedPolicy 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

addToUncheckedPolicy

void addToUncheckedPolicy(PermissionCollection permissions)
                          throws PolicyContextException
Used to add unchecked policy statements to this PolicyConfiguration.

Parameters:
permissions - the collection of permissions to be added as unchecked policy statements. The collection may be either a homogenous or heterogenous collection.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the addToUncheckedPolicy method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void addToUncheckedPolicy(java.security.Permission permission) throws PolicyContextException
用于将未经检查的单个策略语句添加到此 PolicyConfiguration。

permission | 要添加到未经检查的策略语句的权限。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 addToUncheckedPolicy 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

addToUncheckedPolicy

void addToUncheckedPolicy(Permission permission)
                          throws PolicyContextException
Used to add a single unchecked policy statement to this PolicyConfiguration.

Parameters:
permission - the permission to be added to the unchecked policy statements.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the addToUncheckedPolicy method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void addToExcludedPolicy(java.security.PermissionCollection permissions) throws PolicyContextException
用于将已排除的策略语句添加到此 PolicyConfiguration。

permissions | 要添加到已排除的策略语句的权限 Collection。Collection 可能是同质 Collection，也可能是异构 Collection。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 addToExcludedPolicy 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

addToExcludedPolicy

void addToExcludedPolicy(PermissionCollection permissions)
                         throws PolicyContextException
Used to add excluded policy statements to this PolicyConfiguration.

Parameters:
permissions - the collection of permissions to be added to the excluded policy statements. The collection may be either a homogenous or heterogenous collection.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the addToExcludedPolicy method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void addToExcludedPolicy(java.security.Permission permission) throws PolicyContextException
用于将已排除的单个策略语句添加到此 PolicyConfiguration。

permission | 要添加到已排除的策略语句的权限。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 addToExcludedPolicy 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

addToExcludedPolicy

void addToExcludedPolicy(Permission permission)
                         throws PolicyContextException
Used to add a single excluded policy statement to this PolicyConfiguration.

Parameters:
permission - the permission to be added to the excluded policy statements.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the addToExcludedPolicy method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void removeRole(String roleName) throws PolicyContextException
用于从此 PolicyConfiguration 中移除角色及其所有权限。

roleName | 要从此 PolicyConfiguration 中移除的角色的名称。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 removeRole 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

removeRole

void removeRole(String roleName)
                throws PolicyContextException
Used to remove a role and all its permissions from this PolicyConfiguration.

Parameters:
roleName - the name of the Role to remove from this PolicyConfiguration.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the removeRole method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void removeUncheckedPolicy() throws PolicyContextException
用于从此 PolicyConfiguration 中移除所有未经检查的策略语句。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 removeUncheckedPolicy 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

removeUncheckedPolicy

void removeUncheckedPolicy()
                           throws PolicyContextException
Used to remove any unchecked policy statements from this PolicyConfiguration.

Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the removeUncheckedPolicy method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void removeExcludedPolicy() throws PolicyContextException
用于从此 PolicyConfiguration 中移除所有已排除的策略语句。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | PolicyContextException: 如果实现抛出 removeExcludedPolicy 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

removeExcludedPolicy

void removeExcludedPolicy()
                          throws PolicyContextException
Used to remove any excluded policy statements from this PolicyConfiguration.

Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the removeExcludedPolicy method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void linkConfiguration(PolicyConfiguration link) throws PolicyContextException
在此配置与另一个配置之间创建关系，使它们共享相同的主体到角色映射。将 PolicyConfiguration 链接起来，以对多个独立的可管理 PolicyConfiguration 应用公共的主体到角色映射，应用程序由多个模块构成时需要这样做。

注意，链接到另一个 PolicyConfiguration 的配置不会影响 PolicyConfiguration 中构成角色或者已排除（或未经检查）策略 Collection 的策略语句。

link | 对另一个 PolicyConfiguration（非此 PolicyConfiguration）的引用。 此方法所形成的关系是对称的、可传递的、幂等的。如果参数 PolicyConfiguration 与此 PolicyConfiguration 的 Policy 上下文标识符相同，则不会形成任何关系，并抛出如下所述的异常。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted" 或 "inService"。
Throws | IllegalArgumentException: 如果调用时使用的参数 PolicyConfiguration 的 Policy 上下文与此 PolicyConfiguration 的 Policy 上下文相同。
Throws | PolicyContextException: 如果实现抛出 linkConfiguration 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

linkConfiguration

void linkConfiguration(PolicyConfiguration link)
                       throws PolicyContextException
Creates a relationship between this configuration and another such that they share the same principal-to-role mappings. PolicyConfigurations are linked to apply a common principal-to-role mapping to multiple seperately manageable PolicyConfigurations, as is required when an application is composed of multiple modules.

Note that the policy statements which comprise a role, or comprise the excluded or unchecked policy collections in a PolicyConfiguration are unaffected by the configuration being linked to another.

Parameters:
link - a reference to a different PolicyConfiguration than this PolicyConfiguration.

The relationship formed by this method is symetric, transitive and idempotent. If the argument PolicyConfiguration does not have a different Policy context identifier than this PolicyConfiguration no relationship is formed, and an exception, as described below, is thrown.

Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" or "inService" when this method is called.
IllegalArgumentException - if called with an argument PolicyConfiguration whose Policy context is equivalent to that of this PolicyConfiguration.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the linkConfiguration method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void delete() throws PolicyContextException
删除此 PolicyConfiguration 中的所有策略语句，设置其内部状态，使得对 PolicyConfiguration 调用 delete、getContextID 或 inService 以外的任何方法都将遭到拒绝，并抛出 UnsupportedOperationException。

除了移除与已删除的 PolicyConfiguration 有关的任何链接外，此操作不会影响任何链接的 PolicyConfiguration。

Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | PolicyContextException: 如果实现抛出 delete 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

delete

void delete()
            throws PolicyContextException
Causes all policy statements to be deleted from this PolicyConfiguration and sets its internal state such that calling any method, other than delete, getContextID, or inService on the PolicyConfiguration will be rejected and cause an UnsupportedOperationException to be thrown.

This operation has no affect on any linked PolicyConfigurations other than removing any links involving the deleted PolicyConfiguration.

Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the delete method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public void commit() throws PolicyContextException
此方法用于将接口为此 PolicyConfiguration 对象的策略上下文的状态设置为 "inService"。只有状态为 "inService" 的策略上下文才会包含在由 Policy.refresh 方法处理的策略上下文中。通过调用 PolicyConfiguration 工厂的 getPolicyConfiguration 方法，并使用策略上下文的策略上下文标识符作为参数，可以使状态为 "inService" 的策略上下文返回 "open" 状态。

当策略上下文的状态为 "inService" 时，对其 PolicyConfiguration 对象调用 commit、delete、getContextID 或 inService 以外的任何方法将会抛出 UnsupportedOperationException。

Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | UnsupportedOperationException: 如果调用此方法时，接口为此 PolicyConfiguration 对象的策略上下文的状态是 "deleted"。
Throws | PolicyContextException: 如果实现抛出 commit 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

commit

void commit()
            throws PolicyContextException
This method is used to set to "inService" the state of the policy context whose interface is this PolicyConfiguration Object. Only those policy contexts whose state is "inService" will be included in the policy contexts processed by the Policy.refresh method. A policy context whose state is "inService" may be returned to the "open" state by calling the getPolicyConfiguration method of the PolicyConfiguration factory with the policy context identifier of the policy context.

When the state of a policy context is "inService", calling any method other than commit, delete, getContextID, or inService on its PolicyConfiguration Object will cause an UnsupportedOperationException to be thrown.

Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
UnsupportedOperationException - if the state of the policy context whose interface is this PolicyConfiguration Object is "deleted" when this method is called.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the commit method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

public boolean inService() throws PolicyContextException
此方法用于确定接口为此 PolicyConfiguration 对象的策略上下文是否处于 "inService" 状态。
return | 如果关联策略上下文的状态为 "inService"，则返回 true；否则返回 false。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | PolicyContextException: 如果实现抛出 inService 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

inService

boolean inService()
                  throws PolicyContextException
This method is used to determine if the policy context whose interface is this PolicyConfiguration Object is in the "inService" state.

Returns:
true if the state of the associated policy context is "inService"; false otherwise.
Throws:
SecurityException - if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the inService method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PolicyContextHandler (Java EE 5)

javax.security.jacc
Interface PolicyContextHandler

public interface PolicyContextHandler

此接口定义必须由 PolicyContext 类注册和激活的处理程序实现的方法。PolicyContext 类为容器提供注册和激活特定于容器的 PolicyContext 处理程序的方法。Policy 提供者使用 PolicyContext 类激活处理程序，以从容器中获取在其访问决定中应用的其他策略相关上下文。所有通过 PolicyContext 类注册和激活的处理程序必须实现 PolicyContextHandler 接口。
See also javax.security.jacc.PolicyContext, javax.security.jacc.PolicyContextException
英文文档：

This interface defines the methods that must be implemented by handlers that are to be registered and activated by the PolicyContext class. The PolicyContext class provides methods for containers to register and activate container-specific PolicyContext handlers. Policy providers use the PolicyContext class to activate handlers to obtain (from the container) additional policy relevant context to apply in their access decisions. All handlers registered and activated via the PolicyContext class must implement the PolicyContextHandler interface.

Author:
Ron Monzillo, Gary Ellison
See Also:
PolicyContext, PolicyContextException

Method Summary
Object | getContext(String key, Object data) This public method is used by the PolicyContext class to activate the handler and obtain from it the context object identified by the (case-sensitive) key.
String[] | getKeys() This public method returns the keys identifying the context objects supported by the handler.
boolean | supports(String key) This public method returns a boolean result indicating whether or not the handler supports the context object identified by the (case-sensitive) key value.

Method Detail

public boolean supports(String key) throws PolicyContextException
此公共方法返回 boolean 结果，指示处理程序是否支持密钥值（区分大小写）标识的上下文对象。
key | 标识可能由处理程序支持的上下文对象的 String 值。此参数的值不得为 null。
return | 指示处理程序是否处理与参数密钥对应的上下文对象的 boolean 值。
Throws | PolicyContextException: 如果实现抛出方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

supports

boolean supports(String key)
                 throws PolicyContextException
This public method returns a boolean result indicating whether or not the handler supports the context object identified by the (case-sensitive) key value.

Parameters:
key - a String value identifying a context object that could be supported by the handler. The value of this parameter must not be null.
Returns:
a boolean indicating whether or not the context object corresponding to the argument key is handled by the handler.
Throws:
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException

public String[] getKeys() throws PolicyContextException
此公共方法返回标识处理程序支持的上下文对象的键。处理程序支持的每个键的值必须为非 null String 值。
return | 包含标识处理程序支持的上下文对象的 String 值的数组。数组不得包含重复的键值。如果处理程序不支持任何键（这种情况不太可能发生），则处理程序必须返回长度为 0 的数组。此方法一定不会返回 null 值。
Throws | PolicyContextException: 如果实现抛出方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

getKeys

String[] getKeys()
                 throws PolicyContextException
This public method returns the keys identifying the context objects supported by the handler. The value of each key supported by a handler must be a non-null String value.

Returns:
an array containing String values identifing the context objects supported by the handler. The array must not contain duplicate key values. In the unlikely case that the Handler supports no keys, the handler must return a zero length array. The value null must never be returned by this method.
Throws:
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException

public Object getContext(String key, Object data) throws PolicyContextException
PolicyContext 类使用此公共方法激活处理程序，并从中获取由键（区分大小写）标识的上下文对象。除键外，还可以使用 PolicyContext 类中与线程（在其中调用此方法）关联的处理程序数据值激活处理程序。

注意，通过调用 PolicyContext.getContextID()，可以使用与线程关联的策略上下文标识符。

key | 标识处理程序返回的上下文对象的字符串。此参数的值不得为 null。
data | 与调用此方法的线程关联的处理程序数据 Object。注意，此参数传递的值可以为 null。
return | 包含所需上下文的特定于容器和处理程序的 Object。如果相应上下文的值为 null，则返回 null 值。
Throws | PolicyContextException: 如果实现抛出方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

getContext

Object getContext(String key,
                  Object data)
                  throws PolicyContextException
This public method is used by the PolicyContext class to activate the handler and obtain from it the context object identified by the (case-sensitive) key. In addition to the key, the handler will be activated with the handler data value associated within the PolicyContext class with the thread on which the call to this method is made.

Note that the policy context identifier associated with a thread is available to the handler by calling PolicyContext.getContextID().

Parameters:
key - a String that identifies the context object to be returned by the handler. The value of this paramter must not be null.
data - the handler data Object associated with the thread on which the call to this method has been made. Note that the value passed through this parameter may be null.
Returns:
The container and handler specific Object containing the desired context. A null value may be returned if the value of the corresponding context is null.
Throws:
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EJBMethodPermission (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.security.jacc
Class EJBMethodPermission

java.lang.Object
    extended by  java.security.Permission
        extended by  javax.security.jacc.EJBMethodPermission
All Implemented Interfaces:
Serializable, Guard
public final class EJBMethodPermission
extends Permission
implements Serializable

Extends: java.security.Permission
Implements: java.io.Serializable

EJB 方法权限的类。

EJBMethodPermission 的名称包含在应用程序部署描述符中标识目标 EJB 的 ejb-name 元素的值。

EJBMethodPermission 的 actions 标识权限所应用到的 EJB 的方法。

此类的实现可能实现 newPermissionCollection，也可能从超类继承其实现。

See also java.security.Permission
英文文档：

Class for EJB method permissions.

The name of an EJBMethodPermission contains the value of the ejb-name element in the application's deployment descriptor that identifies the target EJB.

The actions of an EJBMethodPermission identifies the methods of the EJB to which the permission applies.

Implementations of this class MAY implement newPermissionCollection or inherit its implementation from the super class.

Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, Serialized Form

Constructor Summary
EJBMethodPermission(String name, String actions)
Creates a new EJBMethodPermission with the specified name and actions.
EJBMethodPermission(String EJBName, String methodInterface, Method method)
Creates a new EJBMethodPermission with name corresponding to the EJBName and actions composed from methodInterface, and the Method object.
EJBMethodPermission(String EJBName, String methodName, String methodInterface, String[] methodParams)
Creates a new EJBMethodPermission with name corresponding to the EJBName and actions composed from methodName, methodInterface, and methodParams.
Method Summary
boolean | equals(Object o) Checks two EJBMethodPermission objects for equality.
String | getActions() Returns a String containing a canonical representation of the actions of this EJBMethodPermission.
int | hashCode() Returns the hash code value for this EJBMethodPermission.
boolean | implies(Permission permission) Determines if the argument Permission is "implied by" this EJBMethodPermission.
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

public EJBMethodPermission(String name, String actions)
使用指定名称和操作创建新的 EJBMethodPermission。

该名称包含在应用程序的部署描述符中与 EJB 对应的 ejb-name 元素的值。

actions 包含一个 methodSpec。actions 参数的语法定义如下：

methodNameSpec ::= methodName | emptyString

methodInterfaceName ::= String

methodInterfaceSpec ::= methodInterfaceName | emptyString

typeName ::= typeName | typeName []

methodParams ::= typeName | methodParams comma typeName

methodParamsSpec ::= emptyString | methodParams

methodSpec ::= null |
methodNameSpec |
methodNameSpec comma methodInterfaceName |
methodNameSpec comma methodInterfaceSpec comma methodParamsSpec

MethodInterfaceName 是一个非空 String，并且应该包含一个为在 EJB 部署描述符中使用而定义的 method-intf 值。实现必须灵活，这样它才能支持其他接口名称，尤其是如果这些名称通过 EJB 规范进行了标准化。EJB 规范当前定义了以下 method-intf 值：

{ "Home", "LocalHome", "Remote", "Local", "ServiceEndpoint" }

methodSpec 为 null 或空字符串指示权限应用到所有 EJB 方法。methodNameSpec 为空字符串的 methodSpec 匹配与该 methodSpec 的 methodInterface 和 methodParams 元素匹配的所有 EJB 方法。

methodInterfaceSpec 为空字符串的 methodSpec 匹配与该 methodSpec 的 methodNameSpec 和 methodParamsSpec 元素匹配的所有 EJB 方法。

不带 methodParamsSpec 的 methodSpec 匹配与该 methodSpec 的 methodNameSpec 和 methodInterface 元素匹配的所有 EJB 方法。

methodParams 数组中 typeNames 的顺序必须与对应参数在目标方法的方法签名中出现的顺序相匹配。methodParams 中的每个 typeName 必须包含相应参数 typeName 的规范形式（如 getActions 方法定义的那样）。带有空 methodParamsSpec 的 methodSpec 匹配与该 methodSpec 的 methodNameSpec 和 methodInterfaceSpec 元素匹配的所有 0 参数 EJB 方法。

name | EJB 的名称。
actions | 标识应用权限的 EJB 方法。
英文文档：

EJBMethodPermission

public EJBMethodPermission(String name,
                           String actions)
Creates a new EJBMethodPermission with the specified name and actions.

The name contains the value of the ejb-name element corresponding to an EJB in the application's deployment descriptor.

The actions contains a methodSpec. The syntax of the actions parameter is defined as follows:

      methodNameSpec ::= methodName | emptyString

      methodInterfaceName ::= String

      methodInterfaceSpec ::= methodInterfaceName | emptyString

      typeName ::= typeName | typeName []

      methodParams ::= typeName | methodParams comma typeName

      methodParamsSpec ::= emptyString | methodParams

      methodSpec ::= null |
           methodNameSpec |
           methodNameSpec comma methodInterfaceName |
           methodNameSpec comma methodInterfaceSpec comma methodParamsSpec

A MethodInterfaceName is a non-empty String and should contain a method-intf value as defined for use in EJB deployment descriptors. An implementation must be flexible such that it supports additional interface names especially if they are standardized by the EJB Specification. The EJB Specification currently defines the following method-intf values:

       { "Home", "LocalHome", "Remote", "Local", "ServiceEndpoint" }

A null or empty string methodSpec indicates that the permission applies to all methods of the EJB. A methodSpec with a methodNameSpec of the empty string matches all methods of the EJB that match the methodInterface and methodParams elements of the methodSpec.

A methodSpec with a methodInterfaceSpec of the empty string matches all methods of the EJB that match the methodNameSpec and methodParamsSpec elements of the methodSpec.

A methodSpec without a methodParamsSpec matches all methods of the EJB that match the methodNameSpec and methodInterface elements of the methodSpec.

The order of the typeNames in methodParams array must match the order of occurence of the corresponding parameters in the method signature of the target method(s). Each typeName in the methodParams must contain the canonical form of the corresponding parameter's typeName as defined by the getActions method. A methodSpec with an empty methodParamsSpec matches all 0 argument methods of the EJB that match the methodNameSpec and methodInterfaceSpec elements of the methodSpec.

Parameters:
name - of the EJB to which the permission pertains.

actions - identifies the methods of the EJB to which the permission pertains.

public EJBMethodPermission(String EJBName, String methodName, String methodInterface, String[] methodParams)
使用与 EJBName 相对应的名称，以及由 methodName、methodInterface 和 methodParams 组成的 actions 创建新的 EJBMethodPermission。

EJBName | EJB 名称的字符串表示形式，出现在部署描述符中相应的 ejb-name 元素中。
methodName | 可用于指示应用权限的 EJB 方法的字符串。null 或 "" 值指示权限属于所有匹配权限规范其他参数的方法，不考虑方法名称。
methodInterface | 可用于指定应用权限的 EJB 接口的字符串。null 或 "" 值指示权限属于所有匹配权限规范其他参数的方法，不考虑它们出现的接口。
methodParams | 可用于指定（按 typeNames）目标方法的参数签名的字符串数组。methodParams 数组中 typeNames 的顺序必须与对应参数在目标方法的方法签名中出现的顺序相匹配。methodParams 数组中的每个 typeName 必须包含相应参数 typeName 的规范形式（如 getActions 方法定义的那样）。空 methodParams 数组用于表示不带参数的方法签名。null 值指示权限属于所有匹配权限规范其他参数的方法，不考虑方法签名。
英文文档：

EJBMethodPermission

public EJBMethodPermission(String EJBName,
                           String methodName,
                           String methodInterface,
                           String[] methodParams)
Creates a new EJBMethodPermission with name corresponding to the EJBName and actions composed from methodName, methodInterface, and methodParams.

Parameters:
EJBName - The string representation of the name of the EJB as it appears in the corresponding ejb-name element in the deployment descriptor.

methodName - A string that may be used to indicate the method of the EJB to which the permission pertains. A value of null or "" indicates that the permission pertains to all methods that match the other parameters of the permission specification without consideration of method name.

methodInterface - A string that may be used to specify the EJB interface to which the permission pertains. A value of null or "", indicates that the permission pertains to all methods that match the other parameters of the permission specification without consideration of the interface they occur on.

methodParams - An array of strings that may be used to specify (by typeNames) the parameter signature of the target methods. The order of the typeNames in methodParams array must match the order of occurence of the corresponding parameters in the method signature of the target method(s). Each typeName in the methodParams array must contain the canonical form of the corresponding parameter's typeName as defined by the getActions method. An empty methodParams array is used to represent a method signature with no arguments. A value of null indicates that the permission pertains to all methods that match the other parameters of the permission specification without consideration of method signature.

public EJBMethodPermission(String EJBName, String methodInterface, Method method)
使用与 EJBName 相对应的名称、由 methodInterface 组成的 actions，以及 Method 对象创建新的 EJBMethodPermission。

容器在检查调用者是否有权限调用 EJB 的方法之前使用此构造方法。

EJBName | EJB 名称的字符串表示形式，出现在部署描述符中相应的 ejb-name 元素中。
methodInterface | 可用于指定应用权限的 EJB 接口的字符串。null 或 "" 值指示权限属于所有匹配权限规范其他参数的方法，不考虑它们出现的接口。
method | Java.lang.reflect.Method 类的实例，该类对应于容器要确定调用者是否有权限访问的方法。此值不得为 null。
英文文档：

EJBMethodPermission

public EJBMethodPermission(String EJBName,
                           String methodInterface,
                           Method method)
Creates a new EJBMethodPermission with name corresponding to the EJBName and actions composed from methodInterface, and the Method object.

A container uses this constructor prior to checking if a caller has permission to call the method of an EJB.

Parameters:
EJBName - The string representation of the name of the EJB as it appears in the corresponding ejb-name element in the deployment descriptor.

methodInterface - A string that may be used to specify the EJB interface to which the permission pertains. A value of null or "", indicates that the permission pertains to all methods that match the other parameters of the permission specification without consideration of the interface they occur on.

method - an instance of the Java.lang.reflect.Method class corresponding to the method that the container is trying to determine whether the caller has permission to access. This value must not be null.
Method Detail

public boolean equals(Object o)
检查两个 EJBMethodPermission 对象是否相等。如果 EJBMethodPermission 对象具有相同的名称和 actions 值（区分大小写），则它们相等。

当且仅当 P1.implies(P2) && P2.implies(P1) 时，这两个 Permission 对象（P1 和 P2）才是相等的。

o | 要测试是否与此 EJBMethodPermission 相等的 EJBMethodPermission 对象
return | 如果参数 EJBMethodPermission 对象与此 EJBMethodPermission 相等，则返回 true。
英文文档：

equals

public boolean equals(Object o)
Checks two EJBMethodPermission objects for equality. EJBMethodPermission objects are equivalent if they have case sensitive equivalent name and actions values.

Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).

Specified by:
equals in class Permission
Parameters:
o - the EJBMethodPermission object being tested for equality with this EJBMethodPermission

Returns:
true if the argument EJBMethodPermission object is equivalent to this EJBMethodPermission.

public String getActions()
返回包含此 EJBMethodPermission 的 actions 的规范表示形式的 String。下列语法描述介绍了 EJBMethodPermission 的 actions 的规范形式。

methodNameSpec ::= methodName | emptyString

methodInterfaceName ::= String

methodInterfaceSpec ::= methodInterfaceName | emptyString

typeName ::= typeName | typeName []

methodParams ::= typeName | methodParams comma typeName

methodParamsSpec ::= emptyString | methodParams

methodSpec ::= null |
methodName |
methodNameSpec comma methodInterfaceName |
methodNameSpec comma methodInterfaceSpec comma methodParamsSpec

每个 typeName 的规范形式必须以相应参数类型的完全限定 Java 名称开头。数组参数的 typeName 的规范形式是数组组件类型的完全限定 Java 名称，后接与数组维数一样多的字符串 "[]" 形式的实例。规范形式中不存在其他字符（例如空白）。

MethodInterfaceName 是一个非空 String，并且应该包含一个为在 EJB 部署描述符中使用而定义的 method-intf 值。实现必须灵活，这样它才能支持其他接口名称，尤其是如果这些名称通过 EJB 规范进行了标准化。EJB 规范当前定义了以下 method-intf 值：

{ "Home", "LocalHome", "Remote", "Local", "ServiceEndpoint" }

return 返回包含此 EJBMethodPermission 的规范化的 actions 的 String。
英文文档：

getActions

public String getActions()
Returns a String containing a canonical representation of the actions of this EJBMethodPermission. The Canonical form of the actions of an EJBMethodPermission is described by the following syntax description.

      methodNameSpec ::= methodName | emptyString

      methodInterfaceName ::= String

      methodInterfaceSpec ::= methodInterfaceName | emptyString

      typeName ::= typeName | typeName []

      methodParams ::= typeName | methodParams comma typeName

      methodParamsSpec ::= emptyString | methodParams

      methodSpec ::= null |
           methodName |
           methodNameSpec comma methodInterfaceName |
           methodNameSpec comma methodInterfaceSpec comma methodParamsSpec

The canonical form of each typeName must begin with the fully qualified Java name of the corresponding parameter's type. The canonical form of a typeName for an array parameter is the fully qualified Java name of the array's component type followed by as many instances of the string "[]" as there are dimensions to the array. No additional characters (e.g. blanks) may occur in the canonical form.

A MethodInterfaceName is a non-empty String and should contain a method-intf value as defined for use in EJB deployment descriptors. An implementation must be flexible such that it supports additional interface names especially if they are standardized by the EJB Specification. The EJB Specification currently defines the following method-intf values:

       { "Home", "LocalHome", "Remote", "Local", "ServiceEndpoint" }

Specified by:
getActions in class Permission
Returns:
a String containing the canonicalized actions of this EJBMethodPermission.

public int hashCode()
返回此 EJBMethodPermission 的哈希码值。所返回哈希码的属性必须如下所示：

  • 在 Java 应用程序的生命周期中，每次对 EJBMethodPermission 对象调用 hashCode 方法，该方法都必须返回相同的整数值。应用程序每次对特定 EJBMethodPermission 对象执行 hashCode 调用所返回的值不必保持一致。
  • 如果根据 equals 方法，两个 EJBMethodPermission 对象是相等的，那么对两个 Permission 对象中的每个对象调用 hashCode 方法必须生成相同的整数结果（在应用程序内）。

return 此对象的整数哈希码值。
英文文档：

hashCode

public int hashCode()
Returns the hash code value for this EJBMethodPermission. The properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value every time it is called on a EJBMethodPermission object. The value returned by hashCode for a particular EJBMethodPermission need not remain consistent from one execution of an application to another.
  • If two EJBMethodPermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).

Specified by:
hashCode in class Permission
Returns:
the integer hash code value for this object.

public boolean implies(java.security.Permission permission)
确定此 EJBMethodPermission 是否“隐含有”参数 Permission。要实现这一点：

  • 参数必须是 EJBMethodPermission 的实例
  • 名称等于此 EJBMethodPermission 的名称，并且
  • 参数 Permission 应用到的方法（如其 actions 中定义的）必须是此 EJBMethodPermission 应用到的方法（如其 actions 中定义的）的子集。

如果满足下列所有条件，则参数 Permission 应用到此权限所应用到的方法的子集。

  • 此权限的 methodNameSpec 的方法名称组件为 null、空字符串，或等于参数 Permission 的方法名称，且
  • 此权限的 methodNameSpec 的方法接口组件为 null、空字符串，或等于参数 Permission 的方法接口，且
  • 此权限的 methodNameSpec 的方法参数列表组件为 null、空字符串，或等于参数 permission 的方法参数列表。

上述名称和 actions 比较是区分大小写的。

permission | 检查“此”EJBMethodPermission，了解它是否隐含有参数 Permission。
return | 如果对象隐含指定的权限，则返回 true；否则返回 false。
英文文档：

implies

public boolean implies(Permission permission)
Determines if the argument Permission is "implied by" this EJBMethodPermission. For this to be the case,

  • The argument must be an instanceof EJBMethodPermission
  • with name equivalent to that of this EJBMethodPermission, and
  • the methods to which the argument permission applies (as defined in its actions) must be a subset of the methods to which this EJBMethodPermission applies (as defined in its actions).

The argument permission applies to a subset of the methods to which this permission applies if all of the following conditions are met.

  • the method name component of the methodNameSpec of this permission is null, the empty string, or equivalent to the method name of the argument permission, and
  • the method interface component of the methodNameSpec of this permission is null, the empty string, or equivalent to the method interface of the argument permission, and
  • the method parameter list component of the methodNameSpec of this permission is null, the empty string, or equivalent to the method parameter list of the argument permission.

The name and actions comparisons described above are case sensitive.

Specified by:
implies in class Permission
Parameters:
permission - "this" EJBMethodPermission is checked to see if it implies the argument permission.

Returns:
true if the specified permission is implied by this object, false if not.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EJBRoleRefPermission (Java EE 5)

javax.security.jacc
Class EJBRoleRefPermission

java.lang.Object
    extended by  java.security.Permission
        extended by  javax.security.jacc.EJBRoleRefPermission
All Implemented Interfaces:
Serializable, Guard
public final class EJBRoleRefPermission
extends Permission
implements Serializable

Extends: java.security.Permission
Implements: java.io.Serializable

EJB isCallerInRole (String reference) 权限的类。EJBRoleRefPermission 是一个指定的权限，它具有各种操作。

EJBRoleRefPermission 的名称包含在应用程序部署描述符中标识 EJB（在其上下文中获得权限）的 ejb-name 元素的值。

EJBRoleRefPermission 的 actions 标识权限所应用到的角色引用。检查 EJBRoleRefPermission 以确定主体是否是引用所标识的角色的成员。

此类的实现可能实现 newPermissionCollection，也可能从超类继承其实现。

See also java.security.Permission
英文文档：

Class for EJB isCallerInRole (String reference) permissions. An EJBRoleRefPermission is a named permission and has actions.

The name of an EJBRoleRefPermission contains the value of the ejb-name element in the application's deployment descriptor that identifies the EJB in whose context the permission is being evalutated.

the actions of an EJBRoleRefPermission identifies the role reference to which the permission applies. An EJBRoleRefPermission is checked to determine if the subject is a member of the role identified by the reference.

Implementations of this class MAY implement newPermissionCollection or inherit its implementation from the super class.

Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, Serialized Form

Constructor Summary
EJBRoleRefPermission(String name, String actions)
Creates a new EJBRoleRefPermission with the specified name and actions.
Method Summary
boolean | equals(Object o) Checks two EJBRoleRefPermission objects for equality.
String | getActions() Returns a canonical String representation of the actions of this EJBRoleRefPermission.
int | hashCode() Returns the hash code value for this EJBRoleRefPermission.
boolean | implies(Permission permission) Determines if the argument Permission is "implied by" this EJBRoleRefPermission.
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

public EJBRoleRefPermission(String name, String actions)
使用指定名称和操作创建新的 EJBRoleRefPermission。
name | 标识在其上下文中获得角色引用的 EJB 的 ejb-name。
actions | 标识应用权限的角色引用。角色引用的范围限定为在名称参数中标识的 EJB。角色引用的值不得为 null 或空字符串。
英文文档：

EJBRoleRefPermission

public EJBRoleRefPermission(String name,
                            String actions)
Creates a new EJBRoleRefPermission with the specified name and actions.

Parameters:
name - the ejb-name that identifies the EJB in whose context the role references are to be evaluated.

actions - identifies the role reference to which the permission pertains. The role reference is scoped to the EJB identified in the name parameter. The value of the role reference must not be null or the empty string.
Method Detail

public boolean equals(Object o)
检查两个 EJBRoleRefPermission 对象是否相等。如果 EJBRoleRefPermission 对象具有相同的名称和 actions 值（区分大小写），则它们相等。

当且仅当 P1.implies(P2) && P2.implies(P1) 时，这两个 Permission 对象（P1 和 P2）才是相等的。

o | 要测试是否与此 EJBRoleRefPermission 相等的 EJBRoleRefPermission 对象
return | 如果参数 EJBRoleRefPermission 对象与此 EJBRoleRefPermission 相等，则返回 true。
英文文档：

equals

public boolean equals(Object o)
Checks two EJBRoleRefPermission objects for equality. EJBRoleRefPermission objects are equivalent if they have case equivalent name and actions values.

Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).

Specified by:
equals in class Permission
Parameters:
o - the EJBRoleRefPermission object being tested for equality with this EJBRoleRefPermission.

Returns:
true if the argument EJBRoleRefPermission object is equivalent to this EJBRoleRefPermission.

public String getActions()
返回此 EJBRoleRefPermission 的 actions 的规范 String 表示形式。

return 包含此 EJBRoleRefPermission 的规范化 actions 的 String。
英文文档：

getActions

public String getActions()
Returns a canonical String representation of the actions of this EJBRoleRefPermission.

Specified by:
getActions in class Permission
Returns:
a String containing the canonicalized actions of this EJBRoleRefPermission.

public int hashCode()
返回此 EJBRoleRefPermission 的哈希码值。所返回哈希码的属性必须如下所示：

  • 在 Java 应用程序的生命周期中，每次对 EJBRoleRefPermission 对象调用 hashCode 方法，该方法都必须返回相同的整数值。应用程序每次对特定 EJBRoleRefPermission 对象执行 hashCode 调用所返回的值不必保持一致。
  • 如果根据 equals 方法，两个 EJBRoleRefPermission 对象是相等的，那么对两个 Permission 对象中每个对象调用 hashCode 方法必须生成相同的整数结果（在应用程序内）。

return 此对象的整数哈希码值。
英文文档：

hashCode

public int hashCode()
Returns the hash code value for this EJBRoleRefPermission. The properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a EJBRoleRefPermission object. The value returned by hashCode for a particular EJBRoleRefPermission need not remain consistent from one execution of an application to another.
  • If two EJBRoleRefPermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).

Specified by:
hashCode in class Permission
Returns:
the integer hash code value for this object.

public boolean implies(java.security.Permission permission)
确定此 EJBRoleRefPermission 是否“隐含有”参数 Permission。要实现这一点：

  • 参数必须是 EJBRoleRefPermission 的实例
  • 名称等于此 EJBRoleRefPermission 的名称，并且
  • 角色引用等于此 EJBRoleRefPermission 应用到的角色引用。

    上述名称和 actions 比较是区分大小写的。

    permission 检查“此”EJBRoleRefPermission，了解它是否隐含有参数 Permission。

    return 如果此对象隐含指定的权限，则返回 true；否则返回 false。
    英文文档：

    implies

    • public boolean implies(Permission permission)
    Determines if the argument Permission is "implied by" this EJBRoleRefPermission. For this to be the case,

  • The argument must be an instanceof EJBRoleRefPermission
  • with name equivalent to that of this EJBRoleRefPermission, and
  • with the role reference equivalent to that of this EJBRoleRefPermission applies.

    The name and actions comparisons described above are case sensitive.

    Specified by:
    implies in class Permission
    Parameters:
    permission - "this" EJBRoleRefPermission is checked to see if it implies the argument permission.

    Returns:
    true if the specified permission is implied by this object, false if not.
    • Overview Package Class Tree Deprecated Index Help
    PREV CLASS NEXT CLASS FRAMES NO FRAMES


PolicyConfigurationFactory (Java EE 5)

javax.security.jacc
Class PolicyConfigurationFactory

java.lang.Object
    extended by  javax.security.jacc.PolicyConfigurationFactory

public abstract class PolicyConfigurationFactory
extends Object

抽象工厂和 finder 类，用于获取实现提供者的 PolicyConfigurationFactory 的类实例。该工厂将用于实例化 PolicyConfiguration 对象，容器的开发工具可使用该对象创建和管理 Policy Provider 的策略上下文。

实现类必须有一个不带参数的公共构造方法，可以使用此构造方法创建工厂实现类的操作实例。

See also java.security.Permission, javax.security.jacc.PolicyConfiguration, javax.security.jacc.PolicyContextException
英文文档：

Abstract factory and finder class for obtaining the instance of the class that implements the PolicyConfigurationFactory of a provider. The factory will be used to instantiate PolicyConfiguration objects that will be used by the deployment tools of the container to create and manage policy contexts within the Policy Provider.

Implementation classes must have a public no argument constructor that may be used to create an operational instance of the factory implementation class.

Author:
Ron Monzillo, Gary Ellison, Harpreet Singh
See Also:
Permission, PolicyConfiguration, PolicyContextException

Constructor Summary
PolicyConfigurationFactory()
Method Summary
abstract PolicyConfiguration | getPolicyConfiguration(String contextID, boolean remove) This method is used to obtain an instance of the provider specific class that implements the PolicyConfiguration interface that corresponds to the identified policy context within the provider.
static PolicyConfigurationFactory | getPolicyConfigurationFactory() This static method uses a system property to find and instantiate (via a public constructor) a provider specific factory implementation class.
abstract boolean | inService(String contextID) This method determines if the identified policy context exists with state "inService" in the Policy provider associated with the factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public PolicyConfigurationFactory()
英文文档：

PolicyConfigurationFactory

public PolicyConfigurationFactory()
Method Detail

public static PolicyConfigurationFactory getPolicyConfigurationFactory() throws ClassNotFoundException, PolicyContextException
此静态方法使用系统属性查找和实例化（通过公共构造方法）特定于提供者的工厂实现类。可从以下系统属性值中获取特定于提供者名称的工厂实现类：

javax.security.jacc.PolicyConfigurationFactory.provider。

return | 特定于提供者单件实例的 PolicyConfigurationFactory 实现类。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | ClassNotFoundException: 如果由于尚未设置系统属性的值而无法找到系统属性指定的类。
Throws | PolicyContextException: 如果实现抛出 getPolicyConfigurationFactory 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

getPolicyConfigurationFactory

public static PolicyConfigurationFactory getPolicyConfigurationFactory()
                                                                throws ClassNotFoundException,
                                                                       PolicyContextException
This static method uses a system property to find and instantiate (via a public constructor) a provider specific factory implementation class. The name of the provider specific factory implementation class is obtained from the value of the system property,

     javax.security.jacc.PolicyConfigurationFactory.provider.

Returns:
the singleton instance of the provider specific PolicyConfigurationFactory implementation class.
Throws:
SecurityException - when called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
ClassNotFoundException - when the class named by the system property could not be found including because the value of the system property has not be set.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the getPolicyConfigurationFactory method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException

abstract public PolicyConfiguration getPolicyConfiguration(String contextID, boolean remove) throws PolicyContextException
此方法用于获取特定于提供者实例的类，该类实现与提供者内已标识的策略上下文对应的 PolicyConfiguration 接口。PolicyConfiguration 接口的方法用于定义已标识策略上下文的策略语句。

如果在调用时，提供者中不存在已标识的策略上下文，则将在提供者中创建策略上下文，并返回实现上下文的 PolicyConfiguration 接口的对象。如果已标识的上下文的状态为 "deleted" 或 "inService"，则在调用后该状态将转换为 "open" 状态。策略上下文生命周期中的状态由 PolicyConfiguration 接口定义。

对于策略上下文标识符的给定值，此方法必须总是返回相同的 PolicyConfiguration 实例，而且给定策略上下文标识符最多只能有一个实际的 PolicyConfiguration 实例（在进程上下文中）。

要始终保持给定策略上下文最多只有一个 PolicyConfiguration 对象，此方法必须是线程安全的。

contextID | 标识要返回其 PolicyConfiguration 接口的策略上下文的字符串。传递给此参数的值不得为 null。
remove | 一个 boolean 值，指出在返回现有策略上下文的 PolicyConfiguration 对象之前是否要移除该策略上下文的策略语句。如果传递给此参数的值为 true，则现有策略上下文的策略语句将被移除。如果值为 false，则不移除。
return | 实现与 Policy 提供者匹配并与标识策略上下文对应的 PolicyConfiguration 接口的对象。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | PolicyContextException: 如果实现抛出 getPolicyConfiguration 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

getPolicyConfiguration

public abstract PolicyConfiguration getPolicyConfiguration(String contextID,
                                                           boolean remove)
                                                    throws PolicyContextException
This method is used to obtain an instance of the provider specific class that implements the PolicyConfiguration interface that corresponds to the identified policy context within the provider. The methods of the PolicyConfiguration interface are used to define the policy statements of the identified policy context.

If at the time of the call, the identified policy context does not exist in the provider, then the policy context will be created in the provider and the Object that implements the context's PolicyConfiguration Interface will be returned. If the state of the identified context is "deleted" or "inService" it will be transitioned to the "open" state as a result of the call. The states in the lifecycle of a policy context are defined by the PolicyConfiguration interface.

For a given value of policy context identifier, this method must always return the same instance of PolicyConfiguration and there must be at most one actual instance of a PolicyConfiguration with a given policy context identifier (during a process context).

To preserve the invariant that there be at most one PolicyConfiguration object for a given policy context, it may be necessary for this method to be thread safe.

Parameters:
contextID - A String identifying the policy context whose PolicyConfiguration interface is to be returned. The value passed to this parameter must not be null.

remove - A boolean value that establishes whether or not the policy statements of an existing policy context are to be removed before its PolicyConfiguration object is returned. If the value passed to this parameter is true, the policy statements of an existing policy context will be removed. If the value is false, they will not be removed.
Returns:
an Object that implements the PolicyConfiguration Interface matched to the Policy provider and corresponding to the identified policy context.
Throws:
SecurityException - when called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the getPolicyConfiguration method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.

abstract public boolean inService(String contextID) throws PolicyContextException
此方法确定在与工厂关联的 Policy 提供者中是否存在状态为 "inService" 的已标识策略上下文。

contextID | 标识策略上下文的字符串
return | 如果在提供者中存在已标识的策略上下文且其状态为 "inService"，则返回 true；否则返回 false。
Throws | SecurityException: 如果由尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 调用。
Throws | PolicyContextException: 如果实现抛出 inService 方法签名未知的经过检查的异常。实现类抛出的异常将封装（构造期间）在抛出的 PolicyContextException 中。
英文文档：

inService

public abstract boolean inService(String contextID)
                           throws PolicyContextException
This method determines if the identified policy context exists with state "inService" in the Policy provider associated with the factory.

Parameters:
contextID - A string identifying a policy context
Returns:
true if the identified policy context exists within the provider and its state is "inService", false otherwise.
Throws:
SecurityException - when called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been accounted for by the inService method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PolicyContext (Java EE 5)

javax.security.jacc
Class PolicyContext

java.lang.Object
    extended by  javax.security.jacc.PolicyContext

public final class PolicyContext
extends Object

容器使用此实用工具类与 Policy 提供者的策略上下文标识符和其他策略相关上下文通信。Policy 提供者使用策略上下文标识符选择在访问决定中应用的策略子集。

策略上下文标识符的值为 String，每个线程都有一个独立建立的策略上下文标识符。容器可以通过调用静态 setContextID 方法建立线程范围策略上下文标识符的值。通过调用静态 getContextID 方法，Policy 才能使用线程范围策略上下文标识符的值。

Policy 提供者还可以使用此类向调用容器请求额外的线程范围策略相关上下文对象。容器可使用静态 registerHandler 方法注册特定于容器的 PolicyContext 处理程序。处理程序注册仅限于在类范围中进行，所有线程上下文中相同的处理程序注册都处于活动状态。容器可以使用静态方法 setHandlerData 建立线程范围参数，Policy 提供者激活这些参数时会将其传递给处理程序。静态 getContext 方法用于激活处理程序并获取相应的上下文对象。

此类提供的静态存取函数允许对每个线程建立策略上下文值，并允许与其通信，而不依赖指向特定 PolicyContext 实例的公共引用。

PolicyContext 类可以封装静态 ThreadLocal 实例变量，以表示策略上下文标识符和处理程序数据值。

应用服务器必须捆绑或安装 PolicyContext 类，应用服务器容器必须防止通过未授权调用 PolicyContext 类方法的调用上下文调用这些方法。但是 getContextID 和 GetHandlerKeys 方法例外，容器必须限制并提供容器信任的调用上下文对 PolicyContext 类方法的访问，以执行容器访问决定。PolicyContext 类可以满足此要求（代表其容器），它将拒绝尚未授予 "setPolicy" SecurityPermission 的 AccessControlContext 所做的调用，并确保将 "setPolicy" 权限授予用于执行容器访问决定的 Policy 提供者。

See also javax.security.jacc.PolicyContextHandler
英文文档：

This utility class is used by containers to communicate policy context identifiers and other policy relevant context to Policy providers. Policy providers use the policy context identifier to select the subset of policy to apply in access decisions.

The value of a policy context identifier is a String and each thread has an independently established policy context identifier. A container will establish the thread-scoped value of a policy context identifier by calling the static setContextID method. The value of a thread-scoped policy context identifier is available (to Policy) by calling the static getContextID method.

This class is also used by Policy providers to request additional thread-scoped policy relevant context objects from the calling container. Containers register container-specific PolicyContext handlers using the static registerHandler method. Handler registration is scoped to the class, such that the same handler registrations are active in all thread contexts. Containers may use the static method setHandlerData to establish a thread-scoped parameter that will be passed to handlers when they are activated by Policy providers. The static getContext method is used to activate a handler and obtain the corresponding context object.

The static accessor functions provided by this class allow per-thread policy context values to be established and communicated independent of a common reference to a particular PolicyContext instance.

The PolicyContext class may encapsulate static ThreadLocal instance variables to represent the policy context identifier and handler data values.

The Application server must bundle or install the PolicyContext class, and the containers of the application server must prevent the methods of the PolicyContext class from being called from calling contexts that are not authorized to call these methods. With the exception of the getContextID and GetHandlerKeys methods, containers must restrict and afford access to the methods of the PolicyContext class to calling contexts trusted by the container to perform container access decisions. The PolicyContext class may satisfy this requirement (on behalf of its container) by rejecting calls made from an AccessControlContext that has not been granted the "setPolicy" SecurityPermission, and by ensuring that Policy providers used to perform container access decisions are granted the "setPolicy" permission.

Author:
Ron Monzillo, Gary Ellison
See Also:
PolicyContextHandler

Method Summary
static Object | getContext(String key) This method may be used by a Policy provider to activate the PolicyContextHandler registered to the context object key and cause it to return the corresponding policy context object from the container.
static String | getContextID() This static method returns the value of the policy context identifier associated with the thread on which the accessor is called.
static Set | getHandlerKeys() This method may be used to obtain the keys that identify the container specific context handlers registered by the container.
static void | registerHandler(String key, PolicyContextHandler handler, boolean replace) Authorization protected method used to register a container specific PolicyContext handler.
static void | setContextID(String contextID) Authorization protected method used to modify the value of the policy context identifier associated with the thread on which this method is called.
static void | setHandlerData(Object data) Authorization protected method that may be used to associate a thread-scoped handler data object with the PolicyContext.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

public static void setContextID(String contextID)
授权保护方法，用于修改与调用此方法的线程关联的策略上下文标识符的值。
contextID | 一个 String，表示要分配给调用线程的 PolicyContext 的策略上下文标识符的值。值 null 是此参数的合法值。
Throws | SecurityException: 如果容器没有授权调用 AccessControlContext 调用此方法。
英文文档：

setContextID

public static void setContextID(String contextID)
Authorization protected method used to modify the value of the policy context identifier associated with the thread on which this method is called.

Parameters:
contextID - a String that represents the value of the policy context identifier to be assigned to the PolicyContext for the calling thread. The value null is a legitimate value for this parameter.
Throws:
SecurityException - if the calling AccessControlContext is not authorized by the container to call this method.

public static String getContextID()
此静态方法返回与调用此存取方法的线程关联的策略上下文标识符的值。
return | 为线程建立的 String（或 null）策略上下文标识符。如果尚未通过 setContext 将线程的策略上下文标识符设置为其他值，则此方法必须返回默认的策略上下文标识符 null。
Throws | SecurityException: 如果容器没有授权调用 AccessControlContext 调用此方法。容器可以选择通过任何 AccessControlContext 授权调用此方法。
英文文档：

getContextID

public static String getContextID()
This static method returns the value of the policy context identifier associated with the thread on which the accessor is called.

Returns:
The String (or null) policy context identifier established for the thread. This method must return the default policy context identifier, null, if the policy context identifier of the thread has not been set via setContext to another value.
Throws:
SecurityException - if the calling AccessControlContext is not authorized by the container to call this method. Containers may choose to authorize calls to this method by any AccessControlContext.

public static void setHandlerData(Object data)
授权保护方法，可用于将线程范围内的处理程序数据对象与 PolicyContext 关联。处理程序数据对象将可用于处理程序，它可以将处理程序提供给（或捆绑到）容器内的调用范围状态。
data | 特定于容器的对象，它将与调用线程关联并被传递到 Policy 提供者激活的任何处理程序（在线程中）。值 null 对于此参数是合法值，如果在线程中尚未调用 setHandlerData，则还将在激活处理程序时使用该值。
Throws | SecurityException: 如果容器没有授权调用 AccessControlContext 调用此方法。
英文文档：

setHandlerData

public static void setHandlerData(Object data)
Authorization protected method that may be used to associate a thread-scoped handler data object with the PolicyContext. The handler data object will be made available to handlers, where it can serve to supply or bind the handler to invocation scoped state within the container.

Parameters:
data - a container-specific object that will be associated with the calling thread and passed to any handler activated by a Policy provider (on the thread). The value null is a legitimate value for this parameter, and is the value that will be used in the activation of handlers if the setHandlerData has not been called on the thread.
Throws:
SecurityException - if the calling AccessControlContext is not authorized by the container to call this method.

public static void registerHandler(String key, PolicyContextHandler handler, boolean replace) throws PolicyContextException
授权保护方法，可用于注册特定于容器的 PolicyContext 处理程序。可以注册一个处理程序来处理多个键，但任何时候最多只能注册一个处理程序来处理一个键。
key | 标识处理程序处理的上下文对象的 String（区分大小写）。此参数的值不得为 null。
handler | 实现 PolicyContextHandler 接口的对象。此参数的值不得为 null。
replace | 此 boolean 值定义此方法的行为，即调用此方法时是否已经注册了 PolicyContextHandler 来处理相同的键。在这种情况下，如果此参数的值为 true，则用参数 handler 替换现有的处理程序。如果此参数的值为 false，则会保留现有注册并抛出异常。
Throws | IllegalArgumentException: 如果 handler 或 key 参数的值有一个为 null，或者 replace 参数的值为 false 且已经注册了与参数 handler 具有相同键的处理程序。
Throws | SecurityException: 如果容器没有授权调用 AccessControlContext 调用此方法。
Throws | PolicyContextException: 如果以 PolicyContextHandler 参数调用此方法的操作使其抛出此方法的签名未知的经过检查的异常。
英文文档：

registerHandler

public static void registerHandler(String key,
                                   PolicyContextHandler handler,
                                   boolean replace)
                            throws PolicyContextException
Authorization protected method used to register a container specific PolicyContext handler. A handler may be registered to handle multiple keys, but at any time, at most one handler may be registered for a key.

Parameters:
key - a (case-sensitive) String that identifies the context object handled by the handler. The value of this parameter must not be null.
handler - an object that implements the PolicyContextHandler interface. The value of this parameter must not be null.
replace - this boolean value defines the behavior of this method if, when it is called, a PolicyContextHandler has already been registered to handle the same key. In that case, and if the value of this argument is true, the existing handler is replaced with the argument handler. If the value of this parameter is false the existing registration is preserved and an exception is thrown.
Throws:
IllegalArgumentException - if the value of either of the handler or key arguments is null, or the value of the replace argument is false and a handler with the same key as the argument handler is already registered.
SecurityException - if the calling AccessControlContext is not authorized by the container to call this method.
PolicyContextException - if an operation by this method on the argument PolicyContextHandler causes it to throw a checked exception that is not accounted for in the signature of this method.

public static java.util.Set<E> getHandlerKeys()
此方法可用于获取标识容器注册的特定于容器的上下文处理程序的键。
return | 一个 Set，其中的元素是 String 键值，用于标识已注册从而可能在 PolicyContext 中激活的处理程序。
Throws | SecurityException: 如果容器没有授权调用 AccessControlContext 调用此方法。容器可以选择通过任何 AccessControlContext 授权调用此方法。
英文文档：

getHandlerKeys

public static Set getHandlerKeys()
This method may be used to obtain the keys that identify the container specific context handlers registered by the container.

Returns:
A Set, the elements of which, are the String key values that identify the handlers that have been registered and therefore may be activated on the PolicyContext.
Throws:
SecurityException - if the calling AccessControlContext is not authorized by the container to call this method. Containers may choose to authorize calls to this method by any AccessControlContext.

public static Object getContext(String key) throws PolicyContextException
Policy 提供者可以使用此方法激活向上下文对象键注册的 PolicyContextHandler，并使其返回容器中相应的策略上下文对象。当此方法激活处理程序时，它会将上下文对象键传递给处理程序以及与调用线程关联的处理程序数据。
key | 一个 String，它标识要激活的 PolicyContextHandler 以及从处理程序中获取的上下文对象。此参数的值不得为 null。
return | 包含所需上下文的特定于容器和处理程序的对象。如果已经注册了相应的处理程序，且相应上下文的值为 null，则返回 null 值。
Throws | IllegalArgumentException: 如果尚未注册 PolicyContextHandler 来处理键，或者已注册的处理程序不再支持该键。
Throws | SecurityException: 如果容器没有授权调用 AccessControlContext 调用此方法。
Throws | PolicyContextException: 如果对标识的 PolicyContextHandler 调用此方法的操作使其抛出此方法的签名未知的经过检查的异常。
英文文档：

getContext

public static Object getContext(String key)
                         throws PolicyContextException
This method may be used by a Policy provider to activate the PolicyContextHandler registered to the context object key and cause it to return the corresponding policy context object from the container. When this method activates a handler, it passes to the handler the context object key and the handler data associated with the calling thread.

Parameters:
key - a String that identifies the PolicyContextHandler to activate and the context object to be acquired from the handler. The value of this parameter must not be null.
Returns:
the container and handler specific object containing the desired context. A null value is returned if the corresponding handler has been registered, and the value of the corresponding context is null.
Throws:
IllegalArgumentException - if a PolicyContextHandler has not been registered for the key or the registered handler no longer supports the key.
SecurityException - if the calling AccessControlContext is not authorized by the container to call this method.
PolicyContextException - if an operation by this method on the identified PolicyContextHandler causes it to throw a checked exception that is not accounted for in the signature of this method.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebResourcePermission (Java EE 5)

javax.security.jacc
Class WebResourcePermission

java.lang.Object
    extended by  java.security.Permission
        extended by  javax.security.jacc.WebResourcePermission
All Implemented Interfaces:
Serializable, Guard
public final class WebResourcePermission
extends Permission
implements Serializable

Extends: java.security.Permission
Implements: java.io.Serializable

Servlet Web 资源权限的类。WebResourcePermission 是一种指定权限，它包含各种操作。

WebResourcePermission 的名称（也称为目标名称）标识应用权限的 Web 资源。

此类的实现可以实现 newPermissionCollection，也可以从超类继承其实现。

version | %I% %E%
See also | java.security.Permission
英文文档：

Class for Servlet web resource permissions. A WebResourcePermission is a named permission and has actions.

The name of a WebResourcePermission (also referred to as the target name) identifies the Web resources to which the permission pertains.

Implementations of this class MAY implement newPermissionCollection or inherit its implementation from the super class.

Version:
%I% %E%
Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, Serialized Form

Constructor Summary
WebResourcePermission(HttpServletRequest request)
Creates a new WebResourcePermission from the HttpServletRequest object.
WebResourcePermission(String name, String actions)
Creates a new WebResourcePermission with the specified name and actions.
WebResourcePermission(String urlPatternSpec, String[] HTTPMethods)
Creates a new WebResourcePermission with name corresponding to the URLPatternSpec, and actions composed from the array of HTTP methods.
Method Summary
boolean | equals(Object o) Checks two WebResourcePermission objects for equality.
String | getActions() Returns a canonical String representation of the actions of this WebResourcePermission.
int | hashCode() Returns the hash code value for this WebResourcePermission.
boolean | implies(Permission permission) Determines if the argument Permission is "implied by" this WebResourcePermission.
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

public WebResourcePermission(String name, String actions)
创建具有指定名称和操作的新 WebResourcePermission。

名称包含可以标识要应用权限的 Web 资源的 URLPatternSpec。URLPatternSpec 的语法如下：

URLPatternList ::= URLPattern | URLPatternList colon URLPattern

URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList

null URLPatternSpec 可以通过权限构造方法转换为默认的 URLPattern ("/")。空字符串是一个 exact URLPattern，在 URLPatternSpec 中，只要是 exact URLPattern 可能出现的地方，它都有可能出现。URLPatternSpec 的第一个 URLPattern 可以是任何模式类型：exact、path-prefix、extension 或者默认类型（在 Java Servlet 规范中定义）。如果 URLPatternSpec 包含 URLPatternList，则 URLPatternList 的模式标识未应用权限的资源，并依赖第一个模式的模式类型和值，如下所示：

  • 匹配第一个模式的 URLPatternList 中不存在任何模式。
  • 如果第一个模式是 path-prefix 模式，则 URLPatternList 中只存在匹配第一个模式的 exact 模式和匹配第一个模式（但不同）的 path-prefix 模式。
  • 如果第一个模式是 extension 模式，则 URLPatternList 中只存在匹配第一个模式的 exact 模式和 path-prefix 模式。
  • 如果第一个模式是默认模式 "/"，则除默认模式以外的模式都可以出现在 URLPatternList 中。
  • 如果第一个模式是 exact 模式，则 URLPatternList 不得在 URLPatternSpec 中显示。

actions 参数包含以逗号分隔的 HTTP 方法列表。actions 参数的语法定义如下：

ExtensionMethod ::= any token as defined by RFC 2616
（即 1*[除了 CTL 或分隔符以外的任何字符]）

HTTPMethod ::= "GET" | "POST" | "PUT" | "DELETE" | "HEAD" |
"OPTIONS" | "TRACE" | ExtensionMethod

HTTPMethodList ::= HTTPMethod | HTTPMethodList comma HTTPMethod

HTTPMethodExceptionList ::= exclaimationPoint HTTPMethodList

HTTPMethodSpec ::= null | HTTPMethodExceptionList |
HTTPMethodList

如果 HTTPMethodSpec 中出现重复，则必须使用权限构造方法删除。

null 或空字符串 HTTPMethodSpec 表示将权限应用于 URL 模式所标识资源的所有 HTTP 方法。

如果 HTTPMethodSpec 包含 HTTPMethodExceptionList（即它以 exclaimationPoint 开始），则权限将应用于未出现在异常列表中的所有方法。

name | 标识应用权限的特定于应用程序的 Web 资源的 URLPatternSpec。URLPatternSpec 中的所有 URLPattern 都相对于部署了 Web 应用程序模块的上下文路径，URLPatternSpec 中不得多次出现相同的 URLPattern。null URLPatternSpec 可以通过权限构造方法转换为默认的 URLPattern ("/")。
actions | 标识应用权限的 HTTP 方法。如果通过此参数传递的值为 null 或空字符串，则权限将应用于所有可能的 HTTP 方法。
英文文档：

WebResourcePermission

public WebResourcePermission(String name,
                             String actions)
Creates a new WebResourcePermission with the specified name and actions.

The name contains a URLPatternSpec that identifies the web resources to which the permissions applies. The syntax of a URLPatternSpec is as follows:

          URLPatternList ::= URLPattern | URLPatternList colon URLPattern

          URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList

A null URLPatternSpec is translated to the default URLPattern, "/", by the permission constructor. The empty string is an exact URLPattern, and may occur anywhere in a URLPatternSpec that an exact URLPattern may occur. The first URLPattern in a URLPatternSpec may be any of the pattern types, exact, path-prefix, extension, or default as defined in the Java Servlet Specification). When a URLPatternSpec includes a URLPatternList, the patterns of the URLPatternList identify the resources to which the permission does NOT apply and depend on the pattern type and value of the first pattern as follows:

  • No pattern may exist in the URLPatternList that matches the first pattern.
  • If the first pattern is a path-prefix pattern, only exact patterns matched by the first pattern and path-prefix patterns matched by, but different from, the first pattern may occur in the URLPatternList.
  • If the first pattern is an extension pattern, only exact patterns that are matched by the first pattern and path-prefix patterns may occur in the URLPatternList.
  • If the first pattern is the default pattern, "/", any pattern except the default pattern may occur in the URLPatternList.
  • If the first pattern is an exact pattern a URLPatternList must not be present in the URLPatternSpec.

The actions parameter contains a comma seperated list of HTTP methods. The syntax of the actions parameter is defined as follows:

          ExtensionMethod ::= any token as defined by RFC 2616
                    (that is, 1*[any CHAR except CTLs or separators])

          HTTPMethod ::= "GET" | "POST" | "PUT" | "DELETE" | "HEAD" |
                   "OPTIONS" | "TRACE" | ExtensionMethod

          HTTPMethodList ::= HTTPMethod | HTTPMethodList comma HTTPMethod

          HTTPMethodExceptionList ::= exclaimationPoint HTTPMethodList

          HTTPMethodSpec ::= null | HTTPMethodExceptionList |
                   HTTPMethodList

If duplicates occur in the HTTPMethodSpec they must be eliminated by the permission constructor.

A null or empty string HTTPMethodSpec indicates that the permission applies to all HTTP methods at the resources identified by the URL pattern.

If the HTTPMethodSpec contains an HTTPMethodExceptionList (i.e., it begins with an exclaimationPoint), the permission pertains to all methods except those occuring in the exception list.

Parameters:
name - the URLPatternSpec that identifies the application specific web resources to which the permission pertains. All URLPatterns in the URLPatternSpec are relative to the context path of the deployed web application module, and the same URLPattern must not occur more than once in a URLPatternSpec. A null URLPatternSpec is translated to the default URLPattern, "/", by the permission constructor.

actions - identifies the HTTP methods to which the permission pertains. If the value passed through this parameter is null or the empty string, then the permission pertains to all the possible HTTP methods.

public WebResourcePermission(String urlPatternSpec, String[] HTTPMethods)
创建新 WebResourcePermission，其名称对应于 URLPatternSpec，其操作由 HTTP 方法数组组成。

urlPatternSpec | 标识应用权限的特定于应用程序的 Web 资源的 URLPatternSpec。URLPatternSpec 中的所有 URLPattern 都相对于部署了 Web 应用程序模块的上下文路径，URLPatternSpec 中不得多次出现相同的 URLPattern。null URLPatternSpec 可以通过权限构造方法转换为默认的 URLPattern ("/")。
HTTPMethods | 一个字符串数组，其中每个元素都包含一个 HTTP 方法的值。如果通过此参数传递的值为 null，或者是不包含任何元素的数组，则权限将应用于所有可能的 HTTP 方法。
英文文档：

WebResourcePermission

public WebResourcePermission(String urlPatternSpec,
                             String[] HTTPMethods)
Creates a new WebResourcePermission with name corresponding to the URLPatternSpec, and actions composed from the array of HTTP methods.

Parameters:
urlPatternSpec - the URLPatternSpec that identifies the application specific web resources to which the permission pertains. All URLPatterns in the URLPatternSpec are relative to the context path of the deployed web application module, and the same URLPattern must not occur more than once in a URLPatternSpec. A null URLPatternSpec is translated to the default URLPattern, "/", by the permission constructor.

HTTPMethods - an array of strings each element of which contains the value of an HTTP method. If the value passed through this parameter is null or is an array with no elements, then the permission pertains to all the possible HTTP methods.

public WebResourcePermission(HttpServletRequest request)
根据 HttpServletRequest 对象创建新的 WebResourcePermission。

request 对应于应用权限的 Servlet 操作的 HttpServletRequest 对象。权限名称是 contextPath (HttpServletRequest.getContextPath()) 之后 requestURI (HttpServletRequest.getRequestURI()) 所得结果的子字符串。当子字符串操作超过字符串 "/" 时，构造权限过程中将使用空字符串作为其名称。从 HttpServletRequest.getMethod() 中获取权限的操作字段。
英文文档：

WebResourcePermission

public WebResourcePermission(HttpServletRequest request)
Creates a new WebResourcePermission from the HttpServletRequest object.

Parameters:
request - the HttpServletRequest object corresponding to the Servlet operation to which the permission pertains. The permission name is the substring of the requestURI (HttpServletRequest.getRequestURI()) that begins after the contextPath (HttpServletRequest.getContextPath()). When the substring operation yields the string "/", the permission is constructed with the empty string as its name. The permission's actions field is obtained from HttpServletRequest.getMethod().
Method Detail

public boolean equals(Object o)
检查两个 WebResourcePermission 对象是否相等。如果 WebResourcePermission 对象的 URLPatternSpec 和（规范）操作值相等，则它们相等。如果引用权限 URLPatternSpec 的第一个模式等于参数权限 URLPatternSpec 的第一个模式，并且引用权限整个 URLPatternList 中的模式与参数权限 URLPatternList 中的模式匹配完全相同的模式集合，则这两个权限相等。

当且仅当 P1.implies(P2) && P2.implies(P1) 时，这两个 Permission 对象（P1 和 P2）才是相等的。

o | 要测试是否与此 WebResourcePermission 相等的 WebResourcePermission 对象
return | 如果参数 WebResourcePermission 对象与此 WebResourcePermission 相等，则返回 true。
英文文档：

equals

public boolean equals(Object o)
Checks two WebResourcePermission objects for equality. WebResourcePermission objects are equivalent if their URLPatternSpec and (canonicalized) actions values are equivalent. The URLPatternSpec of a reference permission is equivalent to that of an argument permission if their first patterns are equivalent, and the patterns of the URLPatternList of the reference permission collectively match exactly the same set of patterns as are matched by the patterns of the URLPatternList of the argument permission.

Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).

Specified by:
equals in class Permission
Parameters:
o - the WebResourcePermission object being tested for equality with this WebResourcePermission.

Returns:
true if the argument WebResourcePermission object is equivalent to this WebResourcePermission.

public String getActions()
返回此 WebResourcePermission 的操作的规范字符串表示形式。在规范形式中，预定义的方法位于扩展方法之前，并且在每个方法类别中，相应的方法按词汇升序排列。在规范形式中可能不存在重复的 HTTP 方法，所有 HTTP 方法集合的规范形式为 null 值。

return 包含此 WebResourcePermission 的规范化操作的字符串（或 null 值）。
英文文档：

getActions

public String getActions()
Returns a canonical String representation of the actions of this WebResourcePermission. In the canonical form, predefined methods preceed extension methods, and within each method classification the corresponding methods occur in ascending lexical order. There may be no duplicate HTTP methods in the canonical form, and the canonical form of the set of all HTTP methods is the value null.

Specified by:
getActions in class Permission
Returns:
a String containing the canonicalized actions of this WebResourcePermission (or the null value).

public int hashCode()
返回此 WebResourcePermission 的哈希码值。所返回哈希码的属性必须如下所示：

  • 在 Java 应用程序的生命周期中，每次对 WebResourcePermission 对象调用 hashCode 方法时，该方法都必须返回相同的整数值。应用程序每次对特定 WebResourcePermission 执行 hashCode 所返回的值不必总是相同。
  • 如果根据 equals 方法，两个 WebResourcePermission 对象相等，那么对这两个 Permission 对象调用 hashCode 方法必须生成相同的整数结果（在应用程序内）。

return 此对象的整数哈希码值。
英文文档：

hashCode

public int hashCode()
Returns the hash code value for this WebResourcePermission. The properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a WebResourcePermission object. The value returned by hashCode for a particular WebResourcePermission need not remain consistent from one execution of an application to another.
  • If two WebResourcePermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).

Specified by:
hashCode in class Permission
Returns:
the integer hash code value for this object.

public boolean implies(java.security.Permission permission)
确定此 WebResourcePermission 是否“隐含”参数 Permission。如果是这样，则所有下列各项都必须为 true：

  • 参数是 WebResourcePermission 的实例
  • 参数 permission 名称的第一个 URLPattern 匹配此权限名称的第一个 URLPattern。
  • 参数 permission 名称的第一个 URLPattern 不匹配此权限 URLPatternSpec URLPatternList 中的任何 URLPattern。
  • 如果参数 permission 名称的第一个 URLPattern 匹配此权限 URLPatternSpec 中的第一个 URLPattern，那么此权限 URLPatternSpec URLPatternList 中的每个 URLPattern 都匹配参数 permission URLPatternList 中的 URLPattern。
  • 参数 permission 操作所表示的 HTTP 方法是此权限操作所表示的 HTTP 方法的子集。

URLPattern 匹配根据 Servlet 匹配规则 执行，模式匹配的两个 URL 的关系应该满足以下条件：

  • 其模式值为等效的 String；
  • 此模式为 path-prefix 模式 "/*"；
  • 此模式为 path-prefix 模式（即以 "/" 开头以 "/*" 结尾），并且参数模式以此模式的子字符串（减去最后 2 个字符）开头，且参数模式的下一个字符为 "/"（如果有）；
  • 此模式是 extension 模式（即以 "*." 开头），并且参数模式以此模式结尾；
  • 引用模式是特殊的默认模式 "/"，它匹配所有参数模式。

上述所有比较都是区分大小写的。

permission | 检查是否隐含参数权限的 "this" WebResourcePermission。
return | 如果对象隐含指定的权限，则返回 true；否则返回 false。
英文文档：

implies

public boolean implies(Permission permission)
Determines if the argument Permission is "implied by" this WebResourcePermission. For this to be the case, all of the following must be true:

  • The argument is an instanceof WebResourcePermission
  • The first URLPattern in the name of the argument permission is matched by the first URLPattern in the name of this permission.
  • The first URLPattern in the name of the argument permission is NOT matched by any URLPattern in the URLPatternList of the URLPatternSpec of this permission.
  • If the first URLPattern in the name of the argument permission matches the first URLPattern in the URLPatternSpec of this permission, then every URLPattern in the URLPatternList of the URLPatternSpec of this permission is matched by a URLPattern in the URLPatternList of the argument permission.
  • The HTTP methods represented by the actions of the argument permission are a subset of the HTTP methods represented by the actions of this permission.

URLPattern matching is performed using the Servlet matching rules where two URL patterns match if they are related as follows:

  • their pattern values are String equivalent, or
  • this pattern is the path-prefix pattern "/*", or
  • this pattern is a path-prefix pattern (that is, it starts with "/" and ends with "/*") and the argument pattern starts with the substring of this pattern, minus its last 2 characters, and the next character of the argument pattern, if there is one, is "/", or
  • this pattern is an extension pattern (that is, it starts with "*.") and the argument pattern ends with this pattern, or
  • the reference pattern is the special default pattern, "/", which matches all argument patterns.

All of the comparisons described above are case sensitive.

Specified by:
implies in class Permission
Parameters:
permission - "this" WebResourcePermission is checked to see if it implies the argument permission.

Returns:
true if the specified permission is implied by this object, false if not.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebRoleRefPermission (Java EE 5)

javax.security.jacc
Class WebRoleRefPermission

java.lang.Object
    extended by  java.security.Permission
        extended by  javax.security.jacc.WebRoleRefPermission
All Implemented Interfaces:
Serializable, Guard
public final class WebRoleRefPermission
extends Permission
implements Serializable

Extends: java.security.Permission
Implements: java.io.Serializable

Servlet isUserInRole (String reference) 权限的类。WebRoleRefPermission 是一种指定权限，它包含各种操作。

WebRoleRefPermission 的名称（也称为目标名称）按 servlet 名称标识 Web 资源（在部署描述符中，servlet 名称对应于从中调用 isUserInRole (String reference) 的组件）。

WebRoleRefPermission 的操作标识应用权限的角色引用。检查 WebRoleRefPermission 确定主体是否是引用所标识的角色的成员。

此类的实现可以实现 newPermissionCollection，也可以从超类继承其实现。

See also java.security.Permission
英文文档：

Class for Servlet isUserInRole (String reference) permissions. A WebRoleRefPermission is a named permission and has actions.

The name of an WebRoleRefPermission (also referred to as the target name) identifies a Web resource by the servlet name (in the deployment descriptor corresponding to the component from which the call to isUserInRole (String reference) is being made.

The actions of an WebRoleRefPermission identifies the role reference to which the permission applies. A WebRoleRefPermission is checked to determine if the subject is a member of the role identified by the reference.

Implementations of this class MAY implement newPermissionCollection or inherit its implementation from the super class.

Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, Serialized Form

Constructor Summary
WebRoleRefPermission(String name, String actions)
Creates a new WebRoleRefPermission with the specified name and actions.
Method Summary
boolean | equals(Object o) Checks two WebRoleRefPermission objects for equality.
String | getActions() Returns a canonical String representation of the actions of this WebRoleRefPermission.
int | hashCode() Returns the hash code value for this WebRoleRefPermission.
boolean | implies(Permission permission) Determines if the argument Permission is "implied by" this WebRoleRefPermission.
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

public WebRoleRefPermission(String name, String actions)
创建具有指定名称和操作创建的新 WebRoleRefPermission。

name | 标识在其上下文中求角色引用值的特定于应用程序的 Web 资源的 servlet 名称。
actions | 标识应用权限的角色引用。角色引用的范围限定为名称参数标识的 Web 资源。角色引用的值不得为 null 或空字符串。
英文文档：

WebRoleRefPermission

public WebRoleRefPermission(String name,
                            String actions)
Creates a new WebRoleRefPermission with the specified name and actions.

Parameters:
name - the servlet-name that identifies the application specific web resource in whose context the role references are to be evaluated.

actions - identifies the role reference to which the permission pertains. The role reference is scoped to the Web resource identified in the name parameter. The value of the role reference must not be null or the empty string.
Method Detail

public boolean equals(Object o)
检查两个 WebRoleRefPermission 对象是否相等。如果 WebRoleRefPermission 对象有相同的名称和操作值（区分大小写），则它们相等。

当且仅当 P1.implies(P2) && P2.implies(P1) 时，这两个 Permission 对象（P1 和 P2）才是相等的。

上述名称和操作比较是区分大小写的。

o | 要测试是否与此 WebRoleRefPermission 相等的 WebRoleRefPermission 对象
return | 如果参数 EJBRoleRefPermission 对象与此 EJBRoleRefPermission 相等，则返回 true。
英文文档：

equals

public boolean equals(Object o)
Checks two WebRoleRefPermission objects for equality. WebRoleRefPermission objects are equivalent if they have case equivalent name and actions values.

Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).

The name and actions comparisons described above are case sensitive.

Specified by:
equals in class Permission
Parameters:
o - the WebRoleRefPermission object being tested for equality with this WebRoleRefPermission.
Returns:
true if the argument WebRoleRefPermission object is equivalent to this WebRoleRefPermission.

public String getActions()
返回此 WebRoleRefPermission 的操作的规范字符串表示形式。

return 包含此 WebRoleRefPermission 的规范操作的字符串。
英文文档：

getActions

public String getActions()
Returns a canonical String representation of the actions of this WebRoleRefPermission.

Specified by:
getActions in class Permission
Returns:
a String containing the canonicalized actions of this WebRoleRefPermission.

public int hashCode()
返回此 WebRoleRefPermission 的哈希码值。所返回哈希码的属性必须如下所示：

  • 在 Java 应用程序的生命周期中，每次对 WebRoleRefPermission 对象调用 hashCode 方法时，该方法都必须返回相同的整数值。应用程序每次对特定 WebRoleRefPermission 执行 hashCode 所返回的值不必总是相同。
  • 如果根据 equals 方法，两个 WebRoleRefPermission 对象相等，那么对这两个 Permission 对象调用 hashCode 方法必须生成相同的整数结果（在应用程序内）。

return 此对象的整数哈希码值。
英文文档：

hashCode

public int hashCode()
Returns the hash code value for this WebRoleRefPermission. The properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a WebRoleRefPermission object. The value returned by hashCode for a particular WebRoleRefPermission need not remain consistent from one execution of an application to another.
  • If two WebRoleRefPermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).

Specified by:
hashCode in class Permission
Returns:
the integer hash code value for this object.

public boolean implies(java.security.Permission permission)
确定此 WebRoleRefPermission 是否“隐含”参数 Permission。如果是这样，

  • 参数必须是 WebRoleRefPermission 的实例，
  • 名称等于此 WebRoleRefPermission，且
  • 角色引用等于此 WebRoleRefPermission（在其操作中定义）。

上述比较都是区分大小写的。

permission | 检查是否隐含参数权限的 "this" WebRoleRefPermission。
return | 如果对象隐含指定的权限，则返回 true；否则返回 false。
英文文档：

implies

public boolean implies(Permission permission)
Determines if the argument Permission is "implied by" this WebRoleRefPermission. For this to be the case,

  • The argument must be an instanceof WebRoleRefPermission
  • with name equivalent to this WebRoleRefPermission, and
  • with role reference equivalent to this WebRoleRefPermission (as defined in their actions).

The comparisons described above are case sensitive.

Specified by:
implies in class Permission
Parameters:
permission - "this" WebRoleRefPermission is checked to see if it implies the argument permission.

Returns:
true if the specified permission is implied by this object, false if not.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebUserDataPermission (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.security.jacc
Class WebUserDataPermission

java.lang.Object
    extended by  java.security.Permission
        extended by  javax.security.jacc.WebUserDataPermission
All Implemented Interfaces:
Serializable, Guard
public final class WebUserDataPermission
extends Permission
implements Serializable

Extends: java.security.Permission
Implements: java.io.Serializable

Servlet Web 用户数据权限的类。WebUserDataPermission 是一种指定权限，它包含各种操作。

WebUserDataPermission 的名称（也称为目标名称）按其相对于上下文路径的 URL 模式标识 Web 资源。

See also java.security.Permission
英文文档：

Class for Servlet Web user data permissions. A WebUserDataPermission is a named permission and has actions.

The name of a WebUserDataPermission (also referred to as the target name) identifies a Web resource by its context path relative URL pattern.

Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, Serialized Form

Constructor Summary
WebUserDataPermission(HttpServletRequest request)
Creates a new WebUserDataPermission from the HttpServletRequest object.
WebUserDataPermission(String name, String actions)
Creates a new WebUserDataPermission with the specified name and actions.
WebUserDataPermission(String urlPatternSpec, String[] HTTPMethods, String transportType)
Creates a new WebUserDataPermission with name corresponding to the URLPatternSpec, and actions composed from the array of HTTP methods and the transport type.
Method Summary
boolean | equals(Object o) Checks two WebUserDataPermission objects for equality.
String | getActions() Returns a canonical String representation of the actions of this WebUserDataPermission.
int | hashCode() Returns the hash code value for this WebUserDataPermission.
boolean | implies(Permission permission) Determines if the argument Permission is "implied by" this WebUserDataPermission.
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

public WebUserDataPermission(String name, String actions)
创建具有指定名称和操作的新 WebUserDataPermission。

名称包含可以标识要应用权限的 Web 资源的 URLPatternSpec。URLPatternSpec 的语法如下：

URLPatternList ::= URLPattern | URLPatternList colon URLPattern

URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList

null URLPatternSpec 可以通过权限构造方法转换为默认的 URLPattern ("/")。空字符串是一个 exact URLPattern，在 URLPatternSpec 中，只要是 exact URLPattern 可能出现的地方，它都有可能出现。URLPatternSpec 的第一个 URLPattern 可以是任何模式类型：exact、path-prefix、extension 或者默认类型（在 Java Servlet 规范中定义）。如果 URLPatternSpec 包含 URLPatternList，则 URLPatternList 的模式标识未应用权限的资源，并依赖第一个模式的模式类型和值，如下所示：

  • 匹配第一个模式的 URLPatternList 中不存在任何模式。
  • 如果第一个模式是 path-prefix 模式，则 URLPatternList 中只存在匹配第一个模式的 exact 模式和匹配第一个模式（但不同）的 path-prefix 模式。
  • 如果第一个模式是 extension 模式，则 URLPatternList 中只存在匹配第一个模式的 exact 模式和 path-prefix 模式。
  • 如果第一个模式是默认模式 "/"，则除默认模式以外的模式都可以出现在 URLPatternList 中。
  • 如果第一个模式是 exact 模式，则 URLPatternList 不得在 URLPatternSpec 中显示。

actions 参数包含以逗号分隔的 HTTP 方法列表，可能后接由冒号分隔的 HTTP 方法的 transportType。

ExtensionMethod ::= any token as defined by RFC 2616
（即 1*[除了 CTL 或分隔符以外的任何字符]）

HTTPMethod ::= "Get" | "POST" | "PUT" | "DELETE" | "HEAD" |
"OPTIONS" | "TRACE" | ExtensionMethod

HTTPMethodList ::= HTTPMethod | HTTPMethodList comma HTTPMethod

HTTPMethodExceptionList ::= exclaimationPoint HTTPMethodList

HTTPMethodSpec ::= emptyString | HTTPMethodExceptionList |
HTTPMethodList

transportType ::= "INTEGRAL" | "CONFIDENTIAL" | "NONE"

actions ::= null | HTTPMethodSpec |
HTTPMethodSpec colon transportType

如果 HTTPMethodSpec 中出现重复，则必须使用权限构造方法删除。

空字符串 HTTPMethodSpec 是包含所有可能 HTTP 方法的列表的简写。

如果 HTTPMethodSpec 包含 HTTPMethodExceptionList（即它以 exclaimationPoint 开始），则权限将应用于未出现在异常列表中的所有方法。

不带 transportType 的操作字符串是将值 "NONE" 作为其 TransportType 的操作字符串的简写。

表示 transportType 为 "NONE" 的授予权限表示可以使用任何连接类型访问关联资源。

name | 标识应用权限的特定于应用程序的 Web 资源的 URLPatternSpec。URLPatternSpec 中的所有 URLPattern 都相对于部署了 Web 应用程序模块的上下文路径，URLPatternSpec 中不得多次出现相同的 URLPattern。null URLPatternSpec 可以通过权限构造方法转换为默认的 URLPattern ("/")。
actions | 标识应用权限的传输类型的 HTTP 方法。如果通过此参数传递的值为 null 或空字符串，则构建权限时，使用的操作将对应于所有可能的 HTTP 方法，并且 transportType 为 "NONE"。
英文文档：

WebUserDataPermission

public WebUserDataPermission(String name,
                             String actions)
Creates a new WebUserDataPermission with the specified name and actions.

The name contains a URLPatternSpec that identifies the web resources to which the permissions applies. The syntax of a URLPatternSpec is as follows:

          URLPatternList ::= URLPattern | URLPatternList colon URLPattern

          URLPatternSpec ::= null | URLPattern | URLPattern colon URLPatternList

A null URLPatternSpec is translated to the default URLPattern, "/", by the permission constructor. The empty string is an exact URLPattern, and may occur anywhere in a URLPatternSpec that an exact URLPattern may occur. The first URLPattern in a URLPatternSpec may be any of the pattern types, exact, path-prefix, extension, or default as defined in the Java Servlet Specification). When a URLPatternSpec includes a URLPatternList, the patterns of the URLPatternList identify the resources to which the permission does NOT apply and depend on the pattern type and value of the first pattern as follows:

  • No pattern may exist in the URLPatternList that matches the first pattern.
  • If the first pattern is a path-prefix pattern, only exact patterns matched by the first pattern and path-prefix patterns matched by, but different from, the first pattern may occur in the URLPatternList.
  • If the first pattern is an extension pattern, only exact patterns that are matched by the first pattern and path-prefix patterns may occur in the URLPatternList.
  • If the first pattern is the default pattern, "/", any pattern except the default pattern may occur in the URLPatternList.
  • If the first pattern is an exact pattern a URLPatternList must not be present in the URLPatternSpec.

The actions parameter contains a comma separated list of HTTP methods that may be followed by a transportType separated from the HTTP method by a colon.

          ExtensionMethod ::= any token as defined by RFC 2616
                  (that is, 1*[any CHAR except CTLs or separators])

          HTTPMethod ::= "Get" | "POST" | "PUT" | "DELETE" | "HEAD" |
                  "OPTIONS" | "TRACE" | ExtensionMethod

          HTTPMethodList ::= HTTPMethod | HTTPMethodList comma HTTPMethod

          HTTPMethodExceptionList ::= exclaimationPoint HTTPMethodList

          HTTPMethodSpec ::= emptyString | HTTPMethodExceptionList |
                  HTTPMethodList

          transportType ::= "INTEGRAL" | "CONFIDENTIAL" | "NONE"

          actions ::= null | HTTPMethodSpec |
                  HTTPMethodSpec colon transportType

If duplicates occur in the HTTPMethodSpec they must be eliminated by the permission constructor.

An empty string HTTPMethodSpec is a shorthand for a List containing all the possible HTTP methods.

If the HTTPMethodSpec contains an HTTPMethodExceptionList (i.e., it begins with an exclaimationPoint), the permission pertains to all methods except those occuring in the exception list.

An actions string without a transportType is a shorthand for a actions string with the value "NONE" as its TransportType.

A granted permission representing a transportType of "NONE", indicates that the associated resources may be accessed using any conection type.

Parameters:
name - the URLPatternSpec that identifies the application specific web resources to which the permission pertains. All URLPatterns in the URLPatternSpec are relative to the context path of the deployed web application module, and the same URLPattern must not occur more than once in a URLPatternSpec. A null URLPatternSpec is translated to the default URLPattern, "/", by the permission constructor.

actions - identifies the HTTP methods and transport type to which the permission pertains. If the value passed through this parameter is null or the empty string, then the permission is constructed with actions corresponding to all the possible HTTP methods and transportType "NONE".

public WebUserDataPermission(String urlPatternSpec, String[] HTTPMethods, String transportType)
创建新 WebUserDataPermission，其名称对应于 URLPatternSpec，其操作由 HTTP 方法的数组和传输类型组成。

urlPatternSpec | 标识应用权限的特定于应用程序的 Web 资源的 URLPatternSpec。URLPatternSpec 中的所有 URLPattern 都相对于部署了 Web 应用程序模块的上下文路径，URLPatternSpec 中不得多次出现相同的 URLPattern。null URLPatternSpec 可以通过权限构造方法转换为默认的 URLPattern ("/")。
HTTPMethods | 一个字符串数组，其中每个元素都包含一个 HTTP 方法的值。如果通过此参数传递的值为 null，或者是不包含任何元素的数组，则构建权限时，使用的操作对应于所有可能的 HTTP 方法。
transportType | 值为 transportType 的 String。如果通过此参数传递的值为 null，则在构建权限时，使用的操作对应于 transportType "NONE"。
英文文档：

WebUserDataPermission

public WebUserDataPermission(String urlPatternSpec,
                             String[] HTTPMethods,
                             String transportType)
Creates a new WebUserDataPermission with name corresponding to the URLPatternSpec, and actions composed from the array of HTTP methods and the transport type.

Parameters:
urlPatternSpec - the URLPatternSpec that identifies the application specific web resources to which the permission pertains. All URLPatterns in the URLPatternSpec are relative to the context path of the deployed web application module, and the same URLPattern must not occur more than once in a URLPatternSpec. A null URLPatternSpec is translated to the default URLPattern, "/", by the permission constructor.

HTTPMethods - an array of strings each element of which contains the value of an HTTP method. If the value passed through this parameter is null or is an array with no elements, then the permission is constructed with actions corresponding to all the possible HTTP methods.

transportType - a String whose value is a transportType. If the value passed through this parameter is null, then the permission is constructed with actions corresponding to transportType "NONE".

public WebUserDataPermission(HttpServletRequest request)
根据 HttpServletRequest 对象创建新的 WebUserDataPermission。

request 对应于应用权限的 Servlet 操作的 HttpServletRequest 对象。权限名称是 contextPath (HttpServletRequest.getContextPath()) 之后 requestURI (HttpServletRequest.getRequestURI()) 所得结果的子字符串。当子字符串操作超过字符串 "/" 时，构造权限过程中将使用空字符串作为其名称。权限操作的 HTTP 方法组件通过 HttpServletRequest.getMethod() 获取。权限操作的 TransportType 组件通过调用 HttpServletRequest.isSecure() 确定。
英文文档：

WebUserDataPermission

public WebUserDataPermission(HttpServletRequest request)
Creates a new WebUserDataPermission from the HttpServletRequest object.

Parameters:
request - the HttpServletRequest object corresponding to the Servlet operation to which the permission pertains. The permission name is the substring of the requestURI (HttpServletRequest.getRequestURI()) that begins after the contextPath (HttpServletRequest.getContextPath()). When the substring operation yields the string "/", the permission is constructed with the empty string as its name. The HTTP method component of the permission's actions is as obtained from HttpServletRequest.getMethod(). The TransportType component of the permission's actions is determined by calling HttpServletRequest.isSecure().
Method Detail

public boolean equals(Object o)
检查两个 WebUserDataPermission 对象是否相等。如果 WebUserDataPermission 对象的 URLPatternSpec 和（规范）操作值相等，则它们相等。如果引用权限 URLPatternSpec 的第一个模式等于参数权限 URLPatternSpec 的第一个模式，并且引用权限整个 URLPatternList 中的模式与参数权限 URLPatternList 中的模式匹配完全相同的模式集合，则这两个权限相等。

当且仅当 P1.implies(P2) && P2.implies(P1) 时，这两个 Permission 对象（P1 和 P2）才是相等的。

o | 要测试是否与此 WebUserDataPermission 相等的 WebUserDataPermission 对象
return | 如果参数 WebUserDataPermission 对象与此 WebUserDataPermission 相等，则返回 true。
英文文档：

equals

public boolean equals(Object o)
Checks two WebUserDataPermission objects for equality. WebUserDataPermission objects are equivalent if their URLPatternSpec and (canonicalized) actions values are equivalent. The URLPatternSpec of a reference permission is equivalent to that of an argument permission if their first patterns are equivalent, and the patterns of the URLPatternList of the reference permission collectively match exactly the same set of patterns as are matched by the patterns of the URLPatternList of the argument permission.

Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).

Specified by:
equals in class Permission
Parameters:
o - the WebUserDataPermission object being tested for equality with this WebUserDataPermission.

Returns:
true if the argument WebUserDataPermission object is equivalent to this WebUserDataPermission.

public String getActions()
返回此 WebUserDataPermission 的操作的规范字符串表示形式。下列语法描述介绍了 WebUserDataPermission 操作的规范形式。

ExtensionMethod ::= any token as defined by RFC 2616
（即 1*[除了 CTL 或分隔符以外的任何字符]）

HTTPMethod ::= "GET" | "POST" | "PUT" | "DELETE" | "HEAD" |
"OPTIONS" | "TRACE" | ExtensionMethod

HTTPMethodList ::= HTTPMethod | HTTPMethodList comma HTTPMethod

HTTPMethodExceptionList ::= exclaimationPoint HTTPMethodList

HTTPMethodSpec ::= emptyString | HTTPMethodExceptionList |
HTTPMethodList

transportType ::= "INTEGRAL" | "CONFIDENTIAL" | "NONE"

actions ::= null | HTTPMethodList |
HTTPMethodSpec colon transportType

如果权限的 HTTP 方法对应于整个 HTTP 方法集合，并且权限的传输类型为 "INTEGRAL" 或 "CONFIDENTIAL"，则 HTTP 方法应使用 emptyString HTTPMethodSpec 以规范形式表示。如果权限的 HTTP 方法对应于整个 HTTP 方法集合，且权限的传输类型不是 "INTEGRAL" 或 "CONFIDENTIAL"，则规范操作值应为 null。

如果权限的方法与整个 HTTP 方法集合不对应，则必须消除重复项目，剩下的元素将按以下顺序排列：预定义的方法位于扩展方法之前，在每个方法分类中，对应的方法按词汇升序排列。所得（非 emptyString）HTTPMethodSpec 必须包含在规范形式中，如果权限传输类型不是 "INTEGRAL" 或 "CONFIDENTIAL"，则规范操作的值必须与所得 HTTPMethodSpec 完全相同。

return 包含此 WebUserDataPermission 的规范化操作的字符串（或 null 值）。
英文文档：

getActions

public String getActions()
Returns a canonical String representation of the actions of this WebUserDataPermission. The canonical form of the actions of a WebUserDataPermission is described by the following syntax description.

          ExtensionMethod ::= any token as defined by RFC 2616
                   (that is, 1*[any CHAR except CTLs or separators])

          HTTPMethod ::= "GET" | "POST" | "PUT" | "DELETE" | "HEAD" |
                   "OPTIONS" | "TRACE" | ExtensionMethod

          HTTPMethodList ::= HTTPMethod | HTTPMethodList comma HTTPMethod

          HTTPMethodExceptionList ::= exclaimationPoint HTTPMethodList

          HTTPMethodSpec ::= emptyString | HTTPMethodExceptionList |
                  HTTPMethodList

          transportType ::= "INTEGRAL" | "CONFIDENTIAL" | "NONE"

          actions ::= null | HTTPMethodList |
                  HTTPMethodSpec colon transportType

If the permission's HTTP methods correspond to the entire HTTP method set and the permission's transport type is "INTEGRAL" or "CONFIDENTIAL", the HTTP methods shall be represented in the canonical form by an emptyString HTTPMethodSpec. If the permission's HTTP methods correspond to the entire HTTP method set, and the permission's transport type is not "INTEGRAL"or "CONFIDENTIAL", the canonical actions value shall be the null value.

If the permission's methods do not correspond to the entire HTTP method set, duplicates must be eliminated and the remaining elements must be ordered such that the predefined methods preceed the extension methods, and such that within each method classification the corresponding methods occur in ascending lexical order. The resulting (non-emptyString) HTTPMethodSpec must be included in the canonical form, and if the permission's transport type is not "INTEGRAL" or "CONFIDENTIAL", the canonical actions value must be exactly the resulting HTTPMethodSpec.

Specified by:
getActions in class Permission
Returns:
a String containing the canonicalized actions of this WebUserDataPermission (or the null value).

public int hashCode()
返回此 WebUserDataPermission 的哈希码值。所返回哈希码的属性必须如下所示：

  • 在 Java 应用程序的生命周期中，每次对 WebUserDataPermission 对象调用 hashCode 方法时，该方法都将返回相同的整数值。应用程序每次对特定 EJBMethod 权限执行 hashCode 所返回的值不必总是相同。
  • 如果根据 equals 方法，两个 WebUserDataPermission 对象相等，那么对这两个 Permission 对象调用 hashCode 方法必须生成相同的整数结果（在应用程序内）。

return 此对象的整数哈希码值。
英文文档：

hashCode

public int hashCode()
Returns the hash code value for this WebUserDataPermission. The properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method shall return the same integer value every time it is called on a WebUserDataPermission object. The value returned by hashCode for a particular EJBMethod permission need not remain consistent from one execution of an application to another.
  • If two WebUserDataPermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).

Specified by:
hashCode in class Permission
Returns:
the integer hash code value for this object.

public boolean implies(java.security.Permission permission)
确定此 WebUserDataPermission 是否“隐含”参数 Permission。如果是这样，则所有下列各项都必须为 true：

  • 参数是 WebUserDataPermission 的实例。
  • 参数 permission 名称的第一个 URLPattern 匹配此权限名称的第一个 URLPattern。
  • 参数 permission 名称的第一个 URLPattern 不匹配此权限 URLPatternSpec URLPatternList 中的任何 URLPattern。
  • 如果参数 permission 名称的第一个 URLPattern 匹配此权限 URLPatternSpec 中的第一个 URLPattern，那么此权限 URLPatternSpec URLPatternList 中的每个 URLPattern 都匹配参数 permission URLPatternList 中的 URLPattern。
  • 参数 permission 操作所表示的 HTTP 方法是此权限操作所表示的 HTTP 方法的子集。
  • 此权限操作中的 transportType 或者对应于值 "NONE"，或者等于参数 permission 的操作中的 transportType。

URLPattern 匹配根据 Servlet 匹配规则 执行，模式匹配的两个 URL 的关系应该满足以下条件：

  • 其模式值为等效的 String；
  • 此模式为 path-prefix 模式 "/*"；
  • 此模式为 path-prefix 模式（即以 "/" 开头以 "/*" 结尾），并且参数模式以此模式的子字符串（减去最后 2 个字符）开头，且参数模式的下一个字符为 "/"（如果有）；
  • 此模式是 extension 模式（即以 "*." 开头），并且参数模式以此模式结尾；
  • 引用模式是特殊的默认模式 "/"，它匹配所有参数模式。

上述所有比较都是区分大小写的。

permission | 检查是否隐含参数权限的 "this" WebUserDataPermission。
return | 如果对象隐含指定的权限，则返回 true；否则返回 false。
英文文档：

implies

public boolean implies(Permission permission)
Determines if the argument Permission is "implied by" this WebUserDataPermission. For this to be the case all of the following must be true:

  • The argument is an instanceof WebUserDataPermission.
  • The first URLPattern in the name of the argument permission is matched by the first URLPattern in the name of this permission.
  • The first URLPattern in the name of the argument permission is NOT matched by any URLPattern in the URLPatternList of the URLPatternSpec of this permission.
  • If the first URLPattern in the name of the argument permission matches the first URLPattern in the URLPatternSpec of this permission, then every URLPattern in the URLPatternList of the URLPatternSpec of this permission is matched by a URLPattern in the URLPatternList of the argument permission.
  • The HTTP methods represented by the actions of the argument permission are a subset of the HTTP methods represented by the actions of this permission.
  • The transportType in the actions of this permission either corresponds to the value "NONE", or equals the transportType in the actions of the argument permission.

URLPattern matching is performed using the Servlet matching rules where two URL patterns match if they are related as follows:

  • their pattern values are String equivalent, or
  • this pattern is the path-prefix pattern "/*", or
  • this pattern is a path-prefix pattern (that is, it starts with "/" and ends with "/*") and the argument pattern starts with the substring of this pattern, minus its last 2 characters, and the next character of the argument pattern, if there is one, is "/", or
  • this pattern is an extension pattern (that is, it starts with "*.") and the argument pattern ends with this pattern, or
  • the reference pattern is the special default pattern, "/", which matches all argument patterns.

All of the comparisons described above are case sensitive.

Specified by:
implies in class Permission
Parameters:
permission - "this" WebUserDataPermission is checked to see if it implies the argument permission.

Returns:
true if the specified permission is implied by this object, false if not.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


PolicyContextException (Java EE 5)

javax.security.jacc
Class PolicyContextException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.security.jacc.PolicyContextException
All Implemented Interfaces:
Serializable
public class PolicyContextException
extends Exception

Extends: Throwable > Exception

javax.security.jacc.PolicyConfiguration 接口的实现、javax.security.jacc.PolicyConfigurationFactory 抽象类、javax.security.jacc.PolicyContext 实用工具类和 javax.security.jacc.PolicyContextException 接口的实现抛出此经过检查的异常。

对于实现中发生的接口或所实现的类未声明的经过检查的异常，javax.security.jacc 实现类可以使用此异常重新抛出。

See also java.lang.Exception, javax.security.jacc.PolicyConfiguration, javax.security.jacc.PolicyConfigurationFactory, javax.security.jacc.PolicyContext, javax.security.jacc.PolicyContextHandler
英文文档：

This checked exception is thrown by implementations of the javax.security.jacc.PolicyConfiguration Interface, the javax.security.jacc.PolicyConfigurationFactory abstract class, the javax.security.jacc.PolicyContext utility class, and implementations of the javax.security.jacc.PolicyContextException Interface.

This exception is used by javax.security.jacc implementation classes to rethrow checked exceptions ocurring within an implementation that are not declared by the interface or class being implemented.

Author:
Ron Monzillo, Gary Ellison
See Also:
Exception, PolicyConfiguration, PolicyConfigurationFactory, PolicyContext, PolicyContextHandler, Serialized Form

Constructor Summary
PolicyContextException()
Constructs a new PolicyContextException with null as its detail message.
PolicyContextException(String msg)
Constructs a new PolicyContextException with the specified detail message
PolicyContextException(String msg, Throwable cause)
Constructs a new PolicyContextException with the specified detail message and cause.
PolicyContextException(Throwable cause)
Constructs a new PolicyContextException with the specified 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

public PolicyContextException()
构造新的 PolicyContextException，将 null 作为其详细消息，描述异常的原因。
英文文档：

PolicyContextException

public PolicyContextException()
Constructs a new PolicyContextException with null as its detail message. describing the cause of the exception.

public PolicyContextException(String msg)
构造带指定详细消息的新 PolicyContextException
msg 一个 String，它包含描述异常原因的详细消息。
英文文档：

PolicyContextException

public PolicyContextException(String msg)
Constructs a new PolicyContextException with the specified detail message

Parameters:
msg - - a String containing a detail message describing the cause of the exception.

public PolicyContextException(String msg, Throwable cause)
构造带指定详细消息和原因的新 PolicyContextException。cause 将被封装在构造的异常中。
msg | 一个 String，它包含描述异常原因的详细消息。
cause | “导致”构造此异常的 Throwable。允许 null 值，以后可以对构造的异常调用 getCause() 获取通过此参数传递的值。
英文文档：

PolicyContextException

public PolicyContextException(String msg,
                              Throwable cause)
Constructs a new PolicyContextException with the specified detail message and cause. The cause will be encapsulated in the constructed exception.

Parameters:
msg - - a String containing a detail message describing the cause of the exception.
cause - - the Throwable that is "causing" this exception to be constructed. A null value is permitted, and the value passed through this parameter may subsequently be retrieved by calling getCause() on the constructed exception.

public PolicyContextException(Throwable cause)
构造带指定 cause 的新 PolicyContextException。cause 将被封装在构造的异常中。
cause “导致”构造此异常的 Throwable。允许 null 值，以后可以对构造的异常调用 getCause() 获取通过此参数传递的值。
英文文档：

PolicyContextException

public PolicyContextException(Throwable cause)
Constructs a new PolicyContextException with the specified cause. The cause will be encapsulated in the constructed exception.

Parameters:
cause - - the Throwable that is "causing" this exception to be constructed. A null value is permitted, and the value passed through this parameter may subsequently be retrieved by calling getCause() on the constructed exception.
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


javax.servlet (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.servlet

The javax.servlet package contains a number of classes and interfaces that describe and define the contracts between a servlet class and the runtime environment provided for an instance of such a class by a conforming servlet container.

See:
Description

Interface Summary
Filter | A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both.
FilterChain | A FilterChain is an object provided by the servlet container to the developer giving a view into the invocation chain of a filtered request for a resource.
FilterConfig | A filter configuration object used by a servlet container to pass information to a filter during initialization.
RequestDispatcher | Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server.
Servlet | Defines methods that all servlets must implement.
ServletConfig | A servlet configuration object used by a servlet container to pass information to a servlet during initialization.
ServletContext | Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.
ServletContextAttributeListener | Implementations of this interface receive notifications of changes to the attribute list on the servlet context of a web application.
ServletContextListener | Implementations of this interface receive notifications about changes to the servlet context of the web application they are part of.
ServletRequest | Defines an object to provide client request information to a servlet.
ServletRequestAttributeListener | A ServletRequestAttributeListener can be implemented by the developer interested in being notified of request attribute changes.
ServletRequestListener | A ServletRequestListener can be implemented by the developer interested in being notified of requests coming in and out of scope in a web component.
ServletResponse | Defines an object to assist a servlet in sending a response to the client.
SingleThreadModel | Deprecated. As of Java Servlet API 2.4, with no direct replacement.

Class Summary
GenericServlet | Defines a generic, protocol-independent servlet.
ServletContextAttributeEvent | This is the event class for notifications about changes to the attributes of the servlet context of a web application.
ServletContextEvent | This is the event class for notifications about changes to the servlet context of a web application.
ServletInputStream | Provides an input stream for reading binary data from a client request, including an efficient readLine method for reading data one line at a time.
ServletOutputStream | Provides an output stream for sending binary data to the client.
ServletRequestAttributeEvent | This is the event class for notifications of changes to the attributes of the servlet request in an application.
ServletRequestEvent | Events of this kind indicate lifecycle events for a ServletRequest.
ServletRequestWrapper | Provides a convenient implementation of the ServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet.
ServletResponseWrapper | Provides a convenient implementation of the ServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet.

Exception Summary
ServletException | Defines a general exception a servlet can throw when it encounters difficulty.
UnavailableException | Defines an exception that a servlet or filter throws to indicate that it is permanently or temporarily unavailable.

Package javax.servlet Description

The javax.servlet package contains a number of classes and interfaces that describe and define the contracts between a servlet class and the runtime environment provided for an instance of such a class by a conforming servlet container.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.servlet Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.servlet

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.util.EventObject (implements java.io.Serializable)
      • javax.servlet.ServletContextEvent
        • javax.servlet.ServletContextAttributeEvent
      • javax.servlet.ServletRequestEvent
        • javax.servlet.ServletRequestAttributeEvent
    • javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig)
    • java.io.InputStream (implements java.io.Closeable)
      • javax.servlet.ServletInputStream
    • java.io.OutputStream (implements java.io.Closeable, java.io.Flushable)
      • javax.servlet.ServletOutputStream
    • javax.servlet.ServletRequestWrapper (implements javax.servlet.ServletRequest)
    • javax.servlet.ServletResponseWrapper (implements javax.servlet.ServletResponse)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.ServletException
          • javax.servlet.UnavailableException

Interface Hierarchy

  • java.util.EventListener
    • javax.servlet.ServletContextAttributeListener
    • javax.servlet.ServletContextListener
    • javax.servlet.ServletRequestAttributeListener
    • javax.servlet.ServletRequestListener
  • javax.servlet.Filter
  • javax.servlet.FilterChain
  • javax.servlet.FilterConfig
  • javax.servlet.RequestDispatcher
  • javax.servlet.Servlet
  • javax.servlet.ServletConfig
  • javax.servlet.ServletContext
  • javax.servlet.ServletRequest
  • javax.servlet.ServletResponse
  • javax.servlet.SingleThreadModel
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Filter (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet
Interface Filter

public interface Filter

过滤器是执行过滤任务的对象，这些任务是针对对某一资源（servlet 或静态内容）的请求或来自某一资源的响应执行的，抑或同时针对这两者执行。

Filter 用 doFilter 方法执行过滤。每个 Filter 都有对 FilterConfig 对象的访问权，可从该对象获得其初始化参数以及对它可以使用的 ServletContext 的引用，以便为过滤任务加载所需的资源。

Filter 是在 Web 应用程序的部署描述符中配置的。

已经标识用于此设计的示例是
1) 验证过滤器
2) 日志记录和审计过滤器
3) 图像转换过滤器
4) 数据压缩过滤器
5) 加密过滤器
6) 标记过滤器
7) 触发资源访问事件的过滤器
8) XSL/T 过滤器
9) Mime 类型链过滤器

since
en
Servlet 2.3
英文文档：

A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both.

Filters perform filtering in the doFilter method. Every Filter has access to a FilterConfig object from which it can obtain its initialization parameters, a reference to the ServletContext which it can use, for example, to load resources needed for filtering tasks.

Filters are configured in the deployment descriptor of a web application

Examples that have been identified for this design are
1) Authentication Filters
2) Logging and Auditing Filters
3) Image conversion Filters
4) Data compression Filters
5) Encryption Filters
6) Tokenizing Filters
7) Filters that trigger resource access events
8) XSL/T filters
9) Mime-type chain Filter

Since:
Servlet 2.3

Method Summary
void | destroy() Called by the web container to indicate to a filter that it is being taken out of service.
void | doFilter(ServletRequest request, ServletResponse response, FilterChain chain) The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain.
void | init(FilterConfig filterConfig) Called by the web container to indicate to a filter that it is being placed into service.

Method Detail

public void init(FilterConfig filterConfig) throws ServletException
由 Web 容器调用，指示将放入服务中的过滤器。servlet 容器只在实例化过滤器之后调用一次 init 方法。在要求过滤器做任何过滤工作之前，init 方法必须成功完成。

如果 init 方法
1.抛出 ServletException
2.没有在 Web 容器定义的时间段内返回，则 Web 容器无法将过滤器放入服务中。
英文文档：

init

void init(FilterConfig filterConfig)
          throws ServletException
Called by the web container to indicate to a filter that it is being placed into service. The servlet container calls the init method exactly once after instantiating the filter. The init method must complete successfully before the filter is asked to do any filtering work.

The web container cannot place the filter into service if the init method either
1.Throws a ServletException
2.Does not return within a time period defined by the web container

Throws:
ServletException

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
每次由于对链末尾的某个资源的客户端请求而通过链传递请求/响应对时，容器都会调用 Filter 的 doFilter 方法。传入此方法的 FilterChain 允许 Filter 将请求和响应传递到链中的下一个实体。

此方法的典型实现遵循以下模式：-
1. 检查请求
2. 有选择地将带有自定义实现的请求对象包装到用于输入过滤的过滤器内容或头中
3. 有选择地将带有自定义实现的响应对象包装到用于输出过滤的过滤器内容或头中
4. a) 既可以使用 FilterChain 对象 (chain.doFilter()) 调用链中的下一个实体，
4. b) 也可以不将请求/响应对传递给过滤器链中的下一个实体，从而阻塞请求处理
5. 在调用过滤器链中的下一个实体之后直接设置响应上的头。

英文文档：

doFilter

void doFilter(ServletRequest request,
              ServletResponse response,
              FilterChain chain)
              throws IOException,
                     ServletException
The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. The FilterChain passed in to this method allows the Filter to pass on the request and response to the next entity in the chain.

A typical implementation of this method would follow the following pattern:-
1. Examine the request
2. Optionally wrap the request object with a custom implementation to filter content or headers for input filtering
3. Optionally wrap the response object with a custom implementation to filter content or headers for output filtering
4. a) Either invoke the next entity in the chain using the FilterChain object (chain.doFilter()),
4. b) or not pass on the request/response pair to the next entity in the filter chain to block the request processing
5. Directly set headers on the response after invocation of the next entity in the filter chain.

Throws:
IOException
ServletException

public void destroy()
由 Web 容器调用，指示将从服务中取出的过滤器。此方法仅在过滤器的 doFilter 方法中的所有线程都已退出之后调用一次，或者在过了超时期之后调用。在调用此方法之后，Web 容器不会再对此过滤器实例调用 doFilter 方法。

此方法为过滤器提供了一个清除持有的所有资源（比如内存、文件句柄和线程）的机会，并确保任何持久状态都与内存中该过滤器的当前状态保持同步。
英文文档：

destroy

void destroy()
Called by the web container to indicate to a filter that it is being taken out of service. This method is only called once all threads within the filter's doFilter method have exited or after a timeout period has passed. After the web container calls this method, it will not call the doFilter method again on this instance of the filter.

This method gives the filter an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the filter's current state in memory.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


FilterChain (Java EE 5)

javax.servlet
Interface FilterChain

public interface FilterChain

FilterChain 是 servlet 容器为开发人员提供的对象，它提供了对某一资源的已过滤请求调用链的视图。过滤器使用 FilterChain 调用链中的下一个过滤器，如果调用的过滤器是链中的最后一个过滤器，则调用链末尾的资源。
since
en
Servlet 2.3
See also javax.servlet.Filter
英文文档：

A FilterChain is an object provided by the servlet container to the developer giving a view into the invocation chain of a filtered request for a resource. Filters use the FilterChain to invoke the next filter in the chain, or if the calling filter is the last filter in the chain, to invoke the resource at the end of the chain.

Since:
Servlet 2.3
See Also:
Filter

Method Summary
 void doFilter(ServletRequest request, ServletResponse response)
Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked.

Method Detail

public void doFilter(ServletRequest request, ServletResponse response) throws java.io.IOException, ServletException
导致链中的下一个过滤器被调用，如果调用的过滤器是链中的最后一个过滤器，则导致调用链末尾的资源。
request | 沿着链传递的请求。
response | 沿着链传递的响应。
since | 2.3
英文文档：

doFilter

void doFilter(ServletRequest request,
              ServletResponse response)
              throws IOException,
                     ServletException
Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked.

Parameters:
request - the request to pass along the chain.
response - the response to pass along the chain.
Throws:
IOException
ServletException
Since:
2.3
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FilterConfig (Java EE 5)

javax.servlet
Interface FilterConfig

public interface FilterConfig

servlet 容器使用的过滤器配置对象，该对象在初始化期间将信息传递给过滤器。
since
en
Servlet 2.3
See also javax.servlet.Filter
英文文档：

A filter configuration object used by a servlet container to pass information to a filter during initialization.

Since:
Servlet 2.3
See Also:
Filter

Method Summary
String | getFilterName() Returns the filter-name of this filter as defined in the deployment descriptor.
String | getInitParameter(String name) Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
Enumeration | getInitParameterNames() Returns the names of the filter's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the filter has no initialization parameters.
ServletContext | getServletContext() Returns a reference to the ServletContext in which the caller is executing.

Method Detail

public String getFilterName()
如部署描述符中定义的那样，返回此过滤器的过滤器名称。
英文文档：

getFilterName

String getFilterName()
Returns the filter-name of this filter as defined in the deployment descriptor.

public ServletContext getServletContext()
返回对调用者在其中执行操作的 ServletContext 的引用。
return | 一个 ServletContext 对象，调用者用于与其 servlet 容器交互
See also | javax.servlet.ServletContext
英文文档：

getServletContext

ServletContext getServletContext()
Returns a reference to the ServletContext in which the caller is executing.

Returns:
a ServletContext object, used by the caller to interact with its servlet container
See Also:
ServletContext

public String getInitParameter(String name)
返回包含指定初始化参数的值的 String，如果参数不存在，则返回 null。
name | 指定初始化参数名称的 String
return | 包含初始化参数值的 String
英文文档：

getInitParameter

String getInitParameter(String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.

Parameters:
name - a String specifying the name of the initialization parameter
Returns:
a String containing the value of the initialization parameter

public java.util.Enumeration<E> getInitParameterNames()
以 String 对象的 Enumeration 的形式返回过滤器初始化参数的名称，如果过滤器没有初始化参数，则返回一个空的 Enumeration。
return 包含过滤器初始化参数名称的 String 对象的 Enumeration
英文文档：

getInitParameterNames

Enumeration getInitParameterNames()
Returns the names of the filter's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the filter has no initialization parameters.

Returns:
an Enumeration of String objects containing the names of the filter's initialization parameters
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RequestDispatcher (Java EE 5)

javax.servlet
Interface RequestDispatcher

public interface RequestDispatcher

定义接收来自客户端的请求并将它们发送到服务器上的任何资源（比如 servlet、HTML 文件或 JSP 文件）的对象。servlet 容器可创建 RequestDispatcher 对象，该对象被用作包装位于特定路径上的服务器资源或通过特定名称给定的服务器资源的包装器。

此接口用于包装 servlet，但 servlet 容器可创建包装任何类型资源的 RequestDispatcher 对象。

See also getRequestDispatcher(java.lang.String), getNamedDispatcher(java.lang.String), getRequestDispatcher(java.lang.String)
英文文档：

Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name.

This interface is intended to wrap servlets, but a servlet container can create RequestDispatcher objects to wrap any type of resource.

Author:
Various
See Also:
ServletContext.getRequestDispatcher(java.lang.String),
ServletContext.getNamedDispatcher(java.lang.String),
ServletRequest.getRequestDispatcher(java.lang.String)

Method Summary
void | forward(ServletRequest request, ServletResponse response) Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.
void | include(ServletRequest request, ServletResponse response) Includes the content of a resource (servlet, JSP page, HTML file) in the response.

Method Detail

public void forward(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
将请求从一个 servlet 转发到服务器上的另一个资源（servlet、JSP 文件或 HTML 文件）。此方法允许一个 servlet 对请求进行初步处理，并使另一个资源生成响应。

对于通过 getRequestDispatcher() 获得的 RequestDispatcher，ServletRequest 对象使其路径元素和参数进行调整以匹配目标资源的路径。

在将响应提交到客户端之前（在刷新响应正文输出之前），应该调用 forward。如果已经提交了响应，则此方法抛出 IllegalStateException。在转发之前，自动清除响应缓冲区中未提交的输出。

request 和 response 参数必须是传入调用的 servlet service 方法的对象，或者是包装它们的 ServletRequestWrapper 或 ServletResponseWrapper 类的子类。

request | 表示客户端对 servlet 发出的请求的 ServletRequest 对象
response | 表示 servlet 向客户端返回的响应的 ServletResponse 对象
Throws | ServletException: 如果目标资源抛出此异常
Throws | java.io.IOException: 如果目标资源抛出此异常
Throws | IllegalStateException: 如果已提交响应
英文文档：

forward

void forward(ServletRequest request,
             ServletResponse response)
             throws ServletException,
                    IOException
Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. This method allows one servlet to do preliminary processing of a request and another resource to generate the response.

For a RequestDispatcher obtained via getRequestDispatcher(), the ServletRequest object has its path elements and parameters adjusted to match the path of the target resource.

forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the ServletRequestWrapper or ServletResponseWrapper classes that wrap them.

Parameters:
request - a ServletRequest object that represents the request the client makes of the servlet
response - a ServletResponse object that represents the response the servlet returns to the client
Throws:
ServletException - if the target resource throws this exception
IOException - if the target resource throws this exception
IllegalStateException - if the response was already committed

public void include(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
包含响应中某个资源（servlet、JSP 页面和 HTML 文件）的内容。事实上，此方法支持编程式服务器端包含。

ServletResponse 对象使其路径元素和参数不根据调用者的路径元素和参数发生改变。包含的 servlet 无法更改响应状态代码或设置头；任何更改尝试都将被忽略。

request 和 response 参数必须是传入调用的 servlet service 方法的对象，或者是包装它们的 ServletRequestWrapper 或 ServletResponseWrapper 类的子类。

request | 包含客户端请求的 ServletRequest 对象
response | 包含 servlet 的响应的 ServletResponse 对象
Throws | ServletException: 如果包含的资源抛出此异常
Throws | java.io.IOException: 如果包含的资源抛出此异常
英文文档：

include

void include(ServletRequest request,
             ServletResponse response)
             throws ServletException,
                    IOException
Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

The ServletResponse object has its path elements and parameters remain unchanged from the caller's. The included servlet cannot change the response status code or set headers; any attempt to make a change is ignored.

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the ServletRequestWrapper or ServletResponseWrapper classes that wrap them.

Parameters:
request - a ServletRequest object that contains the client's request
response - a ServletResponse object that contains the servlet's response
Throws:
ServletException - if the included resource throws this exception
IOException - if the included resource throws this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Servlet (Java EE 5)

javax.servlet
Interface Servlet

All Known Subinterfaces:
HttpJspPage, JspPage
All Known Implementing Classes:
FacesServlet, GenericServlet, HttpServlet
public interface Servlet

Implemented by: FacesServlet, GenericServlet, JspPage

定义所有 servlet 都必须实现的方法。

servlet 是运行在 Web 服务器中的小型 Java 程序。servlet 通常通过 HTTP（超文本传输协议）接收和响应来自 Web 客户端的请求。

要实现此接口，可以编写一个扩展 javax.servlet.GenericServlet 的一般 servlet，或者编写一个扩展 javax.servlet.http.HttpServlet 的 HTTP servlet。

此接口定义了初始化 servlet 的方法、为请求提供服务的方法和从服务器移除 servlet 的方法。这些方法称为生命周期方法，它们是按以下顺序调用的：

  1. 构造 servlet，然后使用 init 方法将其初始化。
  2. 处理来自客户端的对 service 方法的所有调用。
  3. 从服务中取出 servlet，然后使用 destroy 方法销毁它，最后进行垃圾回收并终止它。

除了生命周期方法之外，此接口还提供了 getServletConfig 方法和 getServletInfo 方法，servlet 可使用前一种方法获得任何启动信息，而后一种方法允许 servlet 返回有关其自身的基本信息，比如作者、版本和版权。

See also javax.servlet.GenericServlet, javax.servlet.http.HttpServlet
英文文档：

Defines methods that all servlets must implement.

A servlet is a small Java program that runs within a Web server. Servlets receive and respond to requests from Web clients, usually across HTTP, the HyperText Transfer Protocol.

To implement this interface, you can write a generic servlet that extends javax.servlet.GenericServlet or an HTTP servlet that extends javax.servlet.http.HttpServlet.

This interface defines methods to initialize a servlet, to service requests, and to remove a servlet from the server. These are known as life-cycle methods and are called in the following sequence:

  1. The servlet is constructed, then initialized with the init method.
  2. Any calls from clients to the service method are handled.
  3. The servlet is taken out of service, then destroyed with the destroy method, then garbage collected and finalized.

In addition to the life-cycle methods, this interface provides the getServletConfig method, which the servlet can use to get any startup information, and the getServletInfo method, which allows the servlet to return basic information about itself, such as author, version, and copyright.

Author:
Various
See Also:
GenericServlet, HttpServlet

Method Summary
void | destroy() Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
ServletConfig | getServletConfig() Returns a ServletConfig object, which contains initialization and startup parameters for this servlet.
String | getServletInfo() Returns information about the servlet, such as author, version, and copyright.
void | init(ServletConfig config) Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
void | service(ServletRequest req, ServletResponse res) Called by the servlet container to allow the servlet to respond to a request.

Method Detail

public void init(ServletConfig config) throws ServletException
由 servlet 容器调用，指示将该 servlet 放入服务。

servlet 容器仅在实例化 servlet 之后调用 init 方法一次。在 servlet 可以接收任何请求之前，init 方法必须成功完成。

servlet 容器无法将 servlet 放入服务，如果 init 方法：

  1. 抛出 ServletException
  2. 未在 Web 服务器定义的时间段内返回
config | 包含 servlet 的配置和初始化参数的 ServletConfig 对象
Throws | ServletException: 如果发生妨碍 servlet 正常操作的异常
See also | javax.servlet.UnavailableException, getServletConfig
英文文档：

init

void init(ServletConfig config)
          throws ServletException
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.

The servlet container calls the init method exactly once after instantiating the servlet. The init method must complete successfully before the servlet can receive any requests.

The servlet container cannot place the servlet into service if the init method

  1. Throws a ServletException
  2. Does not return within a time period defined by the Web server

Parameters:
config - a ServletConfig object containing the servlet's configuration and initialization parameters
Throws:
ServletException - if an exception has occurred that interferes with the servlet's normal operation
See Also:
UnavailableException, getServletConfig()

public ServletConfig getServletConfig()
返回 ServletConfig 对象，该对象包含此 servlet 的初始化和启动参数。返回的 ServletConfig 对象是传递给 init 方法的对象。

此接口的实现负责存储 ServletConfig 对象，以便此方法可以返回该对象。实现此接口的 GenericServlet 类已经这样做了。

return | 初始化此 servlet 的 ServletConfig 对象
See also | init
英文文档：

getServletConfig

ServletConfig getServletConfig()
Returns a ServletConfig object, which contains initialization and startup parameters for this servlet. The ServletConfig object returned is the one passed to the init method.

Implementations of this interface are responsible for storing the ServletConfig object so that this method can return it. The GenericServlet class, which implements this interface, already does this.

Returns:
the ServletConfig object that initializes this servlet
See Also:
init(javax.servlet.ServletConfig)

public void service(ServletRequest req, ServletResponse res) throws ServletException, java.io.IOException
由 servlet 容器调用，以允许 servlet 响应某个请求。

此方法仅在 servlet 的 init() 方法成功完成之后调用。

应该为抛出或发送错误的 servlet 设置响应的状态代码。

servlet 通常运行在可同时处理多个请求的多线程 servlet 容器中。开发人员必须知道要同步对所有共享资源（比如文件、网络连接以及 servlet 的类和实例变量）的访问。有关 Java 中多线程编程的更多信息，可从 the Java tutorial on multi-threaded programming 中获得。

req | 包含客户端请求的 ServletRequest 对象
res | 包含 servlet 的响应的 ServletResponse 对象
Throws | ServletException: 如果发生妨碍 servlet 正常操作的异常
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

service

void service(ServletRequest req,
             ServletResponse res)
             throws ServletException,
                    IOException
Called by the servlet container to allow the servlet to respond to a request.

This method is only called after the servlet's init() method has completed successfully.

The status code of the response always should be set for a servlet that throws or sends an error.

Servlets typically run inside multithreaded servlet containers that can handle multiple requests concurrently. Developers must be aware to synchronize access to any shared resources such as files, network connections, and as well as the servlet's class and instance variables. More information on multithreaded programming in Java is available in the Java tutorial on multi-threaded programming.

Parameters:
req - the ServletRequest object that contains the client's request
res - the ServletResponse object that contains the servlet's response
Throws:
ServletException - if an exception occurs that interferes with the servlet's normal operation
IOException - if an input or output exception occurs

public String getServletInfo()
返回有关 servlet 的信息，比如作者、版本和版权。

此方法返回的字符串应该是纯文本，不应该是任何种类的标记（比如 HTML、XML，等等）。

return 包含 servlet 信息的 String
英文文档：

getServletInfo

String getServletInfo()
Returns information about the servlet, such as author, version, and copyright.

The string that this method returns should be plain text and not markup of any kind (such as HTML, XML, etc.).

Returns:
a String containing servlet information

public void destroy()
由 servlet 容器调用，指示将从服务中取出该 servlet。此方法仅在 servlet 的 service 方法已退出或者在过了超时期之后调用一次。在调用此方法之后，servlet 容器不会再对此 servlet 调用 service 方法。

此方法为 servlet 提供了一个清除持有的所有资源（比如内存、文件句柄和线程）的机会，并确保任何持久状态都与内存中该 servlet 的当前状态保持同步。

英文文档：

destroy

void destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. This method is only called once all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls this method, it will not call the service method again on this servlet.

This method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the servlet's current state in memory.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletConfig (Java EE 5)

javax.servlet
Interface ServletConfig

All Known Implementing Classes:
GenericServlet, HttpServlet
public interface ServletConfig

Implemented by: GenericServlet

servlet 容器使用的 servlet 配置对象，该对象在初始化期间将信息传递给 servlet。
英文文档：

A servlet configuration object used by a servlet container to pass information to a servlet during initialization.

Method Summary
String | getInitParameter(String name) Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
Enumeration | getInitParameterNames() Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters.
ServletContext | getServletContext() Returns a reference to the ServletContext in which the caller is executing.
String | getServletName() Returns the name of this servlet instance.

Method Detail

public String getServletName()
返回此 servlet 实例的名称。该名称可能是通过服务器管理提供的，在 Web 应用程序部署描述符中分配，或者对于未注册（和未命名）的 servlet 实例，该名称将是该 servlet 的类名称。
return servlet 实例的名称
英文文档：

getServletName

String getServletName()
Returns the name of this servlet instance. The name may be provided via server administration, assigned in the web application deployment descriptor, or for an unregistered (and thus unnamed) servlet instance it will be the servlet's class name.

Returns:
the name of the servlet instance

public ServletContext getServletContext()
返回对调用者在其中执行操作的 ServletContext 的引用。
return | 一个 ServletContext 对象，调用者用于与其 servlet 容器交互
See also | javax.servlet.ServletContext
英文文档：

getServletContext

ServletContext getServletContext()
Returns a reference to the ServletContext in which the caller is executing.

Returns:
a ServletContext object, used by the caller to interact with its servlet container
See Also:
ServletContext

public String getInitParameter(String name)
返回包含指定初始化参数的值的 String，如果参数不存在，则返回 null。
name | 指定初始化参数名称的 String
return | 包含初始化参数值的 String
英文文档：

getInitParameter

String getInitParameter(String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.

Parameters:
name - a String specifying the name of the initialization parameter
Returns:
a String containing the value of the initialization parameter

public java.util.Enumeration<E> getInitParameterNames()
以 String 对象的 Enumeration 的形式返回 servlet 的初始化参数的名称，如果 servlet 没有初始化参数，则返回一个空的 Enumeration。
return 包含 servlet 初始化参数名称的 String 对象的 Enumeration
英文文档：

getInitParameterNames

Enumeration getInitParameterNames()
Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters.

Returns:
an Enumeration of String objects containing the names of the servlet's initialization parameters
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContext (Java EE 5)

javax.servlet
Interface ServletContext

public interface ServletContext

定义一组方法，servlet 使用这些方法与其 servlet 容器进行通信，例如，获取文件的 MIME 类型、分发请求或写入日志文件。

每个 Java 虚拟机的每个“Web 应用程序”都有一个上下文。（“Web 应用程序”是 servlet 和内容的 Collection，这些 servlet 和内容安装在服务器的 URL 名称空间（比如 /catalog）的特定子集下，并且可能通过 .war 文件安装。）

如果 Web 应用程序在其部署描述符中标记为 "distributed"，那么每个虚拟机都将有一个上下文实例。在这种情况下，不能将上下文用作共享全局信息的位置（因为该信息不会是真正全局共享的）。请使用外部资源（如数据库）替代。

ServletContext 对象包含在 ServletConfig 对象中，ServletConfig 对象在初始化 servlet 时由 Web 服务器提供给 servlet。

See also getServletConfig, getServletContext
英文文档：

Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.

There is one context per "web application" per Java Virtual Machine. (A "web application" is a collection of servlets and content installed under a specific subset of the server's URL namespace such as /catalog and possibly installed via a .war file.)

In the case of a web application marked "distributed" in its deployment descriptor, there will be one context instance for each virtual machine. In this situation, the context cannot be used as a location to share global information (because the information won't be truly global). Use an external resource like a database instead.

The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized.

Author:
Various
See Also:
Servlet.getServletConfig(), ServletConfig.getServletContext()

Method Summary
 Object getAttribute(String name)
Returns the servlet container attribute with the given name, or null if there is no attribute by that name.
 Enumeration getAttributeNames()
Returns an Enumeration containing the attribute names available within this servlet context.
 ServletContext getContext(String uripath)
Returns a ServletContext object that corresponds to a specified URL on the server.
 String getContextPath()
Returns the context path of the web application.
 String getInitParameter(String name)
Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.
 Enumeration getInitParameterNames()
Returns the names of the context's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the context has no initialization parameters.
 int getMajorVersion()
Returns the major version of the Java Servlet API that this servlet container supports.
 String getMimeType(String file)
Returns the MIME type of the specified file, or null if the MIME type is not known.
 int getMinorVersion()
Returns the minor version of the Servlet API that this servlet container supports.
 RequestDispatcher getNamedDispatcher(String name)
Returns a RequestDispatcher object that acts as a wrapper for the named servlet.
 String getRealPath(String path)
Returns a String containing the real path for a given virtual path.
 RequestDispatcher getRequestDispatcher(String path)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.
 URL getResource(String path)
Returns a URL to the resource that is mapped to a specified path.
 InputStream getResourceAsStream(String path)
Returns the resource located at the named path as an InputStream object.
 Set getResourcePaths(String path)
Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.
 String getServerInfo()
Returns the name and version of the servlet container on which the servlet is running.
 Servlet getServlet(String name)
Deprecated. As of Java Servlet API 2.1, with no direct replacement.

This method was originally defined to retrieve a servlet from a ServletContext. In this version, this method always returns null and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

In lieu of this method, servlets can share information using the ServletContext class and can perform shared business logic by invoking methods on common non-servlet classes.

 String getServletContextName()
Returns the name of this web application corresponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.
 Enumeration getServletNames()
Deprecated. As of Java Servlet API 2.1, with no replacement.

This method was originally defined to return an Enumeration of all the servlet names known to this context. In this version, this method always returns an empty Enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

 Enumeration getServlets()
Deprecated. As of Java Servlet API 2.0, with no replacement.

This method was originally defined to return an Enumeration of all the servlets known to this servlet context. In this version, this method always returns an empty enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

 void log(Exception exception, String msg)
Deprecated. As of Java Servlet API 2.1, use log(String message, Throwable throwable) instead.

This method was originally defined to write an exception's stack trace and an explanatory error message to the servlet log file.

 void log(String msg)
Writes the specified message to a servlet log file, usually an event log.
 void log(String message, Throwable throwable)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file.
 void removeAttribute(String name)
Removes the attribute with the given name from the servlet context.
 void setAttribute(String name, Object object)
Binds an object to a given attribute name in this servlet context.

Method Detail

public String getContextPath()
返回 Web 应用程序的上下文路径。

上下文路径是用来选择请求上下文的请求 URI 的一部分。请求 URI 中首先出现的总是上下文路径。路径以 "/" 字符开头但不以 "/" 字符结束。对于默认（根）上下文中的 servlet，此方法返回 ""。

servlet 容器可能通过多个上下文路径匹配一个上下文。在这种情况下，getContextPath() 将返回该请求使用的实际上下文路径，它可能不同于此方法返回的路径。此方法返回的上下文路径应该被认为是应用程序的主要或首选上下文路径。

return | Web 应用程序的上下文路径；对于默认（根）上下文，返回 ""
since
en
Servlet 2.5
See also | getContextPath()
英文文档：

getContextPath

String getContextPath()
Returns the context path of the web application.

The context path is the portion of the request URI that is used to select the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. For servlets in the default (root) context, this method returns "".

It is possible that a servlet container may match a context by more than one context path. In such cases the HttpServletRequest.getContextPath() will return the actual context path used by the request and it may differ from the path returned by this method. The context path returned by this method should be considered as the prime or preferred context path of the application.

Returns:
The context path of the web application, or "" for the default (root) context
Since:
Servlet 2.5
See Also:
HttpServletRequest.getContextPath()

public ServletContext getContext(String uripath)
返回与服务器上的指定 URL 相对应的 ServletContext 对象。

此方法允许 servlet 获得对服务器各个部分的上下文的访问，并根据需要从上下文中获得 RequestDispatcher 对象。给定路径必须以 "/" 开头，相对于服务器的文档根进行解释，并与宿主在此容器上的其他 Web 应用程序的上下文根匹配。

在安全意识较强的环境中，servlet 容器可能对给定 URL 返回 null。

uripath | 指定容器中另一个 Web 应用程序的上下文路径的 String。
return | 与指定 URL 相对应的 ServletContext 对象；如果该对象不存在，或者容器希望限制此访问，则返回 null。
See also | javax.servlet.RequestDispatcher
英文文档：

getContext

ServletContext getContext(String uripath)
Returns a ServletContext object that corresponds to a specified URL on the server.

This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.

In a security conscious environment, the servlet container may return null for a given URL.

Parameters:
uripath - a String specifying the context path of another web application in the container.
Returns:
the ServletContext object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.
See Also:
RequestDispatcher

public int getMajorVersion()
返回此 servlet 容器支持的 Java Servlet API 的主版本。所有遵守 Version 2.5 的实现必须让此方法返回整数 2。
return 2
英文文档：

getMajorVersion

int getMajorVersion()
Returns the major version of the Java Servlet API that this servlet container supports. All implementations that comply with Version 2.5 must have this method return the integer 2.

Returns:
2

public int getMinorVersion()
返回此 servlet 容器支持的 Servlet API 的次版本。所有遵守 Version 2.5 的实现必须让此方法返回整数 5。
return 5
英文文档：

getMinorVersion

int getMinorVersion()
Returns the minor version of the Servlet API that this servlet container supports. All implementations that comply with Version 2.5 must have this method return the integer 5.

Returns:
5

public String getMimeType(String file)
返回指定文件的 MIME 类型，如果 MIME 类型未知，则返回 null。MIME 类型由 servlet 容器的配置确定，可以在 Web 应用程序部署描述符中指定。常见 MIME 类型是 "text/html" 和 "image/gif"。
file | 指定文件名称的 String
return | 指定文件的 MIME 类型的 String。
英文文档：

getMimeType

String getMimeType(String file)
Returns the MIME type of the specified file, or null if the MIME type is not known. The MIME type is determined by the configuration of the servlet container, and may be specified in a web application deployment descriptor. Common MIME types are "text/html" and "image/gif".

Parameters:
file - a String specifying the name of a file
Returns:
a String specifying the file's MIME type

public java.util.Set<E> getResourcePaths(String path)
返回指向 Web 应用程序中资源的所有路径的类似目录的清单，这些路径中最长的子路径与提供的 path 参数匹配。指示以 '/' 结尾的子目录路径的路径。返回的路径都是相对于 Web 应用程序根目录的并有一个前导 '/'。例如，对于包含以下内容的 Web 应用程序

/welcome.html
/catalog/index.html
/catalog/products.html
/catalog/offers/books.html
/catalog/offers/music.html
/customer/login.jsp
/WEB-INF/web.xml
/WEB-INF/classes/com.acme.OrderServlet.class,

getResourcePaths("/") 返回 {"/welcome.html", "/catalog/", "/customer/", "/WEB-INF/"}
getResourcePaths("/catalog/") 返回 {"/catalog/index.html", "/catalog/products.html", "/catalog/offers/"}。
path | 用于匹配资源的部分路径，必须以 / 开头
return | 包含目录清单的集合；如果 Web 应用程序中没有资源并且其路径以提供的路径开头，则返回 null。
since
en
Servlet 2.3
英文文档：

getResourcePaths

Set getResourcePaths(String path)
Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument. Paths indicating subdirectory paths end with a '/'. The returned paths are all relative to the root of the web application and have a leading '/'. For example, for a web application containing

/welcome.html
/catalog/index.html
/catalog/products.html
/catalog/offers/books.html
/catalog/offers/music.html
/customer/login.jsp
/WEB-INF/web.xml
/WEB-INF/classes/com.acme.OrderServlet.class,

getResourcePaths("/") returns {"/welcome.html", "/catalog/", "/customer/", "/WEB-INF/"}
getResourcePaths("/catalog/") returns {"/catalog/index.html", "/catalog/products.html", "/catalog/offers/"}.

Parameters:
path - the partial path used to match the resources, which must start with a /
Returns:
a Set containing the directory listing, or null if there are no resources in the web application whose path begins with the supplied path.
Since:
Servlet 2.3

public java.net.URL getResource(String path) throws java.net.MalformedURLException
返回指向映射到指定路径的资源的 URL。该路径必须以 "/" 开头，并相对于当前上下文根进行解释。

此方法允许 servlet 容器使某一资源可用于来自任意源的 servlet。资源可位于本地或远程文件系统上、数据库中或 .war 文件中。

servlet 容器必须实现访问资源所需的 URL 处理程序和 URLConnection 对象。

如果没有资源映射到路径名，则此方法返回 null。

某些容器可能允许使用 URL 类的方法写入此方法返回的 URL。

资源内容是直接返回的，所以应该知道请求一个 .jsp 页面将返回 JSP 源代码。请改用 RequestDispatcher 以包含执行的结果。

此方法有一个与 java.lang.Class.getResource 不同的用途，后者基于类加载器查找资源。此方法不使用类加载器。

path | 指定指向资源的路径的 String
return | 位于指定路径上的资源，如果该路径上没有资源，则返回 null
Throws | java.net.MalformedURLException: 如果没有以正确格式给出路径名
英文文档：

getResource

URL getResource(String path)
                throws MalformedURLException
Returns a URL to the resource that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root.

This method allows the servlet container to make a resource available to servlets from any source. Resources can be located on a local or remote file system, in a database, or in a .war file.

The servlet container must implement the URL handlers and URLConnection objects that are necessary to access the resource.

This method returns null if no resource is mapped to the pathname.

Some containers may allow writing to the URL returned by this method using the methods of the URL class.

The resource content is returned directly, so be aware that requesting a .jsp page returns the JSP source code. Use a RequestDispatcher instead to include results of an execution.

This method has a different purpose than java.lang.Class.getResource, which looks up resources based on a class loader. This method does not use class loaders.

Parameters:
path - a String specifying the path to the resource
Returns:
the resource located at the named path, or null if there is no resource at that path
Throws:
MalformedURLException - if the pathname is not given in the correct form

public java.io.InputStream getResourceAsStream(String path)
以 InputStream 对象的形式返回位于指定路径上的资源。

InputStream 中的数据可以是任意类型或长度。该路径必须根据 getResource 中给出的规则指定。如果指定路径上没有资源，则此方法返回 null。

使用此方法时，可通过 getResource 方法获得的元信息（比如内容长度和内容类型）将丢失。

servlet 容器必须实现访问资源所需的 URL 处理程序和 URLConnection 对象。

此方法不同于 java.lang.Class.getResourceAsStream，后者使用类加载器。此方法允许 servlet 容器使某一资源可用于来自任意位置的 servlet，而不必使用类加载器。

path | 指定指向资源的路径的 String
return | 返回给 servlet 的 InputStream，如果指定路径上没有资源，则返回 null。
英文文档：

getResourceAsStream

InputStream getResourceAsStream(String path)
Returns the resource located at the named path as an InputStream object.

The data in the InputStream can be of any type or length. The path must be specified according to the rules given in getResource. This method returns null if no resource exists at the specified path.

Meta-information such as content length and content type that is available via getResource method is lost when using this method.

The servlet container must implement the URL handlers and URLConnection objects necessary to access the resource.

This method is different from java.lang.Class.getResourceAsStream, which uses a class loader. This method allows servlet containers to make a resource available to a servlet from any location, without using a class loader.

Parameters:
path - a String specifying the path to the resource
Returns:
the InputStream returned to the servlet, or null if no resource exists at the specified path

public RequestDispatcher getRequestDispatcher(String path)
返回一个 RequestDispatcher 对象，它充当位于给定路径上的资源的包装器。可以使用 RequestDispatcher 对象将请求转发到资源，或者在响应中包含资源。资源可以是动态的，也可以是静态的。

该路径名必须以 "/" 开头，并相对于当前上下文根进行解释。使用 getContext 获得用于外部上下文中资源的 RequestDispatcher。如果 ServletContext 无法返回 RequestDispatcher，则此方法返回 null。

path | 指定指向资源的路径名的 String
return | 充当指定路径上资源的包装器的 RequestDispatcher 对象，如果 ServletContext 无法返回 RequestDispatcher，则返回 null。
See also | javax.servlet.RequestDispatcher, getContext
英文文档：

getRequestDispatcher

RequestDispatcher getRequestDispatcher(String path)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.

The pathname must begin with a "/" and is interpreted as relative to the current context root. Use getContext to obtain a RequestDispatcher for resources in foreign contexts. This method returns null if the ServletContext cannot return a RequestDispatcher.

Parameters:
path - a String specifying the pathname to the resource
Returns:
a RequestDispatcher object that acts as a wrapper for the resource at the specified path, or null if the ServletContext cannot return a RequestDispatcher
See Also:
RequestDispatcher, getContext(java.lang.String)

public RequestDispatcher getNamedDispatcher(String name)
返回充当指定 servlet 的包装器的 RequestDispatcher 对象。

servlet（以及 JSP 页面）可通过服务器管理或通过 Web 应用程序部署描述符给定名称。servlet 实例可使用 ServletConfig#getServletName 确定其名称。

如果 ServletContext 由于某种原因无法返回 RequestDispatcher，则此方法返回 null。

name | 指定要包装的 servlet 的名称的 String
return | 充当指定 servlet 的包装器的 RequestDispatcher 对象，如果 ServletContext 无法返回 RequestDispatcher，则返回 null。
See also | javax.servlet.RequestDispatcher, getContext, getServletName
英文文档：

getNamedDispatcher

RequestDispatcher getNamedDispatcher(String name)
Returns a RequestDispatcher object that acts as a wrapper for the named servlet.

Servlets (and JSP pages also) may be given names via server administration or via a web application deployment descriptor. A servlet instance can determine its name using ServletConfig.getServletName().

This method returns null if the ServletContext cannot return a RequestDispatcher for any reason.

Parameters:
name - a String specifying the name of a servlet to wrap
Returns:
a RequestDispatcher object that acts as a wrapper for the named servlet, or null if the ServletContext cannot return a RequestDispatcher
See Also:
RequestDispatcher, getContext(java.lang.String), ServletConfig.getServletName()

public Servlet getServlet(String name) throws ServletException
deprecated 从 Java Servlet API 2.1 起，不再直接替换。

定义此方法最初是为了从 ServletContext 中获取 servlet。在此版本中，此方法总是返回 null，保留它只是为了保持二进制兼容性。此方法将在 Java Servlet API 将来的版本中永久移除。

作为此方法的替代，servlet 可以使用 ServletContext 类共享信息，并通过对公共非 servlet 类调用方法执行共享的业务逻辑。

英文文档：

getServlet

Servlet getServlet(String name)
                   throws ServletException
Deprecated. As of Java Servlet API 2.1, with no direct replacement.

This method was originally defined to retrieve a servlet from a ServletContext. In this version, this method always returns null and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

In lieu of this method, servlets can share information using the ServletContext class and can perform shared business logic by invoking methods on common non-servlet classes.

Throws:
ServletException

public java.util.Enumeration<E> getServlets()
deprecated 从 Java Servlet API 2.0 起，不再提供替代方法。

定义此方法最初是为了返回此 servlet 上下文已知的所有 servlet 的 Enumeration。在此版本中，此方法总是返回一个空枚举，保留它只是为了保持二进制兼容性。此方法将在 Java Servlet API 将来的版本中永久移除。

英文文档：

getServlets

Enumeration getServlets()
Deprecated. As of Java Servlet API 2.0, with no replacement.

This method was originally defined to return an Enumeration of all the servlets known to this servlet context. In this version, this method always returns an empty enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

public java.util.Enumeration<E> getServletNames()
deprecated 从 Java Servlet API 2.1 起，不再提供替代方法。

定义此方法最初是为了返回此上下文已知的所有 servlet 名称的 Enumeration。在此版本中，此方法总是返回一个空 Enumeration，保留它只是为了保持二进制兼容性。此方法将在 Java Servlet API 将来的版本中永久移除。

英文文档：

getServletNames

Enumeration getServletNames()
Deprecated. As of Java Servlet API 2.1, with no replacement.

This method was originally defined to return an Enumeration of all the servlet names known to this context. In this version, this method always returns an empty Enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

public void log(String msg)
将指定消息写入 servlet 日志文件（通常是一个事件日志）。servlet 日志文件的名称和类型是特定于 servlet 容器的。
msg 指定要写入日志文件的消息的 String
英文文档：

log

void log(String msg)
Writes the specified message to a servlet log file, usually an event log. The name and type of the servlet log file is specific to the servlet container.

Parameters:
msg - a String specifying the message to be written to the log file

public void log(Exception exception, String msg)
deprecated 从 Java Servlet API 2.1 起，请改用 #log(String message, Throwable throwable)。

定义此方法最初是为了将异常的堆栈跟踪和一条解释性错误消息写入 servlet 日志文件。

英文文档：

log

void log(Exception exception,
         String msg)
Deprecated. As of Java Servlet API 2.1, use log(String message, Throwable throwable) instead.

This method was originally defined to write an exception's stack trace and an explanatory error message to the servlet log file.

public void log(String message, Throwable throwable)
将给定 Throwable 异常的解释性消息和堆栈跟踪写入 servlet 日志文件。servlet 日志文件的名称和类型是特定于 servlet 容器的（通常是一个事件日志）。
message | 描述错误或异常的 String
throwable | Throwable 错误或异常
英文文档：

log

void log(String message,
         Throwable throwable)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file. The name and type of the servlet log file is specific to the servlet container, usually an event log.

Parameters:
message - a String that describes the error or exception
throwable - the Throwable error or exception

public String getRealPath(String path)
为给定虚拟路径返回包含实际路径的 String。例如，可以通过对 "http://host/contextPath/index.html" 的请求使路径 "/index.html" 返回服务器文件系统上的绝对文件路径，其中 contextPath 是此 ServletContext 的上下文路径。

将采用与正在其上运行 servlet 容器的计算机和操作系统相适应的形式返回实际路径（包括采用适当的路径分隔符）。如果 servlet 容器由于某种原因无法将虚拟路径转换为实际路径（例如正从 .war 归档文件中获得内容时），则此方法返回 null。

path | 指定虚拟路径的 String
return | 指定实际路径的 String，如果无法执行转换，则返回 null。
英文文档：

getRealPath

String getRealPath(String path)
Returns a String containing the real path for a given virtual path. For example, the path "/index.html" returns the absolute file path on the server's filesystem would be served by a request for "http://host/contextPath/index.html", where contextPath is the context path of this ServletContext..

The real path returned will be in a form appropriate to the computer and operating system on which the servlet container is running, including the proper path separators. This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive).

Parameters:
path - a String specifying a virtual path
Returns:
a String specifying the real path, or null if the translation cannot be performed

public String getServerInfo()
返回正在其上运行 servlet 的 servlet 容器的名称和版本。

所返回字符串的形式是 servername/versionnumber。例如，JavaServer Web Development Kit 可能返回字符串 JavaServer Web Dev Kit/1.0。

servlet 容器可以在主字符串之后在括号中返回其他可选信息，例如 JavaServer Web Dev Kit/1.0 (JDK 1.1.6; Windows NT 4.0 x86)。

return 至少包含 servlet 容器名称和版本号的 String。
英文文档：

getServerInfo

String getServerInfo()
Returns the name and version of the servlet container on which the servlet is running.

The form of the returned string is servername/versionnumber. For example, the JavaServer Web Development Kit may return the string JavaServer Web Dev Kit/1.0.

The servlet container may return other optional information after the primary string in parentheses, for example, JavaServer Web Dev Kit/1.0 (JDK 1.1.6; Windows NT 4.0 x86).

Returns:
a String containing at least the servlet container name and version number

public String getInitParameter(String name)
返回包含指定上下文范围初始化参数值的 String，如果参数不存在，则返回 null。

此方法可使可用的配置信息用于整个“Web 应用程序”。例如，它可以提供 webmaster 的电子邮件地址，或者提供包含关键数据的系统的名称。

name | 包含请求其值的参数的名称的 String
return | 至少包含 servlet 容器名称和版本号的 String。
See also | getInitParameter
英文文档：

getInitParameter

String getInitParameter(String name)
Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.

This method can make available configuration information useful to an entire "web application". For example, it can provide a webmaster's email address or the name of a system that holds critical data.

Parameters:
name - a String containing the name of the parameter whose value is requested
Returns:
a String containing at least the servlet container name and version number
See Also:
ServletConfig.getInitParameter(java.lang.String)

public java.util.Enumeration<E> getInitParameterNames()
以 String 对象的 Enumeration 的形式返回上下文初始化参数的名称，如果该上下文没有初始化参数，则返回一个空的 Enumeration。
return | 包含上下文初始化参数名称的 String 对象的 Enumeration。
See also | getInitParameter
英文文档：

getInitParameterNames

Enumeration getInitParameterNames()
Returns the names of the context's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the context has no initialization parameters.

Returns:
an Enumeration of String objects containing the names of the context's initialization parameters
See Also:
ServletConfig.getInitParameter(java.lang.String)

public Object getAttribute(String name)
返回具有给定名称的 servlet 容器属性，如果不具有该名称的属性，则返回 null。属性允许 servlet 容器将此接口还没有提供的额外信息提供给 servlet。有关其属性的信息，请参见服务器文档。可使用 getAttributeNames 获取支持的属性的列表。

属性是以 java.lang.Object 或某个子类的形式返回的。属性名称应该与包名称遵守相同的约定。Java Servlet API 规范保留匹配 java.*、javax.* 和 sun.* 的名称。

name | 指定属性名称的 String
return | 包含属性值的 Object，如果不存在匹配给定名称的属性，则返回 null
See also | getAttributeNames
英文文档：

getAttribute

Object getAttribute(String name)
Returns the servlet container attribute with the given name, or null if there is no attribute by that name. An attribute allows a servlet container to give the servlet additional information not already provided by this interface. See your server documentation for information about its attributes. A list of supported attributes can be retrieved using getAttributeNames.

The attribute is returned as a java.lang.Object or some subclass. Attribute names should follow the same convention as package names. The Java Servlet API specification reserves names matching java.*, javax.*, and sun.*.

Parameters:
name - a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if no attribute exists matching the given name
See Also:
getAttributeNames()

public java.util.Enumeration<E> getAttributeNames()
返回包含此 servlet 上下文中可用属性的名称的 Enumeration。使用带有一个属性名称的 #getAttribute 方法获取属性值。
return | 属性名称的 Enumeration
See also | getAttribute
英文文档：

getAttributeNames

Enumeration getAttributeNames()
Returns an Enumeration containing the attribute names available within this servlet context. Use the getAttribute(java.lang.String) method with an attribute name to get the value of an attribute.

Returns:
an Enumeration of attribute names
See Also:
getAttribute(java.lang.String)

public void setAttribute(String name, Object object)
将对象绑定到此 servlet 上下文中的给定属性名称。如果已将指定名称用于某个属性，则此方法将使用新属性替换具有该名称的属性。

如果在 ServletContext 上配置了侦听器，则容器将相应地通知它们。

如果传递了 null 值，则效果将与调用 removeAttribute() 相同。

属性名称应该与包名称遵守相同的约定。Java Servlet API 规范保留匹配 java.*、javax.* 和 sun.* 的名称。

name | 指定属性名称的 String
object | 表示要绑定的属性的 Object
英文文档：

setAttribute

void setAttribute(String name,
                  Object object)
Binds an object to a given attribute name in this servlet context. If the name specified is already used for an attribute, this method will replace the attribute with the new to the new attribute.

If listeners are configured on the ServletContext the container notifies them accordingly.

If a null value is passed, the effect is the same as calling removeAttribute().

Attribute names should follow the same convention as package names. The Java Servlet API specification reserves names matching java.*, javax.*, and sun.*.

Parameters:
name - a String specifying the name of the attribute
object - an Object representing the attribute to be bound

public void removeAttribute(String name)
从 servlet 上下文中移除具有给定名称的属性。完成移除操作后，为获取属性值而对 #getAttribute 进行的后续调用将返回 null。

如果在 ServletContext 上配置了侦听器，则容器将相应地通知它们。

name 指定要移除的属性的名称的 String
英文文档：

removeAttribute

void removeAttribute(String name)
Removes the attribute with the given name from the servlet context. After removal, subsequent calls to getAttribute(java.lang.String) to retrieve the attribute's value will return null.

If listeners are configured on the ServletContext the container notifies them accordingly.

Parameters:
name - a String specifying the name of the attribute to be removed

public String getServletContextName()
返回与此 ServletContext 相对应的 Web 应用程序的名称，该名称是通过 display-name 元素在部署描述符中为此 Web 应用程序指定的。
return Web 应用程序的名称，如果尚未在部署描述符中声明该名称，则返回 null。
since
en
Servlet 2.3
英文文档：

getServletContextName

String getServletContextName()
Returns the name of this web application corresponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.

Returns:
The name of the web application or null if no name has been declared in the deployment descriptor.
Since:
Servlet 2.3
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextAttributeListener (Java EE 5)

javax.servlet
Interface ServletContextAttributeListener

All Superinterfaces:
EventListener
public interface ServletContextAttributeListener
extends EventListener

Implements: java.util.EventListener

此接口的实现接收 Web 应用程序的 servlet 上下文中的属性列表更改通知。要接收通知事件，必须在 Web 应用程序的部署描述符中配置实现类。
since
en
v 2.3
See also javax.servlet.ServletContextAttributeEvent
英文文档：

Implementations of this interface receive notifications of changes to the attribute list on the servlet context of a web application. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application.

Since:
v 2.3
See Also:
ServletContextAttributeEvent

Method Summary
void | attributeAdded(ServletContextAttributeEvent scab) Notification that a new attribute was added to the servlet context.
void | attributeRemoved(ServletContextAttributeEvent scab) Notification that an existing attribute has been removed from the servlet context.
void | attributeReplaced(ServletContextAttributeEvent scab) Notification that an attribute on the servlet context has been replaced.

Method Detail

public void attributeAdded(ServletContextAttributeEvent scab)
通知向 servlet 上下文中添加了一个新属性。在添加属性之后调用。
英文文档：

attributeAdded

void attributeAdded(ServletContextAttributeEvent scab)
Notification that a new attribute was added to the servlet context. Called after the attribute is added.

public void attributeRemoved(ServletContextAttributeEvent scab)
通知现有属性已从 servlet 上下文中移除。在移除属性之后调用。
英文文档：

attributeRemoved

void attributeRemoved(ServletContextAttributeEvent scab)
Notification that an existing attribute has been removed from the servlet context. Called after the attribute is removed.

public void attributeReplaced(ServletContextAttributeEvent scab)
通知已替换 servlet 上下文中的一个属性。在替换属性之后调用。
英文文档：

attributeReplaced

void attributeReplaced(ServletContextAttributeEvent scab)
Notification that an attribute on the servlet context has been replaced. Called after the attribute is replaced.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextListener (Java EE 5)

javax.servlet
Interface ServletContextListener

All Superinterfaces:
EventListener
public interface ServletContextListener
extends EventListener

Implements: java.util.EventListener

此接口的实现接收有关其所属 Web 应用程序的 servlet 上下文更改的通知。要接收通知事件，必须在 Web 应用程序的部署描述符中配置实现类。
since
en
v 2.3
See also javax.servlet.ServletContextEvent
英文文档：

Implementations of this interface receive notifications about changes to the servlet context of the web application they are part of. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application.

Since:
v 2.3
See Also:
ServletContextEvent

Method Summary
void | contextDestroyed(ServletContextEvent sce) Notification that the servlet context is about to be shut down.
void | contextInitialized(ServletContextEvent sce) Notification that the web application initialization process is starting.

Method Detail

public void contextInitialized(ServletContextEvent sce)
通知将开始 Web 应用程序初始化过程。在初始化 Web 应用程序中的所有过滤器或 servlet 之前，应该通知所有 ServletContextListener 关于上下文初始化的信息。
英文文档：

contextInitialized

void contextInitialized(ServletContextEvent sce)
Notification that the web application initialization process is starting. All ServletContextListeners are notified of context initialization before any filter or servlet in the web application is initialized.

public void contextDestroyed(ServletContextEvent sce)
通知即将关闭 servlet 上下文。在通知所有 ServletContextListener 上下文销毁之前，所有 servlet 和过滤器都已销毁。
英文文档：

contextDestroyed

void contextDestroyed(ServletContextEvent sce)
Notification that the servlet context is about to be shut down. All servlets and filters have been destroy()ed before any ServletContextListeners are notified of context destruction.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequest (Java EE 5)

javax.servlet
Interface ServletRequest

All Known Subinterfaces:
HttpServletRequest
All Known Implementing Classes:
HttpServletRequestWrapper, ServletRequestWrapper
public interface ServletRequest

Implemented by: HttpServletRequest, ServletRequestWrapper

定义将客户端请求信息提供给某个 servlet 的对象。servlet 容器创建 ServletRequest 对象，并将该对象作为参数传递给该 servlet 的 service 方法。

ServletRequest 对象提供包括参数名称、参数值、属性和输入流的数据。扩展 ServletRequest 的接口可提供其他特定于协议的数据，例如 javax.servlet.http.HttpServletRequest 提供的 HTTP 数据。

See also javax.servlet.http.HttpServletRequest
英文文档：

Defines an object to provide client request information to a servlet. The servlet container creates a ServletRequest object and passes it as an argument to the servlet's service method.

A ServletRequest object provides data including parameter name and values, attributes, and an input stream. Interfaces that extend ServletRequest can provide additional protocol-specific data (for example, HTTP data is provided by HttpServletRequest.

Author:
Various
See Also:
HttpServletRequest

Method Summary
Object | getAttribute(String name) Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
Enumeration | getAttributeNames() Returns an Enumeration containing the names of the attributes available to this request.
String | getCharacterEncoding() Returns the name of the character encoding used in the body of this request.
int | getContentLength() Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.
String | getContentType() Returns the MIME type of the body of the request, or null if the type is not known.
ServletInputStream | getInputStream() Retrieves the body of the request as binary data using a ServletInputStream.
String | getLocalAddr() Returns the Internet Protocol (IP) address of the interface on which the request was received.
Locale | getLocale() Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.
Enumeration | getLocales() Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.
String | getLocalName() Returns the host name of the Internet Protocol (IP) interface on which the request was received.
int | getLocalPort() Returns the Internet Protocol (IP) port number of the interface on which the request was received.
String | getParameter(String name) Returns the value of a request parameter as a String, or null if the parameter does not exist.
Map | getParameterMap() Returns a java.util.Map of the parameters of this request.
Enumeration | getParameterNames() Returns an Enumeration of String objects containing the names of the parameters contained in this request.
String[] | getParameterValues(String name) Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
String | getProtocol() Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
BufferedReader | getReader() Retrieves the body of the request as character data using a BufferedReader.
String | getRealPath(String path) Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String) instead.
String | getRemoteAddr() Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
String | getRemoteHost() Returns the fully qualified name of the client or the last proxy that sent the request.
int | getRemotePort() Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
RequestDispatcher | getRequestDispatcher(String path) Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.
String | getScheme() Returns the name of the scheme used to make this request, for example, http, https, or ftp.
String | getServerName() Returns the host name of the server to which the request was sent.
int | getServerPort() Returns the port number to which the request was sent.
boolean | isSecure() Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
void | removeAttribute(String name) Removes an attribute from this request.
void | setAttribute(String name, Object o) Stores an attribute in this request.
void | setCharacterEncoding(String env) Overrides the name of the character encoding used in the body of this request.

Method Detail

public Object getAttribute(String name)
以 Object 形式返回指定属性的值，如果不存在给定名称的属性，则返回 null。

可以以两种方式设置属性。servlet 容器可设置属性，使有关请求的自定义信息可用。例如，对于使用 HTTPS 发出的请求，可使用属性 javax.servlet.request.X509Certificate 获取有关客户端证书的信息。还可以使用 ServletRequest#setAttribute 以编程方式设置属性。这允许在调用 RequestDispatcher 之前将信息嵌入请求。

属性名称应遵守与包名称相同的命名约定。此规范保留匹配 java.*、javax.* 和 sun.* 的名称。

name | 指定属性名称的 String
return | 包含属性值的 Object，如果属性不存在，则返回 null
英文文档：

getAttribute

Object getAttribute(String name)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

Attributes can be set two ways. The servlet container may set attributes to make available custom information about a request. For example, for requests made using HTTPS, the attribute javax.servlet.request.X509Certificate can be used to retrieve information on the certificate of the client. Attributes can also be set programatically using setAttribute(java.lang.String, java.lang.Object). This allows information to be embedded into a request before a RequestDispatcher call.

Attribute names should follow the same conventions as package names. This specification reserves names matching java.*, javax.*, and sun.*.

Parameters:
name - a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if the attribute does not exist

public java.util.Enumeration<E> getAttributeNames()
返回包含此请求可用属性的名称的 Enumeration。如果该请求没有可用的属性，则此方法返回一个空的 Enumeration。
return 包含请求的属性名称的字符串的 Enumeration
英文文档：

getAttributeNames

Enumeration getAttributeNames()
Returns an Enumeration containing the names of the attributes available to this request. This method returns an empty Enumeration if the request has no attributes available to it.

Returns:
an Enumeration of strings containing the names of the request's attributes

public String getCharacterEncoding()
返回此请求正文中使用的字符编码的名称。如果该请求未指定字符编码，则此方法返回 null
return 包含字符编码的名称的 String，如果该请求未指定字符编码，则返回 null
英文文档：

getCharacterEncoding

String getCharacterEncoding()
Returns the name of the character encoding used in the body of this request. This method returns null if the request does not specify a character encoding

Returns:
a String containing the name of the character encoding, or null if the request does not specify a character encoding

public void setCharacterEncoding(String env) throws java.io.UnsupportedEncodingException
重写此请求正文中使用的字符编码的名称。必须在使用 getReader() 读取请求参数或读取输入之前调用此方法。否则，此方法没有任何效果。
env | 包含字符编码名称的 String。
Throws | java.io.UnsupportedEncodingException: 如果此 ServletRequest 仍然处于可以设置字符编码的状态，但指定编码无效
英文文档：

setCharacterEncoding

void setCharacterEncoding(String env)
                          throws UnsupportedEncodingException
Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.

Parameters:
env - String containing the name of the character encoding.
Throws:
UnsupportedEncodingException - if this ServletRequest is still in a state where a character encoding may be set, but the specified encoding is invalid

public int getContentLength()
返回请求正文的长度（以字节为单位），并使输入流可以使用它，如果长度未知，则返回 -1。对于 HTTP servlet，返回的值与 CGI 变量 CONTENT_LENGTH 的值相同。
return 包含请求正文长度的整数，如果长度未知，则返回 -1
英文文档：

getContentLength

int getContentLength()
Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_LENGTH.

Returns:
an integer containing the length of the request body or -1 if the length is not known

public String getContentType()
返回请求正文的 MIME 类型，如果该类型未知，则返回 null。对于 HTTP servlet，返回的值与 CGI 变量 CONTENT_TYPE 的值相同。
return 包含请求的 MIME 类型名称的 String，如果该类型未知，则返回 null
英文文档：

getContentType

String getContentType()
Returns the MIME type of the body of the request, or null if the type is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_TYPE.

Returns:
a String containing the name of the MIME type of the request, or null if the type is not known

public ServletInputStream getInputStream() throws java.io.IOException
使用 ServletInputStream 以二进制数据形式获取请求正文。可调用此方法或 #getReader 读取正文，而不是两种方法都调用。
return | 包含请求正文的 ServletInputStream 对象
Throws | IllegalStateException: 如果已经为此请求调用 #getReader 方法
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

getInputStream

ServletInputStream getInputStream()
                                  throws IOException
Retrieves the body of the request as binary data using a ServletInputStream. Either this method or getReader() may be called to read the body, not both.

Returns:
a ServletInputStream object containing the body of the request
Throws:
IllegalStateException - if the getReader() method has already been called for this request
IOException - if an input or output exception occurred

public String getParameter(String name)
以 String 形式返回请求参数的值，如果该参数不存在，则返回 null。请求参数是与请求一起发送的额外信息。对于 HTTP servlet，参数包含在查询字符串或发送的表单数据中。

只有在确定参数只有一个值时，才应该使用此方法。如果参数可能拥有一个以上的值，则使用 #getParameterValues。

如果将此方法用于一个有多个值的参数，则返回的值等于 getParameterValues 返回的数组中的第一个值。

如果参数数据是在请求正文中发送的，比如发生在 HTTP POST 请求中，则通过 #getInputStream 或 #getReader 直接读取正文可能妨碍此方法的执行。

name | 指定参数名称的 String
return | 表示单个参数值的 String
See also | getParameterValues
英文文档：

getParameter

String getParameter(String name)
Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String).

If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.

If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via getInputStream() or getReader() can interfere with the execution of this method.

Parameters:
name - a String specifying the name of the parameter
Returns:
a String representing the single value of the parameter
See Also:
getParameterValues(java.lang.String)

public java.util.Enumeration<E> getParameterNames()
返回包含此请求中所包含参数的名称的 String 对象的 Enumeration。如果该请求没有参数，则此方法返回一个空的 Enumeration。
return String 对象的 Enumeration，每个 String 都包含一个请求参数的名称；如果该请求没有参数，则返回一个空的 Enumeration
英文文档：

getParameterNames

Enumeration getParameterNames()
Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.

Returns:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters

public String[] getParameterValues(String name)
返回包含给定请求参数拥有的所有值的 String 对象数组，如果该参数不存在，则返回 null。

如果该参数只有一个值，则数组的长度为 1。

name | 包含请求其值的参数的名称的 String
return | 包含参数值的 String 对象数组
See also | getParameter
英文文档：

getParameterValues

String[] getParameterValues(String name)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

If the parameter has a single value, the array has a length of 1.

Parameters:
name - a String containing the name of the parameter whose value is requested
Returns:
an array of String objects containing the parameter's values
See Also:
getParameter(java.lang.String)

public java.util.Map<K, V> getParameterMap()
返回此请求的参数的 java.util.Map。请求参数是与请求一起发送的额外信息。对于 HTTP servlet，参数包含在查询字符串或发送的表单数据中。
return 将参数名称作为键、参数值作为映射值的不可变 java.util.Map。参数映射中的键的类型为 String。参数映射中的值的类型为 String 数组。
英文文档：

getParameterMap

Map getParameterMap()
Returns a java.util.Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

Returns:
an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.

public String getProtocol()
以 protocol/majorVersion.minorVersion 的形式（例如 HTTP/1.1）返回请求使用的协议的名称和版本。对于 HTTP servlet，返回的值与 CGI 变量 SERVER_PROTOCOL 的值相同。
return 包含协议名称和版本号的 String
英文文档：

getProtocol

String getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. For HTTP servlets, the value returned is the same as the value of the CGI variable SERVER_PROTOCOL.

Returns:
a String containing the protocol name and version number

public String getScheme()
返回用于发出此请求的方案的名称，例如 http、https 或 ftp。不同方案具有不同的构造 URL 的规则，这一点已在 RFC 1738 中注明。
return 包含用于发出此请求的方案的名称的 String
英文文档：

getScheme

String getScheme()
Returns the name of the scheme used to make this request, for example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.

Returns:
a String containing the name of the scheme used to make this request

public String getServerName()
返回请求被发送到的服务器的主机名。它是 Host 头值 ":"（如果有）之前的那部分的值，或者解析的服务器名称或服务器 IP 地址。
return 包含服务器名称的 String
英文文档：

getServerName

String getServerName()
Returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header value, if any, or the resolved server name, or the server IP address.

Returns:
a String containing the name of the server

public int getServerPort()
返回请求被发送到的端口号。它是 Host 头值 ":"（如果有）之后的那部分的值，或者接受客户端连接的服务器端口。
return 指定端口号的整数
英文文档：

getServerPort

int getServerPort()
Returns the port number to which the request was sent. It is the value of the part after ":" in the Host header value, if any, or the server port where the client connection was accepted on.

Returns:
an integer specifying the port number

public java.io.BufferedReader getReader() throws java.io.IOException
使用 BufferedReader 以字符数据形式获取请求正文。读取器根据正文上使用的字符编码转换字符数据。可调用此方法或 #getInputStream 读取正文，而不是两种方法都调用。
return | 包含请求正文的 BufferedReader
Throws | UnsupportedEncodingException: 如果使用的字符集编码不受支持，并且无法对文本进行解码
Throws | IllegalStateException: 如果已对此请求调用 #getInputStream 方法
Throws | java.io.IOException: 如果发生输入或输出异常
See also | getInputStream
英文文档：

getReader

BufferedReader getReader()
                         throws IOException
Retrieves the body of the request as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method or getInputStream() may be called to read the body, not both.

Returns:
a BufferedReader containing the body of the request
Throws:
UnsupportedEncodingException - if the character set encoding used is not supported and the text cannot be decoded
IllegalStateException - if getInputStream() method has been called on this request
IOException - if an input or output exception occurred
See Also:
getInputStream()

public String getRemoteAddr()
返回发送请求的客户端或最后一个代理的 Internet Protocol (IP) 地址。对于 HTTP servlet，返回的值与 CGI 变量 REMOTE_ADDR 的值相同。
return 包含发送请求的客户端的 IP 地址的 String
英文文档：

getRemoteAddr

String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR.

Returns:
a String containing the IP address of the client that sent the request

public String getRemoteHost()
返回发送请求的客户端或最后一个代理的完全限定名称。如果引擎无法或没有选择解析主机名（为了提高性能），则此方法返回以点分隔的字符串形式的 IP 地址。对于 HTTP servlet，返回的值与 CGI 变量 REMOTE_HOST 的值相同。
return 包含客户端的完全限定名称的 String
英文文档：

getRemoteHost

String getRemoteHost()
Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST.

Returns:
a String containing the fully qualified name of the client

public void setAttribute(String name, Object o)
存储此请求中的属性。在请求之间重置属性。此方法常常与 RequestDispatcher 一起使用。

属性名称应遵守与包名称相同的命名约定。以 java.*、javax.* 和 com.sun.* 开头的名称保留给 Sun Microsystems 使用。
如果传入的对象为 null，则效果将与调用 #removeAttribute 相同。
警告，当通过 RequestDispatcher 从驻留在另一个 Web 应用程序中的 servlet 分发请求时，可能无法在调用者 servlet 中正确获取通过此方法设置的对象。

name | 指定属性名称的 String
o | 要存储的 Object
英文文档：

setAttribute

void setAttribute(String name,
                  Object o)
Stores an attribute in this request. Attributes are reset between requests. This method is most often used in conjunction with RequestDispatcher.

Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.
If the object passed in is null, the effect is the same as calling removeAttribute(java.lang.String).
It is warned that when the request is dispatched from the servlet resides in a different web application by RequestDispatcher, the object set by this method may not be correctly retrieved in the caller servlet.

Parameters:
name - a String specifying the name of the attribute
o - the Object to be stored

public void removeAttribute(String name)
从此请求中移除属性。此方法不是普遍需要的，因为属性只在处理请求期间保留。

属性名称应遵守与包名称相同的命名约定。以 java.*、javax.* 和 com.sun.* 开头的名称保留给 Sun Microsystems 使用。

name 指定要移除属性的名称的 String
英文文档：

removeAttribute

void removeAttribute(String name)
Removes an attribute from this request. This method is not generally needed as attributes only persist as long as the request is being handled.

Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.

Parameters:
name - a String specifying the name of the attribute to remove

public java.util.Locale getLocale()
基于 Accept-Language 头，返回客户端将用来接受内容的首选 Locale。如果客户端请求没有提供 Accept-Language 头，则此方法返回服务器的默认语言环境。
return 客户端的首选 Locale
英文文档：

getLocale

Locale getLocale()
Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server.

Returns:
the preferred Locale for the client

public java.util.Enumeration<E> getLocales()
返回 Locale 对象的 Enumeration，这些对象以首选语言环境开头，按递减顺序排列，指示基于 Accept-Language 头客户端可接受的语言环境。如果客户端请求没有提供 Accept-Language 头，则此方法返回包含一个 Locale 的 Enumeration，即服务器的默认语言环境。
return 客户端首选 Locale 对象的 Enumeration
英文文档：

getLocales

Enumeration getLocales()
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns an Enumeration containing one Locale, the default locale for the server.

Returns:
an Enumeration of preferred Locale objects for the client

public boolean isSecure()
返回一个 boolean 值，指示此请求是否是使用安全通道（比如 HTTPS）发出的。
return 指示请求是否是使用安全通道发出的 boolean 值
英文文档：

isSecure

boolean isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

Returns:
a boolean indicating if the request was made using a secure channel

public RequestDispatcher getRequestDispatcher(String path)
返回一个 RequestDispatcher 对象，它充当位于给定路径上的资源的包装器。可以使用 RequestDispatcher 对象将请求转发给资源，或者在响应中包含资源。资源可以是动态的，也可以是静态的。

指定的路径名可以是相对的，尽管它无法扩展到当前 servlet 上下文之外。如果该路径以 "/" 开头，那么可以相对于当前上下文根解释它。如果 servlet 容器无法返回 RequestDispatcher，则此方法将返回 null。

此方法与 ServletContext#getRequestDispatcher 的不同在于此方法可以采用相对路径。

path | 指定指向资源的路径名的 String。如果该路径名是相对的，那么它必须是相对于当前 servlet 的。
return | 充当位于给定路径上的资源的包装器的 RequestDispatcher 对象，如果 servlet 容器无法返回 RequestDispatcher，则返回 null
See also | javax.servlet.RequestDispatcher, getRequestDispatcher
英文文档：

getRequestDispatcher

RequestDispatcher getRequestDispatcher(String path)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.

The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returns null if the servlet container cannot return a RequestDispatcher.

The difference between this method and ServletContext.getRequestDispatcher(java.lang.String) is that this method can take a relative path.

Parameters:
path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet.
Returns:
a RequestDispatcher object that acts as a wrapper for the resource at the specified path, or null if the servlet container cannot return a RequestDispatcher
See Also:
RequestDispatcher, ServletContext.getRequestDispatcher(java.lang.String)

public String getRealPath(String path)
deprecated 从 Java Servlet API 的版本 2.1 起，请改用 ServletContext#getRealPath。
英文文档：

getRealPath

String getRealPath(String path)
Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String) instead.

public int getRemotePort()
返回发送请求的客户端或最后一个代理的 Internet Protocol (IP) 源端口。
return | 指定端口号的整数
since | 2.4
英文文档：

getRemotePort

int getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.

Returns:
an integer specifying the port number
Since:
2.4

public String getLocalName()
返回接收请求的 Internet Protocol (IP) 接口的主机名。
return | 包含接收请求的 IP 的主机名的 String。
since | 2.4
英文文档：

getLocalName

String getLocalName()
Returns the host name of the Internet Protocol (IP) interface on which the request was received.

Returns:
a String containing the host name of the IP on which the request was received.
Since:
2.4

public String getLocalAddr()
返回接收请求的接口的 Internet Protocol (IP) 地址。
return | 包含接收请求的 IP 地址的 String。
since | 2.4
英文文档：

getLocalAddr

String getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received.

Returns:
a String containing the IP address on which the request was received.
Since:
2.4

public int getLocalPort()
返回接收请求的接口的 Internet Protocol (IP) 端口号。
return | 指定端口号的整数
since | 2.4
英文文档：

getLocalPort

int getLocalPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.

Returns:
an integer specifying the port number
Since:
2.4
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestAttributeListener (Java EE 5)

javax.servlet
Interface ServletRequestAttributeListener

All Superinterfaces:
EventListener
public interface ServletRequestAttributeListener
extends EventListener

Implements: java.util.EventListener

ServletRequestAttributeListener 可由想要在请求属性更改时获得通知的开发人员实现。当请求位于注册了该侦听器的 Web 应用程序范围中时，将生成通知。当请求即将进入每个 Web 应用程序中的第一个 servlet 或过滤器时，该请求将被定义为进入范围，当它退出链中的最后一个 servlet 或第一个过滤器时，它将被定义为超出范围。
since
en
Servlet 2.4
英文文档：

A ServletRequestAttributeListener can be implemented by the developer interested in being notified of request attribute changes. Notifications will be generated while the request is within the scope of the web application in which the listener is registered. A request is defined as coming into scope when it is about to enter the first servlet or filter in each web application, as going out of scope when it exits the last servlet or the first filter in the chain.

Since:
Servlet 2.4

Method Summary
void | attributeAdded(ServletRequestAttributeEvent srae) Notification that a new attribute was added to the servlet request.
void | attributeRemoved(ServletRequestAttributeEvent srae) Notification that an existing attribute has been removed from the servlet request.
void | attributeReplaced(ServletRequestAttributeEvent srae) Notification that an attribute was replaced on the servlet request.

Method Detail

public void attributeAdded(ServletRequestAttributeEvent srae)
通知向 servlet 请求添加了一个新属性。在添加属性之后调用。
英文文档：

attributeAdded

void attributeAdded(ServletRequestAttributeEvent srae)
Notification that a new attribute was added to the servlet request. Called after the attribute is added.

public void attributeRemoved(ServletRequestAttributeEvent srae)
通知现有属性已从 servlet 请求中移除。在移除属性之后调用。
英文文档：

attributeRemoved

void attributeRemoved(ServletRequestAttributeEvent srae)
Notification that an existing attribute has been removed from the servlet request. Called after the attribute is removed.

public void attributeReplaced(ServletRequestAttributeEvent srae)
通知已替换 servlet 请求中的一个属性。在替换属性之后调用。
英文文档：

attributeReplaced

void attributeReplaced(ServletRequestAttributeEvent srae)
Notification that an attribute was replaced on the servlet request. Called after the attribute is replaced.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestListener (Java EE 5)

javax.servlet
Interface ServletRequestListener

All Superinterfaces:
EventListener
public interface ServletRequestListener
extends EventListener

Implements: java.util.EventListener

ServletRequestListener 可由想要在请求进入和超出 Web 组件范围时获得通知的开发人员实现。当请求即将进入每个 Web 应用程序中的第一个 servlet 或过滤器时，该请求将被定义为进入范围，当它退出链中的最后一个 servlet 或第一个过滤器时，它将被定义为超出范围。
since
en
Servlet 2.4
英文文档：

A ServletRequestListener can be implemented by the developer interested in being notified of requests coming in and out of scope in a web component. A request is defined as coming into scope when it is about to enter the first servlet or filter in each web application, as going out of scope when it exits the last servlet or the first filter in the chain.

Since:
Servlet 2.4

Method Summary
void | requestDestroyed(ServletRequestEvent sre) The request is about to go out of scope of the web application.
void | requestInitialized(ServletRequestEvent sre) The request is about to come into scope of the web application.

Method Detail

public void requestDestroyed(ServletRequestEvent sre)
请求即将超出该 Web 应用程序的范围。
英文文档：

requestDestroyed

void requestDestroyed(ServletRequestEvent sre)
The request is about to go out of scope of the web application.

public void requestInitialized(ServletRequestEvent sre)
请求即将进入该 Web 应用程序的范围。
英文文档：

requestInitialized

void requestInitialized(ServletRequestEvent sre)
The request is about to come into scope of the web application.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletResponse (Java EE 5)

javax.servlet
Interface ServletResponse

All Known Subinterfaces:
HttpServletResponse
All Known Implementing Classes:
HttpServletResponseWrapper, ServletResponseWrapper
public interface ServletResponse

Implemented by: HttpServletResponse, ServletResponseWrapper

定义辅助 servlet 将响应发送到客户端的对象。servlet 容器创建 ServletResponse 对象，并将它作为参数传递给 servlet 的 service 方法。

要发送 MIME 正文响应中的二进制数据，请使用 #getOutputStream 返回的 ServletOutputStream。要发送字符数据，请使用 #getWriter 返回的 PrintWriter 对象。要混合二进制数据和文本数据，例如要创建 multipart 响应，请使用 ServletOutputStream 并手动管理字符部分。

可使用 #setCharacterEncoding 和 #setContentType 显式指定 MIME 正文响应的 charset，或使用 #setLocale 方法隐式指定它。显式指定优先于隐式指定。如果未指定 charset，则将使用 ISO-8859-1。setCharacterEncoding、setContentType 或 setLocale 方法必须在调用 getWriter 之前，并且必须在提交采用要使用的字符编码的响应之前调用。

有关 MIME 的更多信息，请参见 Internet RFC，比如 RFC 2045。诸如 SMTP 和 HTTP 之类的协议定义了 MIME 的配置文件，并且那些标准仍在不断发展。

See also javax.servlet.ServletOutputStream
英文文档：

Defines an object to assist a servlet in sending a response to the client. The servlet container creates a ServletResponse object and passes it as an argument to the servlet's service method.

To send binary data in a MIME body response, use the ServletOutputStream returned by getOutputStream(). To send character data, use the PrintWriter object returned by getWriter(). To mix binary and text data, for example, to create a multipart response, use a ServletOutputStream and manage the character sections manually.

The charset for the MIME body response can be specified explicitly using the setCharacterEncoding(java.lang.String) and setContentType(java.lang.String) methods, or implicitly using the setLocale(java.util.Locale) method. Explicit specifications take precedence over implicit specifications. If no charset is specified, ISO-8859-1 will be used. The setCharacterEncoding, setContentType, or setLocale method must be called before getWriter and before committing the response for the character encoding to be used.

See the Internet RFCs such as RFC 2045 for more information on MIME. Protocols such as SMTP and HTTP define profiles of MIME, and those standards are still evolving.

Author:
Various
See Also:
ServletOutputStream

Method Summary
 void flushBuffer()
Forces any content in the buffer to be written to the client.
 int getBufferSize()
Returns the actual buffer size used for the response.
 String getCharacterEncoding()
Returns the name of the character encoding (MIME charset) used for the body sent in this response.
 String getContentType()
Returns the content type used for the MIME body sent in this response.
 Locale getLocale()
Returns the locale specified for this response using the setLocale(java.util.Locale) method.
 ServletOutputStream getOutputStream()
Returns a ServletOutputStream suitable for writing binary data in the response.
 PrintWriter getWriter()
Returns a PrintWriter object that can send character text to the client.
 boolean isCommitted()
Returns a boolean indicating if the response has been committed.
 void reset()
Clears any data that exists in the buffer as well as the status code and headers.
 void resetBuffer()
Clears the content of the underlying buffer in the response without clearing headers or status code.
 void setBufferSize(int size)
Sets the preferred buffer size for the body of the response.
 void setCharacterEncoding(String charset)
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.
 void setContentLength(int len)
Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header.
 void setContentType(String type)
Sets the content type of the response being sent to the client, if the response has not been committed yet.
 void setLocale(Locale loc)
Sets the locale of the response, if the response has not been committed yet.

Method Detail

public String getCharacterEncoding()
返回用于此响应中发送的正文的字符编码 (MIME charset) 名称。可能已使用 #setCharacterEncoding 或 #setContentType 方法显式指定字符编码，或使用 #setLocale 方法隐式指定它。显式指定优先于隐式指定。在已调用 getWriter 之后或者在已提交响应之后调用这些方法不会对字符编码产生任何影响。如果未指定字符编码，则返回 ISO-8859-1。

有关字符编码和 MIME 的更多信息，请参见 RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)。

return 指定字符编码名称的 String，例如 UTF-8
英文文档：

getCharacterEncoding

String getCharacterEncoding()
Returns the name of the character encoding (MIME charset) used for the body sent in this response. The character encoding may have been specified explicitly using the setCharacterEncoding(java.lang.String) or setContentType(java.lang.String) methods, or implicitly using the setLocale(java.util.Locale) method. Explicit specifications take precedence over implicit specifications. Calls made to these methods after getWriter has been called or after the response has been committed have no effect on the character encoding. If no character encoding has been specified, ISO-8859-1 is returned.

See RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt) for more information about character encoding and MIME.

Returns:
a String specifying the name of the character encoding, for example, UTF-8

public String getContentType()
返回用于此响应中发送的 MIME 正文的内容类型。必须在提交响应之前已使用 #setContentType 指定适当的内容类型。如果未指定内容类型，则此方法返回 null。如果已指定内容类型，并且已经如 #getCharacterEncoding 中所述显式或隐式指定了字符编码或者已调用 #getWriter，则返回的字符串中将包含 charset 参数。如果未指定字符编码，则省略 charset 参数。
return | 指定内容类型的 String，例如 text/html; charset=UTF-8，或者返回 null
since | 2.4
英文文档：

getContentType

String getContentType()
Returns the content type used for the MIME body sent in this response. The content type proper must have been specified using setContentType(java.lang.String) before the response is committed. If no content type has been specified, this method returns null. If a content type has been specified, and a character encoding has been explicitly or implicitly specified as described in getCharacterEncoding() or getWriter() has been called, the charset parameter is included in the string returned. If no character encoding has been specified, the charset parameter is omitted.

Returns:
a String specifying the content type, for example, text/html; charset=UTF-8, or null
Since:
2.4

public ServletOutputStream getOutputStream() throws java.io.IOException
返回适用于在响应中编写二进制数据的 ServletOutputStream。servlet 容器不会编码二进制数据。

对 ServletOutputStream 调用 flush() 将提交响应。 可调用此方法或 #getWriter 编写正文，而不是两种方法都调用。

return | 用于编写二进制数据的 ServletOutputStream
Throws | IllegalStateException: 如果已对此响应调用 getWriter 方法
Throws | java.io.IOException: 如果发生输入或输出异常
See also | getWriter
英文文档：

getOutputStream

ServletOutputStream getOutputStream()
                                    throws IOException
Returns a ServletOutputStream suitable for writing binary data in the response. The servlet container does not encode the binary data.

Calling flush() on the ServletOutputStream commits the response. Either this method or getWriter() may be called to write the body, not both.

Returns:
a ServletOutputStream for writing binary data
Throws:
IllegalStateException - if the getWriter method has been called on this response
IOException - if an input or output exception occurred
See Also:
getWriter()

public java.io.PrintWriter getWriter() throws java.io.IOException
返回可将字符文本发送到客户端的 PrintWriter 对象。PrintWriter 使用 #getCharacterEncoding 返回的字符编码。如果未如 getCharacterEncoding 中所述指定响应的字符编码（即该方法只返回默认值 ISO-8859-1），则 getWriter 会将字符编码更新到 ISO-8859-1。

对 PrintWriter 调用 flush() 将提交响应。

可调用此方法或 #getOutputStream 编写正文，而不是两种方法都调用。

return | 可将字符数据返回到客户端的 PrintWriter 对象。
Throws | UnsupportedEncodingException: 如果无法使用 getCharacterEncoding 返回的字符编码
Throws | IllegalStateException: 如果已对此响应对象调用 getOutputStream 方法
Throws | java.io.IOException: 如果发生输入或输出异常
See also | getOutputStream, setCharacterEncoding
英文文档：

getWriter

PrintWriter getWriter()
                      throws IOException
Returns a PrintWriter object that can send character text to the client. The PrintWriter uses the character encoding returned by getCharacterEncoding(). If the response's character encoding has not been specified as described in getCharacterEncoding (i.e., the method just returns the default value ISO-8859-1), getWriter updates it to ISO-8859-1.

Calling flush() on the PrintWriter commits the response.

Either this method or getOutputStream() may be called to write the body, not both.

Returns:
a PrintWriter object that can return character data to the client
Throws:
UnsupportedEncodingException - if the character encoding returned by getCharacterEncoding cannot be used
IllegalStateException - if the getOutputStream method has already been called for this response object
IOException - if an input or output exception occurred
See Also:
getOutputStream(), setCharacterEncoding(java.lang.String)

public void setCharacterEncoding(String charset)
设置将发送到客户端的响应的字符编码 (MIME charset)，例如，将它设置为 UTF-8。如果已通过 #setContentType 或 #setLocale 设置了字符编码，则此方法将重写该字符编码。用 text/html 的 String 调用 #setContentType 并用 UTF-8 的 String 调用此方法等效于用 text/html; charset=UTF-8 的 String 调用 setContentType。

可重复调用此方法来更改字符编码。如果在已调用 getWriter 之后或者在已提交响应之后调用此方法，则此方法没有任何效果。

容器必须让客户端了解将用于 servlet 响应的 writer 的字符编码，如果协议提供了实现上述操作的方法。在使用 HTTP 的情况下，字符编码是作为文本媒体类型的 Content-Type 头的一部分传送的。注意，如果 servlet 未指定内容类型，则字符编码不能通过 HTTP 头传送；但是，它仍然用于编码通过 servlet 响应的 writer 编写的文本。

charset | 仅指定 IANA Character Set (http://www.iana.org/assignments/character-sets) 定义的字符集的 String
since | 2.4
See also | #setLocale
英文文档：

setCharacterEncoding

void setCharacterEncoding(String charset)
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. If the character encoding has already been set by setContentType(java.lang.String) or setLocale(java.util.Locale), this method overrides it. Calling setContentType(java.lang.String) with the String of text/html and calling this method with the String of UTF-8 is equivalent with calling setContentType with the String of text/html; charset=UTF-8.

This method can be called repeatedly to change the character encoding. This method has no effect if it is called after getWriter has been called or after the response has been committed.

Containers must communicate the character encoding used for the servlet response's writer to the client if the protocol provides a way for doing so. In the case of HTTP, the character encoding is communicated as part of the Content-Type header for text media types. Note that the character encoding cannot be communicated via HTTP headers if the servlet does not specify a content type; however, it is still used to encode text written via the servlet response's writer.

Parameters:
charset - a String specifying only the character set defined by IANA Character Sets (http://www.iana.org/assignments/character-sets)
Since:
2.4
See Also:
#setLocale

public void setContentLength(int len)
设置 HTTP servlet 中响应的内容正文的长度，此方法设置 HTTP Content-Length 头。
len 指定将返回到客户端的内容长度的整数；设置 Content-Length 头
英文文档：

setContentLength

void setContentLength(int len)
Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header.

Parameters:
len - an integer specifying the length of the content being returned to the client; sets the Content-Length header

public void setContentType(String type)
设置将发送到客户端的响应的内容类型，如果该响应尚未提交。给定内容类型可能包含字符编码规范，例如 text/html;charset=UTF-8。如果在调用 getWriter 之前调用此方法，则只根据给定内容类型设置响应的字符编码。

可重复调用此方法来更改内容类型和字符编码。如果在已提交响应之后调用此方法，则此方法没有任何效果。如果在已调用 getWriter 之后或者在已提交响应之后调用此方法，则该方法不会设置响应的字符编码。

容器必须让客户端了解用于 servlet 响应的 writer 的内容类型和字符编码，如果协议提供了实现上述操作的方法。在使用 HTTP 的情况下，使用 Content-Type 头。

type | 指定内容的 MIME 类型的 String
See also | setLocale, setCharacterEncoding, getOutputStream, getWriter
英文文档：

setContentType

void setContentType(String type)
Sets the content type of the response being sent to the client, if the response has not been committed yet. The given content type may include a character encoding specification, for example, text/html;charset=UTF-8. The response's character encoding is only set from the given content type if this method is called before getWriter is called.

This method may be called repeatedly to change content type and character encoding. This method has no effect if called after the response has been committed. It does not set the response's character encoding if it is called after getWriter has been called or after the response has been committed.

Containers must communicate the content type and the character encoding used for the servlet response's writer to the client if the protocol provides a way for doing so. In the case of HTTP, the Content-Type header is used.

Parameters:
type - a String specifying the MIME type of the content
See Also:
setLocale(java.util.Locale),
setCharacterEncoding(java.lang.String),
getOutputStream(),
getWriter()

public void setBufferSize(int size)
设置响应正文的首选缓冲区大小。servlet 容器将使用至少与所请求大小一样大的缓冲区。可使用 getBufferSize 获得使用的实际缓冲区大小。

较大的缓冲区允许在实际发送任何东西之前编写更多的内容，这为 servlet 提供了更多时间来设置适当的状态代码和头。较小的缓冲区会减少服务器内存负载，并允许客户端更快地开始接收数据。

必须在编写任何响应正文内容之前调用此方法；如果已经编写了内容或者已经提交了响应对象，则此方法将抛出 IllegalStateException。

size | 首选缓冲区大小
Throws | IllegalStateException: 如果在已编写内容后调用此方法
See also | getBufferSize, flushBuffer, isCommitted, reset
英文文档：

setBufferSize

void setBufferSize(int size)
Sets the preferred buffer size for the body of the response. The servlet container will use a buffer at least as large as the size requested. The actual buffer size used can be found using getBufferSize.

A larger buffer allows more content to be written before anything is actually sent, thus providing the servlet with more time to set appropriate status codes and headers. A smaller buffer decreases server memory load and allows the client to start receiving data more quickly.

This method must be called before any response body content is written; if content has been written or the response object has been committed, this method throws an IllegalStateException.

Parameters:
size - the preferred buffer size
Throws:
IllegalStateException - if this method is called after content has been written
See Also:
getBufferSize(),
flushBuffer(),
isCommitted(),
reset()

public int getBufferSize()
返回用于该响应的实际缓冲区大小。如果未使用任何缓冲，则此方法返回 0。
return | 使用的实际缓冲区大小
See also | setBufferSize, flushBuffer, isCommitted, reset
英文文档：

getBufferSize

int getBufferSize()
Returns the actual buffer size used for the response. If no buffering is used, this method returns 0.

Returns:
the actual buffer size used
See Also:
setBufferSize(int),
flushBuffer(),
isCommitted(),
reset()

public void flushBuffer() throws java.io.IOException
强行将缓冲区中的所有内容写入客户端。调用此方法会自动提交响应，这意味着将编写状态代码和头。
See also setBufferSize, getBufferSize, isCommitted, reset
英文文档：

flushBuffer

void flushBuffer()
                 throws IOException
Forces any content in the buffer to be written to the client. A call to this method automatically commits the response, meaning the status code and headers will be written.

Throws:
IOException
See Also:
setBufferSize(int),
getBufferSize(),
isCommitted(),
reset()

public void resetBuffer()
清除响应中底层缓冲区的内容，而不清除头或状态代码。如果已提交响应，则此方法将抛出 IllegalStateException。
since | 2.3
See also | setBufferSize, getBufferSize, isCommitted, reset
英文文档：

resetBuffer

void resetBuffer()
Clears the content of the underlying buffer in the response without clearing headers or status code. If the response has been committed, this method throws an IllegalStateException.

Since:
2.3
See Also:
setBufferSize(int),
getBufferSize(),
isCommitted(),
reset()

public boolean isCommitted()
返回指示响应是否已提交的 boolean 值。已提交的响应已将其状态代码和头编写好。
return | 指示响应是否已提交的 boolean 值
See also | setBufferSize, getBufferSize, flushBuffer, reset
英文文档：

isCommitted

boolean isCommitted()
Returns a boolean indicating if the response has been committed. A committed response has already had its status code and headers written.

Returns:
a boolean indicating if the response has been committed
See Also:
setBufferSize(int),
getBufferSize(),
flushBuffer(),
reset()

public void reset()
清除缓冲区中存在的所有数据以及状态代码和头。如果已提交响应，则此方法将抛出 IllegalStateException。
Throws | IllegalStateException: 如果已提交响应
See also | setBufferSize, getBufferSize, flushBuffer, isCommitted
英文文档：

reset

void reset()
Clears any data that exists in the buffer as well as the status code and headers. If the response has been committed, this method throws an IllegalStateException.

Throws:
IllegalStateException - if the response has already been committed
See Also:
setBufferSize(int),
getBufferSize(),
flushBuffer(),
isCommitted()

public void setLocale(java.util.Locale loc)
设置响应的语言环境，如果该响应尚未提交。如果尚未使用 #setContentType 或 #setCharacterEncoding 显式设置字符编码、尚未调用 getWriter，并且响应尚未提交，则此方法还将设置适合该语言环境的响应的字符编码。如果部署描述符包含 locale-encoding-mapping-list 元素，并且该元素提供了给定语言环境的映射，则使用该映射。否则，从语言环境到字符编码的映射是与容器相关的。

可重复调用此方法来更改语言环境和字符编码。如果在已提交响应之后调用该方法，则此方法没有任何效果。如果在已使用 charset 规范调用 #setContentType 之后、在已调用 #setCharacterEncoding 之后、在已调用 getWriter 之后，或者在已提交响应之后调用此方法，则此方法不会设置响应的字符编码。

容器必须让客户端了解用于 servlet 响应的 writer 的语言环境和字符编码，如果协议提供了实现上述操作的方法。在使用 HTTP 的情况下，语言环境是通过 Content-Language 头传送的，字符编码是作为文本媒体类型的 Content-Type 头的一部分传送的。注意，如果 servlet 未指定内容类型，则字符编码不能通过 HTTP 头传送；但是，它仍然用于编码通过 servlet 响应的 writer 编写的文本。

loc | 响应的语言环境
See also | getLocale, setContentType, setCharacterEncoding
英文文档：

setLocale

void setLocale(Locale loc)
Sets the locale of the response, if the response has not been committed yet. It also sets the response's character encoding appropriately for the locale, if the character encoding has not been explicitly set using setContentType(java.lang.String) or setCharacterEncoding(java.lang.String), getWriter hasn't been called yet, and the response hasn't been committed yet. If the deployment descriptor contains a locale-encoding-mapping-list element, and that element provides a mapping for the given locale, that mapping is used. Otherwise, the mapping from locale to character encoding is container dependent.

This method may be called repeatedly to change locale and character encoding. The method has no effect if called after the response has been committed. It does not set the response's character encoding if it is called after setContentType(java.lang.String) has been called with a charset specification, after setCharacterEncoding(java.lang.String) has been called, after getWriter has been called, or after the response has been committed.

Containers must communicate the locale and the character encoding used for the servlet response's writer to the client if the protocol provides a way for doing so. In the case of HTTP, the locale is communicated via the Content-Language header, the character encoding as part of the Content-Type header for text media types. Note that the character encoding cannot be communicated via HTTP headers if the servlet does not specify a content type; however, it is still used to encode text written via the servlet response's writer.

Parameters:
loc - the locale of the response
See Also:
getLocale(),
setContentType(java.lang.String),
setCharacterEncoding(java.lang.String)

public java.util.Locale getLocale()
返回使用 #setLocale 方法指定的此响应的语言环境。在已提交响应后调用 setLocale 没有任何效果。如果未指定任何语言环境，则返回容器的默认语言环境。
See also setLocale
英文文档：

getLocale

Locale getLocale()
Returns the locale specified for this response using the setLocale(java.util.Locale) method. Calls made to setLocale after the response is committed have no effect. If no locale has been specified, the container's default locale is returned.

See Also:
setLocale(java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SingleThreadModel (Java EE 5)

javax.servlet
Interface SingleThreadModel

Deprecated. As of Java Servlet API 2.4, with no direct replacement.

确保 servlet 一次只处理一个请求。此接口没有方法。

如果某个 servlet 实现了此接口，则会保证 该 servlet 的 service 方法中不会有两个线程同时执行。servlet 容器通过同步对 servlet 的单个实例的访问，或者通过维护 servlet 实例池并将每个新请求分发到空闲 servlet 实现此保证。

注意，SingleThreadModel 并没有解决所有线程安全问题。例如，多个线程上的多个请求仍然可以同时访问会话属性和静态变量，即使在使用 SingleThreadModel servlet 时也是如此。建议开发人员采用实现此接口以外的其他方法解决这些问题，比如避免使用实例变量，或同步访问这些资源的代码块。此接口从 Servlet API 版本 2.4 起已经过时。

deprecated
en
As of Java Servlet API 2.4, with no direct replacement.
英文文档：

public interface SingleThreadModel

Ensures that servlets handle only one request at a time. This interface has no methods.

If a servlet implements this interface, you are guaranteed that no two threads will execute concurrently in the servlet's service method. The servlet container can make this guarantee by synchronizing access to a single instance of the servlet, or by maintaining a pool of servlet instances and dispatching each new request to a free servlet.

Note that SingleThreadModel does not solve all thread safety issues. For example, session attributes and static variables can still be accessed by multiple requests on multiple threads at the same time, even when SingleThreadModel servlets are used. It is recommended that a developer take other means to resolve those issues instead of implementing this interface, such as avoiding the usage of an instance variable or synchronizing the block of the code accessing those resources. This interface is deprecated in Servlet API version 2.4.

Author:
Various

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


GenericServlet (Java EE 5)

javax.servlet
Class GenericServlet

java.lang.Object
    extended by  javax.servlet.GenericServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
HttpServlet
public abstract class GenericServlet
extends Object
implements Servlet, ServletConfig, Serializable

Implements: Servlet, ServletConfig, java.io.Serializable
Extended by: HttpServlet

定义一般的、与协议无关的 servlet。要编写用于 Web 上的 HTTP servlet，请改为扩展 javax.servlet.http.HttpServlet。

GenericServlet 实现 Servlet 和 ServletConfig 接口。servlet 可以直接扩展 GenericServlet，尽管扩展特定于协议的子类（比如 HttpServlet）更为常见。

GenericServlet 使编写 servlet 变得更容易。它提供生命周期方法 init 和 destroy 的简单版本，以及 ServletConfig 接口中的方法的简单版本。GenericServlet 还实现 log 方法，在 ServletContext 接口中对此进行了声明。

要编写一般的 servlet，只需重写抽象 service 方法即可。

英文文档：

Defines a generic, protocol-independent servlet. To write an HTTP servlet for use on the Web, extend HttpServlet instead.

GenericServlet implements the Servlet and ServletConfig interfaces. GenericServlet may be directly extended by a servlet, although it's more common to extend a protocol-specific subclass such as HttpServlet.

GenericServlet makes writing servlets easier. It provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface. GenericServlet also implements the log method, declared in the ServletContext interface.

To write a generic servlet, you need only override the abstract service method.

Author:
Various
See Also:
Serialized Form

Constructor Summary
GenericServlet()
Does nothing.
Method Summary
 void destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
 String getInitParameter(String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
 Enumeration getInitParameterNames()
Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters.
 ServletConfig getServletConfig()
Returns this servlet's ServletConfig object.
 ServletContext getServletContext()
Returns a reference to the ServletContext in which this servlet is running.
 String getServletInfo()
Returns information about the servlet, such as author, version, and copyright.
 String getServletName()
Returns the name of this servlet instance.
 void init()
A convenience method which can be overridden so that there's no need to call super.init(config).
 void init(ServletConfig config)
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
 void log(String msg)
Writes the specified message to a servlet log file, prepended by the servlet's name.
 void log(String message, Throwable t)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file, prepended by the servlet's name.
abstract  void service(ServletRequest req, ServletResponse res)
Called by the servlet container to allow the servlet to respond to a request.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public GenericServlet()
不执行任何操作。所有 servlet 初始化都由 init 方法中的一个方法来完成。
英文文档：

GenericServlet

public GenericServlet()
Does nothing. All of the servlet initialization is done by one of the init methods.

Method Detail

public void destroy()
由 servlet 容器调用，指示将从服务中取出的 servlet。请参见 Servlet#destroy。
英文文档：

destroy

public void destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. See Servlet.destroy().

Specified by:
destroy in interface Servlet

public String getInitParameter(String name)
返回包含指定初始化参数的值的 String，如果参数不存在，则返回 null。请参见 ServletConfig#getInitParameter。

提供此方法是为了方便使用。该方法从 servlet 的 ServletConfig 对象获取指定参数的值。

name | 指定初始化参数名称的 String
return | String 包含初始化参数值的 String
英文文档：

getInitParameter

public String getInitParameter(String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist. See ServletConfig.getInitParameter(java.lang.String).

This method is supplied for convenience. It gets the value of the named parameter from the servlet's ServletConfig object.

Specified by:
getInitParameter in interface ServletConfig
Parameters:
name - a String specifying the name of the initialization parameter
Returns:
String a String containing the value of the initialization parameter

public java.util.Enumeration<E> getInitParameterNames()
以 String 对象的 Enumeration 的形式返回 servlet 的初始化参数的名称，如果 servlet 没有初始化参数，则返回一个空的 Enumeration。请参见 ServletConfig#getInitParameterNames。

提供此方法是为了方便使用。该方法从 servlet 的 ServletConfig 对象获取参数名称。

return Enumeration 包含 servlet 初始化参数名称的 String 对象的枚举
英文文档：

getInitParameterNames

public Enumeration getInitParameterNames()
Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters. See ServletConfig.getInitParameterNames().

This method is supplied for convenience. It gets the parameter names from the servlet's ServletConfig object.

Specified by:
getInitParameterNames in interface ServletConfig
Returns:
Enumeration an enumeration of String objects containing the names of the servlet's initialization parameters

public ServletConfig getServletConfig()
返回此 servlet 的 ServletConfig 对象。
return ServletConfig 初始化此 servlet 的 ServletConfig 对象
英文文档：

getServletConfig

public ServletConfig getServletConfig()
Returns this servlet's ServletConfig object.

Specified by:
getServletConfig in interface Servlet
Returns:
ServletConfig the ServletConfig object that initialized this servlet
See Also:
Servlet.init(javax.servlet.ServletConfig)

public ServletContext getServletContext()
返回对此 servlet 在其中运行的 ServletContext 的引用。请参见 ServletConfig#getServletContext。

提供此方法是为了方便使用。该方法从 servlet 的 ServletConfig 对象获取上下文。

return ServletContext 通过 init 方法传递给此 servlet 的 ServletContext 对象
英文文档：

getServletContext

public ServletContext getServletContext()
Returns a reference to the ServletContext in which this servlet is running. See ServletConfig.getServletContext().

This method is supplied for convenience. It gets the context from the servlet's ServletConfig object.

Specified by:
getServletContext in interface ServletConfig
Returns:
ServletContext the ServletContext object passed to this servlet by the init method
See Also:
ServletContext

public String getServletInfo()
返回有关 servlet 的信息，比如作者、版本和版权。默认情况下，此方法返回一个空字符串。重写此方法使其返回有意义的值。请参见 Servlet#getServletInfo。
return String 有关此 servlet 的信息，默认情况下是一个空字符串
英文文档：

getServletInfo

public String getServletInfo()
Returns information about the servlet, such as author, version, and copyright. By default, this method returns an empty string. Override this method to have it return a meaningful value. See Servlet.getServletInfo().

Specified by:
getServletInfo in interface Servlet
Returns:
String information about this servlet, by default an empty string

public void init(ServletConfig config) throws ServletException
由 servlet 容器调用，指示将放入服务中的 servlet。请参见 Servlet#init。

此实现存储它从 servlet 容器中获得的 ServletConfig 对象，以便将来使用。在重写方法的这种形式时，调用 super.init(config)。

config | 包含此 servlet 的配置信息的 ServletConfig 对象
Throws | ServletException: 如果发生中断 servlet 正常操作的异常
See also | javax.servlet.UnavailableException
英文文档：

init

public void init(ServletConfig config)
          throws ServletException
Called by the servlet container to indicate to a servlet that the servlet is being placed into service. See Servlet.init(javax.servlet.ServletConfig).

This implementation stores the ServletConfig object it receives from the servlet container for later use. When overriding this form of the method, call super.init(config).

Specified by:
init in interface Servlet
Parameters:
config - the ServletConfig object that contains configutation information for this servlet
Throws:
ServletException - if an exception occurs that interrupts the servlet's normal operation
See Also:
UnavailableException

public void init() throws ServletException
可重写的便捷方法，这样就不必调用 super.init(config)。

不用重写 #init(ServletConfig)，只需重写此方法即可，它由 GenericServlet.init(ServletConfig config) 调用。仍然可以通过 #getServletConfig 获取 ServletConfig 对象。

Throws ServletException: 如果发生中断 servlet 正常操作的异常
英文文档：

init

public void init()
          throws ServletException
A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding init(ServletConfig), simply override this method and it will be called by GenericServlet.init(ServletConfig config). The ServletConfig object can still be retrieved via getServletConfig().

Throws:
ServletException - if an exception occurs that interrupts the servlet's normal operation

public void log(String msg)
将前置有 servlet 名称的指定消息写入 servlet 日志文件。请参见 log(String)。
msg 指定要写入日志文件的消息的 String
英文文档：

log

public void log(String msg)
Writes the specified message to a servlet log file, prepended by the servlet's name. See ServletContext.log(String).

Parameters:
msg - a String specifying the message to be written to the log file

public void log(String message, Throwable t)
将前置有 servlet 名称的给定 Throwable 异常的解释性消息和堆栈跟踪写入 servlet 日志文件。请参见 log(String, Throwable)。
message | 描述错误或异常的 String
t | java.lang.Throwable 错误或异常
英文文档：

log

public void log(String message,
                Throwable t)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file, prepended by the servlet's name. See ServletContext.log(String, Throwable).

Parameters:
message - a String that describes the error or exception
t - the java.lang.Throwable error or exception

abstract public void service(ServletRequest req, ServletResponse res) throws ServletException, java.io.IOException
由 servlet 容器调用，以允许 servlet 响应某个请求。请参见 Servlet#service。

此方法已声明为抽象方法，因此子类（比如 HttpServlet）必须重写它。

req | 包含客户端请求的 ServletRequest 对象
res | 将包含 servlet 的响应的 ServletResponse 对象
Throws | ServletException: 如果发生妨碍 servlet 正常操作的异常
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

service

public abstract void service(ServletRequest req,
                             ServletResponse res)
                      throws ServletException,
                             IOException
Called by the servlet container to allow the servlet to respond to a request. See Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse).

This method is declared abstract so subclasses, such as HttpServlet, must override it.

Specified by:
service in interface Servlet
Parameters:
req - the ServletRequest object that contains the client's request
res - the ServletResponse object that will contain the servlet's response
Throws:
ServletException - if an exception occurs that interferes with the servlet's normal operation occurred
IOException - if an input or output exception occurs

public String getServletName()
返回此 servlet 实例的名称。请参见 ServletConfig#getServletName。
return 此 servlet 实例的名称
英文文档：

getServletName

public String getServletName()
Returns the name of this servlet instance. See ServletConfig.getServletName().

Specified by:
getServletName in interface ServletConfig
Returns:
the name of this servlet instance
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextAttributeEvent (Java EE 5)

javax.servlet
Class ServletContextAttributeEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.servlet.ServletContextEvent
            extended by  javax.servlet.ServletContextAttributeEvent
All Implemented Interfaces:
Serializable
public class ServletContextAttributeEvent
extends ServletContextEvent

Extends: java.util.EventObject > ServletContextEvent

这是一个事件类，用于通知有关 Web 应用程序的 servlet 上下文属性更改的信息。
since
en
v 2.3
See also javax.servlet.ServletContextAttributeListener
英文文档：

This is the event class for notifications about changes to the attributes of the servlet context of a web application.

Since:
v 2.3
See Also:
ServletContextAttributeListener, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ServletContextAttributeEvent(ServletContext source, String name, Object value)
Construct a ServletContextAttributeEvent from the given context for the given attribute name and attribute value.
Method Summary
String | getName() Return the name of the attribute that changed on the ServletContext.
Object | getValue() Returns the value of the attribute that has been added, removed, or replaced.
Methods inherited from class javax.servlet.ServletContextEvent
getServletContext
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ServletContextAttributeEvent(ServletContext source, String name, Object value)
为给定属性名称和属性值构造来自给定上下文的 ServletContextAttributeEvent。
英文文档：

ServletContextAttributeEvent

public ServletContextAttributeEvent(ServletContext source,
                                    String name,
                                    Object value)
Construct a ServletContextAttributeEvent from the given context for the given attribute name and attribute value.

Method Detail

public String getName()
返回 ServletContext 中更改的属性的名称。
英文文档：

getName

public String getName()
Return the name of the attribute that changed on the ServletContext.

public Object getValue()
返回已添加、移除或替换的属性的值。如果添加了属性，则这是属性的值。如果移除了属性，则这是被移除属性的值。如果替换了属性，则这是属性原来的值。
英文文档：

getValue

public Object getValue()
Returns the value of the attribute that has been added, removed, or replaced. If the attribute was added, this is the value of the attribute. If the attribute was removed, this is the value of the removed attribute. If the attribute was replaced, this is the old value of the attribute.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletContextEvent (Java EE 5)

javax.servlet
Class ServletContextEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.servlet.ServletContextEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ServletContextAttributeEvent
public class ServletContextEvent
extends EventObject

Extends: java.util.EventObject
Extended by: ServletContextAttributeEvent

这是一个事件类，用于通知有关 Web 应用程序的 servlet 上下文更改的信息。
since
en
v 2.3
See also javax.servlet.ServletContextListener
英文文档：

This is the event class for notifications about changes to the servlet context of a web application.

Since:
v 2.3
See Also:
ServletContextListener, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ServletContextEvent(ServletContext source)
Construct a ServletContextEvent from the given context.
Method Summary
 ServletContext getServletContext()
Return the ServletContext that changed.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ServletContextEvent(ServletContext source)
构造来自给定上下文的 ServletContextEvent。
source - 发送该事件的 ServletContext。
英文文档：

ServletContextEvent

public ServletContextEvent(ServletContext source)
Construct a ServletContextEvent from the given context.

Parameters:
source - - the ServletContext that is sending the event.
Method Detail

public ServletContext getServletContext()
返回更改的 ServletContext。
return 发送该事件的 ServletContext。
英文文档：

getServletContext

public ServletContext getServletContext()
Return the ServletContext that changed.

Returns:
the ServletContext that sent the event.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletInputStream (Java EE 5)

javax.servlet
Class ServletInputStream

java.lang.Object
    extended by  java.io.InputStream
        extended by  javax.servlet.ServletInputStream
All Implemented Interfaces:
Closeable
public abstract class ServletInputStream
extends InputStream

Extends: java.io.InputStream

提供用于读取客户端请求中的二进制数据的输入流，包括一个高效的 readLine 方法用于一次读取一行数据。使用一些协议（比如 HTTP POST 和 PUT），ServletInputStream 对象可用于读取从客户端发送的数据。

ServletInputStream 对象通常是通过 ServletRequest#getInputStream 方法获取的。

这是 servlet 容器实现的一个抽象类。此类的子类必须实现 java.io.InputStream.read() 方法。

See also javax.servlet.ServletRequest
英文文档：

Provides an input stream for reading binary data from a client request, including an efficient readLine method for reading data one line at a time. With some protocols, such as HTTP POST and PUT, a ServletInputStream object can be used to read data sent from the client.

A ServletInputStream object is normally retrieved via the ServletRequest.getInputStream() method.

This is an abstract class that a servlet container implements. Subclasses of this class must implement the java.io.InputStream.read() method.

Author:
Various
See Also:
ServletRequest

Constructor Summary
protected ServletInputStream()
Does nothing, because this is an abstract class.
Method Summary
 int readLine(byte[] b, int off, int len)
Reads the input stream, one line at a time.
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, read, reset, skip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected ServletInputStream()
不执行任何操作，因为这是一个抽象类。
英文文档：

ServletInputStream

protected ServletInputStream()
Does nothing, because this is an abstract class.

Method Detail

public int readLine(byte[] b, int off, int len) throws java.io.IOException
以一次一行的形式读取输入流。从某个偏移量开始将字节读入数组，直到读取特定数量的字节，或者到达换行符为止，该字符也将读入数组。

如果在读取到最大字节数之前到达输入流末尾，则此方法返回 -1。

b | 将数据读入其中的 byte 数组
off | 指定此方法开始读取的字符的整数
len | 指定要读取的最大字节数的整数
return | 指定读取的实际字节数的整数，如果到达流末尾，则返回 -1
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

readLine

public int readLine(byte[] b,
                    int off,
                    int len)
             throws IOException
Reads the input stream, one line at a time. Starting at an offset, reads bytes into an array, until it reads a certain number of bytes or reaches a newline character, which it reads into the array as well.

This method returns -1 if it reaches the end of the input stream before reading the maximum number of bytes.

Parameters:
b - an array of bytes into which data is read
off - an integer specifying the character at which this method begins reading
len - an integer specifying the maximum number of bytes to read
Returns:
an integer specifying the actual number of bytes read, or -1 if the end of the stream is reached
Throws:
IOException - if an input or output exception has occurred
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletOutputStream (Java EE 5)

javax.servlet
Class ServletOutputStream

java.lang.Object
    extended by  java.io.OutputStream
        extended by  javax.servlet.ServletOutputStream
All Implemented Interfaces:
Closeable, Flushable
public abstract class ServletOutputStream
extends OutputStream

Extends: java.io.OutputStream

提供用于将二进制数据发送到客户端的输出流。ServletOutputStream 对象通常是通过 ServletResponse#getOutputStream 方法获取的。

这是 servlet 容器实现的一个抽象类。此类的子类必须实现 java.io.OutputStream.write(int) 方法。

See also javax.servlet.ServletResponse
英文文档：

Provides an output stream for sending binary data to the client. A ServletOutputStream object is normally retrieved via the ServletResponse.getOutputStream() method.

This is an abstract class that the servlet container implements. Subclasses of this class must implement the java.io.OutputStream.write(int) method.

Author:
Various
See Also:
ServletResponse

Constructor Summary
protected ServletOutputStream()
Does nothing, because this is an abstract class.
Method Summary
void | print(boolean b) Writes a boolean value to the client, with no carriage return-line feed (CRLF) character at the end.
void | print(char c) Writes a character to the client, with no carriage return-line feed (CRLF) at the end.
void | print(double d) Writes a double value to the client, with no carriage return-line feed (CRLF) at the end.
void | print(float f) Writes a float value to the client, with no carriage return-line feed (CRLF) at the end.
void | print(int i) Writes an int to the client, with no carriage return-line feed (CRLF) at the end.
void | print(long l) Writes a long value to the client, with no carriage return-line feed (CRLF) at the end.
void | print(String s) Writes a String to the client, without a carriage return-line feed (CRLF) character at the end.
void | println() Writes a carriage return-line feed (CRLF) to the client.
void | println(boolean b) Writes a boolean value to the client, followed by a carriage return-line feed (CRLF).
void | println(char c) Writes a character to the client, followed by a carriage return-line feed (CRLF).
void | println(double d) Writes a double value to the client, followed by a carriage return-line feed (CRLF).
void | println(float f) Writes a float value to the client, followed by a carriage return-line feed (CRLF).
void | println(int i) Writes an int to the client, followed by a carriage return-line feed (CRLF) character.
void | println(long l) Writes a long value to the client, followed by a carriage return-line feed (CRLF).
void | println(String s) Writes a String to the client, followed by a carriage return-line feed (CRLF).
Methods inherited from class java.io.OutputStream
close, flush, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected ServletOutputStream()
不执行任何操作，因为这是一个抽象类。
英文文档：

ServletOutputStream

protected ServletOutputStream()
Does nothing, because this is an abstract class.

Method Detail

public void print(String s) throws java.io.IOException
将 String 写入客户端，末尾没有回车-换行 (CRLF) 字符。
s | 将发送到客户端的 String
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

print

public void print(String s)
           throws IOException
Writes a String to the client, without a carriage return-line feed (CRLF) character at the end.

Parameters:
s - the String to send to the client
Throws:
IOException - if an input or output exception occurred

public void print(boolean b) throws java.io.IOException
将 boolean 值写入客户端，末尾没有回车-换行 (CRLF) 字符。
b | 将发送到客户端的 boolean 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

print

public void print(boolean b)
           throws IOException
Writes a boolean value to the client, with no carriage return-line feed (CRLF) character at the end.

Parameters:
b - the boolean value to send to the client
Throws:
IOException - if an input or output exception occurred

public void print(char c) throws java.io.IOException
将字符写入客户端，末尾没有回车-换行 (CRLF)。
c | 将发送到客户端的字符
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

print

public void print(char c)
           throws IOException
Writes a character to the client, with no carriage return-line feed (CRLF) at the end.

Parameters:
c - the character to send to the client
Throws:
IOException - if an input or output exception occurred

public void print(int i) throws java.io.IOException
将 int 值写入客户端，末尾没有回车-换行 (CRLF)。
i | 将发送到客户端的 int 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

print

public void print(int i)
           throws IOException
Writes an int to the client, with no carriage return-line feed (CRLF) at the end.

Parameters:
i - the int to send to the client
Throws:
IOException - if an input or output exception occurred

public void print(long l) throws java.io.IOException
将 long 值写入客户端，末尾没有回车-换行 (CRLF)。
l | 将发送到客户端的 long 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

print

public void print(long l)
           throws IOException
Writes a long value to the client, with no carriage return-line feed (CRLF) at the end.

Parameters:
l - the long value to send to the client
Throws:
IOException - if an input or output exception occurred

public void print(float f) throws java.io.IOException
将 float 值写入客户端，末尾没有回车-换行 (CRLF)。
f | 将发送到客户端的 float 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

print

public void print(float f)
           throws IOException
Writes a float value to the client, with no carriage return-line feed (CRLF) at the end.

Parameters:
f - the float value to send to the client
Throws:
IOException - if an input or output exception occurred

public void print(double d) throws java.io.IOException
将 double 值写入客户端，末尾没有回车-换行 (CRLF)。
d | 将发送到客户端的 double 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

print

public void print(double d)
           throws IOException
Writes a double value to the client, with no carriage return-line feed (CRLF) at the end.

Parameters:
d - the double value to send to the client
Throws:
IOException - if an input or output exception occurred

public void println() throws java.io.IOException
将回车-换行 (CRLF) 写入客户端。
Throws java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println()
             throws IOException
Writes a carriage return-line feed (CRLF) to the client.

Throws:
IOException - if an input or output exception occurred

public void println(String s) throws java.io.IOException
将 String 写入客户端，后跟一个回车-换行 (CRLF)。
s | 要写入客户端的 String
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println(String s)
             throws IOException
Writes a String to the client, followed by a carriage return-line feed (CRLF).

Parameters:
s - the String to write to the client
Throws:
IOException - if an input or output exception occurred

public void println(boolean b) throws java.io.IOException
将 boolean 值写入客户端，后跟一个回车-换行 (CRLF)。
b | 要写入客户端的 boolean 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println(boolean b)
             throws IOException
Writes a boolean value to the client, followed by a carriage return-line feed (CRLF).

Parameters:
b - the boolean value to write to the client
Throws:
IOException - if an input or output exception occurred

public void println(char c) throws java.io.IOException
将字符写入客户端，后跟一个回车-换行 (CRLF)。
c | 要写入客户端的字符
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println(char c)
             throws IOException
Writes a character to the client, followed by a carriage return-line feed (CRLF).

Parameters:
c - the character to write to the client
Throws:
IOException - if an input or output exception occurred

public void println(int i) throws java.io.IOException
将 int 值写入客户端，后跟一个回车-换行 (CRLF) 字符。
i | 要写入客户端的 int 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println(int i)
             throws IOException
Writes an int to the client, followed by a carriage return-line feed (CRLF) character.

Parameters:
i - the int to write to the client
Throws:
IOException - if an input or output exception occurred

public void println(long l) throws java.io.IOException
将 long 值写入客户端，后跟一个回车-换行 (CRLF)。
l | 要写入客户端的 long 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println(long l)
             throws IOException
Writes a long value to the client, followed by a carriage return-line feed (CRLF).

Parameters:
l - the long value to write to the client
Throws:
IOException - if an input or output exception occurred

public void println(float f) throws java.io.IOException
将 float 值写入客户端，后跟一个回车-换行 (CRLF)。
f | 要写入客户端的 float 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println(float f)
             throws IOException
Writes a float value to the client, followed by a carriage return-line feed (CRLF).

Parameters:
f - the float value to write to the client
Throws:
IOException - if an input or output exception occurred

public void println(double d) throws java.io.IOException
将 double 值写入客户端，后跟一个回车-换行 (CRLF)。
d | 要写入客户端的 double 值
Throws | java.io.IOException: 如果发生输入或输出异常
英文文档：

println

public void println(double d)
             throws IOException
Writes a double value to the client, followed by a carriage return-line feed (CRLF).

Parameters:
d - the double value to write to the client
Throws:
IOException - if an input or output exception occurred
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestAttributeEvent (Java EE 5)

javax.servlet
Class ServletRequestAttributeEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.servlet.ServletRequestEvent
            extended by  javax.servlet.ServletRequestAttributeEvent
All Implemented Interfaces:
Serializable
public class ServletRequestAttributeEvent
extends ServletRequestEvent

Extends: java.util.EventObject > ServletRequestEvent

这是一个事件类，用于通知有关应用程序中 servlet 请求的属性更改的信息。
since
en
Servlet 2.4
See also javax.servlet.ServletRequestAttributeListener
英文文档：

This is the event class for notifications of changes to the attributes of the servlet request in an application.

Since:
Servlet 2.4
See Also:
ServletRequestAttributeListener, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ServletRequestAttributeEvent(ServletContext sc, ServletRequest request, String name, Object value)
Construct a ServletRequestAttributeEvent giving the servlet context of this web application, the ServletRequest whose attributes are changing and the name and value of the attribute.
Method Summary
String | getName() Return the name of the attribute that changed on the ServletRequest.
Object | getValue() Returns the value of the attribute that has been added, removed or replaced.
Methods inherited from class javax.servlet.ServletRequestEvent
getServletContext, getServletRequest
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ServletRequestAttributeEvent(ServletContext sc, ServletRequest request, String name, Object value)
给出此 Web 应用程序的 servlet 上下文、属性正发生更改的 ServletRequest 以及属性的名称和值，构造 ServletRequestAttributeEvent。
sc | 发送该事件的 ServletContext。
request | 发送该事件的 ServletRequest。
name | 请求属性的名称。
value | 请求属性的值。
英文文档：

ServletRequestAttributeEvent

public ServletRequestAttributeEvent(ServletContext sc,
                                    ServletRequest request,
                                    String name,
                                    Object value)
Construct a ServletRequestAttributeEvent giving the servlet context of this web application, the ServletRequest whose attributes are changing and the name and value of the attribute.

Parameters:
sc - the ServletContext that is sending the event.
request - the ServletRequest that is sending the event.
name - the name of the request attribute.
value - the value of the request attribute.
Method Detail

public String getName()
返回 ServletRequest 中更改的属性的名称。
return 更改的请求属性的名称
英文文档：

getName

public String getName()
Return the name of the attribute that changed on the ServletRequest.

Returns:
the name of the changed request attribute

public Object getValue()
返回已添加、移除或替换的属性的值。如果添加了属性，则这是属性的值。如果移除了属性，则这是被移除属性的值。如果替换了属性，则这是属性原来的值。
return 更改的请求属性的值
英文文档：

getValue

public Object getValue()
Returns the value of the attribute that has been added, removed or replaced. If the attribute was added, this is the value of the attribute. If the attribute was removed, this is the value of the removed attribute. If the attribute was replaced, this is the old value of the attribute.

Returns:
the value of the changed request attribute
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestEvent (Java EE 5)

javax.servlet
Class ServletRequestEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.servlet.ServletRequestEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ServletRequestAttributeEvent
public class ServletRequestEvent
extends EventObject

Extends: java.util.EventObject
Extended by: ServletRequestAttributeEvent

这类事件指示 ServletRequest 的生命周期事件。事件的源是此 Web 应用程序的 ServletContext。
since
en
Servlet 2.4
See also javax.servlet.ServletRequestListener
英文文档：

Events of this kind indicate lifecycle events for a ServletRequest. The source of the event is the ServletContext of this web application.

Since:
Servlet 2.4
See Also:
ServletRequestListener, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
ServletRequestEvent(ServletContext sc, ServletRequest request)
Construct a ServletRequestEvent for the given ServletContext and ServletRequest.
Method Summary
ServletContext | getServletContext() Returns the ServletContext of this web application.
ServletRequest | getServletRequest() Returns the ServletRequest that is changing.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ServletRequestEvent(ServletContext sc, ServletRequest request)
为给定 ServletContext 和 ServletRequest 构造 ServletRequestEvent。
sc | Web 应用程序的 ServletContext。
request | 发送该事件的 ServletRequest。
英文文档：

ServletRequestEvent

public ServletRequestEvent(ServletContext sc,
                           ServletRequest request)
Construct a ServletRequestEvent for the given ServletContext and ServletRequest.

Parameters:
sc - the ServletContext of the web application.
request - the ServletRequest that is sending the event.
Method Detail

public ServletRequest getServletRequest()
返回正发生更改的 ServletRequest。
英文文档：

getServletRequest

public ServletRequest getServletRequest()
Returns the ServletRequest that is changing.

public ServletContext getServletContext()
返回此 Web 应用程序的 ServletContext。
英文文档：

getServletContext

public ServletContext getServletContext()
Returns the ServletContext of this web application.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletRequestWrapper (Java EE 5)

javax.servlet
Class ServletRequestWrapper

java.lang.Object
    extended by  javax.servlet.ServletRequestWrapper
All Implemented Interfaces:
ServletRequest
Direct Known Subclasses:
HttpServletRequestWrapper
public class ServletRequestWrapper
extends Object
implements ServletRequest

Implements: ServletRequest
Extended by: HttpServletRequestWrapper

提供 ServletRequest 接口的便捷实现，希望将请求适配到 Servlet 的开发人员可以子类化该接口。此类实现 Wrapper 或 Decorator 模式。默认情况下，方法通过包装的请求对象调用。
since
en
v 2.3
See also javax.servlet.ServletRequest
英文文档：

Provides a convenient implementation of the ServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.

Since:
v 2.3
See Also:
ServletRequest

Constructor Summary
ServletRequestWrapper(ServletRequest request)
Creates a ServletRequest adaptor wrapping the given request object.
Method Summary
 Object getAttribute(String name)
The default behavior of this method is to call getAttribute(String name) on the wrapped request object.
 Enumeration getAttributeNames()
The default behavior of this method is to return getAttributeNames() on the wrapped request object.
 String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.
 int getContentLength()
The default behavior of this method is to return getContentLength() on the wrapped request object.
 String getContentType()
The default behavior of this method is to return getContentType() on the wrapped request object.
 ServletInputStream getInputStream()
The default behavior of this method is to return getInputStream() on the wrapped request object.
 String getLocalAddr()
The default behavior of this method is to return getLocalAddr() on the wrapped request object.
 Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped request object.
 Enumeration getLocales()
The default behavior of this method is to return getLocales() on the wrapped request object.
 String getLocalName()
The default behavior of this method is to return getLocalName() on the wrapped request object.
 int getLocalPort()
The default behavior of this method is to return getLocalPort() on the wrapped request object.
 String getParameter(String name)
The default behavior of this method is to return getParameter(String name) on the wrapped request object.
 Map getParameterMap()
The default behavior of this method is to return getParameterMap() on the wrapped request object.
 Enumeration getParameterNames()
The default behavior of this method is to return getParameterNames() on the wrapped request object.
 String[] getParameterValues(String name)
The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.
 String getProtocol()
The default behavior of this method is to return getProtocol() on the wrapped request object.
 BufferedReader getReader()
The default behavior of this method is to return getReader() on the wrapped request object.
 String getRealPath(String path)
The default behavior of this method is to return getRealPath(String path) on the wrapped request object.
 String getRemoteAddr()
The default behavior of this method is to return getRemoteAddr() on the wrapped request object.
 String getRemoteHost()
The default behavior of this method is to return getRemoteHost() on the wrapped request object.
 int getRemotePort()
The default behavior of this method is to return getRemotePort() on the wrapped request object.
 ServletRequest getRequest()
Return the wrapped request object.
 RequestDispatcher getRequestDispatcher(String path)
The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.
 String getScheme()
The default behavior of this method is to return getScheme() on the wrapped request object.
 String getServerName()
The default behavior of this method is to return getServerName() on the wrapped request object.
 int getServerPort()
The default behavior of this method is to return getServerPort() on the wrapped request object.
 boolean isSecure()
The default behavior of this method is to return isSecure() on the wrapped request object.
 void removeAttribute(String name)
The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.
 void setAttribute(String name, Object o)
The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object.
 void setCharacterEncoding(String enc)
The default behavior of this method is to set the character encoding on the wrapped request object.
 void setRequest(ServletRequest request)
Sets the request object being wrapped.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ServletRequestWrapper(ServletRequest request)
创建包装给定请求对象的 ServletRequest 适配器。
Throws IllegalArgumentException: 如果 request 为 null
英文文档：

ServletRequestWrapper

public ServletRequestWrapper(ServletRequest request)
Creates a ServletRequest adaptor wrapping the given request object.

Throws:
IllegalArgumentException - if the request is null
Method Detail

public ServletRequest getRequest()
返回包装的请求对象。
英文文档：

getRequest

public ServletRequest getRequest()
Return the wrapped request object.

public void setRequest(ServletRequest request)
设置将被包装的请求对象。
Throws IllegalArgumentException: 如果 request 为 null。
英文文档：

setRequest

public void setRequest(ServletRequest request)
Sets the request object being wrapped.

Throws:
IllegalArgumentException - if the request is null.

public Object getAttribute(String name)
此方法的默认行为是对包装的请求对象调用 getAttribute(String name)。
英文文档：

getAttribute

public Object getAttribute(String name)
The default behavior of this method is to call getAttribute(String name) on the wrapped request object.

Specified by:
getAttribute in interface ServletRequest
Parameters:
name - a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if the attribute does not exist

public java.util.Enumeration<E> getAttributeNames()
此方法的默认行为是返回对包装的请求对象调用 getAttributeNames() 的结果。
英文文档：

getAttributeNames

public Enumeration getAttributeNames()
The default behavior of this method is to return getAttributeNames() on the wrapped request object.

Specified by:
getAttributeNames in interface ServletRequest
Returns:
an Enumeration of strings containing the names of the request's attributes

public String getCharacterEncoding()
此方法的默认行为是返回对包装的请求对象调用 getCharacterEncoding() 的结果。
英文文档：

getCharacterEncoding

public String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.

Specified by:
getCharacterEncoding in interface ServletRequest
Returns:
a String containing the name of the character encoding, or null if the request does not specify a character encoding

public void setCharacterEncoding(String enc) throws java.io.UnsupportedEncodingException
此方法的默认行为是设置包装的请求对象上的字符编码。
英文文档：

setCharacterEncoding

public void setCharacterEncoding(String enc)
                          throws UnsupportedEncodingException
The default behavior of this method is to set the character encoding on the wrapped request object.

Specified by:
setCharacterEncoding in interface ServletRequest
Parameters:
enc - String containing the name of the character encoding.
Throws:
UnsupportedEncodingException - if this ServletRequest is still in a state where a character encoding may be set, but the specified encoding is invalid

public int getContentLength()
此方法的默认行为是返回对包装的请求对象调用 getContentLength() 的结果。
英文文档：

getContentLength

public int getContentLength()
The default behavior of this method is to return getContentLength() on the wrapped request object.

Specified by:
getContentLength in interface ServletRequest
Returns:
an integer containing the length of the request body or -1 if the length is not known

public String getContentType()
此方法的默认行为是返回对包装的请求对象调用 getContentType() 的结果。
英文文档：

getContentType

public String getContentType()
The default behavior of this method is to return getContentType() on the wrapped request object.

Specified by:
getContentType in interface ServletRequest
Returns:
a String containing the name of the MIME type of the request, or null if the type is not known

public ServletInputStream getInputStream() throws java.io.IOException
此方法的默认行为是返回对包装的请求对象调用 getInputStream() 的结果。
英文文档：

getInputStream

public ServletInputStream getInputStream()
                                  throws IOException
The default behavior of this method is to return getInputStream() on the wrapped request object.

Specified by:
getInputStream in interface ServletRequest
Returns:
a ServletInputStream object containing the body of the request
Throws:
IOException - if an input or output exception occurred

public String getParameter(String name)
此方法的默认行为是返回对包装的请求对象调用 getParameter(String name) 的结果。
英文文档：

getParameter

public String getParameter(String name)
The default behavior of this method is to return getParameter(String name) on the wrapped request object.

Specified by:
getParameter in interface ServletRequest
Parameters:
name - a String specifying the name of the parameter
Returns:
a String representing the single value of the parameter
See Also:
ServletRequest.getParameterValues(java.lang.String)

public java.util.Map<K, V> getParameterMap()
此方法的默认行为是返回对包装的请求对象调用 getParameterMap() 的结果。
英文文档：

getParameterMap

public Map getParameterMap()
The default behavior of this method is to return getParameterMap() on the wrapped request object.

Specified by:
getParameterMap in interface ServletRequest
Returns:
an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.

public java.util.Enumeration<E> getParameterNames()
此方法的默认行为是返回对包装的请求对象调用 getParameterNames() 的结果。
英文文档：

getParameterNames

public Enumeration getParameterNames()
The default behavior of this method is to return getParameterNames() on the wrapped request object.

Specified by:
getParameterNames in interface ServletRequest
Returns:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters

public String[] getParameterValues(String name)
此方法的默认行为是返回对包装的请求对象调用 getParameterValues(String name) 的结果。
英文文档：

getParameterValues

public String[] getParameterValues(String name)
The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.

Specified by:
getParameterValues in interface ServletRequest
Parameters:
name - a String containing the name of the parameter whose value is requested
Returns:
an array of String objects containing the parameter's values
See Also:
ServletRequest.getParameter(java.lang.String)

public String getProtocol()
此方法的默认行为是返回对包装的请求对象调用 getProtocol() 的结果。
英文文档：

getProtocol

public String getProtocol()
The default behavior of this method is to return getProtocol() on the wrapped request object.

Specified by:
getProtocol in interface ServletRequest
Returns:
a String containing the protocol name and version number

public String getScheme()
此方法的默认行为是返回对包装的请求对象调用 getScheme() 的结果。
英文文档：

getScheme

public String getScheme()
The default behavior of this method is to return getScheme() on the wrapped request object.

Specified by:
getScheme in interface ServletRequest
Returns:
a String containing the name of the scheme used to make this request

public String getServerName()
此方法的默认行为是返回对包装的请求对象调用 getServerName() 的结果。
英文文档：

getServerName

public String getServerName()
The default behavior of this method is to return getServerName() on the wrapped request object.

Specified by:
getServerName in interface ServletRequest
Returns:
a String containing the name of the server

public int getServerPort()
此方法的默认行为是返回对包装的请求对象调用 getServerPort() 的结果。
英文文档：

getServerPort

public int getServerPort()
The default behavior of this method is to return getServerPort() on the wrapped request object.

Specified by:
getServerPort in interface ServletRequest
Returns:
an integer specifying the port number

public java.io.BufferedReader getReader() throws java.io.IOException
此方法的默认行为是返回对包装的请求对象调用 getReader() 的结果。
英文文档：

getReader

public BufferedReader getReader()
                         throws IOException
The default behavior of this method is to return getReader() on the wrapped request object.

Specified by:
getReader in interface ServletRequest
Returns:
a BufferedReader containing the body of the request
Throws:
IOException - if an input or output exception occurred
See Also:
ServletRequest.getInputStream()

public String getRemoteAddr()
此方法的默认行为是返回对包装的请求对象调用 getRemoteAddr() 的结果。
英文文档：

getRemoteAddr

public String getRemoteAddr()
The default behavior of this method is to return getRemoteAddr() on the wrapped request object.

Specified by:
getRemoteAddr in interface ServletRequest
Returns:
a String containing the IP address of the client that sent the request

public String getRemoteHost()
此方法的默认行为是返回对包装的请求对象调用 getRemoteHost() 的结果。
英文文档：

getRemoteHost

public String getRemoteHost()
The default behavior of this method is to return getRemoteHost() on the wrapped request object.

Specified by:
getRemoteHost in interface ServletRequest
Returns:
a String containing the fully qualified name of the client

public void setAttribute(String name, Object o)
此方法的默认行为是返回对包装的请求对象调用 setAttribute(String name, Object o) 的结果。
英文文档：

setAttribute

public void setAttribute(String name,
                         Object o)
The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object.

Specified by:
setAttribute in interface ServletRequest
Parameters:
name - a String specifying the name of the attribute
o - the Object to be stored

public void removeAttribute(String name)
此方法的默认行为是对包装的请求对象调用 removeAttribute(String name)。
英文文档：

removeAttribute

public void removeAttribute(String name)
The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.

Specified by:
removeAttribute in interface ServletRequest
Parameters:
name - a String specifying the name of the attribute to remove

public java.util.Locale getLocale()
此方法的默认行为是返回对包装的请求对象调用 getLocale() 的结果。
英文文档：

getLocale

public Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped request object.

Specified by:
getLocale in interface ServletRequest
Returns:
the preferred Locale for the client

public java.util.Enumeration<E> getLocales()
此方法的默认行为是返回对包装的请求对象调用 getLocales() 的结果。
英文文档：

getLocales

public Enumeration getLocales()
The default behavior of this method is to return getLocales() on the wrapped request object.

Specified by:
getLocales in interface ServletRequest
Returns:
an Enumeration of preferred Locale objects for the client

public boolean isSecure()
此方法的默认行为是返回对包装的请求对象调用 isSecure() 的结果。
英文文档：

isSecure

public boolean isSecure()
The default behavior of this method is to return isSecure() on the wrapped request object.

Specified by:
isSecure in interface ServletRequest
Returns:
a boolean indicating if the request was made using a secure channel

public RequestDispatcher getRequestDispatcher(String path)
此方法的默认行为是返回对包装的请求对象调用 getRequestDispatcher(String path) 的结果。
英文文档：

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)
The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.

Specified by:
getRequestDispatcher in interface ServletRequest
Parameters:
path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet.
Returns:
a RequestDispatcher object that acts as a wrapper for the resource at the specified path, or null if the servlet container cannot return a RequestDispatcher
See Also:
RequestDispatcher, ServletContext.getRequestDispatcher(java.lang.String)

public String getRealPath(String path)
此方法的默认行为是返回对包装的请求对象调用 getRealPath(String path) 的结果。
英文文档：

getRealPath

public String getRealPath(String path)
The default behavior of this method is to return getRealPath(String path) on the wrapped request object.

Specified by:
getRealPath in interface ServletRequest

public int getRemotePort()
此方法的默认行为是返回对包装的请求对象调用 getRemotePort() 的结果。
since 2.4
英文文档：

getRemotePort

public int getRemotePort()
The default behavior of this method is to return getRemotePort() on the wrapped request object.

Specified by:
getRemotePort in interface ServletRequest
Returns:
an integer specifying the port number
Since:
2.4

public String getLocalName()
此方法的默认行为是返回对包装的请求对象调用 getLocalName() 的结果。
since 2.4
英文文档：

getLocalName

public String getLocalName()
The default behavior of this method is to return getLocalName() on the wrapped request object.

Specified by:
getLocalName in interface ServletRequest
Returns:
a String containing the host name of the IP on which the request was received.
Since:
2.4

public String getLocalAddr()
此方法的默认行为是返回对包装的请求对象调用 getLocalAddr() 的结果。
since 2.4
英文文档：

getLocalAddr

public String getLocalAddr()
The default behavior of this method is to return getLocalAddr() on the wrapped request object.

Specified by:
getLocalAddr in interface ServletRequest
Returns:
a String containing the IP address on which the request was received.
Since:
2.4

public int getLocalPort()
此方法的默认行为是返回对包装的请求对象调用 getLocalPort() 的结果。
since 2.4
英文文档：

getLocalPort

public int getLocalPort()
The default behavior of this method is to return getLocalPort() on the wrapped request object.

Specified by:
getLocalPort in interface ServletRequest
Returns:
an integer specifying the port number
Since:
2.4
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletResponseWrapper (Java EE 5)

javax.servlet
Class ServletResponseWrapper

java.lang.Object
    extended by  javax.servlet.ServletResponseWrapper
All Implemented Interfaces:
ServletResponse
Direct Known Subclasses:
HttpServletResponseWrapper
public class ServletResponseWrapper
extends Object
implements ServletResponse

Implements: ServletResponse
Extended by: HttpServletResponseWrapper

提供 ServletResponse 接口的便捷实现，希望根据 Servlet 适配响应的开发人员可以子类化该接口。此类实现 Wrapper 或 Decorator 模式。默认情况下，方法通过包装的响应对象调用。
since
en
v 2.3
See also javax.servlet.ServletResponse
英文文档：

Provides a convenient implementation of the ServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped response object.

Since:
v 2.3
Author:
Various
See Also:
ServletResponse

Constructor Summary
ServletResponseWrapper(ServletResponse response)
Creates a ServletResponse adaptor wrapping the given response object.
Method Summary
 void flushBuffer()
The default behavior of this method is to call flushBuffer() on the wrapped response object.
 int getBufferSize()
The default behavior of this method is to return getBufferSize() on the wrapped response object.
 String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object.
 String getContentType()
The default behavior of this method is to return getContentType() on the wrapped response object.
 Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped response object.
 ServletOutputStream getOutputStream()
The default behavior of this method is to return getOutputStream() on the wrapped response object.
 ServletResponse getResponse()
Return the wrapped ServletResponse object.
 PrintWriter getWriter()
The default behavior of this method is to return getWriter() on the wrapped response object.
 boolean isCommitted()
The default behavior of this method is to return isCommitted() on the wrapped response object.
 void reset()
The default behavior of this method is to call reset() on the wrapped response object.
 void resetBuffer()
The default behavior of this method is to call resetBuffer() on the wrapped response object.
 void setBufferSize(int size)
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object.
 void setCharacterEncoding(String charset)
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object.
 void setContentLength(int len)
The default behavior of this method is to call setContentLength(int len) on the wrapped response object.
 void setContentType(String type)
The default behavior of this method is to call setContentType(String type) on the wrapped response object.
 void setLocale(Locale loc)
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object.
 void setResponse(ServletResponse response)
Sets the response being wrapped.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ServletResponseWrapper(ServletResponse response)
创建包装给定响应对象的 ServletResponse 适配器。
Throws IllegalArgumentException: 如果 response 为 null
英文文档：

ServletResponseWrapper

public ServletResponseWrapper(ServletResponse response)
Creates a ServletResponse adaptor wrapping the given response object.

Throws:
IllegalArgumentException - if the response is null.
Method Detail

public ServletResponse getResponse()
返回包装的 ServletResponse 对象。
英文文档：

getResponse

public ServletResponse getResponse()
Return the wrapped ServletResponse object.

public void setResponse(ServletResponse response)
设置将被包装的响应。
Throws IllegalArgumentException: 如果 response 为 null
英文文档：

setResponse

public void setResponse(ServletResponse response)
Sets the response being wrapped.

Throws:
IllegalArgumentException - if the response is null.

public void setCharacterEncoding(String charset)
此方法的默认行为是对包装的响应对象调用 setCharacterEncoding(String charset)。
since 2.4
英文文档：

setCharacterEncoding

public void setCharacterEncoding(String charset)
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object.

Specified by:
setCharacterEncoding in interface ServletResponse
Parameters:
charset - a String specifying only the character set defined by IANA Character Sets (http://www.iana.org/assignments/character-sets)
Since:
2.4
See Also:
#setLocale

public String getCharacterEncoding()
此方法的默认行为是返回对包装的响应对象调用 getCharacterEncoding() 的结果。
英文文档：

getCharacterEncoding

public String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object.

Specified by:
getCharacterEncoding in interface ServletResponse
Returns:
a String specifying the name of the character encoding, for example, UTF-8

public ServletOutputStream getOutputStream() throws java.io.IOException
此方法的默认行为是返回对包装的响应对象调用 getOutputStream() 的结果。
英文文档：

getOutputStream

public ServletOutputStream getOutputStream()
                                    throws IOException
The default behavior of this method is to return getOutputStream() on the wrapped response object.

Specified by:
getOutputStream in interface ServletResponse
Returns:
a ServletOutputStream for writing binary data
Throws:
IOException - if an input or output exception occurred
See Also:
ServletResponse.getWriter()

public java.io.PrintWriter getWriter() throws java.io.IOException
此方法的默认行为是返回对包装的响应对象调用 getWriter() 的结果。
英文文档：

getWriter

public PrintWriter getWriter()
                      throws IOException
The default behavior of this method is to return getWriter() on the wrapped response object.

Specified by:
getWriter in interface ServletResponse
Returns:
a PrintWriter object that can return character data to the client
Throws:
IOException - if an input or output exception occurred
See Also:
ServletResponse.getOutputStream(), ServletResponse.setCharacterEncoding(java.lang.String)

public void setContentLength(int len)
此方法的默认行为是对包装的响应对象调用 setContentLength(int len)。
英文文档：

setContentLength

public void setContentLength(int len)
The default behavior of this method is to call setContentLength(int len) on the wrapped response object.

Specified by:
setContentLength in interface ServletResponse
Parameters:
len - an integer specifying the length of the content being returned to the client; sets the Content-Length header

public void setContentType(String type)
此方法的默认行为是对包装的响应对象调用 setContentType(String type)。
英文文档：

setContentType

public void setContentType(String type)
The default behavior of this method is to call setContentType(String type) on the wrapped response object.

Specified by:
setContentType in interface ServletResponse
Parameters:
type - a String specifying the MIME type of the content
See Also:
ServletResponse.setLocale(java.util.Locale),
ServletResponse.setCharacterEncoding(java.lang.String),
ServletResponse.getOutputStream(),
ServletResponse.getWriter()

public String getContentType()
此方法的默认行为是返回对包装的响应对象调用 getContentType() 的结果。
since 2.4
英文文档：

getContentType

public String getContentType()
The default behavior of this method is to return getContentType() on the wrapped response object.

Specified by:
getContentType in interface ServletResponse
Returns:
a String specifying the content type, for example, text/html; charset=UTF-8, or null
Since:
2.4

public void setBufferSize(int size)
此方法的默认行为是对包装的响应对象调用 setBufferSize(int size)。
英文文档：

setBufferSize

public void setBufferSize(int size)
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object.

Specified by:
setBufferSize in interface ServletResponse
Parameters:
size - the preferred buffer size
See Also:
ServletResponse.getBufferSize(),
ServletResponse.flushBuffer(),
ServletResponse.isCommitted(),
ServletResponse.reset()

public int getBufferSize()
此方法的默认行为是返回对包装的响应对象调用 getBufferSize() 的结果。
英文文档：

getBufferSize

public int getBufferSize()
The default behavior of this method is to return getBufferSize() on the wrapped response object.

Specified by:
getBufferSize in interface ServletResponse
Returns:
the actual buffer size used
See Also:
ServletResponse.setBufferSize(int),
ServletResponse.flushBuffer(),
ServletResponse.isCommitted(),
ServletResponse.reset()

public void flushBuffer() throws java.io.IOException
此方法的默认行为是对包装的响应对象调用 flushBuffer()。
英文文档：

flushBuffer

public void flushBuffer()
                 throws IOException
The default behavior of this method is to call flushBuffer() on the wrapped response object.

Specified by:
flushBuffer in interface ServletResponse
Throws:
IOException
See Also:
ServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.isCommitted(),
ServletResponse.reset()

public boolean isCommitted()
此方法的默认行为是返回对包装的响应对象调用 isCommitted() 的结果。
英文文档：

isCommitted

public boolean isCommitted()
The default behavior of this method is to return isCommitted() on the wrapped response object.

Specified by:
isCommitted in interface ServletResponse
Returns:
a boolean indicating if the response has been committed
See Also:
ServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.flushBuffer(),
ServletResponse.reset()

public void reset()
此方法的默认行为是对包装的响应对象调用 reset()。
英文文档：

reset

public void reset()
The default behavior of this method is to call reset() on the wrapped response object.

Specified by:
reset in interface ServletResponse
See Also:
ServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.flushBuffer(),
ServletResponse.isCommitted()

public void resetBuffer()
此方法的默认行为是对包装的响应对象调用 resetBuffer()。
英文文档：

resetBuffer

public void resetBuffer()
The default behavior of this method is to call resetBuffer() on the wrapped response object.

Specified by:
resetBuffer in interface ServletResponse
See Also:
ServletResponse.setBufferSize(int),
ServletResponse.getBufferSize(),
ServletResponse.isCommitted(),
ServletResponse.reset()

public void setLocale(java.util.Locale loc)
此方法的默认行为是对包装的响应对象调用 setLocale(Locale loc)。
英文文档：

setLocale

public void setLocale(Locale loc)
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object.

Specified by:
setLocale in interface ServletResponse
Parameters:
loc - the locale of the response
See Also:
ServletResponse.getLocale(),
ServletResponse.setContentType(java.lang.String),
ServletResponse.setCharacterEncoding(java.lang.String)

public java.util.Locale getLocale()
此方法的默认行为是返回对包装的响应对象调用 getLocale() 的结果。
英文文档：

getLocale

public Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped response object.

Specified by:
getLocale in interface ServletResponse
See Also:
ServletResponse.setLocale(java.util.Locale)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServletException (Java EE 5)

javax.servlet
Class ServletException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
UnavailableException
public class ServletException
extends Exception

Extends: Throwable > Exception
Extended by: UnavailableException

定义 servlet 遇到困难时可抛出的一般异常。
英文文档：

Defines a general exception a servlet can throw when it encounters difficulty.

Author:
Various
See Also:
Serialized Form

Constructor Summary
ServletException()
Constructs a new servlet exception.
ServletException(String message)
Constructs a new servlet exception with the specified message.
ServletException(String message, Throwable rootCause)
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message.
ServletException(Throwable rootCause)
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation.
Method Summary
 Throwable getRootCause()
Returns the exception that caused this servlet exception.
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

public ServletException()
构造新的 servlet 异常。
英文文档：

ServletException

public ServletException()
Constructs a new servlet exception.

public ServletException(String message)
构造带指定消息的新 servlet 异常。该消息可以写入到服务器日志和/或向用户显示。
message 指定异常消息文本的 String
英文文档：

ServletException

public ServletException(String message)
Constructs a new servlet exception with the specified message. The message can be written to the server log and/or displayed for the user.

Parameters:
message - a String specifying the text of the exception message

public ServletException(String message, Throwable rootCause)
当 servlet 需要抛出异常并且需要包含有关妨碍 servlet 正常操作的“根本原因”异常的消息时，构造一个新 servlet 异常，该异常包含一条描述消息。
message | 包含异常消息文本的 String
rootCause | 防碍 servlet 正常操作的 Throwable 异常，使此 servlet 异常成为必需的
英文文档：

ServletException

public ServletException(String message,
                        Throwable rootCause)
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message.

Parameters:
message - a String containing the text of the exception message
rootCause - the Throwable exception that interfered with the servlet's normal operation, making this servlet exception necessary

public ServletException(Throwable rootCause)
当 servlet 需要抛出异常并且需要包含有关妨碍 servlet 正常操作的“根本原因”异常的消息时，构造一个新 servlet 异常。该异常消息以底层异常的本地化消息为基础。

此方法调用 Throwable 异常的 getLocalizedMessage 方法获取本地化异常消息。在子类化 ServletException 时，可重写此方法以创建设计用于特定语言环境的异常消息。

rootCause 防碍 servlet 正常操作的 Throwable 异常，使此 servlet 异常成为必需的
英文文档：

ServletException

public ServletException(Throwable rootCause)
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation. The exception's message is based on the localized message of the underlying exception.

This method calls the getLocalizedMessage method on the Throwable exception to get a localized exception message. When subclassing ServletException, this method can be overridden to create an exception message designed for a specific locale.

Parameters:
rootCause - the Throwable exception that interfered with the servlet's normal operation, making the servlet exception necessary
Method Detail

public Throwable getRootCause()
返回导致此 servlet 异常的异常。
return 导致此 servlet 异常的 Throwable
英文文档：

getRootCause

public Throwable getRootCause()
Returns the exception that caused this servlet exception.

Returns:
the Throwable that caused this servlet exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnavailableException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet
Class UnavailableException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.ServletException
                extended by  javax.servlet.UnavailableException
All Implemented Interfaces:
Serializable
public class UnavailableException
extends ServletException

Extends: Throwable > Exception > ServletException

定义 servlet 或过滤器抛出的指示该 servlet 或过滤器永久或暂时不可用的异常。

当 servlet 或过滤器是永久不可用时，该 servlet 或过滤器的某些地方出错，在采取某个操作之前，该 servlet 或过滤器一直无法处理请求。例如，可能以不正确的方式配置了某个 servlet，或者过滤器的状态可能被破坏。组件应该记录错误和需要的校正操作。

如果由于某个系统范围的问题导致 servlet 或过滤器暂时无法处理请求，则该 servlet 或过滤器是暂时不可用。例如，可能无法访问第三层服务器，或者没有处理请求的足够内存或磁盘存储。系统管理员可能需要采取校正操作。

servlet 容器能够以相同的方式安全地处理这两种类型的不可用异常。但是，有效处理暂时不可用性可使 servlet 容器更健壮。确切地说，servlet 容器可能会将对该 servlet 或过滤器的请求阻塞一段时间（该异常建议的时间），而不是在 servlet 容器重启之前一直拒绝它们。

英文文档：

Defines an exception that a servlet or filter throws to indicate that it is permanently or temporarily unavailable.

When a servlet or filter is permanently unavailable, something is wrong with it, and it cannot handle requests until some action is taken. For example, a servlet might be configured incorrectly, or a filter's state may be corrupted. The component should log both the error and the corrective action that is needed.

A servlet or filter is temporarily unavailable if it cannot handle requests momentarily due to some system-wide problem. For example, a third-tier server might not be accessible, or there may be insufficient memory or disk storage to handle requests. A system administrator may need to take corrective action.

Servlet containers can safely treat both types of unavailable exceptions in the same way. However, treating temporary unavailability effectively makes the servlet container more robust. Specifically, the servlet container might block requests to the servlet or filter for a period of time suggested by the exception, rather than rejecting them until the servlet container restarts.

Author:
Various
See Also:
Serialized Form

Constructor Summary
UnavailableException(int seconds, Servlet servlet, String msg)
Deprecated. As of Java Servlet API 2.2, use UnavailableException(String, int) instead.
UnavailableException(Servlet servlet, String msg)
Deprecated. As of Java Servlet API 2.2, use UnavailableException(String) instead.
UnavailableException(String msg)
Constructs a new exception with a descriptive message indicating that the servlet is permanently unavailable.
UnavailableException(String msg, int seconds)
Constructs a new exception with a descriptive message indicating that the servlet is temporarily unavailable and giving an estimate of how long it will be unavailable.
Method Summary
Servlet | getServlet() Deprecated. As of Java Servlet API 2.2, with no replacement. Returns the servlet that is reporting its unavailability.
int | getUnavailableSeconds() Returns the number of seconds the servlet expects to be temporarily unavailable.
boolean | isPermanent() Returns a boolean indicating whether the servlet is permanently unavailable.
Methods inherited from class javax.servlet.ServletException
getRootCause
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

public UnavailableException(Servlet servlet, String msg)
deprecated | 从 Java Servlet API 2.2 起，请改用 #UnavailableException(String)。
servlet | 不可用的 Servlet 实例
msg | 指定描述性消息的 String
英文文档：

UnavailableException

public UnavailableException(Servlet servlet,
                            String msg)
Deprecated. As of Java Servlet API 2.2, use UnavailableException(String) instead.

Parameters:
servlet - the Servlet instance that is unavailable
msg - a String specifying the descriptive message

public UnavailableException(int seconds, Servlet servlet, String msg)
deprecated | 从 Java Servlet API 2.2 起，请改用 #UnavailableException(String, int)。
seconds | 一个整数，指定 servlet 希望不可用的秒数；如果为 0 或为负，指示 servlet 无法做出估计
servlet | 不可用的 Servlet
msg | 指定描述性消息的 String，可以写入日志文件或显示给用户。
英文文档：

UnavailableException

public UnavailableException(int seconds,
                            Servlet servlet,
                            String msg)
Deprecated. As of Java Servlet API 2.2, use UnavailableException(String, int) instead.

Parameters:
seconds - an integer specifying the number of seconds the servlet expects to be unavailable; if zero or negative, indicates that the servlet can't make an estimate
servlet - the Servlet that is unavailable
msg - a String specifying the descriptive message, which can be written to a log file or displayed for the user.

public UnavailableException(String msg)
构造带描述性消息的新异常，指示该 servlet 是永久不可用。
msg 指定描述性消息的 String
英文文档：

UnavailableException

public UnavailableException(String msg)
Constructs a new exception with a descriptive message indicating that the servlet is permanently unavailable.

Parameters:
msg - a String specifying the descriptive message

public UnavailableException(String msg, int seconds)
构造带描述性消息的新异常，指示该 servlet 是暂时不可用，并提供对其不可用时间长度的估计。

在某些情况下，servlet 无法做出估计。例如，servlet 可能知道它需要的服务器没有运行，但无法报告该服务器要花多长时间才能恢复功能。可通过对 seconds 参数使用负值或 0 来指示这一点。

msg | 指定描述性消息的 String，可以写入日志文件或显示给用户。
seconds | 一个整数，指定 servlet 希望不可用的秒数；如果为 0 或为负，指示 servlet 无法做出估计
英文文档：

UnavailableException

public UnavailableException(String msg,
                            int seconds)
Constructs a new exception with a descriptive message indicating that the servlet is temporarily unavailable and giving an estimate of how long it will be unavailable.

In some cases, the servlet cannot make an estimate. For example, the servlet might know that a server it needs is not running, but not be able to report how long it will take to be restored to functionality. This can be indicated with a negative or zero value for the seconds argument.

Parameters:
msg - a String specifying the descriptive message, which can be written to a log file or displayed for the user.
seconds - an integer specifying the number of seconds the servlet expects to be unavailable; if zero or negative, indicates that the servlet can't make an estimate
Method Detail

public boolean isPermanent()
返回指示该 servlet 是否是永久不可用的 boolean 值。如果是永久不可用，则该 servlet 的某些地方出错，系统管理员必须采取校正操作。
return 如果 servlet 是永久不可用，则返回 true；如果 servlet 是可用的或者是暂时不可用，则返回 false
英文文档：

isPermanent

public boolean isPermanent()
Returns a boolean indicating whether the servlet is permanently unavailable. If so, something is wrong with the servlet, and the system administrator must take some corrective action.

Returns:
true if the servlet is permanently unavailable; false if the servlet is available or temporarily unavailable

public Servlet getServlet()
deprecated | 从 Java Servlet API 2.2 起，不再提供替代方法。 返回报告其不可用性的 servlet。
return | 抛出 UnavailableException 的 Servlet 对象
英文文档：

getServlet

public Servlet getServlet()
Deprecated. As of Java Servlet API 2.2, with no replacement. Returns the servlet that is reporting its unavailability.

Returns:
the Servlet object that is throwing the UnavailableException

public int getUnavailableSeconds()
返回 servlet 希望暂时不可用的秒数。

如果此方法返回一个负数，则 servlet 是永久不可用，或者无法提供对其不可用时间长度的估计。在自第一次报告该异常起经过的指定时间内不做任何校正努力。

return 一个整数，指定 servlet 暂时不可用的秒数；如果 servlet 是永久不可用或者无法做出估计，则返回一个负数
英文文档：

getUnavailableSeconds

public int getUnavailableSeconds()
Returns the number of seconds the servlet expects to be temporarily unavailable.

If this method returns a negative number, the servlet is permanently unavailable or cannot provide an estimate of how long it will be unavailable. No effort is made to correct for the time elapsed since the exception was first reported.

Returns:
an integer specifying the number of seconds the servlet will be temporarily unavailable, or a negative number if the servlet is permanently unavailable or cannot make an estimate
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.servlet.http (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.servlet.http

The javax.servlet.http package contains a number of classes and interfaces that describe and define the contracts between a servlet class running under the HTTP protocol and the runtime environment provided for an instance of such a class by a conforming servlet container.

See:
Description

Interface Summary
HttpServletRequest | Extends the ServletRequest interface to provide request information for HTTP servlets.
HttpServletResponse | Extends the ServletResponse interface to provide HTTP-specific functionality in sending a response.
HttpSession | Provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user.
HttpSessionActivationListener | Objects that are bound to a session may listen to container events notifying them that sessions will be passivated and that session will be activated.
HttpSessionAttributeListener | This listener interface can be implemented in order to get notifications of changes to the attribute lists of sessions within this web application.
HttpSessionBindingListener | Causes an object to be notified when it is bound to or unbound from a session.
HttpSessionContext | Deprecated. As of Java(tm) Servlet API 2.1 for security reasons, with no replacement.
HttpSessionListener | Implementations of this interface are notified of changes to the list of active sessions in a web application.

Class Summary
Cookie | Creates a cookie, a small amount of information sent by a servlet to a Web browser, saved by the browser, and later sent back to the server.
HttpServlet | Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site.
HttpServletRequestWrapper | Provides a convenient implementation of the HttpServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet.
HttpServletResponseWrapper | Provides a convenient implementation of the HttpServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet.
HttpSessionBindingEvent | Events of this type are either sent to an object that implements HttpSessionBindingListener when it is bound or unbound from a session, or to a HttpSessionAttributeListener that has been configured in the deployment descriptor when any attribute is bound, unbound or replaced in a session.
HttpSessionEvent | This is the class representing event notifications for changes to sessions within a web application.
HttpUtils | Deprecated. As of Java(tm) Servlet API 2.3.

Package javax.servlet.http Description

The javax.servlet.http package contains a number of classes and interfaces that describe and define the contracts between a servlet class running under the HTTP protocol and the runtime environment provided for an instance of such a class by a conforming servlet container.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.servlet.http Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.servlet.http

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.servlet.http.Cookie (implements java.lang.Cloneable)
    • java.util.EventObject (implements java.io.Serializable)
      • javax.servlet.http.HttpSessionEvent
        • javax.servlet.http.HttpSessionBindingEvent
    • javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig)
      • javax.servlet.http.HttpServlet (implements java.io.Serializable)
    • javax.servlet.http.HttpUtils
    • javax.servlet.ServletRequestWrapper (implements javax.servlet.ServletRequest)
      • javax.servlet.http.HttpServletRequestWrapper (implements javax.servlet.http.HttpServletRequest)
    • javax.servlet.ServletResponseWrapper (implements javax.servlet.ServletResponse)
      • javax.servlet.http.HttpServletResponseWrapper (implements javax.servlet.http.HttpServletResponse)

Interface Hierarchy

  • java.util.EventListener
    • javax.servlet.http.HttpSessionActivationListener
    • javax.servlet.http.HttpSessionAttributeListener
    • javax.servlet.http.HttpSessionBindingListener
    • javax.servlet.http.HttpSessionListener
  • javax.servlet.http.HttpSession
  • javax.servlet.http.HttpSessionContext
  • javax.servlet.ServletRequest
    • javax.servlet.http.HttpServletRequest
  • javax.servlet.ServletResponse
    • javax.servlet.http.HttpServletResponse
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


HttpServletRequest (Java EE 5)

javax.servlet.http
Interface HttpServletRequest

All Superinterfaces:
ServletRequest
All Known Implementing Classes:
HttpServletRequestWrapper
public interface HttpServletRequest
extends ServletRequest

Implements: ServletRequest
Implemented by: HttpServletRequestWrapper

扩展 javax.servlet.ServletRequest 接口，为 HTTP servlet 提供请求信息。

servlet 容器创建 HttpServletRequest 对象，并将该对象作为参数传递给 servlet 的 service 方法（doGet、doPost，等等）。

英文文档：

Extends the ServletRequest interface to provide request information for HTTP servlets.

The servlet container creates an HttpServletRequest object and passes it as an argument to the servlet's service methods (doGet, doPost, etc).

Author:
Various

Field Summary
static String | BASIC_AUTH String identifier for Basic authentication.
static String | CLIENT_CERT_AUTH String identifier for Client Certificate authentication.
static String | DIGEST_AUTH String identifier for Digest authentication.
static String | FORM_AUTH String identifier for Form authentication.
Method Summary
 String getAuthType()
Returns the name of the authentication scheme used to protect the servlet.
 String getContextPath()
Returns the portion of the request URI that indicates the context of the request.
 Cookie[] getCookies()
Returns an array containing all of the Cookie objects the client sent with this request.
 long getDateHeader(String name)
Returns the value of the specified request header as a long value that represents a Date object.
 String getHeader(String name)
Returns the value of the specified request header as a String.
 Enumeration getHeaderNames()
Returns an enumeration of all the header names this request contains.
 Enumeration getHeaders(String name)
Returns all the values of the specified request header as an Enumeration of String objects.
 int getIntHeader(String name)
Returns the value of the specified request header as an int.
 String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 String getPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request.
 String getPathTranslated()
Returns any extra path information after the servlet name but before the query string, and translates it to a real path.
 String getQueryString()
Returns the query string that is contained in the request URL after the path.
 String getRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
 String getRequestedSessionId()
Returns the session ID specified by the client.
 String getRequestURI()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
 StringBuffer getRequestURL()
Reconstructs the URL the client used to make the request.
 String getServletPath()
Returns the part of this request's URL that calls the servlet.
 HttpSession getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one.
 HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.
 Principal getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user.
 boolean isRequestedSessionIdFromCookie()
Checks whether the requested session ID came in as a cookie.
 boolean isRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead.
 boolean isRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL.
 boolean isRequestedSessionIdValid()
Checks whether the requested session ID is still valid.
 boolean isUserInRole(String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding

Field Detail

英文文档：

BASIC_AUTH

static final String BASIC_AUTH
String identifier for Basic authentication. Value "BASIC"

See Also:
Constant Field Values

英文文档：

FORM_AUTH

static final String FORM_AUTH
String identifier for Form authentication. Value "FORM"

See Also:
Constant Field Values

英文文档：

CLIENT_CERT_AUTH

static final String CLIENT_CERT_AUTH
String identifier for Client Certificate authentication. Value "CLIENT_CERT"

See Also:
Constant Field Values

英文文档：

DIGEST_AUTH

static final String DIGEST_AUTH
String identifier for Digest authentication. Value "DIGEST"

See Also:
Constant Field Values
Method Detail

public String getAuthType()
返回用于保护 servlet 的验证方案的名称。所有 servlet 容器都支持 basic、form 和 client certificate 验证，并且可能还支持 digest 验证。如果没有验证 servlet，则返回 null。

返回的值与 CGI 变量 AUTH_TYPE 的值相同。

return 返回静态成员 BASIC_AUTH、FORM_AUTH、CLIENT_CERT_AUTH、DIGEST_AUTH 之一（适用于 == 比较）或返回指示验证方案的特定于容器的字符串，如果没有验证请求，则返回 null。
英文文档：

getAuthType

String getAuthType()
Returns the name of the authentication scheme used to protect the servlet. All servlet containers support basic, form and client certificate authentication, and may additionally support digest authentication. If the servlet is not authenticated null is returned.

Same as the value of the CGI variable AUTH_TYPE.

Returns:
one of the static members BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) or the container-specific string indicating the authentication scheme, or null if the request was not authenticated.

public Cookie[] getCookies()
返回包含客户端随此请求一起发送的所有 Cookie 对象的数组。如果没有发送任何 cookie，则此方法返回 null。
return 此请求中包含的所有 Cookie 的数组，如果该请求没有 cookie，则返回 null
英文文档：

getCookies

Cookie[] getCookies()
Returns an array containing all of the Cookie objects the client sent with this request. This method returns null if no cookies were sent.

Returns:
an array of all the Cookies included with this request, or null if the request has no cookies

public long getDateHeader(String name)
以表示 Date 对象的 long 值的形式返回指定请求头的值。与包含日期的头（比如 If-Modified-Since）一起使用此方法。

返回的日期是自格林威治标准时间 1970 年 1 月 1 日起经过的毫秒数。头名称是不区分大小写的。

如果该请求没有指定名称的头，则此方法返回 -1。如果无法将头转换为日期，则该方法将抛出 IllegalArgumentException。

name | 指定头名称的 String
return | 表示头中指定的日期的 long 值，该日期被表示为自格林威治标准时间 1970 年 1 月 1 日起经过的毫秒数，如果请求中不包含指定的头，则返回 -1
Throws | IllegalArgumentException: 如果无法将头值转换为日期
英文文档：

getDateHeader

long getDateHeader(String name)
Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such as If-Modified-Since.

The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.

If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.

Parameters:
name - a String specifying the name of the header
Returns:
a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the request
Throws:
IllegalArgumentException - If the header value can't be converted to a date

public String getHeader(String name)
以 String 的形式返回指定请求头的值。如果该请求不包含指定名称的头，则此方法返回 null。如果有多个具有相同名称的头，则此方法返回请求中的第一个头。头名称是不区分大小写的。可以将此方法与任何请求头一起使用。
name | 指定头名称的 String
return | 包含请求头的值的 String，如果该请求没有该名称的头，则返回 null
英文文档：

getHeader

String getHeader(String name)
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first head in the request. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name

public java.util.Enumeration<E> getHeaders(String name)
以 String 对象的 Enumeration 的形式返回指定请求头的所有值。

一些头（比如 Accept-Language）能够以具有不同值的几个头的形式由客户端发送，而不采用以逗号分隔的列表的形式发送该头。

如果该请求不包含任何指定名称的头，则此方法返回一个空的 Enumeration。头名称是不区分大小写的。可以将此方法与任何请求头一起使用。

name | 指定头名称的 String
return | 包含请求头的值的 Enumeration。如果该请求不包含任何具有该名称的头，则返回一个空枚举。如果容器不允许访问头信息，则返回 null
英文文档：

getHeaders

Enumeration getHeaders(String name)
Returns all the values of the specified request header as an Enumeration of String objects.

Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.

If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null

public java.util.Enumeration<E> getHeaderNames()
返回此请求包含的所有头名称的枚举。如果该请求没有头，则此方法返回一个空枚举。

一些 servlet 容器不允许 servlet 使用此方法访问头，在这种情况下，此方法返回 null。

return 随此请求一起发送的所有头名称的枚举；如果该请求没有头，则返回一个空枚举；如果 servlet 容器不允许 servlet 使用此方法，则返回 null
英文文档：

getHeaderNames

Enumeration getHeaderNames()
Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration.

Some servlet containers do not allow servlets to access headers using this method, in which case this method returns null

Returns:
an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet container does not allow servlets to use this method, null

public int getIntHeader(String name)
以 int 的形式返回指定请求头的值。如果该请求没有指定名称的头，则此方法返回 -1。如果无法将头转换为整数，则此方法抛出 NumberFormatException。

头名称是不区分大小写的。

name | 指定请求头名称的 String
return | 表示请求头的值的整数，如果该请求没有此名称的头，则返回 -1
Throws | NumberFormatException: 如果无法将头值转换为 int
英文文档：

getIntHeader

int getIntHeader(String name)
Returns the value of the specified request header as an int. If the request does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException.

The header name is case insensitive.

Parameters:
name - a String specifying the name of a request header
Returns:
an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
Throws:
NumberFormatException - If the header value can't be converted to an int

public String getMethod()
返回用于发出此请求的 HTTP 方法的名称，例如 GET、POST 或 PUT。返回的值与 CGI 变量 REQUEST_METHOD 的值相同。
return 指定用于发出此请求的方法名称的 String
英文文档：

getMethod

String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. Same as the value of the CGI variable REQUEST_METHOD.

Returns:
a String specifying the name of the method with which this request was made

public String getPathInfo()
返回与客户端发出此请求时发送的 URL 相关联的额外路径信息。额外路径信息位于 servlet 路径之后但在查询字符串之前，并且将以 "/" 字符开头。

如果没有额外路径信息，则此方法返回 null。

返回的值与 CGI 变量 PATH_INFO 的值相同。

return 由 Web 容器解码的 String，用于指定额外路径信息，这些信息在请求 URL 中跟随在 servlet 路径之后但在查询字符串之前；如果该 URL 没有任何额外路径信息，则返回 null
英文文档：

getPathInfo

String getPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string and will start with a "/" character.

This method returns null if there was no extra path information.

Same as the value of the CGI variable PATH_INFO.

Returns:
a String, decoded by the web container, specifying extra path information that comes after the servlet path but before the query string in the request URL; or null if the URL does not have any extra path information

public String getPathTranslated()
返回在 servlet 名称之后但在查询字符串之前的额外路径信息，并将它转换为实际路径。返回的值与 CGI 变量 PATH_TRANSLATED 的值相同。

如果 URL 没有任何额外路径信息，则此方法返回 null，或者 servlet 容器因为某种原因（比如当从归档文件执行 Web 应用程序时）无法将虚拟路径转换为实际路径。 Web 容器不会解码此字符串。

return 指定实际路径的 String，如果 URL 没有额外路径信息，则返回 null
英文文档：

getPathTranslated

String getPathTranslated()
Returns any extra path information after the servlet name but before the query string, and translates it to a real path. Same as the value of the CGI variable PATH_TRANSLATED.

If the URL does not have any extra path information, this method returns null or the servlet container cannot translate the virtual path to a real path for any reason (such as when the web application is executed from an archive). The web container does not decode this string.

Returns:
a String specifying the real path, or null if the URL does not have any extra path information

public String getContextPath()
返回请求 URI 指示请求上下文的那一部分。请求 URI 中首先出现的总是上下文路径。路径以 "/" 字符开头但不以 "/" 字符结束。对于默认（根）上下文中的 servlet，此方法返回 ""。容器不会解码此字符串。

servlet 容器可能通过多个上下文路径匹配一个上下文。在这种情况下，此方法将返回该请求使用的实际上下文路径，该路径可能不同于 getContextPath() 方法返回的路径。getContextPath() 返回的上下文路径应该被认为是应用程序的主要或首选上下文路径。

return | 指定请求 URI 指示请求上下文的那一部分的 String
See also | getContextPath()
英文文档：

getContextPath

String getContextPath()
Returns the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. For servlets in the default (root) context, this method returns "". The container does not decode this string.

It is possible that a servlet container may match a context by more than one context path. In such cases this method will return the actual context path used by the request and it may differ from the path returned by the ServletContext.getContextPath() method. The context path returned by ServletContext.getContextPath() should be considered as the prime or preferred context path of the application.

Returns:
a String specifying the portion of the request URI that indicates the context of the request
See Also:
ServletContext.getContextPath()

public String getQueryString()
返回包含在请求 URL 中路径后面的查询字符串。如果 URL 没有查询字符串，则此方法返回 null。返回的值与 CGI 变量 QUERY_STRING 的值相同。
return 包含查询字符串的 String，如果 URL 不包含任何查询字符串，则返回 null。该值不由容器解码。
英文文档：

getQueryString

String getQueryString()
Returns the query string that is contained in the request URL after the path. This method returns null if the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING.

Returns:
a String containing the query string or null if the URL contains no query string. The value is not decoded by the container.

public String getRemoteUser()
如果用户已经过验证，则返回发出此请求的用户的登录信息，如果用户未经过验证，则返回 null。用户名是否随每个后续请求发送取决于浏览器和验证类型。返回的值与 CGI 变量 REMOTE_USER 的值相同。
return 指定发出此请求的用户的登录信息的 String，如果用户登录信息未知，则返回 null
英文文档：

getRemoteUser

String getRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER.

Returns:
a String specifying the login of the user making this request, or null if the user login is not known

public boolean isUserInRole(String role)
返回一个 boolean 值，指示指定的逻辑“角色”中是否包含经过验证的用户。角色和角色成员关系可使用部署描述符定义。如果用户没有经过验证，则该方法返回 false。
role | 指定角色名称的 String
return | 一个 boolean 值，指示发出此请求的用户是否属于给定角色；如果用户未经过验证，则返回 false
英文文档：

isUserInRole

boolean isUserInRole(String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returns false.

Parameters:
role - a String specifying the name of the role
Returns:
a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated

public java.security.Principal getUserPrincipal()
返回包含当前已经过验证的用户的名称的 java.security.Principal 对象。如果用户没有经过验证，则该方法返回 null。
return 包含发出此请求的用户的名称的 java.security.Principal；如果用户没有经过验证，则返回 null
英文文档：

getUserPrincipal

Principal getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null.

Returns:
a java.security.Principal containing the name of the user making this request; null if the user has not been authenticated

public String getRequestedSessionId()
返回客户端指定的会话 ID。此值可能不同于此请求的当前有效会话的 ID。如果客户端没有指定会话 ID，则此方法返回 null。
return | 指定会话 ID 的 String，如果该请求没有指定会话 ID，则返回 null
See also | isRequestedSessionIdValid
英文文档：

getRequestedSessionId

String getRequestedSessionId()
Returns the session ID specified by the client. This may not be the same as the ID of the current valid session for this request. If the client did not specify a session ID, this method returns null.

Returns:
a String specifying the session ID, or null if the request did not specify a session ID
See Also:
isRequestedSessionIdValid()

public String getRequestURI()
返回此请求的 URL 的一部分，从协议名称一直到 HTTP 请求的第一行中的查询字符串。Web 容器不会解码此 String。例如：
HTTP 请求的第一行 | 返回的值
POST /some/path.html HTTP/1.1 |  | /some/path.html
GET http://foo.bar/a.html HTTP/1.0 |  | /a.html
HEAD /xyz?a=b HTTP/1.1 |  | /xyz

要使用某个方案和主机重新构造 URL，可使用 HttpUtils#getRequestURL。

return | 包含 URL 从协议名称一直到查询字符串的那一部分的 String
See also | getRequestURL
英文文档：

getRequestURI

String getRequestURI()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. The web container does not decode this String. For example:
First line of HTTP request | Returned Value
POST /some/path.html HTTP/1.1 | /some/path.html
GET http://foo.bar/a.html HTTP/1.0 | /a.html
HEAD /xyz?a=b HTTP/1.1 | /xyz

To reconstruct an URL with a scheme and host, use HttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest).

Returns:
a String containing the part of the URL from the protocol name up to the query string
See Also:
HttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)

public StringBuffer getRequestURL()
重新构造客户端用于发出请求的 URL。返回的 URL 包含一个协议、服务器名称、端口号、服务器路径，但是不包含查询字符串参数。

如果已经使用 javax.servlet.RequestDispatcher#forward 转发了此请求，则重新构造的 URL 中的服务器路径必须反映用于获取 RequestDispatcher 的路径，而不是客户端指定的服务器路径。

因为此方法返回 StringBuffer 而不是字符串，所以可以轻松地修改 URL，例如，可以追加查询参数。

此方法对于创建重定向消息和报告错误很有用。

return 包含重新构造的 URL 的 StringBuffer 对象
英文文档：

getRequestURL

StringBuffer getRequestURL()
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

If this request has been forwarded using RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse), the server path in the reconstructed URL must reflect the path used to obtain the RequestDispatcher, and not the server path specified by the client.

Because this method returns a StringBuffer, not a string, you can modify the URL easily, for example, to append query parameters.

This method is useful for creating redirect messages and for reporting errors.

Returns:
a StringBuffer object containing the reconstructed URL

public String getServletPath()
返回此请求调用 servlet 的 URL 部分。此路径以 "/" 字符开头，包括 servlet 名称或到 servlet 的路径，但不包括任何额外路径信息或查询字符串。返回的值与 CGI 变量 SCRIPT_NAME 的值相同。

如果用于处理此请求的 servlet 使用 "/*" 模式实现匹配，则此方法将返回一个空字符串 ("")。

return 包含将被调用或解码的 servlet 的名称或路径的 String（如请求 URL 中指定的那样），如果用于处理请求的 servlet 使用 "/*" 模式实现匹配，则返回一个空字符串。
英文文档：

getServletPath

String getServletPath()
Returns the part of this request's URL that calls the servlet. This path starts with a "/" character and includes either the servlet name or a path to the servlet, but does not include any extra path information or a query string. Same as the value of the CGI variable SCRIPT_NAME.

This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern.

Returns:
a String containing the name or path of the servlet being called, as specified in the request URL, decoded, or an empty string if the servlet used to process the request is matched using the "/*" pattern.

public HttpSession getSession(boolean create)
返回与此请求关联的当前 HttpSession，如果没有当前会话并且 create 为 true，则返回一个新会话。

如果 create 为 false 并且该请求没有有效的 HttpSession，则此方法返回 null。

要确保会话得到适当维护，必须在提交响应之前调用此方法。如果容器正使用 cookie 维护会话完整性，并被要求在提交响应时创建新会话，则抛出 IllegalStateException。

create | true 表示为此请求创建一个新会话（如有必要）；false 表示返回 null（如果没有当前会话）
return | 与此请求关联的 HttpSession，如果 create 为 false，并且该请求没有有效会话，则返回 null
See also | getSession()
英文文档：

getSession

HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.

If create is false and the request has no valid HttpSession, this method returns null.

To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create a new session when the response is committed, an IllegalStateException is thrown.

Parameters:
create - true to create a new session for this request if necessary; false to return null if there's no current session
Returns:
the HttpSession associated with this request or null if create is false and the request has no valid session
See Also:
getSession()

public HttpSession getSession()
返回与此请求关联的当前会话，如果该请求没有会话，则创建一个会话。
return | 与此请求关联的 HttpSession
See also | getSession(boolean)
英文文档：

getSession

HttpSession getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one.

Returns:
the HttpSession associated with this request
See Also:
getSession(boolean)

public boolean isRequestedSessionIdValid()
检查请求的会话 ID 是否仍然有效。

如果客户端没有指定任何会话 ID，则此方法返回 false。

return | 如果此请求在当前会话上下文中有一个有效会话 id，则返回 true；否则返回 false
See also | getRequestedSessionId, getSession, javax.servlet.http.HttpSessionContext
英文文档：

isRequestedSessionIdValid

boolean isRequestedSessionIdValid()
Checks whether the requested session ID is still valid.

If the client did not specify any session ID, this method returns false.

Returns:
true if this request has an id for a valid session in the current session context; false otherwise
See Also:
getRequestedSessionId(), getSession(boolean), HttpSessionContext

public boolean isRequestedSessionIdFromCookie()
检查请求的会话 ID 是否是作为 cookie 进入的。
return | 如果会话 ID 是作为 cookie 进入的，则返回 true；否则返回 false
See also | getSession
英文文档：

isRequestedSessionIdFromCookie

boolean isRequestedSessionIdFromCookie()
Checks whether the requested session ID came in as a cookie.

Returns:
true if the session ID came in as a cookie; otherwise, false
See Also:
getSession(boolean)

public boolean isRequestedSessionIdFromURL()
检查请求的会话 ID 是否是作为请求 URL 的一部分进入的。
return | 如果会话 ID 是作为 URL 的一部分进入的，则返回 true；否则返回 false
See also | getSession
英文文档：

isRequestedSessionIdFromURL

boolean isRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL.

Returns:
true if the session ID came in as part of a URL; otherwise, false
See Also:
getSession(boolean)

public boolean isRequestedSessionIdFromUrl()
deprecated 从 Java Servlet API 的版本 2.1 起，请改用 #isRequestedSessionIdFromURL。
英文文档：

isRequestedSessionIdFromUrl

boolean isRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpServletResponse (Java EE 5)

javax.servlet.http
Interface HttpServletResponse

All Superinterfaces:
ServletResponse
All Known Implementing Classes:
HttpServletResponseWrapper
public interface HttpServletResponse
extends ServletResponse

Implements: ServletResponse
Implemented by: HttpServletResponseWrapper

扩展 ServletResponse 接口以提供特定于 HTTP 的发送响应功能。例如，该接口拥有访问 HTTP 头和 cookie 的方法。

servlet 容器创建 HttpServletResponse 对象，并将该对象作为参数传递给 servlet 的 service 方法（doGet、doPost，等等）。

See also javax.servlet.ServletResponse
英文文档：

Extends the ServletResponse interface to provide HTTP-specific functionality in sending a response. For example, it has methods to access HTTP headers and cookies.

The servlet container creates an HttpServletResponse object and passes it as an argument to the servlet's service methods (doGet, doPost, etc).

Author:
Various
See Also:
ServletResponse

Field Summary
static int | SC_ACCEPTED Status code (202) indicating that a request was accepted for processing, but was not completed.
static int | SC_BAD_GATEWAY Status code (502) indicating that the HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.
static int | SC_BAD_REQUEST Status code (400) indicating the request sent by the client was syntactically incorrect.
static int | SC_CONFLICT Status code (409) indicating that the request could not be completed due to a conflict with the current state of the resource.
static int | SC_CONTINUE Status code (100) indicating the client can continue.
static int | SC_CREATED Status code (201) indicating the request succeeded and created a new resource on the server.
static int | SC_EXPECTATION_FAILED Status code (417) indicating that the server could not meet the expectation given in the Expect request header.
static int | SC_FORBIDDEN Status code (403) indicating the server understood the request but refused to fulfill it.
static int | SC_FOUND Status code (302) indicating that the resource reside temporarily under a different URI.
static int | SC_GATEWAY_TIMEOUT Status code (504) indicating that the server did not receive a timely response from the upstream server while acting as a gateway or proxy.
static int | SC_GONE Status code (410) indicating that the resource is no longer available at the server and no forwarding address is known.
static int | SC_HTTP_VERSION_NOT_SUPPORTED Status code (505) indicating that the server does not support or refuses to support the HTTP protocol version that was used in the request message.
static int | SC_INTERNAL_SERVER_ERROR Status code (500) indicating an error inside the HTTP server which prevented it from fulfilling the request.
static int | SC_LENGTH_REQUIRED Status code (411) indicating that the request cannot be handled without a defined Content-Length.
static int | SC_METHOD_NOT_ALLOWED Status code (405) indicating that the method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
static int | SC_MOVED_PERMANENTLY Status code (301) indicating that the resource has permanently moved to a new location, and that future references should use a new URI with their requests.
static int | SC_MOVED_TEMPORARILY Status code (302) indicating that the resource has temporarily moved to another location, but that future references should still use the original URI to access the resource.
static int | SC_MULTIPLE_CHOICES Status code (300) indicating that the requested resource corresponds to any one of a set of representations, each with its own specific location.
static int | SC_NO_CONTENT Status code (204) indicating that the request succeeded but that there was no new information to return.
static int | SC_NON_AUTHORITATIVE_INFORMATION Status code (203) indicating that the meta information presented by the client did not originate from the server.
static int | SC_NOT_ACCEPTABLE Status code (406) indicating that the resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
static int | SC_NOT_FOUND Status code (404) indicating that the requested resource is not available.
static int | SC_NOT_IMPLEMENTED Status code (501) indicating the HTTP server does not support the functionality needed to fulfill the request.
static int | SC_NOT_MODIFIED Status code (304) indicating that a conditional GET operation found that the resource was available and not modified.
static int | SC_OK Status code (200) indicating the request succeeded normally.
static int | SC_PARTIAL_CONTENT Status code (206) indicating that the server has fulfilled the partial GET request for the resource.
static int | SC_PAYMENT_REQUIRED Status code (402) reserved for future use.
static int | SC_PRECONDITION_FAILED Status code (412) indicating that the precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.
static int | SC_PROXY_AUTHENTICATION_REQUIRED Status code (407) indicating that the client MUST first authenticate itself with the proxy.
static int | SC_REQUEST_ENTITY_TOO_LARGE Status code (413) indicating that the server is refusing to process the request because the request entity is larger than the server is willing or able to process.
static int | SC_REQUEST_TIMEOUT Status code (408) indicating that the client did not produce a request within the time that the server was prepared to wait.
static int | SC_REQUEST_URI_TOO_LONG Status code (414) indicating that the server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.
static int | SC_REQUESTED_RANGE_NOT_SATISFIABLE Status code (416) indicating that the server cannot serve the requested byte range.
static int | SC_RESET_CONTENT Status code (205) indicating that the agent SHOULD reset the document view which caused the request to be sent.
static int | SC_SEE_OTHER Status code (303) indicating that the response to the request can be found under a different URI.
static int | SC_SERVICE_UNAVAILABLE Status code (503) indicating that the HTTP server is temporarily overloaded, and unable to handle the request.
static int | SC_SWITCHING_PROTOCOLS Status code (101) indicating the server is switching protocols according to Upgrade header.
static int | SC_TEMPORARY_REDIRECT Status code (307) indicating that the requested resource resides temporarily under a different URI.
static int | SC_UNAUTHORIZED Status code (401) indicating that the request requires HTTP authentication.
static int | SC_UNSUPPORTED_MEDIA_TYPE Status code (415) indicating that the server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
static int | SC_USE_PROXY Status code (305) indicating that the requested resource MUST be accessed through the proxy given by the Location field.
Method Summary
 void addCookie(Cookie cookie)
Adds the specified cookie to the response.
 void addDateHeader(String name, long date)
Adds a response header with the given name and date-value.
 void addHeader(String name, String value)
Adds a response header with the given name and value.
 void addIntHeader(String name, int value)
Adds a response header with the given name and integer value.
 boolean containsHeader(String name)
Returns a boolean indicating whether the named response header has already been set.
 String encodeRedirectUrl(String url)
Deprecated. As of version 2.1, use encodeRedirectURL(String url) instead
 String encodeRedirectURL(String url)
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged.
 String encodeUrl(String url)
Deprecated. As of version 2.1, use encodeURL(String url) instead
 String encodeURL(String url)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
 void sendError(int sc)
Sends an error response to the client using the specified status code and clearing the buffer.
 void sendError(int sc, String msg)
Sends an error response to the client using the specified status.
 void sendRedirect(String location)
Sends a temporary redirect response to the client using the specified redirect location URL.
 void setDateHeader(String name, long date)
Sets a response header with the given name and date-value.
 void setHeader(String name, String value)
Sets a response header with the given name and value.
 void setIntHeader(String name, int value)
Sets a response header with the given name and integer value.
 void setStatus(int sc)
Sets the status code for this response.
 void setStatus(int sc, String sm)
Deprecated. As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use setStatus(int), to send an error with a description use sendError(int, String). Sets the status code and message for this response.
Methods inherited from interface javax.servlet.ServletResponse
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale

Field Detail

英文文档：

SC_CONTINUE

static final int SC_CONTINUE
Status code (100) indicating the client can continue.

See Also:
Constant Field Values

英文文档：

SC_SWITCHING_PROTOCOLS

static final int SC_SWITCHING_PROTOCOLS
Status code (101) indicating the server is switching protocols according to Upgrade header.

See Also:
Constant Field Values

英文文档：

SC_OK

static final int SC_OK
Status code (200) indicating the request succeeded normally.

See Also:
Constant Field Values

英文文档：

SC_CREATED

static final int SC_CREATED
Status code (201) indicating the request succeeded and created a new resource on the server.

See Also:
Constant Field Values

英文文档：

SC_ACCEPTED

static final int SC_ACCEPTED
Status code (202) indicating that a request was accepted for processing, but was not completed.

See Also:
Constant Field Values

英文文档：

SC_NON_AUTHORITATIVE_INFORMATION

static final int SC_NON_AUTHORITATIVE_INFORMATION
Status code (203) indicating that the meta information presented by the client did not originate from the server.

See Also:
Constant Field Values

英文文档：

SC_NO_CONTENT

static final int SC_NO_CONTENT
Status code (204) indicating that the request succeeded but that there was no new information to return.

See Also:
Constant Field Values

英文文档：

SC_RESET_CONTENT

static final int SC_RESET_CONTENT
Status code (205) indicating that the agent SHOULD reset the document view which caused the request to be sent.

See Also:
Constant Field Values

英文文档：

SC_PARTIAL_CONTENT

static final int SC_PARTIAL_CONTENT
Status code (206) indicating that the server has fulfilled the partial GET request for the resource.

See Also:
Constant Field Values

英文文档：

SC_MULTIPLE_CHOICES

static final int SC_MULTIPLE_CHOICES
Status code (300) indicating that the requested resource corresponds to any one of a set of representations, each with its own specific location.

See Also:
Constant Field Values

英文文档：

SC_MOVED_PERMANENTLY

static final int SC_MOVED_PERMANENTLY
Status code (301) indicating that the resource has permanently moved to a new location, and that future references should use a new URI with their requests.

See Also:
Constant Field Values

英文文档：

SC_MOVED_TEMPORARILY

static final int SC_MOVED_TEMPORARILY
Status code (302) indicating that the resource has temporarily moved to another location, but that future references should still use the original URI to access the resource. This definition is being retained for backwards compatibility. SC_FOUND is now the preferred definition.

See Also:
Constant Field Values

英文文档：

SC_FOUND

static final int SC_FOUND
Status code (302) indicating that the resource reside temporarily under a different URI. Since the redirection might be altered on occasion, the client should continue to use the Request-URI for future requests.(HTTP/1.1) To represent the status code (302), it is recommended to use this variable.

See Also:
Constant Field Values

英文文档：

SC_SEE_OTHER

static final int SC_SEE_OTHER
Status code (303) indicating that the response to the request can be found under a different URI.

See Also:
Constant Field Values

英文文档：

SC_NOT_MODIFIED

static final int SC_NOT_MODIFIED
Status code (304) indicating that a conditional GET operation found that the resource was available and not modified.

See Also:
Constant Field Values

英文文档：

SC_USE_PROXY

static final int SC_USE_PROXY
Status code (305) indicating that the requested resource MUST be accessed through the proxy given by the Location field.

See Also:
Constant Field Values

英文文档：

SC_TEMPORARY_REDIRECT

static final int SC_TEMPORARY_REDIRECT
Status code (307) indicating that the requested resource resides temporarily under a different URI. The temporary URI SHOULD be given by the Location field in the response.

See Also:
Constant Field Values

英文文档：

SC_BAD_REQUEST

static final int SC_BAD_REQUEST
Status code (400) indicating the request sent by the client was syntactically incorrect.

See Also:
Constant Field Values

英文文档：

SC_UNAUTHORIZED

static final int SC_UNAUTHORIZED
Status code (401) indicating that the request requires HTTP authentication.

See Also:
Constant Field Values

英文文档：

SC_PAYMENT_REQUIRED

static final int SC_PAYMENT_REQUIRED
Status code (402) reserved for future use.

See Also:
Constant Field Values

英文文档：

SC_FORBIDDEN

static final int SC_FORBIDDEN
Status code (403) indicating the server understood the request but refused to fulfill it.

See Also:
Constant Field Values

英文文档：

SC_NOT_FOUND

static final int SC_NOT_FOUND
Status code (404) indicating that the requested resource is not available.

See Also:
Constant Field Values

英文文档：

SC_METHOD_NOT_ALLOWED

static final int SC_METHOD_NOT_ALLOWED
Status code (405) indicating that the method specified in the Request-Line is not allowed for the resource identified by the Request-URI.

See Also:
Constant Field Values

英文文档：

SC_NOT_ACCEPTABLE

static final int SC_NOT_ACCEPTABLE
Status code (406) indicating that the resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

See Also:
Constant Field Values

英文文档：

SC_PROXY_AUTHENTICATION_REQUIRED

static final int SC_PROXY_AUTHENTICATION_REQUIRED
Status code (407) indicating that the client MUST first authenticate itself with the proxy.

See Also:
Constant Field Values

英文文档：

SC_REQUEST_TIMEOUT

static final int SC_REQUEST_TIMEOUT
Status code (408) indicating that the client did not produce a request within the time that the server was prepared to wait.

See Also:
Constant Field Values

英文文档：

SC_CONFLICT

static final int SC_CONFLICT
Status code (409) indicating that the request could not be completed due to a conflict with the current state of the resource.

See Also:
Constant Field Values

英文文档：

SC_GONE

static final int SC_GONE
Status code (410) indicating that the resource is no longer available at the server and no forwarding address is known. This condition SHOULD be considered permanent.

See Also:
Constant Field Values

英文文档：

SC_LENGTH_REQUIRED

static final int SC_LENGTH_REQUIRED
Status code (411) indicating that the request cannot be handled without a defined Content-Length.

See Also:
Constant Field Values

英文文档：

SC_PRECONDITION_FAILED

static final int SC_PRECONDITION_FAILED
Status code (412) indicating that the precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.

See Also:
Constant Field Values

英文文档：

SC_REQUEST_ENTITY_TOO_LARGE

static final int SC_REQUEST_ENTITY_TOO_LARGE
Status code (413) indicating that the server is refusing to process the request because the request entity is larger than the server is willing or able to process.

See Also:
Constant Field Values

英文文档：

SC_REQUEST_URI_TOO_LONG

static final int SC_REQUEST_URI_TOO_LONG
Status code (414) indicating that the server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.

See Also:
Constant Field Values

英文文档：

SC_UNSUPPORTED_MEDIA_TYPE

static final int SC_UNSUPPORTED_MEDIA_TYPE
Status code (415) indicating that the server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.

See Also:
Constant Field Values

英文文档：

SC_REQUESTED_RANGE_NOT_SATISFIABLE

static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE
Status code (416) indicating that the server cannot serve the requested byte range.

See Also:
Constant Field Values

英文文档：

SC_EXPECTATION_FAILED

static final int SC_EXPECTATION_FAILED
Status code (417) indicating that the server could not meet the expectation given in the Expect request header.

See Also:
Constant Field Values

英文文档：

SC_INTERNAL_SERVER_ERROR

static final int SC_INTERNAL_SERVER_ERROR
Status code (500) indicating an error inside the HTTP server which prevented it from fulfilling the request.

See Also:
Constant Field Values

英文文档：

SC_NOT_IMPLEMENTED

static final int SC_NOT_IMPLEMENTED
Status code (501) indicating the HTTP server does not support the functionality needed to fulfill the request.

See Also:
Constant Field Values

英文文档：

SC_BAD_GATEWAY

static final int SC_BAD_GATEWAY
Status code (502) indicating that the HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.

See Also:
Constant Field Values

英文文档：

SC_SERVICE_UNAVAILABLE

static final int SC_SERVICE_UNAVAILABLE
Status code (503) indicating that the HTTP server is temporarily overloaded, and unable to handle the request.

See Also:
Constant Field Values

英文文档：

SC_GATEWAY_TIMEOUT

static final int SC_GATEWAY_TIMEOUT
Status code (504) indicating that the server did not receive a timely response from the upstream server while acting as a gateway or proxy.

See Also:
Constant Field Values

英文文档：

SC_HTTP_VERSION_NOT_SUPPORTED

static final int SC_HTTP_VERSION_NOT_SUPPORTED
Status code (505) indicating that the server does not support or refuses to support the HTTP protocol version that was used in the request message.

See Also:
Constant Field Values
Method Detail

public void addCookie(Cookie cookie)
将指定 cookie 添加到响应。可多次调用此方法设置一个以上的 cookie。
cookie 要返回给客户端的 Cookie
英文文档：

addCookie

void addCookie(Cookie cookie)
Adds the specified cookie to the response. This method can be called multiple times to set more than one cookie.

Parameters:
cookie - the Cookie to return to the client

public boolean containsHeader(String name)
返回一个 boolean 值，指示是否已经设置指定的响应头。
name | 头名称
return | 如果已经设置指定的响应头，则返回 true；否则返回 false
英文文档：

containsHeader

boolean containsHeader(String name)
Returns a boolean indicating whether the named response header has already been set.

Parameters:
name - the header name
Returns:
true if the named response header has already been set; false otherwise

public String encodeURL(String url)
通过将会话 ID 包含在指定 URL 中对该 URL 进行编码，如果不需要编码，则返回未更改的 URL。此方法的实现包含可以确定会话 ID 是否需要在 URL 中编码的逻辑。例如，如果浏览器支持 cookie，或者关闭了会话跟踪，则 URL 编码就不是必需的。

对于健壮的会话跟踪，servlet 发出的所有 URL 都应该通过此方法运行。否则，URL 重写不能用于不支持 cookie 的浏览器。

url | 要编码的 URL。
return | 如果需要编码，则返回编码的 URL；否则返回未更改的 URL。
英文文档：

encodeURL

String encodeURL(String url)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.

For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.

Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.

public String encodeRedirectURL(String url)
对指定 URL 进行编码，以便在 sendRedirect 方法中使用它，如果不需要编码，则返回未更改的 URL。此方法的实现包含可以确定会话 ID 是否需要在 URL 中编码的逻辑。因为进行此确定的规则可能不同于用来确定是否对普通链接进行编码的规则，所以此方法与 encodeURL 方法是分开的。

发送到 HttpServletResponse.sendRedirect 方法的所有 URL 都应该通过此方法运行。否则，URL 重写不能用于不支持 cookie 的浏览器。

url | 要编码的 URL。
return | 如果需要编码，则返回编码的 URL；否则返回未更改的 URL。
See also | sendRedirect, encodeUrl
英文文档：

encodeRedirectURL

String encodeRedirectURL(String url)
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination can differ from those used to decide whether to encode a normal link, this method is separated from the encodeURL method.

All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.

Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.
See Also:
sendRedirect(java.lang.String), encodeUrl(java.lang.String)

public String encodeUrl(String url)
deprecated | 从版本 2.1 起，请改用 encodeURL(String url)
url | 要编码的 URL。
return | 如果需要编码，则返回编码的 URL；否则返回未更改的 URL。
英文文档：

encodeUrl

String encodeUrl(String url)
Deprecated. As of version 2.1, use encodeURL(String url) instead

Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.

public String encodeRedirectUrl(String url)
deprecated | 从版本 2.1 起，请改用 encodeRedirectURL(String url)
url | 要编码的 URL。
return | 如果需要编码，则返回编码的 URL；否则返回未更改的 URL。
英文文档：

encodeRedirectUrl

String encodeRedirectUrl(String url)
Deprecated. As of version 2.1, use encodeRedirectURL(String url) instead

Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.

public void sendError(int sc, String msg) throws java.io.IOException
使用指定状态将错误响应发送到客户端。默认情况下，服务器将创建类似 HTML 格式的服务器错误页面的响应，该页面包含指定消息，内容类型设置为 "text/html"，并且保持 cookie 和其他头不变。 如果已经对 Web 应用程序进行了对应于传入状态代码的错误页面声明，则将优先处理建议的 msg 参数。

如果已经提交了响应，则此方法抛出 IllegalStateException。使用此方法后，响应应该被视为已经被提交，不能再写入。

sc | 错误状态代码
msg | 描述性消息
Throws | java.io.IOException: 如果发生输入或输出异常
Throws | IllegalStateException: 如果提交了响应
英文文档：

sendError

void sendError(int sc,
               String msg)
               throws IOException
Sends an error response to the client using the specified status. The server defaults to creating the response to look like an HTML-formatted server error page containing the specified message, setting the content type to "text/html", leaving cookies and other headers unmodified. If an error-page declaration has been made for the web application corresponding to the status code passed in, it will be served back in preference to the suggested msg parameter.

If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.

Parameters:
sc - the error status code
msg - the descriptive message
Throws:
IOException - If an input or output exception occurs
IllegalStateException - If the response was committed

public void sendError(int sc) throws java.io.IOException
使用指定状态代码并清除缓冲区将错误响应发送到客户端。

如果已经提交了响应，则此方法抛出 IllegalStateException。使用此方法后，响应应该被视为已经被提交，不能再写入。

sc | 错误状态代码
Throws | java.io.IOException: 如果发生输入或输出异常
Throws | IllegalStateException: 如果在此方法调用之前提交了响应
英文文档：

sendError

void sendError(int sc)
               throws IOException
Sends an error response to the client using the specified status code and clearing the buffer.

If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.

Parameters:
sc - the error status code
Throws:
IOException - If an input or output exception occurs
IllegalStateException - If the response was committed before this method call

public void sendRedirect(String location) throws java.io.IOException
使用指定重定向位置 URL 将临时重定向响应发送到客户端。此方法可以接受相对 URL；servlet 容器必须在将响应发送到客户端之前将相对 URL 转换为绝对 URL。如果位置是相对的，没有前导 '/'，则容器将相对于当前请求 URI 对其进行解释。如果位置是相对的，有一个前导 '/'，则容器将相对于 servlet 容器根对其进行解释。

如果已经提交了响应，则此方法抛出 IllegalStateException。使用此方法后，响应应该被视为已经被提交，不能再写入。

location | 重定向位置 URL
Throws | java.io.IOException: 如果发生输入或输出异常
Throws | IllegalStateException: 如果提交了响应，或者部分 URL 是给定的且无法将其转换为有效 URL
英文文档：

sendRedirect

void sendRedirect(String location)
                  throws IOException
Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root.

If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.

Parameters:
location - the redirect location URL
Throws:
IOException - If an input or output exception occurs
IllegalStateException - If the response was committed or if a partial URL is given and cannot be converted into a valid URL

public void setDateHeader(String name, long date)
用给定名称和日期值设置响应头。该日期根据距历元时间的毫秒数指定。如果已经设置了头，则新值将重写以前的值。containsHeader 方法可用于测试在设置其值之前头是否存在。
name | 要设置的头的名称
date | 指定的日期值
See also | containsHeader, addDateHeader
英文文档：

setDateHeader

void setDateHeader(String name,
                   long date)
Sets a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.

Parameters:
name - the name of the header to set
date - the assigned date value
See Also:
containsHeader(java.lang.String), addDateHeader(java.lang.String, long)

public void addDateHeader(String name, long date)
用给定名称和日期值添加响应头。该日期根据距历元时间的毫秒数指定。此方法允许响应头有多个值。
name | 要设置的头的名称
date | 附加的日期值
See also | setDateHeader
英文文档：

addDateHeader

void addDateHeader(String name,
                   long date)
Adds a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. This method allows response headers to have multiple values.

Parameters:
name - the name of the header to set
date - the additional date value
See Also:
setDateHeader(java.lang.String, long)

public void setHeader(String name, String value)
用给定名称和值设置响应头。如果已经设置了头，则新值将重写以前的值。containsHeader 方法可用于测试在设置其值之前头是否存在。
name | 头的名称
value | 头值，如果该值包含八位字节字符串，则应该根据 RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt) 对其进行编码
See also | containsHeader, addHeader
英文文档：

setHeader

void setHeader(String name,
               String value)
Sets a response header with the given name and value. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.

Parameters:
name - the name of the header
value - the header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
See Also:
containsHeader(java.lang.String), addHeader(java.lang.String, java.lang.String)

public void addHeader(String name, String value)
用给定名称和值添加响应头。此方法允许响应头有多个值。
name | 头的名称
value | 附加的头值，如果该值包含八位字节字符串，则应该根据 RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt) 对其进行编码
See also | setHeader
英文文档：

addHeader

void addHeader(String name,
               String value)
Adds a response header with the given name and value. This method allows response headers to have multiple values.

Parameters:
name - the name of the header
value - the additional header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
See Also:
setHeader(java.lang.String, java.lang.String)

public void setIntHeader(String name, int value)
用给定名称和整数值设置响应头。如果已经设置了头，则新值将重写以前的值。containsHeader 方法可用于测试在设置其值之前头是否存在。
name | 头的名称
value | 指定的整数值
See also | containsHeader, addIntHeader
英文文档：

setIntHeader

void setIntHeader(String name,
                  int value)
Sets a response header with the given name and integer value. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.

Parameters:
name - the name of the header
value - the assigned integer value
See Also:
containsHeader(java.lang.String), addIntHeader(java.lang.String, int)

public void addIntHeader(String name, int value)
用给定名称和整数值添加响应头。此方法允许响应头有多个值。
name | 头的名称
value | 指定的整数值
See also | setIntHeader
英文文档：

addIntHeader

void addIntHeader(String name,
                  int value)
Adds a response header with the given name and integer value. This method allows response headers to have multiple values.

Parameters:
name - the name of the header
value - the assigned integer value
See Also:
setIntHeader(java.lang.String, int)

public void setStatus(int sc)
设置此响应的状态代码。此方法用于设置没有错误时的返回状态代码（例如状态代码 SC_OK 或 SC_MOVED_TEMPORARILY）。如果有错误，并且调用者希望调用 Web 应用程序中定义的错误页面，则应改用 sendError 方法。

容器清除缓冲区，设置 Location 头，并保留 cookie 和其他头。

sc | 状态代码
See also | sendError
英文文档：

setStatus

void setStatus(int sc)
Sets the status code for this response. This method is used to set the return status code when there is no error (for example, for the status codes SC_OK or SC_MOVED_TEMPORARILY). If there is an error, and the caller wishes to invoke an error-page defined in the web application, the sendError method should be used instead.

The container clears the buffer and sets the Location header, preserving cookies and other headers.

Parameters:
sc - the status code
See Also:
sendError(int, java.lang.String)

public void setStatus(int sc, String sm)
deprecated | 从版本 2.1 起，由于消息参数的含义不明确。使用 setStatus(int) 设置状态代码，使用 sendError(int, String) 发送带描述的错误。 设置此响应的状态代码和消息。
sc | 状态代码
sm | 状态消息
英文文档：

setStatus

void setStatus(int sc,
               String sm)
Deprecated. As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use setStatus(int), to send an error with a description use sendError(int, String). Sets the status code and message for this response.

Parameters:
sc - the status code
sm - the status message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSession (Java EE 5)

javax.servlet.http
Interface HttpSession

public interface HttpSession

提供一种方式，跨多个页面请求或对 Web 站点的多次访问标识用户并存储有关该用户的信息。

servlet 容器使用此接口创建 HTTP 客户端和 HTTP 服务器之间的会话。会话将保留指定的时间段，跨多个连接或来自用户的页面请求。一个会话通常对应于一个用户，该用户可能多次访问一个站点。服务器能够以多种方式维护会话，比如使用 cookie 或重写 URL。

此接口允许 servlet

  • 查看和操作有关某个会话的信息，比如会话标识符、创建时间和最后一次访问时间
  • 将对象绑定到会话，允许跨多个用户连接保留用户信息

当应用程序将对象存储到会话中或从会话中移除对象时，该会话将检查对象是否实现了 HttpSessionBindingListener。如果实现了，则 servlet 将通知该对象它已经被绑定到会话，或者已从会话中取消对它的绑定。通知是在绑定方法完成后发送的。对于无效或过期的会话，通知是在会话已经无效或过期之后发送的。

当容器使用分布式容器设置在 VM 之间迁移会话时，所有实现 HttpSessionActivationListener 接口的会话属性都会得到通知。

servlet 应该能够处理客户端选择不加入会话的情况，比如故意关闭 cookie 时。在客户端加入会话前，isNew 一直返回 true。如果客户端选择不加入会话，则 getSession 将对每个请求返回一个不同的会话，并且 isNew 将总是返回 true。

会话信息的范围仅限于当前 Web 应用程序 (ServletContext)，因此存储在一个上下文中的信息在另一个上下文中不是直接可见的。

See also javax.servlet.http.HttpSessionBindingListener, javax.servlet.http.HttpSessionContext
英文文档：

Provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user.

The servlet container uses this interface to create a session between an HTTP client and an HTTP server. The session persists for a specified time period, across more than one connection or page request from the user. A session usually corresponds to one user, who may visit a site many times. The server can maintain a session in many ways such as using cookies or rewriting URLs.

This interface allows servlets to

  • View and manipulate information about a session, such as the session identifier, creation time, and last accessed time
  • Bind objects to sessions, allowing user information to persist across multiple user connections

When an application stores an object in or removes an object from a session, the session checks whether the object implements HttpSessionBindingListener. If it does, the servlet notifies the object that it has been bound to or unbound from the session. Notifications are sent after the binding methods complete. For session that are invalidated or expire, notifications are sent after the session has been invalidated or expired.

When container migrates a session between VMs in a distributed container setting, all session attributes implementing the HttpSessionActivationListener interface are notified.

A servlet should be able to handle cases in which the client does not choose to join a session, such as when cookies are intentionally turned off. Until the client joins the session, isNew returns true. If the client chooses not to join the session, getSession will return a different session on each request, and isNew will always return true.

Session information is scoped only to the current web application (ServletContext), so information stored in one context will not be directly visible in another.

Author:
Various
See Also:
HttpSessionBindingListener, HttpSessionContext

Method Summary
 Object getAttribute(String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name.
 Enumeration getAttributeNames()
Returns an Enumeration of String objects containing the names of all the objects bound to this session.
 long getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
 String getId()
Returns a string containing the unique identifier assigned to this session.
 long getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container received the request.
 int getMaxInactiveInterval()
Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses.
 ServletContext getServletContext()
Returns the ServletContext to which this session belongs.
 HttpSessionContext getSessionContext()
Deprecated. As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API.
 Object getValue(String name)
Deprecated. As of Version 2.2, this method is replaced by getAttribute(java.lang.String).
 String[] getValueNames()
Deprecated. As of Version 2.2, this method is replaced by getAttributeNames()
 void invalidate()
Invalidates this session then unbinds any objects bound to it.
 boolean isNew()
Returns true if the client does not yet know about the session or if the client chooses not to join the session.
 void putValue(String name, Object value)
Deprecated. As of Version 2.2, this method is replaced by setAttribute(java.lang.String, java.lang.Object)
 void removeAttribute(String name)
Removes the object bound with the specified name from this session.
 void removeValue(String name)
Deprecated. As of Version 2.2, this method is replaced by removeAttribute(java.lang.String)
 void setAttribute(String name, Object value)
Binds an object to this session, using the name specified.
 void setMaxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.

Method Detail

public long getCreationTime()
返回创建此会话的时间，该时间是用自格林威治标准时间 1970 年 1 月 1 日午夜起经过的毫秒数来测量的。
return | 指定创建此会话的时间的 long 值，用自格林威治标准时间 1970 年 1 月 1 日起经过的毫秒数表示
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

getCreationTime

long getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.

Returns:
a long specifying when this session was created, expressed in milliseconds since 1/1/1970 GMT
Throws:
IllegalStateException - if this method is called on an invalidated session

public String getId()
返回包含分配给此会话的唯一标识符的字符串。标识符是由 servlet 容器分配的，并且是与实现相关的。
return 指定分配给此会话的标识符的字符串
英文文档：

getId

String getId()
Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the servlet container and is implementation dependent.

Returns:
a string specifying the identifier assigned to this session

public long getLastAccessedTime()
返回客户端上一次发送与此会话关联的请求的时间（该时间是自格林威治标准时间 1970 年 1 月 1 日午夜起经过的毫秒数），并用容器接收该请求的时间标记它。

应用程序采取的操作（比如获取或设置与会话关联的值）不会影响访问时间。

return | 表示客户端上一次发送与此会话关联的请求的时间的 long 值，该时间用自格林威治标准时间 1970 年 1 月 1 日起经过的毫秒数表示
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

getLastAccessedTime

long getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container received the request.

Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.

Returns:
a long representing the last time the client sent a request associated with this session, expressed in milliseconds since 1/1/1970 GMT
Throws:
IllegalStateException - if this method is called on an invalidated session

public ServletContext getServletContext()
返回此会话所属的 ServletContext。
return | Web 应用程序的 ServletContext 对象
since | 2.3
英文文档：

getServletContext

ServletContext getServletContext()
Returns the ServletContext to which this session belongs.

Returns:
The ServletContext object for the web application
Since:
2.3

public void setMaxInactiveInterval(int interval)
指定在 servlet 容器使此会话失效之前客户端请求之间的时间间隔，以秒为单位。负数时间指示会话永远不会超时。
interval 指定秒数的整数
英文文档：

setMaxInactiveInterval

void setMaxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.

Parameters:
interval - An integer specifying the number of seconds

public int getMaxInactiveInterval()
返回 servlet 容器在客户端访问之间将使此会话保持打开状态的最大时间间隔，以秒为单位。在此间隔之后，servlet 容器将使会话无效。可使用 setMaxInactiveInterval 方法设置最大时间间隔。负数时间指示会话永远不会超时。
return | 指定此会话在客户端请求之间保持打开状态的秒数的整数
See also | setMaxInactiveInterval
英文文档：

getMaxInactiveInterval

int getMaxInactiveInterval()
Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout.

Returns:
an integer specifying the number of seconds this session remains open between client requests
See Also:
setMaxInactiveInterval(int)

public HttpSessionContext getSessionContext()
deprecated 从版本 2.1 起，此方法已过时，并且无替代版本。此方法将在 Java Servlet API 将来的版本中移除。
英文文档：

getSessionContext

HttpSessionContext getSessionContext()
Deprecated. As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API.

public Object getAttribute(String name)
返回与此会话中的指定名称绑定在一起的对象，如果没有对象绑定在该名称下，则返回 null。
name | 指定对象名称的字符串
return | 具有指定名称的对象
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

getAttribute

Object getAttribute(String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name.

Parameters:
name - a string specifying the name of the object
Returns:
the object with the specified name
Throws:
IllegalStateException - if this method is called on an invalidated session

public Object getValue(String name)
deprecated | 从版本 2.2 起，此方法已由 #getAttribute 替代。
name | 指定对象名称的字符串
return | 具有指定名称的对象
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

getValue

Object getValue(String name)
Deprecated. As of Version 2.2, this method is replaced by getAttribute(java.lang.String).

Parameters:
name - a string specifying the name of the object
Returns:
the object with the specified name
Throws:
IllegalStateException - if this method is called on an invalidated session

public java.util.Enumeration<E> getAttributeNames()
返回包含绑定到此会话的所有对象的名称的 String 对象的 Enumeration。
return | 指定绑定到此会话的所有对象的名称的 String 对象的 Enumeration。
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

getAttributeNames

Enumeration getAttributeNames()
Returns an Enumeration of String objects containing the names of all the objects bound to this session.

Returns:
an Enumeration of String objects specifying the names of all the objects bound to this session
Throws:
IllegalStateException - if this method is called on an invalidated session

public String[] getValueNames()
deprecated | 从版本 2.2 起，此方法已由 #getAttributeNames 替代
return | 指定绑定到此会话的所有对象的名称的 String 对象数组
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

getValueNames

String[] getValueNames()
Deprecated. As of Version 2.2, this method is replaced by getAttributeNames()

Returns:
an array of String objects specifying the names of all the objects bound to this session
Throws:
IllegalStateException - if this method is called on an invalidated session

public void setAttribute(String name, Object value)
使用指定名称将对象绑定到此会话。如果具有同样名称的对象已经绑定到该会话，则替换该对象。

在执行此方法后，如果新对象实现了 HttpSessionBindingListener，则容器将调用 HttpSessionBindingListener.valueBound。然后，容器通知 Web 应用程序中的任何 HttpSessionAttributeListener。

如果某个对象已经使用此名称绑定到了此会话且该对象实现了 HttpSessionBindingListener，则调用它的 HttpSessionBindingListener.valueUnbound 方法。

如果传入的值为 null，则调用此方法将与调用 removeAttribute() 产生的效果相同。

name | 对象绑定到的名称；不能为 null
value | 要绑定的对象
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

setAttribute

void setAttribute(String name,
                  Object value)
Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.

After this method executes, and if the new object implements HttpSessionBindingListener, the container calls HttpSessionBindingListener.valueBound. The container then notifies any HttpSessionAttributeListeners in the web application.

If an object was already bound to this session of this name that implements HttpSessionBindingListener, its HttpSessionBindingListener.valueUnbound method is called.

If the value passed in is null, this has the same effect as calling removeAttribute().

Parameters:
name - the name to which the object is bound; cannot be null
value - the object to be bound
Throws:
IllegalStateException - if this method is called on an invalidated session

public void putValue(String name, Object value)
deprecated | 从版本 2.2 起，此方法已由 #setAttribute 替代
name | 对象绑定到的名称；不能为 null
value | 要绑定的对象；不能为 null
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

putValue

void putValue(String name,
              Object value)
Deprecated. As of Version 2.2, this method is replaced by setAttribute(java.lang.String, java.lang.Object)

Parameters:
name - the name to which the object is bound; cannot be null
value - the object to be bound; cannot be null
Throws:
IllegalStateException - if this method is called on an invalidated session

public void removeAttribute(String name)
从此会话中移除与指定名称绑定在一起的对象。如果会话没有与指定名称绑定在一起的对象，则此方法不执行任何操作。

在执行此方法后，如果对象实现了 HttpSessionBindingListener，则容器将调用 HttpSessionBindingListener.valueUnbound。然后，容器通知 Web 应用程序中的任何 HttpSessionAttributeListener。

name | 要从此会话中移除的对象的名称
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

removeAttribute

void removeAttribute(String name)
Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.

After this method executes, and if the object implements HttpSessionBindingListener, the container calls HttpSessionBindingListener.valueUnbound. The container then notifies any HttpSessionAttributeListeners in the web application.

Parameters:
name - the name of the object to remove from this session
Throws:
IllegalStateException - if this method is called on an invalidated session

public void removeValue(String name)
deprecated | 从版本 2.2 起，此方法已由 #removeAttribute 替代
name | 要从此会话中移除的对象的名称
Throws | IllegalStateException: 如果对无效的会话调用此方法
英文文档：

removeValue

void removeValue(String name)
Deprecated. As of Version 2.2, this method is replaced by removeAttribute(java.lang.String)

Parameters:
name - the name of the object to remove from this session
Throws:
IllegalStateException - if this method is called on an invalidated session

public void invalidate()
使此会话无效，然后取消对任何绑定到它的对象的绑定。
Throws IllegalStateException: 如果对已经无效的会话调用此方法
英文文档：

invalidate

void invalidate()
Invalidates this session then unbinds any objects bound to it.

Throws:
IllegalStateException - if this method is called on an already invalidated session

public boolean isNew()
如果客户端还不知道该会话，或者客户端选择不加入该会话，则返回 true。例如，如果服务器仅使用基于 cookie 的会话，而客户端已经禁止了 cookie 的使用，则每个请求上的会话都将是新会话。
return | 如果服务器已经创建了一个会话，但客户端尚未加入该会话，则返回 true
Throws | IllegalStateException: 如果对已经无效的会话调用此方法
英文文档：

isNew

boolean isNew()
Returns true if the client does not yet know about the session or if the client chooses not to join the session. For example, if the server used only cookie-based sessions, and the client had disabled the use of cookies, then a session would be new on each request.

Returns:
true if the server has created a session, but the client has not yet joined
Throws:
IllegalStateException - if this method is called on an already invalidated session
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


HttpSessionActivationListener (Java EE 5)

javax.servlet.http
Interface HttpSessionActivationListener

All Superinterfaces:
EventListener
public interface HttpSessionActivationListener
extends EventListener

Implements: java.util.EventListener

绑定到会话的对象可以侦听通知它们会话将被钝化和会话将被激活的容器事件。在 VM 之间迁移会话或者保留会话的容器需要通知绑定到实现 HttpSessionActivationListener 的会话的所有属性。
since 2.3
英文文档：

Objects that are bound to a session may listen to container events notifying them that sessions will be passivated and that session will be activated. A container that migrates session between VMs or persists sessions is required to notify all attributes bound to sessions implementing HttpSessionActivationListener.

Since:
2.3

Method Summary
void | sessionDidActivate(HttpSessionEvent se) Notification that the session has just been activated.
void | sessionWillPassivate(HttpSessionEvent se) Notification that the session is about to be passivated.

Method Detail

public void sessionWillPassivate(HttpSessionEvent se)
通知会话即将被钝化。
英文文档：

sessionWillPassivate

void sessionWillPassivate(HttpSessionEvent se)
Notification that the session is about to be passivated.

public void sessionDidActivate(HttpSessionEvent se)
通知会话刚刚被激活。
英文文档：

sessionDidActivate

void sessionDidActivate(HttpSessionEvent se)
Notification that the session has just been activated.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionAttributeListener (Java EE 5)

javax.servlet.http
Interface HttpSessionAttributeListener

All Superinterfaces:
EventListener
public interface HttpSessionAttributeListener
extends EventListener

Implements: java.util.EventListener

为了获取此 Web 应用程序内会话属性列表更改的通知，可实现此侦听器接口。
since
en
v 2.3
英文文档：

This listener interface can be implemented in order to get notifications of changes to the attribute lists of sessions within this web application.

Since:
v 2.3

Method Summary
void | attributeAdded(HttpSessionBindingEvent se) Notification that an attribute has been added to a session.
void | attributeRemoved(HttpSessionBindingEvent se) Notification that an attribute has been removed from a session.
void | attributeReplaced(HttpSessionBindingEvent se) Notification that an attribute has been replaced in a session.

Method Detail

public void attributeAdded(HttpSessionBindingEvent se)
通知已将属性添加到会话。在添加属性之后调用。
英文文档：

attributeAdded

void attributeAdded(HttpSessionBindingEvent se)
Notification that an attribute has been added to a session. Called after the attribute is added.

public void attributeRemoved(HttpSessionBindingEvent se)
通知属性已从会话中移除。在移除属性之后调用。
英文文档：

attributeRemoved

void attributeRemoved(HttpSessionBindingEvent se)
Notification that an attribute has been removed from a session. Called after the attribute is removed.

public void attributeReplaced(HttpSessionBindingEvent se)
通知已替换会话中的一个属性。在替换属性之后调用。
英文文档：

attributeReplaced

void attributeReplaced(HttpSessionBindingEvent se)
Notification that an attribute has been replaced in a session. Called after the attribute is replaced.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionBindingListener (Java EE 5)

javax.servlet.http
Interface HttpSessionBindingListener

All Superinterfaces:
EventListener
public interface HttpSessionBindingListener
extends EventListener

Implements: java.util.EventListener

使对象在被绑定到会话或从会话中取消对它的绑定时得到通知。该对象通过 HttpSessionBindingEvent 对象得到通知。这可能是 servlet 编程人员显式从会话中取消绑定某个属性的结果（由于会话无效，或者由于会话超时）。
See also javax.servlet.http.HttpSession, javax.servlet.http.HttpSessionBindingEvent
英文文档：

Causes an object to be notified when it is bound to or unbound from a session. The object is notified by an HttpSessionBindingEvent object. This may be as a result of a servlet programmer explicitly unbinding an attribute from a session, due to a session being invalidated, or due to a session timing out.

Author:
Various
See Also:
HttpSession, HttpSessionBindingEvent

Method Summary
void | valueBound(HttpSessionBindingEvent event) Notifies the object that it is being bound to a session and identifies the session.
void | valueUnbound(HttpSessionBindingEvent event) Notifies the object that it is being unbound from a session and identifies the session.

Method Detail

public void valueBound(HttpSessionBindingEvent event)
通知对象它将被绑定到某个会话并标识该会话。
event | 标识会话的事件
See also | valueUnbound
英文文档：

valueBound

void valueBound(HttpSessionBindingEvent event)
Notifies the object that it is being bound to a session and identifies the session.

Parameters:
event - the event that identifies the session
See Also:
valueUnbound(javax.servlet.http.HttpSessionBindingEvent)

public void valueUnbound(HttpSessionBindingEvent event)
通知对象要从某个会话中取消对它的绑定并标识该会话。
event | 标识会话的事件
See also | valueBound
英文文档：

valueUnbound

void valueUnbound(HttpSessionBindingEvent event)
Notifies the object that it is being unbound from a session and identifies the session.

Parameters:
event - the event that identifies the session
See Also:
valueBound(javax.servlet.http.HttpSessionBindingEvent)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionContext (Java EE 5)

javax.servlet.http
Interface HttpSessionContext

Deprecated. As of Java(tm) Servlet API 2.1 for security reasons, with no replacement. This interface will be removed in a future version of this API.

deprecated
en
As of Java(tm) Servlet API 2.1 for security reasons, with no replacement. This interface will be removed in a future version of this API.
See also javax.servlet.http.HttpSession, javax.servlet.http.HttpSessionBindingEvent, javax.servlet.http.HttpSessionBindingListener
英文文档：

public interface HttpSessionContext

Author:
Various
See Also:
HttpSession, HttpSessionBindingEvent, HttpSessionBindingListener

Method Summary
Enumeration | getIds() Deprecated. As of Java Servlet API 2.1 with no replacement. This method must return an empty Enumeration and will be removed in a future version of this API.
HttpSession | getSession(String sessionId) Deprecated. As of Java Servlet API 2.1 with no replacement. This method must return null and will be removed in a future version of this API.

Method Detail

public HttpSession getSession(String sessionId)
deprecated 从 Java Servlet API 2.1 起，不再提供替代方法。此方法必须返回 null，并且将在此 API 将来的版本中移除。
英文文档：

getSession

HttpSession getSession(String sessionId)
Deprecated. As of Java Servlet API 2.1 with no replacement. This method must return null and will be removed in a future version of this API.

public java.util.Enumeration<E> getIds()
deprecated 从 Java Servlet API 2.1 起，不再提供替代方法。此方法必须返回一个空的 Enumeration，并且将在此 API 将来的版本中移除。
英文文档：

getIds

Enumeration getIds()
Deprecated. As of Java Servlet API 2.1 with no replacement. This method must return an empty Enumeration and will be removed in a future version of this API.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionListener (Java EE 5)

javax.servlet.http
Interface HttpSessionListener

All Superinterfaces:
EventListener
public interface HttpSessionListener
extends EventListener

Implements: java.util.EventListener

对 Web 应用程序中活动会话列表的更改将通知此接口的实现。要接收通知事件，必须在 Web 应用程序的部署描述符中配置实现类。
since
en
v 2.3
See also javax.servlet.http.HttpSessionEvent
英文文档：

Implementations of this interface are notified of changes to the list of active sessions in a web application. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application.

Since:
v 2.3
See Also:
HttpSessionEvent

Method Summary
void | sessionCreated(HttpSessionEvent se) Notification that a session was created.
void | sessionDestroyed(HttpSessionEvent se) Notification that a session is about to be invalidated.

Method Detail

public void sessionCreated(HttpSessionEvent se)
通知创建了一个会话。
se 通知事件
英文文档：

sessionCreated

void sessionCreated(HttpSessionEvent se)
Notification that a session was created.

Parameters:
se - the notification event

public void sessionDestroyed(HttpSessionEvent se)
通知某个会话即将无效。
se 通知事件
英文文档：

sessionDestroyed

void sessionDestroyed(HttpSessionEvent se)
Notification that a session is about to be invalidated.

Parameters:
se - the notification event
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Cookie (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.http
Class Cookie

java.lang.Object
    extended by  javax.servlet.http.Cookie
All Implemented Interfaces:
Cloneable
public class Cookie
extends Object
implements Cloneable

Implements: Cloneable

创建一个 cookie，cookie 是 servlet 发送到 Web 浏览器的少量信息，这些信息由浏览器保存，然后发送回服务器。cookie 的值可以唯一地标识客户端，因此 cookie 常用于会话管理。

一个 cookie 拥有一个名称、一个值和一些可选属性，比如注释、路径和域限定符、最大生存时间和版本号。一些 Web 浏览器在处理可选属性方面存在 bug，因此有节制地使用这些属性可提高 servlet 的互操作性。

servlet 通过使用 HttpServletResponse#addCookie 方法将 cookie 发送到浏览器，该方法将字段添加到 HTTP 响应头，以便一次一个地将 cookie 发送到浏览器。浏览器应该支持每台 Web 服务器有 20 个 cookie，总共有 300 个 cookie，并且可能将每个 cookie 的大小限定为 4 KB。

浏览器通过向 HTTP 请求头添加字段将 cookie 返回给 servlet。可使用 HttpServletRequest#getCookies 方法从请求中获取 cookie。一些 cookie 可能有相同的名称，但却有不同的路径属性。

cookie 影响使用它们的 Web 页面的缓存。HTTP 1.0 不会缓存那些使用通过此类创建的 cookie 的页面。此类不支持 HTTP 1.1 中定义的缓存控件。

此类支持版本 0（遵守 Netscape 协议）和版本 1（遵守 RFC 2109 协议）cookie 规范。默认情况下，cookie 是使用版本 0 创建的，以确保最佳互操作性。

英文文档：

Creates a cookie, a small amount of information sent by a servlet to a Web browser, saved by the browser, and later sent back to the server. A cookie's value can uniquely identify a client, so cookies are commonly used for session management.

A cookie has a name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum age, and a version number. Some Web browsers have bugs in how they handle the optional attributes, so use them sparingly to improve the interoperability of your servlets.

The servlet sends cookies to the browser by using the HttpServletResponse.addCookie(javax.servlet.http.Cookie) method, which adds fields to HTTP response headers to send cookies to the browser, one at a time. The browser is expected to support 20 cookies for each Web server, 300 cookies total, and may limit cookie size to 4 KB each.

The browser returns cookies to the servlet by adding fields to HTTP request headers. Cookies can be retrieved from a request by using the HttpServletRequest.getCookies() method. Several cookies might have the same name but different path attributes.

Cookies affect the caching of the Web pages that use them. HTTP 1.0 does not cache pages that use cookies created with this class. This class does not support the cache control defined with HTTP 1.1.

This class supports both the Version 0 (by Netscape) and Version 1 (by RFC 2109) cookie specifications. By default, cookies are created using Version 0 to ensure the best interoperability.

Author:
Various

Constructor Summary
Cookie(String name, String value)
Constructs a cookie with a specified name and value.
Method Summary
Object | clone() Overrides the standard java.lang.Object.clone method to return a copy of this cookie.
String | getComment() Returns the comment describing the purpose of this cookie, or null if the cookie has no comment.
String | getDomain() Returns the domain name set for this cookie.
int | getMaxAge() Returns the maximum age of the cookie, specified in seconds, By default, -1 indicating the cookie will persist until browser shutdown.
String | getName() Returns the name of the cookie.
String | getPath() Returns the path on the server to which the browser returns this cookie.
boolean | getSecure() Returns true if the browser is sending cookies only over a secure protocol, or false if the browser can send cookies using any protocol.
String | getValue() Returns the value of the cookie.
int | getVersion() Returns the version of the protocol this cookie complies with.
void | setComment(String purpose) Specifies a comment that describes a cookie's purpose.
void | setDomain(String pattern) Specifies the domain within which this cookie should be presented.
void | setMaxAge(int expiry) Sets the maximum age of the cookie in seconds.
void | setPath(String uri) Specifies a path for the cookie to which the client should return the cookie.
void | setSecure(boolean flag) Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.
void | setValue(String newValue) Assigns a new value to a cookie after the cookie is created.
void | setVersion(int v) Sets the version of the cookie protocol this cookie complies with.
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Cookie(String name, String value)
构造带指定名称和值的 cookie。

名称必须遵守 RFC 2109。这意味着它只能包含 ASCII 字母数字字符，不能包含逗号、分号或空格，也不能以 $ 字符开头。cookie 的名称在创建之后不得更改。

该值可以是服务器选择发送的任何值。可能只有该服务器需要其值。cookie 的值在使用 setValue 方法创建后可以更改。

默认情况下，根据 Netscape cookie 规范创建 cookie。可以使用 setVersion 方法更改版本。

name | 指定 cookie 名称的 String
value | 指定 cookie 值的 String
Throws | IllegalArgumentException: 如果 cookie 名称包含非法字符（例如，逗号、空格或分号），或者它是为了供 cookie 协议使用而保留的标记之一
See also | setValue, setVersion
英文文档：

Cookie

public Cookie(String name,
              String value)
Constructs a cookie with a specified name and value.

The name must conform to RFC 2109. That means it can contain only ASCII alphanumeric characters and cannot contain commas, semicolons, or white space or begin with a $ character. The cookie's name cannot be changed after creation.

The value can be anything the server chooses to send. Its value is probably of interest only to the server. The cookie's value can be changed after creation with the setValue method.

By default, cookies are created according to the Netscape cookie specification. The version can be changed with the setVersion method.

Parameters:
name - a String specifying the name of the cookie
value - a String specifying the value of the cookie
Throws:
IllegalArgumentException - if the cookie name contains illegal characters (for example, a comma, space, or semicolon) or it is one of the tokens reserved for use by the cookie protocol
See Also:
setValue(java.lang.String), setVersion(int)
Method Detail

public void setComment(String purpose)
指定一个描述 cookie 用途的注释。如果浏览器向用户显示 cookie，则注释很有用。Netscape Version 0 cookie 不支持注释。
purpose | 一个 String，指定要显示给用户的注释
See also | getComment
英文文档：

setComment

public void setComment(String purpose)
Specifies a comment that describes a cookie's purpose. The comment is useful if the browser presents the cookie to the user. Comments are not supported by Netscape Version 0 cookies.

Parameters:
purpose - a String specifying the comment to display to the user
See Also:
getComment()

public String getComment()
返回描述此 cookie 用途的注释；如果该 cookie 没有注释，则返回 null。
return | 包含注释的 String；如果没有注释，则返回 null
See also | setComment
英文文档：

getComment

public String getComment()
Returns the comment describing the purpose of this cookie, or null if the cookie has no comment.

Returns:
a String containing the comment, or null if none
See Also:
setComment(java.lang.String)

public void setDomain(String pattern)
指定应在其中显示此 cookie 的域。

RFC 2109 指定了域名的形式。域名以点 (.foo.com) 开头，意味着在指定域名系统（Domain Name System，DNS）区域中（例如，www.foo.com，但不是 a.b.foo.com）cookie 对于服务器是可见的。默认情况下，cookie 只返回给发送它们的服务器。

pattern | 包含域名（在其中此 cookie 可见）的 String；域名形式符合 RFC 2109
See also | getDomain
英文文档：

setDomain

public void setDomain(String pattern)
Specifies the domain within which this cookie should be presented.

The form of the domain name is specified by RFC 2109. A domain name begins with a dot (.foo.com) and means that the cookie is visible to servers in a specified Domain Name System (DNS) zone (for example, www.foo.com, but not a.b.foo.com). By default, cookies are only returned to the server that sent them.

Parameters:
pattern - a String containing the domain name within which this cookie is visible; form is according to RFC 2109
See Also:
getDomain()

public String getDomain()
返回为此 cookie 设置的域名。域名形式是根据 RFC 2109 设置的。
return | 包含域名的 String
See also | setDomain
英文文档：

getDomain

public String getDomain()
Returns the domain name set for this cookie. The form of the domain name is set by RFC 2109.

Returns:
a String containing the domain name
See Also:
setDomain(java.lang.String)

public void setMaxAge(int expiry)
设置 cookie 的最大生存时间，以秒为单位。

正值表示 cookie 将在经过该值表示的秒数后过期。注意，该值是 cookie 过期的最大 生存时间，不是 cookie 的当前生存时间。

负值意味着 cookie 不会被持久存储，将在 Web 浏览器退出时删除。0 值会导致删除 cookie。

expiry | 指定 cookie 的最大生存时间（以秒为单位）的整数；如果为负数，则表示不存储该 cookie；如果为 0，则删除该 cookie
See also | getMaxAge
英文文档：

setMaxAge

public void setMaxAge(int expiry)
Sets the maximum age of the cookie in seconds.

A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.

A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.

Parameters:
expiry - an integer specifying the maximum age of the cookie in seconds; if negative, means the cookie is not stored; if zero, deletes the cookie
See Also:
getMaxAge()

public int getMaxAge()
返回以秒为单位指定的 cookie 的最大生存时间，默认情况下，-1 指示该 cookie 将保留到浏览器关闭为止。
return | 指定 cookie 的最大生存时间（以秒为单位）的整数；如果为负数，则表示该 cookie 保留到浏览器关闭为止
See also | setMaxAge
英文文档：

getMaxAge

public int getMaxAge()
Returns the maximum age of the cookie, specified in seconds, By default, -1 indicating the cookie will persist until browser shutdown.

Returns:
an integer specifying the maximum age of the cookie in seconds; if negative, means the cookie persists until browser shutdown
See Also:
setMaxAge(int)

public void setPath(String uri)
指定客户端应该返回 cookie 的路径。

cookie 对于指定目录中的所有页面及该目录子目录中的所有页面都是可见的。cookie 的路径必须包括设置 cookie 的 servlet，例如 /catalog，它使 cookie 对于服务器上 /catalog 下的所有目录都是可见的。

有关设置 cookie 路径名称的更多信息，请参考 RFC 2109（可从 Internet 上获得）。

uri | 指定路径的 String
See also | getPath
英文文档：

setPath

public void setPath(String uri)
Specifies a path for the cookie to which the client should return the cookie.

The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog.

Consult RFC 2109 (available on the Internet) for more information on setting path names for cookies.

Parameters:
uri - a String specifying a path
See Also:
getPath()

public String getPath()
返回浏览器将此 cookie 返回到的服务器上的路径。cookie 对于服务器上的所有子路径都是可见的。
return | 指定包含 servlet 名称的路径的 String，例如 /catalog
See also | setPath
英文文档：

getPath

public String getPath()
Returns the path on the server to which the browser returns this cookie. The cookie is visible to all subpaths on the server.

Returns:
a String specifying a path that contains a servlet name, for example, /catalog
See Also:
setPath(java.lang.String)

public void setSecure(boolean flag)
指示浏览器是否只能使用安全协议（如 HTTPS 或 SSL）发送 cookie。

默认值为 false。

flag | 如果为 true，则仅在使用安全协议时将 cookie 从浏览器发送到服务器；如果为 false，则在使用任何协议时都可以发送
See also | getSecure
英文文档：

setSecure

public void setSecure(boolean flag)
Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.

The default value is false.

Parameters:
flag - if true, sends the cookie from the browser to the server only when using a secure protocol; if false, sent on any protocol
See Also:
getSecure()

public boolean getSecure()
如果浏览器仅通过安全协议发送 cookie，则返回 true；如果浏览器可以使用任何协议发送 cookie，则返回 false。
return | 如果浏览器使用的是安全协议，则返回 true；否则返回 false
See also | setSecure
英文文档：

getSecure

public boolean getSecure()
Returns true if the browser is sending cookies only over a secure protocol, or false if the browser can send cookies using any protocol.

Returns:
true if the browser uses a secure protocol; otherwise, true
See Also:
setSecure(boolean)

public String getName()
返回 cookie 的名称。名称在创建之后不得更改。
return 指定 cookie 名称的 String
英文文档：

getName

public String getName()
Returns the name of the cookie. The name cannot be changed after creation.

Returns:
a String specifying the cookie's name

public void setValue(String newValue)
在创建 cookie 之后将新值分配给 cookie。如果使用二进制值，则可能需要使用 BASE64 编码。

对于 Version 0 cookie，值不应包含空格、方括号、圆括号、等号、逗号、双引号、斜杠、问号、at 符号、冒号和分号。空值在所有浏览器上的行为不一定相同。

newValue | 指定新值的 String
See also | getValue, javax.servlet.http.Cookie
英文文档：

setValue

public void setValue(String newValue)
Assigns a new value to a cookie after the cookie is created. If you use a binary value, you may want to use BASE64 encoding.

With Version 0 cookies, values should not contain white space, brackets, parentheses, equals signs, commas, double quotes, slashes, question marks, at signs, colons, and semicolons. Empty values may not behave the same way on all browsers.

Parameters:
newValue - a String specifying the new value
See Also:
getValue(), Cookie

public String getValue()
返回 cookie 的值。
return | 包含 cookie 当前值的 String
See also | setValue, javax.servlet.http.Cookie
英文文档：

getValue

public String getValue()
Returns the value of the cookie.

Returns:
a String containing the cookie's present value
See Also:
setValue(java.lang.String), Cookie

public int getVersion()
返回此 cookie 遵守的协议版本。版本 1 遵守 RFC 2109，版本 0 遵守根据 Netscape 起草的原始 cookie 规范。浏览器提供的 cookie 使用并标识该浏览器的 cookie 版本。
return | 如果 cookie 遵守原始 Netscape 规范，则返回 0；如果 cookie 遵守 RFC 2109，则返回 1
See also | setVersion
英文文档：

getVersion

public int getVersion()
Returns the version of the protocol this cookie complies with. Version 1 complies with RFC 2109, and version 0 complies with the original cookie specification drafted by Netscape. Cookies provided by a browser use and identify the browser's cookie version.

Returns:
0 if the cookie complies with the original Netscape specification; 1 if the cookie complies with RFC 2109
See Also:
setVersion(int)

public void setVersion(int v)
设置此 cookie 遵守的 cookie 协议版本。版本 0 遵守原始 Netscape cookie 规范。版本 1 遵守 RFC 2109。

因为 RFC 2109 仍然有点新，所以根据经验可考虑使用版本 1；但在生产网站上不要使用它。

v | 如果 cookie 应该遵守原始 Netscape 规范，则该参数为 0；如果 cookie 应该遵守 RFC 2109，则该参数为 1
See also | getVersion
英文文档：

setVersion

public void setVersion(int v)
Sets the version of the cookie protocol this cookie complies with. Version 0 complies with the original Netscape cookie specification. Version 1 complies with RFC 2109.

Since RFC 2109 is still somewhat new, consider version 1 as experimental; do not use it yet on production sites.

Parameters:
v - 0 if the cookie should comply with the original Netscape specification; 1 if the cookie should comply with RFC 2109
See Also:
getVersion()

public Object clone()
重写标准 java.lang.Object.clone 方法以返回此 cookie 的副本。
英文文档：

clone

public Object clone()
Overrides the standard java.lang.Object.clone method to return a copy of this cookie.

Overrides:
clone in class Object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HttpServlet (Java EE 5)

javax.servlet.http
Class HttpServlet

java.lang.Object
    extended by  javax.servlet.GenericServlet
        extended by  javax.servlet.http.HttpServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
public abstract class HttpServlet
extends GenericServlet
implements Serializable

Extends: GenericServlet
Implements: java.io.Serializable

提供将要被子类化以创建适用于 Web 站点的 HTTP servlet 的抽象类。HttpServlet 的子类至少必须重写一个方法，该方法通常是以下这些方法之一：
  • doGet，如果 servlet 支持 HTTP GET 请求
  • doPost，用于 HTTP POST 请求
  • doPut，用于 HTTP PUT 请求
  • doDelete，用于 HTTP DELETE 请求
  • init 和 destroy，用于管理 servlet 的生命周期内保存的资源
  • getServletInfo，servlet 使用它提供有关其自身的信息

几乎没有理由重写 service 方法。service 通过将标准 HTTP 请求分发给每个 HTTP 请求类型的处理程序方法（上面列出的 do XXX 方法）来处理它们。

同样，几乎没有理由重写 doOptions 和 doTrace 方法。

servlet 通常运行在多线程服务器上，因此应该意识到 servlet 必须处理并发请求并小心地同步对共享资源的访问。共享资源包括内存数据（比如实例或类变量）和外部对象（比如文件、数据库连接和网络连接）。有关在 Java 程序中处理多个线程的更多信息，请参见 Java Tutorial on Multithreaded Programming。

英文文档：

Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these:

  • doGet, if the servlet supports HTTP GET requests
  • doPost, for HTTP POST requests
  • doPut, for HTTP PUT requests
  • doDelete, for HTTP DELETE requests
  • init and destroy, to manage resources that are held for the life of the servlet
  • getServletInfo, which the servlet uses to provide information about itself

There's almost no reason to override the service method. service handles standard HTTP requests by dispatching them to the handler methods for each HTTP request type (the do XXX methods listed above).

Likewise, there's almost no reason to override the doOptions and doTrace methods.

Servlets typically run on multithreaded servers, so be aware that a servlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections. See the Java Tutorial on Multithreaded Programming for more information on handling multiple threads in a Java program.

Author:
Various
See Also:
Serialized Form

Constructor Summary
HttpServlet()
Does nothing, because this is an abstract class.
Method Summary
protected void | doDelete(HttpServletRequest req, HttpServletResponse resp) Called by the server (via the service method) to allow a servlet to handle a DELETE request.
protected void | doGet(HttpServletRequest req, HttpServletResponse resp) Called by the server (via the service method) to allow a servlet to handle a GET request.
protected void | doHead(HttpServletRequest req, HttpServletResponse resp) Receives an HTTP HEAD request from the protected service method and handles the request.
protected void | doOptions(HttpServletRequest req, HttpServletResponse resp) Called by the server (via the service method) to allow a servlet to handle a OPTIONS request.
protected void | doPost(HttpServletRequest req, HttpServletResponse resp) Called by the server (via the service method) to allow a servlet to handle a POST request.
protected void | doPut(HttpServletRequest req, HttpServletResponse resp) Called by the server (via the service method) to allow a servlet to handle a PUT request.
protected void | doTrace(HttpServletRequest req, HttpServletResponse resp) Called by the server (via the service method) to allow a servlet to handle a TRACE request.
protected long | getLastModified(HttpServletRequest req) Returns the time the HttpServletRequest object was last modified, in milliseconds since midnight January 1, 1970 GMT.
protected void | service(HttpServletRequest req, HttpServletResponse resp) Receives standard HTTP requests from the public service method and dispatches them to the do XXX methods defined in this class.
void | service(ServletRequest req, ServletResponse res) Dispatches client requests to the protected service method.
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public HttpServlet()
不执行任何操作，因为这是一个抽象类。
英文文档：

HttpServlet

public HttpServlet()
Does nothing, because this is an abstract class.

Method Detail

protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
由服务器调用（通过 service 方法），以允许 servlet 处理 GET 请求。

重写此方法以支持 GET 请求，也就自动支持了 HTTP HEAD 请求。HEAD 请求是一个返回响应中没有正文、只有请求头字段的 GET 请求。

重写此方法时，读取请求数据、写入响应头、获取响应的编写者或输出流对象，最后，写入响应数据。最好包括内容类型和编码。使用 PrintWriter 对象返回响应时，在访问 PrintWriter 对象之前设置内容类型。

提交响应前，servlet 容器必须写入响应头，因为在 HTTP 中响应头必须在响应正文之前发送。

如有可能，应设置 Content-Length 头（使用 javax.servlet.ServletResponse#setContentLength 方法），以允许 servlet 容器使用持久连接向客户端返回响应，从而改进性能。如果响应缓冲区能够容纳整个响应，则自动设置内容长度。

使用 HTTP 1.1 存储块编码时（这意味着响应具有 Transfer-Encoding 头），不要设置 Content-Length 头。

GET 方法应该是安全的，也就是说，没有需要用户负责的任何副作用。例如，大多数形式查询没有副作用。如果某个客户端请求用于更改存储数据，则该请求应该使用某个其他 HTTP 方法。

GET 方法还应该是幂等的，这意味着可以安全地重复使用它。有时使某个方法是安全的也会使其成为幂等的。例如，重复查询既是安全的，又是幂等的，但在线购买某个产品或修改数据则既不是安全的又不是幂等的。

如果不正确地格式化请求，则 doGet 将返回一条 HTTP "Bad Request" 消息。

req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
resp | 包含 servlet 向客户端发送的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在 servlet 处理 GET 请求期间检测到输入或输出错误
Throws | ServletException: 如果无法处理对 GET 的请求
See also | setContentType
英文文档：

doGet

protected void doGet(HttpServletRequest req,
                     HttpServletResponse resp)
              throws ServletException,
                     IOException
Called by the server (via the service method) to allow a servlet to handle a GET request.

Overriding this method to support a GET request also automatically supports an HTTP HEAD request. A HEAD request is a GET request that returns no body in the response, only the request header fields.

When overriding this method, read the request data, write the response headers, get the response's writer or output stream object, and finally, write the response data. It's best to include content type and encoding. When using a PrintWriter object to return the response, set the content type before accessing the PrintWriter object.

The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body.

Where possible, set the Content-Length header (with the ServletResponse.setContentLength(int) method), to allow the servlet container to use a persistent connection to return its response to the client, improving performance. The content length is automatically set if the entire response fits inside the response buffer.

When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header.

The GET method should be safe, that is, without any side effects for which users are held responsible. For example, most form queries have no side effects. If a client request is intended to change stored data, the request should use some other HTTP method.

The GET method should also be idempotent, meaning that it can be safely repeated. Sometimes making a method safe also makes it idempotent. For example, repeating queries is both safe and idempotent, but buying a product online or modifying data is neither safe nor idempotent.

If the request is incorrectly formatted, doGet returns an HTTP "Bad Request" message.

Parameters:
req - an HttpServletRequest object that contains the request the client has made of the servlet
resp - an HttpServletResponse object that contains the response the servlet sends to the client
Throws:
IOException - if an input or output error is detected when the servlet handles the GET request
ServletException - if the request for the GET could not be handled
See Also:
ServletResponse.setContentType(java.lang.String)

protected long getLastModified(HttpServletRequest req)
返回上次修改 HttpServletRequest 对象的时间，该时间是自格林威治标准时间 1970 年 1 月 1 日午夜起经过的毫秒数。如果该时间是未知的，则此方法返回一个负数（默认值）。

支持 HTTP GET 请求并且可以快速确定其上次修改时间的 servlet 应该重写此方法。这使浏览器和代理缓存更有效地工作，减少服务器和网络资源上的负载。

req | 发送给 servlet 的 HttpServletRequest 对象
return | 指定 HttpServletRequest 对象的上次修改时间的 long 整数，该时间是自格林威治标准时间 1970 年 1 月 1 日午夜起经过的毫秒数，如果该时间是未知的，则返回 -1
英文文档：

getLastModified

protected long getLastModified(HttpServletRequest req)
Returns the time the HttpServletRequest object was last modified, in milliseconds since midnight January 1, 1970 GMT. If the time is unknown, this method returns a negative number (the default).

Servlets that support HTTP GET requests and can quickly determine their last modification time should override this method. This makes browser and proxy caches work more effectively, reducing the load on server and network resources.

Parameters:
req - the HttpServletRequest object that is sent to the servlet
Returns:
a long integer specifying the time the HttpServletRequest object was last modified, in milliseconds since midnight, January 1, 1970 GMT, or -1 if the time is not known

protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException

接收来自受保护 service 方法的 HTTP HEAD 请求并处理该请求。当客户端只想看到响应的头（比如 Content-Type 或 Content-Length）时，它可以发送一个 HEAD 请求。HTTP HEAD 方法计算响应中的输出字节数，以便准确设置 Content-Length 头。

如果重写此方法，可以避免计算响应正文而仅直接设置响应头，从而提高性能。确保编写的 doHead 方法是既安全又幂等的（也就是说，保护它自己不被一个 HTTP HEAD 请求多次调用）。

如果不正确地格式化 HTTP HEAD 请求，则 doHead 将返回一条 HTTP "Bad Request" 消息。

req | 传递给 servlet 的请求对象
resp | servlet 用来将头返回给客户端的响应对象
Throws | java.io.IOException: 如果发生输入或输出错误
Throws | ServletException: 如果无法处理对 HEAD 的请求
英文文档：

doHead

protected void doHead(HttpServletRequest req,
                      HttpServletResponse resp)
               throws ServletException,
                      IOException

Receives an HTTP HEAD request from the protected service method and handles the request. The client sends a HEAD request when it wants to see only the headers of a response, such as Content-Type or Content-Length. The HTTP HEAD method counts the output bytes in the response to set the Content-Length header accurately.

If you override this method, you can avoid computing the response body and just set the response headers directly to improve performance. Make sure that the doHead method you write is both safe and idempotent (that is, protects itself from being called multiple times for one HTTP HEAD request).

If the HTTP HEAD request is incorrectly formatted, doHead returns an HTTP "Bad Request" message.

Parameters:
req - the request object that is passed to the servlet
resp - the response object that the servlet uses to return the headers to the clien
Throws:
IOException - if an input or output error occurs
ServletException - if the request for the HEAD could not be handled

protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
由服务器调用（通过 service 方法），以允许 servlet 处理 POST 请求。 HTTP POST 方法允许客户端一次将不限长度的数据发送到 Web 服务器，这在发送诸如信用卡号之类的信息时很有用。

重写此方法时，读取请求数据、写入响应头、获取响应的编写者或输出流对象，最后，写入响应数据。最好包括内容类型和编码。使用 PrintWriter 对象返回响应时，在访问 PrintWriter 对象之前设置内容类型。

提交响应前，servlet 容器必须写入响应头，因为在 HTTP 中响应头必须在响应正文之前发送。

如有可能，应设置 Content-Length 头（使用 javax.servlet.ServletResponse#setContentLength 方法），以允许 servlet 容器使用持久连接向客户端返回响应，从而改进性能。如果响应缓冲区能够容纳整个响应，则自动设置内容长度。

使用 HTTP 1.1 存储块编码时（这意味着响应具有 Transfer-Encoding 头），不要设置 Content-Length 头。

此方法不需要是安全的或幂等的。通过 POST 请求的操作可能产生用户需要负责的副作用，例如，更新存储数据或在线购买商品。

如果不正确地格式化 HTTP POST 请求，则 doPost 返回一条 HTTP "Bad Request" 消息。

req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
resp | 包含 servlet 向客户端发送的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在 servlet 处理该请求期间检测到输入或输出错误
Throws | ServletException: 如果无法处理对 POST 的请求
See also | javax.servlet.ServletOutputStream, setContentType
英文文档：

doPost

protected void doPost(HttpServletRequest req,
                      HttpServletResponse resp)
               throws ServletException,
                      IOException
Called by the server (via the service method) to allow a servlet to handle a POST request. The HTTP POST method allows the client to send data of unlimited length to the Web server a single time and is useful when posting information such as credit card numbers.

When overriding this method, read the request data, write the response headers, get the response's writer or output stream object, and finally, write the response data. It's best to include content type and encoding. When using a PrintWriter object to return the response, set the content type before accessing the PrintWriter object.

The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body.

Where possible, set the Content-Length header (with the ServletResponse.setContentLength(int) method), to allow the servlet container to use a persistent connection to return its response to the client, improving performance. The content length is automatically set if the entire response fits inside the response buffer.

When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header.

This method does not need to be either safe or idempotent. Operations requested through POST can have side effects for which the user can be held accountable, for example, updating stored data or buying items online.

If the HTTP POST request is incorrectly formatted, doPost returns an HTTP "Bad Request" message.

Parameters:
req - an HttpServletRequest object that contains the request the client has made of the servlet
resp - an HttpServletResponse object that contains the response the servlet sends to the client
Throws:
IOException - if an input or output error is detected when the servlet handles the request
ServletException - if the request for the POST could not be handled
See Also:
ServletOutputStream, ServletResponse.setContentType(java.lang.String)

protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
由服务器调用（通过 service 方法），以允许 servlet 处理 PUT 请求。 PUT 操作允许客户端将文件放在服务器上，类似于通过 FTP 发送文件。

在重写此方法时，随请求一起发送的所有内容头都要保持原样，这些内容头包括 Content-Length、Content-Type、Content-Transfer-Encoding、Content-Encoding、Content-Base、Content-Language、Content-Location、Content-MD5 和 Content-Range。如果某个方法无法处理内容头，则它必须发出一条错误消息 (HTTP 501 - Not Implemented) 并丢弃该请求。有关 HTTP 1.1 的更多信息，请参见 RFC 2616 。

此方法不需要是安全的或幂等的。doPut 执行的操作可能具有用户需要负责的副作用。使用此方法时，在临时存储器中保存受影响 URL 的副本可能会很有用。

如果不正确地格式化 HTTP PUT 请求，则 doPut 返回一条 HTTP "Bad Request" 消息。

req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
resp | 包含 servlet 向客户端返回的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在 servlet 处理 PUT 请求期间发生输入或输出错误
Throws | ServletException: 如果无法处理对 PUT 的请求
英文文档：

doPut

protected void doPut(HttpServletRequest req,
                     HttpServletResponse resp)
              throws ServletException,
                     IOException
Called by the server (via the service method) to allow a servlet to handle a PUT request. The PUT operation allows a client to place a file on the server and is similar to sending a file by FTP.

When overriding this method, leave intact any content headers sent with the request (including Content-Length, Content-Type, Content-Transfer-Encoding, Content-Encoding, Content-Base, Content-Language, Content-Location, Content-MD5, and Content-Range). If your method cannot handle a content header, it must issue an error message (HTTP 501 - Not Implemented) and discard the request. For more information on HTTP 1.1, see RFC 2616 .

This method does not need to be either safe or idempotent. Operations that doPut performs can have side effects for which the user can be held accountable. When using this method, it may be useful to save a copy of the affected URL in temporary storage.

If the HTTP PUT request is incorrectly formatted, doPut returns an HTTP "Bad Request" message.

Parameters:
req - the HttpServletRequest object that contains the request the client made of the servlet
resp - the HttpServletResponse object that contains the response the servlet returns to the client
Throws:
IOException - if an input or output error occurs while the servlet is handling the PUT request
ServletException - if the request for the PUT cannot be handled

protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
由服务器调用（通过 service 方法），以允许 servlet 处理 DELETE 请求。 DELETE 操作允许客户端从服务器中移除文档或 Web 页面。

此方法不需要是安全的或幂等的。通过 DELETE 请求的操作可能具有用户需要负责的副作用。使用此方法时，在临时存储器中保存受影响 URL 的副本可能会很有用。

如果不正确地格式化 HTTP DELETE 请求，则 doDelete 返回一条 HTTP "Bad Request" 消息。

req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
resp | 包含 servlet 向客户端返回的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在 servlet 处理 DELETE 请求期间发生输入或输出错误
Throws | ServletException: 如果无法处理对 DELETE 的请求
英文文档：

doDelete

protected void doDelete(HttpServletRequest req,
                        HttpServletResponse resp)
                 throws ServletException,
                        IOException
Called by the server (via the service method) to allow a servlet to handle a DELETE request. The DELETE operation allows a client to remove a document or Web page from the server.

This method does not need to be either safe or idempotent. Operations requested through DELETE can have side effects for which users can be held accountable. When using this method, it may be useful to save a copy of the affected URL in temporary storage.

If the HTTP DELETE request is incorrectly formatted, doDelete returns an HTTP "Bad Request" message.

Parameters:
req - the HttpServletRequest object that contains the request the client made of the servlet
resp - the HttpServletResponse object that contains the response the servlet returns to the client
Throws:
IOException - if an input or output error occurs while the servlet is handling the DELETE request
ServletException - if the request for the DELETE cannot be handled

protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
由服务器调用（通过 service 方法），以允许 servlet 处理 OPTIONS 请求。 OPTIONS 请求可确定服务器支持哪些 HTTP 方法，并返回相应的头。例如，如果 servlet 重写 doGet，则此方法返回以下头：

Allow:GET, HEAD, TRACE, OPTIONS

无需重写此方法，除非 servlet 实现了 HTTP 1.1 实现的那些方法以外的新 HTTP 方法。

req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
resp | 包含 servlet 向客户端返回的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在 servlet 处理 OPTIONS 请求期间发生输入或输出错误
Throws | ServletException: 如果无法处理对 OPTIONS 的请求
英文文档：

doOptions

protected void doOptions(HttpServletRequest req,
                         HttpServletResponse resp)
                  throws ServletException,
                         IOException
Called by the server (via the service method) to allow a servlet to handle a OPTIONS request. The OPTIONS request determines which HTTP methods the server supports and returns an appropriate header. For example, if a servlet overrides doGet, this method returns the following header:

Allow: GET, HEAD, TRACE, OPTIONS

There's no need to override this method unless the servlet implements new HTTP methods, beyond those implemented by HTTP 1.1.

Parameters:
req - the HttpServletRequest object that contains the request the client made of the servlet
resp - the HttpServletResponse object that contains the response the servlet returns to the client
Throws:
IOException - if an input or output error occurs while the servlet is handling the OPTIONS request
ServletException - if the request for the OPTIONS cannot be handled

protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
由服务器调用（通过 service 方法），以允许 servlet 处理 TRACE 请求。 TRACE 将随 TRACE 请求一起发送的头返回给客户端，以便在调试中使用它们。无需重写此方法。
req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
resp | 包含 servlet 向客户端返回的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在 servlet 处理 TRACE 请求期间发生输入或输出错误
Throws | ServletException: 如果无法处理对 TRACE 的请求
英文文档：

doTrace

protected void doTrace(HttpServletRequest req,
                       HttpServletResponse resp)
                throws ServletException,
                       IOException
Called by the server (via the service method) to allow a servlet to handle a TRACE request. A TRACE returns the headers sent with the TRACE request to the client, so that they can be used in debugging. There's no need to override this method.

Parameters:
req - the HttpServletRequest object that contains the request the client made of the servlet
resp - the HttpServletResponse object that contains the response the servlet returns to the client
Throws:
IOException - if an input or output error occurs while the servlet is handling the TRACE request
ServletException - if the request for the TRACE cannot be handled

protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
接收来自 public service 方法的标准 HTTP 请求，并将它们分发给此类中定义的 do XXX 方法。此方法是 javax.servlet.Servlet#service 方法的特定于 HTTP 的版本。无需重写此方法。
req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
resp | 包含 servlet 向客户端返回的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在处理 HTTP 请求期间发生输入或输出错误
Throws | ServletException: 如果无法处理 HTTP 请求
See also | service
英文文档：

service

protected void service(HttpServletRequest req,
                       HttpServletResponse resp)
                throws ServletException,
                       IOException
Receives standard HTTP requests from the public service method and dispatches them to the do XXX methods defined in this class. This method is an HTTP-specific version of the Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) method. There's no need to override this method.

Parameters:
req - the HttpServletRequest object that contains the request the client made of the servlet
resp - the HttpServletResponse object that contains the response the servlet returns to the client
Throws:
IOException - if an input or output error occurs while the servlet is handling the HTTP request
ServletException - if the HTTP request cannot be handled
See Also:
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)

public void service(ServletRequest req, ServletResponse res) throws ServletException, java.io.IOException
将客户端请求分发给受保护的 service 方法。无需重写此方法。
req | 包含客户端对 servlet 发出的请求的 HttpServletRequest 对象
res | 包含 servlet 向客户端返回的响应的 HttpServletResponse 对象
Throws | java.io.IOException: 如果在处理 HTTP 请求期间发生输入或输出错误
Throws | ServletException: 如果无法处理 HTTP 请求
See also | service
英文文档：

service

public void service(ServletRequest req,
                    ServletResponse res)
             throws ServletException,
                    IOException
Dispatches client requests to the protected service method. There's no need to override this method.

Specified by:
service in interface Servlet
Specified by:
service in class GenericServlet
Parameters:
req - the HttpServletRequest object that contains the request the client made of the servlet
res - the HttpServletResponse object that contains the response the servlet returns to the client
Throws:
IOException - if an input or output error occurs while the servlet is handling the HTTP request
ServletException - if the HTTP request cannot be handled
See Also:
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpServletRequestWrapper (Java EE 5)

javax.servlet.http
Class HttpServletRequestWrapper

java.lang.Object
    extended by  javax.servlet.ServletRequestWrapper
        extended by  javax.servlet.http.HttpServletRequestWrapper
All Implemented Interfaces:
HttpServletRequest, ServletRequest
public class HttpServletRequestWrapper
extends ServletRequestWrapper
implements HttpServletRequest

Extends: ServletRequestWrapper
Implements: HttpServletRequest

提供 HttpServletRequest 接口的便捷实现，希望将请求适配到 Servlet 的开发人员可以子类化该接口。此类实现 Wrapper 或 Decorator 模式。默认情况下，方法通过包装的请求对象调用。
since
en
v 2.3
See also javax.servlet.http.HttpServletRequest
英文文档：

Provides a convenient implementation of the HttpServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.

Since:
v 2.3
See Also:
HttpServletRequest

Field Summary
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor Summary
HttpServletRequestWrapper(HttpServletRequest request)
Constructs a request object wrapping the given request.
Method Summary
 String getAuthType()
The default behavior of this method is to return getAuthType() on the wrapped request object.
 String getContextPath()
The default behavior of this method is to return getContextPath() on the wrapped request object.
 Cookie[] getCookies()
The default behavior of this method is to return getCookies() on the wrapped request object.
 long getDateHeader(String name)
The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.
 String getHeader(String name)
The default behavior of this method is to return getHeader(String name) on the wrapped request object.
 Enumeration getHeaderNames()
The default behavior of this method is to return getHeaderNames() on the wrapped request object.
 Enumeration getHeaders(String name)
The default behavior of this method is to return getHeaders(String name) on the wrapped request object.
 int getIntHeader(String name)
The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.
 String getMethod()
The default behavior of this method is to return getMethod() on the wrapped request object.
 String getPathInfo()
The default behavior of this method is to return getPathInfo() on the wrapped request object.
 String getPathTranslated()
The default behavior of this method is to return getPathTranslated() on the wrapped request object.
 String getQueryString()
The default behavior of this method is to return getQueryString() on the wrapped request object.
 String getRemoteUser()
The default behavior of this method is to return getRemoteUser() on the wrapped request object.
 String getRequestedSessionId()
The default behavior of this method is to return getRequestedSessionId() on the wrapped request object.
 String getRequestURI()
The default behavior of this method is to return getRequestURI() on the wrapped request object.
 StringBuffer getRequestURL()
The default behavior of this method is to return getRequestURL() on the wrapped request object.
 String getServletPath()
The default behavior of this method is to return getServletPath() on the wrapped request object.
 HttpSession getSession()
The default behavior of this method is to return getSession() on the wrapped request object.
 HttpSession getSession(boolean create)
The default behavior of this method is to return getSession(boolean create) on the wrapped request object.
 Principal getUserPrincipal()
The default behavior of this method is to return getUserPrincipal() on the wrapped request object.
 boolean isRequestedSessionIdFromCookie()
The default behavior of this method is to return isRequestedSessionIdFromCookie() on the wrapped request object.
 boolean isRequestedSessionIdFromUrl()
The default behavior of this method is to return isRequestedSessionIdFromUrl() on the wrapped request object.
 boolean isRequestedSessionIdFromURL()
The default behavior of this method is to return isRequestedSessionIdFromURL() on the wrapped request object.
 boolean isRequestedSessionIdValid()
The default behavior of this method is to return isRequestedSessionIdValid() on the wrapped request object.
 boolean isUserInRole(String role)
The default behavior of this method is to return isUserInRole(String role) on the wrapped request object.
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding

Constructor Detail

public HttpServletRequestWrapper(HttpServletRequest request)
构造包装给定请求的请求对象。
Throws IllegalArgumentException: 如果 request 为 null
英文文档：

HttpServletRequestWrapper

public HttpServletRequestWrapper(HttpServletRequest request)
Constructs a request object wrapping the given request.

Throws:
IllegalArgumentException - if the request is null
Method Detail

public String getAuthType()
此方法的默认行为是返回对包装的请求对象调用 getAuthType() 的结果。
英文文档：

getAuthType

public String getAuthType()
The default behavior of this method is to return getAuthType() on the wrapped request object.

Specified by:
getAuthType in interface HttpServletRequest
Returns:
one of the static members BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) or the container-specific string indicating the authentication scheme, or null if the request was not authenticated.

public Cookie[] getCookies()
此方法的默认行为是返回对包装的请求对象调用 getCookies() 的结果。
英文文档：

getCookies

public Cookie[] getCookies()
The default behavior of this method is to return getCookies() on the wrapped request object.

Specified by:
getCookies in interface HttpServletRequest
Returns:
an array of all the Cookies included with this request, or null if the request has no cookies

public long getDateHeader(String name)
此方法的默认行为是返回对包装的请求对象调用 getDateHeader(String name) 的结果。
英文文档：

getDateHeader

public long getDateHeader(String name)
The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.

Specified by:
getDateHeader in interface HttpServletRequest
Parameters:
name - a String specifying the name of the header
Returns:
a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the request

public String getHeader(String name)
此方法的默认行为是返回对包装的请求对象调用 getHeader(String name) 的结果。
英文文档：

getHeader

public String getHeader(String name)
The default behavior of this method is to return getHeader(String name) on the wrapped request object.

Specified by:
getHeader in interface HttpServletRequest
Parameters:
name - a String specifying the header name
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name

public java.util.Enumeration<E> getHeaders(String name)
此方法的默认行为是返回对包装的请求对象调用 getHeaders(String name) 的结果。
英文文档：

getHeaders

public Enumeration getHeaders(String name)
The default behavior of this method is to return getHeaders(String name) on the wrapped request object.

Specified by:
getHeaders in interface HttpServletRequest
Parameters:
name - a String specifying the header name
Returns:
an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null

public java.util.Enumeration<E> getHeaderNames()
此方法的默认行为是返回对包装的请求对象调用 getHeaderNames() 的结果。
英文文档：

getHeaderNames

public Enumeration getHeaderNames()
The default behavior of this method is to return getHeaderNames() on the wrapped request object.

Specified by:
getHeaderNames in interface HttpServletRequest
Returns:
an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet container does not allow servlets to use this method, null

public int getIntHeader(String name)
此方法的默认行为是返回对包装的请求对象调用 getIntHeader(String name) 的结果。
英文文档：

getIntHeader

public int getIntHeader(String name)
The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.

Specified by:
getIntHeader in interface HttpServletRequest
Parameters:
name - a String specifying the name of a request header
Returns:
an integer expressing the value of the request header or -1 if the request doesn't have a header of this name

public String getMethod()
此方法的默认行为是返回对包装的请求对象调用 getMethod() 的结果。
英文文档：

getMethod

public String getMethod()
The default behavior of this method is to return getMethod() on the wrapped request object.

Specified by:
getMethod in interface HttpServletRequest
Returns:
a String specifying the name of the method with which this request was made

public String getPathInfo()
此方法的默认行为是返回对包装的请求对象调用 getPathInfo() 的结果。
英文文档：

getPathInfo

public String getPathInfo()
The default behavior of this method is to return getPathInfo() on the wrapped request object.

Specified by:
getPathInfo in interface HttpServletRequest
Returns:
a String, decoded by the web container, specifying extra path information that comes after the servlet path but before the query string in the request URL; or null if the URL does not have any extra path information

public String getPathTranslated()
此方法的默认行为是返回对包装的请求对象调用 getPathTranslated() 的结果。
英文文档：

getPathTranslated

public String getPathTranslated()
The default behavior of this method is to return getPathTranslated() on the wrapped request object.

Specified by:
getPathTranslated in interface HttpServletRequest
Returns:
a String specifying the real path, or null if the URL does not have any extra path information

public String getContextPath()
此方法的默认行为是返回对包装的请求对象调用 getContextPath() 的结果。
英文文档：

getContextPath

public String getContextPath()
The default behavior of this method is to return getContextPath() on the wrapped request object.

Specified by:
getContextPath in interface HttpServletRequest
Returns:
a String specifying the portion of the request URI that indicates the context of the request
See Also:
ServletContext.getContextPath()

public String getQueryString()
此方法的默认行为是返回对包装的请求对象调用 getQueryString() 的结果。
英文文档：

getQueryString

public String getQueryString()
The default behavior of this method is to return getQueryString() on the wrapped request object.

Specified by:
getQueryString in interface HttpServletRequest
Returns:
a String containing the query string or null if the URL contains no query string. The value is not decoded by the container.

public String getRemoteUser()
此方法的默认行为是返回对包装的请求对象调用 getRemoteUser() 的结果。
英文文档：

getRemoteUser

public String getRemoteUser()
The default behavior of this method is to return getRemoteUser() on the wrapped request object.

Specified by:
getRemoteUser in interface HttpServletRequest
Returns:
a String specifying the login of the user making this request, or null if the user login is not known

public boolean isUserInRole(String role)
此方法的默认行为是返回对包装的请求对象调用 isUserInRole(String role) 的结果。
英文文档：

isUserInRole

public boolean isUserInRole(String role)
The default behavior of this method is to return isUserInRole(String role) on the wrapped request object.

Specified by:
isUserInRole in interface HttpServletRequest
Parameters:
role - a String specifying the name of the role
Returns:
a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated

public java.security.Principal getUserPrincipal()
此方法的默认行为是返回对包装的请求对象调用 getUserPrincipal() 的结果。
英文文档：

getUserPrincipal

public Principal getUserPrincipal()
The default behavior of this method is to return getUserPrincipal() on the wrapped request object.

Specified by:
getUserPrincipal in interface HttpServletRequest
Returns:
a java.security.Principal containing the name of the user making this request; null if the user has not been authenticated

public String getRequestedSessionId()
此方法的默认行为是返回对包装的请求对象调用 getRequestedSessionId() 的结果。
英文文档：

getRequestedSessionId

public String getRequestedSessionId()
The default behavior of this method is to return getRequestedSessionId() on the wrapped request object.

Specified by:
getRequestedSessionId in interface HttpServletRequest
Returns:
a String specifying the session ID, or null if the request did not specify a session ID
See Also:
HttpServletRequest.isRequestedSessionIdValid()

public String getRequestURI()
此方法的默认行为是返回对包装的请求对象调用 getRequestURI() 的结果。
英文文档：

getRequestURI

public String getRequestURI()
The default behavior of this method is to return getRequestURI() on the wrapped request object.

Specified by:
getRequestURI in interface HttpServletRequest
Returns:
a String containing the part of the URL from the protocol name up to the query string
See Also:
HttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)

public StringBuffer getRequestURL()
此方法的默认行为是返回对包装的请求对象调用 getRequestURL() 的结果。
英文文档：

getRequestURL

public StringBuffer getRequestURL()
The default behavior of this method is to return getRequestURL() on the wrapped request object.

Specified by:
getRequestURL in interface HttpServletRequest
Returns:
a StringBuffer object containing the reconstructed URL

public String getServletPath()
此方法的默认行为是返回对包装的请求对象调用 getServletPath() 的结果。
英文文档：

getServletPath

public String getServletPath()
The default behavior of this method is to return getServletPath() on the wrapped request object.

Specified by:
getServletPath in interface HttpServletRequest
Returns:
a String containing the name or path of the servlet being called, as specified in the request URL, decoded, or an empty string if the servlet used to process the request is matched using the "/*" pattern.

public HttpSession getSession(boolean create)
此方法的默认行为是返回对包装的请求对象调用 getSession(boolean create) 的结果。
英文文档：

getSession

public HttpSession getSession(boolean create)
The default behavior of this method is to return getSession(boolean create) on the wrapped request object.

Specified by:
getSession in interface HttpServletRequest
Parameters:
create - true to create a new session for this request if necessary; false to return null if there's no current session
Returns:
the HttpSession associated with this request or null if create is false and the request has no valid session
See Also:
HttpServletRequest.getSession()

public HttpSession getSession()
此方法的默认行为是返回对包装的请求对象调用 getSession() 的结果。
英文文档：

getSession

public HttpSession getSession()
The default behavior of this method is to return getSession() on the wrapped request object.

Specified by:
getSession in interface HttpServletRequest
Returns:
the HttpSession associated with this request
See Also:
HttpServletRequest.getSession(boolean)

public boolean isRequestedSessionIdValid()
此方法的默认行为是返回对包装的请求对象调用 isRequestedSessionIdValid() 的结果。
英文文档：

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
The default behavior of this method is to return isRequestedSessionIdValid() on the wrapped request object.

Specified by:
isRequestedSessionIdValid in interface HttpServletRequest
Returns:
true if this request has an id for a valid session in the current session context; false otherwise
See Also:
HttpServletRequest.getRequestedSessionId(), HttpServletRequest.getSession(boolean), HttpSessionContext

public boolean isRequestedSessionIdFromCookie()
此方法的默认行为是返回对包装的请求对象调用 isRequestedSessionIdFromCookie() 的结果。
英文文档：

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
The default behavior of this method is to return isRequestedSessionIdFromCookie() on the wrapped request object.

Specified by:
isRequestedSessionIdFromCookie in interface HttpServletRequest
Returns:
true if the session ID came in as a cookie; otherwise, false
See Also:
HttpServletRequest.getSession(boolean)

public boolean isRequestedSessionIdFromURL()
此方法的默认行为是返回对包装的请求对象调用 isRequestedSessionIdFromURL() 的结果。
英文文档：

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
The default behavior of this method is to return isRequestedSessionIdFromURL() on the wrapped request object.

Specified by:
isRequestedSessionIdFromURL in interface HttpServletRequest
Returns:
true if the session ID came in as part of a URL; otherwise, false
See Also:
HttpServletRequest.getSession(boolean)

public boolean isRequestedSessionIdFromUrl()
此方法的默认行为是返回对包装的请求对象调用 isRequestedSessionIdFromUrl() 的结果。
英文文档：

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
The default behavior of this method is to return isRequestedSessionIdFromUrl() on the wrapped request object.

Specified by:
isRequestedSessionIdFromUrl in interface HttpServletRequest
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpServletResponseWrapper (Java EE 5)

javax.servlet.http
Class HttpServletResponseWrapper

java.lang.Object
    extended by  javax.servlet.ServletResponseWrapper
        extended by  javax.servlet.http.HttpServletResponseWrapper
All Implemented Interfaces:
HttpServletResponse, ServletResponse
public class HttpServletResponseWrapper
extends ServletResponseWrapper
implements HttpServletResponse

Extends: ServletResponseWrapper
Implements: HttpServletResponse

提供 HttpServletResponse 接口的便捷实现，希望根据 Servlet 适配响应的开发人员可以子类化该接口。此类实现 Wrapper 或 Decorator 模式。默认情况下，方法通过包装的响应对象调用。
since
en
v 2.3
See also javax.servlet.http.HttpServletResponse
英文文档：

Provides a convenient implementation of the HttpServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped response object.

Since:
v 2.3
Author:
Various
See Also:
HttpServletResponse

Field Summary
Fields inherited from interface javax.servlet.http.HttpServletResponse
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
Constructor Summary
HttpServletResponseWrapper(HttpServletResponse response)
Constructs a response adaptor wrapping the given response.
Method Summary
 void addCookie(Cookie cookie)
The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object.
 void addDateHeader(String name, long date)
The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object.
 void addHeader(String name, String value)
The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.
 void addIntHeader(String name, int value)
The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.
 boolean containsHeader(String name)
The default behavior of this method is to call containsHeader(String name) on the wrapped response object.
 String encodeRedirectUrl(String url)
The default behavior of this method is to return encodeRedirectUrl(String url) on the wrapped response object.
 String encodeRedirectURL(String url)
The default behavior of this method is to return encodeRedirectURL(String url) on the wrapped response object.
 String encodeUrl(String url)
The default behavior of this method is to call encodeUrl(String url) on the wrapped response object.
 String encodeURL(String url)
The default behavior of this method is to call encodeURL(String url) on the wrapped response object.
 void sendError(int sc)
The default behavior of this method is to call sendError(int sc) on the wrapped response object.
 void sendError(int sc, String msg)
The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.
 void sendRedirect(String location)
The default behavior of this method is to return sendRedirect(String location) on the wrapped response object.
 void setDateHeader(String name, long date)
The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object.
 void setHeader(String name, String value)
The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.
 void setIntHeader(String name, int value)
The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.
 void setStatus(int sc)
The default behavior of this method is to call setStatus(int sc) on the wrapped response object.
 void setStatus(int sc, String sm)
The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.
Methods inherited from class javax.servlet.ServletResponseWrapper
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getResponse, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale, setResponse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.ServletResponse
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale

Constructor Detail

public HttpServletResponseWrapper(HttpServletResponse response)
构造包装给定响应的响应适配器。
Throws IllegalArgumentException: 如果 response 为 null
英文文档：

HttpServletResponseWrapper

public HttpServletResponseWrapper(HttpServletResponse response)
Constructs a response adaptor wrapping the given response.

Throws:
IllegalArgumentException - if the response is null
Method Detail

public void addCookie(Cookie cookie)
此方法的默认行为是对包装的响应对象调用 addCookie(Cookie cookie)。
英文文档：

addCookie

public void addCookie(Cookie cookie)
The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object.

Specified by:
addCookie in interface HttpServletResponse
Parameters:
cookie - the Cookie to return to the client

public boolean containsHeader(String name)
此方法的默认行为是对包装的响应对象调用 containsHeader(String name)。
英文文档：

containsHeader

public boolean containsHeader(String name)
The default behavior of this method is to call containsHeader(String name) on the wrapped response object.

Specified by:
containsHeader in interface HttpServletResponse
Parameters:
name - the header name
Returns:
true if the named response header has already been set; false otherwise

public String encodeURL(String url)
此方法的默认行为是对包装的响应对象调用 encodeURL(String url)。
英文文档：

encodeURL

public String encodeURL(String url)
The default behavior of this method is to call encodeURL(String url) on the wrapped response object.

Specified by:
encodeURL in interface HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.

public String encodeRedirectURL(String url)
此方法的默认行为是返回对包装的响应对象调用 encodeRedirectURL(String url) 的结果。
英文文档：

encodeRedirectURL

public String encodeRedirectURL(String url)
The default behavior of this method is to return encodeRedirectURL(String url) on the wrapped response object.

Specified by:
encodeRedirectURL in interface HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.
See Also:
HttpServletResponse.sendRedirect(java.lang.String), HttpServletResponse.encodeUrl(java.lang.String)

public String encodeUrl(String url)
此方法的默认行为是对包装的响应对象调用 encodeUrl(String url)。
英文文档：

encodeUrl

public String encodeUrl(String url)
The default behavior of this method is to call encodeUrl(String url) on the wrapped response object.

Specified by:
encodeUrl in interface HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.

public String encodeRedirectUrl(String url)
此方法的默认行为是返回对包装的响应对象调用 encodeRedirectUrl(String url) 的结果。
英文文档：

encodeRedirectUrl

public String encodeRedirectUrl(String url)
The default behavior of this method is to return encodeRedirectUrl(String url) on the wrapped response object.

Specified by:
encodeRedirectUrl in interface HttpServletResponse
Parameters:
url - the url to be encoded.
Returns:
the encoded URL if encoding is needed; the unchanged URL otherwise.

public void sendError(int sc, String msg) throws java.io.IOException
此方法的默认行为是对包装的响应对象调用 sendError(int sc, String msg)。
英文文档：

sendError

public void sendError(int sc,
                      String msg)
               throws IOException
The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.

Specified by:
sendError in interface HttpServletResponse
Parameters:
sc - the error status code
msg - the descriptive message
Throws:
IOException - If an input or output exception occurs

public void sendError(int sc) throws java.io.IOException
此方法的默认行为是对包装的响应对象调用 sendError(int sc)。
英文文档：

sendError

public void sendError(int sc)
               throws IOException
The default behavior of this method is to call sendError(int sc) on the wrapped response object.

Specified by:
sendError in interface HttpServletResponse
Parameters:
sc - the error status code
Throws:
IOException - If an input or output exception occurs

public void sendRedirect(String location) throws java.io.IOException
此方法的默认行为是返回对包装的响应对象调用 sendRedirect(String location) 的结果。
英文文档：

sendRedirect

public void sendRedirect(String location)
                  throws IOException
The default behavior of this method is to return sendRedirect(String location) on the wrapped response object.

Specified by:
sendRedirect in interface HttpServletResponse
Parameters:
location - the redirect location URL
Throws:
IOException - If an input or output exception occurs

public void setDateHeader(String name, long date)
此方法的默认行为是对包装的响应对象调用 setDateHeader(String name, long date)。
英文文档：

setDateHeader

public void setDateHeader(String name,
                          long date)
The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object.

Specified by:
setDateHeader in interface HttpServletResponse
Parameters:
name - the name of the header to set
date - the assigned date value
See Also:
HttpServletResponse.containsHeader(java.lang.String), HttpServletResponse.addDateHeader(java.lang.String, long)

public void addDateHeader(String name, long date)
此方法的默认行为是对包装的响应对象调用 addDateHeader(String name, long date)。
英文文档：

addDateHeader

public void addDateHeader(String name,
                          long date)
The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object.

Specified by:
addDateHeader in interface HttpServletResponse
Parameters:
name - the name of the header to set
date - the additional date value
See Also:
HttpServletResponse.setDateHeader(java.lang.String, long)

public void setHeader(String name, String value)
此方法的默认行为是返回对包装的响应对象调用 setHeader(String name, String value) 的结果。
英文文档：

setHeader

public void setHeader(String name,
                      String value)
The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.

Specified by:
setHeader in interface HttpServletResponse
Parameters:
name - the name of the header
value - the header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
See Also:
HttpServletResponse.containsHeader(java.lang.String), HttpServletResponse.addHeader(java.lang.String, java.lang.String)

public void addHeader(String name, String value)
此方法的默认行为是返回对包装的响应对象调用 addHeader(String name, String value) 的结果。
英文文档：

addHeader

public void addHeader(String name,
                      String value)
The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.

Specified by:
addHeader in interface HttpServletResponse
Parameters:
name - the name of the header
value - the additional header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
See Also:
HttpServletResponse.setHeader(java.lang.String, java.lang.String)

public void setIntHeader(String name, int value)
此方法的默认行为是对包装的响应对象调用 setIntHeader(String name, int value)。
英文文档：

setIntHeader

public void setIntHeader(String name,
                         int value)
The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.

Specified by:
setIntHeader in interface HttpServletResponse
Parameters:
name - the name of the header
value - the assigned integer value
See Also:
HttpServletResponse.containsHeader(java.lang.String), HttpServletResponse.addIntHeader(java.lang.String, int)

public void addIntHeader(String name, int value)
此方法的默认行为是对包装的响应对象调用 addIntHeader(String name, int value)。
英文文档：

addIntHeader

public void addIntHeader(String name,
                         int value)
The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.

Specified by:
addIntHeader in interface HttpServletResponse
Parameters:
name - the name of the header
value - the assigned integer value
See Also:
HttpServletResponse.setIntHeader(java.lang.String, int)

public void setStatus(int sc)
此方法的默认行为是对包装的响应对象调用 setStatus(int sc)。
英文文档：

setStatus

public void setStatus(int sc)
The default behavior of this method is to call setStatus(int sc) on the wrapped response object.

Specified by:
setStatus in interface HttpServletResponse
Parameters:
sc - the status code
See Also:
HttpServletResponse.sendError(int, java.lang.String)

public void setStatus(int sc, String sm)
此方法的默认行为是对包装的响应对象调用 setStatus(int sc, String sm)。
英文文档：

setStatus

public void setStatus(int sc,
                      String sm)
The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.

Specified by:
setStatus in interface HttpServletResponse
Parameters:
sc - the status code
sm - the status message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionBindingEvent (Java EE 5)

javax.servlet.http
Class HttpSessionBindingEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.servlet.http.HttpSessionEvent
            extended by  javax.servlet.http.HttpSessionBindingEvent
All Implemented Interfaces:
Serializable
public class HttpSessionBindingEvent
extends HttpSessionEvent

Extends: java.util.EventObject > HttpSessionEvent

这种类型的事件将发送到绑定到会话或从会话中取消绑定时实现 HttpSessionBindingListener 的对象，或者发送到绑定、取消绑定或替换会话中的任何属性时已在部署描述符中配置好的 HttpSessionAttributeListener。

会话通过调用 HttpSession.setAttribute 绑定对象，通过调用 HttpSession.removeAttribute 取消绑定对象。

See also javax.servlet.http.HttpSession, javax.servlet.http.HttpSessionBindingListener, javax.servlet.http.HttpSessionAttributeListener
英文文档：

Events of this type are either sent to an object that implements HttpSessionBindingListener when it is bound or unbound from a session, or to a HttpSessionAttributeListener that has been configured in the deployment descriptor when any attribute is bound, unbound or replaced in a session.

The session binds the object by a call to HttpSession.setAttribute and unbinds the object by a call to HttpSession.removeAttribute.

Author:
Various
See Also:
HttpSession, HttpSessionBindingListener, HttpSessionAttributeListener, Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
HttpSessionBindingEvent(HttpSession session, String name)
Constructs an event that notifies an object that it has been bound to or unbound from a session.
HttpSessionBindingEvent(HttpSession session, String name, Object value)
Constructs an event that notifies an object that it has been bound to or unbound from a session.
Method Summary
String | getName() Returns the name with which the attribute is bound to or unbound from the session.
HttpSession | getSession() Return the session that changed.
Object | getValue() Returns the value of the attribute that has been added, removed or replaced.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public HttpSessionBindingEvent(HttpSession session, String name)
构造一个事件，通知对象它已经被绑定到会话，或者已经从会话中取消了对它的绑定。要接收该事件，对象必须实现 HttpSessionBindingListener。
session | 将对象绑定到或从中取消绑定的会话
name | 用来绑定或取消绑定对象的名称
See also | getName, getSession
英文文档：

HttpSessionBindingEvent

public HttpSessionBindingEvent(HttpSession session,
                               String name)
Constructs an event that notifies an object that it has been bound to or unbound from a session. To receive the event, the object must implement HttpSessionBindingListener.

Parameters:
session - the session to which the object is bound or unbound
name - the name with which the object is bound or unbound
See Also:
getName(), getSession()

public HttpSessionBindingEvent(HttpSession session, String name, Object value)
构造一个事件，通知对象它已经被绑定到会话，或者已经从会话中取消了对它的绑定。要接收该事件，对象必须实现 HttpSessionBindingListener。
session | 将对象绑定到或从中取消绑定的会话
name | 用来绑定或取消绑定对象的名称
See also | getName, getSession
英文文档：

HttpSessionBindingEvent

public HttpSessionBindingEvent(HttpSession session,
                               String name,
                               Object value)
Constructs an event that notifies an object that it has been bound to or unbound from a session. To receive the event, the object must implement HttpSessionBindingListener.

Parameters:
session - the session to which the object is bound or unbound
name - the name with which the object is bound or unbound
See Also:
getName(), getSession()
Method Detail

public HttpSession getSession()
返回更改的会话。
英文文档：

getSession

public HttpSession getSession()
Return the session that changed.

Overrides:
getSession in class HttpSessionEvent

public String getName()
返回用来将属性绑定到会话或从会话中取消属性绑定的名称。
return 指定用来将对象绑定到会话或从会话中取消绑定对象的名称的字符串
英文文档：

getName

public String getName()
Returns the name with which the attribute is bound to or unbound from the session.

Returns:
a string specifying the name with which the object is bound to or unbound from the session

public Object getValue()
返回已添加、移除或替换的属性的值。如果添加（或绑定）了属性，则这是该属性的值。如果移除（或取消绑定）了属性，则这是被移除属性的值。如果替换了属性，则这是属性原来的值。
since 2.3
英文文档：

getValue

public Object getValue()
Returns the value of the attribute that has been added, removed or replaced. If the attribute was added (or bound), this is the value of the attribute. If the attribute was removed (or unbound), this is the value of the removed attribute. If the attribute was replaced, this is the old value of the attribute.

Since:
2.3
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpSessionEvent (Java EE 5)

javax.servlet.http
Class HttpSessionEvent

java.lang.Object
    extended by  java.util.EventObject
        extended by  javax.servlet.http.HttpSessionEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpSessionBindingEvent
public class HttpSessionEvent
extends EventObject

Extends: java.util.EventObject
Extended by: HttpSessionBindingEvent

这是表示 Web 应用程序内会话更改的事件通知的类。
since
en
v 2.3
英文文档：

This is the class representing event notifications for changes to sessions within a web application.

Since:
v 2.3
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.EventObject
source
Constructor Summary
HttpSessionEvent(HttpSession source)
Construct a session event from the given source.
Method Summary
 HttpSession getSession()
Return the session that changed.
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public HttpSessionEvent(HttpSession source)
构造来自给定源的会话事件。
英文文档：

HttpSessionEvent

public HttpSessionEvent(HttpSession source)
Construct a session event from the given source.

Method Detail

public HttpSession getSession()
返回更改的会话。
英文文档：

getSession

public HttpSession getSession()
Return the session that changed.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HttpUtils (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.http
Class HttpUtils

java.lang.Object
    extended by  javax.servlet.http.HttpUtils
Deprecated. As of Java(tm) Servlet API 2.3. These methods were only useful with the default encoding and have been moved to the request interfaces.

deprecated 从 Java(tm) Servlet API 2.3 起。这些方法只在与默认编码一起使用时有用，并且它们已经移动到请求接口中。
英文文档：

public class HttpUtils
extends Object

Constructor Summary
HttpUtils()
Deprecated. Constructs an empty HttpUtils object.
Method Summary
static StringBuffer | getRequestURL(HttpServletRequest req) Deprecated. Reconstructs the URL the client used to make the request, using information in the HttpServletRequest object.
static Hashtable | parsePostData(int len, ServletInputStream in) Deprecated. Parses data from an HTML form that the client sends to the server using the HTTP POST method and the application/x-www-form-urlencoded MIME type.
static Hashtable | parseQueryString(String s) Deprecated. Parses a query string passed from the client to the server and builds a HashTable object with key-value pairs.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public HttpUtils()
构造一个空的 HttpUtils 对象。
英文文档：

HttpUtils

public HttpUtils()
Deprecated.
Constructs an empty HttpUtils object.

Method Detail

public static java.util.Hashtable<K, V> parseQueryString(String s)
解析从客户端传递到服务器的查询字符串，并使用键-值对构建一个 HashTable 对象。查询字符串应该采用 GET 或 POST 方法打包的字符串形式，也就是说，应该是键=值 形式的键-值对，每个对与下一个对之间用 & 字符隔开。

在具有不同值的查询字符串中键可以出现多次。但是，在哈希表中键只能出现一次，其值是包含查询字符串发送的多个值的字符串数组。

哈希表中的键和值以其解码形式存储，因此任何 + 字符都将被转换为空格，以十六进制符号（如 %xx）形式发送的字符将被转换为 ASCII 字符。

s | 包含要解析的查询的字符串
return | 根据解析的键-值对构建的 HashTable 对象
Throws | IllegalArgumentException: 如果查询字符串无效
英文文档：

parseQueryString

public static Hashtable parseQueryString(String s)
Deprecated.
Parses a query string passed from the client to the server and builds a HashTable object with key-value pairs. The query string should be in the form of a string packaged by the GET or POST method, that is, it should have key-value pairs in the form key=value, with each pair separated from the next by a & character.

A key can appear more than once in the query string with different values. However, the key appears only once in the hashtable, with its value being an array of strings containing the multiple values sent by the query string.

The keys and values in the hashtable are stored in their decoded form, so any + characters are converted to spaces, and characters sent in hexadecimal notation (like %xx) are converted to ASCII characters.

Parameters:
s - a string containing the query to be parsed
Returns:
a HashTable object built from the parsed key-value pairs
Throws:
IllegalArgumentException - if the query string is invalid

public static java.util.Hashtable<K, V> parsePostData(int len, ServletInputStream in)
解析来自 HTML 表单的客户端使用 HTTP POST 方法和 application/x-www-form-urlencoded MIME 类型发送到服务器的数据。

通过 POST 方法发送的数据包含键-值对。在具有不同值的 POST 数据中键可以出现多次。但是，在哈希表中键只能出现一次，其值是包含 POST 方法发送的多个值的字符串数组。

哈希表中的键和值以其解码形式存储，因此任何 + 字符都将被转换为空格，以十六进制符号（如 %xx）形式发送的字符将被转换为 ASCII 字符。

len | 指定也被传递给此方法的 ServletInputStream 对象的长度的整数，以字符为单位
in | 包含从客户端发送的数据的 ServletInputStream 对象
return | 根据解析的键-值对构建的 HashTable 对象
Throws | IllegalArgumentException: 如果 POST 方法发送的数据无效
英文文档：

parsePostData

public static Hashtable parsePostData(int len,
                                      ServletInputStream in)
Deprecated.
Parses data from an HTML form that the client sends to the server using the HTTP POST method and the application/x-www-form-urlencoded MIME type.

The data sent by the POST method contains key-value pairs. A key can appear more than once in the POST data with different values. However, the key appears only once in the hashtable, with its value being an array of strings containing the multiple values sent by the POST method.

The keys and values in the hashtable are stored in their decoded form, so any + characters are converted to spaces, and characters sent in hexadecimal notation (like %xx) are converted to ASCII characters.

Parameters:
len - an integer specifying the length, in characters, of the ServletInputStream object that is also passed to this method
in - the ServletInputStream object that contains the data sent from the client
Returns:
a HashTable object built from the parsed key-value pairs
Throws:
IllegalArgumentException - if the data sent by the POST method is invalid

public static StringBuffer getRequestURL(HttpServletRequest req)
使用 HttpServletRequest 对象中的信息重新构造客户端用于发出请求的 URL。返回的 URL 包含一个协议、服务器名称、端口号、服务器路径，但是不包含查询字符串参数。

因为此方法返回 StringBuffer 而不是字符串，所以可以轻松地修改 URL，例如，可以追加查询参数。

此方法对于创建重定向消息和报告错误很有用。

req | 包含客户端请求的 HttpServletRequest 对象
return | 包含重新构造的 URL 的 StringBuffer 对象
英文文档：

getRequestURL

public static StringBuffer getRequestURL(HttpServletRequest req)
Deprecated.
Reconstructs the URL the client used to make the request, using information in the HttpServletRequest object. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

Because this method returns a StringBuffer, not a string, you can modify the URL easily, for example, to append query parameters.

This method is useful for creating redirect messages and for reporting errors.

Parameters:
req - a HttpServletRequest object containing the client's request
Returns:
a StringBuffer object containing the reconstructed URL
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.servlet.jsp (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.servlet.jsp

Classes and interfaces for the Core JSP 2.1 API.

See:
Description

Interface Summary
HttpJspPage | The HttpJspPage interface describes the interaction that a JSP Page Implementation Class must satisfy when using the HTTP protocol.
JspApplicationContext | Stores application-scoped information relevant to JSP containers.
JspPage | The JspPage interface describes the generic interaction that a JSP Page Implementation class must satisfy; pages that use the HTTP protocol are described by the HttpJspPage interface.

Class Summary
ErrorData | Contains information about an error, for error pages.
JspContext | JspContext serves as the base class for the PageContext class and abstracts all information that is not specific to servlets.
JspEngineInfo | The JspEngineInfo is an abstract class that provides information on the current JSP engine.
JspFactory | The JspFactory is an abstract class that defines a number of factory methods available to a JSP page at runtime for the purposes of creating instances of various interfaces and classes used to support the JSP implementation.
JspWriter | The actions and template data in a JSP page is written using the JspWriter object that is referenced by the implicit variable out which is initialized automatically using methods in the PageContext object.
PageContext | PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment.

Exception Summary
JspException | A generic exception known to the JSP engine; uncaught JspExceptions will result in an invocation of the errorpage machinery.
JspTagException | Exception to be used by a Tag Handler to indicate some unrecoverable error.
SkipPageException | Exception to indicate the calling page must cease evaluation.

Package javax.servlet.jsp Description

Classes and interfaces for the Core JSP 2.1 API.

The javax.servlet.jsp package contains a number of classes and interfaces that describe and define the contracts between a JSP page implementation class and the runtime environment provided for an instance of such a class by a conforming JSP container.

JSP Page Implementation Object Contract

This section describes the basic contract between a JSP Page implementation object and its container.

The main contract is defined by the classes JspPage and HttpJspPage. The JspFactory class describes the mechanism to portably instantiate all needed runtime objects, and JspEngineInfo provides basic information on the current JSP container. Class JspApplicationContext stores application-scoped information relevant to JSP containers. It was added in JSP 2.1 to support the integration of the unified Expression Language.

None of these classes are intended to be used by JSP page authors; an example of how these classes may be used is included below.

Implicit Objects

The PageContext object and the JspWriter are available by default as implicit objects.

Exceptions

The JspException class is the base class for all JSP exceptions. The JspTagException and SkipPageException exceptions are used by the tag extension mechanism.

For JSP error pages, the ErrorData class encapsulates information about the error.

An Implementation Example

An instance of an implementation dependent subclass of the PageContext abstract base class can be created by a JSP implementation class at the beginning of it's _jspService() method via an implementation default JspFactory.

Here is one example of how to use these classes

 public class foo implements Servlet {

 // ...

public void _jspService(HttpServletRequest request,
                        HttpServletResponse response)
       throws IOException, ServletException {

    JspFactory  factory     = JspFactory.getDefaultFactory();
    PageContext pageContext = factory.getPageContext(
                                        this,
                                        request,
                                        response,
                                        null,  // errorPageURL
                                        false, // needsSession
                                        JspWriter.DEFAULT_BUFFER,
                                        true   // autoFlush
                                );

    // initialize implicit variables for scripting env ...

    HttpSession session = pageContext.getSession();
    JspWriter   out     = pageContext.getOut();
    Object      page    = this;

    try {
        // body of translated JSP here ...
    } catch (Exception e) {
        out.clear();
        pageContext.handlePageException(e);
    } finally {
        out.close();
          factory.releasePageContext(pageContext);
    }
}

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.servlet.jsp Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.servlet.jsp

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.servlet.jsp.ErrorData
    • javax.servlet.jsp.JspContext
      • javax.servlet.jsp.PageContext
    • javax.servlet.jsp.JspEngineInfo
    • javax.servlet.jsp.JspFactory
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.jsp.JspException
          • javax.servlet.jsp.JspTagException
          • javax.servlet.jsp.SkipPageException
    • java.io.Writer (implements java.lang.Appendable, java.io.Closeable, java.io.Flushable)
      • javax.servlet.jsp.JspWriter

Interface Hierarchy

  • javax.servlet.jsp.JspApplicationContext
  • javax.servlet.Servlet
    • javax.servlet.jsp.JspPage
      • javax.servlet.jsp.HttpJspPage
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


HttpJspPage (Java EE 5)

javax.servlet.jsp
Interface HttpJspPage

All Superinterfaces:
JspPage, Servlet
public interface HttpJspPage
extends JspPage

Implements: JspPage

HttpJspPage 接口描述使用 HTTP 协议时 JSP 页面实现类必须满足的交互。

该接口的行为等同于 JspPage 的行为，除了 _jspService 方法的签名，现在该签名在 Java 类型系统中是可表示的，并且显式包含在该接口中。

See also javax.servlet.jsp.JspPage
英文文档：

The HttpJspPage interface describes the interaction that a JSP Page Implementation Class must satisfy when using the HTTP protocol.

The behaviour is identical to that of the JspPage, except for the signature of the _jspService method, which is now expressible in the Java type system and included explicitly in the interface.

See Also:
JspPage

Method Summary
 void _jspService(HttpServletRequest request, HttpServletResponse response)
The _jspService()method corresponds to the body of the JSP page.
Methods inherited from interface javax.servlet.jsp.JspPage
jspDestroy, jspInit
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service

Method Detail

public void _jspService(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
_jspService() 方法对应于 JSP 页面的正文。此方法由 JSP 容器自动定义，不得由 JSP 页面作者定义。

如果使用扩展属性指定了超类，则该超类可以选择在调用 _jspService() 方法之前（或之后）在其 service() 方法中执行某些操作。请参见 JSP 规范 JSP_Engine 章节中有关使用扩展属性的内容。

request | 为 JSP 提供客户端请求信息。
response | 协助 JSP 将响应发送到客户端。
Throws | ServletException: 如果 JSP 处理期间发生错误，则抛出该异常，并且容器应该采取适当操作清除请求。
Throws | java.io.IOException: 如果写入此页面的响应时发生错误，则抛出该异常。
英文文档：

_jspService

void _jspService(HttpServletRequest request,
                 HttpServletResponse response)
                 throws ServletException,
                        IOException
The _jspService()method corresponds to the body of the JSP page. This method is defined automatically by the JSP container and should never be defined by the JSP page author.

If a superclass is specified using the extends attribute, that superclass may choose to perform some actions in its service() method before or after calling the _jspService() method. See using the extends attribute in the JSP_Engine chapter of the JSP specification.

Parameters:
request - Provides client request information to the JSP.
response - Assists the JSP in sending a response to the client.
Throws:
ServletException - Thrown if an error occurred during the processing of the JSP and that the container should take appropriate action to clean up the request.
IOException - Thrown if an error occurred while writing the response for this page.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspApplicationContext (Java EE 5)

javax.servlet.jsp
Interface JspApplicationContext

public interface JspApplicationContext

Stores application-scoped information relevant to JSP containers.

The JSP container must create a single instance of JspApplicationContext for each ServletContext instance.

An instance of JspApplicationContext is obtained by invoking the static JspFactory.getJspApplicationContext(javax.servlet.ServletContext) method, passing the ServletContext of the corresponding web application.

The JspApplicationContext provides the following services to JSP applications:

  • Allows registration of ELResolvers, which are used to resolve variables in EL expressions contained in JSP pages and tag files.
  • Provides an instance of ExpressionFactory for those applications or frameworks that need to perform programmatic evaluation of EL expressions instead of allowing the JSP container to do it for them.
  • Allows the attachment of ELContextListener instances for notification whenever a new ELContext is created. This is necessary when an application wishes to make custom context objects available to their pluggable ELResolvers.

Since:
JSP 2.1
See Also:
ServletContext, JspFactory, ELResolver, ExpressionFactory, ELContextListener

Method Summary
void | addELContextListener(ELContextListener listener) Registers a ELContextListeners so that context objects can be added whenever a new ELContext is created.
void | addELResolver(ELResolver resolver) Adds an ELResolver to affect the way EL variables and properties are resolved for EL expressions appearing in JSP pages and tag files.
ExpressionFactory | getExpressionFactory() Returns a factory used to create ValueExpressions and MethodExpressions so that EL expressions can be parsed and evaluated.

Method Detail

addELResolver

void addELResolver(ELResolver resolver)
Adds an ELResolver to affect the way EL variables and properties are resolved for EL expressions appearing in JSP pages and tag files.

For example, in the EL expression ${employee.lastName}, an ELResolver determines what object "employee" references and how to find its "lastName" property.

When evaluating an expression, the JSP container will consult a set of standard resolvers as well as any resolvers registered via this method. The set of resolvers are consulted in the following order:

  • ImplicitObjectELResolver
  • ELResolvers registered via this method, in the order in which they are registered.
  • MapELResolver
  • ListELResolver
  • ArrayELResolver
  • BeanELResolver
  • ScopedAttributeELResolver

It is illegal to register an ELResolver after the application has received any request from the client. If an attempt is made to register an ELResolver after that time, an IllegalStateException is thrown.

This restriction is in place to allow the JSP container to optimize for the common case where no additional ELResolvers are in the chain, aside from the standard ones. It is permissible to add ELResolvers before or after initialization to a CompositeELResolver that is already in the chain.

It is not possible to remove an ELResolver registered with this method, once it has been registered.

Parameters:
resolver - The new ELResolver
Throws:
IllegalStateException - if an attempt is made to call this method after all ServletContextListeners have had their contextInitialized methods invoked.

getExpressionFactory

ExpressionFactory getExpressionFactory()
Returns a factory used to create ValueExpressions and MethodExpressions so that EL expressions can be parsed and evaluated.

Returns:
A concrete implementation of the an ExpressionFactory.

addELContextListener

void addELContextListener(ELContextListener listener)
Registers a ELContextListeners so that context objects can be added whenever a new ELContext is created.

At a minimum, the ELContext objects created will contain a reference to the JspContext for this request, which is added by the JSP container. This is sufficient for all the default ELResolvers listed in addELResolver(javax.el.ELResolver). Note that JspContext.class is used as the key to ELContext.putContext() for the JspContext object reference.

This method is generally used by frameworks and applications that register their own ELResolver that needs context other than JspContext. The listener will typically add the necessary context to the ELContext provided in the event object. Registering a listener that adds context allows the ELResolvers in the stack to access the context they need when they do a resolution.

Parameters:
listener - The listener to be notified when a new ELContext is created.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature

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


JspPage (Java EE 5)

javax.servlet.jsp
Interface JspPage

All Superinterfaces:
Servlet
All Known Subinterfaces:
HttpJspPage
public interface JspPage
extends Servlet

Implements: Servlet
Implemented by: HttpJspPage

JspPage 接口描述 JSP 页面实现类必须满足的一般交互；使用 HTTP 协议的页面是通过 HttpJspPage 接口描述的。

两个方法加一个方法

该接口定义了一个具有 3 个方法的协议；其中只有两个方法：jspInit() 和 jspDestroy() 是此接口的一部分，因为第三个方法：_jspService() 的签名取决于使用的特定协议，并且无法使用 Java 中的一般方式表示。

实现此接口的类负责根据相应的基于 Servlet 的方法调用在适当时间调用上述方法。

jspInit() 和 jspDestroy() 方法可由 JSP 作者定义，但 _jspService() 方法是 JSP 处理器根据 JSP 页面内容自动定义的。

_jspService()

_jspService() 方法对应于 JSP 页面的正文。此方法由 JSP 容器自动定义，不得由 JSP 页面作者定义。

如果使用扩展属性指定了超类，则该超类可以选择在调用 _jspService() 方法之前（或之后）在其 service() 方法中执行某些操作。请参见 JSP 规范 JSP_Engine 章节中有关使用扩展属性的内容。

特定签名取决于 JSP 页面支持的协议。

public void _jspService(ServletRequestSubtype request,
ServletResponseSubtype response)
throws ServletException, IOException;
英文文档：

The JspPage interface describes the generic interaction that a JSP Page Implementation class must satisfy; pages that use the HTTP protocol are described by the HttpJspPage interface.

Two plus One Methods

The interface defines a protocol with 3 methods; only two of them: jspInit() and jspDestroy() are part of this interface as the signature of the third method: _jspService() depends on the specific protocol used and cannot be expressed in a generic way in Java.

A class implementing this interface is responsible for invoking the above methods at the appropriate time based on the corresponding Servlet-based method invocations.

The jspInit() and jspDestroy() methods can be defined by a JSP author, but the _jspService() method is defined automatically by the JSP processor based on the contents of the JSP page.

_jspService()

The _jspService()method corresponds to the body of the JSP page. This method is defined automatically by the JSP container and should never be defined by the JSP page author.

If a superclass is specified using the extends attribute, that superclass may choose to perform some actions in its service() method before or after calling the _jspService() method. See using the extends attribute in the JSP_Engine chapter of the JSP specification.

The specific signature depends on the protocol supported by the JSP page.

 public void _jspService(ServletRequestSubtype request,
                             ServletResponseSubtype response)
        throws ServletException, IOException;

Method Summary
 void jspDestroy()
The jspDestroy() method is invoked when the JSP page is about to be destroyed.
 void jspInit()
The jspInit() method is invoked when the JSP page is initialized.
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service

Method Detail

public void jspInit()
jspInit() 方法在初始化 JSP 页面时调用。此时调用 getServletConfig() 方法将返回所需的值，这由 JSP 实现（以及扩展属性提到的类，如果存在的话）负责。 JSP 页面可以通过在声明元素中包含该方法的定义重写此方法。 JSP 页面将重新定义来自 Servlet 的 init() 方法。
英文文档：

jspInit

void jspInit()
The jspInit() method is invoked when the JSP page is initialized. It is the responsibility of the JSP implementation (and of the class mentioned by the extends attribute, if present) that at this point invocations to the getServletConfig() method will return the desired value. A JSP page can override this method by including a definition for it in a declaration element. A JSP page should redefine the init() method from Servlet.

public void jspDestroy()
jspDestroy() 方法在 JSP 页面即将被销毁时调用。 JSP 页面可以通过在声明元素中包含该方法的定义重写此方法。 JSP 页面将重新定义来自 Servlet 的 destroy() 方法。
英文文档：

jspDestroy

void jspDestroy()
The jspDestroy() method is invoked when the JSP page is about to be destroyed. A JSP page can override this method by including a definition for it in a declaration element. A JSP page should redefine the destroy() method from Servlet.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ErrorData (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.jsp
Class ErrorData

java.lang.Object
    extended by  javax.servlet.jsp.ErrorData

public final class ErrorData
extends Object

包含关于错误的信息，用于错误页面。如果未在错误页面上下文中使用，则此实例中包含的信息是无意义的。要指示某个 JSP 是一个错误页面，页面作者必须将页面指令的 isErrorPage 属性设置为 "true"。
since | 2.0
See also | getErrorData
英文文档：

Contains information about an error, for error pages. The information contained in this instance is meaningless if not used in the context of an error page. To indicate a JSP is an error page, the page author must set the isErrorPage attribute of the page directive to "true".

Since:
JSP 2.0
See Also:
PageContext.getErrorData()

Constructor Summary
ErrorData(Throwable throwable, int statusCode, String uri, String servletName)
Creates a new ErrorData object.
Method Summary
String | getRequestURI() Returns the request URI.
String | getServletName() Returns the name of the servlet invoked.
int | getStatusCode() Returns the status code of the error.
Throwable | getThrowable() Returns the Throwable that caused the error.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ErrorData(Throwable throwable, int statusCode, String uri, String servletName)
创建新的 ErrorData 对象。
throwable | 导致错误的 Throwable
statusCode | 错误的状态代码
uri | 请求 URI
servletName | 调用的 servlet 的名称
英文文档：

ErrorData

public ErrorData(Throwable throwable,
                 int statusCode,
                 String uri,
                 String servletName)
Creates a new ErrorData object.

Parameters:
throwable - The Throwable that is the cause of the error
statusCode - The status code of the error
uri - The request URI
servletName - The name of the servlet invoked
Method Detail

public Throwable getThrowable()
返回导致错误的 Throwable。
return 导致错误的 Throwable
英文文档：

getThrowable

public Throwable getThrowable()
Returns the Throwable that caused the error.

Returns:
The Throwable that caused the error

public int getStatusCode()
返回错误的状态代码。
return 错误的状态代码
英文文档：

getStatusCode

public int getStatusCode()
Returns the status code of the error.

Returns:
The status code of the error

public String getRequestURI()
返回请求 URI。
return 请求 URI
英文文档：

getRequestURI

public String getRequestURI()
Returns the request URI.

Returns:
The request URI

public String getServletName()
返回调用的 servlet 的名称。
return 调用的 servlet 的名称
英文文档：

getServletName

public String getServletName()
Returns the name of the servlet invoked.

Returns:
The name of the servlet invoked
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JspContext (Java EE 5)

javax.servlet.jsp
Class JspContext

java.lang.Object
    extended by  javax.servlet.jsp.JspContext
Direct Known Subclasses:
PageContext
public abstract class JspContext
extends Object

Extended by: PageContext

JspContext 充当 PageContext 类的基类，并抽象化不特定于 servlet 的所有信息。这允许在请求/响应 Servlet 上下文以外使用简单标记扩展。

JspContext 为页面/组件作者和页面实现者提供了许多工具，其中包括：

  • 管理各种范围名称空间的单个 API
  • 获取 JspWriter 以供输出的机制
  • 向脚本环境公开页面指令属性的机制

供容器生成的代码使用的方法

以下方法使嵌套管理的 JspWriter 流能够实现标记扩展：pushBody() 和 popBody()

供 JSP 作者使用的方法

一些方法提供了对不同对象表示范围的统一访问。该实现必须使用与该范围对应的底层机制，因此信息可以在底层环境（例如 Servlet）与 JSP 页面之间来回传递。这些方法有：setAttribute()、getAttribute()、findAttribute()、removeAttribute()、getAttributesScope() 和 getAttributeNamesInScope()。

以下方法提供对隐式对象的便捷访问：getOut()

以下方法提供对表达式语言计算器的编程访问：getExpressionEvaluator() 和 getVariableResolver()

since 2.0
英文文档：

JspContext serves as the base class for the PageContext class and abstracts all information that is not specific to servlets. This allows for Simple Tag Extensions to be used outside of the context of a request/response Servlet.

The JspContext provides a number of facilities to the page/component author and page implementor, including:

  • a single API to manage the various scoped namespaces
  • a mechanism to obtain the JspWriter for output
  • a mechanism to expose page directive attributes to the scripting environment

Methods Intended for Container Generated Code

The following methods enable the management of nested JspWriter streams to implement Tag Extensions: pushBody() and popBody()

Methods Intended for JSP authors

Some methods provide uniform access to the diverse objects representing scopes. The implementation must use the underlying machinery corresponding to that scope, so information can be passed back and forth between the underlying environment (e.g. Servlets) and JSP pages. The methods are: setAttribute(), getAttribute(), findAttribute(), removeAttribute(), getAttributesScope() and getAttributeNamesInScope().

The following methods provide convenient access to implicit objects: getOut()

The following methods provide programmatic access to the Expression Language evaluator: getExpressionEvaluator(), getVariableResolver()

Since:
JSP 2.0

Constructor Summary
JspContext()
Sole constructor.
Method Summary
abstract  Object findAttribute(String name)
Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.
abstract  Object getAttribute(String name)
Returns the object associated with the name in the page scope or null if not found.
abstract  Object getAttribute(String name, int scope)
Return the object associated with the name in the specified scope or null if not found.
abstract  Enumeration<String> getAttributeNamesInScope(int scope)
Enumerate all the attributes in a given scope.
abstract  int getAttributesScope(String name)
Get the scope where a given attribute is defined.
abstract  ELContext getELContext()
Returns the ELContext associated with this JspContext.
abstract  ExpressionEvaluator getExpressionEvaluator()
Deprecated. As of JSP 2.1, replaced by JspApplicationContext.getExpressionFactory()
abstract  JspWriter getOut()
The current value of the out object (a JspWriter).
abstract  VariableResolver getVariableResolver()
Deprecated. As of JSP 2.1, replaced by ELContext.getELResolver(), which can be obtained by jspContext.getELContext().getELResolver().
 JspWriter popBody()
Return the previous JspWriter "out" saved by the matching pushBody(), and update the value of the "out" attribute in the page scope attribute namespace of the JspContext.
 JspWriter pushBody(Writer writer)
Return a new JspWriter object that sends output to the provided Writer.
abstract  void removeAttribute(String name)
Remove the object reference associated with the given name from all scopes.
abstract  void removeAttribute(String name, int scope)
Remove the object reference associated with the specified name in the given scope.
abstract  void setAttribute(String name, Object value)
Register the name and value specified with page scope semantics.
abstract  void setAttribute(String name, Object value, int scope)
Register the name and value specified with appropriate scope semantics.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JspContext()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

JspContext

public JspContext()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

abstract public void setAttribute(String name, Object value)
注册使用页面范围语义指定的名称和值。如果传入的值为 null，则调用此方法与调用 removeAttribute( name, PageContext.PAGE_SCOPE ) 产生的效果相同。
name | 要设置的属性的名称
value | 与 name 关联的值，如果将从页面范围中移除该属性，则此参数为 null。
Throws | NullPointerException: 如果名称为 null。
英文文档：

setAttribute

public abstract void setAttribute(String name,
                                  Object value)
Register the name and value specified with page scope semantics. If the value passed in is null, this has the same effect as calling removeAttribute( name, PageContext.PAGE_SCOPE ).

Parameters:
name - the name of the attribute to set
value - the value to associate with the name, or null if the attribute is to be removed from the page scope.
Throws:
NullPointerException - if the name is null

abstract public void setAttribute(String name, Object value, int scope)
注册使用适当范围语义指定的名称和值。如果传入的值为 null，则调用此方法与调用 removeAttribute( name, scope ) 产生的效果相同。
name | 要设置的属性的名称
value | 与 name 关联的对象，如果将从指定范围中移除该属性，则此参数为 null。
scope | 与名称/对象关联的范围
Throws | NullPointerException: 如果名称为 null。
Throws | IllegalArgumentException: 如果 scope 有效
Throws | IllegalStateException: 如果 scope 为 PageContext.SESSION_SCOPE，但请求的页面未参与会话，或者会话已经无效。
英文文档：

setAttribute

public abstract void setAttribute(String name,
                                  Object value,
                                  int scope)
Register the name and value specified with appropriate scope semantics. If the value passed in is null, this has the same effect as calling removeAttribute( name, scope ).

Parameters:
name - the name of the attribute to set
value - the object to associate with the name, or null if the attribute is to be removed from the specified scope.
scope - the scope with which to associate the name/object
Throws:
NullPointerException - if the name is null
IllegalArgumentException - if the scope is invalid
IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.

abstract public Object getAttribute(String name)
返回与页面范围中的名称关联的对象，如果该对象不存在，则返回 null。
name | 要获取的属性的名称
return | 与页面范围中的名称关联的对象，如果该对象不存在，则返回 null。
Throws | NullPointerException: 如果名称为 null。
英文文档：

getAttribute

public abstract Object getAttribute(String name)
Returns the object associated with the name in the page scope or null if not found.

Parameters:
name - the name of the attribute to get
Returns:
the object associated with the name in the page scope or null if not found.
Throws:
NullPointerException - if the name is null

abstract public Object getAttribute(String name, int scope)
返回与指定范围中的名称关联的对象，如果该对象不存在，则返回 null。
name | 要设置的属性的名称
scope | 与名称/对象关联的范围
return | 与指定范围中的名称关联的对象，如果该对象不存在，则返回 null。
Throws | NullPointerException: 如果名称为 null。
Throws | IllegalArgumentException: 如果 scope 有效
Throws | IllegalStateException: 如果 scope 为 PageContext.SESSION_SCOPE，但请求的页面未参与会话，或者会话已经无效。
英文文档：

getAttribute

public abstract Object getAttribute(String name,
                                    int scope)
Return the object associated with the name in the specified scope or null if not found.

Parameters:
name - the name of the attribute to set
scope - the scope with which to associate the name/object
Returns:
the object associated with the name in the specified scope or null if not found.
Throws:
NullPointerException - if the name is null
IllegalArgumentException - if the scope is invalid
IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.

abstract public Object findAttribute(String name)
按顺序在页面、请求、会话（如果有效）和应用程序范围中搜索指定属性，并返回关联的值或 null。
name | 要搜索的属性的名称
return | 关联的值或 null
Throws | NullPointerException: 如果名称为 null。
英文文档：

findAttribute

public abstract Object findAttribute(String name)
Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.

Parameters:
name - the name of the attribute to search for
Returns:
the value associated or null
Throws:
NullPointerException - if the name is null

abstract public void removeAttribute(String name)
从所有范围中移除与给定名称关联的对象引用。如果没有此类对象，则不执行任何操作。
name | 要移除的对象的名称。
Throws | NullPointerException: 如果名称为 null。
英文文档：

removeAttribute

public abstract void removeAttribute(String name)
Remove the object reference associated with the given name from all scopes. Does nothing if there is no such object.

Parameters:
name - The name of the object to remove.
Throws:
NullPointerException - if the name is null

abstract public void removeAttribute(String name, int scope)
移除给定范围中与指定名称关联的对象引用。如果没有此类对象，则不执行任何操作。
name | 要移除的对象的名称。
scope | 要查看的范围。
Throws | IllegalArgumentException: 如果 scope 有效
Throws | IllegalStateException: 如果 scope 为 PageContext.SESSION_SCOPE，但请求的页面未参与会话，或者会话已经无效。
Throws | NullPointerException: 如果名称为 null。
英文文档：

removeAttribute

public abstract void removeAttribute(String name,
                                     int scope)
Remove the object reference associated with the specified name in the given scope. Does nothing if there is no such object.

Parameters:
name - The name of the object to remove.
scope - The scope where to look.
Throws:
IllegalArgumentException - if the scope is invalid
IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.
NullPointerException - if the name is null

abstract public int getAttributesScope(String name)
获取在其中定义给定属性的范围。
name | 为其返回范围的属性的名称
return | 与指定名称关联的对象的范围或 0
Throws | NullPointerException: 如果名称为 null。
英文文档：

getAttributesScope

public abstract int getAttributesScope(String name)
Get the scope where a given attribute is defined.

Parameters:
name - the name of the attribute to return the scope for
Returns:
the scope of the object associated with the name specified or 0
Throws:
NullPointerException - if the name is null

abstract public java.util.Enumeration<E> getAttributeNamesInScope(int scope)
枚举给定范围中的所有属性。
scope | 为其枚举所有属性的范围
return | 指定范围中所有属性名称 (java.lang.String) 的枚举
Throws | IllegalArgumentException: 如果 scope 有效
Throws | IllegalStateException: 如果 scope 为 PageContext.SESSION_SCOPE，但请求的页面未参与会话，或者会话已经无效。
英文文档：

getAttributeNamesInScope

public abstract Enumeration<String> getAttributeNamesInScope(int scope)
Enumerate all the attributes in a given scope.

Parameters:
scope - the scope to enumerate all the attributes for
Returns:
an enumeration of names (java.lang.String) of all the attributes the specified scope
Throws:
IllegalArgumentException - if the scope is invalid
IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.

abstract public JspWriter getOut()
out 对象（一个 JspWriter）的当前值。
return 正用于客户端响应的当前 JspWriter 流
英文文档：

getOut

public abstract JspWriter getOut()
The current value of the out object (a JspWriter).

Returns:
the current JspWriter stream being used for client response

abstract public ExpressionEvaluator getExpressionEvaluator()
提供对 ExpressionEvaluator 的编程访问。JSP 容器必须返回能解析 EL 表达式的有效 ExpressionEvaluator 实例。
return | 有效的 ExpressionEvaluator 实例。
since | 2.0
英文文档：

getExpressionEvaluator

public abstract ExpressionEvaluator getExpressionEvaluator()
Deprecated. As of JSP 2.1, replaced by JspApplicationContext.getExpressionFactory()

Provides programmatic access to the ExpressionEvaluator. The JSP Container must return a valid instance of an ExpressionEvaluator that can parse EL expressions.

Returns:
A valid instance of an ExpressionEvaluator.
Since:
JSP 2.0

abstract public VariableResolver getVariableResolver()
返回一个 VariableResolver 实例，该实例提供对 JSP 规范中指定的隐式对象的访问，该对象是使用此 JspContext 以上下文对象的形式指定的。
return | 有效的 VariableResolver 实例。
since | 2.0
英文文档：

getVariableResolver

public abstract VariableResolver getVariableResolver()
Deprecated. As of JSP 2.1, replaced by ELContext.getELResolver(), which can be obtained by jspContext.getELContext().getELResolver().

Returns an instance of a VariableResolver that provides access to the implicit objects specified in the JSP specification using this JspContext as the context object.

Returns:
A valid instance of a VariableResolver.
Since:
JSP 2.0

英文文档：

getELContext

public abstract ELContext getELContext()
Returns the ELContext associated with this JspContext.

The ELContext is created lazily and is reused if it already exists. There is a new ELContext for each JspContext.

The ELContext must contain the ELResolver described in the JSP specification (and in the javadocs for JspApplicationContext.addELResolver(javax.el.ELResolver)).

Returns:
The ELContext associated with this JspContext.
Since:
JSP 2.1

public JspWriter pushBody(java.io.Writer writer)
返回将输出发送到提供的 Writer 的新 JspWriter 对象。保存当前的 "out" JspWriter，并更新 JspContext 的页面范围属性名称空间中的 "out" 属性的值。

返回的 JspWriter 必须实现所有方法，并且表现得就像它未被缓冲一样。更确切地说：

  • clear() 必须抛出 IOException
  • clearBuffer() 不执行任何操作
  • getBufferSize() 总是返回 0
  • getRemaining() 总是返回 0

writer | 返回的 JspWriter 将输出发送到的 Writer。
return | 写入给定 Writer 的新 JspWriter。
since | 2.0
英文文档：

pushBody

public JspWriter pushBody(Writer writer)
Return a new JspWriter object that sends output to the provided Writer. Saves the current "out" JspWriter, and updates the value of the "out" attribute in the page scope attribute namespace of the JspContext.

The returned JspWriter must implement all methods and behave as though it were unbuffered. More specifically:

  • clear() must throw an IOException
  • clearBuffer() does nothing
  • getBufferSize() always returns 0
  • getRemaining() always returns 0

Parameters:
writer - The Writer for the returned JspWriter to send output to.
Returns:
a new JspWriter that writes to the given Writer.
Since:
JSP 2.0

public JspWriter popBody()
返回匹配的 pushBody() 保存的以前的 JspWriter "out"，并更新 JspContext 的页面范围属性名称空间中的 "out" 属性的值。
return 保存的 JspWriter。
英文文档：

popBody

public JspWriter popBody()
Return the previous JspWriter "out" saved by the matching pushBody(), and update the value of the "out" attribute in the page scope attribute namespace of the JspContext.

Returns:
the saved JspWriter.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspEngineInfo (Java EE 5)

javax.servlet.jsp
Class JspEngineInfo

java.lang.Object
    extended by  javax.servlet.jsp.JspEngineInfo

public abstract class JspEngineInfo
extends Object

JspEngineInfo 是提供关于当前 JSP 引擎的信息的抽象类。
英文文档：

The JspEngineInfo is an abstract class that provides information on the current JSP engine.

Constructor Summary
JspEngineInfo()
Sole constructor.
Method Summary
abstract  String getSpecificationVersion()
Return the version number of the JSP specification that is supported by this JSP engine.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JspEngineInfo()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

JspEngineInfo

public JspEngineInfo()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

abstract public String getSpecificationVersion()
返回此 JSP 引擎支持的 JSP 规范的版本号。

规范的版本号由以句点 "." 分隔的十进制正整数组成，例如 "2.0" 或 "1.2.3.4.5.6.7"。这允许使用可扩展的编号来表示主版本、次版本、缩微版本，等等。版本号必须以数字开头。

return 规范版本，如果该版本未知，则返回 null
英文文档：

getSpecificationVersion

public abstract String getSpecificationVersion()
Return the version number of the JSP specification that is supported by this JSP engine.

Specification version numbers that consists of positive decimal integers separated by periods ".", for example, "2.0" or "1.2.3.4.5.6.7". This allows an extensible number to be used to represent major, minor, micro, etc versions. The version number must begin with a number.

Returns:
the specification version, null is returned if it is not known
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspFactory (Java EE 5)

javax.servlet.jsp
Class JspFactory

java.lang.Object
    extended by  javax.servlet.jsp.JspFactory

public abstract class JspFactory
extends Object

JspFactory 是一个抽象类，它定义了许多在运行时可供 JSP 页面使用的工厂方法，以创建用来支持 JSP 实现的各种接口和类的实例。

在初始化期间，相应 JSP 引擎实现将实例化此类的与实现相关的子类，并通过使用静态 setDefaultFactory() 方法注册用此类创建的实例使其可供 JSP 实现类全局使用。

PageContext 和 JspEngineInfo 类是可从工厂创建的唯一与实现相关的类。

JSP 页面作者不应使用 JspFactory 对象。

英文文档：

The JspFactory is an abstract class that defines a number of factory methods available to a JSP page at runtime for the purposes of creating instances of various interfaces and classes used to support the JSP implementation.

A conformant JSP Engine implementation will, during it's initialization instantiate an implementation dependent subclass of this class, and make it globally available for use by JSP implementation classes by registering the instance created with this class via the static setDefaultFactory() method.

The only implementation-dependent classes that can be created from the factory are: PageContext, JspEngineInfo, and JspApplicationContext.

With the exception of JspApplicationContext, JspFactory objects should not be used by JSP application developers.

Constructor Summary
JspFactory()
Sole constructor.
Method Summary
static JspFactory | getDefaultFactory() Returns the default factory for this implementation.
abstract JspEngineInfo | getEngineInfo() called to get implementation-specific information on the current JSP engine.
abstract JspApplicationContext | getJspApplicationContext(ServletContext context) Obtains the JspApplicationContext instance associated with the web application for the given ServletContext.
abstract PageContext | getPageContext(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int buffer, boolean autoflush) obtains an instance of an implementation dependent javax.servlet.jsp.PageContext abstract class for the calling Servlet and currently pending request and response.
abstract void | releasePageContext(PageContext pc) called to release a previously allocated PageContext object.
static void | setDefaultFactory(JspFactory deflt) set the default factory for this implementation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JspFactory()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

JspFactory

public JspFactory()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

public static void setDefaultFactory(JspFactory deflt)

设置此实现的默认工厂。除 JSP 引擎运行时之外的任何主体调用此方法都是不合法的。

deflt 默认工厂实现
英文文档：

setDefaultFactory

public static void setDefaultFactory(JspFactory deflt)

set the default factory for this implementation. It is illegal for any principal other than the JSP Engine runtime to call this method.

Parameters:
deflt - The default factory implementation

public static JspFactory getDefaultFactory()
返回此实现的默认工厂。
return 此实现的默认工厂
英文文档：

getDefaultFactory

public static JspFactory getDefaultFactory()
Returns the default factory for this implementation.

Returns:
the default factory for this implementation

abstract public PageContext getPageContext(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int buffer, boolean autoflush)

获得调用 Servlet 和目前挂起的请求和响应的与实现相关的 javax.servlet.jsp.PageContext 抽象类的实例。

为了获得正被处理的请求的 PageContext 对象，此方法通常在 JSP 实现类的 _jspService() 方法处理的早期调用。

调用此方法将导致调用 PageContext.initialize() 方法。返回的 PageContext 被正确初始化。

通过此方法获得的所有 PageContext 对象都将通过调用 releasePageContext() 释放。

servlet | 请求的 servlet
request | servlet 上挂起的当前请求
response | servlet 上挂起的当前响应
errorPageURL | 请求 JSP 的错误页面的 URL，或者为 null
needsSession | 如果 JSP 参与会话，则该参数为 true
buffer | 缓冲区的大小（以字节为单位），如果没有缓冲区，则该参数为 PageContext.NO_BUFFER，如果使用实现默认值，则该参数为 PageContext.DEFAULT_BUFFER。
autoflush | 缓冲区溢出时缓冲区是应该对输出流进行自动刷新，还是应该抛出 IOException？
return | 页面上下文
See also | javax.servlet.jsp.PageContext
英文文档：

getPageContext

public abstract PageContext getPageContext(Servlet servlet,
                                           ServletRequest request,
                                           ServletResponse response,
                                           String errorPageURL,
                                           boolean needsSession,
                                           int buffer,
                                           boolean autoflush)

obtains an instance of an implementation dependent javax.servlet.jsp.PageContext abstract class for the calling Servlet and currently pending request and response.

This method is typically called early in the processing of the _jspService() method of a JSP implementation class in order to obtain a PageContext object for the request being processed.

Invoking this method shall result in the PageContext.initialize() method being invoked. The PageContext returned is properly initialized.

All PageContext objects obtained via this method shall be released by invoking releasePageContext().

Parameters:
servlet - the requesting servlet
request - the current request pending on the servlet
response - the current response pending on the servlet
errorPageURL - the URL of the error page for the requesting JSP, or null
needsSession - true if the JSP participates in a session
buffer - size of buffer in bytes, PageContext.NO_BUFFER if no buffer, PageContext.DEFAULT_BUFFER if implementation default.
autoflush - should the buffer autoflush to the output stream on buffer overflow, or throw an IOException?
Returns:
the page context
See Also:
PageContext

abstract public void releasePageContext(PageContext pc)

调用该方法以释放以前分配的 PageContext 对象。导致调用 PageContext.release()。应该在从 JSP 实现类的 _jspService() 方法返回之前调用此方法。

pc 以前通过 getPageContext() 获得的 PageContext
英文文档：

releasePageContext

public abstract void releasePageContext(PageContext pc)

called to release a previously allocated PageContext object. Results in PageContext.release() being invoked. This method should be invoked prior to returning from the _jspService() method of a JSP implementation class.

Parameters:
pc - A PageContext previously obtained by getPageContext()

abstract public JspEngineInfo getEngineInfo()

调用该方法以获取关于当前 JSP 引擎的特定于实现的信息。

return 描述当前 JSP 引擎的 JspEngineInfo 对象
英文文档：

getEngineInfo

public abstract JspEngineInfo getEngineInfo()

called to get implementation-specific information on the current JSP engine.

Returns:
a JspEngineInfo object describing the current JSP engine

英文文档：

getJspApplicationContext

public abstract JspApplicationContext getJspApplicationContext(ServletContext context)
Obtains the JspApplicationContext instance associated with the web application for the given ServletContext.

Parameters:
context - The ServletContext for the web application the desired JspApplicationContext is associated with.
Returns:
The JspApplicationContext associated with the web application.
Since:
2.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspWriter (Java EE 5)

javax.servlet.jsp
Class JspWriter

java.lang.Object
    extended by  java.io.Writer
        extended by  javax.servlet.jsp.JspWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable
Direct Known Subclasses:
BodyContent
public abstract class JspWriter
extends Writer

Extends: java.io.Writer
Extended by: BodyContent

JSP 页面中的操作和模板数据是使用 JspWriter 对象编写的，该对象由隐式变量 out 引用，而此变量是使用 PageContext 对象中的方法自动初始化的。

此抽象类模仿 java.io.BufferedWriter 和 java.io.PrintWriter 类中的一些功能，但又不同于这些类，因为它从 print 方法抛出 java.io.IOException，而 PrintWriter 不会这样做。

缓冲

初始 JspWriter 对象与 ServletResponse 的 PrintWriter 对象关联，关联方式取决于页面是否被缓冲。如果页面未被缓冲，则写入此 JspWriter 对象的输出将直接写入 PrintWriter，如有必要，将通过对响应对象调用 getWriter() 方法创建 PrintWriter。但是，如果页面被缓冲，则在刷新缓冲区之前不会创建 PrintWriter 对象，并且 setContentType() 之类的操作是合法的。因为这种灵活性显着简化了编程，所以默认情况下将对 JSP 页面进行缓冲。

缓冲会带来超出缓冲区时该如何处理的问题。可以采用两种方法：

  • 超出缓冲区不是致命错误；在超出缓冲区时，只需刷新输出即可。
  • 超出缓冲区是致命错误；在超出缓冲区时，引发一个异常。

两种方法都有效，并且在 JSP 技术中都得到支持。页面的行为由 autoFlush 属性控制，该属性的默认值为 true。通常，需要确保已将正确且完整的数据发送到其客户端的 JSP 页面可能想将 autoFlush 设置为 false，比如客户端是应用程序自身的情况。另一方面，发送有意义的数据（即使只构造了一部分时）的 JSP 页面可能想将 autoFlush 设置为 true；比如发送要通过浏览器立即显示的数据时。每个应用程序都需要考虑自己的特定需求。

一个可以考虑的选择是不设置缓冲区大小界限；但是，这又带来了计算不受控制的弊病，将消耗数量无法估计的资源。

JSP 实现类的 "out" 隐式变量就属于这种类型。如果页面指令选择 autoflush="true"，那么在导致溢出情况时，或者在当前操作是在没有进行刷新的情况下执行的时候，此类上的所有 I/O 操作都将自动刷新缓冲区的内容。如果 autoflush="false"，那么在执行当前操作将导致缓冲区溢出的情况下，此类上的所有 I/O 操作都将抛出 IOException。

See also java.io.Writer, java.io.BufferedWriter, java.io.PrintWriter
英文文档：

The actions and template data in a JSP page is written using the JspWriter object that is referenced by the implicit variable out which is initialized automatically using methods in the PageContext object.

This abstract class emulates some of the functionality found in the java.io.BufferedWriter and java.io.PrintWriter classes, however it differs in that it throws java.io.IOException from the print methods while PrintWriter does not.

Buffering

The initial JspWriter object is associated with the PrintWriter object of the ServletResponse in a way that depends on whether the page is or is not buffered. If the page is not buffered, output written to this JspWriter object will be written through to the PrintWriter directly, which will be created if necessary by invoking the getWriter() method on the response object. But if the page is buffered, the PrintWriter object will not be created until the buffer is flushed and operations like setContentType() are legal. Since this flexibility simplifies programming substantially, buffering is the default for JSP pages.

Buffering raises the issue of what to do when the buffer is exceeded. Two approaches can be taken:

  • Exceeding the buffer is not a fatal error; when the buffer is exceeded, just flush the output.
  • Exceeding the buffer is a fatal error; when the buffer is exceeded, raise an exception.

Both approaches are valid, and thus both are supported in the JSP technology. The behavior of a page is controlled by the autoFlush attribute, which defaults to true. In general, JSP pages that need to be sure that correct and complete data has been sent to their client may want to set autoFlush to false, with a typical case being that where the client is an application itself. On the other hand, JSP pages that send data that is meaningful even when partially constructed may want to set autoFlush to true; such as when the data is sent for immediate display through a browser. Each application will need to consider their specific needs.

An alternative considered was to make the buffer size unbounded; but, this had the disadvantage that runaway computations would consume an unbounded amount of resources.

The "out" implicit variable of a JSP implementation class is of this type. If the page directive selects autoflush="true" then all the I/O operations on this class shall automatically flush the contents of the buffer if an overflow condition would result if the current operation were performed without a flush. If autoflush="false" then all the I/O operations on this class shall throw an IOException if performing the current operation would result in a buffer overflow condition.

See Also:
Writer, BufferedWriter, PrintWriter

Field Summary
protected boolean | autoFlush Whether the JspWriter is autoflushing.
protected int | bufferSize The size of the buffer used by the JspWriter.
static int | DEFAULT_BUFFER Constant indicating that the Writer is buffered and is using the implementation default buffer size.
static int | NO_BUFFER Constant indicating that the Writer is not buffering output.
static int | UNBOUNDED_BUFFER Constant indicating that the Writer is buffered and is unbounded; this is used in BodyContent.
Fields inherited from class java.io.Writer
lock
Constructor Summary
protected JspWriter(int bufferSize, boolean autoFlush)
Protected constructor.
Method Summary
abstract void | clear() Clear the contents of the buffer.
abstract void | clearBuffer() Clears the current contents of the buffer.
abstract void | close() Close the stream, flushing it first.
abstract void | flush() Flush the stream.
int | getBufferSize() This method returns the size of the buffer used by the JspWriter.
abstract int | getRemaining() This method returns the number of unused bytes in the buffer.
boolean | isAutoFlush() This method indicates whether the JspWriter is autoFlushing.
abstract void | newLine() Write a line separator.
abstract void | print(boolean b) Print a boolean value.
abstract void | print(char c) Print a character.
abstract void | print(char[] s) Print an array of characters.
abstract void | print(double d) Print a double-precision floating-point number.
abstract void | print(float f) Print a floating-point number.
abstract void | print(int i) Print an integer.
abstract void | print(long l) Print a long integer.
abstract void | print(Object obj) Print an object.
abstract void | print(String s) Print a string.
abstract void | println() Terminate the current line by writing the line separator string.
abstract void | println(boolean x) Print a boolean value and then terminate the line.
abstract void | println(char x) Print a character and then terminate the line.
abstract void | println(char[] x) Print an array of characters and then terminate the line.
abstract void | println(double x) Print a double-precision floating-point number and then terminate the line.
abstract void | println(float x) Print a floating-point number and then terminate the line.
abstract void | println(int x) Print an integer and then terminate the line.
abstract void | println(long x) Print a long integer and then terminate the line.
abstract void | println(Object x) Print an Object and then terminate the line.
abstract void | println(String x) Print a String and then terminate the line.
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

NO_BUFFER

public static final int NO_BUFFER
Constant indicating that the Writer is not buffering output.

See Also:
Constant Field Values

英文文档：

DEFAULT_BUFFER

public static final int DEFAULT_BUFFER
Constant indicating that the Writer is buffered and is using the implementation default buffer size.

See Also:
Constant Field Values

英文文档：

UNBOUNDED_BUFFER

public static final int UNBOUNDED_BUFFER
Constant indicating that the Writer is buffered and is unbounded; this is used in BodyContent.

See Also:
Constant Field Values

英文文档：

bufferSize

protected int bufferSize
The size of the buffer used by the JspWriter.

英文文档：

autoFlush

protected boolean autoFlush
Whether the JspWriter is autoflushing.

Constructor Detail

protected JspWriter(int bufferSize, boolean autoFlush)
受保护的构造方法。
bufferSize | 将由 JspWriter 使用的缓冲区的大小
autoFlush | JspWriter 是否应自动刷新
英文文档：

JspWriter

protected JspWriter(int bufferSize,
                    boolean autoFlush)
Protected constructor.

Parameters:
bufferSize - the size of the buffer to be used by the JspWriter
autoFlush - whether the JspWriter should be autoflushing
Method Detail

abstract public void newLine() throws java.io.IOException
写入一个行分隔符。行分隔符字符串由系统属性 line.separator 定义，并且不一定是单个换行 ('\n') 字符。
Throws java.io.IOException: 如果发生 I/O 错误
英文文档：

newLine

public abstract void newLine()
                      throws IOException
Write a line separator. The line separator string is defined by the system property line.separator, and is not necessarily a single newline ('\n') character.

Throws:
IOException - If an I/O error occurs

abstract public void print(boolean b) throws java.io.IOException
打印 boolean 值。将 valueOf(boolean) 生成的字符串写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将该字符串写入底层 Writer。
b | 要打印的 boolean
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

print

public abstract void print(boolean b)
                    throws IOException
Print a boolean value. The string produced by String.valueOf(boolean) is written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
b - The boolean to be printed
Throws:
IOException - If an error occured while writing

abstract public void print(char c) throws java.io.IOException
打印字符。将字符写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将字符写入底层 Writer。
c | 要打印的 char
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

print

public abstract void print(char c)
                    throws IOException
Print a character. The character is written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
c - The char to be printed
Throws:
IOException - If an error occured while writing

abstract public void print(int i) throws java.io.IOException
打印整数。将 valueOf(int) 生成的字符串写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将该字符串写入底层 Writer。
i | 要打印的 int
Throws | java.io.IOException: 如果写入时发生错误
See also | toString(int)
英文文档：

print

public abstract void print(int i)
                    throws IOException
Print an integer. The string produced by String.valueOf(int) is written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
i - The int to be printed
Throws:
IOException - If an error occured while writing
See Also:
Integer.toString(int)

abstract public void print(long l) throws java.io.IOException
打印 long 整数。将 valueOf(long) 生成的字符串写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将该字符串写入底层 Writer。
l | 要打印的 long
Throws | java.io.IOException: 如果写入时发生错误
See also | toString(long)
英文文档：

print

public abstract void print(long l)
                    throws IOException
Print a long integer. The string produced by String.valueOf(long) is written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
l - The long to be printed
Throws:
IOException - If an error occured while writing
See Also:
Long.toString(long)

abstract public void print(float f) throws java.io.IOException
打印浮点数。将 valueOf(float) 生成的字符串写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将该字符串写入底层 Writer。
f | 要打印的 float
Throws | java.io.IOException: 如果写入时发生错误
See also | toString(float)
英文文档：

print

public abstract void print(float f)
                    throws IOException
Print a floating-point number. The string produced by String.valueOf(float) is written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
f - The float to be printed
Throws:
IOException - If an error occured while writing
See Also:
Float.toString(float)

abstract public void print(double d) throws java.io.IOException
打印双精度浮点数。将 valueOf(double) 生成的字符串写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将该字符串写入底层 Writer。
d | 要打印的 double
Throws | java.io.IOException: 如果写入时发生错误
See also | toString(double)
英文文档：

print

public abstract void print(double d)
                    throws IOException
Print a double-precision floating-point number. The string produced by String.valueOf(double) is written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
d - The double to be printed
Throws:
IOException - If an error occured while writing
See Also:
Double.toString(double)

abstract public void print(char[] s) throws java.io.IOException
打印字符数组。将字符写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将字符写入底层 Writer。
s | 要打印的字符数组
Throws | NullPointerException: 如果 s 为 null
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

print

public abstract void print(char[] s)
                    throws IOException
Print an array of characters. The characters are written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
s - The array of chars to be printed
Throws:
NullPointerException - If s is null
IOException - If an error occured while writing

abstract public void print(String s) throws java.io.IOException
打印字符串。如果参数为 null，则打印字符串 "null"。否则，将字符串的字符写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将字符写入底层 Writer。
s | 要打印的 String
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

print

public abstract void print(String s)
                    throws IOException
Print a string. If the argument is null then the string "null" is printed. Otherwise, the string's characters are written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
s - The String to be printed
Throws:
IOException - If an error occured while writing

abstract public void print(Object obj) throws java.io.IOException
打印对象。将 valueOf(Object) 方法生成的字符串写入 JspWriter 的缓冲区，如果没有使用缓冲区，则直接将该字符串写入底层 Writer。
obj | 要打印的 Object
Throws | java.io.IOException: 如果写入时发生错误
See also | toString()
英文文档：

print

public abstract void print(Object obj)
                    throws IOException
Print an object. The string produced by the String.valueOf(Object) method is written to the JspWriter's buffer or, if no buffer is used, directly to the underlying writer.

Parameters:
obj - The Object to be printed
Throws:
IOException - If an error occured while writing
See Also:
Object.toString()

abstract public void println() throws java.io.IOException
通过写入行分隔符字符串终止当前行。行分隔符字符串由系统属性 line.separator 定义，不一定是单个换行符 ('\n')。
Throws java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println()
                      throws IOException
Terminate the current line by writing the line separator string. The line separator string is defined by the system property line.separator, and is not necessarily a single newline character ('\n').

Throws:
IOException - If an error occured while writing

abstract public void println(boolean x) throws java.io.IOException
打印 boolean 值，然后终止该行。此方法的行为就像先调用 #print(boolean) 然后调用 #println() 一样。
x | 要写入的 boolean
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(boolean x)
                      throws IOException
Print a boolean value and then terminate the line. This method behaves as though it invokes print(boolean) and then println().

Parameters:
x - the boolean to write
Throws:
IOException - If an error occured while writing

abstract public void println(char x) throws java.io.IOException
打印字符，然后终止该行。此方法的行为就像先调用 #print(char) 然后调用 #println() 一样。
x | 要写入的字符
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(char x)
                      throws IOException
Print a character and then terminate the line. This method behaves as though it invokes print(char) and then println().

Parameters:
x - the char to write
Throws:
IOException - If an error occured while writing

abstract public void println(int x) throws java.io.IOException
打印整数，然后终止该行。此方法的行为就像先调用 #print(int) 然后调用 #println() 一样。
x | 要写入的 int
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(int x)
                      throws IOException
Print an integer and then terminate the line. This method behaves as though it invokes print(int) and then println().

Parameters:
x - the int to write
Throws:
IOException - If an error occured while writing

abstract public void println(long x) throws java.io.IOException
打印 long 整数，然后终止该行。此方法的行为就像先调用 #print(long) 然后调用 #println() 一样。
x | 要写入的 long
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(long x)
                      throws IOException
Print a long integer and then terminate the line. This method behaves as though it invokes print(long) and then println().

Parameters:
x - the long to write
Throws:
IOException - If an error occured while writing

abstract public void println(float x) throws java.io.IOException
打印浮点数，然后终止该行。此方法的行为就像先调用 #print(float) 然后调用 #println() 一样。
x | 要写入的 float
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(float x)
                      throws IOException
Print a floating-point number and then terminate the line. This method behaves as though it invokes print(float) and then println().

Parameters:
x - the float to write
Throws:
IOException - If an error occured while writing

abstract public void println(double x) throws java.io.IOException
打印双精度浮点数，然后终止该行。此方法的行为就像先调用 #print(double) 然后调用 #println() 一样。
x | 要写入的 double
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(double x)
                      throws IOException
Print a double-precision floating-point number and then terminate the line. This method behaves as though it invokes print(double) and then println().

Parameters:
x - the double to write
Throws:
IOException - If an error occured while writing

abstract public void println(char[] x) throws java.io.IOException
打印字符数组，然后终止该行。此方法的行为就像先调用 print(char[]) 然后调用 println() 一样。
x | 要写入的 char[]
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(char[] x)
                      throws IOException
Print an array of characters and then terminate the line. This method behaves as though it invokes print(char[]) and then println().

Parameters:
x - the char[] to write
Throws:
IOException - If an error occured while writing

abstract public void println(String x) throws java.io.IOException
打印 String，然后终止该行。此方法的行为就像先调用 #print(String) 然后调用 #println() 一样。
x | 要写入的 String
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(String x)
                      throws IOException
Print a String and then terminate the line. This method behaves as though it invokes print(String) and then println().

Parameters:
x - the String to write
Throws:
IOException - If an error occured while writing

abstract public void println(Object x) throws java.io.IOException
打印 Object，然后终止该行。此方法的行为就像先调用 #print(Object) 然后调用 #println() 一样。
x | 要写入的 Object
Throws | java.io.IOException: 如果写入时发生错误
英文文档：

println

public abstract void println(Object x)
                      throws IOException
Print an Object and then terminate the line. This method behaves as though it invokes print(Object) and then println().

Parameters:
x - the Object to write
Throws:
IOException - If an error occured while writing

abstract public void clear() throws java.io.IOException
清除缓冲区的内容。如果已经刷新缓冲区，则 clear 操作将抛出 IOException，指示某些数据已经不可撤消地写入了客户端响应流。
Throws java.io.IOException: 如果发生 I/O 错误
英文文档：

clear

public abstract void clear()
                    throws IOException
Clear the contents of the buffer. If the buffer has been already been flushed then the clear operation shall throw an IOException to signal the fact that some data has already been irrevocably written to the client response stream.

Throws:
IOException - If an I/O error occurs

abstract public void clearBuffer() throws java.io.IOException
清除缓冲区的当前内容。与 clear() 不同，如果已经刷新缓冲区，此方法不会抛出 IOException。它只清除缓冲区的当前内容，然后返回。
Throws java.io.IOException: 如果发生 I/O 错误
英文文档：

clearBuffer

public abstract void clearBuffer()
                          throws IOException
Clears the current contents of the buffer. Unlike clear(), this method will not throw an IOException if the buffer has already been flushed. It merely clears the current content of the buffer and returns.

Throws:
IOException - If an I/O error occurs

abstract public void flush() throws java.io.IOException
刷新流。如果该流已保存缓冲区中各种 write() 方法的所有字符，则立即将它们写入预期目标。然后，如果该目标是另一个字符或字节流，则将其刷新。因此，一次 flush() 调用将刷新 Writer 和 OutputStream 链中的所有缓冲区。

如果超出缓冲区大小，则可以间接调用该方法。

在关闭流之后，再调用 write() 或 flush() 将导致抛出 IOException。

Throws java.io.IOException: 如果发生 I/O 错误
英文文档：

flush

public abstract void flush()
                    throws IOException
Flush the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

The method may be invoked indirectly if the buffer size is exceeded.

Once a stream has been closed, further write() or flush() invocations will cause an IOException to be thrown.

Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException - If an I/O error occurs

abstract public void close() throws java.io.IOException
关闭流，先将它刷新。

不必对初始 JspWriter 显式调用此方法，因为 JSP 容器生成的代码将自动包含对 close() 的调用。

与 flush() 不同，关闭以前关闭的流无效。

Throws java.io.IOException: 如果发生 I/O 错误
英文文档：

close

public abstract void close()
                    throws IOException
Close the stream, flushing it first.

This method needs not be invoked explicitly for the initial JspWriter as the code generated by the JSP container will automatically include a call to close().

Closing a previously-closed stream, unlike flush(), has no effect.

Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException - If an I/O error occurs

public int getBufferSize()
此方法返回 JspWriter 使用的缓冲区的大小。
return 缓冲区的大小（以字节为单位），如果未被缓冲，则返回 0。
英文文档：

getBufferSize

public int getBufferSize()
This method returns the size of the buffer used by the JspWriter.

Returns:
the size of the buffer in bytes, or 0 is unbuffered.

abstract public int getRemaining()
此方法返回缓冲区中未使用字节的数量。
return 缓冲区中未使用字节的数量
英文文档：

getRemaining

public abstract int getRemaining()
This method returns the number of unused bytes in the buffer.

Returns:
the number of bytes unused in the buffer

public boolean isAutoFlush()
此方法指示 JspWriter 是否将自动刷新。
return 此 JspWriter 是否将自动刷新，在发生缓冲区溢出的情况下抛出 IOException
英文文档：

isAutoFlush

public boolean isAutoFlush()
This method indicates whether the JspWriter is autoFlushing.

Returns:
if this JspWriter is auto flushing or throwing IOExceptions on buffer overflow conditions
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PageContext (Java EE 5)

javax.servlet.jsp
Class PageContext

java.lang.Object
    extended by  javax.servlet.jsp.JspContext
        extended by  javax.servlet.jsp.PageContext

public abstract class PageContext
extends JspContext

Extends: JspContext

PageContext 扩展了 JspContext，提供有关何时在 Servlet 环境中使用 JSP 技术的有用上下文信息。

PageContext 实例提供对与某个 JSP 页面关联的所有名称空间的访问，也提供对几个页面属性以及实现细节之上的某个层的访问。隐式对象是自动添加到 pageContext 的。

PageContext 类是一个抽象类，该类设计用于扩展，以便由相应 JSP 引擎运行时环境提供该类的与实现相关的实现。PageContext 实例由 JSP 实现类通过调用 JspFactory.getPageContext() 方法获得，该实例可通过调用 JspFactory.releasePageContext() 得到释放。

在其他地方给出了如何在 JSP Page Implementation 对象中使用 PageContext、JspFactory 和其他类的示例。

PageContext 为页面/组件作者和页面实现者提供了许多工具，其中包括：

  • 管理各种范围名称空间的单个 API
  • 许多便捷 API，用于访问各种公共对象
  • 获取 JspWriter 以供输出的机制
  • 通过页面管理会话使用的机制
  • 向脚本环境公开页面指令属性的机制
  • 将当前请求转发或包含到应用程序中其他活动组件的机制
  • 处理 errorpage 异常处理的机制

供容器生成的代码使用的方法

一些方法应该由容器生成的代码使用，而不应该由 JSP 页面作者或 JSP 标记库作者编写的代码使用。

支持生命周期的方法是 initialize() 和 release()。

以下方法使嵌套管理的 JspWriter 流能够实现标记扩展：pushBody()

供 JSP 作者使用的方法

以下方法提供对隐式对象的便捷访问：getException()、getPage()、getRequest()、getResponse()、getSession()、getServletConfig() 和 getServletContext()。

以下方法提供对转发、包含和错误处理的支持：forward()、include() 和 handlePageException()。

英文文档：

PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment.

A PageContext instance provides access to all the namespaces associated with a JSP page, provides access to several page attributes, as well as a layer above the implementation details. Implicit objects are added to the pageContext automatically.

The PageContext class is an abstract class, designed to be extended to provide implementation dependent implementations thereof, by conformant JSP engine runtime environments. A PageContext instance is obtained by a JSP implementation class by calling the JspFactory.getPageContext() method, and is released by calling JspFactory.releasePageContext().

An example of how PageContext, JspFactory, and other classes can be used within a JSP Page Implementation object is given elsewhere.

The PageContext provides a number of facilities to the page/component author and page implementor, including:

  • a single API to manage the various scoped namespaces
  • a number of convenience API's to access various public objects
  • a mechanism to obtain the JspWriter for output
  • a mechanism to manage session usage by the page
  • a mechanism to expose page directive attributes to the scripting environment
  • mechanisms to forward or include the current request to other active components in the application
  • a mechanism to handle errorpage exception processing

Methods Intended for Container Generated Code

Some methods are intended to be used by the code generated by the container, not by code written by JSP page authors, or JSP tag library authors.

The methods supporting lifecycle are initialize() and release()

The following methods enable the management of nested JspWriter streams to implement Tag Extensions: pushBody()

Methods Intended for JSP authors

The following methods provide convenient access to implicit objects:
getException(),  getPage()
getRequest(),  getResponse(),
getSession(),  getServletConfig()
and getServletContext().

The following methods provide support for forwarding, inclusion and error handling: forward(), include(), and handlePageException().

Field Summary
static String | APPLICATION Name used to store ServletContext in PageContext name table.
static int | APPLICATION_SCOPE Application scope: named reference remains available in the ServletContext until it is reclaimed.
static String | CONFIG Name used to store ServletConfig in PageContext name table.
static String | EXCEPTION Name used to store uncaught exception in ServletRequest attribute list and PageContext name table.
static String | OUT Name used to store current JspWriter in PageContext name table.
static String | PAGE Name used to store the Servlet in this PageContext's nametables.
static int | PAGE_SCOPE Page scope: (this is the default) the named reference remains available in this PageContext until the return from the current Servlet.service() invocation.
static String | PAGECONTEXT Name used to store this PageContext in it's own name table.
static String | REQUEST Name used to store ServletRequest in PageContext name table.
static int | REQUEST_SCOPE Request scope: the named reference remains available from the ServletRequest associated with the Servlet until the current request is completed.
static String | RESPONSE Name used to store ServletResponse in PageContext name table.
static String | SESSION Name used to store HttpSession in PageContext name table.
static int | SESSION_SCOPE Session scope (only valid if this page participates in a session): the named reference remains available from the HttpSession (if any) associated with the Servlet until the HttpSession is invalidated.
Constructor Summary
PageContext()
Sole constructor.
Method Summary
abstract  void forward(String relativeUrlPath)
This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.
 ErrorData getErrorData()
Provides convenient access to error information.
abstract  Exception getException()
The current value of the exception object (an Exception).
abstract  Object getPage()
The current value of the page object (In a Servlet environment, this is an instance of javax.servlet.Servlet).
abstract  ServletRequest getRequest()
The current value of the request object (a ServletRequest).
abstract  ServletResponse getResponse()
The current value of the response object (a ServletResponse).
abstract  ServletConfig getServletConfig()
The ServletConfig instance.
abstract  ServletContext getServletContext()
The ServletContext instance.
abstract  HttpSession getSession()
The current value of the session object (an HttpSession).
abstract  void handlePageException(Exception e)
This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP.
abstract  void handlePageException(Throwable t)
This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP.
abstract  void include(String relativeUrlPath)
Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
abstract  void include(String relativeUrlPath, boolean flush)
Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
abstract  void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush)
The initialize method is called to initialize an uninitialized PageContext so that it may be used by a JSP Implementation class to service an incoming request and response within it's _jspService() method.
 BodyContent pushBody()
Return a new BodyContent object, save the current "out" JspWriter, and update the value of the "out" attribute in the page scope attribute namespace of the PageContext.
abstract  void release()
This method shall "reset" the internal state of a PageContext, releasing all internal references, and preparing the PageContext for potential reuse by a later invocation of initialize().
Methods inherited from class javax.servlet.jsp.JspContext
findAttribute, getAttribute, getAttribute, getAttributeNamesInScope, getAttributesScope, getELContext, getExpressionEvaluator, getOut, getVariableResolver, popBody, pushBody, removeAttribute, removeAttribute, setAttribute, setAttribute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

PAGE_SCOPE

public static final int PAGE_SCOPE
Page scope: (this is the default) the named reference remains available in this PageContext until the return from the current Servlet.service() invocation.

See Also:
Constant Field Values

英文文档：

REQUEST_SCOPE

public static final int REQUEST_SCOPE
Request scope: the named reference remains available from the ServletRequest associated with the Servlet until the current request is completed.

See Also:
Constant Field Values

英文文档：

SESSION_SCOPE

public static final int SESSION_SCOPE
Session scope (only valid if this page participates in a session): the named reference remains available from the HttpSession (if any) associated with the Servlet until the HttpSession is invalidated.

See Also:
Constant Field Values

英文文档：

APPLICATION_SCOPE

public static final int APPLICATION_SCOPE
Application scope: named reference remains available in the ServletContext until it is reclaimed.

See Also:
Constant Field Values

英文文档：

PAGE

public static final String PAGE
Name used to store the Servlet in this PageContext's nametables.

See Also:
Constant Field Values

英文文档：

PAGECONTEXT

public static final String PAGECONTEXT
Name used to store this PageContext in it's own name table.

See Also:
Constant Field Values

英文文档：

REQUEST

public static final String REQUEST
Name used to store ServletRequest in PageContext name table.

See Also:
Constant Field Values

英文文档：

RESPONSE

public static final String RESPONSE
Name used to store ServletResponse in PageContext name table.

See Also:
Constant Field Values

英文文档：

CONFIG

public static final String CONFIG
Name used to store ServletConfig in PageContext name table.

See Also:
Constant Field Values

英文文档：

SESSION

public static final String SESSION
Name used to store HttpSession in PageContext name table.

See Also:
Constant Field Values

英文文档：

OUT

public static final String OUT
Name used to store current JspWriter in PageContext name table.

See Also:
Constant Field Values

英文文档：

APPLICATION

public static final String APPLICATION
Name used to store ServletContext in PageContext name table.

See Also:
Constant Field Values

英文文档：

EXCEPTION

public static final String EXCEPTION
Name used to store uncaught exception in ServletRequest attribute list and PageContext name table.

See Also:
Constant Field Values
Constructor Detail

public PageContext()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

PageContext

public PageContext()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

abstract public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws java.io.IOException, IllegalStateException, IllegalArgumentException

调用 initialize 方法初始化未被初始化的 PageContext，这样 JSP 实现类就可以使用它为其 _jspService() 方法中的传入请求和响应提供服务。

此方法通常从 JspFactory.getPageContext() 调用，以便初始化状态。

此方法必须创建一个初始 JspWriter，并将页面范围中的 "out" 名称与新创建的对象相关联。

页面或标记库作者不应该使用此方法。

servlet | 与此 PageContext 关联的 Servlet
request | 此 Servlet 当前挂起的请求
response | 此 Servlet 当前挂起的响应
errorPageURL | 页面指令中 errorpage 属性的值，或者为 null
needsSession | 页面指令中 session 属性的值
bufferSize | 页面指令中 buffer 属性的值
autoFlush | 页面指令中 autoflush 属性的值
Throws | java.io.IOException: 在创建 JspWriter 期间
Throws | IllegalStateException: 如果未正确初始化 out
Throws | IllegalArgumentException: 如果某个给定参数无效
英文文档：

initialize

public abstract void initialize(Servlet servlet,
                                ServletRequest request,
                                ServletResponse response,
                                String errorPageURL,
                                boolean needsSession,
                                int bufferSize,
                                boolean autoFlush)
                         throws IOException,
                                IllegalStateException,
                                IllegalArgumentException

The initialize method is called to initialize an uninitialized PageContext so that it may be used by a JSP Implementation class to service an incoming request and response within it's _jspService() method.

This method is typically called from JspFactory.getPageContext() in order to initialize state.

This method is required to create an initial JspWriter, and associate the "out" name in page scope with this newly created object.

This method should not be used by page or tag library authors.

Parameters:
servlet - The Servlet that is associated with this PageContext
request - The currently pending request for this Servlet
response - The currently pending response for this Servlet
errorPageURL - The value of the errorpage attribute from the page directive or null
needsSession - The value of the session attribute from the page directive
bufferSize - The value of the buffer attribute from the page directive
autoFlush - The value of the autoflush attribute from the page directive
Throws:
IOException - during creation of JspWriter
IllegalStateException - if out not correctly initialized
IllegalArgumentException - If one of the given parameters is invalid

abstract public void release()

此方法将“重置”PageContext 的内部状态，释放所有内部引用，并为以后 initialize() 调用中可能的重用准备 PageContext。此方法通常从 JspFactory.releasePageContext() 调用。

子类将封装此方法。

页面或标记库作者不应该使用此方法。

英文文档：

release

public abstract void release()

This method shall "reset" the internal state of a PageContext, releasing all internal references, and preparing the PageContext for potential reuse by a later invocation of initialize(). This method is typically called from JspFactory.releasePageContext().

Subclasses shall envelope this method.

This method should not be used by page or tag library authors.

abstract public HttpSession getSession()
会话对象的当前值（一个 HttpSession）。
return 此 PageContext 的 HttpSession，或者返回 null
英文文档：

getSession

public abstract HttpSession getSession()
The current value of the session object (an HttpSession).

Returns:
the HttpSession for this PageContext or null

abstract public Object getPage()
页面对象的当前值（在 Servlet 环境中，这是一个 javax.servlet.Servlet 实例）。
return 与此 PageContext 关联的页面实现类实例
英文文档：

getPage

public abstract Object getPage()
The current value of the page object (In a Servlet environment, this is an instance of javax.servlet.Servlet).

Returns:
the Page implementation class instance associated with this PageContext

abstract public ServletRequest getRequest()
请求对象的当前值（一个 ServletRequest）。
return 此 PageContext 的 ServletRequest
英文文档：

getRequest

public abstract ServletRequest getRequest()
The current value of the request object (a ServletRequest).

Returns:
The ServletRequest for this PageContext

abstract public ServletResponse getResponse()
响应对象的当前值（一个 ServletResponse）。
return 此 PageContext 的 ServletResponse
英文文档：

getResponse

public abstract ServletResponse getResponse()
The current value of the response object (a ServletResponse).

Returns:
the ServletResponse for this PageContext

abstract public Exception getException()
异常对象的当前值（一个 Exception）。
return 以 errorpage 的形式传递到此 PageContext 的任何异常
英文文档：

getException

public abstract Exception getException()
The current value of the exception object (an Exception).

Returns:
any exception passed to this as an errorpage

abstract public ServletConfig getServletConfig()
ServletConfig 实例。
return 此 PageContext 的 ServletConfig
英文文档：

getServletConfig

public abstract ServletConfig getServletConfig()
The ServletConfig instance.

Returns:
the ServletConfig for this PageContext

abstract public ServletContext getServletContext()
ServletContext 实例。
return 此 PageContext 的 ServletContext
英文文档：

getServletContext

public abstract ServletContext getServletContext()
The ServletContext instance.

Returns:
the ServletContext for this PageContext

abstract public void forward(String relativeUrlPath) throws ServletException, java.io.IOException

此方法用于将当前 ServletRequest 和 ServletResponse 重定向或“转发”到应用程序中的另一个活动组件。

如果 relativeUrlPath 以 "/" 开始，那么指定的 URL 将相对于此 JSP ServletContext 的 DOCROOT 进行计算。如果路径不以 "/" 开始，那么指定的 URL 将相对于映射到调用 JSP 的请求的 URL 进行计算。

只有通过在 JSP 的 _jspService(...) 方法中执行的 Thread 调用此方法才是有效的。

在成功调用此方法后，调用 Thread 试图修改 ServletResponse 对象是不合法的。任何这样的尝试都将导致不确定的行为。通常，调用者在调用此方法后将立刻从 _jspService(...) 返回。

relativeUrlPath | 指定到目标资源的相对 URL 路径（如上所述）
Throws | IllegalStateException: 如果 ServletResponse 并不处于可以执行转发的状态
Throws | ServletException: 如果转发到的页面抛出 ServletException
Throws | java.io.IOException: 如果在转发时发生 I/O 错误
英文文档：

forward

public abstract void forward(String relativeUrlPath)
                      throws ServletException,
                             IOException

This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.

If the relativeUrlPath begins with a "/" then the URL specified is calculated relative to the DOCROOT of the ServletContext for this JSP. If the path does not begin with a "/" then the URL specified is calculated relative to the URL of the request that was mapped to the calling JSP.

It is only valid to call this method from a Thread executing within a _jspService(...) method of a JSP.

Once this method has been called successfully, it is illegal for the calling Thread to attempt to modify the ServletResponse object. Any such attempt to do so, shall result in undefined behavior. Typically, callers immediately return from _jspService(...) after calling this method.

Parameters:
relativeUrlPath - specifies the relative URL path to the target resource as described above
Throws:
IllegalStateException - if ServletResponse is not in a state where a forward can be performed
ServletException - if the page that was forwarded to throws a ServletException
IOException - if an I/O error occurred while forwarding

abstract public void include(String relativeUrlPath) throws ServletException, java.io.IOException

导致将指定资源作为正由调用 Thread 处理的当前 ServletRequest 和 ServletResponse 的一部分进行处理。将请求的目标资源处理的输出直接写入 ServletResponse 输出流。

在处理 include 之前，作为此调用的副作用，将刷新此 JSP 的当前 JspWriter "out"。

如果 relativeUrlPath 以 "/" 开始，那么指定的 URL 将相对于此 JSP ServletContext 的 DOCROOT 进行计算。如果路径不以 "/" 开始，那么指定的 URL 将相对于映射到调用 JSP 的请求的 URL 进行计算。

只有通过在 JSP 的 _jspService(...) 方法中执行的 Thread 调用此方法才是有效的。

relativeUrlPath | 指定到要包含的目标资源的相对 URL 路径
Throws | ServletException: 如果转发到的页面抛出 ServletException
Throws | java.io.IOException: 如果在转发时发生 I/O 错误
英文文档：

include

public abstract void include(String relativeUrlPath)
                      throws ServletException,
                             IOException

Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread. The output of the target resources processing of the request is written directly to the ServletResponse output stream.

The current JspWriter "out" for this JSP is flushed as a side-effect of this call, prior to processing the include.

If the relativeUrlPath begins with a "/" then the URL specified is calculated relative to the DOCROOT of the ServletContext for this JSP. If the path does not begin with a "/" then the URL specified is calculated relative to the URL of the request that was mapped to the calling JSP.

It is only valid to call this method from a Thread executing within a _jspService(...) method of a JSP.

Parameters:
relativeUrlPath - specifies the relative URL path to the target resource to be included
Throws:
ServletException - if the page that was forwarded to throws a ServletException
IOException - if an I/O error occurred while forwarding

abstract public void include(String relativeUrlPath, boolean flush) throws ServletException, java.io.IOException

导致将指定资源作为正由调用 Thread 处理的当前 ServletRequest 和 ServletResponse 的一部分进行处理。将请求的目标资源处理的输出直接写入调用 getOut() 返回的当前 JspWriter。

如果 flush 为 true，那么在处理 include 之前，作为此调用的副作用，将刷新此 JSP 的当前 JspWriter "out"。否则，不刷新 JspWriter "out"。

如果 relativeUrlPath 以 "/" 开始，那么指定的 URL 将相对于此 JSP ServletContext 的 DOCROOT 进行计算。如果路径不以 "/" 开始，那么指定的 URL 将相对于映射到调用 JSP 的请求的 URL 进行计算。

只有通过在 JSP 的 _jspService(...) 方法中执行的 Thread 调用此方法才是有效的。

relativeUrlPath | 指定到要包含的目标资源的相对 URL 路径
flush | 如果在处理 include 之前要刷新 JspWriter，则该参数为 true；如果不刷新 JspWriter，则该参数为 false。
Throws | ServletException: 如果转发到的页面抛出 ServletException
Throws | java.io.IOException: 如果在转发时发生 I/O 错误
since | 2.0
英文文档：

include

public abstract void include(String relativeUrlPath,
                             boolean flush)
                      throws ServletException,
                             IOException

Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread. The output of the target resources processing of the request is written directly to the current JspWriter returned by a call to getOut().

If flush is true, The current JspWriter "out" for this JSP is flushed as a side-effect of this call, prior to processing the include. Otherwise, the JspWriter "out" is not flushed.

If the relativeUrlPath begins with a "/" then the URL specified is calculated relative to the DOCROOT of the ServletContext for this JSP. If the path does not begin with a "/" then the URL specified is calculated relative to the URL of the request that was mapped to the calling JSP.

It is only valid to call this method from a Thread executing within a _jspService(...) method of a JSP.

Parameters:
relativeUrlPath - specifies the relative URL path to the target resource to be included
flush - True if the JspWriter is to be flushed before the include, or false if not.
Throws:
ServletException - if the page that was forwarded to throws a ServletException
IOException - if an I/O error occurred while forwarding
Since:
JSP 2.0

abstract public void handlePageException(Exception e) throws ServletException, java.io.IOException

此方法旨在通过将异常转发到此 JSP 的指定错误页面处理未处理的“页面”级异常。如果无法转发（比如因为已经提交了响应），则应该使用与实现相关的机制调用错误页面（例如，“包括”错误页面）。

如果页面中没有定义错误页面，则应该重新抛出异常，以便标准的 servlet 错误处理接管。

在调用此方法前，JSP 实现类通常应该清除本地状态，并在调用此方法后立刻返回。向客户端生成任何输出，或者调用此方法后修改任何 ServletResponse 状态都是非法的。

保留此方法只是为了向后兼容。新生成的代码应该使用 PageContext.handlePageException(Throwable)。

e | 要处理的异常
Throws | ServletException: 如果调用错误页面时发生错误
Throws | java.io.IOException: 如果调用错误页面时发生 I/O 错误
Throws | NullPointerException: 如果异常为 null
See also | handlePageException(Throwable)
英文文档：

handlePageException

public abstract void handlePageException(Exception e)
                                  throws ServletException,
                                         IOException

This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP. If forwarding is not possible (for example because the response has already been committed), an implementation dependent mechanism should be used to invoke the error page (e.g. "including" the error page instead).

If no error page is defined in the page, the exception should be rethrown so that the standard servlet error handling takes over.

A JSP implementation class shall typically clean up any local state prior to invoking this and will return immediately thereafter. It is illegal to generate any output to the client, or to modify any ServletResponse state after invoking this call.

This method is kept for backwards compatiblity reasons. Newly generated code should use PageContext.handlePageException(Throwable).

Parameters:
e - the exception to be handled
Throws:
ServletException - if an error occurs while invoking the error page
IOException - if an I/O error occurred while invoking the error page
NullPointerException - if the exception is null
See Also:
handlePageException(Throwable)

abstract public void handlePageException(Throwable t) throws ServletException, java.io.IOException

此方法旨在通过将异常转发到此 JSP 的指定错误页面处理未处理的“页面”级异常。如果无法转发（比如因为已经提交了响应），则应该使用与实现相关的机制调用错误页面（例如，“包括”错误页面）。

如果页面中没有定义错误页面，则应该重新抛出异常，以便标准的 servlet 错误处理接管。

此方法旨在通过将异常重定向到此 JSP 的指定错误页面（如果未指定该页面，则执行一些与实现相关的操作）处理未处理的“页面”级异常。

在调用此方法前，JSP 实现类通常应该清除本地状态，并在调用此方法后立刻返回。向客户端生成任何输出，或者调用此方法后修改任何 ServletResponse 状态都是非法的。

t | 要处理的 throwable
Throws | ServletException: 如果调用错误页面时发生错误
Throws | java.io.IOException: 如果调用错误页面时发生 I/O 错误
Throws | NullPointerException: 如果异常为 null
See also | handlePageException(Exception)
英文文档：

handlePageException

public abstract void handlePageException(Throwable t)
                                  throws ServletException,
                                         IOException

This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP. If forwarding is not possible (for example because the response has already been committed), an implementation dependent mechanism should be used to invoke the error page (e.g. "including" the error page instead).

If no error page is defined in the page, the exception should be rethrown so that the standard servlet error handling takes over.

This method is intended to process an unhandled "page" level exception by redirecting the exception to either the specified error page for this JSP, or if none was specified, to perform some implementation dependent action.

A JSP implementation class shall typically clean up any local state prior to invoking this and will return immediately thereafter. It is illegal to generate any output to the client, or to modify any ServletResponse state after invoking this call.

Parameters:
t - the throwable to be handled
Throws:
ServletException - if an error occurs while invoking the error page
IOException - if an I/O error occurred while invoking the error page
NullPointerException - if the exception is null
See Also:
handlePageException(Exception)

public BodyContent pushBody()
返回一个新的 BodyContent 对象，保存当前 "out" JspWriter，并更新 PageContext 的页面范围属性名称空间中的 "out" 属性的值。
return 新的 BodyContent
英文文档：

pushBody

public BodyContent pushBody()
Return a new BodyContent object, save the current "out" JspWriter, and update the value of the "out" attribute in the page scope attribute namespace of the PageContext.

Returns:
the new BodyContent

public ErrorData getErrorData()
提供对错误信息的便捷访问。
return | 包含有关错误的信息的 ErrorData 实例，这些信息是根据 Servlet 规范从请求属性中获得的。如果没有错误页面（也就是说，如果页面指令的 isErrorPage 属性没有设置为 "true"），则该信息是无意义的。
since | 2.0
英文文档：

getErrorData

public ErrorData getErrorData()
Provides convenient access to error information.

Returns:
an ErrorData instance containing information about the error, as obtained from the request attributes, as per the Servlet specification. If this is not an error page (that is, if the isErrorPage attribute of the page directive is not set to "true"), the information is meaningless.
Since:
JSP 2.0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspException (Java EE 5)

javax.servlet.jsp
Class JspException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.jsp.JspException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JspTagException, SkipPageException
public class JspException
extends Exception

Extends: Throwable > Exception
Extended by: JspTagException, SkipPageException

JSP 引擎已知的一般异常；未捕获的 JspException 将导致调用 errorpage 机制。
英文文档：

A generic exception known to the JSP engine; uncaught JspExceptions will result in an invocation of the errorpage machinery.

See Also:
Serialized Form

Constructor Summary
JspException()
Construct a JspException.
JspException(String msg)
Constructs a new JSP exception with the specified message.
JspException(String message, Throwable cause)
Constructs a new JspException with the specified detail message and cause.
JspException(Throwable cause)
Constructs a new JspException with the specified cause.
Method Summary
 Throwable getRootCause()
Deprecated. As of JSP 2.1, replaced by Throwable.getCause()
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

public JspException()
构造 JspException。
英文文档：

JspException

public JspException()
Construct a JspException.

public JspException(String msg)
构造带指定消息的新 JSP 异常。该消息可以写入到服务器日志和/或向用户显示。
msg 指定异常消息文本的 String
英文文档：

JspException

public JspException(String msg)
Constructs a new JSP exception with the specified message. The message can be written to the server log and/or displayed for the user.

Parameters:
msg - a String specifying the text of the exception message

public JspException(String message, Throwable rootCause)
当 JSP 需要抛出异常并且需要包含有关妨碍 JSP 正常操作的“根本原因”异常的消息时，构造一个新 JSP 异常，该异常包含一条描述消息。
message | 包含异常消息文本的 String
rootCause | 防碍 servlet 正常操作的 Throwable 异常，使此 servlet 异常成为必需的
英文文档：

JspException

public JspException(String message,
                    Throwable cause)
Constructs a new JspException with the specified detail message and cause. The cause is saved for later retrieval by the Throwable.getCause() and getRootCause() methods.

See Also:
Exception.Exception(String, Throwable)

public JspException(Throwable rootCause)
当 JSP 需要抛出异常并且需要包含有关妨碍 JSP 正常操作的“根本原因”异常的消息时，构造一个新 JSP 异常。该异常消息以底层异常的本地化消息为基础。

此方法调用 Throwable 异常的 getLocalizedMessage 方法获取本地化异常消息。在子类化 JspException 时，可重写此方法以创建设计用于特定语言环境的异常消息。

rootCause 防碍 JSP 正常操作的 Throwable 异常，使此 JSP 异常成为必需的
英文文档：

JspException

public JspException(Throwable cause)
Constructs a new JspException with the specified cause. The cause is saved for later retrieval by the Throwable.getCause() and getRootCause() methods.

See Also:
Exception.Exception(Throwable)
Method Detail

public Throwable getRootCause()
返回导致此 JSP 异常的异常。
return 导致此 JSP 异常的 Throwable
英文文档：

getRootCause

public Throwable getRootCause()
Deprecated. As of JSP 2.1, replaced by Throwable.getCause()

Returns the exception that caused this JSP exception.

Returns:
the Throwable that caused this JSP exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspTagException (Java EE 5)

javax.servlet.jsp
Class JspTagException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.jsp.JspException
                extended by  javax.servlet.jsp.JspTagException
All Implemented Interfaces:
Serializable
public class JspTagException
extends JspException

Extends: Throwable > Exception > JspException

标记处理程序使用的异常，指示某个不可恢复的错误。此错误将由顶层 JSP 页面捕获，并且将导致一个错误页面。
英文文档：

Exception to be used by a Tag Handler to indicate some unrecoverable error. This error is to be caught by the top level of the JSP page and will result in an error page.

See Also:
Serialized Form

Constructor Summary
JspTagException()
Constructs a new JspTagException with no message.
JspTagException(String msg)
Constructs a new JspTagException with the specified message.
JspTagException(String message, Throwable rootCause)
Constructs a new JspTagException when the JSP Tag needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message.
JspTagException(Throwable rootCause)
Constructs a new JSP Tag exception when the JSP Tag needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation.
Method Summary
Methods inherited from class javax.servlet.jsp.JspException
getRootCause
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

public JspTagException(String msg)
构造带指定消息的新 JspTagException。该消息可以写入到服务器日志和/或向用户显示。
msg 指定异常消息文本的 String
英文文档：

JspTagException

public JspTagException(String msg)
Constructs a new JspTagException with the specified message. The message can be written to the server log and/or displayed for the user.

Parameters:
msg - a String specifying the text of the exception message

public JspTagException()
构造不带消息的新 JspTagException。
英文文档：

JspTagException

public JspTagException()
Constructs a new JspTagException with no message.

public JspTagException(String message, Throwable rootCause)
当 JSP 标记需要抛出异常并且需要包含有关妨碍 JSP 标记正常操作的“根本原因”异常的消息时，构造一个新 JspTagException，该异常包含一条描述消息。
message | 包含异常消息文本的 String
rootCause | 防碍 JSP 标记正常操作的 Throwable 异常，使此 JSP 标记异常成为必需的
since | 2.0
英文文档：

JspTagException

public JspTagException(String message,
                       Throwable rootCause)
Constructs a new JspTagException when the JSP Tag needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message.

Parameters:
message - a String containing the text of the exception message
rootCause - the Throwable exception that interfered with the JSP Tag's normal operation, making this JSP Tag exception necessary
Since:
JSP 2.0

public JspTagException(Throwable rootCause)
当 JSP 标记需要抛出异常并且需要包含有关妨碍 JSP 标记正常操作的“根本原因”异常的消息时，构造一个新 JSP 标记异常。该异常消息以底层异常的本地化消息为基础。

此方法调用 Throwable 异常的 getLocalizedMessage 方法获取本地化异常消息。在子类化 JspTagException 时，可重写此方法以创建设计用于特定语言环境的异常消息。

rootCause | 防碍 JSP 标记正常操作的 Throwable 异常，使此 JSP 标记异常成为必需的
since | 2.0
英文文档：

JspTagException

public JspTagException(Throwable rootCause)
Constructs a new JSP Tag exception when the JSP Tag needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation. The exception's message is based on the localized message of the underlying exception.

This method calls the getLocalizedMessage method on the Throwable exception to get a localized exception message. When subclassing JspTagException, this method can be overridden to create an exception message designed for a specific locale.

Parameters:
rootCause - the Throwable exception that interfered with the JSP Tag's normal operation, making the JSP Tag exception necessary
Since:
JSP 2.0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SkipPageException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.jsp
Class SkipPageException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.jsp.JspException
                extended by  javax.servlet.jsp.SkipPageException
All Implemented Interfaces:
Serializable
public class SkipPageException
extends JspException

Extends: Throwable > Exception > JspException

指示调用页面必须停止求值的异常。由简单标记处理程序抛出，指示不必对页面的剩余部分求值。在一个标记调用另一个标记的情况下（在标记文件中也可能出现这种情况），结果被传播回页面。效果类似于经典标记处理程序从 doEndTag() 返回 Tag.SKIP_PAGE 的效果。Jsp 片段也可能抛出此异常。此异常不应在 JSP 页面或标记文件中手动抛出 - 该行为是不确定的。该异常应该在 SimpleTag 处理程序和 JSP 片段中抛出。
since | 2.0
See also | doTag, invoke, doEndTag
英文文档：

Exception to indicate the calling page must cease evaluation. Thrown by a simple tag handler to indicate that the remainder of the page must not be evaluated. The result is propagated back to the pagein the case where one tag invokes another (as can be the case with tag files). The effect is similar to that of a Classic Tag Handler returning Tag.SKIP_PAGE from doEndTag(). Jsp Fragments may also throw this exception. This exception should not be thrown manually in a JSP page or tag file - the behavior is undefined. The exception is intended to be thrown inside SimpleTag handlers and in JSP fragments.

Since:
JSP 2.0
See Also:
SimpleTag.doTag(),
JspFragment.invoke(java.io.Writer),
Tag.doEndTag(),
Serialized Form

Constructor Summary
SkipPageException()
Creates a SkipPageException with no message.
SkipPageException(String message)
Creates a SkipPageException with the provided message.
SkipPageException(String message, Throwable rootCause)
Creates a SkipPageException with the provided message and root cause.
SkipPageException(Throwable rootCause)
Creates a SkipPageException with the provided root cause.
Method Summary
Methods inherited from class javax.servlet.jsp.JspException
getRootCause
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

public SkipPageException()
创建不带消息的 SkipPageException。
英文文档：

SkipPageException

public SkipPageException()
Creates a SkipPageException with no message.

public SkipPageException(String message)
创建带提供的消息的 SkipPageException。
message 详细信息
英文文档：

SkipPageException

public SkipPageException(String message)
Creates a SkipPageException with the provided message.

Parameters:
message - the detail message

public SkipPageException(String message, Throwable rootCause)
创建带提供的消息和根本原因的 SkipPageException。
message | 详细信息
rootCause | 此异常的根本原因
英文文档：

SkipPageException

public SkipPageException(String message,
                         Throwable rootCause)
Creates a SkipPageException with the provided message and root cause.

Parameters:
message - the detail message
rootCause - the originating cause of this exception

public SkipPageException(Throwable rootCause)
创建带提供的根本原因的 SkipPageException。
rootCause 此异常的根本原因
英文文档：

SkipPageException

public SkipPageException(Throwable rootCause)
Creates a SkipPageException with the provided root cause.

Parameters:
rootCause - the originating cause of this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.servlet.jsp.el (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.servlet.jsp.el

Provides the ELResolver classes that define the object resolution rules that must be supported by a JSP container with the new unified Expression Language.

See:
Description

Interface Summary
FunctionMapper | Deprecated. As of JSP 2.1, replaced by FunctionMapper
VariableResolver | Deprecated. As of JSP 2.1, replaced by ELResolver

Class Summary
Expression | Deprecated. As of JSP 2.1, replaced by ValueExpression
ExpressionEvaluator | Deprecated. As of JSP 2.1, replaced by ExpressionFactory
ImplicitObjectELResolver | Defines variable resolution behavior for the EL implicit objects defined in the JSP specification.
ScopedAttributeELResolver | Defines variable resolution behavior for scoped attributes.

Exception Summary
ELException | Deprecated. As of JSP 2.1, replaced by ELException
ELParseException | Deprecated. As of JSP 2.1, replaced by ELException

Package javax.servlet.jsp.el Description

Provides the ELResolver classes that define the object resolution rules that must be supported by a JSP container with the new unified Expression Language.

The package also defines programmatic access to the old Expression Language evaluator (pre JSP 2.1).

Please note that as of JSP 2.1, all classes and interfaces that were in package javax.servlet.jsp.el have been deprecated in favor of the new unified Expression Language APIs (javax.el). See the Expression Language specification document for more details.

While a JSP container must still support the deprecated APIs defined in javax.servlet.jsp.el, developers should only rely on the new javax.el APIs for new development work.

Two ELResolver classes have been added in JSP 2.1 to implement object resolution rules that must be supported by a JSP container with the new unified Expression Language: ImplicitObjectELResolver and ScopedAttributeELResolver.

Documentation on the old and deprecated API

The JavaServer Pages(tm) (JSP) 2.0 specification provides a portable API for evaluating "EL Expressions". As of JSP 2.0, EL expressions can be placed directly in the template text of JSP pages and tag files.

This package contains a number of classes and interfaces that describe and define programmatic access to the Expression Language evaluator. This API can also be used by an implementation of JSP to evaluate the expressions, but other implementations, like open-coding into Java bytecodes, are allowed. This package is intended to have no dependencies on other portions of the JSP 2.0 specification.

Expression Evaluator

Programmatic access to the EL Expression Evaluator is provided through the following types:
  • ExpressionEvaluator
  • Expression
  • FunctionMapper
  • VariableResolver

An ExpressionEvaluator object can be obtained from a JspContext object through the getExpressionEvaluator method. An ExpressionEvaluator encapsulates the EL processor. An EL expression provided as a String can then be evaluated directly, or it can be parsed first into an Expression object. The parse step, can be used to factor out the cost of parsing the expression, or even the cost of optimizing the implementation.

The parsing of an expression string is done against a target type, a default prefix (that applies when a function has no prefix), and a FunctionMapper. The FunctionMapper object maps a prefix and a local name part into a java.lang.reflect.Method object.

The interpretation or evaluation of a parsed expression is done using a VariableResolver object. This object resolves top level object names into Objects. A VariableResolver can be obtained from a JspContext object through the getVariableResolver method.

Exceptions

The ELException exception is used by the expression language to denote any exception that may arise during the parsing or evaluation of an expression. The ELParseException exception is a subclass of ELException that corresponds to parsing errors

Parsing errors are conveyed as exceptions to simplify the API. It is expected that many JSP containers will use additional mechanisms to parse EL expressions and report their errors - a run-time API cannot provide accurate line-error numbers without additional machinery.

Code Fragment

Below is a non-normative code fragment outlining how the APIs can be used.

// Get an instance of an ExpressionEvaluator

ExpressionEvaluator ee = myJspContext.getExpressionEvaluator();
VariableResolver vr = myJspContext.getVariableResolver();

FunctionMapper fm; // we don't have a portable implementation yet

// Example of compiling an expression.  See [ISSUE-2]
// Errors detected this way may have higher quality than those
// found with a simple validate() invocation.

ExpressionCompilation ce;

try {
  ce = ee.prepareExpression(expr,
                            targetClass,
                            fm,
                            null // no prefixes
                            );
} catch (ELParseException e) {
        log (e.getMessage());
}

try {
  ce.evaluate(vr);
} catch (ElException e) {
        log (e);
}

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.servlet.jsp.el Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.servlet.jsp.el

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.el.ELResolver
      • javax.servlet.jsp.el.ImplicitObjectELResolver
      • javax.servlet.jsp.el.ScopedAttributeELResolver
    • javax.servlet.jsp.el.Expression
    • javax.servlet.jsp.el.ExpressionEvaluator
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.servlet.jsp.el.ELException
          • javax.servlet.jsp.el.ELParseException

Interface Hierarchy

  • javax.servlet.jsp.el.FunctionMapper
  • javax.servlet.jsp.el.VariableResolver
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


FunctionMapper (Java EE 5)

javax.servlet.jsp.el
Interface FunctionMapper

Deprecated. As of JSP 2.1, replaced by FunctionMapper

用于 EL 函数名称与方法之间映射的接口。

例如，实现此接口的类可以参考标记库信息来解析映射。

since 2.0
英文文档：

public interface FunctionMapper

The interface to a map between EL function names and methods.

Classes implementing this interface may, for instance, consult tag library information to resolve the map.

Since:
JSP 2.0

Method Summary
 Method resolveFunction(String prefix, String localName)
Deprecated. Resolves the specified local name and prefix into a Java.lang.Method.

Method Detail

public Method resolveFunction(String prefix, String localName)
将指定本地名称和前缀解析为 Java.lang.Method。如果没有找到前缀和本地名称，则返回 null。
prefix | 函数前缀；如果没有前缀，则为 ""。
localName | 函数的短名称
return | 方法映射的结果。null 意味着没有发现任何条目。
英文文档：

resolveFunction

Method resolveFunction(String prefix,
                       String localName)
Deprecated.
Resolves the specified local name and prefix into a Java.lang.Method. Returns null if the prefix and local name are not found.

Parameters:
prefix - the prefix of the function, or "" if no prefix.
localName - the short name of the function
Returns:
the result of the method mapping. Null means no entry found.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VariableResolver (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.jsp.el
Interface VariableResolver

Deprecated. As of JSP 2.1, replaced by ELResolver

此类用于自定义 ExpressionEvaluator 在求值时解析变量引用的方式。例如，此类的实例可以实现其自己的变量查找机制，或者引入重写任何其他变量的“隐式变量”的概念。此类的实例应该在对表达式求值时传递。

此类的实例包含解析发生时将要依赖的上下文

since 2.0
英文文档：

public interface VariableResolver

This class is used to customize the way an ExpressionEvaluator resolves variable references at evaluation time. For example, instances of this class can implement their own variable lookup mechanisms, or introduce the notion of "implicit variables" which override any other variables. An instance of this class should be passed when evaluating an expression.

An instance of this class includes the context against which resolution will happen

Since:
JSP 2.0

Method Summary
 Object resolveVariable(String pName)
Deprecated. Resolves the specified variable.

Method Detail

public Object resolveVariable(String pName) throws ELException
解析指定变量。如果未找到变量，则返回 null。
pName | 要解析的变量的名称
return | 变量解析的结果
Throws | ELException: 如果试图解析给定变量时发生失败
英文文档：

resolveVariable

Object resolveVariable(String pName)
                       throws ELException
Deprecated.
Resolves the specified variable. Returns null if the variable is not found.

Parameters:
pName - the name of the variable to resolve
Returns:
the result of the variable resolution
Throws:
ELException - if a failure occurred while trying to resolve the given variable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Expression (Java EE 5)

javax.servlet.jsp.el
Class Expression

java.lang.Object
    extended by  javax.servlet.jsp.el.Expression
Deprecated. As of JSP 2.1, replaced by ValueExpression

用于已准备好的表达式的抽象类。

Expression 实例可通过 ExpressionEvaluator 实例获得。

Expression 可能已经对表达式进行了语法解析，也可能还没有这么做。调用 evaluate() 方法的客户端应该准备好应对引发 ELParseException 异常的情况。

since 2.0
英文文档：

public abstract class Expression
extends Object

The abstract class for a prepared expression.

An instance of an Expression can be obtained via from an ExpressionEvaluator instance.

An Expression may or not have done a syntactic parse of the expression. A client invoking the evaluate() method should be ready for the case where ELParseException exceptions are raised.

Since:
JSP 2.0

Constructor Summary
Expression()
Deprecated.
Method Summary
abstract  Object evaluate(VariableResolver vResolver)
Deprecated. Evaluates an expression that was previously prepared.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Expression()
英文文档：

Expression

public Expression()
Deprecated.
Method Detail

abstract public Object evaluate(VariableResolver vResolver) throws ELException
对以前准备好的表达式求值。在某些实现中，准备表达式需要进行完整的语法验证，但在其他实现中可能不需要这样做。因为是运行时求值，所以对表达式求值可能引发 ELParseException 和其他 ELException。
vResolver | 一个 VariableResolver 实例，可在运行时使用它将隐式对象的名称解析为 Objects。
return | 表达式求值的结果。
Throws | ELException: 如果表达式求值失败，则抛出此异常。
英文文档：

evaluate

public abstract Object evaluate(VariableResolver vResolver)
                         throws ELException
Deprecated.
Evaluates an expression that was previously prepared. In some implementations preparing an expression involves full syntactic validation, but others may not do so. Evaluating the expression may raise an ELParseException as well as other ELExceptions due to run-time evaluation.

Parameters:
vResolver - A VariableResolver instance that can be used at runtime to resolve the name of implicit objects into Objects.
Returns:
The result of the expression evaluation.
Throws:
ELException - Thrown if the expression evaluation failed.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExpressionEvaluator (Java EE 5)

javax.servlet.jsp.el
Class ExpressionEvaluator

java.lang.Object
    extended by  javax.servlet.jsp.el.ExpressionEvaluator
Deprecated. As of JSP 2.1, replaced by ExpressionFactory

表达式语言计算器的抽象基类。实现表达式语言的类通过此抽象类公开其功能。

ExpressionEvaluator 实例可通过 JspContext / PageContext 获得。

parseExpression() 和 evaluate() 方法必须是线程安全的。也就是说，多个线程可以对同一 ExpressionEvaluator 对象同时调用这些方法。如果实现依赖于 transient 状态，那么它们应该使访问同步。但是，实现不应假定每种 ExpressionEvaluator 类型中只有一个对象将被实例化；因此，全局缓存应该是静态的。

一次只能解析或求值一个以 '${' 开头并以 '}' 结尾的 EL 表达式。EL 表达式无法与静态文本混合。例如，试图解析或求值 "abc${1+1}def${1+1}ghi" 或者甚至 "${1+1}${1+1}" 将导致抛出 ELException。

以下是具有合法语法的 EL 表达式的示例：

  • ${person.lastName}
  • ${8 * 8}
  • ${my:reverse('hello')}

since 2.0
英文文档：

public abstract class ExpressionEvaluator
extends Object

The abstract base class for an expression-language evaluator. Classes that implement an expression language expose their functionality via this abstract class.

An instance of the ExpressionEvaluator can be obtained via the JspContext / PageContext

The parseExpression() and evaluate() methods must be thread-safe. That is, multiple threads may call these methods on the same ExpressionEvaluator object simultaneously. Implementations should synchronize access if they depend on transient state. Implementations should not, however, assume that only one object of each ExpressionEvaluator type will be instantiated; global caching should therefore be static.

Only a single EL expression, starting with '${' and ending with '}', can be parsed or evaluated at a time. EL expressions cannot be mixed with static text. For example, attempting to parse or evaluate "abc${1+1}def${1+1}ghi" or even "${1+1}${1+1}" will cause an ELException to be thrown.

The following are examples of syntactically legal EL expressions:

  • ${person.lastName}
  • ${8 * 8}
  • ${my:reverse('hello')}

Since:
JSP 2.0

Constructor Summary
ExpressionEvaluator()
Deprecated.
Method Summary
abstract Object | evaluate(String expression, Class expectedType, VariableResolver vResolver, FunctionMapper fMapper) Deprecated. Evaluates an expression.
abstract Expression | parseExpression(String expression, Class expectedType, FunctionMapper fMapper) Deprecated. Prepare an expression for later evaluation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ExpressionEvaluator()
英文文档：

ExpressionEvaluator

public ExpressionEvaluator()
Deprecated.
Method Detail

abstract public Expression parseExpression(String expression, Class<T> expectedType, FunctionMapper fMapper) throws ELException
为以后的求值准备表达式。此方法应对表达式执行语法验证；如果执行验证时检测到错误，则将引发 ELParseException。
expression | 要求值的表达式。
expectedType | 求值结果的期望类型
fMapper | 用来解析表达式中发现的函数的 FunctionMapper。它可以为 null，这种情况下此调用不支持任何函数。在从 parseExpression() 返回之后，ExpressionEvaluator 不得占用 FunctionMapper 引用。返回的 Expression 对象必须调用相同的函数，不管提供的 FunctionMapper 实例中的映射在调用 ExpressionEvaluator.parseExpression() 和 Expression.evaluate() 之间是否发生更改。
return | 封装参数的 Expression 对象。
Throws | ELException: 如果发现解析错误，则抛出此异常。
英文文档：

parseExpression

public abstract Expression parseExpression(String expression,
                                           Class expectedType,
                                           FunctionMapper fMapper)
                                    throws ELException
Deprecated.
Prepare an expression for later evaluation. This method should perform syntactic validation of the expression; if in doing so it detects errors, it should raise an ELParseException.

Parameters:
expression - The expression to be evaluated.
expectedType - The expected type of the result of the evaluation
fMapper - A FunctionMapper to resolve functions found in the expression. It can be null, in which case no functions are supported for this invocation. The ExpressionEvaluator must not hold on to the FunctionMapper reference after returning from parseExpression(). The Expression object returned must invoke the same functions regardless of whether the mappings in the provided FunctionMapper instance change between calling ExpressionEvaluator.parseExpression() and Expression.evaluate().
Returns:
The Expression object encapsulating the arguments.
Throws:
ELException - Thrown if parsing errors were found.

abstract public Object evaluate(String expression, Class<T> expectedType, VariableResolver vResolver, FunctionMapper fMapper) throws ELException
对表达式求值。此方法可能执行一些语法验证，如果执行语法验证，那么它在遇到语法错误时将引发 ELParseException 错误。EL 求值错误将导致引发 ELException。
expression | 要求值的表达式。
expectedType | 求值结果的期望类型
vResolver | 一个 VariableResolver 实例，可在运行时使用它将隐式对象的名称解析为 Objects。
fMapper | 用来解析表达式中发现的函数的 FunctionMapper。它可以为 null，这种情况下此调用不支持任何函数。
return | 表达式求值的结果。
Throws | ELException: 如果表达式求值失败，则抛出此异常。
英文文档：

evaluate

public abstract Object evaluate(String expression,
                                Class expectedType,
                                VariableResolver vResolver,
                                FunctionMapper fMapper)
                         throws ELException
Deprecated.
Evaluates an expression. This method may perform some syntactic validation and, if so, it should raise an ELParseException error if it encounters syntactic errors. EL evaluation errors should cause an ELException to be raised.

Parameters:
expression - The expression to be evaluated.
expectedType - The expected type of the result of the evaluation
vResolver - A VariableResolver instance that can be used at runtime to resolve the name of implicit objects into Objects.
fMapper - A FunctionMapper to resolve functions found in the expression. It can be null, in which case no functions are supported for this invocation.
Returns:
The result of the expression evaluation.
Throws:
ELException - Thrown if the expression evaluation failed.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ImplicitObjectELResolver (Java EE 5)

javax.servlet.jsp.el
Class ImplicitObjectELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.servlet.jsp.el.ImplicitObjectELResolver

public class ImplicitObjectELResolver
extends ELResolver

Defines variable resolution behavior for the EL implicit objects defined in the JSP specification.

The following variables are resolved by this ELResolver, as per the JSP specification:

  • pageContext - the PageContext object.
  • pageScope - a Map that maps page-scoped attribute names to their values.
  • requestScope - a Map that maps request-scoped attribute names to their values.
  • sessionScope - a Map that maps session-scoped attribute names to their values.
  • applicationScope - a Map that maps application-scoped attribute names to their values.
  • param - a Map that maps parameter names to a single String parameter value (obtained by calling ServletRequest.getParameter(String name)).
  • paramValues - a Map that maps parameter names to a String[] of all values for that parameter (obtained by calling ServletRequest.getParameterValues(String name)).
  • header - a Map that maps header names to a single String header value (obtained by calling HttpServletRequest.getHeader(String name)).
  • headerValues - a Map that maps header names to a String[] of all values for that header (obtained by calling HttpServletRequest.getHeaders(String)).
  • cookie - a Map that maps cookie names to a single Cookie object. Cookies are retrieved according to the semantics of HttpServletRequest.getCookies(). If the same name is shared by multiple cookies, an implementation must use the first one encountered in the array of Cookie objects returned by the getCookies() method. However, users of the cookie implicit object must be aware that the ordering of cookies is currently unspecified in the servlet specification.
  • initParam - a Map that maps context initialization parameter names to their String parameter value (obtained by calling ServletContext.getInitParameter(String name)).

Since:
JSP 2.1
See Also:
ELResolver

Field Summary

Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE

Constructor Summary
ImplicitObjectELResolver()

Method Summary
 Class<String> getCommonPropertyType(ELContext context, Object base)
          If the base object is null, returns String.class.
 Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
          If the base object is null, and the property matches the name of a JSP implicit object, returns an Iterator containing FeatureDescriptor objects with information about each JSP implicit object resolved by this resolver.
 Class getType(ELContext context, Object base, Object property)
          If the base object is null, and the property matches the name of a JSP implicit object, returns null to indicate that no types are ever accepted to setValue().
 Object getValue(ELContext context, Object base, Object property)
          If the base object is null, and the property matches the name of a JSP implicit object, returns the implicit object.
 boolean isReadOnly(ELContext context, Object base, Object property)
          If the base object is null, and the property matches the name of a JSP implicit object, returns true to indicate that implicit objects cannot be overwritten.
 void setValue(ELContext context, Object base, Object property, Object val)
          If the base object is null, and the property matches the name of a JSP implicit object, throws PropertyNotWritableException to indicate that implicit objects cannot be overwritten.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ImplicitObjectELResolver

public ImplicitObjectELResolver()
Method Detail

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
If the base object is null, and the property matches the name of a JSP implicit object, returns the implicit object.

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if an implicit object is matched. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the implicit object to resolve.
Returns:
If the propertyResolved property of ELContext was set to true, then the implicit object; otherwise undefined.
Throws:
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

getType

public Class getType(ELContext context,
                     Object base,
                     Object property)
If the base object is null, and the property matches the name of a JSP implicit object, returns null to indicate that no types are ever accepted to setValue().

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if an implicit object is matched. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the implicit object to resolve.
Returns:
If the propertyResolved property of ELContext was set to true, then null; otherwise undefined.
Throws:
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object val)
If the base object is null, and the property matches the name of a JSP implicit object, throws PropertyNotWritableException to indicate that implicit objects cannot be overwritten.

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if an implicit object is matched. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the implicit object.
val - The value to be associated with the implicit object.
Throws:
NullPointerException - if context is null.
PropertyNotWritableException - always thrown, if the implicit object name is recognized by this resolver.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
If the base object is null, and the property matches the name of a JSP implicit object, returns true to indicate that implicit objects cannot be overwritten.

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if an implicit object is matched. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the implicit object.
Returns:
If the propertyResolved property of ELContext was set to true, then true; otherwise undefined.
Throws:
NullPointerException - if context is null.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
If the base object is null, and the property matches the name of a JSP implicit object, returns an Iterator containing FeatureDescriptor objects with information about each JSP implicit object resolved by this resolver. Otherwise, returns null.

The Iterator returned must contain one instance of FeatureDescriptor for each of the EL implicit objects defined by the JSP spec. Each info object contains information about a single implicit object, and is initialized as follows:

  • displayName - The name of the implicit object.
  • name - Same as displayName property.
  • shortDescription - A suitable description for the implicit object. Will vary by implementation.
  • expert - false
  • hidden - false
  • preferred - true
    • In addition, the following named attributes must be set in the returned FeatureDescriptors:
  • ELResolver.TYPE - The runtime type of the implicit object.
  • ELResolver.RESOLVABLE_AT_DESIGN_TIME - true.

    • Specified by:
    getFeatureDescriptors in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - Only null is handled by this resolver. Other values will result in a null return value.
    Returns:
    An Iterator containing one FeatureDescriptor object for each implicit object, or null if base is not null.
    See Also:
    FeatureDescriptor

    getCommonPropertyType

    public Class<String> getCommonPropertyType(ELContext context,
                                           Object base)
    If the base object is null, returns String.class. Otherwise, returns null.

    Specified by:
    getCommonPropertyType in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - Only null is handled by this resolver. Other values will result in a null return value.
    Returns:
    null if base is not null; otherwise String.class.
    Overview  Package   Class  Tree  Deprecated  Index  Help
     PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
    SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
    Submit a bug or feature

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


ScopedAttributeELResolver (Java EE 5)

javax.servlet.jsp.el
Class ScopedAttributeELResolver

java.lang.Object
    extended by  javax.el.ELResolver
        extended by  javax.servlet.jsp.el.ScopedAttributeELResolver

public class ScopedAttributeELResolver
extends ELResolver

Defines variable resolution behavior for scoped attributes.

This resolver handles all variable resolutions (where base is null. It searches PageContext.findAttribute() for a matching attribute. If not found, it will return null, or in the case of setValue it will create a new attribute in the page scope with the given name.

Since:
JSP 2.1
See Also:
ELResolver

Field Summary
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor Summary
ScopedAttributeELResolver()
Method Summary
Class<String> | getCommonPropertyType(ELContext context, Object base) If the base object is null, returns String.class.
Iterator<FeatureDescriptor> | getFeatureDescriptors(ELContext context, Object base) If the base object is null, returns an Iterator containing FeatureDescriptor objects with information about each scoped attribute resolved by this resolver.
Class<Object> | getType(ELContext context, Object base, Object property) If the base object is null, returns Object.class to indicate that any type is valid to set for a scoped attribute.
Object | getValue(ELContext context, Object base, Object property) If the base object is null, searches the page, request, session and application scopes for an attribute with the given name and returns it, or null if no attribute exists with the current name.
boolean | isReadOnly(ELContext context, Object base, Object property) If the base object is null, returns false to indicate that scoped attributes are never read-only.
void | setValue(ELContext context, Object base, Object property, Object val) If the base object is null, sets an existing scoped attribute to the new value, or creates a new scoped attribute if one does not exist by this name.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ScopedAttributeELResolver

public ScopedAttributeELResolver()
Method Detail

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
If the base object is null, searches the page, request, session and application scopes for an attribute with the given name and returns it, or null if no attribute exists with the current name.

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if base is null. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the scoped attribute to resolve.
Returns:
If the propertyResolved property of ELContext was set to true, then the scoped attribute; otherwise undefined.
Throws:
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

getType

public Class<Object> getType(ELContext context,
                             Object base,
                             Object property)
If the base object is null, returns Object.class to indicate that any type is valid to set for a scoped attribute.

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if base is null. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getType in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the scoped attribute to resolve.
Returns:
If the propertyResolved property of ELContext was set to true, then Object.class; otherwise undefined.
Throws:
NullPointerException - if context is null
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object val)
If the base object is null, sets an existing scoped attribute to the new value, or creates a new scoped attribute if one does not exist by this name.

If the provided attribute name matches the key of an attribute in page scope, request scope, session scope, or application scope, the corresponding attribute value will be replaced by the provided value. Otherwise, a new page scope attribute will be created with the given name and value.

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if base is null. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
setValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the scoped attribute to set.
val - The value for the scoped attribute.
Throws:
NullPointerException - if context is null.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
If the base object is null, returns false to indicate that scoped attributes are never read-only.

The propertyResolved property of the ELContext object must be set to true by this resolver before returning if base is null. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
isReadOnly in class ELResolver
Parameters:
context - The context of this evaluation.
base - Only null is handled by this resolver. Other values will result in an immediate return.
property - The name of the scoped attribute.
Returns:
If the propertyResolved property of ELContext was set to true, then false; otherwise undefined.
Throws:
NullPointerException - if context is null.
ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
If the base object is null, returns an Iterator containing FeatureDescriptor objects with information about each scoped attribute resolved by this resolver. Otherwise, returns null.

The Iterator returned must contain one instance of FeatureDescriptor for each scoped attribute found in any scope. Each info object contains information about a single scoped attribute, and is initialized as follows:

  • displayName - The name of the scoped attribute.
  • name - Same as displayName property.
  • shortDescription - A suitable description for the scoped attribute. Should include the attribute's current scope (page, request, session, application). Will vary by implementation.
  • expert - false
  • hidden - false
  • preferred - true
    • In addition, the following named attributes must be set in the returned FeatureDescriptors:
  • ELResolver.TYPE - The current runtime type of the scoped attribute.
  • ELResolver.RESOLVABLE_AT_DESIGN_TIME - true.

    • Specified by:
    getFeatureDescriptors in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - Only null is handled by this resolver. Other values will result in a null return value.
    Returns:
    An Iterator containing one FeatureDescriptor object for each scoped attribute, or null if base is not null.
    See Also:
    FeatureDescriptor

    getCommonPropertyType

    public Class<String> getCommonPropertyType(ELContext context,
                                           Object base)
    If the base object is null, returns String.class. Otherwise, returns null.

    Specified by:
    getCommonPropertyType in class ELResolver
    Parameters:
    context - The context of this evaluation.
    base - Only null is handled by this resolver. Other values will result in a null return value.
    Returns:
    null if base is not null; otherwise String.class.
    Overview Package Class Tree Deprecated Index Help
    PREV CLASS NEXT CLASS FRAMES NO FRAMES
    SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
    Submit a bug or feature

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


ELException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.jsp.el
Class ELException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.jsp.el.ELException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ELParseException
Deprecated. As of JSP 2.1, replaced by ELException

Extends: Throwable > Exception
Extended by: ELParseException

表示计算器求值操作期间出现的任何异常情况。
since 2.0
英文文档：

public class ELException
extends Exception

Represents any of the exception conditions that arise during the operation evaluation of the evaluator.

Since:
JSP 2.0
See Also:
Serialized Form

Constructor Summary
ELException()
Deprecated. Creates an ELException with no detail message.
ELException(String pMessage)
Deprecated. Creates an ELException with the provided detail message.
ELException(String pMessage, Throwable pRootCause)
Deprecated. Creates an ELException with the given detail message and root cause.
ELException(Throwable pRootCause)
Deprecated. Creates an ELException with the given root cause.
Method Summary
 Throwable getRootCause()
Deprecated. Returns the root cause.
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

public ELException()
创建不带详细消息的 ELException。
英文文档：

ELException

public ELException()
Deprecated.
Creates an ELException with no detail message.

public ELException(String pMessage)
创建带有提供的详细消息的 ELException。
pMessage 详细信息
英文文档：

ELException

public ELException(String pMessage)
Deprecated.
Creates an ELException with the provided detail message.

Parameters:
pMessage - the detail message

public ELException(Throwable pRootCause)
创建带有给定根本原因的 ELException。
pRootCause 此异常的根本原因
英文文档：

ELException

public ELException(Throwable pRootCause)
Deprecated.
Creates an ELException with the given root cause.

Parameters:
pRootCause - the originating cause of this exception

public ELException(String pMessage, Throwable pRootCause)
创建带有给定详细消息和根本原因的 ELException。
pMessage | 详细信息
pRootCause | 此异常的根本原因
英文文档：

ELException

public ELException(String pMessage,
                   Throwable pRootCause)
Deprecated.
Creates an ELException with the given detail message and root cause.

Parameters:
pMessage - the detail message
pRootCause - the originating cause of this exception
Method Detail

public Throwable getRootCause()
返回根本原因。
return 此异常的根本原因
英文文档：

getRootCause

public Throwable getRootCause()
Deprecated.
Returns the root cause.

Returns:
the root cause of this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ELParseException (Java EE 5)

javax.servlet.jsp.el
Class ELParseException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.servlet.jsp.el.ELException
                extended by  javax.servlet.jsp.el.ELParseException
All Implemented Interfaces:
Serializable
Deprecated. As of JSP 2.1, replaced by ELException

Extends: Throwable > Exception > ELException

表示解析 EL 表达式时遇到的解析错误。
since 2.0
英文文档：

public class ELParseException
extends ELException

Represents a parsing error encountered while parsing an EL expression.

Since:
JSP 2.0
See Also:
Serialized Form

Constructor Summary
ELParseException()
Deprecated. Creates an ELParseException with no detail message.
ELParseException(String pMessage)
Deprecated. Creates an ELParseException with the provided detail message.
Method Summary
Methods inherited from class javax.servlet.jsp.el.ELException
getRootCause
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

public ELParseException()
创建不带详细消息的 ELParseException。
英文文档：

ELParseException

public ELParseException()
Deprecated.
Creates an ELParseException with no detail message.

public ELParseException(String pMessage)
创建带有提供的详细消息的 ELParseException。
pMessage 详细信息
英文文档：

ELParseException

public ELParseException(String pMessage)
Deprecated.
Creates an ELParseException with the provided detail message.

Parameters:
pMessage - the detail message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.servlet.jsp.tagext (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.servlet.jsp.tagext

Classes and interfaces for the definition of JavaServer Pages Tag Libraries.

See:
Description

Interface Summary
BodyTag | The BodyTag interface extends IterationTag by defining additional methods that let a tag handler manipulate the content of evaluating its body.
DynamicAttributes | For a tag to declare that it accepts dynamic attributes, it must implement this interface.
IterationTag | The IterationTag interface extends Tag by defining one additional method that controls the reevaluation of its body.
JspIdConsumer | This interface indicates to the container that a tag handler wishes to be provided with a compiler generated ID.
JspTag | Serves as a base class for Tag and SimpleTag.
SimpleTag | Interface for defining Simple Tag Handlers.
Tag | The interface of a classic tag handler that does not want to manipulate its body.
TryCatchFinally | The auxiliary interface of a Tag, IterationTag or BodyTag tag handler that wants additional hooks for managing resources.

Class Summary
BodyContent | An encapsulation of the evaluation of the body of an action so it is available to a tag handler.
BodyTagSupport | A base class for defining tag handlers implementing BodyTag.
FunctionInfo | Information for a function in a Tag Library.
JspFragment | Encapsulates a portion of JSP code in an object that can be invoked as many times as needed.
PageData | Translation-time information on a JSP page.
SimpleTagSupport | A base class for defining tag handlers implementing SimpleTag.
TagAdapter | Wraps any SimpleTag and exposes it using a Tag interface.
TagAttributeInfo | Information on the attributes of a Tag, available at translation time.
TagData | The (translation-time only) attribute/value information for a tag instance.
TagExtraInfo | Optional class provided by the tag library author to describe additional translation-time information not described in the TLD.
TagFileInfo | Tag information for a tag file in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.
TagInfo | Tag information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.
TagLibraryInfo | Translation-time information associated with a taglib directive, and its underlying TLD file.
TagLibraryValidator | Translation-time validator class for a JSP page.
TagSupport | A base class for defining new tag handlers implementing Tag.
TagVariableInfo | Variable information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.
ValidationMessage | A validation message from either TagLibraryValidator or TagExtraInfo.
VariableInfo | Information on the scripting variables that are created/modified by a tag (at run-time).

Package javax.servlet.jsp.tagext Description

Classes and interfaces for the definition of JavaServer Pages Tag Libraries.

Custom actions can be used by JSP authors and authoring tools to simplify writing JSP pages. A custom action can be either an empty or a non-empty action.

An empty tag has no body. There are two equivalent syntaxes, one with separate start and end tags, and one where the start and end tags are combined. The two following examples are identical:

<x:foo att="myObject"></foo>
<x:foo att="myObject"/>

A non-empty tag has a start tag, a body, and an end tag. A prototypical example is of the form:

<x:foo att="myObject" >
  BODY
</x:foo/>

The JavaServer Pages(tm) (JSP) specification provides a portable mechanism for the description of tag libraries.

A JSP tag library contains

  • A Tag Library Descriptor
  • A number of Tag Files or Tag handler classes defining request-time behavior
  • Additional classes and resources used at runtime
  • Possibly some additional classes to provide extra translation information

This API is described in the following sections:

  1. Classic Tag Handlers
  2. Tag Handlers that want to access their Body Content
  3. Dynamic Attributes
  4. Annotated Tag Handler Management Example
  5. Cooperating Actions
  6. Simple Tag Handlers
  7. JSP Fragments
  8. Example Simple Tag Handler Scenario
  9. Translation-time Classes

1. Classic Tag Handlers

 This section introduces the notion of a tag handler and describes the classic types of tag handler.

JSP 2.0 introduces a new type of Tag Handler called a Simple Tag Handler, which is described in a later section. The protocol for Simple Tag handlers is much more straightforward.

Tag Handler

A tag handler is a run-time, container-managed object that evaluates custom actions during the execution of a JSP page. A tag handler supports a protocol that allows the JSP container to provide good integration of the server-side actions within a JSP page.

A tag handler is created initially using a zero argument constructor on its corresponding class; the method java.beans.Beans.instantiate() is not used.

A tag handler has some properties that are exposed to the page as attributes on an action; these properties are managed by the JSP container (via generated code). The setter methods used to set the properties are discovered using the JavaBeans introspector machinery.

The protocol supported by a tag handler provides for passing of parameters, the evaluation and reevaluation of the body of the action, and for getting access to objects and other tag handlers in the JSP page.

A tag handler instance is responsible for processing one request at a time. It is the responsability of the JSP container to enforce this.

Additional translation time information associated with the action indicates the name of any scripting variables it may introduce, their types and their scope. At specific moments, the JSP container will automatically synchronize the PageContext information with variables in the scripting language so they can be made available directly through the scripting elements.

Properties

A tag handler has some properties. All tag handlers have a pageContext property for the JSP page where the tag is located, and a parent property for the tag handler to the closest enclosing action. Specific tag handler classes may have additional properties.

All attributes of a custom action must be JavaBeans component properties, although some properties may not be exposed as attributes. The attributes that are visible to the JSP translator are exactly those listed in the Tag Library Descriptor (TLD).

All properties of a tag handler instance exposed as attributes will be initialized by the container using the appropriate setter methods before the instance can be used to perform the action methods. It is the responsibility of the JSP container to invoke the appropriate setter methods to initialize these properties. It is the responsability of user code, be it scriptlets, JavaBeans code, or code inside custom tags, to not invoke these setter methods, as doing otherwise would interfere with the container knowledge.

The setter methods that should be used when assigning a value to an attribute of a custom action are determined by using the JavaBeans introspector on the tag handler class, then use the setter method associated with the property that has the same name as the attribute in question. An implication (unclear in the JavaBeans specification) is that there is only one setter per property.

Unspecified attributes/properties should not be set (using a setter method).

Once properly set, all properties are expected to be persistent, so that if the JSP container ascertains that a property has already been set on a given tag handler instance, it must not set it again.

The JSP container may reuse classic tag handler instances for multiple occurrences of the corresponding custom action, in the same page or in different pages, but only if the same set of attributes are used for all occurrences. If a tag handler is used for more than one occurence, the container must reset all attributes where the values differ between the custom action occurrences. Attributes with the same value in all occurrences must not be reset. If an attribute value is set as a request-time attribute value (using a scripting or an EL expression), the container must reset the attribute between all reuses of the tag handler instance.

User code can access property information and access and modify tag handler internal state starting with the first action method (doStartTag) up until the last action method (doEndTag or doFinally for tag handlers implementing TryCatchFinally).

Tag Handler as a Container-Managed Object

Since a tag handler is a container managed object, the container needs to maintain its references; specifically, user code should not keep references to a tag handler except between the start of the first action method (doStartTag()) and the end of the last action method (doEndTag() or doFinally() for those tags that implement TryCatchFinally).

The restrictions on references to tag handler objects and on modifying attribute properties gives the JSP container substantial freedom in effectively managing tag handler objects to achieve different goals. For example, a container may implementing different pooling strategies to minimize creation cost, or may hoist setting of properties to reduce cost when a tag handler is inside another iterative tag.

Conversions

A tag handler implements an action; the JSP container must follow the type conversions described in Section 2.13.2 when assigning values to the attributes of an action.

Empty and Non-Empty Actions

An empty action has no body; it may use one of two syntaxes: either <foo/> or <foo></foo>. Since empty actions have no body the methods related to body manipulation are not invoked. There is a mechanism in the Tag Library Descriptor to indicate that a tag can only be used to write empty actions; when used, non-empty actions using that tag will produce a translation error.

A non-empty action has a body.

The Tag Interface

A Tag handler that does not want to process its body can implement just the Tag interface. A tag handler may not want to process its body because it is an empty tag or because the body is just to be "passed through".

The Tag interface includes methods to provide page context information to the Tag Handler instance, methods to handle the life-cycle of tag handlers, and two main methods for performing actions on a tag: doStartTag() and doEndTag(). The method doStartTag() is invoked when encountering the start tag and its return value indicates whether the body (if there is any) should be skipped, or evaluated and passed through to the current response stream. The method doEndTag() is invoked when encountering the end tag; its return value indicates whether the rest of the page should continue to be evaluated or not.

If an exception is encountered during the evaluation of the body of a tag, its doEndTag method will not be evaluated. See the TryCatchFinally tag for methods that are guaranteed to be evaluated.

The IterationTag Interface

The IterationTag interface is used to repeatedly reevaluate the body of a custom action. The interface has one method: doAfterBody() which is invoked after each evaluation of the body to determine whether to reevaluate or not.

Reevaluation is requested with the value 2, which in JSP 1.1 is defined to be BodyTag.EVAL_BODY_TAG. That constant value is still kept in JSP 1.2 (for full backwards compatibility) but, to improve clarity, a new name is also available: IterationTag.EVAL_BODY_AGAIN. To stop iterating, the returned value should be 0, which is Tag.SKIP_BODY.

The JspIdConsumer Interface

This interface indicates to the container that a tag handler wishes to be provided with a compiler generated ID that is unique within the page.

The TagSupport Base Class

The TagSupport class is a base class that can be used when implementing the Tag or IterationTag interfaces.

2. Tag Handlers that want Access to their Body Content

The evaluation of a body is delivered into a BodyContent object. This is then made available to tag handlers that implement the BodyTag interface. The BodyTagSupport class provides a useful base class to simplify writing these handlers.

If a Tag handler wants to have access to the content of its body then it must implement the BodyTag interface. This interface extends IterationTag, provides two additional methods setBodyContent(BodyContent) and doInitBody() and refers to an object of type BodyContent.

A BodyContent is a subclass of JspWriter that has a few additional methods to convert its contents into a String, insert the contents into another JspWriter, to get a Reader into its contents, and to clear the contents. Its semantics also assure that buffer size will never be exceeded.

The JSP page implementation will create a BodyContent if the doStartTag() method returns a EVAL_BODY_BUFFERED. This object will be passed to doInitBody(); then the body of the tag will be evaluated, and during that evaluation out will be bound to the BodyContent just passed to the BodyTag handler. Then doAfterBody() will be evaluated. If that method returns SKIP_BODY, no more evaluations of the body will be done; if the method returns EVAL_BODY_AGAIN, then the body will be evaluated, and doAfterBody() will be invoked again.

The content of a BodyContent instance remains available until after the invocation of its associated doEndTag() method.

A common use of the BodyContent is to extract its contents into a String and then use the String as a value for some operation. Another common use is to take its contents and push it into the out Stream that was valid when the start tag was encountered (that is available from the PageContext object passed to the handler in setPageContext).

3. Dynamic Attributes

Any tag handler can optionally extend the DynamicAttributes interface to indicate that it supports dynamic attributes. In addition to implementing the DynamicAttributes interface, tag handlers that support dynamic attributes must declare that they do so in the Tag Library Descriptor.

The TLD is what ultimately determines whether a tag handler accepts dynamic attributes or not. If a tag handler declares that it supports dynamic attributes in the TLD but it does not implement the DynamicAttributes interface, the tag handler must be considered invalid by the container.

If the dynamic-attributes element for a tag being invoked contains the value "true", the following requirements apply:

  • For each attribute specified in the tag invocation that does not have a corresponding attribute element in the TLD for this tag, a call must be made to setDynamicAttribute(), passing in the namespace of the attribute (or null if the attribute does not have a namespace or prefix), the name of the attribute without the namespace prefix, and the final value of the attribute.
  • Dynamic attributes must be considered to accept request-time expression values as well as deferred expressions.
  • Dynamic attributes must be treated as though they were of type java.lang.Object. If a ValueExpression is passed as a dynamic attribute, the default value for the expected return type is assumed to be java.lang.Object. If a MethodExpression is passed as a dynamic attribute, the default method signature is assumed to be void method().
  • Note that passing a String literal as a dynamic attribute will never be considered as a deferred expression.
  • The JSP container must recognize dynamic attributes that are passed to the tag handler using the <jsp:attribute> standard action.
  • If the setDynamicAttribute() method throws JspException, the doStartTag() or doTag() method is not invoked for this tag, and the exception must be treated in the same manner as if it came from a regular attribute setter method.
  • For a JSP document in either standard or XML syntax, If a dynamic attribute has a prefix that doesn't map to a namespace, a translation error must occur. In standard syntax, only namespaces defined using taglib directives are recognized.

In the following example, assume attributes a and b are declared using the attribute element in the TLD, attributes d1 and d2 are not declared, and the dynamic-attributes element is set to "true". The attributes are set using the calls:

  • setA( "1" ),
  • setDynamicAttribute( null, "d1", "2" ),
  • setDynamicAttribute( "http://www.foo.com/jsp/taglib/mytag.tld", "d2", "3" ),
  • setB( "4" ),
  • setDynamicAttribute( null, "d3", "5" ), and
  • setDynamicAttribute( "http://www.foo.com/jsp/taglib/mytag.tld", "d4", "6" ).
<jsp:root xmlns:mytag="http://www.foo.com/jsp/taglib/mytag.tld" version="2.0">
  <mytag:invokeDynamic a="1" d1="2" mytag:d2="3">
    <jsp:attribute name="b">4</jsp:attribute>
    <jsp:attribute name="d3">5</jsp:attribute>
    <jsp:attribute name="mytag:d4">6</jsp:attribute>
  </mytag:invokeDynamic>
</jsp:root>

4. Annotated Tag Handler Management Example

 Below is a somewhat complete example of the way one JSP container could choose to do some tag handler management. There are many other strategies that could be followed, with different pay offs.

In this example, we are assuming that x:iterate is an iterative tag, while x:doit and x:foobar are simple tag. We will also assume that x:iterate and x:foobar implement the TryCatchFinally interface, while x:doit does not.

<x:iterate src="foo">
  <x:doit att1="one" att2="<%= 1 + 1 %>" />
  <x:foobar />
  <x:doit att1="one" att2="<%= 2 + 2 %>" />
</x:iterate>
<x:doit att1="one" att2="<%= 3 + 3 %>" />

The particular code shown below assumes there is some pool of tag handlers that are managed (details not described, although pool managing is simpler when there are no optional attributes), and attemps to reuse tag handlers if possible. The code also "hoists" setting of properties to reduce the cost when appropriate, e.g. inside an iteration.

boolean b1, b2;
IterationTag i; // for x:iterate
Tag d; // for x:doit
Tag d; // for x:foobar

page: // label to end of page...

// initialize iteration tag
i = get tag from pool or new();

i.setPageContext(pc);
i.setParent(null);
i.setSrc("foo");

// x:iterate implements TryCatchFinally
try {
    if ((b1 = i.doStartTag()) == EVAL_BODY_INCLUDE) {

        // initialize doit tag
        // code has been moved out of the loop for show
        d = get tag from pool or new();

        d.setPageContext(pc);
        d.setParent(i);
        d.setAtt1("one");

    loop:
        while (1) do {
            // I'm ignoring newlines...

            // two invocations, fused together

            // first invocation of x:doit
            d.setAtt2(1+1);
            if ((b2 = d.doStartTag()) == EVAL_BODY_INCLUDE) {
                // nothing
            } else if (b2 != SKIP_BODY) {
                // Q? protocol error ...
            }
            if ((b2 = d.doEndTag()) == SKIP_PAGE) {
                break page;  // be done with it.
            } else if (b2 != EVAL_PAGE) {
                // Q? protocol error
            }

            // x:foobar invocation
            f = get tag from pool or new();
            f.setPageContext(pc);
            f.setParent(i);

            // x:foobar implements TryCatchFinally
            try {

                if ((b2 = f.doStartTag()) == EVAL_BODY_INCLUDE) {
                    // nothing
                } else if (b2 != SKIP_BODY) {
                    // Q? protocol error
                }
                if ((b2 = f.doEndTag()) == SKIP_PAGE) {
                    break page;  // be done with it.
                } else if (b2 != EVAL_PAGE) {
                    // Q? protocol error
                }
            } catch (Throwable t) {
                f.doCatch(t); // caught, may been rethrown!
            } finally {
                f.doFinally();
            }

            // put f back to pool

            // second invocation of x:doit
            d.setAtt2(2+2);
            if ((b2 = d.doStartTag()) == EVAL_BODY_INCLUDE) {
                // nothing
            } else if (b2 != SKIP_BODY) {
                // Q? protocol error
            }
            if ((b2 = d.doEndTag()) == SKIP_PAGE) {
                break page;  // be done with it.
            } else if (b2 != EVAL_PAGE) {
                // Q? protocol error
            }

            if ((b2 = i.doAfterBody()) == EVAL_BODY_AGAIN) {
                break loop;
            } else if (b2 != SKIP_BODY) {
                // Q? protocol error
            }
        // loop
        }

    } else if (b1 != SKIP_BODY) {
        // Q? protocol error
    }

    // tail end of the IteratorTag ...

    if ((b1 = i.doEndTag()) == SKIP_PAGE) {
        break page;   // be done with it.
    } else if (b1 != EVAL_PAGE) {
        // Q? protocol error
    }

    // third invocation
    // this tag handler could be reused from the previous ones.
    d = get tag from pool or new();

    d.setPageContext(pc);
    d.setParent(null);
    d.setAtt1("one");
    d.setAtt2(3+3);

    if ((b1 = d.doStartTag()) == EVAL_BODY_INCLUDE) {
        // nothing
    } else if (b1 != SKIP_BODY) {
        // Q? protocol error
    }
    if ((b1 = d.doEndTag()) == SKIP_PAGE) {
        break page;  // be done with it.
    } else if (b1 != EVAL_PAGE) {
        // Q? protocol error
    }

} catch (Throwable t) {
    i.doCatch(t); // caught, may been rethrown!
} finally {
    i.doFinally();
}

5. Cooperating Actions

 Actions can cooperate with other actions and with scripting code in a number of ways.

PageContext

Often two actions in a JSP page will want to cooperate, perhaps by one action creating some server-side object that needs to be accessed by another. One mechanism for doing this is by giving the object a name within the JSP page; the first action will create the object and associate the name to it while the second action will use the name to retrieve the object.

For example, in the following JSP segment the foo action might create a server-side object and give it the name "myObject". Then the bar action might access that server-side object and take some action.

<x:foo id="myObject" />
<x:bar ref="myObjet" />

In a JSP implementation, the mapping "name"->value is kept by the implicit object pageContext. This object is passed around through the Tag handler instances so it can be used to communicate information: all it is needed is to know the name under which the information is stored into the pageContext.

The Runtime Stack

An alternative to explicit communication of information through a named object is implicit coordination based on syntactic scoping.

For example, in the following JSP segment the foo action might create a server-side object; later the nested bar action might access that server-side object. The object is not named within the pageContext: it is found because the specific foo element is the closest enclosing instance of a known element type.

<foo>
   <bar/>
</foo>

This functionality is supported through the TagSupport.findAncestorWithClass(Tag, Class), which uses a reference to parent tag kept by each Tag instance, which effectively provides a run-time execution stack.

6. Simple Tag Handlers

This section presents the API to implement Simple Tag Handlers. Simple Tag Handlers present a much simpler invocation protocol than do Classic Tag Handlers.

The Tag Library Descriptor maps tag library declarations to their physical underlying implementations. A Simple Tag Handler is represented in Java by a class which implements the SimpleTag interface.

Unlike classic tag handlers, the SimpleTag interface does not extend Tag. Instead of supporting doStartTag() and doEndTag(), the SimpleTag interface provides a simple doTag() method, which is called once and only once for any given tag invocation. All tag logic, iteration, body evaluations, etc. are to be performed in this single method. Thus, simple tag handlers have the equivalent power of BodyTag, but with a much simpler lifecycle and interface.

To support body content, the setJspBody() method is provided. The container invokes the setJspBody() method with a JspFragment object encapsulating the body of the tag. The tag handler implementation can call invoke() on that fragment to evaluate the body. The SimpleTagSupport convenience class provides getJspBody() and other useful methods to make this even easier.

Lifecycle of Simple Tag Handlers

This section describes the lifecycle of simple tag handlers, from creation to invocation. For all semantics left unspecified by this section, the semantics default to that of a classic tag handler.

When a simple tag handler is invoked, the following steps occur (in order):

  1. Simple tag handlers are created initially using a zero argument constructor on the corresponding implementation class. Unlike classic tag handlers, this instance must never be pooled by the container. A new instance must be created for each tag invocation.
  2. The setJspContext() and setParent() methods are invoked on the tag handler. The setParent() method need not be called if the value being passed in is null. In the case of tag files, a JspContext wrapper is created so that the tag file can appear to have its own page scope. Calling getJspContext() must return the wrapped JspContext.
  3. The attributes specified as XML element attributes (if any) are evaluated next, in the order in which they are declared, according to the following rules (referred to as "evaluating an XML element attribute" below). The appropriate bean property setter is invoked for each. If no setter is defined for the specified attribute but the tag accepts dynamic attributes, the setDynamicAttribute() method is invoked as the setter.
    • If the attribute is a scripting expression (e.g. "<%= 1+1 %>" in JSP syntax, or "%= 1+1 %" in XML syntax), the expression is evaluated, and the result is converted as per the rules in "Type Conversions", and passed to the setter.
    • Otherwise, if the attribute contains any Expression Language expressions (e.g. "Hello ${name}"), the expression is evaluated, and the result is converted and passed to the setter.
    • Otherwise, the attribute value is taken verbatim, converted, and passed to the setter.
  4. The value for each <jsp:attribute> element is evaluated, and the corresponding bean property setter methods are invoked for each, in the order in which they appear in the body of the tag. If no setter is defined for the specified attribute but the tag accepts dynamic attributes, the setDynamicAttribute() method is invoked as the setter.
    • Otherwise, if the attribute is not of type JspFragment, the container evaluates the body of the <jsp:attribute> element. This evaluation can be done in a container-specific manner. Container implementors should note that in the process of evaluating this body, other custom actions may be invoked.
    • Otherwise, if the attribute is of type JspFragment, an instance of a JspFragment object is created and passed in.
  5. The value for the body of the tag is determined, and if a body exists the setJspBody() method is called on the tag handler.
    • If the tag is declared to have a body-content of "empty" or no body or an empty body is passed for this invocation, then setJspBody() is not called.
    • Otherwise, the body of the tag is either the body of the <jsp:body> element, or the body of the custom action invocation if no <jsp:body> or <jsp:attribute> elements are present. In this case, an instance of a JspFragment object is created as per the lifecycle described in the JSP Fragments section and it is passed to the setter. If the tag is declared to have a body-content of "tagdependent" the JspFragment must echo the body's contents verbatim. Otherwise, if the tag is declared to have a body-content of type "scriptless", the JspFragment must evaluate the body's contents as a JSP scriptless body.
  6. The doTag() method is invoked.
  7. The implementation of doTag() performs its function, potentially calling other tag handlers (if the tag handler is implemented as a tag file) and invoking fragments.
  8. The doTag() method returns, and the tag handler instance is discarded. If SkipPageException is thrown, the rest of the page is not evaluated and the request is completed. If this request was forwarded or included from another page (or Servlet), only the current page evaluation stops.
  9. For each tag scripting variable declared with scopes AT_BEGIN or AT_END, the appropriate scripting variables and scoped attributes are declared, as with classic tag handlers.

7. JSP Fragments

JSP Fragments are represented in Java by an instance of the javax.servlet.jsp.tagext.JspFragment abstract class. Pieces of JSP code are translated into JSP fragments in the context of a tag invocation. JSP Fragments are created when providing the body of a <jsp:attribute> standard action for an attribute that is defined as a fragment or of type JspFragment, or when providing the body of a tag invocation handled by a Simple Tag Handler.

Before being passed to a tag handler, the JspFragment instance is associated with the JspContext of the surrounding page in an implementation-dependent manner. In addition, it is associated with the parent Tag or SimpleTag instance for collaboration purposes, so that when a custom action is invoked from within the fragment, setParent() can be called with the appropriate value. The fragment implementation must keep these associations for the duration of the tag invocation in which it is used.

The invoke() method executes the body and directs all output to either the passed in java.io.Writer or the JspWriter returned by the getOut() method of the JspContext associated with the fragment.

The implementation of each method can optionally throw a JspException, which must be handled by the invoker. Note that tag library developers and page authors should not generate JspFragment implementations manually.

The following sections specify the creation and invocation lifecycles of a JSP Fragment in detail, from the JSP Container's perspective.

Creation of a JSP Fragment

When a JSP fragment is created, the following steps occur (in order):

  1. An instance of a class implementing the JspFragment abstract class is obtained (may either be created or can optionally be cached) each time the tag is invoked. This instance must be configured to produce the contents of the body of the fragment when invoked. If the fragment is defining the body of a <jsp:attribute>, the fragment must evaluate the body each time it is invoked. Otherwise, if the fragment is defining the body of a simple tag, the behavior of the fragment when invoked varies depending on the body-content declared for the tag:
    • If the body-content is "tagdependent", then the fragment must echo the contents of the body verbatim when invoked.
    • If the body-content is "scriptless", then the fragment must evaluate the body each time it is invoked.
  2. The JspFragment instance is passed a reference to the current JspContext. Whenever the fragment invokes a tag handler, it must use this value when calling setJspContext().
  3. The JspFragment instance is associated with an instance of the tag handler of the nearest enclosing tag invocation, or with null if there is no enclosing tag. Whenever the fragment invokes a tag handler, the fragment must use this value when calling setParent().

Invocation of a JSP Fragment

After a JSP fragment is created, it is passed to a tag handler for later invocation. JSP fragments can be invoked either programmatically from a tag handler written in Java, or from a tag file using the <jsp:invoke> or <jsp:doBody> standard action.

JSP fragments are passed to tag handlers using a bean property of type JspFragment. These fragments can be invoked by calling the invoke() method in the JspFragment abstract class. Note that it is legal (and possible) for a fragment to recursively invoke itself, indirectly.

The following steps are followed when invoking a JSP fragment:

  1. The tag handler invoking the fragment is responsible for setting the values of all declared AT_BEGIN and NESTED variables in the JspContext of the calling page/tag, before invoking the fragment. Note that this is not always the same as the JspContext of the fragment being invoked, as fragments can be passed from one tag to another. In the case of tag files, for each variable declared in scope AT_BEGIN or NESTED, if a page scoped attribute exists with the provided name in the tag file, the JSP container must generate code to create/update the page scoped attribute of the provided name in the calling page/tag. If a page scoped attribute with the provided name does not exist in the calling page, and a page scoped attribute of the provided name is present in the tag file, the scoped attribute is removed from the tag file's page scope. See the chapter on Tag Files for details.
  2. If <jsp:invoke> or <jsp:doBody> is being used to invoke a fragment, if the var attribute is specified, a custom java.io.Writer is created that can expose the result of the invocation as a java.lang.String object. If the varReader attribute is specified, a custom java.io.Writer object is created that can expose the resulting invocation as a java.io.Reader object.
  3. The invoke() method of the fragment is invoked, passing in an optional Writer.
  4. Before executing the body of the fragment, if a non-null value is provided for the writer parameter, then the value of JspContext.getOut() and the implicit "out" object must be updated to send output to that writer. To accomplish this, the container must call pushBody( writer ) on the current JspContext, where writer is the instance of java.io.Writer passed to the fragment upon invocation.
  5. The body of the fragment is then evaluated by executing the generated code. The body of the fragment may execute other standard or custom actions. If a classic Custom Tag Handler is invoked and returns SKIP_PAGE, or if a Simple Tag Handler is invoked and throws SkipPageException, the JspFragment must throw SkipPageException to signal that the calling page is to be skipped.
  6. Once the fragment has completed its evaluation, even if an exception is thrown, the value of JspContext.getOut() must be restored via a call to popBody() on the current JspContext.
  7. The fragment returns from invoke()
  8. If <jsp:invoke> or <jsp:doBody> is being used to invoke a fragment, if the var or varReader attribute is specified, a scoped variable with a name equal to the value of the var or varReader attribute is created (or modified) in the page scope, and the value is set to a java.lang.String or java.io.Reader respectively that can produce the results of the fragment invocation.
  9. The invoke() method can be called again, zero or more times. When the tag invocation defining the fragment is complete, the tag must discard the fragment instance since it might be reused by the container.

8. Example Simple Tag Handler Scenario

The following non-normative example is intended to help solidify some of the concepts relating to Tag Files, JSP Fragments and Simple Tag Handlers. In the first section, two sample input files are presented, a JSP (my.jsp), and a simple tag handler implemented using a tag file (simpletag.tag). One possible output of the translation process is presented in the second section.

Although short, the example shows all concepts, including the variable directive. In practice most uses of tags will be much simpler, but probably longer.

The sample generated code is annotated with comments that point to lifecycle steps presented in various sections. The notation is as follows:

  • "Step T.x" = Annotated step x from "Lifecycle of Simple Tag Handlers" earlier in this Chapter.
  • "Step C.x" = Annotated step x from "Creation of a JSP Fragment" earlier in this Chapter.
  • "Step F.x" = Annotated step x from "Invocation of a JSP Fragment" earlier in this Chapter.

Sample Source Files

This section presents the sample source files in this scenario, from which the output files are generated.

Original JSP (my.jsp)

<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>

<my:simpleTag x="10">
    <jsp:attribute name="y">20</jsp:attribute>
    <jsp:attribute name="nonfragment">
        Nonfragment Template Text
    </jsp:attribute>
    <jsp:attribute name="frag">
        Fragment Template Text ${var1}
    </jsp:attribute>
    <jsp:body>
        Body of tag that defines an AT_BEGIN
        scripting variable ${var1}.
    </jsp:body>
</my:simpleTag>

Original Tag File (/WEB-INF/tags/simpletag.tag)

<%-- /WEB-INF/tags/simpletag.tag --%>
<%@ attribute name="x" %>
<%@ attribute name="y" %>
<%@ attribute name="nonfragment" %>
<%@ attribute name="frag" fragment="true" %>
<%@ variable name-given="var1" scope="AT_BEGIN" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Some template text.
<c:set var="var1" value="${x+y}"/>
<jsp:invoke fragment="frag" varReader="var1"/>

Invoke the body:
<jsp:doBody/>

Sample Generated Files

This section presents sample output files that might be generated by a JSP compiler, from the source files presented in the previous section.

Helper class for JspFragment (JspFragmentBase.java)

public abstract class JspFragmentBase
    implements javax.servlet.jsp.tagext.JspFragment
{
    protected javax.servlet.jsp.JspContext jspContext;
    protected javax.servlet.jsp.tagext.JspTag parentTag;
    public void JspFragmentBase(
        javax.servlet.jsp.JspContext jspContext,
        javax.servlet.jsp.tagext.JspTag parentTag )
    {
        this.jspContext = jspContext;
        this.parentTag = parentTag;
    }
}

Relevant Portion of JSP Service Method

// Step T.1 - Initial creation
MySimpleTag _jsp_mySimpleTag = new MySimpleTag();
// Step T.2 - Set page context and parent (since parent is null,
// no need to call setParent() in this case)
_jsp_mySimpleTag.setJspContext( jspContext );
// Step T.3 - XML element attributes evaluated and set
_jsp.mySimpleTag.setX( "10" );
// Step T.4 - <jsp:attribute> elements evaluated and set
//   - parameter y
// (using PageContext.pushBody() is one possible implementation -
// one limitation is that this code will only work for Servlet-based code).
out = ((PageContext)jspContext).pushBody();
out.write( "20" );
_jsp_mySimpleTag.setY(
    ((javax.servlet.jsp.tagext.BodyContent)out).getString() );
out = jspContext.popBody();
//   - parameter nonfragment
// (using PageContext.pushBody() is one possible implementation -
// one limitation is that this code will only work for Servlet-based code).
// Note that trim is enabled by default, else we would have "\n    Non..."
out = ((PageContext)jspContext).pushBody();
out.write( "Nonfragment Template Text" );
_jsp_mySimpleTag.setNonfragment(
    ((javax.servlet.jsp.tagext.BodyContent)out).getString() );
out = jspContext.popBody();
//   - parameter frag
_jsp_mySimpleTag.setFrag(
    // Step C.1 - New instance of fragment created
    // Step C.2 - Store jspContext
    // Step C.3 - Association with nearest enclosing Tag instance
    new JspFragmentBase( jspContext, _jsp_mySimpleTag ) {
        public void invoke( java.io.Writer writer ) {
            javax.servlet.jsp.JspWriter out;
            // Step F.1-F.3 done in tag file (see following example)
            // Step F.4 - If writer provided, push body:
            if( out == null ) {
                out = this.jspContext.getOut();
            }
            else {
                out = this.jspContext.pushBody( writer );
            }
            // Step F.5 - Evaluate body of fragment:
            try {
                out.write( "Fragment Template Text " );
                out.write( jspContext.getExpressionEvaluator().evaluate(
                    "${var1}",
                    java.lang.String.class,
                    vResolver, fMapper, "my" ) );
            }
            finally {
                // Step F.6 - Restore value of JspContext.getOut()
                if( writer != null ) {
                    this.jspContext.popBody();
                }
            }

            // Step F.7-F.9 done in tag file (see following example)
        }
    } );
// Step T.5 - Determine and set body of the tag
// - body of tag
_jsp_mySimpleTag.setJspBody(
    // Step C.1 - New instance of fragment created
    // Step C.2 - Store jspContext
    // Step C.3 - Association with nearest enclosing Tag instance
    new JspFragmentBase( jspContext, _jsp_mySimpleTag ) {
        public void invoke( java.io.Writer writer ) {
            javax.servlet.jsp.JspWriter out;
            // Step F.1-F.3 done in tag file (see following example)
            // Step F.4 - If writer provided, push body:
            if( writer == null ) {
                out = this.jspContext.getOut();
            }
            else {
                out = this.jspContext.pushBody( writer );
            }
            // Step F.5 - Evaluate body of fragment:
            try {
                out.write(
                    "Body of tag that defines an AT_BEGIN\n" +
                    " scripting variable " );
                out.write( jspContext.getExpressionEvaluator().evaluate(
                    "${var1}",
                    java.lang.String.class,
                    vResolver, fMapper, "my" ) );
                out.write( ".\n" );
            }
            finally {
                // Step F.6 - Restore value of JspContext.getOut()
                if( writer != null ) {
                    this.jspContext.popBody();
                }
            }

            // Step F.7-F.9 done in tag file (see following example)
        }
    } );
// Step T.6 - Inovke doTag
// Step T.7 occurs in the tag file (see following example)
// Step T.8 - doTag returns - page will catch SkipPageException.
_jsp_mySimpleTag.doTag();
// Step T.9 - Declare AT_BEGIN and AT_END scripting variables
String var1 = (String)jspContext.findAttribute( "var1" );

Generated Simple Tag Handler (MySimpleTag.java)

public class MySimpleTag
    extends javax.servlet.jsp.tagext.SimpleTagSupport
{
    // Attributes:
    private String x;
    private String y;
    private String nonfragment;
    private javax.servlet.jsp.tagext.JspFragment frag;
    // Setters and getters for attributes:
    public void setX( Stirng x ) {
        this.x = x;
    }
    public String getX() {
        return this.x;
    }
    public void setY( String y ) {
        this.y = y;
    }
    public String getY() {
        return this.y;
    }
    public void setNonfragment( String nonfragment ) {
        this.nonfragment = nonfragment;
    }
    public String getNonfragment() {
        return this.nonfragment;
    }
    public void setFrag( javax.servlet.jsp.tagext.JspFragment frag ) {
        this.frag = frag;
    }
    public javax.servlet.jsp.tagext.JspFragment getFrag() {
        return this.frag;
    }

    protected JspContext jspContext;
    public void setJspContext( JspContext ctx ) {
        super.setJspContext( ctx );
        // Step T.2 - A JspContext wrapper is created.
        // (Implementation of wrapper not shown).
        this.jspContext = new utils.JspContextWrapper( ctx );
    }
    public JspContext getJspContext() {
        // Step T.2 - Calling getJspContext() must return the
        // wrapped JspContext.
        return this.jspContext;
    }

    public void doTag() throws JspException {
        java.lang.Object jspValue;
        JspContext jspContext = getJspContext();
        JspContext _jsp_parentContext =
            SimpleTagSupport.this.getJspContext();
        try {
            javax.servlet.jsp.JspWriter out = jspContext.getOut();

            // Create page-scope attributes for each tag attribute:
            this.jspContext.setAttribute( "x", getX() );
            this.jspContext.setAttribute( "y", getY() );
            this.jspContext.setAttribute( "nonfragment", getNonfragment() );
            this.jspContext.setAttribute( "frag", getFrag() );

            // Synchronize AT_BEGIN variables from calling page
            if( (jspValue = _jsp_parentContext.getAttribute(
                    "var1" )) != null )
            {
                jspContext.setAttribute( "var1", value );
            }
            else {
                jspContext.removeAttribute( "var1",
                    JspContext.PAGE_SCOPE );
            }

            // Tag template text:
            out.write( "\n\n\n\n\n\n\n\nSome template text.\n" );

            // Invoke c:set - recognized tag handler from JSTL:
            jspContext.setAttribute( "var1",
                jspContext.getExpressionEvaluator().evaluate(
                    "${x+y}",
                    java.lang.String.class,
                    jspContext,
                    prefixMap, functionMap, "my" ) );

            // Invoke the "frag" fragment:
            // Step F.1 - Set values of AT_BEGIN and NESTED variables
            //     in calling page context.
            if( (jspValue = jspContext.getAttribute( "var1" )) != null ) {
                _jsp_parentContext.setAttribute( "var1", value );
            }
            else {
                _jsp_parentContext.removeAttribute( "var1",
                    JspContext.PAGE_SCOPE );
            }

            // Step F.2 - varReader is specified, generate a writer.
            java.io.Writer _jsp_sout = new java.io.StringWriter();

            // Step F.3 - Invoke fragment with writer
            getFrag().invoke( _jsp_sout );

            // Step F.4 - F.6 occur in the fragment (see above)
            // Step F.7 - fragment returns

            // Step F.8 - varReader specified, so save to var
            jspContext.setAttribute(
                "var1", new StringReader( _jsp_sout.toString() ) );

            // Step F.9 - Done!

            out.write( "\n\nInvoke the body:\n" );

            // Invoke the body of the tag:
            // Step F.1 - Set values of AT_BEGIN and NESTED variables
            //     in calling page context.
            if( (jspValue = jspContext.getAttribute( "var1" )) != null ) {
                _jsp_parentContext.setAttribute( "var1", value );
            }
            else {
                _jsp_parentContext.removeAttribute( "var1",
                    JspContext.PAGE_SCOPE);
            }

            // Step F.2 - varReader is not specified - does not apply.

            try {
                // Step F.3 - Invoke body, passing optional writer
                getJspBody().invoke( null );
            }
            finally {
                // Steps F.4 - F.6 occur in the fragment (see above)
                // Step F.7 - fragment returns
            }

            // Step F.8 does not apply.
            // Step F.9 - Done!
        }
        finally {
            // Tag handlers generate code to synchronize AT_BEGIN with
            // calling page, regardless of whether an error occurs.
            if( (jspValue = jspContext.getAttribute( "var1" )) != null ) {
                _jsp_parentContext.setAttribute( "var1", value );
            }
            else {
                _jsp_parentContext.removeAttribute( "var1",
                    JspContext.PAGE_SCOPE );
            }
        }
    }
}

9. Translation-time Classes

 The following classes are used at translation time.

Tag mapping, Tag name

A taglib directive introduces a tag library and associates a prefix to it. The TLD associated with the library associates Tag handler classes (plus other information) with tag names. This information is used to associate a Tag class, a prefix, and a name with each custom action element appearing in a JSP page.

At execution time the implementation of a JSP page will use an available Tag instance with the appropriate property settings and then follow the protocol described by the interfaces Tag, IterationTag, BodyTag, SimpleTag, and TryCatchFinally. The implementation guarantees that all tag handler instances are initialized and all are released, but the implementation can assume that previous settings are preserved by a tag handler, to reduce run-time costs.

Scripting Variables

JSP supports scripting variables that can be declared within a scriptlet and can be used in another. JSP actions also can be used to define scripting variables so they can used in scripting elements, or in other actions. This is very useful in some cases; for example, the jsp:useBean standard action may define an object which can later be used through a scripting variable.

In some cases the information on scripting variables can be described directly into the TLD using elements. A special case is typical interpretation of the "id" attribute. In other cases the logic that decides whether an action instance will define a scripting variable may be quite complex and the name of a TagExtraInfo class is instead given in the TLD. The getVariableInfo method of this class is used at translation time to obtain information on each variable that will be created at request time when this action is executed. The method is passed a TagData instance that contains the translation-time attribute values.

Validation

The TLD file contains several pieces of information that is used to do syntactic validation at translation-time. It also contains two extensible validation mechanisms: a TagLibraryValidator class can be used to validate a complete JSP page, and a TagExtraInfo class can be used to validate a specific action. In some cases, additional request-time validation will be done dynamically within the methods in the Tag instance. If an error is discovered, an instance of JspTagException can be thrown. If uncaught, this object will invoke the errorpage mechanism of JSP.

The TagLibraryValidator is an addition to the JSP 1.2 specification and is very open ended, being strictly more powerful than the TagExtraInfo mechanism. A JSP page is presented via the PageData object, which abstracts the XML view of the JSP page.

A PageData instance will provides an InputStream (read-only) on the page. Later specifications may add other views on the page (DOM, SAX, JDOM are all candidates), for now these views can be generated from the InputStream and perhaps can be cached for improved performance (recall the view of the page is just read-only).

As of JSP 2.0, the JSP container must support a jsp:id attribute to provide higher quality validation errors. The container will track the JSP pages as passed to the container, and will assign to each element a unique "id", which is passed as the value of the jsp:id attribute. Each XML element in the XML view will be extended with this attribute. The TagLibraryValidator can use the attribute in one or more ValidationMessage objects. The container then, in turn, can use these values to provide more precise information on the location of an error.

The prefix for the id attribute need not be "jsp" but it must map to the namespace http://java.sun.com/JSP/Page. In the case where the user has redefined the jsp prefix, an alternative prefix must be used by the container.

Validation Details

In detail, validation is done as follows:

First, the JSP page is parsed using the information in the TLD. At this stage valid mandatory and optional attributes are checked.

Second, for each unique tag library in the page as determined by the tag library URI, and in the lexical order in which they appear, their associated validator class (if any) is invoked. This involves several substeps.

The first substep is to obtain an initialized validator instance by either:

  • construct a new instance and invoke setInitParameters() on it, or
  • obtain an existing instance that is not being used, invoke release() on it, and then invoke setInitParameters() on it, or
  • locate an existing instance that is not being used on which the desired setInitParameters() has already been invoked

The class name is as indicated in the <validator-class> element, and the Map passed through setInitParameters() is as described in the <init-params> element. All TagLibraryValidator classes are supposed to keep their initParameters until new ones are set, or until release() is invoked on them.

The second substep is to perform the actual validation. This is done by invoking the validate() method with a prefix, uri, and PageData that correspond to the taglib directive instance being validated and the PageData representing the page. In the case where a single URI is mapped to more than one prefix, the prefix of the first URI must be used.

The last substep is to invoke the release() method on the validator tag when it is no longer needed. This method releases all resources.

Finally, after checking all the tag library validator classes, the TagExtraInfo classes for all tags will be consulted by invoking their validate method. The order of invocation of this methods is undefined.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.servlet.jsp.tagext Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.servlet.jsp.tagext

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.servlet.jsp.tagext.FunctionInfo
    • javax.servlet.jsp.tagext.JspFragment
    • javax.servlet.jsp.tagext.PageData
    • javax.servlet.jsp.tagext.SimpleTagSupport (implements javax.servlet.jsp.tagext.SimpleTag)
    • javax.servlet.jsp.tagext.TagAdapter (implements javax.servlet.jsp.tagext.Tag)
    • javax.servlet.jsp.tagext.TagAttributeInfo
    • javax.servlet.jsp.tagext.TagData (implements java.lang.Cloneable)
    • javax.servlet.jsp.tagext.TagExtraInfo
    • javax.servlet.jsp.tagext.TagFileInfo
    • javax.servlet.jsp.tagext.TagInfo
    • javax.servlet.jsp.tagext.TagLibraryInfo
    • javax.servlet.jsp.tagext.TagLibraryValidator
    • javax.servlet.jsp.tagext.TagSupport (implements javax.servlet.jsp.tagext.IterationTag, java.io.Serializable)
      • javax.servlet.jsp.tagext.BodyTagSupport (implements javax.servlet.jsp.tagext.BodyTag)
    • javax.servlet.jsp.tagext.TagVariableInfo
    • javax.servlet.jsp.tagext.ValidationMessage
    • javax.servlet.jsp.tagext.VariableInfo
    • java.io.Writer (implements java.lang.Appendable, java.io.Closeable, java.io.Flushable)
      • javax.servlet.jsp.JspWriter
        • javax.servlet.jsp.tagext.BodyContent

Interface Hierarchy

  • javax.servlet.jsp.tagext.DynamicAttributes
  • javax.servlet.jsp.tagext.JspIdConsumer
  • javax.servlet.jsp.tagext.JspTag
    • javax.servlet.jsp.tagext.SimpleTag
    • javax.servlet.jsp.tagext.Tag
      • javax.servlet.jsp.tagext.IterationTag
        • javax.servlet.jsp.tagext.BodyTag
  • javax.servlet.jsp.tagext.TryCatchFinally
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


BodyTag (Java EE 5)

javax.servlet.jsp.tagext
Interface BodyTag

All Superinterfaces:
IterationTag, JspTag, Tag
All Known Implementing Classes:
BodyTagSupport, UIComponentBodyTag, UIComponentClassicTagBase, UIComponentELTag, UIComponentTag
public interface BodyTag
extends IterationTag

Implements: IterationTag
Implemented by: BodyTagSupport, UIComponentClassicTagBase

BodyTag 接口通过定义额外的方法扩展 IterationTag，这些方法允许标记处理程序操作对其正文求值的内容。

由标记处理程序负责操作正文内容。例如，标记处理程序可以取得正文内容，使用 bodyContent.getString 方法将它转换为 String，然后使用它。或者，标记处理程序可以取得正文内容，并使用 bodyContent.writeOut 方法将它写出到其封闭 JspWriter 中。

实现 BodyTag 的标记处理程序可被视为实现了 IterationTag 的标记处理程序，只是 doStartTag 方法可以返回 SKIP_BODY、EVAL_BODY_INCLUDE 或 EVAL_BODY_BUFFERED。

如果返回 EVAL_BODY_INCLUDE，那么将像在 IterationTag 中那样进行求值。

如果返回 EVAL_BODY_BUFFERED，那么将创建 BodyContent 对象（通过 JSP 编译器生成的代码）来捕获正文求值。JSP 编译器生成的代码包含通过调用当前 pageContext 的 pushBody 方法获得的 BodyContent 对象，这会带来保存以前 out 值的额外效果。页面编译器通过调用 PageContext 类的 popBody 方法返回此对象；该调用还恢复 out 的值。

该接口提供了一个带有一个 setter 方法和一个新 action 方法的新属性。

属性

有一个新属性：bodyContent，用于包含 BodyContent 对象，JSP 页面实现对象将正文求值（和重求值，如果适当的话）放入该对象。setter 方法 (setBodyContent) 只在 doStartTag() 返回 EVAL_BODY_BUFFERED 并且相应操作元素不包含空正文时调用。

方法

除了 bodyContent 属性的 setter 方法之外，还有一个新的 action 方法：doInitBody()，该方法就在调用 setBodyContent() 之后、正文求值之前调用。此方法只在 doStartTag() 返回 EVAL_BODY_BUFFERED 时调用。

生命周期

以下的转换图描述了生命周期的详细信息。计算 doStartTag()、setBodyContent()、doInitBody()、BODY、doAfterBody() 期间抛出的异常将中断执行序列，并向上传播到堆栈，除非标记处理程序实现了 TryCatchFinally 接口；有关详细信息，请参见该接口。

空操作和非空操作

如果 TagLibraryDescriptor 文件指示操作必须总是有一个空元素正文（通过 "empty" 的 <body-content> 条目），则 doStartTag() 方法必须返回 SKIP_BODY。否则，doStartTag() 方法可能返回 SKIP_BODY、EVAL_BODY_INCLUDE 或 EVAL_BODY_BUFFERED。

注意，在 doStartTag() 之后调用哪些方法取决于返回值和自定义操作元素在 JSP 页面中是否为空，而不取决于它在 TLD 中的声明方式。

如果返回 SKIP_BODY，则不对正文求值，并调用 doEndTag()。

如果返回 EVAL_BODY_INCLUDE，并且自定义操作元素不为空，则不调用 setBodyContent()，不调用 doInitBody()，对正文求值并“传递”到当前 out，调用 doAfterBody()，然后在 0 个或更多迭代之后调用 doEndTag()。如果自定义操作元素为空，则仅调用 doStart() 和 doEndTag()。

如果返回 EVAL_BODY_BUFFERED，并且自定义操作元素不为空，则不调用 setBodyContent()，调用 doInitBody()，对正文求值，调用 doAfterBody()，然后在 0 个或更多迭代之后调用 doEndTag()。如果自定义操作元素为空，则仅调用 doStart() 和 doEndTag()。

英文文档：

The BodyTag interface extends IterationTag by defining additional methods that let a tag handler manipulate the content of evaluating its body.

It is the responsibility of the tag handler to manipulate the body content. For example the tag handler may take the body content, convert it into a String using the bodyContent.getString method and then use it. Or the tag handler may take the body content and write it out into its enclosing JspWriter using the bodyContent.writeOut method.

A tag handler that implements BodyTag is treated as one that implements IterationTag, except that the doStartTag method can return SKIP_BODY, EVAL_BODY_INCLUDE or EVAL_BODY_BUFFERED.

If EVAL_BODY_INCLUDE is returned, then evaluation happens as in IterationTag.

If EVAL_BODY_BUFFERED is returned, then a BodyContent object will be created (by code generated by the JSP compiler) to capture the body evaluation. The code generated by the JSP compiler obtains the BodyContent object by calling the pushBody method of the current pageContext, which additionally has the effect of saving the previous out value. The page compiler returns this object by calling the popBody method of the PageContext class; the call also restores the value of out.

The interface provides one new property with a setter method and one new action method.

Properties

There is a new property: bodyContent, to contain the BodyContent object, where the JSP Page implementation object will place the evaluation (and reevaluation, if appropriate) of the body. The setter method (setBodyContent) will only be invoked if doStartTag() returns EVAL_BODY_BUFFERED and the corresponding action element does not have an empty body.

Methods

In addition to the setter method for the bodyContent property, there is a new action method: doInitBody(), which is invoked right after setBodyContent() and before the body evaluation. This method is only invoked if doStartTag() returns EVAL_BODY_BUFFERED.

Lifecycle

Lifecycle details are described by the transition diagram below. Exceptions that are thrown during the computation of doStartTag(), setBodyContent(), doInitBody(), BODY, doAfterBody() interrupt the execution sequence and are propagated up the stack, unless the tag handler implements the TryCatchFinally interface; see that interface for details.

Lifecycle Details Transition Diagram for BodyTag

Empty and Non-Empty Action

If the TagLibraryDescriptor file indicates that the action must always have an empty element body, by an <body-content> entry of "empty", then the doStartTag() method must return SKIP_BODY. Otherwise, the doStartTag() method may return SKIP_BODY, EVAL_BODY_INCLUDE, or EVAL_BODY_BUFFERED.

Note that which methods are invoked after the doStartTag() depends on both the return value and on if the custom action element is empty or not in the JSP page, not how it's declared in the TLD.

If SKIP_BODY is returned the body is not evaluated, and doEndTag() is invoked.

If EVAL_BODY_INCLUDE is returned, and the custom action element is not empty, setBodyContent() is not invoked, doInitBody() is not invoked, the body is evaluated and "passed through" to the current out, doAfterBody() is invoked and then, after zero or more iterations, doEndTag() is invoked. If the custom action element is empty, only doStart() and doEndTag() are invoked.

If EVAL_BODY_BUFFERED is returned, and the custom action element is not empty, setBodyContent() is invoked, doInitBody() is invoked, the body is evaluated, doAfterBody() is invoked, and then, after zero or more iterations, doEndTag() is invoked. If the custom action element is empty, only doStart() and doEndTag() are invoked.

Field Summary
static int | EVAL_BODY_BUFFERED Request the creation of new buffer, a BodyContent on which to evaluate the body of this tag.
static int | EVAL_BODY_TAG Deprecated. As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED or IterationTag.EVAL_BODY_AGAIN.
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Method Summary
void | doInitBody() Prepare for evaluation of the body.
void | setBodyContent(BodyContent b) Set the bodyContent property.
Methods inherited from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent

Field Detail

英文文档：

EVAL_BODY_TAG

static final int EVAL_BODY_TAG
Deprecated. As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED or IterationTag.EVAL_BODY_AGAIN.
Deprecated constant that has the same value as EVAL_BODY_BUFFERED and EVAL_BODY_AGAIN. This name has been marked as deprecated to encourage the use of the two different terms, which are much more descriptive.

See Also:
Constant Field Values

英文文档：

EVAL_BODY_BUFFERED

static final int EVAL_BODY_BUFFERED
Request the creation of new buffer, a BodyContent on which to evaluate the body of this tag. Returned from doStartTag when it implements BodyTag. This is an illegal return value for doStartTag when the class does not implement BodyTag.

See Also:
Constant Field Values
Method Detail

public void setBodyContent(BodyContent b)
设置 bodyContent 属性。此方法由 JSP 页面实现对象调用，每个操作调用最多调用一次。此方法将在 doInitBody 之前调用。不能对空标记或者 doStartTag() 方法返回 SKIP_BODY 或 EVAL_BODY_INCLUDE 的非空标记调用此方法。

在调用 setBodyContent 时，隐式对象 out 的值在 pageContext 对象中已发生更改。传递的 BodyContent 对象上没有数据，但该对象可能已经被以前的某个调用重用（和清除）。

在调用 doEndTag 方法之后，BodyContent 对象才是可用的，并且具有适当内容，在这种情况下，它可以被重用。

b | BodyContent
See also | doInitBody, doAfterBody
英文文档：

setBodyContent

void setBodyContent(BodyContent b)
Set the bodyContent property. This method is invoked by the JSP page implementation object at most once per action invocation. This method will be invoked before doInitBody. This method will not be invoked for empty tags or for non-empty tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.

When setBodyContent is invoked, the value of the implicit object out has already been changed in the pageContext object. The BodyContent object passed will have not data on it but may have been reused (and cleared) from some previous invocation.

The BodyContent object is available and with the appropriate content until after the invocation of the doEndTag method, at which case it may be reused.

Parameters:
b - the BodyContent
See Also:
doInitBody(), IterationTag.doAfterBody()

public void doInitBody() throws JspException
为正文求值做准备。此方法由 JSP 页面实现对象在 setBodyContent 之后并在第一次对正文求值之前调用。不能对空标记或者 doStartTag() 方法返回 SKIP_BODY 或 EVAL_BODY_INCLUDE 的非空标记调用此方法。

在调用 doInitBody() 之后，JSP 容器将重新同步所有 AT_BEGIN 和 NESTED 变量（由关联的 TagExtraInfo 或 TLD 定义）的值。

Throws | JspException: 如果在处理此标记时发生错误
See also | doAfterBody
英文文档：

doInitBody

void doInitBody()
                throws JspException
Prepare for evaluation of the body. This method is invoked by the JSP page implementation object after setBodyContent and before the first time the body is to be evaluated. This method will not be invoked for empty tags or for non-empty tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.

The JSP container will resynchronize the values of any AT_BEGIN and NESTED variables (defined by the associated TagExtraInfo or TLD) after the invocation of doInitBody().

Throws:
JspException - if an error occurred while processing this tag
See Also:
IterationTag.doAfterBody()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DynamicAttributes (Java EE 5)

javax.servlet.jsp.tagext
Interface DynamicAttributes

public interface DynamicAttributes

声明接受动态属性的标记必须实现此接口。还必须配置标记库描述符中该标记的条目，以指示接受动态属性。
对于此标记的标记库描述符中未声明的任何属性，将使用该属性的名称和值调用 setDynamicAttribute() 方法，而不是在转换期间出现错误。由标记负责记住动态属性的名称和值。
since 2.0
英文文档：

For a tag to declare that it accepts dynamic attributes, it must implement this interface. The entry for the tag in the Tag Library Descriptor must also be configured to indicate dynamic attributes are accepted.
For any attribute that is not declared in the Tag Library Descriptor for this tag, instead of getting an error at translation time, the setDynamicAttribute() method is called, with the name and value of the attribute. It is the responsibility of the tag to remember the names and values of the dynamic attributes.

Since:
JSP 2.0

Method Summary
 void setDynamicAttribute(String uri, String localName, Object value)
Called when a tag declared to accept dynamic attributes is passed an attribute that is not declared in the Tag Library Descriptor.

Method Detail

public void setDynamicAttribute(String uri, String localName, Object value) throws JspException
在将标记库描述符中未声明的属性传递给声明接受动态属性的标记时调用。
uri | 属性的名称空间，如果在默认名称空间中，则该参数为 null。
localName | 要设置的属性的名称。
value | 属性的值
Throws | JspException: 如果标记处理程序想要表示它不接受给定属性。容器不得为此标记调用 doStartTag() 或 doTag()。
英文文档：

setDynamicAttribute

void setDynamicAttribute(String uri,
                         String localName,
                         Object value)
                         throws JspException
Called when a tag declared to accept dynamic attributes is passed an attribute that is not declared in the Tag Library Descriptor.

Parameters:
uri - the namespace of the attribute, or null if in the default namespace.
localName - the name of the attribute being set.
value - the value of the attribute
Throws:
JspException - if the tag handler wishes to signal that it does not accept the given attribute. The container must not call doStartTag() or doTag() for this tag.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IterationTag (Java EE 5)

javax.servlet.jsp.tagext
Interface IterationTag

All Superinterfaces:
JspTag, Tag
All Known Subinterfaces:
BodyTag
All Known Implementing Classes:
AttributeTag, BodyTagSupport, ConverterELTag, ConverterTag, FacetTag, TagSupport, UIComponentBodyTag, UIComponentClassicTagBase, UIComponentELTag, UIComponentTag, ValidatorELTag, ValidatorTag
public interface IterationTag
extends Tag

Implements: Tag
Implemented by: BodyTag, TagSupport

IterationTag 接口通过定义一个控制其正文重求值的附加方法扩展 Tag。

实现 IterationTag 的标记处理程序可被视为实现了与 doStartTag() 和 doEndTag() 方法有关的 Tag 的标记处理程序。IterationTag 提供了一个新方法：doAfterBody()。

doAfterBody() 方法在每次正文求值之后调用，以控制是否对正文重新求值。如果 doAfterBody() 返回 IterationTag.EVAL_BODY_AGAIN，则将对正文重新求值。如果 doAfterBody() 返回 Tag.SKIP_BODY，则将跳过正文并对 doEndTag() 求值。

属性 除了 Tag 中的那些属性之外，没有任何新属性。

方法 有一个新方法：doAfterBody()。

生命周期

以下的转换图描述了生命周期的详细信息。计算 doStartTag()、BODY 和 doAfterBody() 期间抛出的异常将中断执行序列，并向上传播到堆栈，除非标记处理程序实现了 TryCatchFinally 接口；有关详细信息，请参见该接口。

空操作和非空操作

如果 TagLibraryDescriptor 文件指示操作必须总是有一个空元素正文（通过 "empty" 的 <body-content> 条目），则 doStartTag() 方法必须返回 SKIP_BODY。

注意，在 doStartTag() 之后调用哪些方法取决于返回值和自定义操作元素在 JSP 页面中是否为空，而不取决于它在 TLD 中的声明方式。

如果返回 SKIP_BODY，则不对正文求值，然后调用 doEndTag()。

如果返回 EVAL_BODY_INCLUDE，并且自定义操作元素不为空，则对正文求值并“传递”到当前 out，然后调用 doAfterBody()，并在 0 个或更多迭代之后调用 doEndTag()。

英文文档：

The IterationTag interface extends Tag by defining one additional method that controls the reevaluation of its body.

A tag handler that implements IterationTag is treated as one that implements Tag regarding the doStartTag() and doEndTag() methods. IterationTag provides a new method: doAfterBody().

The doAfterBody() method is invoked after every body evaluation to control whether the body will be reevaluated or not. If doAfterBody() returns IterationTag.EVAL_BODY_AGAIN, then the body will be reevaluated. If doAfterBody() returns Tag.SKIP_BODY, then the body will be skipped and doEndTag() will be evaluated instead.

Properties There are no new properties in addition to those in Tag.

Methods There is one new methods: doAfterBody().

Lifecycle

Lifecycle details are described by the transition diagram below. Exceptions that are thrown during the computation of doStartTag(), BODY and doAfterBody() interrupt the execution sequence and are propagated up the stack, unless the tag handler implements the TryCatchFinally interface; see that interface for details.

Lifecycle Details Transition Diagram for IterationTag

Empty and Non-Empty Action

If the TagLibraryDescriptor file indicates that the action must always have an empty element body, by a <body-content> entry of "empty", then the doStartTag() method must return SKIP_BODY.

Note that which methods are invoked after the doStartTag() depends on both the return value and on if the custom action element is empty or not in the JSP page, not on how it's declared in the TLD.

If SKIP_BODY is returned the body is not evaluated, and then doEndTag() is invoked.

If EVAL_BODY_INCLUDE is returned, and the custom action element is not empty, the body is evaluated and "passed through" to the current out, then doAfterBody() is invoked and, after zero or more iterations, doEndTag() is invoked.

Field Summary
static int EVAL_BODY_AGAIN
Request the reevaluation of some body.
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Method Summary
 int doAfterBody()
Process body (re)evaluation.
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent

Field Detail

英文文档：

EVAL_BODY_AGAIN

static final int EVAL_BODY_AGAIN
Request the reevaluation of some body. Returned from doAfterBody. For compatibility with JSP 1.1, the value is carefully selected to be the same as the, now deprecated, BodyTag.EVAL_BODY_TAG,

See Also:
Constant Field Values
Method Detail

public int doAfterBody() throws JspException
处理正文求值（重求值）。在每次对 BodyEvaluation 对象中的正文求值之后，由 JSP 页面实现对象调用此方法。如果没有正文求值，则不调用该方法。

如果 doAfterBody 返回 EVAL_BODY_AGAIN，则将发生新的正文求值（后面接着另一个 doAfterBody 调用）。如果 doAfterBody 返回 SKIP_BODY，则不会再进行正文求值，并且将调用 doEndTag 方法。

如果此标记处理程序实现了 BodyTag 并且 doAfterBody 返回 SKIP_BODY，则将在调用 doEndTag 之前使用 pageContext 中的 popBody 方法恢复 out 的值。

重新调用该方法可能导致不同的操作，因为共享的状态可能已经发生了某些变化，或者因为进行了外部计算。

在调用 doAfterBody() 之后，JSP 容器将重新同步所有 AT_BEGIN 和 NESTED 变量（由关联的 TagExtraInfo 或 TLD 定义）的值。

return | 是否需要附加的正文求值
Throws | JspException: 如果在处理此标记时发生错误
英文文档：

doAfterBody

int doAfterBody()
                throws JspException
Process body (re)evaluation. This method is invoked by the JSP Page implementation object after every evaluation of the body into the BodyEvaluation object. The method is not invoked if there is no body evaluation.

If doAfterBody returns EVAL_BODY_AGAIN, a new evaluation of the body will happen (followed by another invocation of doAfterBody). If doAfterBody returns SKIP_BODY, no more body evaluations will occur, and the doEndTag method will be invoked.

If this tag handler implements BodyTag and doAfterBody returns SKIP_BODY, the value of out will be restored using the popBody method in pageContext prior to invoking doEndTag.

The method re-invocations may be lead to different actions because there might have been some changes to shared state, or because of external computation.

The JSP container will resynchronize the values of any AT_BEGIN and NESTED variables (defined by the associated TagExtraInfo or TLD) after the invocation of doAfterBody().

Returns:
whether additional evaluations of the body are desired
Throws:
JspException - if an error occurred while processing this tag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspIdConsumer (Java EE 5)

javax.servlet.jsp.tagext
Interface JspIdConsumer

All Known Implementing Classes:
UIComponentBodyTag, UIComponentClassicTagBase, UIComponentELTag, UIComponentTag
public interface JspIdConsumer

This interface indicates to the container that a tag handler wishes to be provided with a compiler generated ID.

The container sets the jspId attribute of the tag handler with an identification string, as part of tag property initialization. Each tag in a JSP page has a unique jspId, and a given tag in a JSP page always has the same jspId, even for multiple requests to the page.

Tag handler instances that implement JspIdConsumer cannot be reused.

Even though the jspId attribute is similar in concept to the jsp:id attribute of an XML view (see Section JSP.10.1.13 of the spec), they are not related. The jsp:id attribute is available only at translation time, and the jspId attribute is avalable only at request time.

The JSP container must provide a value for jspId that conforms to the following rules:

  • It must start with a letter (as defined by the Character.isLetter() method) or underscore ('_').
  • Subsequent characters may be letters (as defined by the Character.isLetter() method), digits (as defined by the Character.isDigit() method), dashes ('-'), or underscores ('_')

Note that the rules exclude colons ':' in a jspId, and that they are the same rules used for a component ID in JavaServer Faces.

Since:
JSP 2.1

Method Summary
 void setJspId(String id)
Called by the container generated code to set a value for the jspId attribute.

Method Detail

setJspId

void setJspId(String id)
Called by the container generated code to set a value for the jspId attribute. An unique identification string, relative to this page, is generated at translation time.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature

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


JspTag (Java EE 5)

javax.servlet.jsp.tagext
Interface JspTag

All Known Subinterfaces:
BodyTag, IterationTag, SimpleTag, Tag
All Known Implementing Classes:
AttributeTag, BodyTagSupport, ConverterELTag, ConverterTag, FacetTag, SimpleTagSupport, TagAdapter, TagSupport, UIComponentBodyTag, UIComponentClassicTagBase, UIComponentELTag, UIComponentTag, UIComponentTagBase, ValidatorELTag, ValidatorTag
public interface JspTag

Implemented by: SimpleTag, Tag, UIComponentTagBase

充当 Tag 和 SimpleTag 的基类。使用此类主要是出于组织和类型安全方面的考虑。
since 2.0
英文文档：

Serves as a base class for Tag and SimpleTag. This is mostly for organizational and type-safety purposes.

Since:
JSP 2.0

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTag (Java EE 5)

javax.servlet.jsp.tagext
Interface SimpleTag

All Superinterfaces:
JspTag
All Known Implementing Classes:
SimpleTagSupport
public interface SimpleTag
extends JspTag

Implements: JspTag
Implemented by: SimpleTagSupport

用来定义简单标记处理程序的接口。

简单标记处理程序不同于经典标记处理程序，因为它不支持 doStartTag() 和 doEndTag()，SimpleTag 接口提供了一个简单 doTag() 方法，对于任何给定标记调用，只能调用该方法一次。所有标记逻辑、迭代、正文求值等等，都在这一个方法中执行。因此，简单标记处理程序与 BodyTag 具有相等的效力，只是它具有更简单的生命周期和接口。

为了支持正文内容，提供了 setJspBody() 方法。容器使用封装了标记正文的 JspFragment 对象调用 setJspBody() 方法。标记处理程序实现可以对该片段调用 invoke()，根据需要多次对正文求值。

SimpleTag 处理程序必须具有不带参数的公共构造方法。多数 SimpleTag 处理程序应该扩展 SimpleTagSupport。

生命周期

以下是 SimpleTag 生命周期的非标准的简单概述。有关详细信息，请参见 JSP 规范。

  1. 新的标记处理程序实例每次都由容器通过调用提供的无参数构造方法创建。与经典标记处理程序不同，简单标记处理程序从不被 JSP 容器缓存和重用。
  2. setJspContext() 和 setParent() 方法由容器调用。setParent() 方法只在元素嵌套在另一个标记调用中时调用。
  3. 为此标记定义的每个属性的 setter 方法都由容器调用。
  4. 如果存在正文，则由容器调用 setJspBody() 方法来设置此标记的正文，以 JspFragment 的形式。如果页面的操作元素为空，则根本不调用此方法。
  5. doTag() 方法由容器调用。所有标记逻辑、迭代、正文求值等等都发生在此方法中。
  6. doTag() 方法返回，并且同步所有变量。
since | 2.0
See also | javax.servlet.jsp.tagext.SimpleTagSupport
英文文档：

Interface for defining Simple Tag Handlers.

Simple Tag Handlers differ from Classic Tag Handlers in that instead of supporting doStartTag() and doEndTag(), the SimpleTag interface provides a simple doTag() method, which is called once and only once for any given tag invocation. All tag logic, iteration, body evaluations, etc. are to be performed in this single method. Thus, simple tag handlers have the equivalent power of BodyTag, but with a much simpler lifecycle and interface.

To support body content, the setJspBody() method is provided. The container invokes the setJspBody() method with a JspFragment object encapsulating the body of the tag. The tag handler implementation can call invoke() on that fragment to evaluate the body as many times as it needs.

A SimpleTag handler must have a public no-args constructor. Most SimpleTag handlers should extend SimpleTagSupport.

Lifecycle

The following is a non-normative, brief overview of the SimpleTag lifecycle. Refer to the JSP Specification for details.

  1. A new tag handler instance is created each time by the container by calling the provided zero-args constructor. Unlike classic tag handlers, simple tag handlers are never cached and reused by the JSP container.
  2. The setJspContext() and setParent() methods are called by the container. The setParent() method is only called if the element is nested within another tag invocation.
  3. The setters for each attribute defined for this tag are called by the container.
  4. If a body exists, the setJspBody() method is called by the container to set the body of this tag, as a JspFragment. If the action element is empty in the page, this method is not called at all.
  5. The doTag() method is called by the container. All tag logic, iteration, body evaluations, etc. occur in this method.
  6. The doTag() method returns and all variables are synchronized.

Since:
JSP 2.0
See Also:
SimpleTagSupport

Method Summary
void | doTag() Called by the container to invoke this tag.
JspTag | getParent() Returns the parent of this tag, for collaboration purposes.
void | setJspBody(JspFragment jspBody) Provides the body of this tag as a JspFragment object, able to be invoked zero or more times by the tag handler.
void | setJspContext(JspContext pc) Called by the container to provide this tag handler with the JspContext for this invocation.
void | setParent(JspTag parent) Sets the parent of this tag, for collaboration purposes.

Method Detail

public void doTag() throws JspException, java.io.IOException
容器调用它来调用此标记。此方法的实现由标记库开发人员提供，该实现处理所有标记处理、正文迭代，等等。

在调用 doTag() 之后，JSP 容器将重新同步所有 AT_BEGIN 和 AT_END 变量（由关联的标记文件、TagExtraInfo 或 TLD 定义）。

Throws | JspException: 如果处理此标记时发生错误。
Throws | SkipPageException: 如果（直接或间接）调用此标记的页面停止求值。如果调用的经典标记处理程序返回 SKIP_PAGE，或者调用的简单标记处理程序抛出 SkipPageException，或者调用的 JSP 片段抛出 SkipPageException，则标记文件生成的简单标记处理程序必定抛出此异常。
Throws | java.io.IOException: 如果写入输出流时出现错误。
英文文档：

doTag

void doTag()
           throws JspException,
                  IOException
Called by the container to invoke this tag. The implementation of this method is provided by the tag library developer, and handles all tag processing, body iteration, etc.

The JSP container will resynchronize any AT_BEGIN and AT_END variables (defined by the associated tag file, TagExtraInfo, or TLD) after the invocation of doTag().

Throws:
JspException - If an error occurred while processing this tag.
SkipPageException - If the page that (either directly or indirectly) invoked this tag is to cease evaluation. A Simple Tag Handler generated from a tag file must throw this exception if an invoked Classic Tag Handler returned SKIP_PAGE or if an invoked Simple Tag Handler threw SkipPageException or if an invoked Jsp Fragment threw a SkipPageException.
IOException - If there was an error writing to the output stream.

public void setParent(JspTag parent)
为了进行协作，设置此标记的父标记。

仅当此标记调用嵌套在另一个标记调用中时，容器才调用此方法。

parent 封闭此标记的标记
英文文档：

setParent

void setParent(JspTag parent)
Sets the parent of this tag, for collaboration purposes.

The container invokes this method only if this tag invocation is nested within another tag invocation.

Parameters:
parent - the tag that encloses this tag

public JspTag getParent()
为了进行协作，返回此标记的父标记。
return 此标记的父标记
英文文档：

getParent

JspTag getParent()
Returns the parent of this tag, for collaboration purposes.

Returns:
the parent of this tag

public void setJspContext(JspContext pc)
由容器调用以将此调用的 JspContext 提供给此标记处理程序。实现应该保存此值。
pc | 此调用的页面上下文
See also | setPageContext
英文文档：

setJspContext

void setJspContext(JspContext pc)
Called by the container to provide this tag handler with the JspContext for this invocation. An implementation should save this value.

Parameters:
pc - the page context for this invocation
See Also:
Tag.setPageContext(javax.servlet.jsp.PageContext)

public void setJspBody(JspFragment jspBody)
以标记处理程序可以不调用或多次调用的 JspFragment 对象的形式提供此标记的正文。

此方法由 JSP 页面实现对象在调用 doTag() 之前调用。如果页面的操作元素为空，则根本不调用此方法。

jspBody 封装此标记正文的片段。
英文文档：

setJspBody

void setJspBody(JspFragment jspBody)
Provides the body of this tag as a JspFragment object, able to be invoked zero or more times by the tag handler.

This method is invoked by the JSP page implementation object prior to doTag(). If the action element is empty in the page, this method is not called at all.

Parameters:
jspBody - The fragment encapsulating the body of this tag.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Tag (Java EE 5)

javax.servlet.jsp.tagext
Interface Tag

All Superinterfaces:
JspTag
All Known Subinterfaces:
BodyTag, IterationTag
All Known Implementing Classes:
AttributeTag, BodyTagSupport, ConverterELTag, ConverterTag, FacetTag, TagAdapter, TagSupport, UIComponentBodyTag, UIComponentClassicTagBase, UIComponentELTag, UIComponentTag, ValidatorELTag, ValidatorTag
public interface Tag
extends JspTag

Implements: JspTag
Implemented by: IterationTag, TagAdapter, UIComponentELTag, UIComponentTag

不想操作其正文的经典标记处理程序的接口。Tag 接口定义了标记处理程序与 JSP 页面实现类之间的基本协议。它定义了生命周期以及在开始和结束标记时调用的方法。

属性

Tag 接口指定了用于核心 pageContext 和父属性的 setter 和 getter 方法。

JSP 页面实现对象调用 setPageContext 和 setParent，其顺序是在调用 doStartTag() 或 doEndTag() 之前。

方法

有两个主要操作：doStartTag 和 doEndTag。一旦已经初始化所有适当属性，就可以对标记处理程序调用 doStartTag 和 doEndTag 方法。在这些调用之间，假定标记处理程序保存了其必须保留的状态。在调用 doEndTag 之后，标记处理程序可用于进一步的调用（并且它应该已经保留了其属性）。

生命周期

以下的转换图和注释描述了生命周期的详细信息。

  • [1] 此转换旨在释放长期数据。不能保证是否已经保留了任何属性。
  • [2] 当且仅当标记正常结束，未引发异常时发生此转换。
  • [3] 在重用标记处理程序之前，可以再次调用某些 setter。例如，如果在同一页面内但在不同级别上重用标记处理程序，则调用 setParent()，如果在另一个页面中使用标记处理程序，则调用 setPageContext()，如果值不同或者它们被表示为请求期间属性值，则调用属性的 setter 方法。
  • 查阅 TryCatchFinally 接口，获得与异常处理和资源管理有关的其他详细信息。

Tag 的生命周期详细信息转换图

一旦完成了标记处理程序上的所有调用，就对它调用 release 方法。一旦调用了 release 方法，就会假定所有 属性（包括父属性和 pageContext）都已重置为未指定的值。页面编译器可以保证，将在处理程序被释放到 GC 之前对标记处理程序调用 release()。

空操作和非空操作

如果 TagLibraryDescriptor 文件指示操作必须总是有一个空操作（通过 "empty" 的 <body-content> 条目），则 doStartTag() 方法必须返回 SKIP_BODY。

否则，doStartTag() 方法可能返回 SKIP_BODY 或 EVAL_BODY_INCLUDE。

如果返回 SKIP_BODY，则不会对正文（如果存在）求值。

如果返回 EVAL_BODY_INCLUDE，则对正文求值并“传递”到当前 out。

英文文档：

The interface of a classic tag handler that does not want to manipulate its body. The Tag interface defines the basic protocol between a Tag handler and JSP page implementation class. It defines the life cycle and the methods to be invoked at start and end tag.

Properties

The Tag interface specifies the setter and getter methods for the core pageContext and parent properties.

The JSP page implementation object invokes setPageContext and setParent, in that order, before invoking doStartTag() or doEndTag().

Methods

There are two main actions: doStartTag and doEndTag. Once all appropriate properties have been initialized, the doStartTag and doEndTag methods can be invoked on the tag handler. Between these invocations, the tag handler is assumed to hold a state that must be preserved. After the doEndTag invocation, the tag handler is available for further invocations (and it is expected to have retained its properties).

Lifecycle

Lifecycle details are described by the transition diagram below, with the following comments:

  • [1] This transition is intended to be for releasing long-term data. no guarantees are assumed on whether any properties have been retained or not.
  • [2] This transition happens if and only if the tag ends normally without raising an exception
  • [3] Some setters may be called again before a tag handler is reused. For instance, setParent() is called if it's reused within the same page but at a different level, setPageContext() is called if it's used in another page, and attribute setters are called if the values differ or are expressed as request-time attribute values.
  • Check the TryCatchFinally interface for additional details related to exception handling and resource management.

Lifecycle Details Transition Diagram for Tag

Once all invocations on the tag handler are completed, the release method is invoked on it. Once a release method is invoked all properties, including parent and pageContext, are assumed to have been reset to an unspecified value. The page compiler guarantees that release() will be invoked on the Tag handler before the handler is released to the GC.

Empty and Non-Empty Action

If the TagLibraryDescriptor file indicates that the action must always have an empty action, by an <body-content> entry of "empty", then the doStartTag() method must return SKIP_BODY.

Otherwise, the doStartTag() method may return SKIP_BODY or EVAL_BODY_INCLUDE.

If SKIP_BODY is returned the body, if present, is not evaluated.

If EVAL_BODY_INCLUDE is returned, the body is evaluated and "passed through" to the current out.

Field Summary
static int | EVAL_BODY_INCLUDE Evaluate body into existing out stream.
static int | EVAL_PAGE Continue evaluating the page.
static int | SKIP_BODY Skip body evaluation.
static int | SKIP_PAGE Skip the rest of the page.
Method Summary
int | doEndTag() Process the end tag for this instance.
int | doStartTag() Process the start tag for this instance.
Tag | getParent() Get the parent (closest enclosing tag handler) for this tag handler.
void | release() Called on a Tag handler to release state.
void | setPageContext(PageContext pc) Set the current page context.
void | setParent(Tag t) Set the parent (closest enclosing tag handler) of this tag handler.

Field Detail

英文文档：

SKIP_BODY

static final int SKIP_BODY
Skip body evaluation. Valid return value for doStartTag and doAfterBody.

See Also:
Constant Field Values

英文文档：

EVAL_BODY_INCLUDE

static final int EVAL_BODY_INCLUDE
Evaluate body into existing out stream. Valid return value for doStartTag.

See Also:
Constant Field Values

英文文档：

SKIP_PAGE

static final int SKIP_PAGE
Skip the rest of the page. Valid return value for doEndTag.

See Also:
Constant Field Values

英文文档：

EVAL_PAGE

static final int EVAL_PAGE
Continue evaluating the page. Valid return value for doEndTag().

See Also:
Constant Field Values
Method Detail

public void setPageContext(PageContext pc)
设置当前页面上下文。此方法由 JSP 页面实现对象在调用 doStartTag() 之前调用。

如果在 doStartTag() 调用之间此值发生变化，则*不*要通过 doEndTag() 重置此值，而必须通过页面实现显式重置它。

pc 此标记处理程序的页面上下文。
英文文档：

setPageContext

void setPageContext(PageContext pc)
Set the current page context. This method is invoked by the JSP page implementation object prior to doStartTag().

This value is *not* reset by doEndTag() and must be explicitly reset by a page implementation if it changes between calls to doStartTag().

Parameters:
pc - The page context for this tag handler.

public void setParent(Tag t)
设置此标记处理程序的父标记处理程序（最接近的封闭标记处理程序）。由 JSP 页面实现对象在调用 doStartTag() 之前调用。

*不*要通过 doEndTag() 重置此值，必须通过页面实现显式重置它。

t 父标记，或 null。
英文文档：

setParent

void setParent(Tag t)
Set the parent (closest enclosing tag handler) of this tag handler. Invoked by the JSP page implementation object prior to doStartTag().

This value is *not* reset by doEndTag() and must be explicitly reset by a page implementation.

Parameters:
t - The parent tag, or null.

public Tag getParent()
获取此标记处理程序的父标记处理程序（最接近的封闭标记处理程序）。

可使用 getParent() 方法在运行时导航嵌套的标记处理程序结构，以便在各自定义操作之间合作；例如，TagSupport 中的 findAncestorWithClass() 方法提供了一个实现此操作的便捷方式。

规范的当前版本仅提供一种正式方法指示标记处理程序的 observable 类型：其标记处理程序实现类，在标记元素的标记类子元素中描述。这可以通过一种非正式的方法扩展，即允许标记库作者在描述子元素中指示 observable 类型。该类型应该是标记处理程序实现类的子类型或者是 void 类型。支持特定标记库（比如 JSP 标准标记库）的专门化容器可以利用这一附加限制。

return | 当前的父标记处理程序，如果不存在，则返回 null。
See also | findAncestorWithClass
英文文档：

getParent

Tag getParent()
Get the parent (closest enclosing tag handler) for this tag handler.

The getParent() method can be used to navigate the nested tag handler structure at runtime for cooperation among custom actions; for example, the findAncestorWithClass() method in TagSupport provides a convenient way of doing this.

The current version of the specification only provides one formal way of indicating the observable type of a tag handler: its tag handler implementation class, described in the tag-class subelement of the tag element. This is extended in an informal manner by allowing the tag library author to indicate in the description subelement an observable type. The type should be a subtype of the tag handler implementation class or void. This addititional constraint can be exploited by a specialized container that knows about that specific tag library, as in the case of the JSP standard tag library.

Returns:
the current parent, or null if none.
See Also:
TagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.Tag, java.lang.Class)

public int doStartTag() throws JspException
处理此实例的开始标记。此方法由 JSP 页面实现对象调用。

doStartTag 方法假定已经设置了属性 pageContext 和父属性。它还假定任何公开为属性的属性也已经进行了设置。在调用此方法时，尚未对正文求值。

此方法返回 Tag.EVAL_BODY_INCLUDE 或 BodyTag.EVAL_BODY_BUFFERED，指示应该对操作正文求值，或者返回 SKIP_BODY，指示不对正文求值。

当 Tag 返回 EVAL_BODY_INCLUDE 时，对正文（如果有）求值的结果将包含在当前 "out" JspWriter 中，然后调用 doEndTag()。

BodyTag.EVAL_BODY_BUFFERED 只在标记处理程序实现了 BodyTag 时有效。

在调用 doStartTag() 之后，JSP 容器将重新同步所有 AT_BEGIN 和 NESTED 变量（由关联的 TagExtraInfo 或 TLD 定义）的值，除了实现了 BodyTag 而该 BodyTag 的 doStartTag() 方法返回 BodyTag.EVAL_BODY_BUFFERED 的标记处理程序。

return | 如果标记想处理正文，则返回 EVAL_BODY_INCLUDE，如果标记不想处理正文，则返回 SKIP_BODY。
Throws | JspException: 如果在处理此标记时发生错误
See also | javax.servlet.jsp.tagext.BodyTag
英文文档：

doStartTag

int doStartTag()
               throws JspException
Process the start tag for this instance. This method is invoked by the JSP page implementation object.

The doStartTag method assumes that the properties pageContext and parent have been set. It also assumes that any properties exposed as attributes have been set too. When this method is invoked, the body has not yet been evaluated.

This method returns Tag.EVAL_BODY_INCLUDE or BodyTag.EVAL_BODY_BUFFERED to indicate that the body of the action should be evaluated or SKIP_BODY to indicate otherwise.

When a Tag returns EVAL_BODY_INCLUDE the result of evaluating the body (if any) is included into the current "out" JspWriter as it happens and then doEndTag() is invoked.

BodyTag.EVAL_BODY_BUFFERED is only valid if the tag handler implements BodyTag.

The JSP container will resynchronize the values of any AT_BEGIN and NESTED variables (defined by the associated TagExtraInfo or TLD) after the invocation of doStartTag(), except for a tag handler implementing BodyTag whose doStartTag() method returns BodyTag.EVAL_BODY_BUFFERED.

Returns:
EVAL_BODY_INCLUDE if the tag wants to process body, SKIP_BODY if it does not want to process it.
Throws:
JspException - if an error occurred while processing this tag
See Also:
BodyTag

public int doEndTag() throws JspException
处理此实例的结束标记。由 JSP 页面实现对象对所有标记处理程序调用此方法。

此方法将在从 doStartTag 返回后调用。可能已经对操作正文求值，也可能未求值，取决于 doStartTag 的返回值。

如果此方法返回 EVAL_PAGE，则将继续对页面的其余部分求值。如果此方法返回 SKIP_PAGE，则不对页面其余部分求值，完成请求，且不调用封闭标记的 doEndTag() 方法。如果此请求被转发或包含到另一个页面（或 Servlet）中，则仅停止对当前页面的求值。

在调用 doEndTag() 之后，JSP 容器将重新同步所有 AT_BEGIN 和 AT_END 变量（由关联的 TagExtraInfo 或 TLD 定义）的值。

return | 是否继续对 JSP 页面求值的指示。
Throws | JspException: 如果在处理此标记时发生错误
英文文档：

doEndTag

int doEndTag()
             throws JspException
Process the end tag for this instance. This method is invoked by the JSP page implementation object on all Tag handlers.

This method will be called after returning from doStartTag. The body of the action may or may not have been evaluated, depending on the return value of doStartTag.

If this method returns EVAL_PAGE, the rest of the page continues to be evaluated. If this method returns SKIP_PAGE, the rest of the page is not evaluated, the request is completed, and the doEndTag() methods of enclosing tags are not invoked. If this request was forwarded or included from another page (or Servlet), only the current page evaluation is stopped.

The JSP container will resynchronize the values of any AT_BEGIN and AT_END variables (defined by the associated TagExtraInfo or TLD) after the invocation of doEndTag().

Returns:
indication of whether to continue evaluating the JSP page.
Throws:
JspException - if an error occurred while processing this tag

public void release()
对标记处理程序调用，以释放状态。页面编译器保证 JSP 页面实现对象将对所有标记处理程序调用此方法，但之间可能会多次调用 doStartTag 和 doEndTag。
英文文档：

release

void release()
Called on a Tag handler to release state. The page compiler guarantees that JSP page implementation objects will invoke this method on all tag handlers, but there may be multiple invocations on doStartTag and doEndTag in between.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TryCatchFinally (Java EE 5)

javax.servlet.jsp.tagext
Interface TryCatchFinally

public interface TryCatchFinally

想使用其他挂钩 (hook) 管理资源的 Tag、IterationTag 或 BodyTag 标记处理程序的辅助接口。

此接口提供了两个新方法：doCatch(Throwable) 和 doFinally()。原型调用如下所示：

h = get a Tag();  // get a tag handler, perhaps from pool

h.setPageContext(pc);  // initialize as desired
h.setParent(null);
h.setFoo("foo");

// tag invocation protocol; see Tag.java
try {
doStartTag()...
   ....
doEndTag()...
} catch (Throwable t) {
// react to exceptional condition
h.doCatch(t);
} finally {
// restore data invariants and release per-invocation resources
h.doFinally();
 }

... other invocations perhaps with some new setters
 ...
h.release();  // release long-term resources
英文文档：

The auxiliary interface of a Tag, IterationTag or BodyTag tag handler that wants additional hooks for managing resources.

This interface provides two new methods: doCatch(Throwable) and doFinally(). The prototypical invocation is as follows:

 h = get a Tag();  // get a tag handler, perhaps from pool

 h.setPageContext(pc);  // initialize as desired
 h.setParent(null);
 h.setFoo("foo");

 // tag invocation protocol; see Tag.java
 try {
   doStartTag()...
   ....
   doEndTag()...
 } catch (Throwable t) {
   // react to exceptional condition
   h.doCatch(t);
 } finally {
   // restore data invariants and release per-invocation resources
   h.doFinally();
 }

 ... other invocations perhaps with some new setters
 ...
 h.release();  // release long-term resources

Method Summary
 void doCatch(Throwable t)
Invoked if a Throwable occurs while evaluating the BODY inside a tag or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody().
 void doFinally()
Invoked in all cases after doEndTag() for any class implementing Tag, IterationTag or BodyTag.

Method Detail

public void doCatch(Throwable t) throws Throwable
如果在某个标记内或在以下任何方法：Tag.doStartTag()、Tag.doEndTag()、IterationTag.doAfterBody() 和 BodyTag.doInitBody() 中对正文求值时发生 Throwable，则调用此方法。

如果某个 setter 方法发生 Throwable，则不调用此方法。

此方法可能抛出一个将沿嵌套链进一步向上传播的异常（同一异常或新异常）。如果抛出异常，则将调用 doFinally()。

此方法旨在用于响应异常条件。

t | 在此标记中导航的 throwable 异常。
Throws | Throwable: 如果将沿嵌套链进一步向上重新抛出该异常。
英文文档：

doCatch

void doCatch(Throwable t)
             throws Throwable
Invoked if a Throwable occurs while evaluating the BODY inside a tag or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody().

This method is not invoked if the Throwable occurs during one of the setter methods.

This method may throw an exception (the same or a new one) that will be propagated further up the nest chain. If an exception is thrown, doFinally() will be invoked.

This method is intended to be used to respond to an exceptional condition.

Parameters:
t - The throwable exception navigating through this tag.
Throws:
Throwable - if the exception is to be rethrown further up the nest chain.

public void doFinally()
在对任何实现 Tag、IterationTag 或 BodyTag 的类调用 doEndTag() 之后的任何情况下都可调用此方法。即使标记 BODY 中或以下任何方法：Tag.doStartTag()、Tag.doEndTag()、IterationTag.doAfterBody() 和 BodyTag.doInitBody() 中已经发生异常，也可以调用此方法。

如果某个 setter 方法发生 Throwable，则不调用此方法。

此方法不应抛出 Exception。

此方法旨在维护每次调用的数据完整性和资源管理操作。

英文文档：

doFinally

void doFinally()
Invoked in all cases after doEndTag() for any class implementing Tag, IterationTag or BodyTag. This method is invoked even if an exception has occurred in the BODY of the tag, or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody().

This method is not invoked if the Throwable occurs during one of the setter methods.

This method should not throw an Exception.

This method is intended to maintain per-invocation data integrity and resource management actions.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BodyContent (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.jsp.tagext
Class BodyContent

java.lang.Object
    extended by  java.io.Writer
        extended by  javax.servlet.jsp.JspWriter
            extended by  javax.servlet.jsp.tagext.BodyContent
All Implemented Interfaces:
Closeable, Flushable, Appendable
public abstract class BodyContent
extends JspWriter

Extends: java.io.Writer > JspWriter

对某一操作正文求值的封装，因此它可用于标记处理程序。BodyContent 是 JspWriter 的子类。

注意，BodyContent 的内容是求值的结果，因此除了操作调用的结果外，它不会包含任何操作和类似的东西。

BodyContent 有一些方法，这些方法可将其内容转换为 String、读取其内容和清除内容。

BodyContent 对象的缓冲区大小是无界的。BodyContent 对象不能处于 autoFlush 模式。不可能对 BodyContent 对象调用 flush，因为没有回溯流。

BodyContent 实例是通过调用 PageContext 类的 pushBody 和 popBody 方法创建的。BodyContent 按照与其关联的操作的结构被封闭在另一个 JspWriter（可能是另一个 BodyContent 对象）内。

通过调用 setBodyContent() 使 BodyContent 可用于 BodyTag。直到调用 doEndTag() 后，标记处理程序才可以使用该对象。

英文文档：

An encapsulation of the evaluation of the body of an action so it is available to a tag handler. BodyContent is a subclass of JspWriter.

Note that the content of BodyContent is the result of evaluation, so it will not contain actions and the like, but the result of their invocation.

BodyContent has methods to convert its contents into a String, to read its contents, and to clear the contents.

The buffer size of a BodyContent object is unbounded. A BodyContent object cannot be in autoFlush mode. It is not possible to invoke flush on a BodyContent object, as there is no backing stream.

Instances of BodyContent are created by invoking the pushBody and popBody methods of the PageContext class. A BodyContent is enclosed within another JspWriter (maybe another BodyContent object) following the structure of their associated actions.

A BodyContent is made available to a BodyTag through a setBodyContent() call. The tag handler can use the object until after the call to doEndTag().

Field Summary
Fields inherited from class javax.servlet.jsp.JspWriter
autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER
Fields inherited from class java.io.Writer
lock
Constructor Summary
protected BodyContent(JspWriter e)
Protected constructor.
Method Summary
 void clearBody()
Clear the body without throwing any exceptions.
 void flush()
Redefined flush() so it is not legal.
 JspWriter getEnclosingWriter()
Get the enclosing JspWriter.
abstract  Reader getReader()
Return the value of this BodyContent as a Reader.
abstract  String getString()
Return the value of the BodyContent as a String.
abstract  void writeOut(Writer out)
Write the contents of this BodyContent into a Writer.
Methods inherited from class javax.servlet.jsp.JspWriter
clear, clearBuffer, close, getBufferSize, getRemaining, isAutoFlush, newLine, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected BodyContent(JspWriter e)
受保护的构造方法。 无界缓冲区，不执行自动刷新。
e 封闭的 JspWriter
英文文档：

BodyContent

protected BodyContent(JspWriter e)
Protected constructor. Unbounded buffer, no autoflushing.

Parameters:
e - the enclosing JspWriter
Method Detail

public void flush() throws java.io.IOException
重定义的 flush()，因此它是不合法的。

刷新 BodyContent 是无效的，因为它后面没有回溯流。

Throws java.io.IOException: 始终抛出
英文文档：

flush

public void flush()
           throws IOException
Redefined flush() so it is not legal.

It is not valid to flush a BodyContent because there is no backing stream behind it.

Specified by:
flush in interface Flushable
Specified by:
flush in class JspWriter
Throws:
IOException - always thrown

public void clearBody()
清除正文，不抛出任何异常。
英文文档：

clearBody

public void clearBody()
Clear the body without throwing any exceptions.

abstract public java.io.Reader getReader()
以 Reader 形式返回此 BodyContent 的值。
return Reader 形式的此 BodyContent 的值
英文文档：

getReader

public abstract Reader getReader()
Return the value of this BodyContent as a Reader.

Returns:
the value of this BodyContent as a Reader

abstract public String getString()
以 String 形式返回 BodyContent 的值。
return String 形式的 BodyContent 的值
英文文档：

getString

public abstract String getString()
Return the value of the BodyContent as a String.

Returns:
the value of the BodyContent as a String

abstract public void writeOut(java.io.Writer out) throws java.io.IOException
将此 BodyContent 的内容写入 Writer。子类可优化常用调用模式。
out | 要放置此正文求值的内容的 Writer
Throws | java.io.IOException: 如果在将此 BodyContent 的内容写入给定 Writer 时发生 I/O 错误
英文文档：

writeOut

public abstract void writeOut(Writer out)
                       throws IOException
Write the contents of this BodyContent into a Writer. Subclasses may optimize common invocation patterns.

Parameters:
out - The writer into which to place the contents of this body evaluation
Throws:
IOException - if an I/O error occurred while writing the contents of this BodyContent to the given Writer

public JspWriter getEnclosingWriter()
获取封闭的 JspWriter。
return 构造时传递的封闭 JspWriter
英文文档：

getEnclosingWriter

public JspWriter getEnclosingWriter()
Get the enclosing JspWriter.

Returns:
the enclosing JspWriter passed at construction time
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BodyTagSupport (Java EE 5)

javax.servlet.jsp.tagext
Class BodyTagSupport

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
        extended by  javax.servlet.jsp.tagext.BodyTagSupport
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag
public class BodyTagSupport
extends TagSupport
implements BodyTag

Extends: TagSupport
Implements: BodyTag

用来定义实现 BodyTag 的标记处理程序的基类。

BodyTagSupport 类实现 BodyTag 接口并添加了其他便捷方法，包括 bodyContent 属性的 getter 方法和获取以前的 out JspWriter 的方法。

许多标记处理程序将扩展 BodyTagSupport，并且仅重新定义少数几个方法。

英文文档：

A base class for defining tag handlers implementing BodyTag.

The BodyTagSupport class implements the BodyTag interface and adds additional convenience methods including getter methods for the bodyContent property and methods to get at the previous out JspWriter.

Many tag handlers will extend BodyTagSupport and only redefine a few methods.

See Also:
Serialized Form

Field Summary
protected  BodyContent bodyContent
The current BodyContent for this BodyTag.
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
BodyTagSupport()
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.
Method Summary
int | doAfterBody() After the body evaluation: do not reevaluate and continue with the page.
int | doEndTag() Default processing of the end tag returning EVAL_PAGE.
void | doInitBody() Prepare for evaluation of the body just before the first body evaluation: no action.
int | doStartTag() Default processing of the start tag returning EVAL_BODY_BUFFERED.
BodyContent | getBodyContent() Get current bodyContent.
JspWriter | getPreviousOut() Get surrounding out JspWriter.
void | release() Release state.
void | setBodyContent(BodyContent b) Prepare for evaluation of the body: stash the bodyContent away.
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent

Field Detail

英文文档：

bodyContent

protected BodyContent bodyContent
The current BodyContent for this BodyTag.

Constructor Detail

public BodyTagSupport()
默认构造方法，所有子类只需定义一个具有相同签名的公共构造方法并调用该超类构造方法。 此构造方法通过 JSP 转换器生成的代码调用。
英文文档：

BodyTagSupport

public BodyTagSupport()
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor. This constructor is called by the code generated by the JSP translator.

Method Detail

public int doStartTag() throws JspException
开始标记的默认处理，返回 EVAL_BODY_BUFFERED。
return | EVAL_BODY_BUFFERED
Throws | JspException: 如果在处理此标记时发生错误
See also | doStartTag
英文文档：

doStartTag

public int doStartTag()
               throws JspException
Default processing of the start tag returning EVAL_BODY_BUFFERED.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
EVAL_BODY_BUFFERED
Throws:
JspException - if an error occurred while processing this tag
See Also:
Tag.doStartTag()

public int doEndTag() throws JspException
结束标记的默认处理，返回 EVAL_PAGE。
return | EVAL_PAGE
Throws | JspException: 如果在处理此标记时发生错误
See also | doEndTag
英文文档：

doEndTag

public int doEndTag()
             throws JspException
Default processing of the end tag returning EVAL_PAGE.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Returns:
EVAL_PAGE
Throws:
JspException - if an error occurred while processing this tag
See Also:
Tag.doEndTag()

public void setBodyContent(BodyContent b)
为正文求值做准备：隐藏 bodyContent。
b | BodyContent
See also | doAfterBody, doInitBody(), setBodyContent
英文文档：

setBodyContent

public void setBodyContent(BodyContent b)
Prepare for evaluation of the body: stash the bodyContent away.

Specified by:
setBodyContent in interface BodyTag
Parameters:
b - the BodyContent
See Also:
doAfterBody(),
doInitBody(),
BodyTag.setBodyContent(javax.servlet.jsp.tagext.BodyContent)

public void doInitBody() throws JspException
在第一次正文求值之前为正文求值做准备：不执行任何操作。
Throws | JspException: 如果在处理此标记时发生错误
See also | setBodyContent, doAfterBody, doInitBody
英文文档：

doInitBody

public void doInitBody()
                throws JspException
Prepare for evaluation of the body just before the first body evaluation: no action.

Specified by:
doInitBody in interface BodyTag
Throws:
JspException - if an error occurred while processing this tag
See Also:
setBodyContent(javax.servlet.jsp.tagext.BodyContent),
doAfterBody(),
BodyTag.doInitBody()

public int doAfterBody() throws JspException
在正文求值之后：不重新求值，并继续处理该页面。默认情况下，不使用 bodyContent 数据（如果有）执行任何操作。
return | SKIP_BODY
Throws | JspException: 如果在处理此标记时发生错误
See also | doInitBody, doAfterBody
英文文档：

doAfterBody

public int doAfterBody()
                throws JspException
After the body evaluation: do not reevaluate and continue with the page. By default nothing is done with the bodyContent data (if any).

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class TagSupport
Returns:
SKIP_BODY
Throws:
JspException - if an error occurred while processing this tag
See Also:
doInitBody(), IterationTag.doAfterBody()

public void release()
释放状态。
See also release
英文文档：

release

public void release()
Release state.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport
See Also:
Tag.release()

public BodyContent getBodyContent()
获取当前 bodyContent。
return 正文内容。
英文文档：

getBodyContent

public BodyContent getBodyContent()
Get current bodyContent.

Returns:
the body content.

public JspWriter getPreviousOut()
获取周围的 out JspWriter。
return 封闭的 JspWriter，来自 bodyContent。
英文文档：

getPreviousOut

public JspWriter getPreviousOut()
Get surrounding out JspWriter.

Returns:
the enclosing JspWriter, from the bodyContent.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FunctionInfo (Java EE 5)

javax.servlet.jsp.tagext
Class FunctionInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.FunctionInfo

public class FunctionInfo
extends Object

关于标记库中某个函数的信息。此类是根据标记库描述符文件 (TLD) 实例化的，仅在转换期间可用。
since 2.0
英文文档：

Information for a function in a Tag Library. This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.

Since:
JSP 2.0

Constructor Summary
FunctionInfo(String name, String klass, String signature)
Constructor for FunctionInfo.
Method Summary
String | getFunctionClass() The class of the function.
String | getFunctionSignature() The signature of the function.
String | getName() The name of the function.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public FunctionInfo(String name, String klass, String signature)
FunctionInfo 的构造方法。
name | 函数的名称
klass | 函数的类
signature | 函数的签名
英文文档：

FunctionInfo

public FunctionInfo(String name,
                    String klass,
                    String signature)
Constructor for FunctionInfo.

Parameters:
name - The name of the function
klass - The class of the function
signature - The signature of the function
Method Detail

public String getName()
函数的名称。
return 函数的名称
英文文档：

getName

public String getName()
The name of the function.

Returns:
The name of the function

public String getFunctionClass()
函数的类。
return 函数的类
英文文档：

getFunctionClass

public String getFunctionClass()
The class of the function.

Returns:
The class of the function

public String getFunctionSignature()
函数的签名。
return 函数的签名
英文文档：

getFunctionSignature

public String getFunctionSignature()
The signature of the function.

Returns:
The signature of the function
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JspFragment (Java EE 5)

javax.servlet.jsp.tagext
Class JspFragment

java.lang.Object
    extended by  javax.servlet.jsp.tagext.JspFragment

public abstract class JspFragment
extends Object

封装某个对象中的部分 JSP 代码，可以根据需要多次调用该对象。可使用 JSP 语法将 JSP 片段定义为 SimpleTag 处理程序调用的标记正文，或者定义为 <jsp:attribute> 标准操作的正文（该操作指定声明为片段或在 TLD 中类型为 JspFragment 的某个属性的值）。

JSP 片段的定义必须仅包含模板文本和 JSP 操作元素。换句话说，它不得包含 scriptlet 或 scriptlet 表达式。在转换期间，容器生成一个能够执行定义的片段的 JspFragment 抽象类实现。

标记处理程序可以不调用或多次调用片段，或者在返回之前将它传递给其他标记。要将值传递给 JSP 片段或从 JSP 片段中获取值，标记处理程序将在与该片段关联的 JspContext 中存储/获取值。

注意，标记库开发人员和页面作者不应手动生成 JspFragment 实现。

实现注意事项：不必为每个片段生成单独的类。一种可能的实现是为实现 JspFragment 的每个页面生成一个 helper 类。在构造时，可传递一个鉴别符来选择该实例将执行哪个片段。

since 2.0
英文文档：

Encapsulates a portion of JSP code in an object that can be invoked as many times as needed. JSP Fragments are defined using JSP syntax as the body of a tag for an invocation to a SimpleTag handler, or as the body of a <jsp:attribute> standard action specifying the value of an attribute that is declared as a fragment, or to be of type JspFragment in the TLD.

The definition of the JSP fragment must only contain template text and JSP action elements. In other words, it must not contain scriptlets or scriptlet expressions. At translation time, the container generates an implementation of the JspFragment abstract class capable of executing the defined fragment.

A tag handler can invoke the fragment zero or more times, or pass it along to other tags, before returning. To communicate values to/from a JSP fragment, tag handlers store/retrieve values in the JspContext associated with the fragment.

Note that tag library developers and page authors should not generate JspFragment implementations manually.

Implementation Note: It is not necessary to generate a separate class for each fragment. One possible implementation is to generate a single helper class for each page that implements JspFragment. Upon construction, a discriminator can be passed to select which fragment that instance will execute.

Since:
JSP 2.0

Constructor Summary
JspFragment()
Method Summary
abstract JspContext | getJspContext() Returns the JspContext that is bound to this JspFragment.
abstract void | invoke(Writer out) Executes the fragment and directs all output to the given Writer, or the JspWriter returned by the getOut() method of the JspContext associated with the fragment if out is null.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JspFragment()
英文文档：

JspFragment

public JspFragment()
Method Detail

abstract public void invoke(java.io.Writer out) throws JspException, java.io.IOException
执行该片段，并将所有输出定向到给定 Writer，如果 out 为 null，则将输出定向到与该片段关联的 JspContext 的 getOut() 方法返回的 JspWriter。
out | 将片段输出到的 Writer，如果应该将输出发送到 JspContext.getOut()，则该参数为 null。
Throws | JspException: 如果调用此片段时发生错误，则抛出此异常。
Throws | SkipPageException: 如果（直接或间接）调用了标记处理程序（该标记处理程序调用了此片段）的页面将停止求值，则抛出此异常。如果经典标记处理程序返回 Tag.SKIP_PAGE，或者简单标记处理程序抛出 SkipPageException，则容器必定抛出此异常。
Throws | java.io.IOException: 如果写入流时出现错误。
英文文档：

invoke

public abstract void invoke(Writer out)
                     throws JspException,
                            IOException
Executes the fragment and directs all output to the given Writer, or the JspWriter returned by the getOut() method of the JspContext associated with the fragment if out is null.

Parameters:
out - The Writer to output the fragment to, or null if output should be sent to JspContext.getOut().
Throws:
JspException - Thrown if an error occured while invoking this fragment.
SkipPageException - Thrown if the page that (either directly or indirectly) invoked the tag handler that invoked this fragment is to cease evaluation. The container must throw this exception if a Classic Tag Handler returned Tag.SKIP_PAGE or if a Simple Tag Handler threw SkipPageException.
IOException - If there was an error writing to the stream.

abstract public JspContext getJspContext()
返回绑定到此 JspFragment 的 JspContext。
return 在调用时此片段使用的 JspContext。
英文文档：

getJspContext

public abstract JspContext getJspContext()
Returns the JspContext that is bound to this JspFragment.

Returns:
The JspContext used by this fragment at invocation time.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PageData (Java EE 5)

javax.servlet.jsp.tagext
Class PageData

java.lang.Object
    extended by  javax.servlet.jsp.tagext.PageData

public abstract class PageData
extends Object

JSP 页面上的转换期间信息。该信息对应于 JSP 页面的 XML 视图。

此类对象由 JSP 转换器生成，例如，在被传递到 TagLibraryValidator 实例的时候。

英文文档：

Translation-time information on a JSP page. The information corresponds to the XML view of the JSP page.

Objects of this type are generated by the JSP translator, e.g. when being pased to a TagLibraryValidator instance.

Constructor Summary
PageData()
Sole constructor.
Method Summary
abstract  InputStream getInputStream()
Returns an input stream on the XML view of a JSP page.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public PageData()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

PageData

public PageData()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

abstract public java.io.InputStream getInputStream()
返回 JSP 页面的 XML 视图上的输入流。该流是用 UTF-8 编码的。记住，JSP 页面的 XML 视图扩展了 include 指令。
return 文档上的输入流。
英文文档：

getInputStream

public abstract InputStream getInputStream()
Returns an input stream on the XML view of a JSP page. The stream is encoded in UTF-8. Recall tht the XML view of a JSP page has the include directives expanded.

Returns:
An input stream on the document.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SimpleTagSupport (Java EE 5)

javax.servlet.jsp.tagext
Class SimpleTagSupport

java.lang.Object
    extended by  javax.servlet.jsp.tagext.SimpleTagSupport
All Implemented Interfaces:
JspTag, SimpleTag
public class SimpleTagSupport
extends Object
implements SimpleTag

Implements: SimpleTag

用来定义实现 SimpleTag 的标记处理程序的基类。

SimpleTagSupport 类是一个实用工具类，旨在用作新简单标记处理程序的基类。SimpleTagSupport 类实现 SimpleTag 接口，并添加了其他便捷方法，包括用于 SimpleTag 中属性的 getter 方法。

since 2.0
英文文档：

A base class for defining tag handlers implementing SimpleTag.

The SimpleTagSupport class is a utility class intended to be used as the base class for new simple tag handlers. The SimpleTagSupport class implements the SimpleTag interface and adds additional convenience methods including getter methods for the properties in SimpleTag.

Since:
JSP 2.0

Constructor Summary
SimpleTagSupport()
Sole constructor.
Method Summary
void | doTag() Default processing of the tag does nothing.
static JspTag | findAncestorWithClass(JspTag from, Class<?> klass) Find the instance of a given class type that is closest to a given instance.
protected JspFragment | getJspBody() Returns the body passed in by the container via setJspBody.
protected JspContext | getJspContext() Returns the page context passed in by the container via setJspContext.
JspTag | getParent() Returns the parent of this tag, for collaboration purposes.
void | setJspBody(JspFragment jspBody) Stores the provided JspFragment.
void | setJspContext(JspContext pc) Stores the provided JSP context in the private jspContext field.
void | setParent(JspTag parent) Sets the parent of this tag, for collaboration purposes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SimpleTagSupport()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

SimpleTagSupport

public SimpleTagSupport()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

public void doTag() throws JspException, java.io.IOException
标记的默认处理不执行任何操作。
Throws | JspException: 子类可以抛出 JspException，指示处理此标记时发生错误。
Throws | SkipPageException: 如果（直接或间接）调用此标记的页面停止求值。如果调用的经典标记处理程序返回 SKIP_PAGE，或者调用的简单标记处理程序抛出 SkipPageException，或者调用的 JSP 片段抛出 SkipPageException，则标记文件生成的简单标记处理程序必定抛出此异常。
Throws | java.io.IOException: 如果写入输出流时出现错误，子类可以抛出 IOException
See also | doTag()
英文文档：

doTag

public void doTag()
           throws JspException,
                  IOException
Default processing of the tag does nothing.

Specified by:
doTag in interface SimpleTag
Throws:
JspException - Subclasses can throw JspException to indicate an error occurred while processing this tag.
SkipPageException - If the page that (either directly or indirectly) invoked this tag is to cease evaluation. A Simple Tag Handler generated from a tag file must throw this exception if an invoked Classic Tag Handler returned SKIP_PAGE or if an invoked Simple Tag Handler threw SkipPageException or if an invoked Jsp Fragment threw a SkipPageException.
IOException - Subclasses can throw IOException if there was an error writing to the output stream
See Also:
SimpleTag.doTag()

public void setParent(JspTag parent)
为了进行协作，设置此标记的父标记。

仅当此标记调用嵌套在另一个标记调用中时，容器才调用此方法。

parent 封闭此标记的标记
英文文档：

setParent

public void setParent(JspTag parent)
Sets the parent of this tag, for collaboration purposes.

The container invokes this method only if this tag invocation is nested within another tag invocation.

Specified by:
setParent in interface SimpleTag
Parameters:
parent - the tag that encloses this tag

public JspTag getParent()
为了进行协作，返回此标记的父标记。
return 此标记的父标记
英文文档：

getParent

public JspTag getParent()
Returns the parent of this tag, for collaboration purposes.

Specified by:
getParent in interface SimpleTag
Returns:
the parent of this tag

public void setJspContext(JspContext pc)
在私有 jspContext 字段中存储提供的 JSP 上下文。子类可通过 getJspContext() 访问 JspContext。
pc | 此调用的页面上下文
See also | setJspContext
英文文档：

setJspContext

public void setJspContext(JspContext pc)
Stores the provided JSP context in the private jspContext field. Subclasses can access the JspContext via getJspContext().

Specified by:
setJspContext in interface SimpleTag
Parameters:
pc - the page context for this invocation
See Also:
SimpleTag.setJspContext(javax.servlet.jsp.JspContext)

protected JspContext getJspContext()
返回容器通过 setJspContext 传入的页面上下文。
return 此调用的页面上下文
英文文档：

getJspContext

protected JspContext getJspContext()
Returns the page context passed in by the container via setJspContext.

Returns:
the page context for this invocation

public void setJspBody(JspFragment jspBody)
存储提供的 JspFragment。
jspBody | 封装此标记正文的片段。如果页面的操作元素为空，则根本不调用此方法。
See also | setJspBody
英文文档：

setJspBody

public void setJspBody(JspFragment jspBody)
Stores the provided JspFragment.

Specified by:
setJspBody in interface SimpleTag
Parameters:
jspBody - The fragment encapsulating the body of this tag. If the action element is empty in the page, this method is not called at all.
See Also:
SimpleTag.setJspBody(javax.servlet.jsp.tagext.JspFragment)

protected JspFragment getJspBody()
返回容器通过 setJspBody 传入的正文。
return 封装此标记正文的片段，如果页面的操作元素为空，则返回 null。
英文文档：

getJspBody

protected JspFragment getJspBody()
Returns the body passed in by the container via setJspBody.

Returns:
the fragment encapsulating the body of this tag, or null if the action element is empty in the page.

final public static JspTag findAncestorWithClass(JspTag from, Class<T> klass)
查找最接近给定实例的给定类类型的实例。此方法使用来自 Tag 和/或 SimpleTag 接口的 getParent 方法。此方法用于协调各协作标记。

对于遍历祖先时遇到的每个 TagAdapter 实例，TagAdapter.getAdaptee() 返回的标记处理程序（而不是 TagAdpater 自身）都会与 klass 进行比较。如果标记处理程序匹配，则返回该标记处理程序，而不是返回它的 TagAdapter。

规范的当前版本仅提供一种正式方法指示标记处理程序的 observable 类型：其标记处理程序实现类，在标记元素的标记类子元素中描述。这可以通过一种非正式的方法扩展，即允许标记库作者在描述子元素中指示 observable 类型。该类型应该是标记处理程序实现类的子类型或者是 void 类型。支持特定标记库（比如 JSP 标准标记库）的专门化容器可以利用这一附加限制。

当标记库作者提供有关标记处理程序 observable 类型的信息时，客户端编程代码应该遵守该限制。具体地说，传递给 findAncestorWithClass 的类应该是 observable 类型的子类型。

from | 开始查找实例的位置。
klass | 将匹配的 JspTag 或接口的子类
return | 实现该接口的最接近的祖先，或者指定类的实例
英文文档：

findAncestorWithClass

public static final JspTag findAncestorWithClass(JspTag from,
                                                 Class<?> klass)
Find the instance of a given class type that is closest to a given instance. This method uses the getParent method from the Tag and/or SimpleTag interfaces. This method is used for coordination among cooperating tags.

For every instance of TagAdapter encountered while traversing the ancestors, the tag handler returned by TagAdapter.getAdaptee() - instead of the TagAdpater itself - is compared to klass. If the tag handler matches, it - and not its TagAdapter - is returned.

The current version of the specification only provides one formal way of indicating the observable type of a tag handler: its tag handler implementation class, described in the tag-class subelement of the tag element. This is extended in an informal manner by allowing the tag library author to indicate in the description subelement an observable type. The type should be a subtype of the tag handler implementation class or void. This addititional constraint can be exploited by a specialized container that knows about that specific tag library, as in the case of the JSP standard tag library.

When a tag library author provides information on the observable type of a tag handler, client programmatic code should adhere to that constraint. Specifically, the Class passed to findAncestorWithClass should be a subtype of the observable type.

Parameters:
from - The instance from where to start looking.
klass - The subclass of JspTag or interface to be matched
Returns:
the nearest ancestor that implements the interface or is an instance of the class specified
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagAdapter (Java EE 5)

javax.servlet.jsp.tagext
Class TagAdapter

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagAdapter
All Implemented Interfaces:
JspTag, Tag
public class TagAdapter
extends Object
implements Tag

Implements: Tag

包装任何 SimpleTag，并使用 Tag 接口公开它。此类用于支持经典标记处理程序与 SimpleTag 处理程序之间的协作。

因为 SimpleTag 没有扩展 Tag，并且因为 Tag.setParent() 只接受 Tag 实例，所以经典标记处理程序（实现 Tag 的经典标记处理程序）无法使 SimpleTag 成为其父标记。为了对此进行补救，可创建 TagAdapter 来包装 SimpleTag 父标记，并将适配器传递给 setParent()。经典标记处理程序可以调用 getAdaptee() 来获取已封装的 SimpleTag 实例。

since 2.0
英文文档：

Wraps any SimpleTag and exposes it using a Tag interface. This is used to allow collaboration between classic Tag handlers and SimpleTag handlers.

Because SimpleTag does not extend Tag, and because Tag.setParent() only accepts a Tag instance, a classic tag handler (one that implements Tag) cannot have a SimpleTag as its parent. To remedy this, a TagAdapter is created to wrap the SimpleTag parent, and the adapter is passed to setParent() instead. A classic Tag Handler can call getAdaptee() to retrieve the encapsulated SimpleTag instance.

Since:
JSP 2.0

Field Summary
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
TagAdapter(SimpleTag adaptee)
Creates a new TagAdapter that wraps the given SimpleTag and returns the parent tag when getParent() is called.
Method Summary
 int doEndTag()
Must not be called.
 int doStartTag()
Must not be called.
 JspTag getAdaptee()
Gets the tag that is being adapted to the Tag interface.
 Tag getParent()
Returns the parent of this tag, which is always getAdaptee().getParent().
 void release()
Must not be called.
 void setPageContext(PageContext pc)
Must not be called.
 void setParent(Tag parentTag)
Must not be called.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public TagAdapter(SimpleTag adaptee)
创建包装给定 SimpleTag 的新 TagAdapter，并在调用 getParent() 时返回父标记。
adaptee 将被适配为 Tag 的 SimpleTag。
英文文档：

TagAdapter

public TagAdapter(SimpleTag adaptee)
Creates a new TagAdapter that wraps the given SimpleTag and returns the parent tag when getParent() is called.

Parameters:
adaptee - The SimpleTag being adapted as a Tag.
Method Detail

public void setPageContext(PageContext pc)
不得调用。
pc | 忽略。
Throws | UnsupportedOperationException: 不得调用
英文文档：

setPageContext

public void setPageContext(PageContext pc)
Must not be called.

Specified by:
setPageContext in interface Tag
Parameters:
pc - ignored.
Throws:
UnsupportedOperationException - Must not be called

public void setParent(Tag parentTag)
不得调用。此标记的父标记始终是 getAdaptee().getParent()。
parentTag | 忽略。
Throws | UnsupportedOperationException: 不得调用。
英文文档：

setParent

public void setParent(Tag parentTag)
Must not be called. The parent of this tag is always getAdaptee().getParent().

Specified by:
setParent in interface Tag
Parameters:
parentTag - ignored.
Throws:
UnsupportedOperationException - Must not be called.

public Tag getParent()
返回此标记的父标记，该父标记始终是 getAdaptee().getParent()。 此父标记可能是封闭 Tag（如果 getAdaptee().getParent() 实现了 Tag），也可能是封闭 Tag 的适配器（如果 getAdaptee().getParent() 没有实现 Tag）。
return 将被适配的标记的父标记。
英文文档：

getParent

public Tag getParent()
Returns the parent of this tag, which is always getAdaptee().getParent(). This will either be the enclosing Tag (if getAdaptee().getParent() implements Tag), or an adapter to the enclosing Tag (if getAdaptee().getParent() does not implement Tag).

Specified by:
getParent in interface Tag
Returns:
The parent of the tag being adapted.
See Also:
TagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.Tag, java.lang.Class)

public JspTag getAdaptee()
获取将被适配到 Tag 接口的标记。在 JSP 2.0 中，此标记应该是 SimpleTag 实例，但为以后规范版本中的其他种类的标记保留了空间。
return 将被适配的标记
英文文档：

getAdaptee

public JspTag getAdaptee()
Gets the tag that is being adapted to the Tag interface. This should be an instance of SimpleTag in JSP 2.0, but room is left for other kinds of tags in future spec versions.

Returns:
the tag that is being adapted

public int doStartTag() throws JspException
不得调用。
return | 总是抛出 UnsupportedOperationException
Throws | UnsupportedOperationException: 不得调用
Throws | JspException: 不会抛出
英文文档：

doStartTag

public int doStartTag()
               throws JspException
Must not be called.

Specified by:
doStartTag in interface Tag
Returns:
always throws UnsupportedOperationException
Throws:
UnsupportedOperationException - Must not be called
JspException - never thrown
See Also:
BodyTag

public int doEndTag() throws JspException
不得调用。
return | 总是抛出 UnsupportedOperationException
Throws | UnsupportedOperationException: 不得调用
Throws | JspException: 不会抛出
英文文档：

doEndTag

public int doEndTag()
             throws JspException
Must not be called.

Specified by:
doEndTag in interface Tag
Returns:
always throws UnsupportedOperationException
Throws:
UnsupportedOperationException - Must not be called
JspException - never thrown

public void release()
不得调用。
Throws UnsupportedOperationException: 不得调用
英文文档：

release

public void release()
Must not be called.

Specified by:
release in interface Tag
Throws:
UnsupportedOperationException - Must not be called
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagAttributeInfo (Java EE 5)

javax.servlet.jsp.tagext
Class TagAttributeInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagAttributeInfo

public class TagAttributeInfo
extends Object

有关 Tag 属性的信息，此类在转换期间可用。此类是根据标记库描述符文件 (TLD) 实例化的。

这里仅包含生成代码所需的信息。其他信息（比如用于验证的 SCHEMA）属于其他地方。

英文文档：

Information on the attributes of a Tag, available at translation time. This class is instantiated from the Tag Library Descriptor file (TLD).

Only the information needed to generate code is included here. Other information like SCHEMA for validation belongs elsewhere.

Note from the Expert Group:
This should have been designed as an interface. Every time we change the TLD, we need to add a new constructor to this class (not good). This class should only be instantiated by container implementations (not by JSP developers).

Field Summary
static String ID
"id" is wired in to be ID.
Constructor Summary
TagAttributeInfo(String name, boolean required, String type, boolean reqTime)
Constructor for TagAttributeInfo.
TagAttributeInfo(String name, boolean required, String type, boolean reqTime, boolean fragment)
JSP 2.0 Constructor for TagAttributeInfo.
TagAttributeInfo(String name, boolean required, String type, boolean reqTime, boolean fragment, String description, boolean deferredValue, boolean deferredMethod, String expectedTypeName, String methodSignature)
JSP 2.1 Constructor for TagAttributeInfo.
Method Summary
boolean | canBeRequestTime() Whether this attribute has been specified in the TLD as rtexprvalue.
String | getDescription() Gets the description string of this tag attribute.
String | getExpectedTypeName() Returns the name of the expected type (as a String) of this deferred value attribute.
static TagAttributeInfo | getIdAttribute(TagAttributeInfo[] a) Convenience static method that goes through an array of TagAttributeInfo objects and looks for "id".
String | getMethodSignature() Returns the expected method signature of this deferred method attribute.
String | getName() The name of this attribute.
String | getTypeName() The type (as a String) of this attribute.
boolean | isDeferredMethod() Returns true if this attribute is to be passed a MethodExpression so that expression evaluation can be deferred.
boolean | isDeferredValue() Returns true if this attribute is to be passed a ValueExpression so that expression evaluation can be deferred.
boolean | isFragment() Whether this attribute is of type JspFragment.
boolean | isRequired() Whether this attribute is required.
String | toString() Returns a String representation of this TagAttributeInfo, suitable for debugging purposes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

ID

public static final String ID
"id" is wired in to be ID. There is no real benefit in having it be something else IDREFs are not handled any differently.

See Also:
Constant Field Values
Constructor Detail

public TagAttributeInfo(String name, boolean required, String type, boolean reqTime)
TagAttributeInfo 的构造方法。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。
name | 属性名称。
required | 标记实例是否需要此属性。
type | 属性类型的名称。
reqTime | 此属性是否包含请求期间属性。
英文文档：

TagAttributeInfo

public TagAttributeInfo(String name,
                        boolean required,
                        String type,
                        boolean reqTime)
Constructor for TagAttributeInfo. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor).

Parameters:
name - The name of the attribute.
required - If this attribute is required in tag instances.
type - The name of the type of the attribute.
reqTime - Whether this attribute holds a request-time Attribute.

public TagAttributeInfo(String name, boolean required, String type, boolean reqTime, boolean fragment)
TagAttributeInfo 的 JSP 2.0 构造方法。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。
name | 属性名称。
required | 标记实例是否需要此属性。
type | 属性类型的名称。
reqTime | 此属性是否包含请求期间属性。
fragment | 此属性的类型是否为 JspFragment
since | 2.0
英文文档：

TagAttributeInfo

public TagAttributeInfo(String name,
                        boolean required,
                        String type,
                        boolean reqTime,
                        boolean fragment)
JSP 2.0 Constructor for TagAttributeInfo. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor).

Parameters:
name - The name of the attribute.
required - If this attribute is required in tag instances.
type - The name of the type of the attribute.
reqTime - Whether this attribute holds a request-time Attribute.
fragment - Whether this attribute is of type JspFragment
Since:
JSP 2.0

英文文档：

TagAttributeInfo

public TagAttributeInfo(String name,
                        boolean required,
                        String type,
                        boolean reqTime,
                        boolean fragment,
                        String description,
                        boolean deferredValue,
                        boolean deferredMethod,
                        String expectedTypeName,
                        String methodSignature)
JSP 2.1 Constructor for TagAttributeInfo. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor).

Parameters:
name - The name of the attribute.
required - If this attribute is required in tag instances.
type - The name of the type of the attribute.
reqTime - Whether this attribute holds a request-time Attribute.
fragment - Whether this attribute is of type JspFragment
description - The description of the attribute.
deferredValue - Whether this attribute is a deferred value.
deferredMethod - Whether this attribute is a deferred method. rtexpr or deferred value.
expectedTypeName - The name of the expected type of this deferred value (or null if this is not a deferred value).
methodSignature - The expected method signature of this deferred method (or null if this is not a deferred method).
Since:
JSP 2.1
Method Detail

public String getName()
此属性的名称。
return 属性的名称
英文文档：

getName

public String getName()
The name of this attribute.

Returns:
the name of the attribute

public String getTypeName()
此属性的类型（作为 String）。
return 属性的类型
英文文档：

getTypeName

public String getTypeName()
The type (as a String) of this attribute.

This method must return "javax.el.ValueExpression" if isDeferredValue() returns true and canBeRequestTime() returns false. It must return "javax.el.MethodExpression" if isDeferredMethod() returns true. It must return "java.lang.Object" if isDeferredValue() returns true and canBeRequestTime() returns true.

Returns:
the type of the attribute

public boolean canBeRequestTime()
此属性是否能包含请求期间值。
return 属性是否能包含请求期间值。
英文文档：

canBeRequestTime

public boolean canBeRequestTime()
Whether this attribute has been specified in the TLD as rtexprvalue. If true, this means the attribute can hold a request-time value.

Returns:
true if the attribute has been specified in the TLD as rtexprvalue

public boolean isRequired()
此属性是否是必需的。
return 属性是否是必需的。
英文文档：

isRequired

public boolean isRequired()
Whether this attribute is required.

Returns:
if the attribute is required.

public static TagAttributeInfo getIdAttribute(TagAttributeInfo[] a)
遍历 TagAttributeInfo 对象数组并查找 "id" 的便捷静态方法。
a | TagAttributeInfo 数组
return | 名称为 "id" 的 TagAttributeInfo 引用
英文文档：

getIdAttribute

public static TagAttributeInfo getIdAttribute(TagAttributeInfo[] a)
Convenience static method that goes through an array of TagAttributeInfo objects and looks for "id".

Parameters:
a - An array of TagAttributeInfo
Returns:
The TagAttributeInfo reference with name "id"

public boolean isFragment()
此属性的类型是否为 JspFragment。
return | 属性的类型是否为 JspFragment
since | 2.0
英文文档：

isFragment

public boolean isFragment()
Whether this attribute is of type JspFragment.

Returns:
if the attribute is of type JspFragment
Since:
JSP 2.0

英文文档：

getDescription

public String getDescription()
Gets the description string of this tag attribute.

Returns:
the description string of this tag attribute

英文文档：

isDeferredValue

public boolean isDeferredValue()
Returns true if this attribute is to be passed a ValueExpression so that expression evaluation can be deferred.

If this method returns true, then getTypeName() must return "javax.el.ValueExpression".

The getExpectedType() method can be used to retrieve the expected type this value expression will be constructed with.

Returns:
true if this attribute accepts a deferred value; false otherwise.
Since:
JSP 2.1

英文文档：

isDeferredMethod

public boolean isDeferredMethod()
Returns true if this attribute is to be passed a MethodExpression so that expression evaluation can be deferred.

If this method returns true, then getTypeName() must return "javax.el.MethodExpression".

The getMethodSignature() method can be used to retrieve the expected method signature this method expression will be constructed with.

Returns:
true if this attribute accepts a deferred method; false otherwise.
Since:
JSP 2.1

英文文档：

getExpectedTypeName

public String getExpectedTypeName()
Returns the name of the expected type (as a String) of this deferred value attribute.

This method returns null if isDeferredValue() returns false.

Returns:
the name of the expected type
Since:
JSP 2.1

英文文档：

getMethodSignature

public String getMethodSignature()
Returns the expected method signature of this deferred method attribute.

This method returns null if isDeferredMethod() returns false.

Returns:
the method signature
Since:
JSP 2.1

public String toString()
返回此 TagAttributeInfo 的 String 表示形式，适用于调试目的。
return 此 TagAttributeInfo 的 String 表示形式
英文文档：

toString

public String toString()
Returns a String representation of this TagAttributeInfo, suitable for debugging purposes.

Overrides:
toString in class Object
Returns:
a String representation of this TagAttributeInfo
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagData (Java EE 5)

javax.servlet.jsp.tagext
Class TagData

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagData
All Implemented Interfaces:
Cloneable
public class TagData
extends Object
implements Cloneable

Implements: Cloneable

标记实例的（仅转换期间的）属性/值信息。

TagData 仅用作 TagExtraInfo 的 isValid、validate 和 getVariableInfo 方法的参数，这些方法在转换期间调用。

英文文档：

The (translation-time only) attribute/value information for a tag instance.

TagData is only used as an argument to the isValid, validate, and getVariableInfo methods of TagExtraInfo, which are invoked at translation time.

Field Summary
static Object REQUEST_TIME_VALUE
Distinguished value for an attribute to indicate its value is a request-time expression (which is not yet available because TagData instances are used at translation-time).
Constructor Summary
TagData(Hashtable<String,Object> attrs)
Constructor for a TagData.
TagData(Object[][] atts)
Constructor for TagData.
Method Summary
Object | getAttribute(String attName) The value of the attribute.
Enumeration<String> | getAttributes() Enumerates the attributes.
String | getAttributeString(String attName) Get the value for a given attribute.
String | getId() The value of the tag's id attribute.
void | setAttribute(String attName, Object value) Set the value of an attribute.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

REQUEST_TIME_VALUE

public static final Object REQUEST_TIME_VALUE
Distinguished value for an attribute to indicate its value is a request-time expression (which is not yet available because TagData instances are used at translation-time).

Constructor Detail

public TagData(Object[][] atts)
TagData 的构造方法。

典型的构造方法可能是

static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}};
static final TagData td = new TagData(att);
除了包含标识对象 REQUEST_TIME_VALUE 的那些值之外，其他所有值都必须是 String。
atts 静态属性和值。可以为 null。
英文文档：

TagData

public TagData(Object[][] atts)
Constructor for TagData.

A typical constructor may be

 static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}};
 static final TagData td = new TagData(att);
All values must be Strings except for those holding the distinguished object REQUEST_TIME_VALUE.

Parameters:
atts - the static attribute and values. May be null.

public TagData(java.util.Hashtable<K, V> attrs)
TagData 的构造方法。 如果哈希表中已经有属性了，则使用此构造方法。
attrs 可从中获取值的哈希表。
英文文档：

TagData

public TagData(Hashtable<String,Object> attrs)
Constructor for a TagData. If you already have the attributes in a hashtable, use this constructor.

Parameters:
attrs - A hashtable to get the values from.
Method Detail

public String getId()
标记的 id 属性的值。
return 标记的 id 属性的值，如果未指定这类属性，则返回 null。
英文文档：

getId

public String getId()
The value of the tag's id attribute.

Returns:
the value of the tag's id attribute, or null if no such attribute was specified.

public Object getAttribute(String attName)
属性的值。如果为接受请求期间属性表达式的属性指定了一个静态值，则返回该静态值，即使在 操作的正文中提供了该值。如果该值被指定为请求期间属性表达式，或者通过 <jsp:attribute> 操作使用包含动态内容（scriptlet、脚本表达式、EL 表达式、标准操作或自定义操作）的正文指定了该值，则仅返回标识对象 REQUEST_TIME_VALUE。如果未设置属性，则返回 null。
attName | 属性的名称
return | 属性的值
英文文档：

getAttribute

public Object getAttribute(String attName)
The value of the attribute. If a static value is specified for an attribute that accepts a request-time attribute expression then that static value is returned, even if the value is provided in the body of a <jsp:attribute> action. The distinguished object REQUEST_TIME_VALUE is only returned if the value is specified as a request-time attribute expression or via the <jsp:attribute> action with a body that contains dynamic content (scriptlets, scripting expressions, EL expressions, standard actions, or custom actions). Returns null if the attribute is not set.

Parameters:
attName - the name of the attribute
Returns:
the attribute's value

public void setAttribute(String attName, Object value)
设置属性的值。
attName | 属性的名称
value | 值。
英文文档：

setAttribute

public void setAttribute(String attName,
                         Object value)
Set the value of an attribute.

Parameters:
attName - the name of the attribute
value - the value.

public String getAttributeString(String attName)
获取给定属性的值。
attName | 属性的名称
return | 属性值字符串
Throws | ClassCastException: 如果属性值不是 String
英文文档：

getAttributeString

public String getAttributeString(String attName)
Get the value for a given attribute.

Parameters:
attName - the name of the attribute
Returns:
the attribute value string
Throws:
ClassCastException - if attribute value is not a String

public java.util.Enumeration<E> getAttributes()
枚举属性。
return TagData 中属性的枚举
英文文档：

getAttributes

public Enumeration<String> getAttributes()
Enumerates the attributes.

Returns:
An enumeration of the attributes in a TagData
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagExtraInfo (Java EE 5)

javax.servlet.jsp.tagext
Class TagExtraInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagExtraInfo

public abstract class TagExtraInfo
extends Object

标记库作者提供的可选类，用于描述 TLD 中没有描述的其他转换期间信息。标记库描述符文件 (TLD) 中提到过 TagExtraInfo 类。

此类可用于：

  • 指示标记定义了脚本变量
  • 执行标记属性的转换期间验证。

JSP 转换器负责使调用 getTagInfo() 返回的初始值对应于将被转换的标记的 TagInfo 对象。如果对 setTagInfo() 进行显式调用，则传递的对象将在 getTagInfo() 的后续调用中返回。

影响 getTagInfo() 返回的值的唯一方式是通过 setTagInfo() 调用，因此将通过 JSP 转换器使用对应于将被转换的标记的 TagInfo 对象调用 TagExtraInfo.setTagInfo()。该调用应该发生在任何 validate() 调用和任何 getVariableInfo() 调用之前。

注：如果 TLD 中的标记定义如下：一个或多个变量子元素拥有的关联 TagExtraInfo 实现所返回的 VariableInfo 调用 getVariableInfo() 将返回一个或多个元素，那么这是一个（转换期间）错误。

英文文档：

Optional class provided by the tag library author to describe additional translation-time information not described in the TLD. The TagExtraInfo class is mentioned in the Tag Library Descriptor file (TLD).

This class can be used:

  • to indicate that the tag defines scripting variables
  • to perform translation-time validation of the tag attributes.

It is the responsibility of the JSP translator that the initial value to be returned by calls to getTagInfo() corresponds to a TagInfo object for the tag being translated. If an explicit call to setTagInfo() is done, then the object passed will be returned in subsequent calls to getTagInfo().

The only way to affect the value returned by getTagInfo() is through a setTagInfo() call, and thus, TagExtraInfo.setTagInfo() is to be called by the JSP translator, with a TagInfo object that corresponds to the tag being translated. The call should happen before any invocation on validate() and before any invocation on getVariableInfo().

NOTE: It is a (translation time) error for a tag definition in a TLD with one or more variable subelements to have an associated TagExtraInfo implementation that returns a VariableInfo array with one or more elements from a call to getVariableInfo().

Constructor Summary
TagExtraInfo()
Sole constructor.
Method Summary
TagInfo | getTagInfo() Get the TagInfo for this class.
VariableInfo[] | getVariableInfo(TagData data) information on scripting variables defined by the tag associated with this TagExtraInfo instance.
boolean | isValid(TagData data) Translation-time validation of the attributes.
void | setTagInfo(TagInfo tagInfo) Set the TagInfo for this class.
ValidationMessage[] | validate(TagData data) Translation-time validation of the attributes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public TagExtraInfo()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

TagExtraInfo

public TagExtraInfo()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

public VariableInfo[] getVariableInfo(TagData data)
与此 TagExtraInfo 实例关联的由标记定义的脚本变量的信息。请求期间属性通过 TagData 参数的值指定。
data | TagData 实例。
return | VariableInfo 数据数组，如果没有要定义的脚本变量，则返回 null 或长度为 0 的数组。
英文文档：

getVariableInfo

public VariableInfo[] getVariableInfo(TagData data)
information on scripting variables defined by the tag associated with this TagExtraInfo instance. Request-time attributes are indicated as such in the TagData parameter.

Parameters:
data - The TagData instance.
Returns:
An array of VariableInfo data, or null or a zero length array if no scripting variables are to be defined.

public boolean isValid(TagData data)
属性的转换期间验证。请求期间属性通过 TagData 参数的值指定。注意，执行验证的首选方式是使用 validate() 方法，因为它可以返回更详细的信息。
data | TagData 实例。
return | 此标记实例是否有效。
See also | validate
英文文档：

isValid

public boolean isValid(TagData data)
Translation-time validation of the attributes. Request-time attributes are indicated as such in the TagData parameter. Note that the preferred way to do validation is with the validate() method, since it can return more detailed information.

Parameters:
data - The TagData instance.
Returns:
Whether this tag instance is valid.
See Also:
validate(javax.servlet.jsp.tagext.TagData)

public ValidationMessage[] validate(TagData data)
属性的转换期间验证。请求期间属性通过 TagData 参数的值指定。因为可能提供更高质量的验证消息，所以这是执行验证的首选方式（尽管 isValid() 仍然有效）。

JSP 2.0 和更高版本的容器将调用 validate()，而不是 isValid()。此方法的默认实现是调用 isValid()。如果 isValid() 返回 false，则返回指示 isValid() 返回 false 的一般 ValidationMessage[]。

data | TagData 实例。
return | 一个 null 对象，如果没有错误，则返回长度为 0 的数组，否则返回 ValidationMessage 数组。
since | 2.0
英文文档：

validate

public ValidationMessage[] validate(TagData data)
Translation-time validation of the attributes. Request-time attributes are indicated as such in the TagData parameter. Because of the higher quality validation messages possible, this is the preferred way to do validation (although isValid() still works).

JSP 2.0 and higher containers call validate() instead of isValid(). The default implementation of this method is to call isValid(). If isValid() returns false, a generic ValidationMessage[] is returned indicating isValid() returned false.

Parameters:
data - The TagData instance.
Returns:
A null object, or zero length array if no errors, an array of ValidationMessages otherwise.
Since:
JSP 2.0

final public void setTagInfo(TagInfo tagInfo)
设置此类的 TagInfo。
tagInfo 此实例要扩展的 TagInfo
英文文档：

setTagInfo

public final void setTagInfo(TagInfo tagInfo)
Set the TagInfo for this class.

Parameters:
tagInfo - The TagInfo this instance is extending

final public TagInfo getTagInfo()
获取此类的 TagInfo。
return 此实例要扩展的 taginfo 实例
英文文档：

getTagInfo

public final TagInfo getTagInfo()
Get the TagInfo for this class.

Returns:
the taginfo instance this instance is extending
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagFileInfo (Java EE 5)

javax.servlet.jsp.tagext
Class TagFileInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagFileInfo

public class TagFileInfo
extends Object

标记库中某个标记文件的标记信息；此类是根据标记库描述符文件 (TLD) 实例化的，仅在转换期间可用。
since 2.0
英文文档：

Tag information for a tag file in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.

Since:
JSP 2.0

Constructor Summary
TagFileInfo(String name, String path, TagInfo tagInfo)
Constructor for TagFileInfo from data in the JSP 2.0 format for TLD.
Method Summary
String | getName() The unique action name of this tag.
String | getPath() Where to find the .tag file implementing this action.
TagInfo | getTagInfo() Returns information about this tag, parsed from the directives in the tag file.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public TagFileInfo(String name, String path, TagInfo tagInfo)
TagFileInfo 的构造方法，可构造用于 JSP 2.0 格式的 TLD 数据的 TagFileInfo。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。 注意，因为 TagLibibraryInfo 同时反映了 TLD 信息和 taglib 指令信息，所以 TagFileInfo 实例取决于 taglib 指令。这可能是一个设计错误，将来可能会修复。
name | 此标记的唯一操作名称
path | 找到实现此操作的 .tag 文件的路径，相对于 TLD 文件的位置。
tagInfo | 关于此标记的详细信息，这些信息是根据标记文件中的指令进行解析的。
英文文档：

TagFileInfo

public TagFileInfo(String name,
                   String path,
                   TagInfo tagInfo)
Constructor for TagFileInfo from data in the JSP 2.0 format for TLD. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor). Note that, since TagLibibraryInfo reflects both TLD information and taglib directive information, a TagFileInfo instance is dependent on a taglib directive. This is probably a design error, which may be fixed in the future.

Parameters:
name - The unique action name of this tag
path - Where to find the .tag file implementing this action, relative to the location of the TLD file.
tagInfo - The detailed information about this tag, as parsed from the directives in the tag file.
Method Detail

public String getName()
此标记的唯一操作名称。
return 标记的（短）名称。
英文文档：

getName

public String getName()
The unique action name of this tag.

Returns:
The (short) name of the tag.

public String getPath()
找到实现此操作的 .tag 文件的路径。
return 标记文件的路径，该路径相对于 TLD，如果在隐式标记文件中定义了该标记文件，则返回 "."。
英文文档：

getPath

public String getPath()
Where to find the .tag file implementing this action.

Returns:
The path of the tag file, relative to the TLD, or "." if the tag file was defined in an implicit tag file.

public TagInfo getTagInfo()
返回关于此标记的信息，这些信息是根据标记文件中的指令进行解析的。
return 包含关于此标记的信息的 TagInfo 对象
英文文档：

getTagInfo

public TagInfo getTagInfo()
Returns information about this tag, parsed from the directives in the tag file.

Returns:
a TagInfo object containing information about this tag
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagInfo (Java EE 5)

javax.servlet.jsp.tagext
Class TagInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagInfo

public class TagInfo
extends Object

标记库中某个标记的标记信息；此类是根据标记库描述符文件 (TLD) 实例化的，仅在转换期间可用。
英文文档：

Tag information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.

Field Summary
static String | BODY_CONTENT_EMPTY Static constant for getBodyContent() when it is empty.
static String | BODY_CONTENT_JSP Static constant for getBodyContent() when it is JSP.
static String | BODY_CONTENT_SCRIPTLESS Static constant for getBodyContent() when it is scriptless.
static String | BODY_CONTENT_TAG_DEPENDENT Static constant for getBodyContent() when it is Tag dependent.
Constructor Summary
TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo)
Constructor for TagInfo from data in the JSP 1.1 format for TLD.
TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi)
Constructor for TagInfo from data in the JSP 1.2 format for TLD.
TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi, boolean dynamicAttributes)
Constructor for TagInfo from data in the JSP 2.0 format for TLD.
Method Summary
TagAttributeInfo[] | getAttributes() Attribute information (in the TLD) on this tag.
String | getBodyContent() The bodycontent information for this tag.
String | getDisplayName() Get the displayName.
String | getInfoString() The information string for the tag.
String | getLargeIcon() Get the path to the large icon.
String | getSmallIcon() Get the path to the small icon.
String | getTagClassName() Name of the class that provides the handler for this tag.
TagExtraInfo | getTagExtraInfo() The instance (if any) for extra tag information.
TagLibraryInfo | getTagLibrary() The instance of TabLibraryInfo we belong to.
String | getTagName() The name of the Tag.
TagVariableInfo[] | getTagVariableInfos() Get TagVariableInfo objects associated with this TagInfo.
VariableInfo[] | getVariableInfo(TagData data) Information on the scripting objects created by this tag at runtime.
boolean | hasDynamicAttributes() Get dynamicAttributes associated with this TagInfo.
boolean | isValid(TagData data) Translation-time validation of the attributes.
void | setTagExtraInfo(TagExtraInfo tei) Set the instance for extra tag information.
void | setTagLibrary(TagLibraryInfo tl) Set the TagLibraryInfo property.
ValidationMessage[] | validate(TagData data) Translation-time validation of the attributes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

BODY_CONTENT_JSP

public static final String BODY_CONTENT_JSP
Static constant for getBodyContent() when it is JSP.

See Also:
Constant Field Values

英文文档：

BODY_CONTENT_TAG_DEPENDENT

public static final String BODY_CONTENT_TAG_DEPENDENT
Static constant for getBodyContent() when it is Tag dependent.

See Also:
Constant Field Values

英文文档：

BODY_CONTENT_EMPTY

public static final String BODY_CONTENT_EMPTY
Static constant for getBodyContent() when it is empty.

See Also:
Constant Field Values

英文文档：

BODY_CONTENT_SCRIPTLESS

public static final String BODY_CONTENT_SCRIPTLESS
Static constant for getBodyContent() when it is scriptless.

Since:
JSP 2.0
See Also:
Constant Field Values
Constructor Detail

public TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo)
TagInfo 的构造方法，该 TagInfo 来自 JSP 1.1 格式的 TLD 中的数据。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。 注意，因为 TagLibibraryInfo 同时反映了 TLD 信息和 taglib 指令信息，所以 TagInfo 实例取决于 taglib 指令。这可能是一个设计错误，将来可能会修复。
tagName | 此标记的名称
tagClassName | 标记处理程序类的名称
bodycontent | 有关这些标记正文内容的信息
infoString | 此标记的（可选）字符串信息
taglib | 包含我们的标记库实例。
tagExtraInfo | 提供附加标记信息的实例。可以为 null
attributeInfo | 描述符中的 AttributeInfo 数据数组。可以为 null。
英文文档：

TagInfo

public TagInfo(String tagName,
               String tagClassName,
               String bodycontent,
               String infoString,
               TagLibraryInfo taglib,
               TagExtraInfo tagExtraInfo,
               TagAttributeInfo[] attributeInfo)
Constructor for TagInfo from data in the JSP 1.1 format for TLD. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor). Note that, since TagLibibraryInfo reflects both TLD information and taglib directive information, a TagInfo instance is dependent on a taglib directive. This is probably a design error, which may be fixed in the future.

Parameters:
tagName - The name of this tag
tagClassName - The name of the tag handler class
bodycontent - Information on the body content of these tags
infoString - The (optional) string information for this tag
taglib - The instance of the tag library that contains us.
tagExtraInfo - The instance providing extra Tag info. May be null
attributeInfo - An array of AttributeInfo data from descriptor. May be null;

public TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi)
TagInfo 的构造方法，该 TagInfo 来自 JSP 1.2 格式的 TLD 中的数据。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。 注意，因为 TagLibibraryInfo 同时反映了 TLD 信息和 taglib 指令信息，所以 TagInfo 实例取决于 taglib 指令。这可能是一个设计错误，将来可能会修复。
tagName | 此标记的名称
tagClassName | 标记处理程序类的名称
bodycontent | 有关这些标记正文内容的信息
infoString | 此标记的（可选）字符串信息
taglib | 包含我们的标记库实例。
tagExtraInfo | 提供附加标记信息的实例。可以为 null
attributeInfo | 描述符中的 AttributeInfo 数据数组。可以为 null。
displayName | 通过工具显示的短名称
smallIcon | 指向通过工具显示的小图标的路径
largeIcon | 指向通过工具显示的大图标的路径
tvi | TagVariableInfo 的数组（或者为 null）
英文文档：

TagInfo

public TagInfo(String tagName,
               String tagClassName,
               String bodycontent,
               String infoString,
               TagLibraryInfo taglib,
               TagExtraInfo tagExtraInfo,
               TagAttributeInfo[] attributeInfo,
               String displayName,
               String smallIcon,
               String largeIcon,
               TagVariableInfo[] tvi)
Constructor for TagInfo from data in the JSP 1.2 format for TLD. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor). Note that, since TagLibibraryInfo reflects both TLD information and taglib directive information, a TagInfo instance is dependent on a taglib directive. This is probably a design error, which may be fixed in the future.

Parameters:
tagName - The name of this tag
tagClassName - The name of the tag handler class
bodycontent - Information on the body content of these tags
infoString - The (optional) string information for this tag
taglib - The instance of the tag library that contains us.
tagExtraInfo - The instance providing extra Tag info. May be null
attributeInfo - An array of AttributeInfo data from descriptor. May be null;
displayName - A short name to be displayed by tools
smallIcon - Path to a small icon to be displayed by tools
largeIcon - Path to a large icon to be displayed by tools
tvi - An array of a TagVariableInfo (or null)

public TagInfo(String tagName, String tagClassName, String bodycontent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi, boolean dynamicAttributes)
TagInfo 的构造方法，该 TagInfo 来自 JSP 2.0 格式的 TLD 中的数据。此类只能通过某些解析 TLD (Tag Library Descriptor) 的 JSP 代码所请求的 TagLibrary 代码进行实例化。 注意，因为 TagLibibraryInfo 同时反映了 TLD 信息和 taglib 指令信息，所以 TagInfo 实例取决于 taglib 指令。这可能是一个设计错误，将来可能会修复。
tagName | 此标记的名称
tagClassName | 标记处理程序类的名称
bodycontent | 有关这些标记正文内容的信息
infoString | 此标记的（可选）字符串信息
taglib | 包含我们的标记库实例。
tagExtraInfo | 提供附加标记信息的实例。可以为 null
attributeInfo | 描述符中的 AttributeInfo 数据数组。可以为 null。
displayName | 通过工具显示的短名称
smallIcon | 指向通过工具显示的小图标的路径
largeIcon | 指向通过工具显示的大图标的路径
tvi | TagVariableInfo 的数组（或者为 null）
dynamicAttributes | 如果支持动态属性，则该参数为 true
since | 2.0
英文文档：

TagInfo

public TagInfo(String tagName,
               String tagClassName,
               String bodycontent,
               String infoString,
               TagLibraryInfo taglib,
               TagExtraInfo tagExtraInfo,
               TagAttributeInfo[] attributeInfo,
               String displayName,
               String smallIcon,
               String largeIcon,
               TagVariableInfo[] tvi,
               boolean dynamicAttributes)
Constructor for TagInfo from data in the JSP 2.0 format for TLD. This class is to be instantiated only from the TagLibrary code under request from some JSP code that is parsing a TLD (Tag Library Descriptor). Note that, since TagLibibraryInfo reflects both TLD information and taglib directive information, a TagInfo instance is dependent on a taglib directive. This is probably a design error, which may be fixed in the future.

Parameters:
tagName - The name of this tag
tagClassName - The name of the tag handler class
bodycontent - Information on the body content of these tags
infoString - The (optional) string information for this tag
taglib - The instance of the tag library that contains us.
tagExtraInfo - The instance providing extra Tag info. May be null
attributeInfo - An array of AttributeInfo data from descriptor. May be null;
displayName - A short name to be displayed by tools
smallIcon - Path to a small icon to be displayed by tools
largeIcon - Path to a large icon to be displayed by tools
tvi - An array of a TagVariableInfo (or null)
dynamicAttributes - True if supports dynamic attributes
Since:
JSP 2.0
Method Detail

public String getTagName()
Tag 的名称。
return 标记的（短）名称。
英文文档：

getTagName

public String getTagName()
The name of the Tag.

Returns:
The (short) name of the tag.

public TagAttributeInfo[] getAttributes()
关于此标记的属性信息（在 TLD 中）。返回 TLD 中指示的描述此标记属性的数组。
return 此标记的 TagAttributeInfo 的数组，如果该标记没有属性，则返回长度为 0 的数组。
英文文档：

getAttributes

public TagAttributeInfo[] getAttributes()
Attribute information (in the TLD) on this tag. The return is an array describing the attributes of this tag, as indicated in the TLD.

Returns:
The array of TagAttributeInfo for this tag, or a zero-length array if the tag has no attributes.

public VariableInfo[] getVariableInfo(TagData data)
关于此标记在运行时创建的脚本对象的信息。这是用于关联的 TagExtraInfo 类的便捷方法。
data | 描述此操作的 TagData。
return | 如果 TagExtraInfo 对象与此 TagInfo 关联，则返回调用 getTagExtraInfo().getVariableInfo( data ) 的结果，否则返回 null。
英文文档：

getVariableInfo

public VariableInfo[] getVariableInfo(TagData data)
Information on the scripting objects created by this tag at runtime. This is a convenience method on the associated TagExtraInfo class.

Parameters:
data - TagData describing this action.
Returns:
if a TagExtraInfo object is associated with this TagInfo, the result of getTagExtraInfo().getVariableInfo( data ), otherwise null.

public boolean isValid(TagData data)
属性的转换期间验证。这是用于关联的 TagExtraInfo 类的便捷方法。
data | 转换期间 TagData 实例。
return | 数据是否有效。
英文文档：

isValid

public boolean isValid(TagData data)
Translation-time validation of the attributes. This is a convenience method on the associated TagExtraInfo class.

Parameters:
data - The translation-time TagData instance.
Returns:
Whether the data is valid.

public ValidationMessage[] validate(TagData data)
属性的转换期间验证。这是用于关联的 TagExtraInfo 类的便捷方法。
data | 转换期间 TagData 实例。
return | 一个 null 对象，如果没有错误，则返回长度为 0 的数组，否则返回 ValidationMessage 数组。
since | 2.0
英文文档：

validate

public ValidationMessage[] validate(TagData data)
Translation-time validation of the attributes. This is a convenience method on the associated TagExtraInfo class.

Parameters:
data - The translation-time TagData instance.
Returns:
A null object, or zero length array if no errors, an array of ValidationMessages otherwise.
Since:
JSP 2.0

public void setTagExtraInfo(TagExtraInfo tei)
设置额外标记信息的实例。
tei TagExtraInfo 实例
英文文档：

setTagExtraInfo

public void setTagExtraInfo(TagExtraInfo tei)
Set the instance for extra tag information.

Parameters:
tei - the TagExtraInfo instance

public TagExtraInfo getTagExtraInfo()
额外标记信息的实例（如果有）。
return TagExtraInfo 实例（如果有）。
英文文档：

getTagExtraInfo

public TagExtraInfo getTagExtraInfo()
The instance (if any) for extra tag information.

Returns:
The TagExtraInfo instance, if any.

public String getTagClassName()
为此标记提供处理程序的类的名称。
return 标记处理程序类的名称。
英文文档：

getTagClassName

public String getTagClassName()
Name of the class that provides the handler for this tag.

Returns:
The name of the tag handler class.

public String getBodyContent()
此标记的 bodycontent 信息。如果没有为此标记定义 bodycontent，则返回 JSP 的默认值。
return 正文内容字符串。
英文文档：

getBodyContent

public String getBodyContent()
The bodycontent information for this tag. If the bodycontent is not defined for this tag, the default of JSP will be returned.

Returns:
the body content string.

public String getInfoString()
标记的信息字符串。
return 信息字符串，如果没有定义该字符串，则返回 null
英文文档：

getInfoString

public String getInfoString()
The information string for the tag.

Returns:
the info string, or null if not defined

public void setTagLibrary(TagLibraryInfo tl)
设置 TagLibraryInfo 属性。 注意，TagLibraryInfo 元素不但依赖于 TLD 信息，而且还依赖于使用的特定 taglib 实例。这意味着需要做大量工作来构造和初始化 TagLib 对象。 如果谨慎使用，可使用此 setter 避免必须为每个 taglib 指令创建新的 TagInfo 元素。
tl 要分配的 TagLibraryInfo
英文文档：

setTagLibrary

public void setTagLibrary(TagLibraryInfo tl)
Set the TagLibraryInfo property. Note that a TagLibraryInfo element is dependent not just on the TLD information but also on the specific taglib instance used. This means that a fair amount of work needs to be done to construct and initialize TagLib objects. If used carefully, this setter can be used to avoid having to create new TagInfo elements for each taglib directive.

Parameters:
tl - the TagLibraryInfo to assign

public TagLibraryInfo getTagLibrary()
我们所属的 TabLibraryInfo 实例。
return 我们所属的标记库实例
英文文档：

getTagLibrary

public TagLibraryInfo getTagLibrary()
The instance of TabLibraryInfo we belong to.

Returns:
the tag library instance we belong to

public String getDisplayName()
获取 displayName。
return 通过工具显示的短名称，如果没有定义该名称，则返回 null
英文文档：

getDisplayName

public String getDisplayName()
Get the displayName.

Returns:
A short name to be displayed by tools, or null if not defined

public String getSmallIcon()
获取指向小图标的路径。
return 指向通过工具显示的小图标的路径，如果没有定义该路径，则返回 null
英文文档：

getSmallIcon

public String getSmallIcon()
Get the path to the small icon.

Returns:
Path to a small icon to be displayed by tools, or null if not defined

public String getLargeIcon()
获取指向大图标的路径。
return 指向通过工具显示的大图标的路径，如果没有定义该路径，则返回 null
英文文档：

getLargeIcon

public String getLargeIcon()
Get the path to the large icon.

Returns:
Path to a large icon to be displayed by tools, or null if not defined

public TagVariableInfo[] getTagVariableInfos()
获取与此 TagInfo 关联的 TagVariableInfo 对象。
return 与此标记声明的变量相对应的 TagVariableInfo 对象的数组，如果没有声明任何变量，则返回长度为 0 的数组
英文文档：

getTagVariableInfos

public TagVariableInfo[] getTagVariableInfos()
Get TagVariableInfo objects associated with this TagInfo.

Returns:
Array of TagVariableInfo objects corresponding to variables declared by this tag, or a zero length array if no variables have been declared

public boolean hasDynamicAttributes()
获取与此 TagInfo 关联的 dynamicAttributes。
return | 如果标记处理程序支持动态属性，则返回 true
since | 2.0
英文文档：

hasDynamicAttributes

public boolean hasDynamicAttributes()
Get dynamicAttributes associated with this TagInfo.

Returns:
True if tag handler supports dynamic attributes
Since:
JSP 2.0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagLibraryInfo (Java EE 5)

javax.servlet.jsp.tagext
Class TagLibraryInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagLibraryInfo

public abstract class TagLibraryInfo
extends Object

与 taglib 指令及其底层 TLD 文件关联的转换期间信息。 多数信息直接来自 TLD，除了 taglib 指令中使用的前缀和 uri 值
英文文档：

Translation-time information associated with a taglib directive, and its underlying TLD file. Most of the information is directly from the TLD, except for the prefix and the uri values used in the taglib directive

Field Summary
protected FunctionInfo[] | functions An array describing the functions that are defined in this tag library.
protected String | info Information (documentation) for this TLD.
protected String | jspversion The version of the JSP specification this tag library is written to.
protected String | prefix The prefix assigned to this taglib from the taglib directive.
protected String | shortname The preferred short name (prefix) as indicated in the TLD.
protected TagFileInfo[] | tagFiles An array describing the tag files that are defined in this tag library.
protected TagInfo[] | tags An array describing the tags that are defined in this tag library.
protected String | tlibversion The version of the tag library.
protected String | uri The value of the uri attribute from the taglib directive for this library.
protected String | urn The "reliable" URN indicated in the TLD.
Constructor Summary
protected TagLibraryInfo(String prefix, String uri)
Constructor.
Method Summary
FunctionInfo | getFunction(String name) Get the FunctionInfo for a given function name, looking through all the functions in this tag library.
FunctionInfo[] | getFunctions() An array describing the functions that are defined in this tag library.
String | getInfoString() Information (documentation) for this TLD.
String | getPrefixString() The prefix assigned to this taglib from the taglib directive
String | getReliableURN() The "reliable" URN indicated in the TLD (the uri element).
String | getRequiredVersion() A string describing the required version of the JSP container.
String | getShortName() The preferred short name (prefix) as indicated in the TLD.
TagInfo | getTag(String shortname) Get the TagInfo for a given tag name, looking through all the tags in this tag library.
TagFileInfo | getTagFile(String shortname) Get the TagFileInfo for a given tag name, looking through all the tag files in this tag library.
TagFileInfo[] | getTagFiles() An array describing the tag files that are defined in this tag library.
abstract TagLibraryInfo[] | getTagLibraryInfos() Returns an array of TagLibraryInfo objects representing the entire set of tag libraries (including this TagLibraryInfo) imported by taglib directives in the translation unit that references this TagLibraryInfo.
TagInfo[] | getTags() An array describing the tags that are defined in this tag library.
String | getURI() The value of the uri attribute from the taglib directive for this library.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

prefix

protected String prefix
The prefix assigned to this taglib from the taglib directive.

英文文档：

uri

protected String uri
The value of the uri attribute from the taglib directive for this library.

英文文档：

tags

protected TagInfo[] tags
An array describing the tags that are defined in this tag library.

英文文档：

tagFiles

protected TagFileInfo[] tagFiles
An array describing the tag files that are defined in this tag library.

Since:
JSP 2.0

英文文档：

functions

protected FunctionInfo[] functions
An array describing the functions that are defined in this tag library.

Since:
JSP 2.0

英文文档：

tlibversion

protected String tlibversion
The version of the tag library.

英文文档：

jspversion

protected String jspversion
The version of the JSP specification this tag library is written to.

英文文档：

shortname

protected String shortname
The preferred short name (prefix) as indicated in the TLD.

英文文档：

urn

protected String urn
The "reliable" URN indicated in the TLD.

英文文档：

info

protected String info
Information (documentation) for this TLD.

Constructor Detail

protected TagLibraryInfo(String prefix, String uri)
构造方法。 此方法将调用 TagInfo 的构造方法，并在解析 TLD 文件后调用 TagAttributeInfo。
prefix | taglib 指令实际使用的前缀
uri | taglib 指令实际使用的 URI
英文文档：

TagLibraryInfo

protected TagLibraryInfo(String prefix,
                         String uri)
Constructor.

Parameters:
prefix - the prefix actually used by the taglib directive
uri - the URI actually used by the taglib directive
Method Detail

public String getURI()
此库的 taglib 指令中的 uri 属性值。
return uri 属性的值
英文文档：

getURI

public String getURI()
The value of the uri attribute from the taglib directive for this library.

Returns:
the value of the uri attribute

public String getPrefixString()
从 taglib 指令分配给此 taglib 的前缀。
return 从 taglib 指令分配给此 taglib 的前缀
英文文档：

getPrefixString

public String getPrefixString()
The prefix assigned to this taglib from the taglib directive

Returns:
the prefix assigned to this taglib from the taglib directive

public String getShortName()
TLD 中指示的首选短名称（前缀）。编写工具可以将此短名称用作首选前缀，以便在创建此库的 taglib 指令时使用。
return 库的首选短名称
英文文档：

getShortName

public String getShortName()
The preferred short name (prefix) as indicated in the TLD. This may be used by authoring tools as the preferred prefix to use when creating an taglib directive for this library.

Returns:
the preferred short name for the library

public String getReliableURN()
TLD 中指示的“可靠”URN（uri 元素）。编写工具可以将此 URN 用作全局标识符，以便在创建此库的 taglib 指令时使用。
return 此 TLD 中的可靠 URN
英文文档：

getReliableURN

public String getReliableURN()
The "reliable" URN indicated in the TLD (the uri element). This may be used by authoring tools as a global identifier to use when creating a taglib directive for this library.

Returns:
a reliable URN to a TLD like this

public String getInfoString()
此 TLD 的信息（文档）。
return 此标记库的信息字符串
英文文档：

getInfoString

public String getInfoString()
Information (documentation) for this TLD.

Returns:
the info string for this tag lib

public String getRequiredVersion()
描述所需 JSP 容器版本的字符串。
return | （最低）所需的 JSP 容器版本。
See also | javax.servlet.jsp.JspEngineInfo
英文文档：

getRequiredVersion

public String getRequiredVersion()
A string describing the required version of the JSP container.

Returns:
the (minimal) required version of the JSP container.
See Also:
JspEngineInfo

public TagInfo[] getTags()
描述此标记库中定义的标记的数组。
return 与此标记库定义的标记相对应的 TagInfo 对象，如果此标记库没有定义标记，则返回长度为 0 的数组
英文文档：

getTags

public TagInfo[] getTags()
An array describing the tags that are defined in this tag library.

Returns:
the TagInfo objects corresponding to the tags defined by this tag library, or a zero length array if this tag library defines no tags

public TagFileInfo[] getTagFiles()
描述此标记库中定义的标记文件的数组。
return | 与此标记库定义的标记文件相对应的 TagFileInfo 对象，如果此标记库没有定义标记文件，则返回长度为 0 的数组
since | 2.0
英文文档：

getTagFiles

public TagFileInfo[] getTagFiles()
An array describing the tag files that are defined in this tag library.

Returns:
the TagFileInfo objects corresponding to the tag files defined by this tag library, or a zero length array if this tag library defines no tags files
Since:
JSP 2.0

public TagInfo getTag(String shortname)
获取给定标记名称的 TagInfo，查看此标记库中的所有标记。
shortname | 标记的短名称（无前缀）
return | 具有指定短名称的标记的 TagInfo，如果未找到这样的标记，则返回 null
英文文档：

getTag

public TagInfo getTag(String shortname)
Get the TagInfo for a given tag name, looking through all the tags in this tag library.

Parameters:
shortname - The short name (no prefix) of the tag
Returns:
the TagInfo for the tag with the specified short name, or null if no such tag is found

public TagFileInfo getTagFile(String shortname)
获取给定标记名称的 TagFileInfo，查看此标记库中的所有标记文件。
shortname | 标记的短名称（无前缀）
return | 指定标记文件的 TagFileInfo，如果未找到标记文件，则返回 null
since | 2.0
英文文档：

getTagFile

public TagFileInfo getTagFile(String shortname)
Get the TagFileInfo for a given tag name, looking through all the tag files in this tag library.

Parameters:
shortname - The short name (no prefix) of the tag
Returns:
the TagFileInfo for the specified Tag file, or null if no Tag file is found
Since:
JSP 2.0

public FunctionInfo[] getFunctions()
描述此标记库中定义的函数的数组。
return | 此标记库中定义的函数，如果该标记库没有定义任何函数，则返回长度为 0 的数组。
since | 2.0
英文文档：

getFunctions

public FunctionInfo[] getFunctions()
An array describing the functions that are defined in this tag library.

Returns:
the functions defined in this tag library, or a zero length array if the tag library defines no functions.
Since:
JSP 2.0

public FunctionInfo getFunction(String name)
获取给定函数名称的 FunctionInfo，查看此标记库中的所有函数。
name | 函数的名称（无前缀）
return | 具有给定名称的函数的 FunctionInfo，如果不存在这样的函数，则返回 null
since | 2.0
英文文档：

getFunction

public FunctionInfo getFunction(String name)
Get the FunctionInfo for a given function name, looking through all the functions in this tag library.

Parameters:
name - The name (no prefix) of the function
Returns:
the FunctionInfo for the function with the given name, or null if no such function exists
Since:
JSP 2.0

英文文档：

getTagLibraryInfos

public abstract TagLibraryInfo[] getTagLibraryInfos()
Returns an array of TagLibraryInfo objects representing the entire set of tag libraries (including this TagLibraryInfo) imported by taglib directives in the translation unit that references this TagLibraryInfo. If a tag library is imported more than once and bound to different prefices, only the TagLibraryInfo bound to the first prefix must be included in the returned array.

Returns:
Array of TagLibraryInfo objects representing the entire set of tag libraries (including this TagLibraryInfo) imported by taglib directives in the translation unit that references this TagLibraryInfo.
Since:
JSP 2.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagLibraryValidator (Java EE 5)

javax.servlet.jsp.tagext
Class TagLibraryValidator

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagLibraryValidator

public abstract class TagLibraryValidator
extends Object

JSP 页面的转换期间验证器类。验证器在与 JSP 页面关联的 XML 视图上进行操作。

TLD 文件将 TagLibraryValidator 类和一些 init 参数与标记库相关联。

JSP 容器负责定位适当子类的适当实例，方法是

  • 新建一个新的实例，或者重用可用的实例
  • 对实例调用 setInitParams(Map) 方法
一旦完成初始化，则将调用 validate(String, String, PageData) 方法，其中前两个参数是 XML 视图中此标记库的前缀和 uri。前缀用于使生成错误消息变得更容易。不过，它并不总是很准确。在单个 URI 被映射到 XML 视图中的多个前缀的情况下，提供第一个 URI 的前缀。因此，要在检查标记元素自身的情况下提供高质量的错误消息，就应该忽略前缀参数，而使用元素的实际前缀。TagLibraryValidator 应该总是使用 uri 来标识属于标记库的元素，而不是使用前缀来标识。

TagLibraryValidator 实例可以内部创建辅助对象来执行验证（例如，XSchema 验证器），并且可将该对象重用于给定转换运行中的所有页面。

JSP 容器不保证会序列化 validate() 方法的调用，并且 TagLibraryValidator 应该执行它们可能需要的任何同步。

从 JSP 2.0 起，JSP 容器必须提供 jsp:id 属性，以提供更高质量的验证错误。容器将跟踪传递给容器的 JSP 页面，将给每个元素分配唯一的 "id"，该 id 作为 jsp:id 属性的值传递。XML 视图中每个可用的 XML 元素都将使用此属性扩展。然后，TagLibraryValidator 可以在一个或多个 ValidationMessage 对象中使用该属性。然后，容器可以依次使用这些值提供有关错误位置的更准确信息。

id 属性的实际前缀不一定是 jsp，但它总是映射到名称空间 http://java.sun.com/JSP/Page。TagLibraryValidator 实现必须依赖 id 属性的 uri 而不是前缀。

英文文档：

Translation-time validator class for a JSP page. A validator operates on the XML view associated with the JSP page.

The TLD file associates a TagLibraryValidator class and some init arguments with a tag library.

The JSP container is reponsible for locating an appropriate instance of the appropriate subclass by

  • new a fresh instance, or reuse an available one
  • invoke the setInitParams(Map) method on the instance
once initialized, the validate(String, String, PageData) method will be invoked, where the first two arguments are the prefix and uri for this tag library in the XML View. The prefix is intended to make it easier to produce an error message. However, it is not always accurate. In the case where a single URI is mapped to more than one prefix in the XML view, the prefix of the first URI is provided. Therefore, to provide high quality error messages in cases where the tag elements themselves are checked, the prefix parameter should be ignored and the actual prefix of the element should be used instead. TagLibraryValidators should always use the uri to identify elements as beloning to the tag library, not the prefix.

A TagLibraryValidator instance may create auxiliary objects internally to perform the validation (e.g. an XSchema validator) and may reuse it for all the pages in a given translation run.

The JSP container is not guaranteed to serialize invocations of validate() method, and TagLibraryValidators should perform any synchronization they may require.

As of JSP 2.0, a JSP container must provide a jsp:id attribute to provide higher quality validation errors. The container will track the JSP pages as passed to the container, and will assign to each element a unique "id", which is passed as the value of the jsp:id attribute. Each XML element in the XML view available will be extended with this attribute. The TagLibraryValidator can then use the attribute in one or more ValidationMessage objects. The container then, in turn, can use these values to provide more precise information on the location of an error.

The actual prefix of the id attribute may or may not be jsp but it will always map to the namespace http://java.sun.com/JSP/Page. A TagLibraryValidator implementation must rely on the uri, not the prefix, of the id attribute.

Constructor Summary
TagLibraryValidator()
Sole constructor.
Method Summary
Map<String,Object> | getInitParameters() Get the init parameters data as an immutable Map.
void | release() Release any data kept by this instance for validation purposes.
void | setInitParameters(Map<String,Object> map) Set the init data in the TLD for this validator.
ValidationMessage[] | validate(String prefix, String uri, PageData page) Validate a JSP page.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public TagLibraryValidator()
唯一的构造方法。（由子类构造方法调用，通常是隐式的）。
英文文档：

TagLibraryValidator

public TagLibraryValidator()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

public void setInitParameters(java.util.Map<K, V> map)
设置此验证器的 TLD 中的 init 数据。参数名称是键，参数值是值。
map 描述 init 参数的 Map
英文文档：

setInitParameters

public void setInitParameters(Map<String,Object> map)
Set the init data in the TLD for this validator. Parameter names are keys, and parameter values are the values.

Parameters:
map - A Map describing the init parameters

public java.util.Map<K, V> getInitParameters()
获取不可变 Map 形式的 init 参数数据。参数名称是键，参数值是值。
return 不可变映射形式的 init 参数。
英文文档：

getInitParameters

public Map<String,Object> getInitParameters()
Get the init parameters data as an immutable Map. Parameter names are keys, and parameter values are the values.

Returns:
The init parameters as an immutable map.

public ValidationMessage[] validate(String prefix, String uri, PageData page)
验证 JSP 页面。此方法将对 XML 视图中的每个唯一标记库 URI 调用一次。如果页面有效，则此方法将返回 null；否则该方法应该返回 ValidationMessage 对象的数组。长度为 0 的数组也将被解释为没有错误。
prefix | XML 视图中与标记库关联的第一个前缀。注意，如果重新定义名称空间，那么某些标记可能使用不同的前缀。
uri | 标记库的唯一标识符
page | JspData 页面对象
return | 如果没有错误，则返回一个 null 对象，或长度为 0 的数组，否则返回 ValidationMessage 的数组。
英文文档：

validate

public ValidationMessage[] validate(String prefix,
                                    String uri,
                                    PageData page)
Validate a JSP page. This will get invoked once per unique tag library URI in the XML view. This method will return null if the page is valid; otherwise the method should return an array of ValidationMessage objects. An array of length zero is also interpreted as no errors.

Parameters:
prefix - the first prefix with which the tag library is associated, in the XML view. Note that some tags may use a different prefix if the namespace is redefined.
uri - the tag library's unique identifier
page - the JspData page object
Returns:
A null object, or zero length array if no errors, an array of ValidationMessages otherwise.

public void release()
释放此实例为了进行验证保存的所有数据。
英文文档：

release

public void release()
Release any data kept by this instance for validation purposes.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagSupport (Java EE 5)

javax.servlet.jsp.tagext
Class TagSupport

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagSupport
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
Direct Known Subclasses:
AttributeTag, BodyTagSupport, ConverterELTag, ConverterTag, FacetTag, ValidatorELTag, ValidatorTag
public class TagSupport
extends Object
implements IterationTag, Serializable

Implements: IterationTag, java.io.Serializable
Extended by: AttributeTag, BodyTagSupport, ConverterELTag, ConverterTag, FacetTag, ValidatorELTag, ValidatorTag

用来定义实现 Tag 的新标记处理程序的基类。

TagSupport 类是一个实用工具类，旨在用作新标记处理程序的基类。TagSupport 类实现 Tag 和 IterationTag 接口，并添加了其他便捷方法，包括用于 Tag 中属性的 getter 方法。TagSupport 有一个静态方法，包含该方法是为了促进各协作标记之间的协调。

许多标记处理程序将扩展 TagSupport，并且仅重新定义少数几个方法。

英文文档：

A base class for defining new tag handlers implementing Tag.

The TagSupport class is a utility class intended to be used as the base class for new tag handlers. The TagSupport class implements the Tag and IterationTag interfaces and adds additional convenience methods including getter methods for the properties in Tag. TagSupport has one static method that is included to facilitate coordination among cooperating tags.

Many tag handlers will extend TagSupport and only redefine a few methods.

See Also:
Serialized Form

Field Summary
protected String | id The value of the id attribute of this tag; or null.
protected PageContext | pageContext The PageContext.
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor Summary
TagSupport()
Default constructor, all subclasses are required to define only a public constructor with the same signature, and to call the superclass constructor.
Method Summary
int | doAfterBody() Default processing for a body.
int | doEndTag() Default processing of the end tag returning EVAL_PAGE.
int | doStartTag() Default processing of the start tag, returning SKIP_BODY.
static Tag | findAncestorWithClass(Tag from, Class klass) Find the instance of a given class type that is closest to a given instance.
String | getId() The value of the id attribute of this tag; or null.
Tag | getParent() The Tag instance most closely enclosing this tag instance.
Object | getValue(String k) Get a the value associated with a key.
Enumeration<String> | getValues() Enumerate the keys for the values kept by this tag handler.
void | release() Release state.
void | removeValue(String k) Remove a value associated with a key.
void | setId(String id) Set the id attribute for this tag.
void | setPageContext(PageContext pageContext) Set the page context.
void | setParent(Tag t) Set the nesting tag of this tag.
void | setValue(String k, Object o) Associate a value with a String key.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

id

protected String id
The value of the id attribute of this tag; or null.

英文文档：

pageContext

protected PageContext pageContext
The PageContext.

Constructor Detail

public TagSupport()
默认构造方法，所有子类只需定义一个具有相同签名的公共构造方法并调用该超类构造方法。 此构造方法通过 JSP 转换器生成的代码调用。
英文文档：

TagSupport

public TagSupport()
Default constructor, all subclasses are required to define only a public constructor with the same signature, and to call the superclass constructor. This constructor is called by the code generated by the JSP translator.

Method Detail

final public static Tag findAncestorWithClass(Tag from, Class<T> klass)
查找最接近给定实例的给定类类型的实例。此方法使用来自 Tag 接口的 getParent 方法。此方法用于协调各协作标记。

规范的当前版本仅提供一种正式方法指示标记处理程序的 observable 类型：其标记处理程序实现类，在标记元素的标记类子元素中描述。这可以通过一种非正式的方法扩展，即允许标记库作者在描述子元素中指示 observable 类型。该类型应该是标记处理程序实现类的子类型或者是 void 类型。支持特定标记库（比如 JSP 标准标记库）的专门化容器可以利用这一附加限制。

当标记库作者提供有关标记处理程序 observable 类型的信息时，客户端编程代码应该遵守该限制。具体地说，传递给 findAncestorWithClass 的类应该是 observable 类型的子类型。

from | 开始查找实例的位置。
klass | 将匹配的 Tag 或接口的子类
return | 实现该接口的最接近的祖先，或者指定类的实例
英文文档：

findAncestorWithClass

public static final Tag findAncestorWithClass(Tag from,
                                              Class klass)
Find the instance of a given class type that is closest to a given instance. This method uses the getParent method from the Tag interface. This method is used for coordination among cooperating tags.

The current version of the specification only provides one formal way of indicating the observable type of a tag handler: its tag handler implementation class, described in the tag-class subelement of the tag element. This is extended in an informal manner by allowing the tag library author to indicate in the description subelement an observable type. The type should be a subtype of the tag handler implementation class or void. This addititional constraint can be exploited by a specialized container that knows about that specific tag library, as in the case of the JSP standard tag library.

When a tag library author provides information on the observable type of a tag handler, client programmatic code should adhere to that constraint. Specifically, the Class passed to findAncestorWithClass should be a subtype of the observable type.

Parameters:
from - The instance from where to start looking.
klass - The subclass of Tag or interface to be matched
Returns:
the nearest ancestor that implements the interface or is an instance of the class specified

public int doStartTag() throws JspException
开始标记的默认处理，返回 SKIP_BODY。
return | SKIP_BODY
Throws | JspException: 如果处理此标记时发生错误
See also | doStartTag()
英文文档：

doStartTag

public int doStartTag()
               throws JspException
Default processing of the start tag, returning SKIP_BODY.

Specified by:
doStartTag in interface Tag
Returns:
SKIP_BODY
Throws:
JspException - if an error occurs while processing this tag
See Also:
Tag.doStartTag()

public int doEndTag() throws JspException
结束标记的默认处理，返回 EVAL_PAGE。
return | EVAL_PAGE
Throws | JspException: 如果处理此标记时发生错误
See also | doEndTag()
英文文档：

doEndTag

public int doEndTag()
             throws JspException
Default processing of the end tag returning EVAL_PAGE.

Specified by:
doEndTag in interface Tag
Returns:
EVAL_PAGE
Throws:
JspException - if an error occurs while processing this tag
See Also:
Tag.doEndTag()

public int doAfterBody() throws JspException
正文的默认处理。
return | SKIP_BODY
Throws | JspException: 如果处理此标记时发生错误
See also | doAfterBody()
英文文档：

doAfterBody

public int doAfterBody()
                throws JspException
Default processing for a body.

Specified by:
doAfterBody in interface IterationTag
Returns:
SKIP_BODY
Throws:
JspException - if an error occurs while processing this tag
See Also:
IterationTag.doAfterBody()

public void release()
释放状态。
See also release()
英文文档：

release

public void release()
Release state.

Specified by:
release in interface Tag
See Also:
Tag.release()

public void setParent(Tag t)
设置此标记的嵌套标记。
t | 父 Tag。
See also | setParent(Tag)
英文文档：

setParent

public void setParent(Tag t)
Set the nesting tag of this tag.

Specified by:
setParent in interface Tag
Parameters:
t - The parent Tag.
See Also:
Tag.setParent(Tag)

public Tag getParent()
封闭此标记实例的最接近的标记实例。
return | 父标记实例或 null
See also | getParent()
英文文档：

getParent

public Tag getParent()
The Tag instance most closely enclosing this tag instance.

Specified by:
getParent in interface Tag
Returns:
the parent tag instance or null
See Also:
Tag.getParent()

public void setId(String id)
设置此标记的 id 属性。
id id 的 String。
英文文档：

setId

public void setId(String id)
Set the id attribute for this tag.

Parameters:
id - The String for the id.

public String getId()
此标记的 id 属性值；或者为 null。
return id 属性的值，或者返回 null
英文文档：

getId

public String getId()
The value of the id attribute of this tag; or null.

Returns:
the value of the id attribute, or null

public void setPageContext(PageContext pageContext)
设置页面上下文。
pageContext | PageContext。
See also | setPageContext
英文文档：

setPageContext

public void setPageContext(PageContext pageContext)
Set the page context.

Specified by:
setPageContext in interface Tag
Parameters:
pageContext - The PageContext.
See Also:
Tag.setPageContext(javax.servlet.jsp.PageContext)

public void setValue(String k, Object o)
将值与 String 键相关联。
k | 键 String。
o | 要关联的值。
英文文档：

setValue

public void setValue(String k,
                     Object o)
Associate a value with a String key.

Parameters:
k - The key String.
o - The value to associate.

public Object getValue(String k)
获取与某个键关联的值。
k | 字符串键。
return | 与此键关联的值，或者返回 null。
英文文档：

getValue

public Object getValue(String k)
Get a the value associated with a key.

Parameters:
k - The string key.
Returns:
The value associated with the key, or null.

public void removeValue(String k)
移除与某个键关联的值。
k 字符串键。
英文文档：

removeValue

public void removeValue(String k)
Remove a value associated with a key.

Parameters:
k - The string key.

public java.util.Enumeration<E> getValues()
枚举此标记处理程序保存的值对应的键。
return 设置的值对应的所有键的枚举，如果未设置任何值，则返回 null 或一个空 Enumeration。
英文文档：

getValues

public Enumeration<String> getValues()
Enumerate the keys for the values kept by this tag handler.

Returns:
An enumeration of all the keys for the values set, or null or an empty Enumeration if no values have been set.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TagVariableInfo (Java EE 5)

javax.servlet.jsp.tagext
Class TagVariableInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.TagVariableInfo

public class TagVariableInfo
extends Object

标记库中某个标记的变量信息；此类是根据标记库描述符文件 (TLD) 实例化的，仅在转换期间可用。 此对象应该是不可变的。 此信息只在 JSP 1.2 格式的 TLD 或更高版本格式的 TLD 中可用。
英文文档：

Variable information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time. This object should be immutable. This information is only available in JSP 1.2 format TLDs or above.

Constructor Summary
TagVariableInfo(String nameGiven, String nameFromAttribute, String className, boolean declare, int scope)
Constructor for TagVariableInfo.
Method Summary
String | getClassName() The body of the <variable-class> element.
boolean | getDeclare() The body of the <declare> element.
String | getNameFromAttribute() The body of the <name-from-attribute> element.
String | getNameGiven() The body of the <name-given> element.
int | getScope() The body of the <scope> element.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public TagVariableInfo(String nameGiven, String nameFromAttribute, String className, boolean declare, int scope)
TagVariableInfo 的构造方法。
nameGiven | <name-given> 的值
nameFromAttribute | <name-from-attribute> 的值
className | <variable-class> 的值
declare | <declare> 的值
scope | <scope> 的值
英文文档：

TagVariableInfo

public TagVariableInfo(String nameGiven,
                       String nameFromAttribute,
                       String className,
                       boolean declare,
                       int scope)
Constructor for TagVariableInfo.

Parameters:
nameGiven - value of <name-given>
nameFromAttribute - value of <name-from-attribute>
className - value of <variable-class>
declare - value of <declare>
scope - value of <scope>
Method Detail

public String getNameGiven()
<name-given> 元素的正文。
return 常量形式的变量名称
英文文档：

getNameGiven

public String getNameGiven()
The body of the <name-given> element.

Returns:
The variable name as a constant

public String getNameFromAttribute()
<name-from-attribute> 元素的正文。这是某个属性的名称，该属性的（转换期间）值将给出变量名称。<name-given> 或 <name-from-attribute> 之一是必需的。
return 其值定义变量名称的属性
英文文档：

getNameFromAttribute

public String getNameFromAttribute()
The body of the <name-from-attribute> element. This is the name of an attribute whose (translation-time) value will give the name of the variable. One of <name-given> or <name-from-attribute> is required.

Returns:
The attribute whose value defines the variable name

public String getClassName()
<variable-class> 元素的正文。
return 变量的类的名称，如果未在 TLD 中定义该变量类的名称，则返回 'java.lang.String'。
英文文档：

getClassName

public String getClassName()
The body of the <variable-class> element.

Returns:
The name of the class of the variable or 'java.lang.String' if not defined in the TLD.

public boolean getDeclare()
<declare> 元素的正文。
return 是否将声明变量。如果未在 TLD 中定义是否将声明变量，则返回 'true'。
英文文档：

getDeclare

public boolean getDeclare()
The body of the <declare> element.

Returns:
Whether the variable is to be declared or not. If not defined in the TLD, 'true' will be returned.

public int getScope()
<scope> 元素的正文。
return 给变量的范围。如果未在 TLD 中定义范围，则将返回 NESTED 范围。
英文文档：

getScope

public int getScope()
The body of the <scope> element.

Returns:
The scope to give the variable. NESTED scope will be returned if not defined in the TLD.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationMessage (Java EE 5)

javax.servlet.jsp.tagext
Class ValidationMessage

java.lang.Object
    extended by  javax.servlet.jsp.tagext.ValidationMessage

public class ValidationMessage
extends Object

来自 TagLibraryValidator 或 TagExtraInfo 的验证消息。

从 JSP 2.0 起，JSP 容器必须支持 jsp:id 属性，以提供更高质量的验证错误。容器将跟踪传递给容器的 JSP 页面，将给每个元素分配唯一的 "id"，该 id 作为 jsp:id 属性的值传递。XML 视图中每个可用的 XML 元素都将使用此属性扩展。然后，TagLibraryValidator 可以在一个或多个 ValidationMessage 对象中使用该属性。然后，容器可以依次使用这些值提供有关错误位置的更准确信息。

id 属性的实际前缀不一定是 jsp，但它总是映射到名称空间 http://java.sun.com/JSP/Page。TagLibraryValidator 实现必须依赖 id 属性的 uri 而不是前缀。

英文文档：

A validation message from either TagLibraryValidator or TagExtraInfo.

As of JSP 2.0, a JSP container must support a jsp:id attribute to provide higher quality validation errors. The container will track the JSP pages as passed to the container, and will assign to each element a unique "id", which is passed as the value of the jsp:id attribute. Each XML element in the XML view available will be extended with this attribute. The TagLibraryValidator can then use the attribute in one or more ValidationMessage objects. The container then, in turn, can use these values to provide more precise information on the location of an error.

The actual prefix of the id attribute may or may not be jsp but it will always map to the namespace http://java.sun.com/JSP/Page. A TagLibraryValidator implementation must rely on the uri, not the prefix, of the id attribute.

Constructor Summary
ValidationMessage(String id, String message)
Create a ValidationMessage.
Method Summary
String | getId() Get the jsp:id.
String | getMessage() Get the localized validation message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ValidationMessage(String id, String message)
创建 ValidationMessage。消息 String 应该是非 null 的。如果消息不是特定于任何 XML 元素的，或者没有传递 jsp:id 属性，则 id 值可以为 null。如果 id 值是非 null 的，则 id 值必须是传入 validate() 方法的 PageData 的 jsp:id 属性值。
id | 该参数为 null 或者 jsp:id 属性的值。
message | 本地化验证消息。
英文文档：

ValidationMessage

public ValidationMessage(String id,
                         String message)
Create a ValidationMessage. The message String should be non-null. The value of id may be null, if the message is not specific to any XML element, or if no jsp:id attributes were passed on. If non-null, the value of id must be the value of a jsp:id attribute for the PageData passed into the validate() method.

Parameters:
id - Either null, or the value of a jsp:id attribute.
message - A localized validation message.
Method Detail

public String getId()
获取 jsp:id。null 意味着没有可用信息。
return jsp:id 信息。
英文文档：

getId

public String getId()
Get the jsp:id. Null means that there is no information available.

Returns:
The jsp:id information.

public String getMessage()
获取本地化验证消息。
return 验证消息
英文文档：

getMessage

public String getMessage()
Get the localized validation message.

Returns:
A validation message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


VariableInfo (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.servlet.jsp.tagext
Class VariableInfo

java.lang.Object
    extended by  javax.servlet.jsp.tagext.VariableInfo

public class VariableInfo
extends Object

有关由标记（在运行时）创建/修改的脚本变量的信息。此信息由 TagExtraInfo 类提供，在 JSP 的转换阶段使用。

自定义操作生成的脚本变量有一个相关联的范围，该范围是 AT_BEGIN、NESTED 或 AT_END。

返回对象中的类名称 (VariableInfo.getClassName) 用于确定脚本变量的类型。注意，因为脚本变量根据范围属性分配其值，该属性不能是基本类型，所以必须使用“装箱”类型（比如 java.lang.Integer），而不是基本类型。

类名称可以是完全限定类名称或者简短类名称。

如果提供完全限定类名称，则将引用应该位于 Web 应用程序的 CLASSPATH 中的类（请参见 Servlet 2.4 规范 - 实质上是 WEB-INF/lib 和 WEB-INF/classes）。操作失败将导致转换期间错误。

如果在 VariableInfo 对象中给出简短类名称，那么类名称必须是自定义操作出现的页面上 import 指令上下文中的某个公共类的名称。该类必须也位于 Web 应用程序的 CLASSPATH 中（请参见 Servlet 2.4 规范 - 实质上是 WEB-INF/lib 和 WEB-INF/classes）。操作失败将导致转换期间错误。

用法注释

通常，完全限定类名称将引用标记库已知的类，这样就可以在与标记处理程序相同的 JAR 文件中传送该类。在其他多数情况下，它将引用构建 JSP 处理器的平台（比如 J2EE）中的某个类。以这种方式使用完全限定类名称可对配置错误产生一定的抵抗力。

短名称通常由标记库根据从自定义操作用户（作者）传入的一些属性生成，因此，它不那么健壮：例如，在正引用的 JSP 页面中丢失 import 指令将导致无效短名称类和转换错误。

同步协议

调用 getVariableInfo 的结果是产生一个 VariableInfo 对象数组。每个 VariableInfo 对象都描述一个脚本变量，描述方式是提供该变量的名称、其类型、该变量是否是新变量以及其范围是什么。范围可通过图像得到最好的描述：

NESTED、AT_BEGIN 和 AT_END 变量范围

JSP 2.0 规范定义了这三个值的解释：

  • NESTED，如果脚本变量在定义它的操作的开始标记和结束标记之间是可用的。
  • AT_BEGIN，如果脚本变量从定义它的操作的开始标记一直到范围的结束都是可用的。
  • AT_END，如果脚本变量在定义它的操作的结束标记之后一直到范围的结束都是可用的。
变量的范围值暗示哪些方法可能影响其值，这样就需要在某些地方执行同步，如下表所示。注： 变量的同步将发生在已调用各自方法之后。
变量同步点
doStartTag() doInitBody() doAfterBody() doEndTag() doTag()
Tag
         AT_BEGIN 和 NESTED

AT_BEGIN 和 AT_END
IterationTag
         AT_BEGIN 和 NESTED
AT_BEGIN 和 NESTED
 AT_BEGIN 和 AT_END
BodyTag
         AT_BEGIN 和 NESTED1
 AT_BEGIN 和 NESTED1
 AT_BEGIN 和 NESTED
 AT_BEGIN 和 AT_END
SimpleTag

AT_BEGIN 和 AT_END
1 如果返回 EVAL_BODY_INCLUDE，则在调用 doStartTag() 之后调用，否则在调用 doInitBody() 之后调用。

TLD 中的变量信息

多数情况下，也可以使用 <tag> 元素的 <variable> 子元素直接将脚本变量信息编码到标记库描述符。请参见 JSP 规范。

英文文档：

Information on the scripting variables that are created/modified by a tag (at run-time). This information is provided by TagExtraInfo classes and it is used by the translation phase of JSP.

Scripting variables generated by a custom action have an associated scope of either AT_BEGIN, NESTED, or AT_END.

The class name (VariableInfo.getClassName) in the returned objects is used to determine the types of the scripting variables. Note that because scripting variables are assigned their values from scoped attributes which cannot be of primitive types, "boxed" types such as java.lang.Integer must be used instead of primitives.

The class name may be a Fully Qualified Class Name, or a short class name.

If a Fully Qualified Class Name is provided, it should refer to a class that should be in the CLASSPATH for the Web Application (see Servlet 2.4 specification - essentially it is WEB-INF/lib and WEB-INF/classes). Failure to be so will lead to a translation-time error.

If a short class name is given in the VariableInfo objects, then the class name must be that of a public class in the context of the import directives of the page where the custom action appears. The class must also be in the CLASSPATH for the Web Application (see Servlet 2.4 specification - essentially it is WEB-INF/lib and WEB-INF/classes). Failure to be so will lead to a translation-time error.

Usage Comments

Frequently a fully qualified class name will refer to a class that is known to the tag library and thus, delivered in the same JAR file as the tag handlers. In most other remaining cases it will refer to a class that is in the platform on which the JSP processor is built (like Java EE). Using fully qualified class names in this manner makes the usage relatively resistant to configuration errors.

A short name is usually generated by the tag library based on some attributes passed through from the custom action user (the author), and it is thus less robust: for instance a missing import directive in the referring JSP page will lead to an invalid short name class and a translation error.

Synchronization Protocol

The result of the invocation on getVariableInfo is an array of VariableInfo objects. Each such object describes a scripting variable by providing its name, its type, whether the variable is new or not, and what its scope is. Scope is best described through a picture:

NESTED, AT_BEGIN and AT_END Variable Scopes

The JSP 2.0 specification defines the interpretation of 3 values:

  • NESTED, if the scripting variable is available between the start tag and the end tag of the action that defines it.
  • AT_BEGIN, if the scripting variable is available from the start tag of the action that defines it until the end of the scope.
  • AT_END, if the scripting variable is available after the end tag of the action that defines it until the end of the scope.
The scope value for a variable implies what methods may affect its value and thus where synchronization is needed as illustrated by the table below. Note: the synchronization of the variable(s) will occur after the respective method has been called.
Variable Synchronization Points
doStartTag() doInitBody() doAfterBody() doEndTag() doTag()
Tag
         AT_BEGIN, NESTED

AT_BEGIN, AT_END
IterationTag
         AT_BEGIN, NESTED
AT_BEGIN, NESTED
 AT_BEGIN, AT_END
BodyTag
         AT_BEGIN, NESTED1
 AT_BEGIN, NESTED1
 AT_BEGIN, NESTED
 AT_BEGIN, AT_END
SimpleTag

AT_BEGIN, AT_END
1 Called after doStartTag() if EVAL_BODY_INCLUDE is returned, or after doInitBody() otherwise.

Variable Information in the TLD

Scripting variable information can also be encoded directly for most cases into the Tag Library Descriptor using the <variable> subelement of the <tag> element. See the JSP specification.

Field Summary
static int | AT_BEGIN Scope information that scripting variable is visible after start tag.
static int | AT_END Scope information that scripting variable is visible after end tag.
static int | NESTED Scope information that scripting variable is visible only within the start/end tags.
Constructor Summary
VariableInfo(String varName, String className, boolean declare, int scope)
Constructor These objects can be created (at translation time) by the TagExtraInfo instances.
Method Summary
String | getClassName() Returns the type of this variable.
boolean | getDeclare() Returns whether this is a new variable.
int | getScope() Returns the lexical scope of the variable.
String | getVarName() Returns the name of the scripting variable.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

NESTED

public static final int NESTED
Scope information that scripting variable is visible only within the start/end tags.

See Also:
Constant Field Values

英文文档：

AT_BEGIN

public static final int AT_BEGIN
Scope information that scripting variable is visible after start tag.

See Also:
Constant Field Values

英文文档：

AT_END

public static final int AT_END
Scope information that scripting variable is visible after end tag.

See Also:
Constant Field Values
Constructor Detail

public VariableInfo(String varName, String className, boolean declare, int scope)
构造方法，可以通过 TagExtraInfo 实例（在转换期间）创建这些对象。
varName | 脚本变量的名称
className | 此变量的类型
declare | 如果为 true，则该变量是一个新变量（在某些语言中，这将需要一个声明）
scope | 变量的词法范围的指示
英文文档：

VariableInfo

public VariableInfo(String varName,
                    String className,
                    boolean declare,
                    int scope)
Constructor These objects can be created (at translation time) by the TagExtraInfo instances.

Parameters:
varName - The name of the scripting variable
className - The type of this variable
declare - If true, it is a new variable (in some languages this will require a declaration)
scope - Indication on the lexical scope of the variable
Method Detail

public String getVarName()
返回脚本变量的名称。
return 脚本变量的名称
英文文档：

getVarName

public String getVarName()
Returns the name of the scripting variable.

Returns:
the name of the scripting variable

public String getClassName()
返回此变量的类型。
return 此变量的类型
英文文档：

getClassName

public String getClassName()
Returns the type of this variable.

Returns:
the type of this variable

public boolean getDeclare()
返回此变量是否是新变量。如果是，那么在某些语言中这将需要一个声明。
return 此变量是否是新变量。
英文文档：

getDeclare

public boolean getDeclare()
Returns whether this is a new variable. If so, in some languages this will require a declaration.

Returns:
whether this is a new variable.

public int getScope()
返回变量的词法范围。
return | 变量的词法范围，该范围是 AT_BEGIN、AT_END 或 NESTED。
See also | AT_BEGIN, AT_END, NESTED
英文文档：

getScope

public int getScope()
Returns the lexical scope of the variable.

Returns:
the lexical scope of the variable, either AT_BEGIN, AT_END, or NESTED.
See Also:
AT_BEGIN, AT_END, NESTED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.transaction (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.transaction

Provides the API that defines the contract between the transaction manager and the various parties involved in a distributed transaction namely : resource manager, application, and application server.

See:
Description

Interface Summary
Status | The Status interface defines static variables used for transaction status codes.
Synchronization | The transaction manager supports a synchronization mechanism that allows the interested party to be notified before and after the transaction completes.
Transaction | The Transaction interface allows operations to be performed against the transaction in the target Transaction object.
TransactionManager | The TransactionManager interface defines the methods that allow an application server to manage transaction boundaries.
TransactionSynchronizationRegistry | This interface is intended for use by system level application server components such as persistence managers, resource adapters, as well as EJB and Web application components.
UserTransaction | The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries.

Exception Summary
HeuristicCommitException | This exception is thrown by the rollback operation on a resource to report that a heuristic decision was made and that all relevant updates have been committed.
HeuristicMixedException | This exception is thrown to report that a heuristic decision was made and that some relevant updates have been committed and others have been rolled back.
HeuristicRollbackException | This exception is thrown by the commit operation to report that a heuristic decision was made and that all relevant updates have been rolled back.
InvalidTransactionException | This exception indicates that the request carried an invalid transaction context.
NotSupportedException | NotSupportedException exception indicates that the request cannot be executed because the operation is not a supported feature.
RollbackException | RollbackException exception is thrown when the transaction has been marked for rollback only or the transaction has been rolled back instead of committed.
SystemException | The SystemException is thrown by the transaction manager to indicate that it has encountered an unexpected error condition that prevents future transaction services from proceeding.
TransactionRequiredException | This exception indicates that a request carried a null transaction context, but the target object requires an activate transaction.
TransactionRolledbackException | This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back.

Package javax.transaction Description

Provides the API that defines the contract between the transaction manager and the various parties involved in a distributed transaction namely : resource manager, application, and application server. The implementation of this API is provided by the application server vendor and the resource manager driver vendor.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.transaction Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.transaction

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.transaction.HeuristicCommitException
        • javax.transaction.HeuristicMixedException
        • javax.transaction.HeuristicRollbackException
        • java.io.IOException
          • java.rmi.RemoteException
            • javax.transaction.InvalidTransactionException
            • javax.transaction.TransactionRequiredException
            • javax.transaction.TransactionRolledbackException
        • javax.transaction.NotSupportedException
        • javax.transaction.RollbackException
        • javax.transaction.SystemException

Interface Hierarchy

  • javax.transaction.Status
  • javax.transaction.Synchronization
  • javax.transaction.Transaction
  • javax.transaction.TransactionManager
  • javax.transaction.TransactionSynchronizationRegistry
  • javax.transaction.UserTransaction
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Status (Java EE 5)

javax.transaction
Interface Status

public interface Status

Status 接口定义用于事务状态代码的静态变量。
英文文档：

The Status interface defines static variables used for transaction status codes.

Field Summary
static int | STATUS_ACTIVE A transaction is associated with the target object and it is in the active state.
static int | STATUS_COMMITTED A transaction is associated with the target object and it has been committed.
static int | STATUS_COMMITTING A transaction is associated with the target object and it is in the process of committing.
static int | STATUS_MARKED_ROLLBACK A transaction is associated with the target object and it has been marked for rollback, perhaps as a result of a setRollbackOnly operation.
static int | STATUS_NO_TRANSACTION No transaction is currently associated with the target object.
static int | STATUS_PREPARED A transaction is associated with the target object and it has been prepared.
static int | STATUS_PREPARING A transaction is associated with the target object and it is in the process of preparing.
static int | STATUS_ROLLEDBACK A transaction is associated with the target object and the outcome has been determined to be rollback.
static int | STATUS_ROLLING_BACK A transaction is associated with the target object and it is in the process of rolling back.
static int | STATUS_UNKNOWN A transaction is associated with the target object but its current status cannot be determined.

Field Detail

英文文档：

STATUS_ACTIVE

static final int STATUS_ACTIVE
A transaction is associated with the target object and it is in the active state. An implementation returns this status after a transaction has been started and prior to a Coordinator issuing any prepares, unless the transaction has been marked for rollback.

See Also:
Constant Field Values

英文文档：

STATUS_MARKED_ROLLBACK

static final int STATUS_MARKED_ROLLBACK
A transaction is associated with the target object and it has been marked for rollback, perhaps as a result of a setRollbackOnly operation.

See Also:
Constant Field Values

英文文档：

STATUS_PREPARED

static final int STATUS_PREPARED
A transaction is associated with the target object and it has been prepared. That is, all subordinates have agreed to commit. The target object may be waiting for instructions from a superior as to how to proceed.

See Also:
Constant Field Values

英文文档：

STATUS_COMMITTED

static final int STATUS_COMMITTED
A transaction is associated with the target object and it has been committed. It is likely that heuristics exist; otherwise, the transaction would have been destroyed and NoTransaction returned.

See Also:
Constant Field Values

英文文档：

STATUS_ROLLEDBACK

static final int STATUS_ROLLEDBACK
A transaction is associated with the target object and the outcome has been determined to be rollback. It is likely that heuristics exist; otherwise, the transaction would have been destroyed and NoTransaction returned.

See Also:
Constant Field Values

英文文档：

STATUS_UNKNOWN

static final int STATUS_UNKNOWN
A transaction is associated with the target object but its current status cannot be determined. This is a transient condition and a subsequent invocation will ultimately return a different status.

See Also:
Constant Field Values

英文文档：

STATUS_NO_TRANSACTION

static final int STATUS_NO_TRANSACTION
No transaction is currently associated with the target object. This will occur after a transaction has completed.

See Also:
Constant Field Values

英文文档：

STATUS_PREPARING

static final int STATUS_PREPARING
A transaction is associated with the target object and it is in the process of preparing. An implementation returns this status if it has started preparing, but has not yet completed the process. The likely reason for this is that the implementation is probably waiting for responses to prepare from one or more Resources.

See Also:
Constant Field Values

英文文档：

STATUS_COMMITTING

static final int STATUS_COMMITTING
A transaction is associated with the target object and it is in the process of committing. An implementation returns this status if it has decided to commit but has not yet completed the committing process. This occurs because the implementation is probably waiting for responses from one or more Resources.

See Also:
Constant Field Values

英文文档：

STATUS_ROLLING_BACK

static final int STATUS_ROLLING_BACK
A transaction is associated with the target object and it is in the process of rolling back. An implementation returns this status if it has decided to rollback but has not yet completed the process. The implementation is probably waiting for responses from one or more Resources.

See Also:
Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Synchronization (Java EE 5)

javax.transaction
Interface Synchronization

public interface Synchronization

事务管理器支持一种同步机制，这种机制允许在事务完成之前和之后通知感兴趣的参与者。使用 registerSynchronization 方法，应用服务器可向当前与目标 Transaction 对象关联的事务注册一个 Synchronization 对象。
英文文档：

The transaction manager supports a synchronization mechanism that allows the interested party to be notified before and after the transaction completes. Using the registerSynchronization method, the application server registers a Synchronization object for the transaction currently associated with the target Transaction object.

Method Summary
void | afterCompletion(int status) This method is called by the transaction manager after the transaction is committed or rolled back.
void | beforeCompletion() The beforeCompletion method is called by the transaction manager prior to the start of the two-phase transaction commit process.

Method Detail

public void beforeCompletion()
在启动二阶段事务提交过程之前，事务管理器调用 beforeCompletion 方法。使用要提交的事务的事务上下文执行此调用。
英文文档：

beforeCompletion

void beforeCompletion()
The beforeCompletion method is called by the transaction manager prior to the start of the two-phase transaction commit process. This call is executed with the transaction context of the transaction that is being committed.

public void afterCompletion(int status)
提交或回滚事务之后，事务管理器调用此方法。
status 事务的完成状态。
英文文档：

afterCompletion

void afterCompletion(int status)
This method is called by the transaction manager after the transaction is committed or rolled back.

Parameters:
status - The status of the transaction completion.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Transaction (Java EE 5)

javax.transaction
Interface Transaction

public interface Transaction

Transaction 接口允许针对目标 Transaction 对象中的事务执行操作。创建每个全局事务时，也会相应地创建一个 Transaction 对象。Transaction 对象可用于资源登记、同步注册、事务完成和状态查询操作。
英文文档：

The Transaction interface allows operations to be performed against the transaction in the target Transaction object. A Transaction object is created corresponding to each global transaction creation. The Transaction object can be used for resource enlistment, synchronization registration, transaction completion, and status query operations.

Method Summary
void | commit() Complete the transaction represented by this Transaction object.
boolean | delistResource(XAResource xaRes, int flag) Disassociate the resource specified from the transaction associated with the target Transaction object.
boolean | enlistResource(XAResource xaRes) Enlist the resource specified with the transaction associated with the target Transaction object.
int | getStatus() Obtain the status of the transaction associated with the target Transaction object.
void | registerSynchronization(Synchronization sync) Register a synchronization object for the transaction currently associated with the target object.
void | rollback() Rollback the transaction represented by this Transaction object.
void | setRollbackOnly() Modify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction.

Method Detail

public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
完成此 Transaction 对象表示的事务。
Throws | RollbackException: 抛出该异常指示事务已经回滚，而不是提交。
Throws | HeuristicMixedException: 抛出该异常指示做出了启发式决策，提交了一部分相关更新，同时回滚了另一部分。
Throws | HeuristicRollbackException: 抛出该异常指示做出了启发式决策，回滚了所有相关更新。
Throws | SecurityException: 抛出该异常指示不允许线程提交事务。
Throws | IllegalStateException: 如果目标对象中的事务不是活动的，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

commit

void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   IllegalStateException,
                   SystemException
Complete the transaction represented by this Transaction object.

Throws:
RollbackException - Thrown to indicate that the transaction has been rolled back rather than committed.
HeuristicMixedException - Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
HeuristicRollbackException - Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back.
SecurityException - Thrown to indicate that the thread is not allowed to commit the transaction.
IllegalStateException - Thrown if the transaction in the target object is inactive.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public boolean delistResource(XAResource xaRes, int flag) throws IllegalStateException, SystemException
取消指定的资源与目标 Transaction 对象关联的事务之间的关联。
xaRes | 与资源关联的 XAResource 对象（连接）。
flag | TMSUCCESS、TMSUSPEND 或 TMFAIL 值之一。
Throws | IllegalStateException: 如果目标对象中的事务不是活动的，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
return | 如果成功取消了资源的登记，则返回 true；否则返回 false。
英文文档：

delistResource

boolean delistResource(XAResource xaRes,
                       int flag)
                       throws IllegalStateException,
                              SystemException
Disassociate the resource specified from the transaction associated with the target Transaction object.

Parameters:
xaRes - The XAResource object associated with the resource (connection).
flag - One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.
Returns:
true if the resource was delisted successfully; otherwise false.
Throws:
IllegalStateException - Thrown if the transaction in the target object is inactive.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public boolean enlistResource(XAResource xaRes) throws RollbackException, IllegalStateException, SystemException
登记与目标 Transaction 对象关联的事务指定的资源。
xaRes | 与资源关联的 XAResource 对象（连接）。
return | 如果成功登记了资源，则返回 true；否则返回 false。
Throws | RollbackException: 抛出该异常指示已将事务标记为只回滚。
Throws | IllegalStateException: 如果目标对象中的事务处于准备状态或者非活动状态，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

enlistResource

boolean enlistResource(XAResource xaRes)
                       throws RollbackException,
                              IllegalStateException,
                              SystemException
Enlist the resource specified with the transaction associated with the target Transaction object.

Parameters:
xaRes - The XAResource object associated with the resource (connection).
Returns:
true if the resource was enlisted successfully; otherwise false.
Throws:
RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public int getStatus() throws SystemException
获取与目标 Transaction 对象关联的事务的状态。
return | 事务状态。如果没有事务与目标对象关联，则此方法返回 Status.NoTransaction 值。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

getStatus

int getStatus()
              throws SystemException
Obtain the status of the transaction associated with the target Transaction object.

Returns:
The transaction status. If no transaction is associated with the target object, this method returns the Status.NoTransaction value.
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void registerSynchronization(Synchronization sync) throws RollbackException, IllegalStateException, SystemException
为当前与目标对象关联的事务注册一个同步对象。事务管理器在启动二阶段事务提交过程之前调用 beforeCompletion 方法。事务完成之后，事务管理器调用 afterCompletion 方法。
sync | 与目标对象关联的事务的 Synchronization 对象。
Throws | RollbackException: 抛出该异常指示已将事务标记为只回滚。
Throws | IllegalStateException: 如果目标对象中的事务处于准备状态或者非活动状态，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

registerSynchronization

void registerSynchronization(Synchronization sync)
                             throws RollbackException,
                                    IllegalStateException,
                                    SystemException
Register a synchronization object for the transaction currently associated with the target object. The transction manager invokes the beforeCompletion method prior to starting the two-phase transaction commit process. After the transaction is completed, the transaction manager invokes the afterCompletion method.

Parameters:
sync - The Synchronization object for the transaction associated with the target object.
Throws:
RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void rollback() throws IllegalStateException, SystemException
回滚此 Transaction 对象表示的事务。
Throws | IllegalStateException: 如果目标对象中的事务处于准备状态或者非活动状态，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

rollback

void rollback()
              throws IllegalStateException,
                     SystemException
Rollback the transaction represented by this Transaction object.

Throws:
IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void setRollbackOnly() throws IllegalStateException, SystemException
修改与目标对象关联的事务，从而使事务的唯一可能结果为回滚事务。
Throws | IllegalStateException: 如果目标对象不与任何事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

setRollbackOnly

void setRollbackOnly()
                     throws IllegalStateException,
                            SystemException
Modify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction.

Throws:
IllegalStateException - Thrown if the target object is not associated with any transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionManager (Java EE 5)

javax.transaction
Interface TransactionManager

public interface TransactionManager

TransactionManager 接口定义帮助应用服务器管理事务邦定的方法。
英文文档：

The TransactionManager interface defines the methods that allow an application server to manage transaction boundaries.

Method Summary
void | begin() Create a new transaction and associate it with the current thread.
void | commit() Complete the transaction associated with the current thread.
int | getStatus() Obtain the status of the transaction associated with the current thread.
Transaction | getTransaction() Get the transaction object that represents the transaction context of the calling thread.
void | resume(Transaction tobj) Resume the transaction context association of the calling thread with the transaction represented by the supplied Transaction object.
void | rollback() Roll back the transaction associated with the current thread.
void | setRollbackOnly() Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
void | setTransactionTimeout(int seconds) Modify the timeout value that is associated with transactions started by the current thread with the begin method.
Transaction | suspend() Suspend the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended.

Method Detail

public void begin() throws NotSupportedException, SystemException
创建一个新事务，并将其与当前线程关联。
Throws | NotSupportedException: 如果线程已经与事务关联，但 TransactionManager 实现不支持嵌套的事务。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

begin

void begin()
           throws NotSupportedException,
                  SystemException
Create a new transaction and associate it with the current thread.

Throws:
NotSupportedException - Thrown if the thread is already associated with a transaction and the Transaction Manager implementation does not support nested transactions.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
完成与当前线程关联的事务。完成此方法时，线程不再与事务关联。
Throws | RollbackException: 抛出该异常指示事务已经回滚，而不是提交。
Throws | HeuristicMixedException: 抛出该异常指示做出了启发式决策，提交了一部分相关更新，同时回滚了另一部分。
Throws | HeuristicRollbackException: 抛出该异常指示做出了启发式决策，回滚了所有相关更新。
Throws | SecurityException: 抛出该异常指示不允许线程提交事务。
Throws | IllegalStateException: 如果当前线程不与事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

commit

void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   IllegalStateException,
                   SystemException
Complete the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Throws:
RollbackException - Thrown to indicate that the transaction has been rolled back rather than committed.
HeuristicMixedException - Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
HeuristicRollbackException - Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back.
SecurityException - Thrown to indicate that the thread is not allowed to commit the transaction.
IllegalStateException - Thrown if the current thread is not associated with a transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public int getStatus() throws SystemException
获取与当前线程关联的事务状态。
return | 事务状态。如果没有任何事务与当前线程关联，则此方法返回 Status.NoTransaction 值。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

getStatus

int getStatus()
              throws SystemException
Obtain the status of the transaction associated with the current thread.

Returns:
The transaction status. If no transaction is associated with the current thread, this method returns the Status.NoTransaction value.
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public Transaction getTransaction() throws SystemException
获取表示调用线程的事务上下文的事务对象。
return | 表示与调用线程关联的事务的 Transaction 对象。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

getTransaction

Transaction getTransaction()
                           throws SystemException
Get the transaction object that represents the transaction context of the calling thread.

Returns:
the Transaction object representing the transaction associated with the calling thread.
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void resume(Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException
恢复调用线程与所提供的 Transaction 对象表示的事务的事务上下文关联。当此方法返回时，调用线程与指定的事务上下文关联。
tobj | 表示要恢复的事务的 Transaction 对象。
Throws | InvalidTransactionException: 如果参数事务对象包含一个无效的事务，则抛出此异常。
Throws | IllegalStateException: 如果线程已与另一个事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

resume

void resume(Transaction tobj)
            throws InvalidTransactionException,
                   IllegalStateException,
                   SystemException
Resume the transaction context association of the calling thread with the transaction represented by the supplied Transaction object. When this method returns, the calling thread is associated with the transaction context specified.

Parameters:
tobj - The Transaction object that represents the transaction to be resumed.
Throws:
InvalidTransactionException - Thrown if the parameter transaction object contains an invalid transaction.
IllegalStateException - Thrown if the thread is already associated with another transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void rollback() throws IllegalStateException, SecurityException, SystemException
回滚与当前线程关联的事务。完成此方法时，线程不再与事务关联。
Throws | SecurityException: 抛出该异常指示不允许线程回滚事务。
Throws | IllegalStateException: 如果当前线程不与事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

rollback

void rollback()
              throws IllegalStateException,
                     SecurityException,
                     SystemException
Roll back the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Throws:
SecurityException - Thrown to indicate that the thread is not allowed to roll back the transaction.
IllegalStateException - Thrown if the current thread is not associated with a transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void setRollbackOnly() throws IllegalStateException, SystemException
修改与当前线程关联的事务，从而使事务的唯一可能结果为回滚事务。
Throws | IllegalStateException: 如果当前线程不与事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

setRollbackOnly

void setRollbackOnly()
                     throws IllegalStateException,
                            SystemException
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.

Throws:
IllegalStateException - Thrown if the current thread is not associated with a transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void setTransactionTimeout(int seconds) throws SystemException
修改与事务关联的超时值，这些事务由当前线程通过 begin 方法启动。

如果应用程序没有调用此方法，则事务服务对事务超时使用某个默认值。

seconds | 超时值（以秒为单位）。如果值为 0，则事务服务恢复默认值。如果值为负，则抛出 SystemException。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

setTransactionTimeout

void setTransactionTimeout(int seconds)
                           throws SystemException
Modify the timeout value that is associated with transactions started by the current thread with the begin method.

If an application has not called this method, the transaction service uses some default value for the transaction timeout.

Parameters:
seconds - The value of the timeout in seconds. If the value is zero, the transaction service restores the default value. If the value is negative a SystemException is thrown.
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public Transaction suspend() throws SystemException
将当前与调用线程关联的事务挂起，并返回一个表示被挂起的事务上下文的 Transaction 对象。如果调用线程没有与事务关联，则该方法返回一个 null 对象引用。当此方法返回时，调用线程未与任何事务关联。
return | 表示被挂起事务的 Transaction 对象。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

suspend

Transaction suspend()
                    throws SystemException
Suspend the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended. If the calling thread is not associated with a transaction, the method returns a null object reference. When this method returns, the calling thread is not associated with a transaction.

Returns:
Transaction object representing the suspended transaction.
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionSynchronizationRegistry (Java EE 5)

javax.transaction
Interface TransactionSynchronizationRegistry

public interface TransactionSynchronizationRegistry

此接口供系统级应用服务器组件（比如持久性管理器、资源适配器）以及 EJB 和 Web 应用程序组件使用。此类可以注册带有特殊排序语义的同步对象，将资源对象与当前事务关联，获取当前事务的事务上下文，获取当前事务状态，并将当前事务标记为回滚。 此接口由应用服务器通过一个无状态服务对象实现。这个对象还可以用于任意数量的线程安全的组件。

在标准的应用服务器环境中，可以通过 JNDI 使用标准名称查询实现此接口的实例。标准名称是 java:comp/TransactionSynchronizationRegistry。

since JTA 1.1
英文文档：

This interface is intended for use by system level application server components such as persistence managers, resource adapters, as well as EJB and Web application components. This provides the ability to register synchronization objects with special ordering semantics, associate resource objects with the current transaction, get the transaction context of the current transaction, get current transaction status, and mark the current transaction for rollback. This interface is implemented by the application server by a stateless service object. The same object can be used by any number of components with thread safety.

In standard application server environments, an instance implementing this interface can be looked up by a standard name via JNDI. The standard name is java:comp/TransactionSynchronizationRegistry.

Since:
JTA 1.1

Method Summary
Object | getResource(Object key) Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
boolean | getRollbackOnly() Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
Object | getTransactionKey() Return an opaque object to represent the transaction bound to the current thread at the time this method is called.
int | getTransactionStatus() Return the status of the transaction bound to the current thread at the time this method is called.
void | putResource(Object key, Object value) Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
void | registerInterposedSynchronization(Synchronization sync) Register a Synchronization instance with special ordering semantics.
void | setRollbackOnly() Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.

Method Detail

public Object getTransactionKey()
返回一个不透明对象，以表示调用此方法时邦定到当前线程的事务。此对象重写 hashCode 和 equals，以允许将其作为 hashMap 中的键供调用者使用。如果当前没有活动的事务，则返回 null。

此对象将返回相同的 hashCode，并且对于相同应用服务器的相同事务上下文中执行的任何组件，调用此方法所返回所有其他对象都与此对象相等。

toString 方法返回一个 String，这将有助于人类读者更好地理解事务上下文。toString 结果的其他方面都没有定义。尤其不保证 toString 的结果具有向前或向后兼容性。

对象不必是可序列化的，而且没有定义获取对象的虚拟机外部的任何行为。

return | 一个不透明对象，它表示调用此方法时当前线程的事务邦定。
since | JTA 1.1
英文文档：

getTransactionKey

Object getTransactionKey()
Return an opaque object to represent the transaction bound to the current thread at the time this method is called. This object overrides hashCode and equals to allow its use as the key in a hashMap for use by the caller. If there is no transaction currently active, return null.

This object will return the same hashCode and compare equal to all other objects returned by calling this method from any component executing in the same transaction context in the same application server.

The toString method returns a String that might be usable by a human reader to usefully understand the transaction context. The toString result is otherwise not defined. Specifically, there is no forward or backward compatibility guarantee of the results of toString.

The object is not necessarily serializable, and has no defined behavior outside the virtual machine whence it was obtained.

Returns:
an opaque object representing the transaction bound to the current thread at the time this method is called.
Since:
JTA 1.1

public void putResource(Object key, Object value)
添加或替换资源 Map 中的一个对象，调用此方法时正为绑定到当前线程的事务管理着这些资源。提供的键应该是一个调用者定义的类，以避免与其他用户冲突。键的类必须保证 hashCode 和 equals 方法可以用作映射中的键。实现不会检查或使用键和值。此方法的常规协定为，支持非 null 键和 null 值的 Map 的 put(Object, Object)。例如，如果已有一个与键关联的值，那么它会被 value 参数取代。
key | Map 条目的键。
value | Map 条目的值。
Throws | IllegalStateException: 如果没有任何事务处于活动状态。
Throws | NullPointerException: 如果参数 key 为 null。
since | JTA 1.1
英文文档：

putResource

void putResource(Object key,
                 Object value)
Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called. The supplied key should be of an caller- defined class so as not to conflict with other users. The class of the key must guarantee that the hashCode and equals methods are suitable for use as keys in a map. The key and value are not examined or used by the implementation. The general contract of this method is that of Map.put(Object, Object) for a Map that supports non-null keys and null values. For example, if there is already an value associated with the key, it is replaced by the value parameter.

Parameters:
key - the key for the Map entry.
value - the value for the Map entry.
Throws:
IllegalStateException - if no transaction is active.
NullPointerException - if the parameter key is null.
Since:
JTA 1.1

public Object getResource(Object key)
从资源 Map 中获取一个对象，调用此方法时正为邦定到当前线程的事务管理着这些资源。应该通过在同一个事务中调用 putResouce 提前提供键。如果不能在当前资源 Map 中找到键，则返回 null。此方法的常规协定为，支持非 null 键和 null 值的 Map 的 get(Object)。例如，如果没有参数键条目或者与键关联的值实际上为 null，则返回值为 null。
key | Map 条目的键。
return | 与该键关联的值。
Throws | IllegalStateException: 如果没有任何事务处于活动状态。
Throws | NullPointerException: 如果参数 key 为 null。
since | JTA 1.1
英文文档：

getResource

Object getResource(Object key)
Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called. The key should have been supplied earlier by a call to putResouce in the same transaction. If the key cannot be found in the current resource Map, null is returned. The general contract of this method is that of Map.get(Object) for a Map that supports non-null keys and null values. For example, the returned value is null if there is no entry for the parameter key or if the value associated with the key is actually null.

Parameters:
key - the key for the Map entry.
Returns:
the value associated with the key.
Throws:
IllegalStateException - if no transaction is active.
NullPointerException - if the parameter key is null.
Since:
JTA 1.1

public void registerInterposedSynchronization(Synchronization sync)
注册一个具有特殊排序语义的 Synchronization 实例。其 beforeCompletion 将在所有 SessionSynchronization beforeCompletion 回调和直接向 Transaction 注册的回调之后，但在启动二阶段提交过程之前调用。同样，afterCompletion 回调将在二阶段提交完成之后，但在任何 SessionSynchronization 和 Transaction afterCompletion 回调之前调用。

beforeCompletion 回调将在调用此方法时当前线程事务邦定的事务上下文中调用。允许的方法包括访问资源，例如 Connector。不允许访问“用户组件”（例如，计时器服务或 Bean 方法），因为这可能更改调用者管理的数据状态，也可能更改已经由 registerInterposedSynchronization 的另一个调用者刷新的数据状态。常规上下文是 registerInterposedSynchronization 调用者的组件上下文。

将调用 afterCompletion 回调的上下文中是不确定的。正如上面所定义的，不允许访问“用户组件”。可以关闭资源，但是不能对其执行任何事务性操作。

如果调用此方法时没有活动的事务上下文，则抛出 IllegalStateException。

如果在启动二阶段提交过程之后调用此方法，则抛出 IllegalStateException。

sync | Synchronization 实例。
Throws | IllegalStateException: 如果没有任何事务处于活动状态。
since | JTA 1.1
英文文档：

registerInterposedSynchronization

void registerInterposedSynchronization(Synchronization sync)
Register a Synchronization instance with special ordering semantics. Its beforeCompletion will be called after all SessionSynchronization beforeCompletion callbacks and callbacks registered directly with the Transaction, but before the 2-phase commit process starts. Similarly, the afterCompletion callback will be called after 2-phase commit completes but before any SessionSynchronization and Transaction afterCompletion callbacks.

The beforeCompletion callback will be invoked in the transaction context of the transaction bound to the current thread at the time this method is called. Allowable methods include access to resources, e.g. Connectors. No access is allowed to "user components" (e.g. timer services or bean methods), as these might change the state of data being managed by the caller, and might change the state of data that has already been flushed by another caller of registerInterposedSynchronization. The general context is the component context of the caller of registerInterposedSynchronization.

The afterCompletion callback will be invoked in an undefined context. No access is permitted to "user components" as defined above. Resources can be closed but no transactional work can be performed with them.

If this method is invoked without an active transaction context, an IllegalStateException is thrown.

If this method is invoked after the two-phase commit processing has started, an IllegalStateException is thrown.

Parameters:
sync - the Synchronization instance.
Throws:
IllegalStateException - if no transaction is active.
Since:
JTA 1.1

public int getTransactionStatus()
返回调用此方法时当前线程事务邦定的状态。这是在调用此方法时当前线程事务邦定的上下文中执行 TransactionManager.getStatus() 的结果。
return | 调用此方法时当前线程事务邦定的状态。
since | JTA 1.1
英文文档：

getTransactionStatus

int getTransactionStatus()
Return the status of the transaction bound to the current thread at the time this method is called. This is the result of executing TransactionManager.getStatus() in the context of the transaction bound to the current thread at the time this method is called.

Returns:
the status of the transaction bound to the current thread at the time this method is called.
Since:
JTA 1.1

public void setRollbackOnly()
设置调用此方法时当前线程事务邦定的 rollbackOnly 状态。
Throws | IllegalStateException: 如果没有任何事务处于活动状态。
since | JTA 1.1
英文文档：

setRollbackOnly

void setRollbackOnly()
Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.

Throws:
IllegalStateException - if no transaction is active.
Since:
JTA 1.1

public boolean getRollbackOnly()
获取调用此方法时当前线程事务邦定的 rollbackOnly 状态。
return | rollbackOnly 状态
Throws | IllegalStateException: 如果没有任何事务处于活动状态。
since | JTA 1.1
英文文档：

getRollbackOnly

boolean getRollbackOnly()
Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.

Returns:
the rollbackOnly status.
Throws:
IllegalStateException - if no transaction is active.
Since:
JTA 1.1
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UserTransaction (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.transaction
Interface UserTransaction

public interface UserTransaction

UserTransaction 接口定义帮助应用程序显式管理事务邦定的方法。
英文文档：

The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries.

Method Summary
void | begin() Create a new transaction and associate it with the current thread.
void | commit() Complete the transaction associated with the current thread.
int | getStatus() Obtain the status of the transaction associated with the current thread.
void | rollback() Roll back the transaction associated with the current thread.
void | setRollbackOnly() Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
void | setTransactionTimeout(int seconds) Modify the timeout value that is associated with transactions started by the current thread with the begin method.

Method Detail

public void begin() throws NotSupportedException, SystemException
创建一个新事务，并将其与当前线程关联。
Throws | NotSupportedException: 如果线程已经与事务关联，但 TransactionManager 实现不支持嵌套的事务。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

begin

void begin()
           throws NotSupportedException,
                  SystemException
Create a new transaction and associate it with the current thread.

Throws:
NotSupportedException - Thrown if the thread is already associated with a transaction and the Transaction Manager implementation does not support nested transactions.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
完成与当前线程关联的事务。完成此方法时，线程不再与事务关联。
Throws | RollbackException: 抛出该异常指示事务已经回滚，而不是提交。
Throws | HeuristicMixedException: 抛出该异常指示做出了启发式决策，提交了一部分相关更新，同时回滚了另一部分。
Throws | HeuristicRollbackException: 抛出该异常指示做出了启发式决策，回滚了所有相关更新。
Throws | SecurityException: 抛出该异常指示不允许线程提交事务。
Throws | IllegalStateException: 如果当前线程不与事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

commit

void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   IllegalStateException,
                   SystemException
Complete the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Throws:
RollbackException - Thrown to indicate that the transaction has been rolled back rather than committed.
HeuristicMixedException - Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
HeuristicRollbackException - Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back.
SecurityException - Thrown to indicate that the thread is not allowed to commit the transaction.
IllegalStateException - Thrown if the current thread is not associated with a transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void rollback() throws IllegalStateException, SecurityException, SystemException
回滚与当前线程关联的事务。完成此方法时，线程不再与事务关联。
Throws | SecurityException: 抛出该异常指示不允许线程回滚事务。
Throws | IllegalStateException: 如果当前线程不与事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

rollback

void rollback()
              throws IllegalStateException,
                     SecurityException,
                     SystemException
Roll back the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Throws:
SecurityException - Thrown to indicate that the thread is not allowed to roll back the transaction.
IllegalStateException - Thrown if the current thread is not associated with a transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void setRollbackOnly() throws IllegalStateException, SystemException
修改与当前线程关联的事务，从而使事务的唯一可能结果为回滚事务。
Throws | IllegalStateException: 如果当前线程不与事务关联，则抛出该异常。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

setRollbackOnly

void setRollbackOnly()
                     throws IllegalStateException,
                            SystemException
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.

Throws:
IllegalStateException - Thrown if the current thread is not associated with a transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public int getStatus() throws SystemException
获取与当前线程关联的事务状态。
return | 事务状态。如果没有任何事务与当前线程关联，则此方法返回 Status.NoTransaction 值。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

getStatus

int getStatus()
              throws SystemException
Obtain the status of the transaction associated with the current thread.

Returns:
The transaction status. If no transaction is associated with the current thread, this method returns the Status.NoTransaction value.
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

public void setTransactionTimeout(int seconds) throws SystemException
修改与事务关联的超时值，这些事务由当前线程通过 begin 方法启动。

如果应用程序没有调用此方法，则事务服务对事务超时使用某个默认值。

seconds | 超时值（以秒为单位）。如果值为 0，则事务服务恢复默认值。如果值为负，则抛出 SystemException。
Throws | SystemException: 如果事务管理器遇到不可预料的错误情况，则抛出该异常。
英文文档：

setTransactionTimeout

void setTransactionTimeout(int seconds)
                           throws SystemException
Modify the timeout value that is associated with transactions started by the current thread with the begin method.

If an application has not called this method, the transaction service uses some default value for the transaction timeout.

Parameters:
seconds - The value of the timeout in seconds. If the value is zero, the transaction service restores the default value. If the value is negative a SystemException is thrown.
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HeuristicCommitException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.transaction
Class HeuristicCommitException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.transaction.HeuristicCommitException
All Implemented Interfaces:
Serializable
public class HeuristicCommitException
extends Exception

Extends: Throwable > Exception

对资源进行的回滚操作抛出此异常报告作出了一个启发式决策，并且提交了所有相关更新。
英文文档：

This exception is thrown by the rollback operation on a resource to report that a heuristic decision was made and that all relevant updates have been committed.

See Also:
Serialized Form

Constructor Summary
HeuristicCommitException()
HeuristicCommitException(String msg)
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

public HeuristicCommitException()
英文文档：

HeuristicCommitException

public HeuristicCommitException()

public HeuristicCommitException(String msg)
英文文档：

HeuristicCommitException

public HeuristicCommitException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HeuristicMixedException (Java EE 5)

javax.transaction
Class HeuristicMixedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.transaction.HeuristicMixedException
All Implemented Interfaces:
Serializable
public class HeuristicMixedException
extends Exception

Extends: Throwable > Exception

抛出此异常报告作出了一个启发式决策，并且提交了一些相关更新，其他更新已经回滚。
英文文档：

This exception is thrown to report that a heuristic decision was made and that some relevant updates have been committed and others have been rolled back.

See Also:
Serialized Form

Constructor Summary
HeuristicMixedException()
HeuristicMixedException(String msg)
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

public HeuristicMixedException()
英文文档：

HeuristicMixedException

public HeuristicMixedException()

public HeuristicMixedException(String msg)
英文文档：

HeuristicMixedException

public HeuristicMixedException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HeuristicRollbackException (Java EE 5)

javax.transaction
Class HeuristicRollbackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.transaction.HeuristicRollbackException
All Implemented Interfaces:
Serializable
public class HeuristicRollbackException
extends Exception

Extends: Throwable > Exception

提交操作抛出此异常报告作出了一个启发式决策，并且回滚了所有相关更新。
英文文档：

This exception is thrown by the commit operation to report that a heuristic decision was made and that all relevant updates have been rolled back.

See Also:
Serialized Form

Constructor Summary
HeuristicRollbackException()
HeuristicRollbackException(String msg)
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

public HeuristicRollbackException()
英文文档：

HeuristicRollbackException

public HeuristicRollbackException()

public HeuristicRollbackException(String msg)
英文文档：

HeuristicRollbackException

public HeuristicRollbackException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidTransactionException (Java EE 5)

javax.transaction
Class InvalidTransactionException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.io.IOException
                extended by  java.rmi.RemoteException
                    extended by  javax.transaction.InvalidTransactionException
All Implemented Interfaces:
Serializable
public class InvalidTransactionException
extends RemoteException

Extends: Throwable > Exception > java.io.IOException > java.rmi.RemoteException

此异常指示该请求带来了无效的事务上下文。例如，如果在尝试注册资源时发生错误，则引发此异常。
英文文档：

This exception indicates that the request carried an invalid transaction context. For example, this exception could be raised if an error occured when trying to register a resource.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.rmi.RemoteException
detail
Constructor Summary
InvalidTransactionException()
InvalidTransactionException(String msg)
Method Summary
Methods inherited from class java.rmi.RemoteException
getCause, getMessage
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, 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

public InvalidTransactionException()
英文文档：

InvalidTransactionException

public InvalidTransactionException()

public InvalidTransactionException(String msg)
英文文档：

InvalidTransactionException

public InvalidTransactionException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotSupportedException (Java EE 5)

javax.transaction
Class NotSupportedException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.transaction.NotSupportedException
All Implemented Interfaces:
Serializable
public class NotSupportedException
extends Exception

Extends: Throwable > Exception

NotSupportedException 异常指示不能执行请求，因为该操作不是一个受支持的功能。例如，因为嵌套事务不受支持，所以，当与某个事务关联的调用线程试图启动一个新事务时，Transaction Manager 将抛出此异常。（当与一个事务关联的线程试图启动第二个事务时，就会发生嵌套事务）。
英文文档：

NotSupportedException exception indicates that the request cannot be executed because the operation is not a supported feature. For example, because nested transactions are not supported, the Transaction Manager throws this exception when a calling thread that is already associated with a transaction attempts to start a new transaction. (A nested transaction occurs when a thread is already associated with one transaction and attempts to start a second transaction.)

See Also:
Serialized Form

Constructor Summary
NotSupportedException()
NotSupportedException(String msg)
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

public NotSupportedException()
英文文档：

NotSupportedException

public NotSupportedException()

public NotSupportedException(String msg)
英文文档：

NotSupportedException

public NotSupportedException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RollbackException (Java EE 5)

javax.transaction
Class RollbackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.transaction.RollbackException
All Implemented Interfaces:
Serializable
public class RollbackException
extends Exception

Extends: Throwable > Exception

当事务被标记为只回滚或者事务已被回滚而不是被提交时，抛出 RollbackException 异常。这是一个由 UserTransaction、Transaction 和 TransactionManager 接口中的方法抛出的本地异常。
英文文档：

RollbackException exception is thrown when the transaction has been marked for rollback only or the transaction has been rolled back instead of committed. This is a local exception thrown by methods in the UserTransaction, Transaction, and TransactionManager interfaces.

See Also:
Serialized Form

Constructor Summary
RollbackException()
RollbackException(String msg)
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

public RollbackException()
英文文档：

RollbackException

public RollbackException()

public RollbackException(String msg)
英文文档：

RollbackException

public RollbackException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SystemException (Java EE 5)

javax.transaction
Class SystemException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.transaction.SystemException
All Implemented Interfaces:
Serializable
public class SystemException
extends Exception

Extends: Throwable > Exception

事务管理器抛出 SystemException 指示它遇到了一个不可预料的错误条件，该错误条件阻止了事务服务的继续进行。
英文文档：

The SystemException is thrown by the transaction manager to indicate that it has encountered an unexpected error condition that prevents future transaction services from proceeding.

See Also:
Serialized Form

Field Summary
 int errorCode
The error code with which to create the SystemException.
Constructor Summary
SystemException()
SystemException(int errcode)
Create a SystemException with a given error code.
SystemException(String s)
Create a SystemException with a given string.
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

Field Detail

英文文档：

errorCode

public int errorCode
The error code with which to create the SystemException.

Constructor Detail

public SystemException()
英文文档：

SystemException

public SystemException()

public SystemException(String s)
创建一个具有给定字符串的 XAException。
s 异常的字符串消息
英文文档：

SystemException

public SystemException(String s)
Create a SystemException with a given string.

Parameters:
s - The string message for the exception

public SystemException(int errcode)
创建一个具有给定错误代码的 SystemException。
errcode 该异常的错误代码
英文文档：

SystemException

public SystemException(int errcode)
Create a SystemException with a given error code.

Parameters:
errcode - The error code for the exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionRequiredException (Java EE 5)

javax.transaction
Class TransactionRequiredException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.io.IOException
                extended by  java.rmi.RemoteException
                    extended by  javax.transaction.TransactionRequiredException
All Implemented Interfaces:
Serializable
public class TransactionRequiredException
extends RemoteException

Extends: Throwable > Exception > java.io.IOException > java.rmi.RemoteException

此异常指示某个请求带来了 null 事务上下文，但目标对象需要激活的事务。
英文文档：

This exception indicates that a request carried a null transaction context, but the target object requires an activate transaction.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.rmi.RemoteException
detail
Constructor Summary
TransactionRequiredException()
TransactionRequiredException(String msg)
Method Summary
Methods inherited from class java.rmi.RemoteException
getCause, getMessage
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, 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

public TransactionRequiredException()
英文文档：

TransactionRequiredException

public TransactionRequiredException()

public TransactionRequiredException(String msg)
英文文档：

TransactionRequiredException

public TransactionRequiredException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TransactionRolledbackException (Java EE 5)

javax.transaction
Class TransactionRolledbackException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.io.IOException
                extended by  java.rmi.RemoteException
                    extended by  javax.transaction.TransactionRolledbackException
All Implemented Interfaces:
Serializable
public class TransactionRolledbackException
extends RemoteException

Extends: Throwable > Exception > java.io.IOException > java.rmi.RemoteException

此异常指示与请求处理关联的事务已回滚，或已标记为回滚。因此，请求操作不能执行或没有执行，因为代表该事务进行下一步计算是无效的。
英文文档：

This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back. Thus the requested operation either could not be performed or was not performed because further computation on behalf of the transaction would be fruitless

See Also:
Serialized Form

Field Summary
Fields inherited from class java.rmi.RemoteException
detail
Constructor Summary
TransactionRolledbackException()
TransactionRolledbackException(String msg)
Method Summary
Methods inherited from class java.rmi.RemoteException
getCause, getMessage
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, 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

public TransactionRolledbackException()
英文文档：

TransactionRolledbackException

public TransactionRolledbackException()

public TransactionRolledbackException(String msg)
英文文档：

TransactionRolledbackException

public TransactionRolledbackException(String msg)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.transaction.xa (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.transaction.xa

Provides the API that defines the contract between the transaction manager and the resource manager, which allows the transaction manager to enlist and delist resource objects (supplied by the resource manager driver) in JTA transactions.

See:
Description

Interface Summary
XAResource | The XAResource interface is a Java mapping of the industry standard XA interface based on the X/Open CAE Specification (Distributed Transaction Processing: The XA Specification).
Xid | The Xid interface is a Java mapping of the X/Open transaction identifier XID structure.

Exception Summary
XAException The XAException is thrown by the Resource Manager (RM) to inform the Transaction Manager of an error encountered by the involved transaction.

Package javax.transaction.xa Description

Provides the API that defines the contract between the transaction manager and the resource manager, which allows the transaction manager to enlist and delist resource objects (supplied by the resource manager driver) in JTA transactions. The driver vendor for a specific resource manager provides the implementation of this API.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.transaction.xa Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.transaction.xa

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.transaction.xa.XAException

Interface Hierarchy

  • javax.transaction.xa.XAResource
  • javax.transaction.xa.Xid
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


XAResource (Java EE 5)

javax.transaction.xa
Interface XAResource

public interface XAResource

XAResource 接口是基于 X/Open CAE 规范（分布式事务处理：XA 规范）的工业标准 XA 接口的 Java 映射。

在分布式事务处理 (DTP) 环境中，XA 接口定义资源管理器和事务管理器之间的协定。JDBC 驱动程序或 JMS 提供者实现此接口，以支持全局事务与数据库或消息服务连接之间的关联。

可由应用程序在外部事务管理器控制事务的环境中使用的任何事务资源均可支持 XAResource 接口。数据库管理系统就属于此类资源。应用程序可以通过多个数据库连接访问数据。使用事务管理器将每个数据库连接作为事务资源进行登记。事务管理器获取参与全局事务的每个连接的 XAResource。事务管理器使用 start 方法建立全局事务与资源之间的关联，使用 end 方法取消事务与资源之间的关联。资源管理器负责将全局事务关联到在 start 与 end 方法调用之间对其数据执行的所有工作。

在事务提交时，事务管理器通知资源管理器根据二阶段提交协议准备、提交或回滚事务。

英文文档：

The XAResource interface is a Java mapping of the industry standard XA interface based on the X/Open CAE Specification (Distributed Transaction Processing: The XA Specification).

The XA interface defines the contract between a Resource Manager and a Transaction Manager in a distributed transaction processing (DTP) environment. A JDBC driver or a JMS provider implements this interface to support the association between a global transaction and a database or message service connection.

The XAResource interface can be supported by any transactional resource that is intended to be used by application programs in an environment where transactions are controlled by an external transaction manager. An example of such a resource is a database management system. An application may access data through multiple database connections. Each database connection is enlisted with the transaction manager as a transactional resource. The transaction manager obtains an XAResource for each connection participating in a global transaction. The transaction manager uses the start method to associate the global transaction with the resource, and it uses the end method to disassociate the transaction from the resource. The resource manager is responsible for associating the global transaction to all work performed on its data between the start and end method invocations.

At transaction commit time, the resource managers are informed by the transaction manager to prepare, commit, or rollback a transaction according to the two-phase commit protocol.

Field Summary
static int | TMENDRSCAN Ends a recovery scan.
static int | TMFAIL Disassociates the caller and marks the transaction branch rollback-only.
static int | TMJOIN Caller is joining existing transaction branch.
static int | TMNOFLAGS Use TMNOFLAGS to indicate no flags value is selected.
static int | TMONEPHASE Caller is using one-phase optimization.
static int | TMRESUME Caller is resuming association with a suspended transaction branch.
static int | TMSTARTRSCAN Starts a recovery scan.
static int | TMSUCCESS Disassociates caller from a transaction branch.
static int | TMSUSPEND Caller is suspending (not ending) its association with a transaction branch.
static int | XA_OK The transaction work has been prepared normally.
static int | XA_RDONLY The transaction branch has been read-only and has been committed.
Method Summary
void | commit(Xid xid, boolean onePhase) Commits the global transaction specified by xid.
void | end(Xid xid, int flags) Ends the work performed on behalf of a transaction branch.
void | forget(Xid xid) Tells the resource manager to forget about a heuristically completed transaction branch.
int | getTransactionTimeout() Obtains the current transaction timeout value set for this XAResource instance.
boolean | isSameRM(XAResource xares) This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager instance represented by the parameter xares.
int | prepare(Xid xid) Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
Xid[] | recover(int flag) Obtains a list of prepared transaction branches from a resource manager.
void | rollback(Xid xid) Informs the resource manager to roll back work done on behalf of a transaction branch.
boolean | setTransactionTimeout(int seconds) Sets the current transaction timeout value for this XAResource instance.
void | start(Xid xid, int flags) Starts work on behalf of a transaction branch specified in xid.

Field Detail

英文文档：

TMENDRSCAN

static final int TMENDRSCAN
Ends a recovery scan.

See Also:
Constant Field Values

英文文档：

TMFAIL

static final int TMFAIL
Disassociates the caller and marks the transaction branch rollback-only.

See Also:
Constant Field Values

英文文档：

TMJOIN

static final int TMJOIN
Caller is joining existing transaction branch.

See Also:
Constant Field Values

英文文档：

TMNOFLAGS

static final int TMNOFLAGS
Use TMNOFLAGS to indicate no flags value is selected.

See Also:
Constant Field Values

英文文档：

TMONEPHASE

static final int TMONEPHASE
Caller is using one-phase optimization.

See Also:
Constant Field Values

英文文档：

TMRESUME

static final int TMRESUME
Caller is resuming association with a suspended transaction branch.

See Also:
Constant Field Values

英文文档：

TMSTARTRSCAN

static final int TMSTARTRSCAN
Starts a recovery scan.

See Also:
Constant Field Values

英文文档：

TMSUCCESS

static final int TMSUCCESS
Disassociates caller from a transaction branch.

See Also:
Constant Field Values

英文文档：

TMSUSPEND

static final int TMSUSPEND
Caller is suspending (not ending) its association with a transaction branch.

See Also:
Constant Field Values

英文文档：

XA_RDONLY

static final int XA_RDONLY
The transaction branch has been read-only and has been committed.

See Also:
Constant Field Values

英文文档：

XA_OK

static final int XA_OK
The transaction work has been prepared normally.

See Also:
Constant Field Values
Method Detail

public void commit(Xid xid, boolean onePhase) throws XAException
提交 xid 指定的全局事务。
xid | 全局事务标识符
onePhase | 如果为 true，则资源管理器应使用单阶段提交协议提交代表 xid 执行的工作。
Throws | XAException: 发生错误。可能的 XAExceptions 有 XA_HEURHAZ、XA_HEURCOM、XA_HEURRB、XA_HEURMIX、XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。 如果资源管理器不提交事务，并且将参数 onePhase 设置为 true，则资源管理器可能抛出 XA_RB* 异常之一。返回后，资源管理器回滚分支的工作，并释放所有占用的资源。
英文文档：

commit

void commit(Xid xid,
            boolean onePhase)
            throws XAException
Commits the global transaction specified by xid.

Parameters:
xid - A global transaction identifier
onePhase - If true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid.
Throws:
XAException - An error has occurred. Possible XAExceptions are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

If the resource manager did not commit the transaction and the parameter onePhase is set to true, the resource manager may throw one of the XA_RB* exceptions. Upon return, the resource manager has rolled back the branch's work and has released all held resources.

public void end(Xid xid, int flags) throws XAException
终止代表事务分支所执行的工作。资源管理器取消 XA 资源与指定的事务分支的关联，并使事务完成。

如果在标志中指定为 TMSUSPEND，则事务分支将以未完成状态暂时挂起。事务上下文处于挂起状态，必须通过 start 方法（将标志指定为 TMRESUME）恢复。

如果指定为 TMFAIL，则部分工作将失败。资源管理器可以将事务标记为只回滚

如果指定为 TMSUCCESS，则将完成部分工作。

xid | 全局事务标识符，它与以前在 start 方法中使用的标识符相同。
flags | TMSUCCESS、TMFAIL 或 TMSUSPEND 之一。
Throws | XAException: 发生错误。可能的 XAException 值有 XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL、XAER_PROTO 或 XA_RB*。
英文文档：

end

void end(Xid xid,
         int flags)
         throws XAException
Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource from the transaction branch specified and lets the transaction complete.

If TMSUSPEND is specified in the flags, the transaction branch is temporarily suspended in an incomplete state. The transaction context is in a suspended state and must be resumed via the start method with TMRESUME specified.

If TMFAIL is specified, the portion of work has failed. The resource manager may mark the transaction as rollback-only

If TMSUCCESS is specified, the portion of work has completed successfully.

Parameters:
xid - A global transaction identifier that is the same as the identifier used previously in the start method.
flags - One of TMSUCCESS, TMFAIL, or TMSUSPEND.
Throws:
XAException - An error has occurred. Possible XAException values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, XAER_PROTO, or XA_RB*.

public void forget(Xid xid) throws XAException
告知资源管理器忘记以启发方式完成的事务分支。
xid | 全局事务标识符
Throws | XAException: 发生错误。可能的异常值有 XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。
英文文档：

forget

void forget(Xid xid)
            throws XAException
Tells the resource manager to forget about a heuristically completed transaction branch.

Parameters:
xid - A global transaction identifier.
Throws:
XAException - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

public int getTransactionTimeout() throws XAException
获取为此 XAResource 实例设置的当前事务超时值。如果在调用此方法之前未使用 XAResource.setTransactionTimeout，则返回值是资源管理器的默认超时集；否则，返回在以前 setTransactionTimeout 调用中使用的值。
return | 以秒为单位的事务超时值。
Throws | XAException: 发生错误。可能的异常值有 XAER_RMERR 和 XAER_RMFAIL。
英文文档：

getTransactionTimeout

int getTransactionTimeout()
                          throws XAException
Obtains the current transaction timeout value set for this XAResource instance. If XAResource.setTransactionTimeout was not used prior to invoking this method, the return value is the default timeout set for the resource manager; otherwise, the value used in the previous setTransactionTimeout call is returned.

Returns:
the transaction timeout value in seconds.
Throws:
XAException - An error has occurred. Possible exception values are XAER_RMERR and XAER_RMFAIL.

public boolean isSameRM(XAResource xares) throws XAException
调用此方法确定目标对象表示的资源管理器实例是否与参数 xares 表示的资源管理器实例相同。
xares | 其资源管理器实例将与目标对象的资源管理器实例进行比较的 XAResource 对象。
return | 如果是相同的 RM 实例，则返回 true；否则返回 false。
Throws | XAException: 发生错误。可能的异常值有 XAER_RMERR 和 XAER_RMFAIL。
英文文档：

isSameRM

boolean isSameRM(XAResource xares)
                 throws XAException
This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager instance represented by the parameter xares.

Parameters:
xares - An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object.
Returns:
true if it's the same RM instance; otherwise false.
Throws:
XAException - An error has occurred. Possible exception values are XAER_RMERR and XAER_RMFAIL.

public int prepare(Xid xid) throws XAException
请求资源管理器准备好提交 xid 中指定的事务。
xid | 全局事务标识符
Throws | XAException: 发生错误。可能的异常值有：XA_RB*、XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。
return | 一个值，它指示资源管理器对事务结果的表决。可能的值有：XA_RDONLY 或 XA_OK。如果资源管理器要回滚事务，则应该通过引发 prepare 方法中相应的 XAException 实现这一点。
英文文档：

prepare

int prepare(Xid xid)
            throws XAException
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.

Parameters:
xid - A global transaction identifier.
Returns:
A value indicating the resource manager's vote on the outcome of the transaction. The possible values are: XA_RDONLY or XA_OK. If the resource manager wants to roll back the transaction, it should do so by raising an appropriate XAException in the prepare method.
Throws:
XAException - An error has occurred. Possible exception values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

public Xid[] recover(int flag) throws XAException
从资源管理器获取准备好的事务分支的列表。恢复过程中，事务管理器调用此方法，以获取当前处于准备状态或启发式完成状态的事务分支的列表。
flag | TMSTARTRSCAN、MENDRSCAN、MNOFLAGS 之一。参数中没有设置任何其他标志时，必须使用 MNOFLAGS。
Throws | XAException: 发生错误。可能的值为 XAER_RMERR、XAER_RMFAIL、XAER_INVAL 和 XAER_PROTO。
return | 资源管理器返回当前处于准备状态或启发式完成状态的事务分支的 0 个或多个 XID。如果在操作过程中发生错误，则资源管理器应抛出相应的 XAException。
英文文档：

recover

Xid[] recover(int flag)
              throws XAException
Obtains a list of prepared transaction branches from a resource manager. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states.

Parameters:
flag - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS must be used when no other flags are set in the parameter.
Returns:
The resource manager returns zero or more XIDs of the transaction branches that are currently in a prepared or heuristically completed state. If an error occurs during the operation, the resource manager should throw the appropriate XAException.
Throws:
XAException - An error has occurred. Possible values are XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.

public void rollback(Xid xid) throws XAException
通知资源管理器回滚代表事务分支完成的工作。
xid | 全局事务标识符
Throws | XAException: 发生错误。可能的 XAExceptions 有 XA_HEURHAZ、XA_HEURCOM、XA_HEURRB、XA_HEURMIX、XAER_RMERR、XAER_RMFAIL、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。 如果事务分支已经标记为只回滚，则资源管理器抛出 XA_RB* 异常之一。返回后，资源管理器回滚分支的工作，并释放所有占用的资源。
英文文档：

rollback

void rollback(Xid xid)
              throws XAException
Informs the resource manager to roll back work done on behalf of a transaction branch.

Parameters:
xid - A global transaction identifier.
Throws:
XAException - An error has occurred. Possible XAExceptions are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.

If the transaction branch is already marked rollback-only the resource manager may throw one of the XA_RB* exceptions. Upon return, the resource manager has rolled back the branch's work and has released all held resources.

public boolean setTransactionTimeout(int seconds) throws XAException

为此 XAResource 实例设置当前事务超时值。设置后，在使用其他值再次调用 setTransactionTimeout 之前，此超时值是有效的。要将超时值重设为资源管理器使用的默认值，请将该值设置为 0。 如果执行超时操作成功，则该方法返回 true；否则返回 false。如果资源管理器不支持显式设置事务超时值，则此方法返回 false。

seconds | 以秒为单位的事务超时值。
return | 如果成功设置事务超时值，则返回 true；否则返回 false。
Throws | XAException: 发生错误。可能的异常值为 XAER_RMERR、XAER_RMFAIL 或 XAER_INVAL。
英文文档：

setTransactionTimeout

boolean setTransactionTimeout(int seconds)
                              throws XAException

Sets the current transaction timeout value for this XAResource instance. Once set, this timeout value is effective until setTransactionTimeout is invoked again with a different value. To reset the timeout value to the default value used by the resource manager, set the value to zero. If the timeout operation is performed successfully, the method returns true; otherwise false. If a resource manager does not support explicitly setting the transaction timeout value, this method returns false.

Parameters:
seconds - The transaction timeout value in seconds.
Returns:
true if the transaction timeout value is set successfully; otherwise false.
Throws:
XAException - An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.

public void start(Xid xid, int flags) throws XAException
代表 xid 中指定的事务分支开始工作。 如果指定为 TMJOIN，则该启动适用于连接资源管理器以前见到的事务。如果指定为 TMRESUME，该启动适用于恢复参数 xid 中指定的挂起事务。 如果 TMJOIN 和 TMRESUME 都没有指定，并且资源管理器以前见到过 xid 指定的事务，则资源管理器抛出错误代码为 XAER_DUPID 的 XAException 异常。
xid | 与资源关联的全局事务标识符。
flags | TMNOFLAGS、TMJOIN 或 TMRESUME 之一。
Throws | XAException: 发生错误。可能的异常有 XA_RB*、XAER_RMERR、XAER_RMFAIL、XAER_DUPID、XAER_OUTSIDE、XAER_NOTA、XAER_INVAL 或 XAER_PROTO。
英文文档：

start

void start(Xid xid,
           int flags)
           throws XAException
Starts work on behalf of a transaction branch specified in xid. If TMJOIN is specified, the start applies to joining a transaction previously seen by the resource manager. If TMRESUME is specified, the start applies to resuming a suspended transaction specified in the parameter xid. If neither TMJOIN nor TMRESUME is specified and the transaction specified by xid has previously been seen by the resource manager, the resource manager throws the XAException exception with XAER_DUPID error code.

Parameters:
xid - A global transaction identifier to be associated with the resource.
flags - One of TMNOFLAGS, TMJOIN, or TMRESUME.
Throws:
XAException - An error has occurred. Possible exceptions are XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Xid (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.transaction.xa
Interface Xid

public interface Xid

Xid 接口是 X/Open 事务标识符 XID 结构的 Java 映射。此接口指定三种存取方法，以获取全局事务的格式 ID、全局事务 ID 和分支限定符。Xid 接口供事务管理器和资源管理器使用。此接口对应用程序不可见。
英文文档：

The Xid interface is a Java mapping of the X/Open transaction identifier XID structure. This interface specifies three accessor methods to retrieve a global transaction's format ID, global transaction ID, and branch qualifier. The Xid interface is used by the transaction manager and the resource managers. This interface is not visible to the application programs.

Field Summary
static int | MAXBQUALSIZE Maximum number of bytes returned by getBqual.
static int | MAXGTRIDSIZE Maximum number of bytes returned by getGtrid.
Method Summary
byte[] | getBranchQualifier() Obtain the transaction branch identifier part of XID as an array of bytes.
int | getFormatId() Obtain the format identifier part of the XID.
byte[] | getGlobalTransactionId() Obtain the global transaction identifier part of XID as an array of bytes.

Field Detail

英文文档：

MAXGTRIDSIZE

static final int MAXGTRIDSIZE
Maximum number of bytes returned by getGtrid.

See Also:
Constant Field Values

英文文档：

MAXBQUALSIZE

static final int MAXBQUALSIZE
Maximum number of bytes returned by getBqual.

See Also:
Constant Field Values
Method Detail

public int getFormatId()
获取 XID 的格式标识符部分。
return 格式标识符。O 指 OSI CCR 格式。
英文文档：

getFormatId

int getFormatId()
Obtain the format identifier part of the XID.

Returns:
Format identifier. O means the OSI CCR format.

public byte[] getGlobalTransactionId()
获取 XID 的全局事务标识符部分作为字节数组。
return 全局事务标识符。
英文文档：

getGlobalTransactionId

byte[] getGlobalTransactionId()
Obtain the global transaction identifier part of XID as an array of bytes.

Returns:
Global transaction identifier.

public byte[] getBranchQualifier()
获取 XID 的事务分支标识符部分作为字节数组。
return 全局事务标识符。
英文文档：

getBranchQualifier

byte[] getBranchQualifier()
Obtain the transaction branch identifier part of XID as an array of bytes.

Returns:
Global transaction identifier.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


XAException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.transaction.xa
Class XAException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.transaction.xa.XAException
All Implemented Interfaces:
Serializable
public class XAException
extends Exception

Extends: Throwable > Exception

资源管理器 (RM) 抛出 XAException，以通知事务管理器涉及的事务遇到错误。
英文文档：

The XAException is thrown by the Resource Manager (RM) to inform the Transaction Manager of an error encountered by the involved transaction.

See Also:
Serialized Form

Field Summary
int | errorCode The error code with which to create the SystemException.
static int | XA_HEURCOM The transaction branch has been heuristically committed.
static int | XA_HEURHAZ The transaction branch may have been heuristically completed.
static int | XA_HEURMIX The transaction branch has been heuristically committed and rolled back.
static int | XA_HEURRB The transaction branch has been heuristically rolled back.
static int | XA_NOMIGRATE Resumption must occur where the suspension occurred.
static int | XA_RBBASE The inclusive lower bound of the rollback codes.
static int | XA_RBCOMMFAIL Indicates that the rollback was caused by a communication failure.
static int | XA_RBDEADLOCK A deadlock was detected.
static int | XA_RBEND The inclusive upper bound of the rollback error code.
static int | XA_RBINTEGRITY A condition that violates the integrity of the resource was detected.
static int | XA_RBOTHER The resource manager rolled back the transaction branch for a reason not on this list.
static int | XA_RBPROTO A protocol error occurred in the resource manager.
static int | XA_RBROLLBACK Indicates that the rollback was caused by an unspecified reason.
static int | XA_RBTIMEOUT A transaction branch took too long.
static int | XA_RBTRANSIENT May retry the transaction branch.
static int | XA_RDONLY The transaction branch was read-only and has been committed.
static int | XA_RETRY Routine returned with no effect and may be reissued.
static int | XAER_ASYNC There is an asynchronous operation already outstanding.
static int | XAER_DUPID The XID already exists.
static int | XAER_INVAL Invalid arguments were given.
static int | XAER_NOTA The XID is not valid.
static int | XAER_OUTSIDE The resource manager is doing work outside a global transaction.
static int | XAER_PROTO Routine was invoked in an improper context.
static int | XAER_RMERR A resource manager error has occurred in the transaction branch.
static int | XAER_RMFAIL Resource manager is unavailable.
Constructor Summary
XAException()
Create an XAException.
XAException(int errcode)
Create an XAException with a given error code.
XAException(String s)
Create an XAException with a given string.
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

Field Detail

英文文档：

errorCode

public int errorCode
The error code with which to create the SystemException.

英文文档：

XA_RBBASE

public static final int XA_RBBASE
The inclusive lower bound of the rollback codes.

See Also:
Constant Field Values

英文文档：

XA_RBROLLBACK

public static final int XA_RBROLLBACK
Indicates that the rollback was caused by an unspecified reason.

See Also:
Constant Field Values

英文文档：

XA_RBCOMMFAIL

public static final int XA_RBCOMMFAIL
Indicates that the rollback was caused by a communication failure.

See Also:
Constant Field Values

英文文档：

XA_RBDEADLOCK

public static final int XA_RBDEADLOCK
A deadlock was detected.

See Also:
Constant Field Values

英文文档：

XA_RBINTEGRITY

public static final int XA_RBINTEGRITY
A condition that violates the integrity of the resource was detected.

See Also:
Constant Field Values

英文文档：

XA_RBOTHER

public static final int XA_RBOTHER
The resource manager rolled back the transaction branch for a reason not on this list.

See Also:
Constant Field Values

英文文档：

XA_RBPROTO

public static final int XA_RBPROTO
A protocol error occurred in the resource manager.

See Also:
Constant Field Values

英文文档：

XA_RBTIMEOUT

public static final int XA_RBTIMEOUT
A transaction branch took too long.

See Also:
Constant Field Values

英文文档：

XA_RBTRANSIENT

public static final int XA_RBTRANSIENT
May retry the transaction branch.

See Also:
Constant Field Values

英文文档：

XA_RBEND

public static final int XA_RBEND
The inclusive upper bound of the rollback error code.

See Also:
Constant Field Values

英文文档：

XA_NOMIGRATE

public static final int XA_NOMIGRATE
Resumption must occur where the suspension occurred.

See Also:
Constant Field Values

英文文档：

XA_HEURHAZ

public static final int XA_HEURHAZ
The transaction branch may have been heuristically completed.

See Also:
Constant Field Values

英文文档：

XA_HEURCOM

public static final int XA_HEURCOM
The transaction branch has been heuristically committed.

See Also:
Constant Field Values

英文文档：

XA_HEURRB

public static final int XA_HEURRB
The transaction branch has been heuristically rolled back.

See Also:
Constant Field Values

英文文档：

XA_HEURMIX

public static final int XA_HEURMIX
The transaction branch has been heuristically committed and rolled back.

See Also:
Constant Field Values

英文文档：

XA_RETRY

public static final int XA_RETRY
Routine returned with no effect and may be reissued.

See Also:
Constant Field Values

英文文档：

XA_RDONLY

public static final int XA_RDONLY
The transaction branch was read-only and has been committed.

See Also:
Constant Field Values

英文文档：

XAER_ASYNC

public static final int XAER_ASYNC
There is an asynchronous operation already outstanding.

See Also:
Constant Field Values

英文文档：

XAER_RMERR

public static final int XAER_RMERR
A resource manager error has occurred in the transaction branch.

See Also:
Constant Field Values

英文文档：

XAER_NOTA

public static final int XAER_NOTA
The XID is not valid.

See Also:
Constant Field Values

英文文档：

XAER_INVAL

public static final int XAER_INVAL
Invalid arguments were given.

See Also:
Constant Field Values

英文文档：

XAER_PROTO

public static final int XAER_PROTO
Routine was invoked in an improper context.

See Also:
Constant Field Values

英文文档：

XAER_RMFAIL

public static final int XAER_RMFAIL
Resource manager is unavailable.

See Also:
Constant Field Values

英文文档：

XAER_DUPID

public static final int XAER_DUPID
The XID already exists.

See Also:
Constant Field Values

英文文档：

XAER_OUTSIDE

public static final int XAER_OUTSIDE
The resource manager is doing work outside a global transaction.

See Also:
Constant Field Values
Constructor Detail

public XAException()
创建一个 XAException。
英文文档：

XAException

public XAException()
Create an XAException.

public XAException(String s)
创建一个具有给定字符串的 XAException。
s 包含异常消息的 String 对象。
英文文档：

XAException

public XAException(String s)
Create an XAException with a given string.

Parameters:
s - The String object containing the exception message.

public XAException(int errcode)
创建一个具有给定错误代码的 XAException。
errcode 标识异常的错误代码。
英文文档：

XAException

public XAException(int errcode)
Create an XAException with a given error code.

Parameters:
errcode - The error code identifying the exception.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.bind (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.bind

Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.

See:
Description

Interface Summary
DatatypeConverterInterface | The DatatypeConverterInterface is for JAXB provider use only.
Element | This is an element marker interface.
Marshaller | The Marshaller class is responsible for governing the process of serializing Java content trees back into XML data.
NotIdentifiableEvent | This event indicates that a problem was encountered resolving an ID/IDREF.
ParseConversionEvent | This event indicates that a problem was encountered while converting a string from the XML data into a value of the target Java data type.
PrintConversionEvent | This event indicates that a problem was encountered while converting data from the Java content tree into its lexical representation.
Unmarshaller | The Unmarshaller class governs the process of deserializing XML data into newly created Java content trees, optionally validating the XML data as it is unmarshalled.
UnmarshallerHandler | Unmarshaller implemented as SAX ContentHandler.
ValidationEvent | This event indicates that a problem was encountered while validating the incoming XML data during an unmarshal operation, while performing on-demand validation of the Java content tree, or while marshalling the Java content tree back to XML data.
ValidationEventHandler | A basic event handler interface for validation errors.
ValidationEventLocator | Encapsulate the location of a ValidationEvent.
Validator | Deprecated. since JAXB 2.0

Class Summary
Binder<XmlNode> | Enable synchronization between XML infoset nodes and JAXB objects representing same XML document.
DatatypeConverter | The javaType binding declaration can be used to customize the binding of an XML schema datatype to a Java datatype.
JAXBContext | The JAXBContext class provides the client's entry point to the JAXB API.
JAXBElement<T> | JAXB representation of an Xml Element.
JAXBElement.GlobalScope | Designates global scope for an xml element.
JAXBIntrospector | Provide access to JAXB xml binding data for a JAXB object.
Marshaller.Listener | Register an instance of an implementation of this class with a Marshaller to externally listen for marshal events.
SchemaOutputResolver | Controls where a JAXB implementation puts the generates schema files.
Unmarshaller.Listener | Register an instance of an implementation of this class with Unmarshaller to externally listen for unmarshal events.

Exception Summary
JAXBException | This is the root exception class for all JAXB exceptions.
MarshalException | This exception indicates that an error has occurred while performing a marshal operation that the provider is unable to recover from.
PropertyException | This exception indicates that an error was encountered while getting or setting a property.
TypeConstraintException | This exception indicates that a violation of a dynamically checked type constraint was detected.
UnmarshalException | This exception indicates that an error has occurred while performing an unmarshal operation that prevents the JAXB Provider from completing the operation.
ValidationException | This exception indicates that an error has occurred while performing a validate operation.

Package javax.xml.bind Description

Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.

JAXBContext is the client-entry point to the runtime binding framework.

Package Specification

  • JAXB Specification

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • The JAXB Website

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.bind Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.bind

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.bind.Binder<XmlNode>
    • javax.xml.bind.DatatypeConverter
    • javax.xml.bind.JAXBContext
    • javax.xml.bind.JAXBElement<T> (implements java.io.Serializable)
    • javax.xml.bind.JAXBElement.GlobalScope
    • javax.xml.bind.JAXBIntrospector
    • javax.xml.bind.Marshaller.Listener
    • javax.xml.bind.SchemaOutputResolver
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.xml.bind.JAXBException
          • javax.xml.bind.MarshalException
          • javax.xml.bind.PropertyException
          • javax.xml.bind.UnmarshalException
          • javax.xml.bind.ValidationException
        • java.lang.RuntimeException
          • javax.xml.bind.TypeConstraintException
    • javax.xml.bind.Unmarshaller.Listener

Interface Hierarchy

  • org.xml.sax.ContentHandler
    • javax.xml.bind.UnmarshallerHandler
  • javax.xml.bind.DatatypeConverterInterface
  • javax.xml.bind.Element
  • javax.xml.bind.Marshaller
  • javax.xml.bind.Unmarshaller
  • javax.xml.bind.ValidationEvent
    • javax.xml.bind.NotIdentifiableEvent
    • javax.xml.bind.ParseConversionEvent
    • javax.xml.bind.PrintConversionEvent
  • javax.xml.bind.ValidationEventHandler
  • javax.xml.bind.ValidationEventLocator
  • javax.xml.bind.Validator
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DatatypeConverterInterface (Java EE 5)

javax.xml.bind
Interface DatatypeConverterInterface

public interface DatatypeConverterInterface

该 DatatypeConverterInterface 仅适用于 JAXB 提供者。JAXB 提供者必须提供一个实现此接口的类。JAXB 提供者需要在第一次执行编组或解组操作之前（可能在调用 JAXBContext.newInstance 期间）的某个时间点调用 DatatypeConverter.setDatatypeConverter。要配置用于执行打印和解析功能的转换器，这一步是必需的。重复调用此 api 是无效的，传入第一个调用中的 DatatypeConverter 实例将是将从那时起有效的实例。

此接口定义了一些 parse 和 print 方法。在 JAXB 规范的默认绑定 Table 5-1 中指定的每个 XML 模式数据类型都有一个 parse 和 print 方法。

此处定义的 parse 和 print 方法由 DatatypeConverter 类中定义的静态 parse 和 print 方法调用。

XML 模式数据类型的 parse 方法必须能够将 XML 模式数据类型的任何词汇表示形式（由 XML Schema Part 2: Datatypes specification 指定）转换为 XML 模式数据类型的值空间中的值。如果在转换期间发生错误，则该方法将抛出 IllegalArgumentException，或者抛出 IllegalArgumentException 的子类。

XML 模式数据类型的 print 方法可以输出对于 XML 模式数据类型有效的任何词汇表示形式。如果在转换期间发生错误，则该方法将抛出 IllegalArgumentException，或者抛出 IllegalArgumentException 的子类。

前缀 xsd：用于引用 XML 模式数据类型 XML Schema Part 2: Datatypes specification。

version
en
$Revision: 1.5 $
since | JAXB1.0
See also | javax.xml.bind.DatatypeConverter, javax.xml.bind.ParseConversionEvent, javax.xml.bind.PrintConversionEvent
英文文档：

The DatatypeConverterInterface is for JAXB provider use only. A JAXB provider must supply a class that implements this interface. JAXB Providers are required to call the DatatypeConverter.setDatatypeConverter api at some point before the first marshal or unmarshal operation (perhaps during the call to JAXBContext.newInstance). This step is necessary to configure the converter that should be used to perform the print and parse functionality. Calling this api repeatedly will have no effect - the DatatypeConverter instance passed into the first invocation is the one that will be used from then on.

This interface defines the parse and print methods. There is one parse and print method for each XML schema datatype specified in the the default binding Table 5-1 in the JAXB specification.

The parse and print methods defined here are invoked by the static parse and print methods defined in the DatatypeConverter class.

A parse method for a XML schema datatype must be capable of converting any lexical representation of the XML schema datatype ( specified by the XML Schema Part2: Datatypes specification into a value in the value space of the XML schema datatype. If an error is encountered during conversion, then an IllegalArgumentException or a subclass of IllegalArgumentException must be thrown by the method.

A print method for a XML schema datatype can output any lexical representation that is valid with respect to the XML schema datatype. If an error is encountered during conversion, then an IllegalArgumentException, or a subclass of IllegalArgumentException must be thrown by the method.

The prefix xsd: is used to refer to XML schema datatypes XML Schema Part2: Datatypes specification.

Since:
JAXB1.0
Version:
$Revision: 1.5 $
Author:
  • Sekhar Vajjhala, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Ryan Shoemaker,Sun Microsystems Inc.
See Also:
DatatypeConverter, ParseConversionEvent, PrintConversionEvent

Method Summary
String | parseAnySimpleType(String lexicalXSDAnySimpleType) Return a string containing the lexical representation of the simple type.
byte[] | parseBase64Binary(String lexicalXSDBase64Binary) Converts the string argument into an array of bytes.
boolean | parseBoolean(String lexicalXSDBoolean) Converts the string argument into a boolean value.
byte | parseByte(String lexicalXSDByte) Converts the string argument into a byte value.
Calendar | parseDate(String lexicalXSDDate) Converts the string argument into a Calendar value.
Calendar | parseDateTime(String lexicalXSDDateTime) Converts the string argument into a Calendar value.
BigDecimal | parseDecimal(String lexicalXSDDecimal) Converts the string argument into a BigDecimal value.
double | parseDouble(String lexicalXSDDouble) Converts the string argument into a double value.
float | parseFloat(String lexicalXSDFloat) Converts the string argument into a float value.
byte[] | parseHexBinary(String lexicalXSDHexBinary) Converts the string argument into an array of bytes.
int | parseInt(String lexicalXSDInt) Convert the string argument into an int value.
BigInteger | parseInteger(String lexicalXSDInteger) Convert the string argument into a BigInteger value.
long | parseLong(String lexicalXSDLong) Converts the string argument into a long value.
QName | parseQName(String lexicalXSDQName, NamespaceContext nsc) Converts the string argument into a QName value.
short | parseShort(String lexicalXSDShort) Converts the string argument into a short value.
String | parseString(String lexicalXSDString) Convert the string argument into a string.
Calendar | parseTime(String lexicalXSDTime) Converts the string argument into a Calendar value.
long | parseUnsignedInt(String lexicalXSDUnsignedInt) Converts the string argument into a long value.
int | parseUnsignedShort(String lexicalXSDUnsignedShort) Converts the string argument into an int value.
String | printAnySimpleType(String val) Converts a string value into a string.
String | printBase64Binary(byte[] val) Converts an array of bytes into a string.
String | printBoolean(boolean val) Converts a boolean value into a string.
String | printByte(byte val) Converts a byte value into a string.
String | printDate(Calendar val) Converts a Calendar value into a string.
String | printDateTime(Calendar val) Converts a Calendar value into a string.
String | printDecimal(BigDecimal val) Converts a BigDecimal value into a string.
String | printDouble(double val) Converts a double value into a string.
String | printFloat(float val) Converts a float value into a string.
String | printHexBinary(byte[] val) Converts an array of bytes into a string.
String | printInt(int val) Converts an int value into a string.
String | printInteger(BigInteger val) Converts a BigInteger value into a string.
String | printLong(long val) Converts a long value into a string.
String | printQName(QName val, NamespaceContext nsc) Converts a QName instance into a string.
String | printShort(short val) Converts a short value into a string.
String | printString(String val) Converts the string argument into a string.
String | printTime(Calendar val) Converts a Calendar value into a string.
String | printUnsignedInt(long val) Converts a long value into a string.
String | printUnsignedShort(int val) Converts an int value into a string.

Method Detail

public String parseString(String lexicalXSDString)

将字符串参数转换为一个字符串。

lexicalXSDString | XML 模式数据类型 xsd:string 的词汇表示形式
return | 与输入字符串相同的字符串。
英文文档：

parseString

String parseString(String lexicalXSDString)

Convert the string argument into a string.

Parameters:
lexicalXSDString - A lexical representation of the XML Schema datatype xsd:string
Returns:
A string that is the same as the input string.

public java.math.BigInteger parseInteger(String lexicalXSDInteger)

将字符串参数转换为一个 BigInteger 值。

lexicalXSDInteger | 包含 xsd:integer 的词汇表示形式的字符串。
return | 字符串参数表示的 BigInteger 值。
Throws | NumberFormatException: 如果 lexicalXSDInteger 不是 java.math.BigInteger 值的有效字符串表示形式。
英文文档：

parseInteger

BigInteger parseInteger(String lexicalXSDInteger)

Convert the string argument into a BigInteger value.

Parameters:
lexicalXSDInteger - A string containing a lexical representation of xsd:integer.
Returns:
A BigInteger value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDInteger is not a valid string representation of a BigInteger value.

public int parseInt(String lexicalXSDInt)

将字符串参数转换为一个 int 值。

lexicalXSDInt | 包含 xsd:int 的词汇表示形式的字符串。
return | 字符串参数表示的 int 值。
Throws | NumberFormatException: 如果 lexicalXSDInt 不是 int 值的有效字符串表示形式。
英文文档：

parseInt

int parseInt(String lexicalXSDInt)

Convert the string argument into an int value.

Parameters:
lexicalXSDInt - A string containing a lexical representation of xsd:int.
Returns:
An int value represented byte the string argument.
Throws:
NumberFormatException - lexicalXSDInt is not a valid string representation of an int value.

public long parseLong(String lexicalXSDLong)

将字符串参数转换为一个 long 值。

lexicalXSDLong | 包含 xsd:long 的词汇表示形式的字符串。
return | 字符串参数表示的 long 值。
Throws | NumberFormatException: 如果 lexicalXSDLong 不是 long 值的有效字符串表示形式。
英文文档：

parseLong

long parseLong(String lexicalXSDLong)

Converts the string argument into a long value.

Parameters:
lexicalXSDLong - A string containing lexical representation of xsd:long.
Returns:
A long value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDLong is not a valid string representation of a long value.

public short parseShort(String lexicalXSDShort)

将字符串参数转换为一个 short 值。

lexicalXSDShort | 包含 xsd:short 的词汇表示形式的字符串。
return | 字符串参数表示的 short 值。
Throws | NumberFormatException: 如果 lexicalXSDShort 不是 short 值的有效字符串表示形式。
英文文档：

parseShort

short parseShort(String lexicalXSDShort)

Converts the string argument into a short value.

Parameters:
lexicalXSDShort - A string containing lexical representation of xsd:short.
Returns:
A short value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDShort is not a valid string representation of a short value.

public java.math.BigDecimal parseDecimal(String lexicalXSDDecimal)

将字符串参数转换为一个 BigDecimal 值。

lexicalXSDDecimal | 包含 xsd:decimal 的词汇表示形式的字符串。
return | 字符串参数表示的 BigDecimal 值。
Throws | NumberFormatException: 如果 lexicalXSDDecimal 不是 java.math.BigDecimal 的有效字符串表示形式。
英文文档：

parseDecimal

BigDecimal parseDecimal(String lexicalXSDDecimal)

Converts the string argument into a BigDecimal value.

Parameters:
lexicalXSDDecimal - A string containing lexical representation of xsd:decimal.
Returns:
A BigDecimal value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDDecimal is not a valid string representation of BigDecimal.

public float parseFloat(String lexicalXSDFloat)

将字符串参数转换为一个 float 值。

lexicalXSDFloat | 包含 xsd:float 的词汇表示形式的字符串。
return | 字符串参数表示的 float 值。
Throws | NumberFormatException: 如果 lexicalXSDFloat 不是 float 值的有效字符串表示形式。
英文文档：

parseFloat

float parseFloat(String lexicalXSDFloat)

Converts the string argument into a float value.

Parameters:
lexicalXSDFloat - A string containing lexical representation of xsd:float.
Returns:
A float value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDFloat is not a valid string representation of a float value.

public double parseDouble(String lexicalXSDDouble)

将字符串参数转换为一个 double 值。

lexicalXSDDouble | 包含 xsd:double 的词汇表示形式的字符串。
return | 字符串参数表示的 double 值。
Throws | NumberFormatException: 如果 lexicalXSDDouble 不是 double 值的有效字符串表示形式。
英文文档：

parseDouble

double parseDouble(String lexicalXSDDouble)

Converts the string argument into a double value.

Parameters:
lexicalXSDDouble - A string containing lexical representation of xsd:double.
Returns:
A double value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDDouble is not a valid string representation of a double value.

public boolean parseBoolean(String lexicalXSDBoolean)

将字符串参数转换为一个 boolean 值。

lexicalXSDBoolean | 包含 xsd:boolean 的词汇表示形式的字符串。
return | 字符串参数表示的 boolean 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 中为 xsd:boolean 定义的词汇值空间。
英文文档：

parseBoolean

boolean parseBoolean(String lexicalXSDBoolean)

Converts the string argument into a boolean value.

Parameters:
lexicalXSDBoolean - A string containing lexical representation of xsd:boolean.
Returns:
A boolean value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.

public byte parseByte(String lexicalXSDByte)

将字符串参数转换为一个 byte 值。

lexicalXSDByte | 包含 xsd:byte 的词汇表示形式的字符串。
return | 字符串参数表示的 byte 值。
Throws | NumberFormatException: 如果 lexicalXSDByte 不包含可解析的字节。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:byte 定义的词汇值空间。
英文文档：

parseByte

byte parseByte(String lexicalXSDByte)

Converts the string argument into a byte value.

Parameters:
lexicalXSDByte - A string containing lexical representation of xsd:byte.
Returns:
A byte value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDByte does not contain a parseable byte.
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.

public javax.xml.namespace.QName parseQName(String lexicalXSDQName, javax.xml.namespace.NamespaceContext nsc)

将字符串参数转换为一个 QName 值。

字符串参数 lexicalXSDQname 必须符合 XML Schema Part 2: Datatypes specification:QNames 中指定的词汇值空间。

lexicalXSDQName | 包含 xsd:QName 的词汇表示形式的字符串。
nsc | 解释 QName 中前缀的名称空间上下文。
return | 字符串参数表示的 QName 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2 规范，或者 lexicalXSDQname 的名称空间前缀未绑定到 NamespaceContext nsc 中的 URI。
英文文档：

parseQName

QName parseQName(String lexicalXSDQName,
                 NamespaceContext nsc)

Converts the string argument into a QName value.

String parameter lexicalXSDQname must conform to lexical value space specifed at XML Schema Part 2:Datatypes specification:QNames

Parameters:
lexicalXSDQName - A string containing lexical representation of xsd:QName.
nsc - A namespace context for interpreting a prefix within a QName.
Returns:
A QName value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to XML Schema Part 2 specification or if namespace prefix of lexicalXSDQname is not bound to a URI in NamespaceContext nsc.

public java.util.Calendar parseDateTime(String lexicalXSDDateTime)

将字符串参数转换为一个 Calendar 值。

lexicalXSDDateTime | 包含 xsd:datetime 的词汇表示形式的字符串。
return | 字符串参数表示的 Calendar 对象。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:dateTime 定义的词汇值空间。
英文文档：

parseDateTime

Calendar parseDateTime(String lexicalXSDDateTime)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDDateTime - A string containing lexical representation of xsd:datetime.
Returns:
A Calendar object represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.

public byte[] parseBase64Binary(String lexicalXSDBase64Binary)

将字符串参数转换为一个字节数组。

lexicalXSDBase64Binary | 包含 xsd:base64Binary 的词汇表示形式的字符串。
return | 字符串参数表示的字节数组。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:base64Binary 定义的词汇值空间。
英文文档：

parseBase64Binary

byte[] parseBase64Binary(String lexicalXSDBase64Binary)

Converts the string argument into an array of bytes.

Parameters:
lexicalXSDBase64Binary - A string containing lexical representation of xsd:base64Binary.
Returns:
An array of bytes represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary

public byte[] parseHexBinary(String lexicalXSDHexBinary)

将字符串参数转换为一个字节数组。

lexicalXSDHexBinary | 包含 xsd:hexBinary 的词汇表示形式的字符串。
return | 字符串参数表示的字节数组。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:hexBinary 定义的词汇值空间。
英文文档：

parseHexBinary

byte[] parseHexBinary(String lexicalXSDHexBinary)

Converts the string argument into an array of bytes.

Parameters:
lexicalXSDHexBinary - A string containing lexical representation of xsd:hexBinary.
Returns:
An array of bytes represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.

public long parseUnsignedInt(String lexicalXSDUnsignedInt)

将字符串参数转换为一个 long 值。

lexicalXSDUnsignedInt | 包含 xsd:unsignedInt 的词汇表示形式的字符串。
return | 字符串参数表示的 long 值。
Throws | NumberFormatException: 如果不能将字符串参数解析为 long 值。
英文文档：

parseUnsignedInt

long parseUnsignedInt(String lexicalXSDUnsignedInt)

Converts the string argument into a long value.

Parameters:
lexicalXSDUnsignedInt - A string containing lexical representation of xsd:unsignedInt.
Returns:
A long value represented by the string argument.
Throws:
NumberFormatException - if string parameter can not be parsed into a long value.

public int parseUnsignedShort(String lexicalXSDUnsignedShort)

将字符串参数转换为一个 int 值。

lexicalXSDUnsignedShort | 包含 xsd:unsignedShort 的词汇表示形式的字符串。
return | 字符串参数表示的 int 值。
Throws | NumberFormatException: 如果不能将字符串参数解析为 int 值。
英文文档：

parseUnsignedShort

int parseUnsignedShort(String lexicalXSDUnsignedShort)

Converts the string argument into an int value.

Parameters:
lexicalXSDUnsignedShort - A string containing lexical representation of xsd:unsignedShort.
Returns:
An int value represented by the string argument.
Throws:
NumberFormatException - if string parameter can not be parsed into an int value.

public java.util.Calendar parseTime(String lexicalXSDTime)

将字符串参数转换为一个 Calendar 值。

lexicalXSDTime | 包含 xsd:Time 的词汇表示形式的字符串。
return | 字符串参数表示的 Calendar 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:Time 定义的词汇值空间。
英文文档：

parseTime

Calendar parseTime(String lexicalXSDTime)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDTime - A string containing lexical representation of xsd:Time.
Returns:
A Calendar value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.

public java.util.Calendar parseDate(String lexicalXSDDate)

将字符串参数转换为一个 Calendar 值。

lexicalXSDDate | 包含 xsd:Date 的词汇表示形式的字符串。
return | 字符串参数表示的 Calendar 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:Date 定义的词汇值空间。
英文文档：

parseDate

Calendar parseDate(String lexicalXSDDate)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDDate - A string containing lexical representation of xsd:Date.
Returns:
A Calendar value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.

public String parseAnySimpleType(String lexicalXSDAnySimpleType)

返回包含简单类型的词汇表示形式的字符串。

lexicalXSDAnySimpleType | 包含简单类型的词汇表示形式的字符串。
return | 包含简单类型的词汇表示形式的字符串。
英文文档：

parseAnySimpleType

String parseAnySimpleType(String lexicalXSDAnySimpleType)

Return a string containing the lexical representation of the simple type.

Parameters:
lexicalXSDAnySimpleType - A string containing lexical representation of the simple type.
Returns:
A string containing the lexical representation of the simple type.

public String printString(String val)

将字符串参数转换为一个字符串。

val | 字符串值。
return | 包含 xsd:string 的词汇表示形式的字符串
英文文档：

printString

String printString(String val)

Converts the string argument into a string.

Parameters:
val - A string value.
Returns:
A string containing a lexical representation of xsd:string

public String printInteger(java.math.BigInteger val)

将 BigInteger 值转换为一个字符串。

val | 一个 BigInteger 值
return | 包含 xsd:integer 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printInteger

String printInteger(BigInteger val)

Converts a BigInteger value into a string.

Parameters:
val - A BigInteger value
Returns:
A string containing a lexical representation of xsd:integer
Throws:
IllegalArgumentException - val is null.

public String printInt(int val)

将 int 值转换为一个字符串。

val | 一个 int 值
return | 包含 xsd:int 的词汇表示形式的字符串
英文文档：

printInt

String printInt(int val)

Converts an int value into a string.

Parameters:
val - An int value
Returns:
A string containing a lexical representation of xsd:int

public String printLong(long val)

将 long 值转换为一个字符串。

val | 一个 long 值
return | 包含 xsd:long 的词汇表示形式的字符串
英文文档：

printLong

String printLong(long val)

Converts a long value into a string.

Parameters:
val - A long value
Returns:
A string containing a lexical representation of xsd:long

public String printShort(short val)

将 short 值转换为一个字符串。

val | 一个 short 值
return | 包含 xsd:short 的词汇表示形式的字符串
英文文档：

printShort

String printShort(short val)

Converts a short value into a string.

Parameters:
val - A short value
Returns:
A string containing a lexical representation of xsd:short

public String printDecimal(java.math.BigDecimal val)

将 BigDecimal 值转换为一个字符串。

val | 一个 BigDecimal 值
return | 包含 xsd:decimal 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printDecimal

String printDecimal(BigDecimal val)

Converts a BigDecimal value into a string.

Parameters:
val - A BigDecimal value
Returns:
A string containing a lexical representation of xsd:decimal
Throws:
IllegalArgumentException - val is null.

public String printFloat(float val)

将 float 值转换为一个字符串。

val | 一个 float 值
return | 包含 xsd:float 的词汇表示形式的字符串
英文文档：

printFloat

String printFloat(float val)

Converts a float value into a string.

Parameters:
val - A float value
Returns:
A string containing a lexical representation of xsd:float

public String printDouble(double val)

将 double 值转换为一个字符串。

val | 一个 double 值
return | 包含 xsd:double 的词汇表示形式的字符串
英文文档：

printDouble

String printDouble(double val)

Converts a double value into a string.

Parameters:
val - A double value
Returns:
A string containing a lexical representation of xsd:double

public String printBoolean(boolean val)

将 boolean 值转换为一个字符串。

val | 一个 boolean 值
return | 包含 xsd:boolean 的词汇表示形式的字符串
英文文档：

printBoolean

String printBoolean(boolean val)

Converts a boolean value into a string.

Parameters:
val - A boolean value
Returns:
A string containing a lexical representation of xsd:boolean

public String printByte(byte val)

将 byte 值转换为一个字符串。

val | 一个 byte 值
return | 包含 xsd:byte 的词汇表示形式的字符串
英文文档：

printByte

String printByte(byte val)

Converts a byte value into a string.

Parameters:
val - A byte value
Returns:
A string containing a lexical representation of xsd:byte

public String printQName(javax.xml.namespace.QName val, javax.xml.namespace.NamespaceContext nsc)

将 QName 实例转换为一个字符串。

val | 一个 QName 值
nsc | 解释 QName 中前缀的名称空间上下文。
return | 包含 QName 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null、nsc 为非 null 或 nsc.getPrefix(nsprefixFromVal) 为 null。
英文文档：

printQName

String printQName(QName val,
                  NamespaceContext nsc)

Converts a QName instance into a string.

Parameters:
val - A QName value
nsc - A namespace context for interpreting a prefix within a QName.
Returns:
A string containing a lexical representation of QName
Throws:
IllegalArgumentException - if val is null or if nsc is non-null or nsc.getPrefix(nsprefixFromVal) is null.

public String printDateTime(java.util.Calendar val)

将 Calendar 值转换为一个字符串。

val | 一个 Calendar 值
return | 包含 xsd:dateTime 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printDateTime

String printDateTime(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:dateTime
Throws:
IllegalArgumentException - if val is null.

public String printBase64Binary(byte[] val)

将字节数组转换为一个字符串。

val | 字节数组
return | 包含 xsd:base64Binary 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printBase64Binary

String printBase64Binary(byte[] val)

Converts an array of bytes into a string.

Parameters:
val - an array of bytes
Returns:
A string containing a lexical representation of xsd:base64Binary
Throws:
IllegalArgumentException - if val is null.

public String printHexBinary(byte[] val)

将字节数组转换为一个字符串。

val | 字节数组
return | 包含 xsd:hexBinary 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printHexBinary

String printHexBinary(byte[] val)

Converts an array of bytes into a string.

Parameters:
val - an array of bytes
Returns:
A string containing a lexical representation of xsd:hexBinary
Throws:
IllegalArgumentException - if val is null.

public String printUnsignedInt(long val)

将 long 值转换为一个字符串。

val | 一个 long 值
return | 包含 xsd:unsignedInt 的词汇表示形式的字符串
英文文档：

printUnsignedInt

String printUnsignedInt(long val)

Converts a long value into a string.

Parameters:
val - A long value
Returns:
A string containing a lexical representation of xsd:unsignedInt

public String printUnsignedShort(int val)

将 int 值转换为一个字符串。

val | 一个 int 值
return | 包含 xsd:unsignedShort 的词汇表示形式的字符串
英文文档：

printUnsignedShort

String printUnsignedShort(int val)

Converts an int value into a string.

Parameters:
val - An int value
Returns:
A string containing a lexical representation of xsd:unsignedShort

public String printTime(java.util.Calendar val)

将 Calendar 值转换为一个字符串。

val | 一个 Calendar 值
return | 包含 xsd:time 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printTime

String printTime(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:time
Throws:
IllegalArgumentException - if val is null.

public String printDate(java.util.Calendar val)

将 Calendar 值转换为一个字符串。

val | 一个 Calendar 值
return | 包含 xsd:date 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printDate

String printDate(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:date
Throws:
IllegalArgumentException - if val is null.

public String printAnySimpleType(String val)

将字符串值转换为一个字符串。

val | 字符串值
return | 包含 xsd:AnySimpleType 的词汇表示形式的字符串
英文文档：

printAnySimpleType

String printAnySimpleType(String val)

Converts a string value into a string.

Parameters:
val - A string value
Returns:
A string containing a lexical representation of xsd:AnySimpleType
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Element (Java EE 5)

javax.xml.bind
Interface Element

public interface Element

这是一个元素标记接口。 在某些情况下，绑定编译器必须生成实现此接口的派生的 java 内容类。在这些情况下，客户端应用程序必须提供元素实例，而不是元素的类型。有关详细信息，请参阅该规范的 5.7 节“元素声明”和 5.7.1 节“绑定到 Java 元素接口”。
version
en
$Revision: 1.1 $
since JAXB1.0
英文文档：

This is an element marker interface. Under certain circumstances, it is necessary for the binding compiler to generate derived java content classes that implement this interface. In those cases, client applications must supply element instances rather than types of elements. For more detail, see section 5.7 "Element Declaration" and 5.7.1 "Bind to Java Element Interface" of the specification.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Marshaller (Java EE 5)

javax.xml.bind
Interface Marshaller

All Known Implementing Classes:
AbstractMarshallerImpl
public interface Marshaller

Inner classes: Marshaller.Listener
Implemented by: AbstractMarshallerImpl

Marshaller 类负责管理将 Java 内容树序列化回 XML 数据的过程。它提供了基本的编组方法：

假定以下安装代码适用于下列所有代码片段：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();
Object element = u.unmarshal( new File( "foo.xml" ) );
Marshaller m = jc.createMarshaller();

编组到 File 中：

OutputStream os = new FileOutputStream( "nosferatu.xml" );
m.marshal( element, os );

编组到 SAX ContentHandler 中：

// assume MyContentHandler instanceof ContentHandler
m.marshal( element, new MyContentHandler() );

编组到 DOM Node 中：

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();

m.marshal( element, doc );

编组到 java.io.OutputStream 中：

m.marshal( element, System.out );

编组到 java.io.Writer 中：

m.marshal( element, new PrintWriter( System.out ) );

编组到 javax.xml.transform.SAXResult 中：

// assume MyContentHandler instanceof ContentHandler
SAXResult result = new SAXResult( new MyContentHandler() );

m.marshal( element, result );

编组到 javax.xml.transform.DOMResult 中：

DOMResult result = new DOMResult();

m.marshal( element, result );

编组到 javax.xml.transform.StreamResult 中：

StreamResult result = new StreamResult( System.out );

m.marshal( element, result );

编组到 javax.xml.stream.XMLStreamWriter 中：

XMLStreamWriter xmlStreamWriter =
XMLOutputFactory.newInstance().createXMLStreamWriter( ... );

m.marshal( element, xmlStreamWriter );

编组到 javax.xml.stream.XMLEventWriter 中：

XMLEventWriter xmlEventWriter =
XMLOutputFactory.newInstance().createXMLEventWriter( ... );

m.marshal( element, xmlEventWriter );

对通过 JAXB 元素确定的内容树进行编组

重载的 Marshaller.marshal(java.lang.Object, ...) 方法的第一个参数必须是由 isElement(java.lang.Object) 计算的 JAXB 元素；否则，Marshaller.marshal 方法必须抛出 MarshalException。存在两种能编组非 JAXB 元素实例的机制。一种方法是将该实例包装为 JAXBElement 值，并将包装器对象作为第一个参数传递给 Marshaller.marshal 方法。对于 java 到模式的绑定，还可以简单地使用 @XmlRootElement 注释该实例的类。

编码

默认情况下，在将 XML 数据生成到 java.io.OutputStream 或 java.io.Writer 中时，Marshaller 将使用 UTF-8 编码。可以使用 setProperty API 更改执行这些编组操作期间所使用的输出编码。期望客户端应用程序根据 W3C XML 1.0 Recommendation 中的定义提供 Java 平台支持的有效字符编码名称。

验证和格式良好性

客户端应用程序不需要在调用任何编组 API 之前验证 Java 内容树。此外，在将 Java 内容树编组回 XML 数据时，不要求它对于其源模式有效。不同的 JAXB 提供者可支持编组各种级别的无效 Java 内容树，但所有 JAXB 提供者都必须能够将有效的内容树编组回 XML 数据。当因为无效内容导致 JAXB 提供者无法完成编组操作时，JAXB 提供者必须抛出 MarshalException。一些 JAXB 提供者完全允许编组无效内容，而另一些 JAXB 提供者将在出现第一个验证错误时失败。

即使没有为编组操作显式地启用模式验证，但在操作过程中可能要检测某些类型的验证事件。这些验证事件将被报告给已注册的事件处理程序。如果客户端应用程序没有在调用某个编组 API 之前注册事件处理程序，则事件将被转发给默认的事件处理程序，默认处理程序将在遇到第一个错误或遇到致命错误之后终止编组操作。注意，对于 JAXB 2.0 和以后的版本，不再使用 javax.xml.bind.helpers.DefaultValidationEventHandler。

支持的属性

所有 JAXB 提供者都要支持以下这组属性。某些提供者还可以支持其他属性。

jaxb.encoding：值必须是 java.lang.String
编组 XML 数据时使用的输出编码。默认情况下，如果未指定此属性，则 Marshaller 将使用 "UTF-8"。
jaxb.formatted.output：值必须是 java.lang.Boolean
此属性控制 Marshaller 是否使用换行和缩排对得到的 XML 数据进行格式化。此属性为 true 值表示可读性强的缩排 xml 数据，而属性值为 false 则表示未格式化的 xml 数据。如果未指定此属性，则 Marshaller 将该属性值默认为 false（未格式化）。
jaxb.schemaLocation：值必须是 java.lang.String
此属性允许客户端应用程序在生成的 XML 数据中指定 xsi:schemaLocation 属性。该 schemaLocation 属性值的格式将以便于理解的、非标准的形式在 W3C XML Schema Part 0:Primer 的第 5.6 节中讨论，并在 W3C XML Schema Part 1:Structures 的第 2.6 节中指定。
jaxb.noNamespaceSchemaLocation：值必须是 java.lang.String
此属性允许客户端应用程序在生成的 XML 数据中指定 xsi:noNamespaceSchemaLocation 属性。该 schemaLocation 属性值的格式将以便于理解的、非标准的形式在 W3C XML Schema Part 0:Primer 的第 5.6 节中讨论，并在 W3C XML Schema Part 1:Structures 的第 2.6 节中指定。
jaxb.fragment：值必须是 java.lang.Boolean
此属性决定 Marshaller 是否将生成文档级事件。如果未指定该属性，则默认为 false。将其设置为 true 时，根据所使用的编组 API，此属性具有不同的含义：
  • marshal(Object,ContentHandler)：Marshaller 不会调用 startDocument() 和 endDocument()。
  • marshal(Object,Node)：该属性对此 API 没有影响。
  • marshal(Object,OutputStream)：Marshaller 不会生成 xml 声明。
  • marshal(Object,Writer)：Marshaller 不会生成 xml 声明。
  • marshal(Object,Result)：取决于 Result 对象的类型，请参见 Node、ContentHandler 和 Stream API 的语义。
  • marshal(Object,XMLEventWriter)：Marshaller 不会生成 javax.xml.stream.events.XMLEvent#START_DOCUMENT 和 javax.xml.stream.events.XMLEvent#END_DOCUMENT 事件。
  • marshal(Object,XMLStreamWriter)：Marshaller 不会生成 javax.xml.stream.events.XMLEvent#START_DOCUMENT 和 javax.xml.stream.events.XMLEvent#END_DOCUMENT 事件。

编组事件回调

Marshaller 提供了两种风格的回调机制，这些机制允许在解组过程的关键点上进行特定于应用程序的处理。在“类定义的”事件回调中，编组期间会触发位于 JAXB 映射类中的特定于应用程序的代码。“外部侦听器”允许用一个回调方法集中处理编组事件，而不是通过各种类型事件回调处理。

类定义的事件回调方法允许任何 JAXB 映射类通过定义带有以下方法签名的方法指定自己的特定回调方法：

// Invoked by Marshaller after it has created an instance of this object.
boolean beforeMarshal(Marshaller, Object parent);

// Invoked by Marshaller after it has marshalled all properties of this object.
void afterMmarshal(Marshaller, Object parent);
类定义的事件回调方法应该在回调方法需要访问该类的非公共方法和/或字段时使用。

外部侦听器回调机制支持 Listener 实例使用 setListener(Listener) 的注册。外部侦听器接收所有回调事件，从而允许用比逐个类地定义回调方法更为集中的方式处理事件。

“类定义的”事件回调方法和外部侦听器事件回调方法相互独立，可以对一个事件同时调用。两种侦听器回调方法都存在时，按照 beforeMarshal(Object) 和 afterMarshal(Object) 中定义的顺序对它们进行调用。

抛出异常的事件回调方法会终止当前的编组进程。

version
en
$Revision: 1.19 $ $Date: 2006/03/08 16:54:42 $
since | JAXB1.0
See also | javax.xml.bind.JAXBContext, javax.xml.bind.Validator, javax.xml.bind.Unmarshaller
英文文档：

The Marshaller class is responsible for governing the process of serializing Java content trees back into XML data. It provides the basic marshalling methods:

Assume the following setup code for all following code fragments:

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();
       Object element = u.unmarshal( new File( "foo.xml" ) );
       Marshaller m = jc.createMarshaller();

Marshalling to a File:

       OutputStream os = new FileOutputStream( "nosferatu.xml" );
       m.marshal( element, os );

Marshalling to a SAX ContentHandler:

       // assume MyContentHandler instanceof ContentHandler
       m.marshal( element, new MyContentHandler() );

Marshalling to a DOM Node:

       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
       dbf.setNamespaceAware(true);
       DocumentBuilder db = dbf.newDocumentBuilder();
       Document doc = db.newDocument();

       m.marshal( element, doc );

Marshalling to a java.io.OutputStream:

       m.marshal( element, System.out );

Marshalling to a java.io.Writer:

       m.marshal( element, new PrintWriter( System.out ) );

Marshalling to a javax.xml.transform.SAXResult:

       // assume MyContentHandler instanceof ContentHandler
       SAXResult result = new SAXResult( new MyContentHandler() );

       m.marshal( element, result );

Marshalling to a javax.xml.transform.DOMResult:

       DOMResult result = new DOMResult();

       m.marshal( element, result );

Marshalling to a javax.xml.transform.StreamResult:

       StreamResult result = new StreamResult( System.out );

       m.marshal( element, result );

Marshalling to a javax.xml.stream.XMLStreamWriter:

       XMLStreamWriter xmlStreamWriter =
           XMLOutputFactory.newInstance().createXMLStreamWriter( ... );

       m.marshal( element, xmlStreamWriter );

Marshalling to a javax.xml.stream.XMLEventWriter:

       XMLEventWriter xmlEventWriter =
           XMLOutputFactory.newInstance().createXMLEventWriter( ... );

       m.marshal( element, xmlEventWriter );

Marshalling content tree rooted by a JAXB element

The first parameter of the overloaded Marshaller.marshal(java.lang.Object, ...) methods must be a JAXB element as computed by JAXBIntrospector.isElement(java.lang.Object); otherwise, a Marshaller.marshal method must throw a MarshalException. There exist two mechanisms to enable marshalling an instance that is not a JAXB element. One method is to wrap the instance as a value of a JAXBElement, and pass the wrapper element as the first parameter to a Marshaller.marshal method. For java to schema binding, it is also possible to simply annotate the instance's class with @XmlRootElement.

Encoding

By default, the Marshaller will use UTF-8 encoding when generating XML data to a java.io.OutputStream, or a java.io.Writer. Use the setProperty API to change the output encoding used during these marshal operations. Client applications are expected to supply a valid character encoding name as defined in the W3C XML 1.0 Recommendation and supported by your Java Platform.

Validation and Well-Formedness

Client applications are not required to validate the Java content tree prior to calling any of the marshal API's. Furthermore, there is no requirement that the Java content tree be valid with respect to its original schema in order to marshal it back into XML data. Different JAXB Providers will support marshalling invalid Java content trees at varying levels, however all JAXB Providers must be able to marshal a valid content tree back to XML data. A JAXB Provider must throw a MarshalException when it is unable to complete the marshal operation due to invalid content. Some JAXB Providers will fully allow marshalling invalid content, others will fail on the first validation error.

Even when schema validation is not explictly enabled for the marshal operation, it is possible that certain types of validation events will be detected during the operation. Validation events will be reported to the registered event handler. If the client application has not registered an event handler prior to invoking one of the marshal API's, then events will be delivered to a default event handler which will terminate the marshal operation after encountering the first error or fatal error. Note that for JAXB 2.0 and later versions, DefaultValidationEventHandler is no longer used.

Supported Properties

All JAXB Providers are required to support the following set of properties. Some providers may support additional properties.

jaxb.encoding - value must be a java.lang.String
The output encoding to use when marshalling the XML data. The Marshaller will use "UTF-8" by default if this property is not specified.
jaxb.formatted.output - value must be a java.lang.Boolean
This property controls whether or not the Marshaller will format the resulting XML data with line breaks and indentation. A true value for this property indicates human readable indented xml data, while a false value indicates unformatted xml data. The Marshaller will default to false (unformatted) if this property is not specified.
jaxb.schemaLocation - value must be a java.lang.String
This property allows the client application to specify an xsi:schemaLocation attribute in the generated XML data. The format of the schemaLocation attribute value is discussed in an easy to understand, non-normative form in Section 5.6 of the W3C XML Schema Part 0: Primer and specified in Section 2.6 of the W3C XML Schema Part 1: Structures.
jaxb.noNamespaceSchemaLocation - value must be a java.lang.String
This property allows the client application to specify an xsi:noNamespaceSchemaLocation attribute in the generated XML data. The format of the schemaLocation attribute value is discussed in an easy to understand, non-normative form in Section 5.6 of the W3C XML Schema Part 0: Primer and specified in Section 2.6 of the W3C XML Schema Part 1: Structures.
jaxb.fragment - value must be a java.lang.Boolean
This property determines whether or not document level events will be generated by the Marshaller. If the property is not specified, the default is false. This property has different implications depending on which marshal api you are using - when this property is set to true:
  • marshal(Object,ContentHandler) - the Marshaller won't
             invoke ContentHandler.startDocument() and
             ContentHandler.endDocument().
  • marshal(Object,Node) - the property has no effect on this API.
  • marshal(Object,OutputStream) - the Marshaller won't generate an xml declaration.
  • marshal(Object,Writer) - the Marshaller won't generate an xml declaration.
  • marshal(Object,Result) - depends on the kind of Result object, see semantics for Node, ContentHandler, and Stream APIs
  • marshal(Object,XMLEventWriter) - the Marshaller will not generate XMLStreamConstants.START_DOCUMENT and XMLStreamConstants.END_DOCUMENT events.
  • marshal(Object,XMLStreamWriter) - the Marshaller will not generate XMLStreamConstants.START_DOCUMENT and XMLStreamConstants.END_DOCUMENT events.

Marshal Event Callbacks

"The Marshaller provides two styles of callback mechanisms that allow application specific processing during key points in the unmarshalling process. In 'class defined' event callbacks, application specific code placed in JAXB mapped classes is triggered during marshalling. 'External listeners' allow for centralized processing of marshal events in one callback method rather than by type event callbacks.

Class defined event callback methods allow any JAXB mapped class to specify its own specific callback methods by defining methods with the following method signatures:

   // Invoked by Marshaller after it has created an instance of this object.
   boolean beforeMarshal(Marshaller, Object parent);

   // Invoked by Marshaller after it has marshalled all properties of this object.
   void afterMmarshal(Marshaller, Object parent);
The class defined event callback methods should be used when the callback method requires access to non-public methods and/or fields of the class.

The external listener callback mechanism enables the registration of a Marshaller.Listener instance with a setListener(Listener). The external listener receives all callback events, allowing for more centralized processing than per class defined callback methods.

The 'class defined' and external listener event callback methods are independent of each other, both can be called for one event. The invocation ordering when both listener callback methods exist is defined in Marshaller.Listener.beforeMarshal(Object) and Marshaller.Listener.afterMarshal(Object).

An event callback method throwing an exception terminates the current marshal process.

Since:
JAXB1.0
Version:
$Revision: 1.19 $ $Date: 2006/03/08 16:54:42 $
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
JAXBContext, Validator, Unmarshaller

Nested Class Summary
static class Marshaller.Listener

Register an instance of an implementation of this class with a Marshaller to externally listen for marshal events.

Field Summary
static String | JAXB_ENCODING The name of the property used to specify the output encoding in the marshalled XML data.
static String | JAXB_FORMATTED_OUTPUT The name of the property used to specify whether or not the marshalled XML data is formatted with linefeeds and indentation.
static String | JAXB_FRAGMENT The name of the property used to specify whether or not the marshaller will generate document level events (ie calling startDocument or endDocument).
static String | JAXB_NO_NAMESPACE_SCHEMA_LOCATION The name of the property used to specify the xsi:noNamespaceSchemaLocation attribute value to place in the marshalled XML output.
static String | JAXB_SCHEMA_LOCATION The name of the property used to specify the xsi:schemaLocation attribute value to place in the marshalled XML output.
Method Summary
<A extends XmlAdapter>
A
getAdapter(Class<A> type)
Gets the adapter associated with the specified type.
 AttachmentMarshaller getAttachmentMarshaller()
 ValidationEventHandler getEventHandler()
Return the current event handler or the default event handler if one hasn't been set.
 Marshaller.Listener getListener()
Return Marshaller.Listener registered with this Marshaller.
 Node getNode(Object contentTree)
Get a DOM tree view of the content tree(Optional).
 Object getProperty(String name)
Get the particular property in the underlying implementation of Marshaller.
 Schema getSchema()
Get the JAXP 1.3 Schema object being used to perform marshal-time validation.
 void marshal(Object jaxbElement, ContentHandler handler)
Marshal the content tree rooted at jaxbElement into SAX2 events.
 void marshal(Object jaxbElement, Node node)
Marshal the content tree rooted at jaxbElement into a DOM tree.
 void marshal(Object jaxbElement, OutputStream os)
Marshal the content tree rooted at jaxbElement into an output stream.
 void marshal(Object jaxbElement, Result result)
Marshal the content tree rooted at jaxbElement into the specified javax.xml.transform.Result.
 void marshal(Object jaxbElement, Writer writer)
Marshal the content tree rooted at jaxbElement into a Writer.
 void marshal(Object jaxbElement, XMLEventWriter writer)
Marshal the content tree rooted at jaxbElement into a XMLEventWriter.
 void marshal(Object jaxbElement, XMLStreamWriter writer)
Marshal the content tree rooted at jaxbElement into a XMLStreamWriter.
<A extends XmlAdapter>
void
setAdapter(Class<A> type, A adapter)
Associates a configured instance of XmlAdapter with this marshaller.
 void setAdapter(XmlAdapter adapter)
Associates a configured instance of XmlAdapter with this marshaller.
 void setAttachmentMarshaller(AttachmentMarshaller am)
Associate a context that enables binary data within an XML document to be transmitted as XML-binary optimized attachment.
 void setEventHandler(ValidationEventHandler handler)
Allow an application to register a validation event handler.
 void setListener(Marshaller.Listener listener)
Register marshal event callback Marshaller.Listener with this Marshaller.
 void setProperty(String name, Object value)
Set the particular property in the underlying implementation of Marshaller.
 void setSchema(Schema schema)
Specify the JAXP 1.3 Schema object that should be used to validate subsequent marshal operations against.

Field Detail

英文文档：

JAXB_ENCODING

static final String JAXB_ENCODING
The name of the property used to specify the output encoding in the marshalled XML data.

See Also:
Constant Field Values

英文文档：

JAXB_FORMATTED_OUTPUT

static final String JAXB_FORMATTED_OUTPUT
The name of the property used to specify whether or not the marshalled XML data is formatted with linefeeds and indentation.

See Also:
Constant Field Values

英文文档：

JAXB_SCHEMA_LOCATION

static final String JAXB_SCHEMA_LOCATION
The name of the property used to specify the xsi:schemaLocation attribute value to place in the marshalled XML output.

See Also:
Constant Field Values

英文文档：

JAXB_NO_NAMESPACE_SCHEMA_LOCATION

static final String JAXB_NO_NAMESPACE_SCHEMA_LOCATION
The name of the property used to specify the xsi:noNamespaceSchemaLocation attribute value to place in the marshalled XML output.

See Also:
Constant Field Values

英文文档：

JAXB_FRAGMENT

static final String JAXB_FRAGMENT
The name of the property used to specify whether or not the marshaller will generate document level events (ie calling startDocument or endDocument).

See Also:
Constant Field Values
Method Detail

public void marshal(Object jaxbElement, javax.xml.transform.Result result) throws JAXBException
将以 jaxbElement 为根的内容树编组到指定的 javax.xml.transform.Result 中。

所有 JAXB 提供者至少必须支持 javax.xml.transform.dom.DOMResult、javax.xml.transform.sax.SAXResult 和 javax.xml.transform.stream.StreamResult。它也可以支持 Result 的其他派生类。

jaxbElement | 要编组的内容树的根。
result | XML 将被发送到此 Result
Throws | JAXBException: 如果进行解组期间发生不可预料的错误。
Throws | MarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false，或者 Marshaller 不能编组 obj（或任何可从 obj 获得的对象）。请参阅编组 JAXB 元素。
Throws | IllegalArgumentException: 如果任何方法的参数为 null
英文文档：

marshal

void marshal(Object jaxbElement,
             Result result)
             throws JAXBException
Marshal the content tree rooted at jaxbElement into the specified javax.xml.transform.Result.

All JAXB Providers must at least support DOMResult, SAXResult, and StreamResult. It can support other derived classes of Result as well.

Parameters:
jaxbElement - The root of content tree to be marshalled.
result - XML will be sent to this Result
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.
IllegalArgumentException - If any of the method parameters are null

public void marshal(Object jaxbElement, java.io.OutputStream os) throws JAXBException
将以 jaxbElement 为根的内容树编组到输出流中。
jaxbElement | 要编组的内容树的根。
os | XML 将被添加到此流。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误。
Throws | MarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false，或者 Marshaller 不能编组 obj（或任何可从 obj 获得的对象）。请参阅编组 JAXB 元素。
Throws | IllegalArgumentException: 如果任何方法的参数为 null
英文文档：

marshal

void marshal(Object jaxbElement,
             OutputStream os)
             throws JAXBException
Marshal the content tree rooted at jaxbElement into an output stream.

Parameters:
jaxbElement - The root of content tree to be marshalled.
os - XML will be added to this stream.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.
IllegalArgumentException - If any of the method parameters are null

public void marshal(Object jaxbElement, java.io.Writer writer) throws JAXBException
将以 jaxbElement 为根的内容树编组到 Writer 中。
jaxbElement | 要编组的内容树的根。
writer | XML 将被发送到此编写器。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误。
Throws | MarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false，或者 Marshaller 不能编组 obj（或任何可从 obj 获得的对象）。请参阅编组 JAXB 元素。
Throws | IllegalArgumentException: 如果任何方法的参数为 null
英文文档：

marshal

void marshal(Object jaxbElement,
             Writer writer)
             throws JAXBException
Marshal the content tree rooted at jaxbElement into a Writer.

Parameters:
jaxbElement - The root of content tree to be marshalled.
writer - XML will be sent to this writer.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.
IllegalArgumentException - If any of the method parameters are null

public void marshal(Object jaxbElement, org.xml.sax.ContentHandler handler) throws JAXBException
将以 jaxbElement 为根的内容树编组到 SAX2 事件中。
jaxbElement | 要编组的内容树的根。
handler | XML 将被作为 SAX2 事件发送到此处理程序。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误。
Throws | MarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false，或者 Marshaller 不能编组 obj（或任何可从 obj 获得的对象）。请参阅编组 JAXB 元素。
Throws | IllegalArgumentException: 如果任何方法的参数为 null
英文文档：

marshal

void marshal(Object jaxbElement,
             ContentHandler handler)
             throws JAXBException
Marshal the content tree rooted at jaxbElement into SAX2 events.

Parameters:
jaxbElement - The root of content tree to be marshalled.
handler - XML will be sent to this handler as SAX2 events.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.
IllegalArgumentException - If any of the method parameters are null

public void marshal(Object jaxbElement, org.w3c.dom.Node node) throws JAXBException
将以 jaxbElement 为根的内容树编组到 DOM 树中。
jaxbElement | 将被编组的内容树。
node | DOM 节点将作为此节点的子节点添加。此参数必须是一个可接受子节点（org.w3c.dom.Document、org.w3c.dom.DocumentFragment 或 org.w3c.dom.Element）的 Node。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误。
Throws | MarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false，或者 Marshaller 不能编组 jaxbElement（或任何可从 jaxbElement 获得的对象）。请参阅编组 JAXB 元素。
Throws | IllegalArgumentException: 如果任何方法的参数为 null
英文文档：

marshal

void marshal(Object jaxbElement,
             Node node)
             throws JAXBException
Marshal the content tree rooted at jaxbElement into a DOM tree.

Parameters:
jaxbElement - The content tree to be marshalled.
node - DOM nodes will be added as children of this node. This parameter must be a Node that accepts children (Document, DocumentFragment, or Element)
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal jaxbElement (or any object reachable from jaxbElement). See Marshalling a JAXB element.
IllegalArgumentException - If any of the method parameters are null

public void marshal(Object jaxbElement, XMLStreamWriter writer) throws JAXBException
将以 jaxbElement 为根的内容树编组到 javax.xml.stream.XMLStreamWriter 中。
jaxbElement | 将被编组的内容树。
writer | XML 将被发送到此编写器。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误。
Throws | MarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false，或者 Marshaller 不能编组 obj（或任何可从 obj 获得的对象）。请参阅编组 JAXB 元素。
Throws | IllegalArgumentException: 如果任何方法的参数为 null
since | JAXB 2.0
英文文档：

marshal

void marshal(Object jaxbElement,
             XMLStreamWriter writer)
             throws JAXBException
Marshal the content tree rooted at jaxbElement into a XMLStreamWriter.

Parameters:
jaxbElement - The content tree to be marshalled.
writer - XML will be sent to this writer.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.
IllegalArgumentException - If any of the method parameters are null
Since:
JAXB 2.0

public void marshal(Object jaxbElement, XMLEventWriter writer) throws JAXBException
将以 jaxbElement 为根的内容树编组到 javax.xml.stream.XMLEventWriter 中。
jaxbElement | 要编组的以 jaxbElement 为根的内容树。
writer | XML 将被发送到此编写器。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误。
Throws | MarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false，或者 Marshaller 不能编组 obj（或任何可从 obj 获得的对象）。请参阅编组 JAXB 元素。
Throws | IllegalArgumentException: 如果任何方法的参数为 null
since | JAXB 2.0
英文文档：

marshal

void marshal(Object jaxbElement,
             XMLEventWriter writer)
             throws JAXBException
Marshal the content tree rooted at jaxbElement into a XMLEventWriter.

Parameters:
jaxbElement - The content tree rooted at jaxbElement to be marshalled.
writer - XML will be sent to this writer.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.
IllegalArgumentException - If any of the method parameters are null
Since:
JAXB 2.0

public org.w3c.dom.Node getNode(Object contentTree) throws JAXBException
获取内容树的 DOM 树视图（可选）。 如果更新了返回的 DOM 树，则这些更改也可以在内容树中看见。使用 #marshal(Object, org.w3c.dom.Node) 强行将内容树的深层复制转换成 DOM 表示形式。
contentTree | XML 内容的 JAXB Java 表示形式
return | contentTree 的 DOM 树视图
Throws | UnsupportedOperationException: 如果 JAXB 提供者实现不支持内容树的 DOM 视图
Throws | IllegalArgumentException: 如果任何方法的参数为 null
Throws | JAXBException: 如果发生任何不可预料的问题
英文文档：

getNode

Node getNode(Object contentTree)
             throws JAXBException
Get a DOM tree view of the content tree(Optional). If the returned DOM tree is updated, these changes are also visible in the content tree. Use marshal(Object, org.w3c.dom.Node) to force a deep copy of the content tree to a DOM representation.

Parameters:
contentTree - - JAXB Java representation of XML content
Returns:
the DOM tree view of the contentTree
Throws:
UnsupportedOperationException - If the JAXB provider implementation does not support a DOM view of the content tree
IllegalArgumentException - If any of the method parameters are null
JAXBException - If any unexpected problem occurs

public void setProperty(String name, Object value) throws PropertyException
设置 Marshaller 底层实现中的特定属性。此方法只能用于设置上文中标准 JAXB 定义的属性之一或特定于提供者的属性。试图设置未定义的属性将导致抛出 PropertyException。请参阅支持的属性。
name | 要设置的属性的名称。此值可以使用一个常量字段来指定，也可以是用户提供的字符串。
value | 要设置的属性值
Throws | PropertyException: 如果处理给定属性或值时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
英文文档：

setProperty

void setProperty(String name,
                 Object value)
                 throws PropertyException
Set the particular property in the underlying implementation of Marshaller. This method can only be used to set one of the standard JAXB defined properties above or a provider specific property. Attempting to set an undefined property will result in a PropertyException being thrown. See Supported Properties.

Parameters:
name - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.
value - the value of the property to be set
Throws:
PropertyException - when there is an error processing the given property or value
IllegalArgumentException - If the name parameter is null

public Object getProperty(String name) throws PropertyException
获取 Marshaller 底层实现中的特定属性。此方法只能用于获取上文中标准 JAXB 定义的属性之一或特定于提供者的属性。试图获取未定义的属性将导致抛出 PropertyException。请参阅支持的属性。
name | 将检索的属性名称
return | 所请求属性的值
Throws | PropertyException: 如果检索给定属性或值属性名称时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
英文文档：

getProperty

Object getProperty(String name)
                   throws PropertyException
Get the particular property in the underlying implementation of Marshaller. This method can only be used to get one of the standard JAXB defined properties above or a provider specific property. Attempting to get an undefined property will result in a PropertyException being thrown. See Supported Properties.

Parameters:
name - the name of the property to retrieve
Returns:
the value of the requested property
Throws:
PropertyException - when there is an error retrieving the given property or value property name
IllegalArgumentException - If the name parameter is null

public void setEventHandler(ValidationEventHandler handler) throws JAXBException
允许应用程序注册一个验证事件处理程序。

如果在调用任何编组 API 期间遇到任何验证错误，则 JAXB 提供者将调用验证事件处理程序。如果客户端应用程序没有在调用某个 marshal 方法之前注册验证事件处理程序，则将使用默认事件处理程序处理验证事件，默认处理程序将在遇到第一个错误或致命错误之后将终止编组操作。

调用带有 null 参数的此方法将导致 Marshaller 重新使用默认事件处理程序。

handler | 验证事件处理程序
Throws | JAXBException: 如果在设置事件处理程序时发生错误
英文文档：

setEventHandler

void setEventHandler(ValidationEventHandler handler)
                     throws JAXBException
Allow an application to register a validation event handler.

The validation event handler will be called by the JAXB Provider if any validation errors are encountered during calls to any of the marshal API's. If the client application does not register a validation event handler before invoking one of the marshal methods, then validation events will be handled by the default event handler which will terminate the marshal operation after the first error or fatal error is encountered.

Calling this method with a null parameter will cause the Marshaller to revert back to the default default event handler.

Parameters:
handler - the validation event handler
Throws:
JAXBException - if an error was encountered while setting the event handler

public ValidationEventHandler getEventHandler() throws JAXBException
当前的事件处理程序；如果没有设置，则返回默认事件处理程序。
return | 当前的 ValidationEventHandler；如果没有设置，则返回默认的事件处理程序
Throws | JAXBException: 如果获取当前的事件处理程序时遇到错误
英文文档：

getEventHandler

ValidationEventHandler getEventHandler()
                                       throws JAXBException
Return the current event handler or the default event handler if one hasn't been set.

Returns:
the current ValidationEventHandler or the default event handler if it hasn't been set
Throws:
JAXBException - if an error was encountered while getting the current event handler

public void setAdapter(XmlAdapter adapter)
将已配置的 XmlAdapter 实例与此 marshaller 关联。

这是调用 setAdapter(adapter.getClass(),adapter) 的一个便捷方法。

Throws | IllegalArgumentException: 如果 adapter 参数为 null。
Throws | UnsupportedOperationException: 如果基于 JAXB 1.0 实现调用。
since | JAXB 2.0
See also | setAdapter(Class,XmlAdapter)
英文文档：

setAdapter

void setAdapter(XmlAdapter adapter)
Associates a configured instance of XmlAdapter with this marshaller.

This is a convenience method that invokes setAdapter(adapter.getClass(),adapter);.

Throws:
IllegalArgumentException - if the adapter parameter is null.
UnsupportedOperationException - if invoked agains a JAXB 1.0 implementation.
Since:
JAXB 2.0
See Also:
setAdapter(Class,XmlAdapter)

英文文档：

setAdapter

<A extends XmlAdapter> void setAdapter(Class<A> type,
                                       A adapter)
Associates a configured instance of XmlAdapter with this marshaller.

Every marshaller internally maintains a Map<Class,XmlAdapter>, which it uses for marshalling classes whose fields/methods are annotated with XmlJavaTypeAdapter.

This method allows applications to use a configured instance of XmlAdapter. When an instance of an adapter is not given, a marshaller will create one by invoking its default constructor.

Parameters:
type - The type of the adapter. The specified instance will be used when XmlJavaTypeAdapter.value() refers to this type.
adapter - The instance of the adapter to be used. If null, it will un-register the current adapter set for this type.
Throws:
IllegalArgumentException - if the type parameter is null.
UnsupportedOperationException - if invoked agains a JAXB 1.0 implementation.
Since:
JAXB 2.0

英文文档：

getAdapter

<A extends XmlAdapter> A getAdapter(Class<A> type)
Gets the adapter associated with the specified type. This is the reverse operation of the setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter) method.

Throws:
IllegalArgumentException - if the type parameter is null.
UnsupportedOperationException - if invoked agains a JAXB 1.0 implementation.
Since:
JAXB 2.0

public void setAttachmentMarshaller(AttachmentMarshaller am)

与上下文关联，使 XML 文档内的二进制数据能够以优化的 XML 二进制附件的形式传送。可以使用存储在 xml 文档中的内容 id URI (cid) 从 XML 文档内容模式引用附件。

Throws IllegalStateException: 如果试图在执行编组操作期间同时调用此方法。
英文文档：

setAttachmentMarshaller

void setAttachmentMarshaller(AttachmentMarshaller am)

Associate a context that enables binary data within an XML document to be transmitted as XML-binary optimized attachment. The attachment is referenced from the XML document content model by content-id URIs(cid) references stored within the xml document.

Throws:
IllegalStateException - if attempt to concurrently call this method during a marshal operation.

public AttachmentMarshaller getAttachmentMarshaller()
英文文档：

getAttachmentMarshaller

AttachmentMarshaller getAttachmentMarshaller()

public void setSchema(javax.xml.validation.Schema schema)
指定应该用作验证后续编组操作依据的 JAXP 1.3 Schema 对象。向此方法传递 null 将禁用验证。

此方法允许调用者在对已编组的 XML 进行编组时验证它。

最初，此属性被设置为 null。

schema | 作为验证编组操作依据的 Schema 对象；为 null 表示禁用验证
Throws | UnsupportedOperationException: 如果对根据引用 JAXB 1.0 映射类的 JAXBContext 而创建的 Marshaller 调用此方法，则抛出该异常
since | JAXB2.0
英文文档：

setSchema

void setSchema(Schema schema)
Specify the JAXP 1.3 Schema object that should be used to validate subsequent marshal operations against. Passing null into this method will disable validation.

This method allows the caller to validate the marshalled XML as it's marshalled.

Initially this property is set to null.

Parameters:
schema - Schema object to validate marshal operations against or null to disable validation
Throws:
UnsupportedOperationException - could be thrown if this method is invoked on an Marshaller created from a JAXBContext referencing JAXB 1.0 mapped classes
Since:
JAXB2.0

public javax.xml.validation.Schema getSchema()
获取用于执行编组时验证的 JAXP 1.3 Schema 对象。如果未在 marshaller 上设置 Schema，则此方法将返回 null，指示不执行编组时验证。
return | 返回用于执行编组时验证的 Schema 对象；如果该对象不存在，则返回 null。
Throws | UnsupportedOperationException: 如果对根据引用 JAXB 1.0 映射类的 JAXBContext 而创建的 Marshaller 调用此方法，则抛出该异常
since | JAXB2.0
英文文档：

getSchema

Schema getSchema()
Get the JAXP 1.3 Schema object being used to perform marshal-time validation. If there is no Schema set on the marshaller, then this method will return null indicating that marshal-time validation will not be performed.

Returns:
the Schema object being used to perform marshal-time validation or null if not present.
Throws:
UnsupportedOperationException - could be thrown if this method is invoked on an Marshaller created from a JAXBContext referencing JAXB 1.0 mapped classes
Since:
JAXB2.0

public void setListener(Marshaller.Listener listener)

向此 Marshaller 注册编组事件回调 Listener。

每个 Marshaller 只有一个 Listener。设置 Listener 将替换以前设置的 Listener。通过将 listener 设置为 null 可注销当前的 Listener。

listener | 实现 Listener 的类的实例
since | JAXB2.0
英文文档：

setListener

void setListener(Marshaller.Listener listener)

Register marshal event callback Marshaller.Listener with this Marshaller.

There is only one Listener per Marshaller. Setting a Listener replaces the previous set Listener. One can unregister current Listener by setting listener to null.

Parameters:
listener - an instance of a class that implements Marshaller.Listener
Since:
JAXB2.0

public Marshaller.Listener getListener()

返回向此 Marshaller 注册的 Listener。

return | 注册的 Listener；如果未向此 Marshaller 注册任何 Listener，则返回 null。
since | JAXB2.0
英文文档：

getListener

Marshaller.Listener getListener()

Return Marshaller.Listener registered with this Marshaller.

Returns:
registered Marshaller.Listener or null if no Listener is registered with this Marshaller.
Since:
JAXB2.0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Marshaller.Listener (Java EE 5)

javax.xml.bind
Class Marshaller.Listener

java.lang.Object
    extended by  javax.xml.bind.Marshaller.Listener
Enclosing interface:
Marshaller
public abstract static class Marshaller.Listener
extends Object

Contained within: Marshaller

向 Marshaller 注册此类的一个实现的实例，以从外部侦听编组事件。

此类支持对每个已编组的对象进行预处理和后处理。从映射到 xml 元素或复杂类型定义的实例进行编组时，将调用事件回调。从表示简单类型定义的 Java 数据类型的实例进行编组时，不需要调用事件回调。

外部侦听器是用于定义编组事件回调的两个不同机制之一。请参阅 Marshal Event Callbacks 获得对方面的概括。

since | JAXB2.0
See also | setListener(Listener), getListener()
英文文档：

Register an instance of an implementation of this class with a Marshaller to externally listen for marshal events.

This class enables pre and post processing of each marshalled object. The event callbacks are called when marshalling from an instance that maps to an xml element or complex type definition. The event callbacks are not called when marshalling from an instance of a Java datatype that represents a simple type definition.

External listener is one of two different mechanisms for defining marshal event callbacks. See Marshal Event Callbacks for an overview.

Since:
JAXB2.0
See Also:
Marshaller.setListener(Listener), Marshaller.getListener()

Constructor Summary
Marshaller.Listener()
Method Summary
void | afterMarshal(Object source) Callback method invoked after marshalling source to XML.
void | beforeMarshal(Object source) Callback method invoked before marshalling from source to XML.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Marshaller.Listener()
英文文档：

Marshaller.Listener

public Marshaller.Listener()
Method Detail

public void beforeMarshal(Object source)

从 source 编组到 XML 之前调用的回调方法。

只在编组进程开始编组 source 之前才调用此方法。注意，如果 source 的类定义了自己的 beforeMarshal 方法，则只在调用此方法之前调用特定于类的回调方法。

source 编组之前的 JAXB 映射类的实例。
英文文档：

beforeMarshal

public void beforeMarshal(Object source)

Callback method invoked before marshalling from source to XML.

This method is invoked just before marshalling process starts to marshal source. Note that if the class of source defines its own beforeMarshal method, the class specific callback method is invoked just before this method is invoked.

Parameters:
source - instance of JAXB mapped class prior to marshalling from it.

public void afterMarshal(Object source)

将 source 编组到 XML 之后调用的回调方法。

在编组 source 及其所有子代之前调用此方法。注意，如果 source 的类定义了自己的 afterMarshal 方法，则只在调用此方法之前调用特定于类的回调方法。

source 编组之后的 JAXB 映射类的实例。
英文文档：

afterMarshal

public void afterMarshal(Object source)

Callback method invoked after marshalling source to XML.

This method is invoked after source and all its descendants have been marshalled. Note that if the class of source defines its own afterMarshal method, the class specific callback method is invoked just before this method is invoked.

Parameters:
source - instance of JAXB mapped class after marshalling it.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotIdentifiableEvent (Java EE 5)

javax.xml.bind
Interface NotIdentifiableEvent

All Superinterfaces:
ValidationEvent
All Known Implementing Classes:
NotIdentifiableEventImpl
public interface NotIdentifiableEvent
extends ValidationEvent

Implements: ValidationEvent
Implemented by: NotIdentifiableEventImpl

此事件指示解析 ID/IDREF 时遇到一个问题。
version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler
英文文档：

This event indicates that a problem was encountered resolving an ID/IDREF.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
Validator, ValidationEventHandler

Field Summary
Fields inherited from interface javax.xml.bind.ValidationEvent
ERROR, FATAL_ERROR, WARNING
Method Summary
Methods inherited from interface javax.xml.bind.ValidationEvent
getLinkedException, getLocator, getMessage, getSeverity

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParseConversionEvent (Java EE 5)

javax.xml.bind
Interface ParseConversionEvent

All Superinterfaces:
ValidationEvent
All Known Implementing Classes:
ParseConversionEventImpl
public interface ParseConversionEvent
extends ValidationEvent

Implements: ValidationEvent
Implemented by: ParseConversionEventImpl

此事件指示将 XML 数据中的字符串转换为目标 Java 数据类型的值时遇到一个问题。
version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventHandler, javax.xml.bind.Unmarshaller
英文文档：

This event indicates that a problem was encountered while converting a string from the XML data into a value of the target Java data type.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
ValidationEvent, ValidationEventHandler, Unmarshaller

Field Summary
Fields inherited from interface javax.xml.bind.ValidationEvent
ERROR, FATAL_ERROR, WARNING
Method Summary
Methods inherited from interface javax.xml.bind.ValidationEvent
getLinkedException, getLocator, getMessage, getSeverity

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PrintConversionEvent (Java EE 5)

javax.xml.bind
Interface PrintConversionEvent

All Superinterfaces:
ValidationEvent
All Known Implementing Classes:
PrintConversionEventImpl
public interface PrintConversionEvent
extends ValidationEvent

Implements: ValidationEvent
Implemented by: PrintConversionEventImpl

此事件指示将 Java 内容树中的数据转换为其词汇表示形式时遇到一个问题。
version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventHandler, javax.xml.bind.Marshaller
英文文档：

This event indicates that a problem was encountered while converting data from the Java content tree into its lexical representation.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
ValidationEvent, ValidationEventHandler, Marshaller

Field Summary
Fields inherited from interface javax.xml.bind.ValidationEvent
ERROR, FATAL_ERROR, WARNING
Method Summary
Methods inherited from interface javax.xml.bind.ValidationEvent
getLinkedException, getLocator, getMessage, getSeverity

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Unmarshaller (Java EE 5)

javax.xml.bind
Interface Unmarshaller

All Known Implementing Classes:
AbstractUnmarshallerImpl
public interface Unmarshaller

Inner classes: Unmarshaller.Listener
Implemented by: AbstractUnmarshallerImpl

Unmarshaller 类管理将 XML 数据反序列化为新创建的 Java 内容树的过程，并可在解组时有选择地验证 XML 数据。它针对各种不同的输入种类提供各种重载的 unmarshal 方法。

从 File 解组：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();
Object o = u.unmarshal( new File( "nosferatu.xml" ) );

从 InputStream 解组：

InputStream is = new FileInputStream( "nosferatu.xml" );
JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();
Object o = u.unmarshal( is );

从 URL 解组：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();
URL url = new URL( "http://beaker.east/nosferatu.xml" );
Object o = u.unmarshal( url );

使用 javax.xml.transform.stream.StreamSource 从 StringBuffer 解组：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();
StringBuffer xmlStr = new StringBuffer( "<?xml version="1.0"?>..." );
Object o = u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) );

从 org.w3c.dom.Node 解组：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new File( "nosferatu.xml"));

Object o = u.unmarshal( doc );

使用客户端指定的验证 SAX2.0 解析器从 javax.xml.transform.sax.SAXSource 解组：

// configure a validating SAX2.0 parser (Xerces2)
static final String JAXP_SCHEMA_LANGUAGE =
"http://java.sun.com/xml/jaxp/properties/schemaLanguage";
static final String JAXP_SCHEMA_LOCATION =
"http://java.sun.com/xml/jaxp/properties/schemaSource";
static final String W3C_XML_SCHEMA =
"http://www.w3.org/2001/XMLSchema";

System.setProperty( "javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl" );

SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware( true );
spf.setValidating(true);
SAXParser saxParser = spf.newSAXParser();

try {
saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
saxParser.setProperty(JAXP_SCHEMA_LOCATION, "http://....");
} catch (SAXNotRecognizedException x) {
// exception handling omitted
       }

XMLReader xmlReader = saxParser.getXMLReader();
SAXSource source =
new SAXSource( xmlReader, new InputSource( "http://..." ) );

// Setup JAXB to unmarshal
JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();
ValidationEventCollector vec = new ValidationEventCollector();
u.setEventHandler( vec );

// turn off the JAXB provider's default validation mechanism to
// avoid duplicate validation
u.setValidating( false )

// unmarshal
Object o = u.unmarshal( source );

// check for events
if( vec.hasEvents() ) {
// iterate over events
       }

从 StAX XMLStreamReader 解组：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();

javax.xml.stream.XMLStreamReader xmlStreamReader =
javax.xml.stream.XMLInputFactory().newInstance().createXMLStreamReader( ... );

Object o = u.unmarshal( xmlStreamReader );

从 StAX XMLEventReader 解组：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();

javax.xml.stream.XMLEventReader xmlEventReader =
javax.xml.stream.XMLInputFactory().newInstance().createXMLEventReader( ... );

Object o = u.unmarshal( xmlEventReader );

解组 XML 数据

解组可以反序列化表示整个 XML 文档或 XML 文档子树的 XML 数据。通常，使用解组全局声明的根元素所描述的 unmarshal 方法便已足够。通过利用全局元素声明和类型定义到 JAXB 映射类的 JAXBContext 映射，这些 unmarshal 方法可以启动对 XML 数据的根元素的解组。当 JAXBContext 映射不足以解组 XML 数据的根元素时，应用程序可以使用通过声明的类型进行解组的方法帮助解组过程。在 XML 数据的根元素对应于模式中的本地元素声明的情况下，这些方法对于解组很有用。
unmarshal 方法从不返回 null。如果解组过程无法将 XML 内容的根解组到 JAXB 映射对象，则将报告一个致命错误，通过抛出 JAXBException 终止处理过程。

解组全局声明的根元素

不带 declaredType 参数的 unmarshal 方法使用 JAXBContext 来解组 XML 数据的根元素。JAXBContext 实例是用来创建此 Unmarshaller 的实例。JAXBContext 实例维护全局声明的 XML 元素和类型定义名称到 JAXB 映射类的映射。该 unmarshal 方法检查 JAXBContext 是否存在根元素的 XML 名称和/或 @xsi:type 到 JAXB 映射类的映射。如果存在这种映射，则使用适当的 JAXB 映射类来解组 XML 数据。注意，当根元素名称未知且根元素具有 @xsi:type 时，将使用该 JAXB 映射类作为 JAXBElement 值来解组 XML 数据。当 JAXBContext 对象没有根元素名称的映射，也没有其 @xsi:type（如果存在）的映射时，那么将通过抛出 UnmarshalException 立即中止解组操作。通过使用下一节描述的通过声明的类型进行解组的方法，可以解决这种异常现象。

通过声明的类型进行解组

带 declaredType 参数的 unmarshal 方法使应用程序即使在根元素 XML 名称的 JAXBContext 中不存在映射时，也能够反序列化 XML 数据的根元素。该 unmarshaller 使用指定为 declaredType 参数的、应用程序提供的映射来解组根元素。注意，即使根元素的元素名称是通过 JAXBContext 映射的，declaredType 参数也会重写该映射，以便在使用这些 unmarshal 方法时反序列化根元素。此外，当 XML 数据的根元素具有 xsi:type 属性，且该属性的值引用一个通过 JAXBContext 映射到 JAXB 映射类的类型定义时，根元素的 xsi:type 属性将优先于 unmarshal 方法的 declaredType 参数。这些方法总是返回一个 JAXBElement<declaredType> 实例。下表显示了如何设置返回的 JAXBElement 实例的属性。

通过声明的类型进行解组所返回的 JAXBElement
JAXBElement 属性 | 值
name | xml 元素名称
value | instanceof declaredType
declaredType | unmarshal 方法的 declaredType 参数
范围 | null （实际范围未知）

以下是通过声明的类型进行解组的方法的一个示例。

通过 declaredType 从 org.w3c.dom.Node 解组：

Schema fragment for example
<xs:schema>
<xs:complexType name="FooType">...<\xs:complexType>
<!-- global element declaration "PurchaseOrder" -->
<xs:element name="PurchaseOrder">
<xs:complexType>
<xs:sequence>
<!-- local element declaration "foo" -->
<xs:element name="foo" type="FooType"/>
                    ...
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
Unmarshaller u = jc.createUnmarshaller();

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new File( "nosferatu.xml"));
Element  fooSubtree = ...; // traverse DOM till reach xml element foo, constrained by a
// local element declaration in schema.

// FooType is the JAXB mapping of the type of local element declaration foo.
JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);

支持兼容 SAX2.0 的解析器

客户端应用程序能够选择自己的兼容 SAX2.0 的解析器。如果没有选择 SAX 解析器，则将使用 JAXB 提供者的默认解析器。尽管 JAXB 提供者的默认解析器不必是与 SAX2.0 兼容的，但所有提供者必须允许客户端应用程序指定它们自己的 SAX2.0 解析器。一些提供者可能要求客户端应用程序在模式编译时指定 SAX2.0 解析器。有关详细信息，请参见 unmarshal(Source)。

验证和格式良好性

客户端应用程序可以通过 setSchema(javax.xml.validation.Schema) API 来启用或禁用 JAXP 1.3 验证机制。复杂的客户端可以指定它们自己的兼容 SAX 2.0 的解析器，并使用 unmarshal(Source) API 来绕开 JAXP 1.3 验证机制。

由于要解组的无效 XML 内容是在 JAXB 2.0 中定义的，这使 Unmarshaller 默认的验证事件处理程序比在 JAXB 1.0 中更为宽松。当向 JAXBContext 注册由 JAXB 1.0 绑定解析器所生成的模式派生代码时，默认的解组验证处理程序是 javax.xml.bind.helpers.DefaultValidationEventHandler，它将在遇到致命错误（或错误）之后终止编组操作。对于 JAXB 2.0 客户端应用程序，不存在显式定义的默认验证处理程序，默认事件处理只在遇到致命错误时终止编组操作。

支持的属性

当前没有任何需要 Unmarshaller 上的所有 JAXB 提供者都支持的属性。但是，一些提供者可能支持它们自己的特定于提供者的属性集。

解组事件回调

Unmarshaller 提供了两种风格的回调机制，这些机制允许在解组过程的关键点上进行特定于应用程序的处理。在“类定义的”事件回调中，解组期间会触发放置在 JAXB 映射类中的特定于应用程序的代码。“外部侦听器”允许用一个回调方法集中处理解组事件，而不是通过各种类型事件回调处理。

“类定义”的事件回调方法允许任何 JAXB 映射类通过定义带有以下方法签名的方法指定自己的特定回调方法：

// This method is called immediately after the object is created and before the unmarshalling of this
// object begins.The callback provides an opportunity to initialize JavaBean properties prior to unmarshalling.
void beforeUnmarshal(Unmarshaller, Object parent);

//This method is called after all the properties (except IDREF) are unmarshalled for this object,
//but before this object is set to the parent object.
void afterUnmarshal(Unmarshaller, Object parent);
类定义的回调方法应该在回调方法需要访问类的非公共方法和/或字段时使用。

外部侦听器回调机制允许 Listener 实例使用 setListener(Listener) 注册。外部侦听器接收所有回调事件，从而允许用比逐个类地定义回调方法更集中的方式处理事件。外部侦听器在解组过程将编组到 JAXB 元素或 JAXB 映射类时接收事件。

‘类定义的’侦听器事件回调方法和外部侦听器事件回调方法相互独立，但可以为一个事件同时调用两者。两种侦听器回调方法都存在时，按照 beforeUnmarshal(Object, Object) 和 afterUnmarshal(Object, Object) 中定义的顺序对它们进行调用。

抛出异常的事件回调方法会终止当前的解组过程。

version
en
$Revision: 1.32 $ $Date: 2005/08/18 15:18:26 $
since | JAXB1.0
See also | javax.xml.bind.JAXBContext, javax.xml.bind.Marshaller, javax.xml.bind.Validator
英文文档：

The Unmarshaller class governs the process of deserializing XML data into newly created Java content trees, optionally validating the XML data as it is unmarshalled. It provides an overloading of unmarshal methods for many different input kinds.

Unmarshalling from a File:

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();
       Object o = u.unmarshal( new File( "nosferatu.xml" ) );

Unmarshalling from an InputStream:

       InputStream is = new FileInputStream( "nosferatu.xml" );
       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();
       Object o = u.unmarshal( is );

Unmarshalling from a URL:

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();
       URL url = new URL( "http://beaker.east/nosferatu.xml" );
       Object o = u.unmarshal( url );

Unmarshalling from a StringBuffer using a javax.xml.transform.stream.StreamSource:

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();
       StringBuffer xmlStr = new StringBuffer( "<?xml version="1.0"?>..." );
       Object o = u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) );

Unmarshalling from a org.w3c.dom.Node:

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();

       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
       dbf.setNamespaceAware(true);
       DocumentBuilder db = dbf.newDocumentBuilder();
       Document doc = db.parse(new File( "nosferatu.xml"));

       Object o = u.unmarshal( doc );

Unmarshalling from a javax.xml.transform.sax.SAXSource using a client specified validating SAX2.0 parser:

       // configure a validating SAX2.0 parser (Xerces2)
       static final String JAXP_SCHEMA_LANGUAGE =
           "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
       static final String JAXP_SCHEMA_LOCATION =
           "http://java.sun.com/xml/jaxp/properties/schemaSource";
       static final String W3C_XML_SCHEMA =
           "http://www.w3.org/2001/XMLSchema";

       System.setProperty( "javax.xml.parsers.SAXParserFactory",
                           "org.apache.xerces.jaxp.SAXParserFactoryImpl" );

       SAXParserFactory spf = SAXParserFactory.newInstance();
       spf.setNamespaceAware(true);
       spf.setValidating(true);
       SAXParser saxParser = spf.newSAXParser();

       try {
           saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
           saxParser.setProperty(JAXP_SCHEMA_LOCATION, "http://....");
       } catch (SAXNotRecognizedException x) {
           // exception handling omitted
       }

       XMLReader xmlReader = saxParser.getXMLReader();
       SAXSource source =
           new SAXSource( xmlReader, new InputSource( "http://..." ) );

       // Setup JAXB to unmarshal
       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();
       ValidationEventCollector vec = new ValidationEventCollector();
       u.setEventHandler( vec );

       // turn off the JAXB provider's default validation mechanism to
       // avoid duplicate validation
       u.setValidating( false )

       // unmarshal
       Object o = u.unmarshal( source );

       // check for events
       if( vec.hasEvents() ) {
          // iterate over events
       }

Unmarshalling from a StAX XMLStreamReader:

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();

       javax.xml.stream.XMLStreamReader xmlStreamReader =
           javax.xml.stream.XMLInputFactory().newInstance().createXMLStreamReader( ... );

       Object o = u.unmarshal( xmlStreamReader );

Unmarshalling from a StAX XMLEventReader:

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();

       javax.xml.stream.XMLEventReader xmlEventReader =
           javax.xml.stream.XMLInputFactory().newInstance().createXMLEventReader( ... );

       Object o = u.unmarshal( xmlEventReader );

Unmarshalling XML Data

Unmarshalling can deserialize XML data that represents either an entire XML document or a subtree of an XML document. Typically, it is sufficient to use the unmarshalling methods described by Unmarshal root element that is declared globally. These unmarshal methods utilize JAXBContext's mapping of global XML element declarations and type definitions to JAXB mapped classes to initiate the unmarshalling of the root element of XML data. When the JAXBContext's mappings are not sufficient to unmarshal the root element of XML data, the application can assist the unmarshalling process by using the unmarshal by declaredType methods. These methods are useful for unmarshalling XML data where the root element corresponds to a local element declaration in the schema.
An unmarshal method never returns null. If the unmarshal process is unable to unmarshal the root of XML content to a JAXB mapped object, a fatal error is reported that terminates processing by throwing JAXBException.

Unmarshal a root element that is globally declared

The unmarshal methods that do not have an declaredType parameter use JAXBContext to unmarshal the root element of an XML data. The JAXBContext instance is the one that was used to create this Unmarshaller. The JAXBContext instance maintains a mapping of globally declared XML element and type definition names to JAXB mapped classes. The unmarshal method checks if JAXBContext has a mapping from the root element's XML name and/or @xsi:type to a JAXB mapped class. If it does, it umarshalls the XML data using the appropriate JAXB mapped class. Note that when the root element name is unknown and the root element has an @xsi:type, the XML data is unmarshalled using that JAXB mapped class as the value of a JAXBElement. When the JAXBContext object does not have a mapping for the root element's name nor its @xsi:type, if it exists, then the unmarshal operation will abort immediately by throwing a UnmarshalException. This exception scenario can be worked around by using the unmarshal by declaredType methods described in the next subsection.

Unmarshal by Declared Type

The unmarshal methods with a declaredType parameter enable an application to deserialize a root element of XML data, even when there is no mapping in JAXBContext of the root element's XML name. The unmarshaller unmarshals the root element using the application provided mapping specified as the declaredType parameter. Note that even when the root element's element name is mapped by JAXBContext, the declaredType parameter overrides that mapping for deserializing the root element when using these unmarshal methods. Additionally, when the root element of XML data has an xsi:type attribute and that attribute's value references a type definition that is mapped to a JAXB mapped class by JAXBContext, that the root element's xsi:type attribute takes precedence over the unmarshal methods declaredType parameter. These methods always return a JAXBElement<declaredType> instance. The table below shows how the properties of the returned JAXBElement instance are set.

Unmarshal By Declared Type returned JAXBElement
JAXBElement Property | Value
name | xml element name
value | instanceof declaredType
declaredType | unmarshal method declaredType parameter
scope | null (actual scope is unknown)

The following is an example of unmarshal by declaredType method.

Unmarshal by declaredType from a org.w3c.dom.Node:

       Schema fragment for example
       <xs:schema>
          <xs:complexType name="FooType">...<\xs:complexType>
          <!-- global element declaration "PurchaseOrder" -->
          <xs:element name="PurchaseOrder">
              <xs:complexType>
                 <xs:sequence>
                    <!-- local element declaration "foo" -->
                    <xs:element name="foo" type="FooType"/>
                    ...
                 </xs:sequence>
              </xs:complexType>
          </xs:element>
       </xs:schema>

       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
       Unmarshaller u = jc.createUnmarshaller();

       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
       dbf.setNamespaceAware(true);
       DocumentBuilder db = dbf.newDocumentBuilder();
       Document doc = db.parse(new File( "nosferatu.xml"));
       Element  fooSubtree = ...; // traverse DOM till reach xml element foo, constrained by a
                                  // local element declaration in schema.

       // FooType is the JAXB mapping of the type of local element declaration foo.
       JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);

Support for SAX2.0 Compliant Parsers

A client application has the ability to select the SAX2.0 compliant parser of their choice. If a SAX parser is not selected, then the JAXB Provider's default parser will be used. Even though the JAXB Provider's default parser is not required to be SAX2.0 compliant, all providers are required to allow a client application to specify their own SAX2.0 parser. Some providers may require the client application to specify the SAX2.0 parser at schema compile time. See unmarshal(Source) for more detail.

Validation and Well-Formedness

A client application can enable or disable JAXP 1.3 validation mechanism via the setSchema(javax.xml.validation.Schema) API. Sophisticated clients can specify their own validating SAX 2.0 compliant parser and bypass the JAXP 1.3 validation mechanism using the unmarshal(Source) API.

Since unmarshalling invalid XML content is defined in JAXB 2.0, the Unmarshaller default validation event handler was made more lenient than in JAXB 1.0. When schema-derived code generated by JAXB 1.0 binding compiler is registered with JAXBContext, the default unmarshal validation handler is DefaultValidationEventHandler and it terminates the marshal operation after encountering either a fatal error or an error. For a JAXB 2.0 client application, there is no explicitly defined default validation handler and the default event handling only terminates the marshal operation after encountering a fatal error.

Supported Properties

There currently are not any properties required to be supported by all JAXB Providers on Unmarshaller. However, some providers may support their own set of provider specific properties.

Unmarshal Event Callbacks

The Unmarshaller provides two styles of callback mechanisms that allow application specific processing during key points in the unmarshalling process. In 'class defined' event callbacks, application specific code placed in JAXB mapped classes is triggered during unmarshalling. 'External listeners' allow for centralized processing of unmarshal events in one callback method rather than by type event callbacks.

'Class defined' event callback methods allow any JAXB mapped class to specify its own specific callback methods by defining methods with the following method signature:

   // This method is called immediately after the object is created and before the unmarshalling of this
   // object begins. The callback provides an opportunity to initialize JavaBean properties prior to unmarshalling.
   void beforeUnmarshal(Unmarshaller, Object parent);

   //This method is called after all the properties (except IDREF) are unmarshalled for this object,
   //but before this object is set to the parent object.
   void afterUnmarshal(Unmarshaller, Object parent);
The class defined callback methods should be used when the callback method requires access to non-public methods and/or fields of the class.

The external listener callback mechanism enables the registration of a Unmarshaller.Listener instance with an setListener(Listener). The external listener receives all callback events, allowing for more centralized processing than per class defined callback methods. The external listener receives events when unmarshalling proces is marshalling to a JAXB element or to JAXB mapped class.

The 'class defined' and external listener event callback methods are independent of each other, both can be called for one event. The invocation ordering when both listener callback methods exist is defined in Unmarshaller.Listener.beforeUnmarshal(Object, Object) and Unmarshaller.Listener.afterUnmarshal(Object, Object).

An event callback method throwing an exception terminates the current unmarshal process.

Since:
JAXB1.0
Version:
$Revision: 1.32 $ $Date: 2005/08/18 15:18:26 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
JAXBContext, Marshaller, Validator

Nested Class Summary
static class Unmarshaller.Listener

Register an instance of an implementation of this class with Unmarshaller to externally listen for unmarshal events.

Method Summary
<A extends XmlAdapter>
A
getAdapter(Class<A> type)
Gets the adapter associated with the specified type.
 AttachmentUnmarshaller getAttachmentUnmarshaller()
 ValidationEventHandler getEventHandler()
Return the current event handler or the default event handler if one hasn't been set.
 Unmarshaller.Listener getListener()
Return Unmarshaller.Listener registered with this Unmarshaller.
 Object getProperty(String name)
Get the particular property in the underlying implementation of Unmarshaller.
 Schema getSchema()
Get the JAXP 1.3 Schema object being used to perform unmarshal-time validation.
 UnmarshallerHandler getUnmarshallerHandler()
Get an unmarshaller handler object that can be used as a component in an XML pipeline.
 boolean isValidating()
Deprecated. since JAXB2.0, please see getSchema()
<A extends XmlAdapter>
void
setAdapter(Class<A> type, A adapter)
Associates a configured instance of XmlAdapter with this unmarshaller.
 void setAdapter(XmlAdapter adapter)
Associates a configured instance of XmlAdapter with this unmarshaller.
 void setAttachmentUnmarshaller(AttachmentUnmarshaller au)
Associate a context that resolves cid's, content-id URIs, to binary data passed as attachments.
 void setEventHandler(ValidationEventHandler handler)
Allow an application to register a ValidationEventHandler.
 void setListener(Unmarshaller.Listener listener)
Register unmarshal event callback Unmarshaller.Listener with this Unmarshaller.
 void setProperty(String name, Object value)
Set the particular property in the underlying implementation of Unmarshaller.
 void setSchema(Schema schema)
Specify the JAXP 1.3 Schema object that should be used to validate subsequent unmarshal operations against.
 void setValidating(boolean validating)
Deprecated. since JAXB2.0, please see setSchema(javax.xml.validation.Schema)
 Object unmarshal(File f)
Unmarshal XML data from the specified file and return the resulting content tree.
 Object unmarshal(InputSource source)
Unmarshal XML data from the specified SAX InputSource and return the resulting content tree.
 Object unmarshal(InputStream is)
Unmarshal XML data from the specified InputStream and return the resulting content tree.
 Object unmarshal(Node node)
Unmarshal global XML data from the specified DOM tree and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(Node node, Class<T> declaredType)
Unmarshal XML data by JAXB mapped declaredType and return the resulting content tree.
 Object unmarshal(Reader reader)
Unmarshal XML data from the specified Reader and return the resulting content tree.
 Object unmarshal(Source source)
Unmarshal XML data from the specified XML Source and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(Source source, Class<T> declaredType)
Unmarshal XML data from the specified XML Source by declaredType and return the resulting content tree.
 Object unmarshal(URL url)
Unmarshal XML data from the specified URL and return the resulting content tree.
 Object unmarshal(XMLEventReader reader)
Unmarshal XML data from the specified pull parser and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(XMLEventReader reader, Class<T> declaredType)
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.
 Object unmarshal(XMLStreamReader reader)
Unmarshal XML data from the specified pull parser and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(XMLStreamReader reader, Class<T> declaredType)
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.

Method Detail

public Object unmarshal(java.io.File f) throws JAXBException
从指定的文件解组 XML 数据并返回得到的内容树。

实现解组全局根元素。

f | 将从中解组 XML 数据的文件
return | 新创建的 java 内容树的根对象
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 File 参数为 null
英文文档：

unmarshal

Object unmarshal(File f)
                 throws JAXBException
Unmarshal XML data from the specified file and return the resulting content tree.

Implements Unmarshal Global Root Element.

Parameters:
f - the file to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the file parameter is null

public Object unmarshal(java.io.InputStream is) throws JAXBException
从指定的 InputStream 解组 XML 数据并返回得到的内容树。使用这种形式的 unmarshal API 时，验证事件位置信息可能不完整。

实现解组全局根元素。

is | 将从中解组 XML 数据的 InputStream
return | 新创建的 java 内容树的根对象
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 InputStream 参数为 null
英文文档：

unmarshal

Object unmarshal(InputStream is)
                 throws JAXBException
Unmarshal XML data from the specified InputStream and return the resulting content tree. Validation event location information may be incomplete when using this form of the unmarshal API.

Implements Unmarshal Global Root Element.

Parameters:
is - the InputStream to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the InputStream parameter is null

public Object unmarshal(java.io.Reader reader) throws JAXBException
从指定的 Reader 解组 XML 数据并返回得到的内容树。使用这种形式的 unmarshal API 时，验证事件位置信息可能不完整，这是因为 Reader 不提供系统 ID。

实现解组全局根元素。

reader | 将从中解组 XML 数据的 Reader
return | 新创建的 java 内容树的根对象
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或者 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 InputStream 参数为 null
since | JAXB2.0
英文文档：

unmarshal

Object unmarshal(Reader reader)
                 throws JAXBException
Unmarshal XML data from the specified Reader and return the resulting content tree. Validation event location information may be incomplete when using this form of the unmarshal API, because a Reader does not provide the system ID.

Implements Unmarshal Global Root Element.

Parameters:
reader - the Reader to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the InputStream parameter is null
Since:
JAXB2.0

public Object unmarshal(java.net.URL url) throws JAXBException
从指定的 URL 解组 XML 数据并返回得到的内容树。

实现解组全局根元素。

url | 将从中解组 XML 数据的 URL
return | 新创建的 java 内容树的根对象
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 URL 参数为 null
英文文档：

unmarshal

Object unmarshal(URL url)
                 throws JAXBException
Unmarshal XML data from the specified URL and return the resulting content tree.

Implements Unmarshal Global Root Element.

Parameters:
url - the url to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the URL parameter is null

public Object unmarshal(org.xml.sax.InputSource source) throws JAXBException
从指定的 SAX InputSource 解组 XML 数据并返回得到的内容树。

实现解组全局根元素。

source | 将从中解组 XML 数据的输入源
return | 新创建的 java 内容树的根对象
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 InputSource 参数为 null
英文文档：

unmarshal

Object unmarshal(InputSource source)
                 throws JAXBException
Unmarshal XML data from the specified SAX InputSource and return the resulting content tree.

Implements Unmarshal Global Root Element.

Parameters:
source - the input source to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the InputSource parameter is null

public Object unmarshal(org.w3c.dom.Node node) throws JAXBException
从指定的 DOM 树解组全局 XML 数据并返回得到的内容树。

实现解组全局根元素。

node | 要从中解组 XML 数据的文档/元素。调用者至少必须支持 Document 和 Element。
return | 新创建的 java 内容树的根对象
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 Node 参数为 nul
See also | unmarshal(org.w3c.dom.Node, Class)
英文文档：

unmarshal

Object unmarshal(Node node)
                 throws JAXBException
Unmarshal global XML data from the specified DOM tree and return the resulting content tree.

Implements Unmarshal Global Root Element.

Parameters:
node - the document/element to unmarshal XML data from. The caller must support at least Document and Element.
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the Node parameter is null
See Also:
unmarshal(org.w3c.dom.Node, Class)

英文文档：

unmarshal

<T> JAXBElement<T> unmarshal(Node node,
                             Class<T> declaredType)
                         throws JAXBException
Unmarshal XML data by JAXB mapped declaredType and return the resulting content tree.

Implements Unmarshal by Declared Type

Parameters:
node - the document/element to unmarshal XML data from. The caller must support at least Document and Element.
declaredType - appropriate JAXB mapped class to hold node's XML data.
Returns:
JAXB Element representation of node
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If any parameter is null
Since:
JAXB2.0

public Object unmarshal(javax.xml.transform.Source source) throws JAXBException
从指定的 XML Source 解组 XML 数据并返回得到的内容树。

实现解组全局根元素。

SAX 2.0 解析器的可插入性

客户端应用程序可以选择不使用随 JAXB 提供者一起提供的默认解析器机制。任何兼容 SAX 2.0 的解析器都可以取代 JAXB 提供者的默认机制。要实现这一点，客户端应用程序必须正确配置一个包含 XMLReader 的 SAXSource，并且该 XMLReader 是由 SAX 2.0 解析器提供者实现的。如果 XMLReader 有一个向它注册的 org.xml.sax.ErrorHandler，则将使用 JAXB 提供者替换它，以便通过 JAXB 的 ValidationEventHandler 机制报告验证错误。如果 SAXSource 不包含 XMLReader，则将使用 JAXB 提供者的默认解析器机制。

也可以使用此解析器替换机制来替换 JAXB 提供者的解组时验证引擎。客户端应用程序必须正确配置其兼容 SAX 2.0 的解析器来执行验证（如上例所示）。解析器在解组操作期间遇到的任何 SAXParserExceptions 都将由 JAXB 提供者处理，并将其转换为 JAXB ValidationEvent 对象，这些对象将通过已经向 Unmarshaller 注册的 ValidationEventHandler 报告给客户端。注： 在为了实现解组而指定一个替换验证 SAX 2.0 解析器时，无需替换 JAXB 提供者使用的验证引擎来执行按需应变的验证。

客户端应用程序指定将在解组期间使用的替换解析器机制的唯一方法是通过 unmarshal(SAXSource) API。所有其他形式的 unmarshal 方法（文件、URL、Node 等等）将使用 JAXB 提供者的默认解析器和验证器机制。

source | 将从中解组 XML 数据的 XML Source（提供者只需支持 SAXSource、DOMSource 和 StreamSource）
return | 新创建的 java 内容树的根对象
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 Source 参数为 nul
See also | unmarshal(javax.xml.transform.Source, Class)
英文文档：

unmarshal

Object unmarshal(Source source)
                 throws JAXBException
Unmarshal XML data from the specified XML Source and return the resulting content tree.

Implements Unmarshal Global Root Element.

SAX 2.0 Parser Pluggability

A client application can choose not to use the default parser mechanism supplied with their JAXB provider. Any SAX 2.0 compliant parser can be substituted for the JAXB provider's default mechanism. To do so, the client application must properly configure a SAXSource containing an XMLReader implemented by the SAX 2.0 parser provider. If the XMLReader has an org.xml.sax.ErrorHandler registered on it, it will be replaced by the JAXB Provider so that validation errors can be reported via the ValidationEventHandler mechanism of JAXB. If the SAXSource does not contain an XMLReader, then the JAXB provider's default parser mechanism will be used.

This parser replacement mechanism can also be used to replace the JAXB provider's unmarshal-time validation engine. The client application must properly configure their SAX 2.0 compliant parser to perform validation (as shown in the example above). Any SAXParserExceptions encountered by the parser during the unmarshal operation will be processed by the JAXB provider and converted into JAXB ValidationEvent objects which will be reported back to the client via the ValidationEventHandler registered with the Unmarshaller. Note: specifying a substitute validating SAX 2.0 parser for unmarshalling does not necessarily replace the validation engine used by the JAXB provider for performing on-demand validation.

The only way for a client application to specify an alternate parser mechanism to be used during unmarshal is via the unmarshal(SAXSource) API. All other forms of the unmarshal method (File, URL, Node, etc) will use the JAXB provider's default parser and validator mechanisms.

Parameters:
source - the XML Source to unmarshal XML data from (providers are only required to support SAXSource, DOMSource, and StreamSource)
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the Source parameter is null
See Also:
unmarshal(javax.xml.transform.Source, Class)

英文文档：

unmarshal

<T> JAXBElement<T> unmarshal(Source source,
                             Class<T> declaredType)
                         throws JAXBException
Unmarshal XML data from the specified XML Source by declaredType and return the resulting content tree.

Implements Unmarshal by Declared Type

See SAX 2.0 Parser Pluggability

Parameters:
source - the XML Source to unmarshal XML data from (providers are only required to support SAXSource, DOMSource, and StreamSource)
declaredType - appropriate JAXB mapped class to hold source's xml root element
Returns:
Java content rooted by JAXB Element
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If any parameter is null
Since:
JAXB2.0

public Object unmarshal(XMLStreamReader reader) throws JAXBException
从指定的 pull 解析器解组 XML 数据并返回得到的内容树。

实现解组全局根元素。

此方法假定该解析器处于 START_DOCUMENT 或 START_ELEMENT 事件上。解组将从起始事件开始，到相应的终止事件结束。如果此方法成功返回，则 reader 将指向终止事件后面的标记。

reader | 要读取的解析器。
return | 新创建的 java 内容树的根对象。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 reader 参数为 null
Throws | IllegalStateException: 如果 reader 没有指向 START_DOCUMENT 或 START_ELEMENT 事件。
since | JAXB2.0
See also | unmarshal(javax.xml.stream.XMLStreamReader, Class)
英文文档：

unmarshal

Object unmarshal(XMLStreamReader reader)
                 throws JAXBException
Unmarshal XML data from the specified pull parser and return the resulting content tree.

Implements Unmarshal Global Root Element.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Parameters:
reader - The parser to be read.
Returns:
the newly created root object of the java content tree.
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the reader parameter is null
IllegalStateException - If reader is not pointing to a START_DOCUMENT or START_ELEMENT event.
Since:
JAXB2.0
See Also:
unmarshal(javax.xml.stream.XMLStreamReader, Class)

英文文档：

unmarshal

<T> JAXBElement<T> unmarshal(XMLStreamReader reader,
                             Class<T> declaredType)
                         throws JAXBException
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.

This method implements unmarshal by declaredType.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Parameters:
reader - The parser to be read.
declaredType - appropriate JAXB mapped class to hold reader's START_ELEMENT XML data.
Returns:
content tree rooted by JAXB Element representation
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If any parameter is null
Since:
JAXB2.0

public Object unmarshal(XMLEventReader reader) throws JAXBException
从指定的 pull 解析器解组 XML 数据并返回得到的内容树。

此方法是一个解组全局根方法。

此方法假定该解析器处于 START_DOCUMENT 或 START_ELEMENT 事件上。解组将从起始事件开始，到相应的终止事件结束。如果此方法成功返回，则 reader 将指向终止事件后面的标记。

reader | 要读取的解析器。
return | 新创建的 java 内容树的根对象。
Throws | JAXBException: 如果进行解组期间发生不可预料的错误
Throws | UnmarshalException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或着 Unmarshaller 不能执行 XML 到 Java 的绑定。请参阅解组 XML 数据
Throws | IllegalArgumentException: 如果 reader 参数为 null
Throws | IllegalStateException: 如果 reader 没有指向 START_DOCUMENT 或 START_ELEMENT 事件。
since | JAXB2.0
See also | unmarshal(javax.xml.stream.XMLEventReader, Class)
英文文档：

unmarshal

Object unmarshal(XMLEventReader reader)
                 throws JAXBException
Unmarshal XML data from the specified pull parser and return the resulting content tree.

This method is an Unmarshal Global Root method.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Parameters:
reader - The parser to be read.
Returns:
the newly created root object of the java content tree.
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If the reader parameter is null
IllegalStateException - If reader is not pointing to a START_DOCUMENT or START_ELEMENT event.
Since:
JAXB2.0
See Also:
unmarshal(javax.xml.stream.XMLEventReader, Class)

英文文档：

unmarshal

<T> JAXBElement<T> unmarshal(XMLEventReader reader,
                             Class<T> declaredType)
                         throws JAXBException
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.

This method implements unmarshal by declaredType.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Parameters:
reader - The parser to be read.
declaredType - appropriate JAXB mapped class to hold reader's START_ELEMENT XML data.
Returns:
content tree rooted by JAXB Element representation
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
IllegalArgumentException - If any parameter is null
Since:
JAXB2.0

public UnmarshallerHandler getUnmarshallerHandler()
获取可用作 XML 管线中的组件的 unmarshaller 处理程序对象。

JAXB 提供者可以为此方法的多次调用返回相同的处理程序对象。换句话说，此方法不必创建新的 UnmarshallerHandler 实例。如果应用程序需要使用多个 UnmarshallerHandler，那么它应该创建多个 Unmarshaller。

return | 返回 unmarshaller 处理程序对象
See also | javax.xml.bind.UnmarshallerHandler
英文文档：

getUnmarshallerHandler

UnmarshallerHandler getUnmarshallerHandler()
Get an unmarshaller handler object that can be used as a component in an XML pipeline.

The JAXB Provider can return the same handler object for multiple invocations of this method. In other words, this method does not necessarily create a new instance of UnmarshallerHandler. If the application needs to use more than one UnmarshallerHandler, it should create more than one Unmarshaller.

Returns:
the unmarshaller handler object
See Also:
UnmarshallerHandler

public void setValidating(boolean validating) throws JAXBException
指定 Unmarshaller 的默认验证机制是否应在解组操作期间执行验证。默认情况下，Unmarshaller 不执行验证。

此方法只能在调用某一 unmarshal 方法之前或之后调用。

此方法只控制 JAXB 提供者的默认解组时验证机制，不会影响指定自己的验证兼容 SAX 2.0 的解析器的客户端。指定自己的解组时验证机制的客户端可能希望通过此 API 关闭 JAXB 提供者的默认验证机制，以避免“双重验证”。

此方法从 JAXB 2.0 开始已经废弃，请使用新的 #setSchema(javax.xml.validation.Schema) API。

validating | 如果 Unmarshaller 应该在解组期间执行验证，则该参数为 true；否则为 false
Throws | JAXBException: 如果在解组期间启用或禁用验证时发生错误
Throws | UnsupportedOperationException: 如果对根据引用 JAXB 2.0 映射类的 JAXBContext 而创建的 Unmarshaller 调用此方法，则抛出该异常
deprecated | 从 JAXB2.0 开始，请参阅 #setSchema(javax.xml.validation.Schema)
英文文档：

setValidating

void setValidating(boolean validating)
                   throws JAXBException
Deprecated. since JAXB2.0, please see setSchema(javax.xml.validation.Schema)

Specifies whether or not the default validation mechanism of the Unmarshaller should validate during unmarshal operations. By default, the Unmarshaller does not validate.

This method may only be invoked before or after calling one of the unmarshal methods.

This method only controls the JAXB Provider's default unmarshal-time validation mechanism - it has no impact on clients that specify their own validating SAX 2.0 compliant parser. Clients that specify their own unmarshal-time validation mechanism may wish to turn off the JAXB Provider's default validation mechanism via this API to avoid "double validation".

This method is deprecated as of JAXB 2.0 - please use the new setSchema(javax.xml.validation.Schema) API.

Parameters:
validating - true if the Unmarshaller should validate during unmarshal, false otherwise
Throws:
JAXBException - if an error occurred while enabling or disabling validation at unmarshal time
UnsupportedOperationException - could be thrown if this method is invoked on an Unmarshaller created from a JAXBContext referencing JAXB 2.0 mapped classes

public boolean isValidating() throws JAXBException
指示是否将 Unmarshaller 配置为在解组操作期间执行验证。

此 API 返回 JAXB 提供者的默认解组时验证机制的状态。

此方法从 JAXB 2.0 开始已经废弃，请使用新的 #getSchema() API。

return | 如果将 Unmarshaller 配置为在解组操作期间执行验证，则返回 true；否则返回 false
Throws | JAXBException: 如果在检索验证标志时发生错误
Throws | UnsupportedOperationException: 如果对根据引用 JAXB 2.0 映射类的 JAXBContext 而创建的 Unmarshaller 调用此方法，则抛出该异常
deprecated | 从 JAXB 2.0 开始，请参阅 #getSchema()
英文文档：

isValidating

boolean isValidating()
                     throws JAXBException
Deprecated. since JAXB2.0, please see getSchema()

Indicates whether or not the Unmarshaller is configured to validate during unmarshal operations.

This API returns the state of the JAXB Provider's default unmarshal-time validation mechanism.

This method is deprecated as of JAXB 2.0 - please use the new getSchema() API.

Returns:
true if the Unmarshaller is configured to validate during unmarshal operations, false otherwise
Throws:
JAXBException - if an error occurs while retrieving the validating flag
UnsupportedOperationException - could be thrown if this method is invoked on an Unmarshaller created from a JAXBContext referencing JAXB 2.0 mapped classes

public void setEventHandler(ValidationEventHandler handler) throws JAXBException
允许应用程序注册 ValidationEventHandler。

如果在调用任何 unmarshal 方法期间遇到任何错误，则 ValidationEventHandler 将由 JAXB 提供者调用。如果客户端应用程序没有在调用 unmarshal 方法之前注册 ValidationEventHandler，则 ValidationEvents 将由默认事件处理程序处理，默认事件处理程序将在遇到第一个错误或致命错误时终止解组操作。

调用带有 null 参数的此方法将导致 Unmarshaller 重新使用默认事件处理程序。

handler | 验证事件处理程序
Throws | JAXBException: 如果在设置事件处理程序时发生错误
英文文档：

setEventHandler

void setEventHandler(ValidationEventHandler handler)
                     throws JAXBException
Allow an application to register a ValidationEventHandler.

The ValidationEventHandler will be called by the JAXB Provider if any validation errors are encountered during calls to any of the unmarshal methods. If the client application does not register a ValidationEventHandler before invoking the unmarshal methods, then ValidationEvents will be handled by the default event handler which will terminate the unmarshal operation after the first error or fatal error is encountered.

Calling this method with a null parameter will cause the Unmarshaller to revert back to the default event handler.

Parameters:
handler - the validation event handler
Throws:
JAXBException - if an error was encountered while setting the event handler

public ValidationEventHandler getEventHandler() throws JAXBException
当前的事件处理程序；如果没有设置，则返回默认事件处理程序。
return | 当前的 ValidationEventHandler；如果没有设置，则返回默认的事件处理程序
Throws | JAXBException: 如果获取当前的事件处理程序时遇到错误
英文文档：

getEventHandler

ValidationEventHandler getEventHandler()
                                       throws JAXBException
Return the current event handler or the default event handler if one hasn't been set.

Returns:
the current ValidationEventHandler or the default event handler if it hasn't been set
Throws:
JAXBException - if an error was encountered while getting the current event handler

public void setProperty(String name, Object value) throws PropertyException
设置 Unmarshaller 底层实现中的特定属性。此方法只能用于设置上文中标准 JAXB 定义的属性之一或特定于提供者的属性。试图设置未定义的属性将导致抛出 PropertyException。请参阅支持的属性。
name | 要设置的属性的名称。此值可以使用一个常量字段来指定，也可以是用户提供的字符串。
value | 要设置的属性值
Throws | PropertyException: 如果处理给定属性或值时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
英文文档：

setProperty

void setProperty(String name,
                 Object value)
                 throws PropertyException
Set the particular property in the underlying implementation of Unmarshaller. This method can only be used to set one of the standard JAXB defined properties above or a provider specific property. Attempting to set an undefined property will result in a PropertyException being thrown. See Supported Properties.

Parameters:
name - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.
value - the value of the property to be set
Throws:
PropertyException - when there is an error processing the given property or value
IllegalArgumentException - If the name parameter is null

public Object getProperty(String name) throws PropertyException
获取 Unmarshaller 底层实现中的特定属性。此方法只能用于获取上文中标准 JAXB 定义的属性之一或特定于提供者的属性。试图获取未定义的属性将导致抛出 PropertyException。请参阅支持的属性。
name | 将检索的属性名称
return | 所请求属性的值
Throws | PropertyException: 如果检索给定属性或值属性名称时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
英文文档：

getProperty

Object getProperty(String name)
                   throws PropertyException
Get the particular property in the underlying implementation of Unmarshaller. This method can only be used to get one of the standard JAXB defined properties above or a provider specific property. Attempting to get an undefined property will result in a PropertyException being thrown. See Supported Properties.

Parameters:
name - the name of the property to retrieve
Returns:
the value of the requested property
Throws:
PropertyException - when there is an error retrieving the given property or value property name
IllegalArgumentException - If the name parameter is null

public void setSchema(javax.xml.validation.Schema schema)
指定应用作验证后续解组操作依据的 JAXP 1.3 Schema 对象。向此方法传递 null 将禁用验证。

此方法将替换已过时的 setValidating(boolean) API。

最初，此属性被设置为 null。

schema | 作为验证解组操作依据的 Schema 对象；为 null 表示禁用验证
Throws | UnsupportedOperationException: 如果对根据引用 JAXB 1.0 映射类的 JAXBContext 而创建的 Unmarshaller 调用此方法，则抛出该异常
since | JAXB2.0
英文文档：

setSchema

void setSchema(Schema schema)
Specify the JAXP 1.3 Schema object that should be used to validate subsequent unmarshal operations against. Passing null into this method will disable validation.

This method replaces the deprecated setValidating(boolean) API.

Initially this property is set to null.

Parameters:
schema - Schema object to validate unmarshal operations against or null to disable validation
Throws:
UnsupportedOperationException - could be thrown if this method is invoked on an Unmarshaller created from a JAXBContext referencing JAXB 1.0 mapped classes
Since:
JAXB2.0

public javax.xml.validation.Schema getSchema()
获取用于执行解组时验证的 JAXP 1.3 Schema 对象。如果没有在 unmarshaller 上设置 Schema，则此方法将返回 null，指示不会执行解组时验证。

此方法用于替换已过时的 #isValidating() API，并可访问 Schema 对象。要确定 Unmarshaller 是否启用了验证，只需测试返回类型是否为 null：

boolean isValidating = u.getSchema()!=null;

return | 返回用于执行解组时验证的 Schema 对象；如果该对象不存在，则返回 null
Throws | UnsupportedOperationException: 如果对根据引用 JAXB 1.0 映射类的 JAXBContext 而创建的 Unmarshaller 调用此方法，则抛出该异常
since | JAXB2.0
英文文档：

getSchema

Schema getSchema()
Get the JAXP 1.3 Schema object being used to perform unmarshal-time validation. If there is no Schema set on the unmarshaller, then this method will return null indicating that unmarshal-time validation will not be performed.

This method provides replacement functionality for the deprecated isValidating() API as well as access to the Schema object. To determine if the Unmarshaller has validation enabled, simply test the return type for null:

boolean isValidating = u.getSchema()!=null;

Returns:
the Schema object being used to perform unmarshal-time validation or null if not present
Throws:
UnsupportedOperationException - could be thrown if this method is invoked on an Unmarshaller created from a JAXBContext referencing JAXB 1.0 mapped classes
Since:
JAXB2.0

public void setAdapter(XmlAdapter adapter)
将已配置的 XmlAdapter 实例与此 unmarshaller 关联。

这是调用 setAdapter(adapter.getClass(),adapter); 的一个便捷方法。

Throws | IllegalArgumentException: 如果 adapter 参数为 null。
Throws | UnsupportedOperationException: 如果基于 JAXB 1.0 实现调用。
since | JAXB2.0
See also | setAdapter(Class,XmlAdapter)
英文文档：

setAdapter

void setAdapter(XmlAdapter adapter)
Associates a configured instance of XmlAdapter with this unmarshaller.

This is a convenience method that invokes setAdapter(adapter.getClass(),adapter);.

Throws:
IllegalArgumentException - if the adapter parameter is null.
UnsupportedOperationException - if invoked agains a JAXB 1.0 implementation.
Since:
JAXB2.0
See Also:
setAdapter(Class,XmlAdapter)

英文文档：

setAdapter

<A extends XmlAdapter> void setAdapter(Class<A> type,
                                       A adapter)
Associates a configured instance of XmlAdapter with this unmarshaller.

Every unmarshaller internally maintains a Map<Class,XmlAdapter>, which it uses for unmarshalling classes whose fields/methods are annotated with XmlJavaTypeAdapter.

This method allows applications to use a configured instance of XmlAdapter. When an instance of an adapter is not given, an unmarshaller will create one by invoking its default constructor.

Parameters:
type - The type of the adapter. The specified instance will be used when XmlJavaTypeAdapter.value() refers to this type.
adapter - The instance of the adapter to be used. If null, it will un-register the current adapter set for this type.
Throws:
IllegalArgumentException - if the type parameter is null.
UnsupportedOperationException - if invoked agains a JAXB 1.0 implementation.
Since:
JAXB2.0

英文文档：

getAdapter

<A extends XmlAdapter> A getAdapter(Class<A> type)
Gets the adapter associated with the specified type. This is the reverse operation of the setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter) method.

Throws:
IllegalArgumentException - if the type parameter is null.
UnsupportedOperationException - if invoked agains a JAXB 1.0 implementation.
Since:
JAXB2.0

public void setAttachmentUnmarshaller(AttachmentUnmarshaller au)

将解析 cid（内容 id URI）的上下文与作为附件传递的二进制数据关联。

通过 #setSchema(Schema) 启用的解组时验证，即使在 unmarshaller 执行 XOP 处理时也必须支持。

Throws IllegalStateException: 如果试图在解组操作期间同时调用此方法。
英文文档：

setAttachmentUnmarshaller

void setAttachmentUnmarshaller(AttachmentUnmarshaller au)

Associate a context that resolves cid's, content-id URIs, to binary data passed as attachments.

Unmarshal time validation, enabled via setSchema(Schema), must be supported even when unmarshaller is performing XOP processing.

Throws:
IllegalStateException - if attempt to concurrently call this method during a unmarshal operation.

public AttachmentUnmarshaller getAttachmentUnmarshaller()
英文文档：

getAttachmentUnmarshaller

AttachmentUnmarshaller getAttachmentUnmarshaller()

public void setListener(Unmarshaller.Listener listener)

向此 Unmarshaller 注册解组事件回调 Listener。

每个 Unmarshaller 只有一个 Listener。设置 Listener 将替换以前设置的 Listener。通过将 listener 设置为 null 可注销当前的 Listener。

listener | 为此 Unmarshaller 提供解组事件回调
since | JAXB2.0
英文文档：

setListener

void setListener(Unmarshaller.Listener listener)

Register unmarshal event callback Unmarshaller.Listener with this Unmarshaller.

There is only one Listener per Unmarshaller. Setting a Listener replaces the previous set Listener. One can unregister current Listener by setting listener to null.

Parameters:
listener - provides unmarshal event callbacks for this Unmarshaller
Since:
JAXB2.0

public Unmarshaller.Listener getListener()

返回向此 Unmarshaller 注册的 Listener。

return | 注册的 Listener；如果未向此 Unmarshaller 注册任何 Listener，则返回 null。
since | JAXB2.0
英文文档：

getListener

Unmarshaller.Listener getListener()

Return Unmarshaller.Listener registered with this Unmarshaller.

Returns:
registered Unmarshaller.Listener or null if no Listener is registered with this Unmarshaller.
Since:
JAXB2.0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Unmarshaller.Listener (Java EE 5)

javax.xml.bind
Class Unmarshaller.Listener

java.lang.Object
    extended by  javax.xml.bind.Unmarshaller.Listener
Enclosing interface:
Unmarshaller
public abstract static class Unmarshaller.Listener
extends Object

Contained within: Unmarshaller

向 Unmarshaller 注册此类的一个实现的实例，以便外部侦听解组事件。

此类可以在将 XML 数据解组到 JAXB 映射类中时启用对 JAXB 映射类实例的预处理和后处理。在将 XML 内容解组到 JAXBElement 实例或表示复杂类型定义的 JAXB 映射类中时，将调用事件回调。解组到表示简单类型定义的 Java 数据类型的实例时，不需要调用事件回调。

外部侦听器是用于定义解组事件回调的两个不同机制之一。请参阅 Unmarshal Event Callbacks 获得对这方面的概括。

(@link #setListener(Listener)} (@link #getListener()}

since JAXB2.0
英文文档：

Register an instance of an implementation of this class with Unmarshaller to externally listen for unmarshal events.

This class enables pre and post processing of an instance of a JAXB mapped class as XML data is unmarshalled into it. The event callbacks are called when unmarshalling XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition. The event callbacks are not called when unmarshalling to an instance of a Java datatype that represents a simple type definition.

External listener is one of two different mechanisms for defining unmarshal event callbacks. See Unmarshal Event Callbacks for an overview.

(@link #setListener(Listener)} (@link #getListener()}

Since:
JAXB2.0

Constructor Summary
Unmarshaller.Listener()
Method Summary
void | afterUnmarshal(Object target, Object parent) Callback method invoked after unmarshalling XML data into target.
void | beforeUnmarshal(Object target, Object parent) Callback method invoked before unmarshalling into target.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Unmarshaller.Listener()
英文文档：

Unmarshaller.Listener

public Unmarshaller.Listener()
Method Detail

public void beforeUnmarshal(Object target, Object parent)

在解组到 target 之前调用的回调方法。

在创建 target 之后且在开始解组此对象之前立即调用此方法。注意，如果 target 的类定义了自己的 beforeUnmarshal 方法，则在调用此方法之前调用特定于类的回调方法。

target | 解组之前的 JAXB 映射类的非 null 实例。
parent | 将最终引用 target 的 JAXB 映射类的实例。当 target 是根元素时，该参数为 null。
英文文档：

beforeUnmarshal

public void beforeUnmarshal(Object target,
                            Object parent)

Callback method invoked before unmarshalling into target.

This method is invoked immediately after target was created and before the unmarshalling of this object begins. Note that if the class of target defines its own beforeUnmarshal method, the class specific callback method is invoked before this method is invoked.

Parameters:
target - non-null instance of JAXB mapped class prior to unmarshalling into it.
parent - instance of JAXB mapped class that will eventually reference target. null when target is root element.

public void afterUnmarshal(Object target, Object parent)

将 XML 数据解组到 target 之后调用的回调方法。

在将所有属性（IDREF 除外）解组到 target 之后、但在将 target 设置为其 parent 对象之前调用此方法。注意，如果 target 的类定义了自己的 afterUnmarshal 方法，则在调用此方法之前调用特定于类的回调方法。

target | 解组之前的 JAXB 映射类的非 null 实例。
parent | 将引用 target 的 JAXB 映射类的实例。当 target 是根元素时，该参数为 null。
英文文档：

afterUnmarshal

public void afterUnmarshal(Object target,
                           Object parent)

Callback method invoked after unmarshalling XML data into target.

This method is invoked after all the properties (except IDREF) are unmarshalled into target, but before target is set into its parent object. Note that if the class of target defines its own afterUnmarshal method, the class specific callback method is invoked before this method is invoked.

Parameters:
target - non-null instance of JAXB mapped class prior to unmarshalling into it.
parent - instance of JAXB mapped class that will reference target. null when target is root element.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnmarshallerHandler (Java EE 5)

javax.xml.bind
Interface UnmarshallerHandler

All Superinterfaces:
ContentHandler
public interface UnmarshallerHandler
extends ContentHandler

Implements: org.xml.sax.ContentHandler

作为 SAX ContentHandler 实现的 Unmarshaller。

应用程序可以使用此接口将其 JAXB 提供者用作 XML 管线中的一个组件。例如：

JAXBContext context = JAXBContext.newInstance( "org.acme.foo" );

Unmarshaller unmarshaller = context.createUnmarshaller();

UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();

SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware( true );

XMLReader xmlReader = spf.newSAXParser().getXMLReader();
xmlReader.setContentHandler( unmarshallerHandler );
xmlReader.parse(new InputSource( new FileInputStream( XML_FILE ) ) );

MyObject myObject= (MyObject)unmarshallerHandler.getResult();

此接口是可重用的：即使用户解组某一对象时失败，她/他仍可开始新一轮的解组。

version
en
$Revision: 1.2 $ $Date: 2006/03/08 16:55:17 $
since | JAXB1.0
See also | getUnmarshallerHandler()
英文文档：

Unmarshaller implemented as SAX ContentHandler.

Applications can use this interface to use their JAXB provider as a component in an XML pipeline. For example:

       JAXBContext context = JAXBContext.newInstance( "org.acme.foo" );

       Unmarshaller unmarshaller = context.createUnmarshaller();

       UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();

       SAXParserFactory spf = SAXParserFactory.newInstance();
       spf.setNamespaceAware( true );

       XMLReader xmlReader = spf.newSAXParser().getXMLReader();
       xmlReader.setContentHandler( unmarshallerHandler );
       xmlReader.parse(new InputSource( new FileInputStream( XML_FILE ) ) );

       MyObject myObject= (MyObject)unmarshallerHandler.getResult();

This interface is reusable: even if the user fails to unmarshal an object, s/he can still start a new round of unmarshalling.

Since:
JAXB1.0
Version:
$Revision: 1.2 $ $Date: 2006/03/08 16:55:17 $
Author:
  • Kohsuke KAWAGUCHI, Sun Microsystems, Inc.
See Also:
Unmarshaller.getUnmarshallerHandler()

Method Summary
 Object getResult()
Obtains the unmarshalled result.
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping

Method Detail

public Object getResult() throws JAXBException, IllegalStateException
获得解组的结果。此方法只能在此处理程序接收 endDocument SAX 事件之后调用。
Throws | IllegalStateException: 如果在此处理程序接收 endDocument 事件之前调用此方法。
Throws | JAXBException: 如果出现任何解组错误。注意，允许该实现在解析错误期间抛出 SAXException。
return | 总是返回被解组的非 null 有效对象。
英文文档：

getResult

Object getResult()
                 throws JAXBException,
                        IllegalStateException
Obtains the unmarshalled result. This method can be called only after this handler receives the endDocument SAX event.

Returns:
always return a non-null valid object which was unmarshalled.
Throws:
IllegalStateException - if this method is called before this handler receives the endDocument event.
JAXBException - if there is any unmarshalling error. Note that the implementation is allowed to throw SAXException during the parsing when it finds an error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationEvent (Java EE 5)

javax.xml.bind
Interface ValidationEvent

All Known Subinterfaces:
NotIdentifiableEvent, ParseConversionEvent, PrintConversionEvent
All Known Implementing Classes:
NotIdentifiableEventImpl, ParseConversionEventImpl, PrintConversionEventImpl, ValidationEventImpl
public interface ValidationEvent

Implemented by: NotIdentifiableEvent, ParseConversionEvent, PrintConversionEvent, ValidationEventImpl

此事件指示在执行解组操作期间验证传入的 XML 数据时、对 Java 内容树执行按需验证时或将 Java 内容树编组回 XML 数据时遇到问题。
version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler
英文文档：

This event indicates that a problem was encountered while validating the incoming XML data during an unmarshal operation, while performing on-demand validation of the Java content tree, or while marshalling the Java content tree back to XML data.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
Validator, ValidationEventHandler

Field Summary
static int | ERROR Conditions that correspond to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation
static int | FATAL_ERROR Conditions that correspond to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation
static int | WARNING Conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation
Method Summary
Throwable | getLinkedException() Retrieve the linked exception for this warning/error.
ValidationEventLocator | getLocator() Retrieve the locator for this warning/error.
String | getMessage() Retrieve the text message for this warning/error.
int | getSeverity() Retrieve the severity code for this warning/error.

Field Detail

英文文档：

WARNING

static final int WARNING
Conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation

See Also:
Constant Field Values

英文文档：

ERROR

static final int ERROR
Conditions that correspond to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation

See Also:
Constant Field Values

英文文档：

FATAL_ERROR

static final int FATAL_ERROR
Conditions that correspond to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation

See Also:
Constant Field Values
Method Detail

public int getSeverity()
检索此警告/错误的严重性代码。

必须是 ValidationError.WARNING、ValidationError.ERROR 或 ValidationError.FATAL_ERROR 之一。

return 此警告/错误的严重性代码
英文文档：

getSeverity

int getSeverity()
Retrieve the severity code for this warning/error.

Must be one of ValidationError.WARNING, ValidationError.ERROR, or ValidationError.FATAL_ERROR.

Returns:
the severity code for this warning/error

public String getMessage()
检索此警告/错误的文本消息。
return 此警告/错误的文本消息；如果没有设置此消息，则返回 null
英文文档：

getMessage

String getMessage()
Retrieve the text message for this warning/error.

Returns:
the text message for this warning/error or null if one wasn't set

public Throwable getLinkedException()
检索此警告/错误的链接异常。
return 此警告/错误的链接异常；如果未设置此异常，则返回 null
英文文档：

getLinkedException

Throwable getLinkedException()
Retrieve the linked exception for this warning/error.

Returns:
the linked exception for this warning/error or null if one wasn't set

public ValidationEventLocator getLocator()
检索此警告/错误的定位符。
return 指示发生此警告/错误的位置的定位符
英文文档：

getLocator

ValidationEventLocator getLocator()
Retrieve the locator for this warning/error.

Returns:
the locator that indicates where the warning/error occurred
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationEventHandler (Java EE 5)

javax.xml.bind
Interface ValidationEventHandler

All Known Implementing Classes:
DefaultValidationEventHandler, ValidationEventCollector
public interface ValidationEventHandler

Implemented by: DefaultValidationEventHandler, ValidationEventCollector

用来验证错误的基本事件处理程序接口。

如果应用程序需要实现自定义事件处理，那么它必须实现此接口，然后向 Unmarshaller、Validator 或 Marshaller 注册。JAXB 提供者随后将向这些事件处理程序报告在执行解组、编组和验证操作期间遇到的验证错误和警告。

如果 handleEvent 方法抛出未经检查的运行时异常，则 JAXB 提供者必须像该方法返回 false 那样作出相应对待，有效地终止当时正在运行的任何操作（解组、验证或编组）。

在事件处理程序中修改 Java 内容树不是规范中定义的行为，并且可能导致不可预料的行为。

遇到致命错误后未能从 handleEvent 方法返回 false 也不是一种规范中定义的行为，并且可能导致不可预料的行为。

默认事件处理程序

请参阅：Validator javadocs
version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.Unmarshaller, javax.xml.bind.Validator, javax.xml.bind.Marshaller, javax.xml.bind.ValidationEvent, javax.xml.bind.util.ValidationEventCollector
英文文档：

A basic event handler interface for validation errors.

If an application needs to implement customized event handling, it must implement this interface and then register it with either the Unmarshaller, the Validator, or the Marshaller. The JAXB Provider will then report validation errors and warnings encountered during the unmarshal, marshal, and validate operations to these event handlers.

If the handleEvent method throws an unchecked runtime exception, the JAXB Provider must treat that as if the method returned false, effectively terminating whatever operation was in progress at the time (unmarshal, validate, or marshal).

Modifying the Java content tree within your event handler is undefined by the specification and may result in unexpected behaviour.

Failing to return false from the handleEvent method after encountering a fatal error is undefined by the specification and may result in unexpected behavior.

Default Event Handler

See: Validator javadocs

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
Unmarshaller, Validator, Marshaller, ValidationEvent, ValidationEventCollector

Method Summary
 boolean handleEvent(ValidationEvent event)
Receive notification of a validation warning or error.

Method Detail

public boolean handleEvent(ValidationEvent event)
接收验证警告或错误的通知。ValidationEvent 将 ValidationEventLocator 嵌入通知中，以指示发生错误或警告的位置。

如果从此方法抛出未经检查的运行时异常，则 JAXB 提供者会像该方法返回 false 那样作出相应对待，并中断当前的解组、验证和编组操作。

event | 封装的验证事件信息。如果为 null，则该信息是一个提供者错误。
return | 如果 JAXB 提供者应该在处理此警告/错误之后尝试继续执行当前的解组、验证或编组操作，则返回 true；如果提供者应该使用适当的 UnmarshalException、ValidationException 或 MarshalException 终止当前操作，则返回 false。
Throws | IllegalArgumentException: 如果事件对象为 null。
英文文档：

handleEvent

boolean handleEvent(ValidationEvent event)
Receive notification of a validation warning or error. The ValidationEvent will have a ValidationEventLocator embedded in it that indicates where the error or warning occurred.

If an unchecked runtime exception is thrown from this method, the JAXB provider will treat it as if the method returned false and interrupt the current unmarshal, validate, or marshal operation.

Parameters:
event - the encapsulated validation event information. It is a provider error if this parameter is null.
Returns:
true if the JAXB Provider should attempt to continue the current unmarshal, validate, or marshal operation after handling this warning/error, false if the provider should terminate the current operation with the appropriate UnmarshalException, ValidationException, or MarshalException.
Throws:
IllegalArgumentException - if the event object is null.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationEventLocator (Java EE 5)

javax.xml.bind
Interface ValidationEventLocator

All Known Implementing Classes:
ValidationEventLocatorImpl
public interface ValidationEventLocator

Implemented by: ValidationEventLocatorImpl

封装 ValidationEvent 的位置。

该 ValidationEventLocator 指示发生 ValidationEvent 的位置。根据检测到错误或警告时将要执行的验证类型来设置不同的字段。例如，按需验证（on-demand validation）应生成包含对 Java 内容树中对象的引用的定位符，而解组时验证（unmarshal-time validation）应生成包含适用于 XML 数据源（文件、url、Node 等）的信息的定位符。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.Validator, javax.xml.bind.ValidationEvent
英文文档：

Encapsulate the location of a ValidationEvent.

The ValidationEventLocator indicates where the ValidationEvent occurred. Different fields will be set depending on the type of validation that was being performed when the error or warning was detected. For example, on-demand validation would produce locators that contained references to objects in the Java content tree while unmarshal-time validation would produce locators containing information appropriate to the source of the XML data (file, url, Node, etc).

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
Validator, ValidationEvent

Method Summary
int | getColumnNumber() Return the column number if available
int | getLineNumber() Return the line number if available
Node | getNode() Return a reference to the DOM Node if available
Object | getObject() Return a reference to the object in the Java content tree if available
int | getOffset() Return the byte offset if available
URL | getURL() Return the name of the XML source as a URL if available

Method Detail

public java.net.URL getURL()
返回 URL 形式的 XML 源名称（如果可用）。
return 返回 URL 形式的 XML 源名称；如果没有可用的名称，则返回 null
英文文档：

getURL

URL getURL()
Return the name of the XML source as a URL if available

Returns:
the name of the XML source as a URL or null if unavailable

public int getOffset()
返回字节偏移量（如果可用）。
return 到输入源的字节偏移量，如果不可用，则返回 -1
英文文档：

getOffset

int getOffset()
Return the byte offset if available

Returns:
the byte offset into the input source or -1 if unavailable

public int getLineNumber()
返回行号（如果可用）。
return 行号；如果不可用，则返回 -1
英文文档：

getLineNumber

int getLineNumber()
Return the line number if available

Returns:
the line number or -1 if unavailable

public int getColumnNumber()
返回列号（如果可用）。
return 列号；如果不可用，则返回 -1
英文文档：

getColumnNumber

int getColumnNumber()
Return the column number if available

Returns:
the column number or -1 if unavailable

public Object getObject()
返回对 Java 内容树中对象的引用（如果可用）。
return 对 Java 内容树中对象的引用；如果不可用，则返回 null
英文文档：

getObject

Object getObject()
Return a reference to the object in the Java content tree if available

Returns:
a reference to the object in the Java content tree or null if unavailable

public org.w3c.dom.Node getNode()
返回对 DOM Node 的引用（如果可用）。
return 对 DOM Node 的引用；如果不可用，则返回 null
英文文档：

getNode

Node getNode()
Return a reference to the DOM Node if available

Returns:
a reference to the DOM Node or null if unavailable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Validator (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind
Interface Validator

Deprecated. since JAXB 2.0

自 JAXB 2.0 开始，此类已过时，成为一个可选项。

该 Validator 类负责控制运行时期间对内容树的验证。

三种形式的验证

解组时验证
这种形式的验证使客户端应用程序能够接收关于将 XML 数据解组到 Java 内容树中时检测到的验证错误和警告的信息，并且与其他类型的验证完全没有关系。要启用或禁用它，请参阅 Unmarshaller.setValidating 的 javadoc。所有 JAXB 1.0 提供者都必须支持此操作。
按需验证
这种形式的验证使客户端应用程序能够接收关于在 Java 内容树中检测到的验证错误和警告的信息。客户端应用程序在任何点上都可以在 Java 内容树（或其任意子树）上调用 Validator.validate 方法。所有 JAXB 1.0 提供这都必须支持此操作。
快速失败验证
当对 Java 内容树所做的修改违反规范中定义的 Java 属性的类型约束时，这种形式的验证使客户端应用程序能够接收关于这些修改的即时反馈。JAXB 提供者不需要支持这种类型的验证。在不支持这种类型的验证的 JAXB 提供者中，一些提供者可能要求在模式编译时确定是否允许客户端应用程序在运行时请求进行快速失败验证。

Validator 类负责管理按需验证。Unmarshaller 类负责管理解组操作期间的解组时验证。虽然没有在编组操作期间启用验证的正式方法，但 Marshaller 可以检测错误，并将这些错误报告给已在它自身上注册的 ValidationEventHandler。

使用默认事件处理程序

如果客户端应用程序没有在调用 validate、unmarshal 或 marshal 方法之前在其 Validator、Unmarshaller 或 Marshaller 上设置事件处理程序，则默认事件处理程序将接收遇到的所有错误或警告的通知。默认事件处理程序将使当前操作在遇到第一个错误或致命错误之后暂停（但将在接收警告后尝试继续完成操作）。

处理验证事件

有三种处理解组、验证和编组期间遇到的事件的方式：
使用默认事件处理程序
如果没有通过 setEventHandler API 在 Validator、Unmarshaller 或 Marshaller 上指定事件处理程序，则将使用默认事件处理程序。
实现和注册一个自定义事件处理程序
复杂事件处理的客户端应用程序可以实现 ValidationEventHandler 接口，并向 Unmarshaller 和/或 Validator 注册它。
使用 ValidationEventCollector 实用工具
为了方便起见，可以提供特殊的事件处理程序，只收集执行解组、验证和编组操作期间创建的任何 ValidationEvent 对象，并将它们作为 java.util.Collection 返回给客户端应用程序。

验证和格式良好

验证事件的处理因为客户端应用程序配置方式的不同而各有不同，以便能够按前一节中描述的方式处理它们。但是，在某些情况下，JAXB 提供者指示无法再以可靠的方式检测和报告错误。在这些情况下，JAXB 提供者会将 ValidationEvent 的严重性设置为 FATAL_ERROR，以指示应该终止解组、验证或编组操作。默认事件处理程序和 ValidationEventCollector 实用工具类必须在收到致命错误通知后终止处理。提供自己的 ValidationEventHandler 的客户端应用程序也应该在收到致命错误通知后终止处理。如果不终止处理，则可能发生不可预料的行为。

支持的属性

当前没有任何需要 Validator 上的所有 JAXB 提供者都支持的属性。但是，一些提供者可能支持它们自己的特定于提供者的属性集。

version
en
$Revision: 1.4 $ $Date: 2005/07/29 20:56:02 $
since | JAXB1.0
deprecated
en
since JAXB 2.0
See also | javax.xml.bind.JAXBContext, javax.xml.bind.Unmarshaller, javax.xml.bind.ValidationEventHandler, javax.xml.bind.ValidationEvent, javax.xml.bind.util.ValidationEventCollector
英文文档：

public interface Validator

As of JAXB 2.0, this class is deprecated and optional.

The Validator class is responsible for controlling the validation of content trees during runtime.

Three Forms of Validation

Unmarshal-Time Validation
This form of validation enables a client application to receive information about validation errors and warnings detected while unmarshalling XML data into a Java content tree and is completely orthogonal to the other types of validation. To enable or disable it, see the javadoc for Unmarshaller.setValidating. All JAXB 1.0 Providers are required to support this operation.
On-Demand Validation
This form of validation enables a client application to receive information about validation errors and warnings detected in the Java content tree. At any point, client applications can call the Validator.validate method on the Java content tree (or any sub-tree of it). All JAXB 1.0 Providers are required to support this operation.
Fail-Fast Validation
This form of validation enables a client application to receive immediate feedback about modifications to the Java content tree that violate type constraints on Java Properties as defined in the specification. JAXB Providers are not required support this type of validation. Of the JAXB Providers that do support this type of validation, some may require you to decide at schema compile time whether or not a client application will be allowed to request fail-fast validation at runtime.

The Validator class is responsible for managing On-Demand Validation. The Unmarshaller class is responsible for managing Unmarshal-Time Validation during the unmarshal operations. Although there is no formal method of enabling validation during the marshal operations, the Marshaller may detect errors, which will be reported to the ValidationEventHandler registered on it.

Using the Default EventHandler

If the client application does not set an event handler on their Validator, Unmarshaller, or Marshaller prior to calling the validate, unmarshal, or marshal methods, then a default event handler will receive notification of any errors or warnings encountered. The default event handler will cause the current operation to halt after encountering the first error or fatal error (but will attempt to continue after receiving warnings).

Handling Validation Events

There are three ways to handle events encountered during the unmarshal, validate, and marshal operations:
Use the default event handler
The default event handler will be used if you do not specify one via the setEventHandler API's on Validator, Unmarshaller, or Marshaller.
Implement and register a custom event handler
Client applications that require sophisticated event processing can implement the ValidationEventHandler interface and register it with the Unmarshaller and/or Validator.
Use the ValidationEventCollector utility
For convenience, a specialized event handler is provided that simply collects any ValidationEvent objects created during the unmarshal, validate, and marshal operations and returns them to the client application as a java.util.Collection.

Validation and Well-Formedness

Validation events are handled differently depending on how the client application is configured to process them as described in the previous section. However, there are certain cases where a JAXB Provider indicates that it is no longer able to reliably detect and report errors. In these cases, the JAXB Provider will set the severity of the ValidationEvent to FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations should be terminated. The default event handler and ValidationEventCollector utility class must terminate processing after being notified of a fatal error. Client applications that supply their own ValidationEventHandler should also terminate processing after being notified of a fatal error. If not, unexpected behaviour may occur.

Supported Properties

There currently are not any properties required to be supported by all JAXB Providers on Validator. However, some providers may support their own set of provider specific properties.

Since:
JAXB1.0
Version:
$Revision: 1.4 $ $Date: 2005/07/29 20:56:02 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
JAXBContext, Unmarshaller, ValidationEventHandler, ValidationEvent, ValidationEventCollector

Method Summary
ValidationEventHandler | getEventHandler() Deprecated. since JAXB2.0
Object | getProperty(String name) Deprecated. since JAXB2.0
void | setEventHandler(ValidationEventHandler handler) Deprecated. since JAXB2.0
void | setProperty(String name, Object value) Deprecated. since JAXB2.0
boolean | validate(Object subrootObj) Deprecated. since JAXB2.0
boolean | validateRoot(Object rootObj) Deprecated. since JAXB2.0

Method Detail

public void setEventHandler(ValidationEventHandler handler) throws JAXBException
允许应用程序注册一个验证事件处理程序。

如果调用 validate 期间遇到任何验证错误，则 JAXB 提供者将调用验证事件处理程序。如果客户端应用程序没有在调用验证方法之前注册验证事件处理程序，那么验证事件将由默认事件处理程序处理，默认事件处理程序将在遇到第一个错误或致命错误之后终止验证操作。

调用带有 null 参数的此方法将导致 Validator 重新使用默认事件处理程序。

handler | 验证事件处理程序
Throws | JAXBException: 如果在设置事件处理程序时发生错误
deprecated | 从 JAXB 2.0 开始
英文文档：

setEventHandler

void setEventHandler(ValidationEventHandler handler)
                     throws JAXBException
Deprecated. since JAXB2.0

Allow an application to register a validation event handler.

The validation event handler will be called by the JAXB Provider if any validation errors are encountered during calls to validate. If the client application does not register a validation event handler before invoking the validate method, then validation events will be handled by the default event handler which will terminate the validate operation after the first error or fatal error is encountered.

Calling this method with a null parameter will cause the Validator to revert back to the default default event handler.

Parameters:
handler - the validation event handler
Throws:
JAXBException - if an error was encountered while setting the event handler

public ValidationEventHandler getEventHandler() throws JAXBException
当前的事件处理程序；如果没有设置，则返回默认事件处理程序。
return | 当前的 ValidationEventHandler；如果没有设置，则返回默认的事件处理程序
Throws | JAXBException: 如果获取当前的事件处理程序时遇到错误
deprecated | 从 JAXB 2.0 开始
英文文档：

getEventHandler

ValidationEventHandler getEventHandler()
                                       throws JAXBException
Deprecated. since JAXB2.0

Return the current event handler or the default event handler if one hasn't been set.

Returns:
the current ValidationEventHandler or the default event handler if it hasn't been set
Throws:
JAXBException - if an error was encountered while getting the current event handler

public boolean validate(Object subrootObj) throws JAXBException
从 subrootObj 开始验证 Java 内容树。

客户端应用程序可以使用此方法在运行时根据需要来验证 Java 内容树。此方法可用于验证 Java 内容树的任意子树。全局约束检查不会作为此操作的一部分执行（即 ID/IDREF 约束）。

subrootObj | 将从其所在位置开始执行验证的对象
Throws | JAXBException: 如果验证期间发生任何预料不到的问题
Throws | ValidationException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或者 Validator 无法验证以 subrootObj 为根的内容树
Throws | IllegalArgumentException: 如果 subrootObj 参数为 null
return | 如果以 subrootObj 为根的子树有效，则返回 true；否则返回 false
deprecated | 从 JAXB 2.0 开始
英文文档：

validate

boolean validate(Object subrootObj)
                 throws JAXBException
Deprecated. since JAXB2.0

Validate the Java content tree starting at subrootObj.

Client applications can use this method to validate Java content trees on-demand at runtime. This method can be used to validate any arbitrary subtree of the Java content tree. Global constraint checking will not be performed as part of this operation (i.e. ID/IDREF constraints).

Parameters:
subrootObj - the obj to begin validation at
Returns:
true if the subtree rooted at subrootObj is valid, false otherwise
Throws:
JAXBException - if any unexpected problem occurs during validation
ValidationException - If the ValidationEventHandler returns false from its handleEvent method or the Validator is unable to validate the content tree rooted at subrootObj
IllegalArgumentException - If the subrootObj parameter is null

public boolean validateRoot(Object rootObj) throws JAXBException
验证以 rootObj 为根的 Java 内容树。

客户端应用程序可以使用此方法在运行时根据需要来验证 Java 内容树。此方法用于验证整个 Java 内容树。全局约束检查将作为此操作的一部分执行（即 ID/IDREF 约束）。

rootObj | 将从其所在位置开始执行验证的根对象
Throws | JAXBException: 如果验证期间发生任何预料不到的问题
Throws | ValidationException: 如果 ValidationEventHandler 从其 handleEvent 方法返回 false 或者 Validator 无法验证以 rootObj 为根的内容树
Throws | IllegalArgumentException: 如果 rootObj 参数为 null
return | 如果以 rootObj 为根的树有效，则返回 true；否则返回 false
deprecated | 从 JAXB 2.0 开始
英文文档：

validateRoot

boolean validateRoot(Object rootObj)
                     throws JAXBException
Deprecated. since JAXB2.0

Validate the Java content tree rooted at rootObj.

Client applications can use this method to validate Java content trees on-demand at runtime. This method is used to validate an entire Java content tree. Global constraint checking will be performed as part of this operation (i.e. ID/IDREF constraints).

Parameters:
rootObj - the root obj to begin validation at
Returns:
true if the tree rooted at rootObj is valid, false otherwise
Throws:
JAXBException - if any unexpected problem occurs during validation
ValidationException - If the ValidationEventHandler returns false from its handleEvent method or the Validator is unable to validate the content tree rooted at rootObj
IllegalArgumentException - If the rootObj parameter is null

public void setProperty(String name, Object value) throws PropertyException
设置 Validator 底层实现中的特定属性。此方法只能用于设置上文中标准 JAXB 定义的属性之一或特定于提供者的属性。试图设置未定义的属性将导致抛出 PropertyException。请参阅支持的属性。
name | 要设置的属性的名称。此值可以使用一个常量字段来指定，也可以是用户提供的字符串。
value | 要设置的属性值
Throws | PropertyException: 如果处理给定属性或值时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
deprecated | 从 JAXB 2.0 开始
英文文档：

setProperty

void setProperty(String name,
                 Object value)
                 throws PropertyException
Deprecated. since JAXB2.0

Set the particular property in the underlying implementation of Validator. This method can only be used to set one of the standard JAXB defined properties above or a provider specific property. Attempting to set an undefined property will result in a PropertyException being thrown. See Supported Properties.

Parameters:
name - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.
value - the value of the property to be set
Throws:
PropertyException - when there is an error processing the given property or value
IllegalArgumentException - If the name parameter is null

public Object getProperty(String name) throws PropertyException
获取 Validator 底层实现中的特定属性。此方法只可用于获取上文中标准 JAXB 定义的属性之一或特定于提供者的属性。试图获取未定义的属性将导致抛出 PropertyException。请参阅支持的属性。
name | 将检索的属性名称
return | 所请求属性的值
Throws | PropertyException: 如果检索给定属性或值属性名称时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
deprecated | 从 JAXB 2.0 开始
英文文档：

getProperty

Object getProperty(String name)
                   throws PropertyException
Deprecated. since JAXB2.0

Get the particular property in the underlying implementation of Validator. This method can only be used to get one of the standard JAXB defined properties above or a provider specific property. Attempting to get an undefined property will result in a PropertyException being thrown. See Supported Properties.

Parameters:
name - the name of the property to retrieve
Returns:
the value of the requested property
Throws:
PropertyException - when there is an error retrieving the given property or value property name
IllegalArgumentException - If the name parameter is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Binder (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind
Class Binder<XmlNode>

java.lang.Object
    extended by  javax.xml.bind.Binder<XmlNode>

public abstract class Binder<XmlNode>
extends Object

在 XML 信息集节点和表示相同 XML 文档的 JAXB 对象之间启用同步。

此类的实例维护了保留视图的信息集的 XML 节点与 XML 文档的 JAXB 表示形式之间的关联。两个视图之间的导航由方法 #getXMLNode(Object) 和 #getJAXBNode(Object) 提供。

可以在其他视图保持不变的情况下，对保留视图的信息集或文档的 JAXB 表示形式进行修改。Binder 能够使用适当的 Binder 更新方法（#updateXML(Object, Object) 或 #updateJAXB(Object)）将在修改视图中所做的更改同步到其他视图中。

下面是一个典型的使用场景：

  • 将 XML 文档加载为 XML 信息集表示形式
  • 将 #unmarshal(Object) XML 信息集视图加载到 JAXB 视图。（注意保存资源，可以只将 XML 信息集视图的子树解组为 JAXB 视图。）
  • XML 文档的应用程序访问/更新 JAXB 视图。
  • #updateXML(Object) 可将对 JAXB 视图的修改同步到 XML 信息集视图中。更新操作将尽可能多地保留原始 XML 信息集（如注释、PI 等等）

Binder 实例是使用工厂方法 createBinder() 或 createBinder(Class) 创建的。

模板参数 XmlNode 是保留表示形式的 XML 信息集的根接口/类。Binder 实现至少需要支持 org.w3c.dom.Node.class 的一个 XmlNode 值。Binder 实现可以支持保留表示形式的备用 XML 信息集。

since JAXB 2.0
英文文档：

Enable synchronization between XML infoset nodes and JAXB objects representing same XML document.

An instance of this class maintains the association between XML nodes of an infoset preserving view and a JAXB representation of an XML document. Navigation between the two views is provided by the methods getXMLNode(Object) and getJAXBNode(Object).

Modifications can be made to either the infoset preserving view or the JAXB representation of the document while the other view remains unmodified. The binder is able to synchronize the changes made in the modified view back into the other view using the appropriate Binder update methods, updateXML(Object, Object) or updateJAXB(Object).

A typical usage scenario is the following:

  • load XML document into an XML infoset representation
  • unmarshal(Object) XML infoset view to JAXB view. (Note to conserve resources, it is possible to only unmarshal a subtree of the XML infoset view to the JAXB view.)
  • application access/updates JAXB view of XML document.
  • updateXML(Object) synchronizes modifications to JAXB view back into the XML infoset view. Update operation preserves as much of original XML infoset as possible (i.e. comments, PI, ...)

A Binder instance is created using the factory method JAXBContext.createBinder() or JAXBContext.createBinder(Class).

The template parameter, XmlNode, is the root interface/class for the XML infoset preserving representation. A Binder implementation is required to minimally support an XmlNode value of org.w3c.dom.Node.class. A Binder implementation can support alternative XML infoset preserving representations.

Since:
JAXB 2.0
Author:
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) Joseph Fialli

Constructor Summary
Binder()
Method Summary
abstract  ValidationEventHandler getEventHandler()
Return the current event handler or the default event handler if one hasn't been set.
abstract  Object getJAXBNode(XmlNode xmlNode)
Gets the JAXB object associated with the given XML element.
abstract  Object getProperty(String name)
Get the particular property in the underlying implementation of Binder.
abstract  Schema getSchema()
Gets the last Schema object (including null) set by the setSchema(Schema) method.
abstract  XmlNode getXMLNode(Object jaxbObject)
Gets the XML element associated with the given JAXB object.
abstract  void marshal(Object jaxbObject, XmlNode xmlNode)
Marshal a JAXB object tree to a new XML document.
abstract  void setEventHandler(ValidationEventHandler handler)
Allow an application to register a ValidationEventHandler.
abstract  void setProperty(String name, Object value)
Set the particular property in the underlying implementation of Binder.
abstract  void setSchema(Schema schema)
Specifies whether marshal, unmarshal and update methods performs validation on their XML content.
abstract  Object unmarshal(XmlNode xmlNode)
Unmarshal XML infoset view to a JAXB object tree.
abstract
<T> JAXBElement<T>
unmarshal(XmlNode xmlNode, Class<T> declaredType)
Unmarshal XML root element by provided declaredType to a JAXB object tree.
abstract  Object updateJAXB(XmlNode xmlNode)
Takes an XML node and updates its associated JAXB object and its descendants.
abstract  XmlNode updateXML(Object jaxbObject)
Takes an JAXB object and updates its associated XML node and its descendants.
abstract  XmlNode updateXML(Object jaxbObject, XmlNode xmlNode)
Changes in JAXB object tree are updated in its associated XML parse tree.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public Binder()
英文文档：

Binder

public Binder()
Method Detail

英文文档：

unmarshal

public abstract Object unmarshal(XmlNode xmlNode)
                          throws JAXBException
Unmarshal XML infoset view to a JAXB object tree.

This method is similar to Unmarshaller.unmarshal(Node) with the addition of maintaining the association between XML nodes and the produced JAXB objects, enabling future update operations, updateXML(Object, Object) or updateJAXB(Object).

When getSchema() is non-null, xmlNode and its descendants is validated during this operation.

This method throws UnmarshalException when the Binder's JAXBContext does not have a mapping for the XML element name or the type, specifiable via @xsi:type, of xmlNode to a JAXB mapped class. The method unmarshal(Object, Class) enables an application to specify the JAXB mapped class that the xmlNode should be mapped to.

Parameters:
xmlNode - the document/element to unmarshal XML data from.
Returns:
the newly created root object of the JAXB object tree.
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Binder is unable to perform the XML to Java binding.
IllegalArgumentException - If the node parameter is null

英文文档：

unmarshal

public abstract <T> JAXBElement<T> unmarshal(XmlNode xmlNode,
                                             Class<T> declaredType)
                                  throws JAXBException
Unmarshal XML root element by provided declaredType to a JAXB object tree.

Implements Unmarshal by Declared Type

This method is similar to Unmarshaller.unmarshal(Node, Class) with the addition of maintaining the association between XML nodes and the produced JAXB objects, enabling future update operations, updateXML(Object, Object) or updateJAXB(Object).

When getSchema() is non-null, xmlNode and its descendants is validated during this operation.

Parameters:
xmlNode - the document/element to unmarshal XML data from.
declaredType - appropriate JAXB mapped class to hold node's XML data.
Returns:
JAXB Element representation of node
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Binder is unable to perform the XML to Java binding.
IllegalArgumentException - If any of the input parameters are null
Since:
JAXB2.0

英文文档：

marshal

public abstract void marshal(Object jaxbObject,
                             XmlNode xmlNode)
                      throws JAXBException
Marshal a JAXB object tree to a new XML document.

This method is similar to Marshaller.marshal(Object, Node) with the addition of maintaining the association between JAXB objects and the produced XML nodes, enabling future update operations such as updateXML(Object, Object) or updateJAXB(Object).

When getSchema() is non-null, the marshalled xml content is validated during this operation.

Parameters:
jaxbObject - The content tree to be marshalled.
xmlNode - The parameter must be a Node that accepts children.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Binder is unable to marshal jaxbObject (or any object reachable from jaxbObject).
IllegalArgumentException - If any of the method parameters are null

abstract public Object getXMLNode(Object jaxbObject)
获取与给定 JAXB 对象关联的 XML 元素。

一旦 JAXB 对象树与 XML 片段关联，此方法将在两树之间启用导航。

XML 元素与 JAXB 对象之间的关联是通过 bind 方法和 update 方法建立的。注意，此关联是片面的；并不是所有 XML 元素都有关联的 JAXB 对象，也不是所有 JAXB 对象都有关联的 XML 元素。

jaxbObject | 可从以前对返回 JAXB 对象树的 bind 或 update 方法的调用中获得的实例。
return | 如果指定的 JAXB 对象对于此 Binder 为未知对象，或者该对象与 XML 元素没有任何关联，则返回 null。
Throws | IllegalArgumentException: 如果 jaxbObject 参数为 null
英文文档：

getXMLNode

public abstract XmlNode getXMLNode(Object jaxbObject)
Gets the XML element associated with the given JAXB object.

Once a JAXB object tree is associated with an XML fragment, this method enables navigation between the two trees.

An association between an XML element and a JAXB object is established by the bind methods and the update methods. Note that this association is partial; not all XML elements have associated JAXB objects, and not all JAXB objects have associated XML elements.

Parameters:
jaxbObject - An instance that is reachable from a prior call to a bind or update method that returned a JAXB object tree.
Returns:
null if the specified JAXB object is not known to this Binder, or if it is not associated with an XML element.
Throws:
IllegalArgumentException - If the jaxbObject parameter is null

英文文档：

getJAXBNode

public abstract Object getJAXBNode(XmlNode xmlNode)
Gets the JAXB object associated with the given XML element.

Once a JAXB object tree is associated with an XML fragment, this method enables navigation between the two trees.

An association between an XML element and a JAXB object is established by the unmarshal, marshal and update methods. Note that this association is partial; not all XML elements have associated JAXB objects, and not all JAXB objects have associated XML elements.

Returns:
null if the specified XML node is not known to this Binder, or if it is not associated with a JAXB object.
Throws:
IllegalArgumentException - If the node parameter is null

abstract public Object updateXML(Object jaxbObject) throws JAXBException
取一个 JAXB 对象，并更新与其关联的 XML 节点和该节点的子级。

这是如下调用的一种便捷方法：

updateXML( jaxbObject, getXMLNode(jaxbObject));

Throws | JAXBException: 如果更新相应的 XML 内容时出现任何不可预料的问题。
Throws | IllegalArgumentException: 如果 jaxbObject 参数为 null
英文文档：

updateXML

public abstract XmlNode updateXML(Object jaxbObject)
                           throws JAXBException
Takes an JAXB object and updates its associated XML node and its descendants.

This is a convenience method of:

 updateXML( jaxbObject, getXMLNode(jaxbObject));

Throws:
JAXBException - If any unexpected problem occurs updating corresponding XML content.
IllegalArgumentException - If the jaxbObject parameter is null

英文文档：

updateXML

public abstract XmlNode updateXML(Object jaxbObject,
                                  XmlNode xmlNode)
                           throws JAXBException
Changes in JAXB object tree are updated in its associated XML parse tree.

This operation can be thought of as an "in-place" marshalling. The difference is that instead of creating a whole new XML tree, this operation updates an existing tree while trying to preserve the XML as much as possible.

For example, unknown elements/attributes in XML that were not bound to JAXB will be left untouched (whereas a marshalling operation would create a new tree that doesn't contain any of those.)

As a side-effect, this operation updates the association between XML nodes and JAXB objects.

Parameters:
jaxbObject - root of potentially modified JAXB object tree
xmlNode - root of update target XML parse tree
Returns:
Returns the updated XML node. Typically, this is the same node you passed in as xmlNode, but it maybe a different object, for example when the tag name of the object has changed.
Throws:
JAXBException - If any unexpected problem occurs updating corresponding XML content.
IllegalArgumentException - If any of the input parameters are null

英文文档：

updateJAXB

public abstract Object updateJAXB(XmlNode xmlNode)
                           throws JAXBException
Takes an XML node and updates its associated JAXB object and its descendants.

This operation can be thought of as an "in-place" unmarshalling. The difference is that instead of creating a whole new JAXB tree, this operation updates an existing tree, reusing as much JAXB objects as possible.

As a side-effect, this operation updates the association between XML nodes and JAXB objects.

Returns:
Returns the updated JAXB object. Typically, this is the same object that was returned from earlier marshal(Object,Object) or updateJAXB(Object) method invocation, but it maybe a different object, for example when the name of the XML element has changed.
Throws:
JAXBException - If any unexpected problem occurs updating corresponding JAXB mapped content.
IllegalArgumentException - If node parameter is null

abstract public void setSchema(javax.xml.validation.Schema schema)
指定 marshal、unmarshal 和 update 方法是否在其 XML 内容上执行验证。
schema | 可将此参数设置为 null 来禁用验证。
See also | setSchema(Schema)
英文文档：

setSchema

public abstract void setSchema(Schema schema)
Specifies whether marshal, unmarshal and update methods performs validation on their XML content.

Parameters:
schema - set to null to disable validation.
See Also:
Unmarshaller.setSchema(Schema)

abstract public javax.xml.validation.Schema getSchema()
获取 #setSchema(Schema) 方法设置的最后一个 Schema 对象（包括 null）。
return 用于验证的 Schema 对象，如果不存在这样的对象，则返回 null
英文文档：

getSchema

public abstract Schema getSchema()
Gets the last Schema object (including null) set by the setSchema(Schema) method.

Returns:
the Schema object for validation or null if not present

abstract public void setEventHandler(ValidationEventHandler handler) throws JAXBException
允许应用程序注册 ValidationEventHandler。

如果在调用任何 Binder 的 unmarshal、marshal 和 update 方法期间遇到验证错误，JAXB 提供者将调用 ValidationEventHandler。

调用带有 null 参数的此方法将导致 Binder 转而调用默认事件处理程序。

handler | 验证事件处理程序
Throws | JAXBException: 如果在设置事件处理程序时发生错误
英文文档：

setEventHandler

public abstract void setEventHandler(ValidationEventHandler handler)
                              throws JAXBException
Allow an application to register a ValidationEventHandler.

The ValidationEventHandler will be called by the JAXB Provider if any validation errors are encountered during calls to any of the Binder unmarshal, marshal and update methods.

Calling this method with a null parameter will cause the Binder to revert back to the default default event handler.

Parameters:
handler - the validation event handler
Throws:
JAXBException - if an error was encountered while setting the event handler

abstract public ValidationEventHandler getEventHandler() throws JAXBException
当前的事件处理程序；如果没有设置，则返回默认事件处理程序。
return | 当前的 ValidationEventHandler；如果没有设置，则返回默认的事件处理程序
Throws | JAXBException: 如果获取当前的事件处理程序时发生错误
英文文档：

getEventHandler

public abstract ValidationEventHandler getEventHandler()
                                                throws JAXBException
Return the current event handler or the default event handler if one hasn't been set.

Returns:
the current ValidationEventHandler or the default event handler if it hasn't been set
Throws:
JAXBException - if an error was encountered while getting the current event handler

abstract public void setProperty(String name, Object value) throws PropertyException
设置 Binder 的基础实现中的特定属性。此方法只用于设置某个标准 JAXB 定义的 unmarshal/marshal 属性或者特定于提供者的 binder、unmarshal 或 marshal 属性。试图设置未定义的属性将导致抛出 PropertyException。请参阅受支持的 Unmarshal 属性和受支持的 Marshal 属性。
name | 要设置的属性的名称。此值可以使用一个常量字段来指定，也可以是一个用户提供的字符串。
value | 要设置的属性值
Throws | PropertyException: 如果处理给定属性或值时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
英文文档：

setProperty

public abstract void setProperty(String name,
                                 Object value)
                          throws PropertyException
Set the particular property in the underlying implementation of Binder. This method can only be used to set one of the standard JAXB defined unmarshal/marshal properties or a provider specific property for binder, unmarshal or marshal. Attempting to set an undefined property will result in a PropertyException being thrown. See Supported Unmarshal Properties and Supported Marshal Properties.

Parameters:
name - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.
value - the value of the property to be set
Throws:
PropertyException - when there is an error processing the given property or value
IllegalArgumentException - If the name parameter is null

abstract public Object getProperty(String name) throws PropertyException
获取 Binder 的基础实现中的特定属性。此方法只用于获取某个标准 JAXB 定义的 unmarshal/marshal 属性或者特定于提供者的 binder、unmarshal 或 marshal 属性。试图获取未定义的属性将导致抛出 PropertyException。请参阅受支持的 Unmarshal 属性和受支持的 Marshal 属性。
name | 将检索的属性名称
return | 所请求属性的值
Throws | PropertyException: 如果检索给定属性或值属性名称时发生错误
Throws | IllegalArgumentException: 如果 name 参数为 null
英文文档：

getProperty

public abstract Object getProperty(String name)
                            throws PropertyException
Get the particular property in the underlying implementation of Binder. This method can only be used to get one of the standard JAXB defined unmarshal/marshal properties or a provider specific property for binder, unmarshal or marshal. Attempting to get an undefined property will result in a PropertyException being thrown. See Supported Unmarshal Properties and Supported Marshal Properties.

Parameters:
name - the name of the property to retrieve
Returns:
the value of the requested property
Throws:
PropertyException - when there is an error retrieving the given property or value property name
IllegalArgumentException - If the name parameter is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


DatatypeConverter (Java EE 5)

javax.xml.bind
Class DatatypeConverter

java.lang.Object
    extended by  javax.xml.bind.DatatypeConverter

public final class DatatypeConverter
extends Object

可以使用 javaType 绑定声明来自定义 XML 模式数据类型到 Java 数据类型的绑定。自定义可能涉及编写分别用来解析和打印 XML 模式数据类型的词汇表示形式的 parse 和 print 方法。不过，编写 parse 和 print 方法需要了解词汇表示形式（ XML Schema Part2: Datatypes 规范），因此可能很难编写。

此类使编写 parse 和 print 方法变得更容易。它定义了静态 parse 和 print 方法，以便访问 JAXB 提供者的 parse 和 print 方法的实现。这些方法由自定义 parse 和 print 方法调用。例如，可以使用如下 parse 和 print 方法来自定义 xsd:dateTime 到 long 值的绑定：

// Customized parse method
public long myParseCal( String dateTimeString ) {
java.util.Calendar cal = DatatypeConverter.parseDateTime(dateTimeString);
long longval = convert_calendar_to_long(cal); //application specific
return longval;
    }

// Customized print method
public String myPrintCal( Long longval ) {
java.util.Calendar cal = convert_long_to_calendar(longval) ; //application specific
String dateTimeString = DatatypeConverter.printDateTime(cal);
return dateTimeString;
    }

在 DatatypeConverterInterface 中有分别对应于每个 parse 和 print 方法的静态 parse 和 print 方法。

在该类中定义的静态方法还可以用于指定 javaType 绑定声明中的 parse 和 print 方法。

JAXB 提供者需要在第一次执行编组或解组操作之前（可能是在调用 JAXBContext.newInstance 期间）的某个时间点调用 setDatatypeConverter API。要配置用于执行打印和解析功能的转换器，这一步是必需的。

XML 模式数据类型的 print 方法可以输出对于 XML 模式数据类型有效的任何词汇表示形式。如果在转换期间发生错误，则该方法将抛出 IllegalArgumentException，或者抛出 IllegalArgumentException 的子类。

version
en
$Revision: 1.3 $
since | JAXB1.0
See also | javax.xml.bind.DatatypeConverterInterface, javax.xml.bind.ParseConversionEvent, javax.xml.bind.PrintConversionEvent
英文文档：

The javaType binding declaration can be used to customize the binding of an XML schema datatype to a Java datatype. Customizations can involve writing a parse and print method for parsing and printing lexical representations of a XML schema datatype respectively. However, writing parse and print methods requires knowledge of the lexical representations ( XML Schema Part2: Datatypes specification ) and hence may be difficult to write.

This class makes it easier to write parse and print methods. It defines static parse and print methods that provide access to a JAXB provider's implementation of parse and print methods. These methods are invoked by custom parse and print methods. For example, the binding of xsd:dateTime to a long can be customized using parse and print methods as follows:

    // Customized parse method
    public long myParseCal( String dateTimeString ) {
        java.util.Calendar cal = DatatypeConverter.parseDateTime(dateTimeString);
        long longval = convert_calendar_to_long(cal); //application specific
        return longval;
    }

    // Customized print method
    public String myPrintCal( Long longval ) {
        java.util.Calendar cal = convert_long_to_calendar(longval) ; //application specific
        String dateTimeString = DatatypeConverter.printDateTime(cal);
        return dateTimeString;
    }

There is a static parse and print method corresponding to each parse and print method respectively in the DatatypeConverterInterface.

The static methods defined in the class can also be used to specify a parse or a print method in a javaType binding declaration.

JAXB Providers are required to call the setDatatypeConverter api at some point before the first marshal or unmarshal operation (perhaps during the call to JAXBContext.newInstance). This step is necessary to configure the converter that should be used to perform the print and parse functionality.

A print method for a XML schema datatype can output any lexical representation that is valid with respect to the XML schema datatype. If an error is encountered during conversion, then an IllegalArgumentException, or a subclass of IllegalArgumentException must be thrown by the method.

Since:
JAXB1.0
Version:
$Revision: 1.3 $
Author:
  • Sekhar Vajjhala, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Ryan Shoemaker,Sun Microsystems Inc.
See Also:
DatatypeConverterInterface, ParseConversionEvent, PrintConversionEvent

Method Summary
static String | parseAnySimpleType(String lexicalXSDAnySimpleType) Return a string containing the lexical representation of the simple type.
static byte[] | parseBase64Binary(String lexicalXSDBase64Binary) Converts the string argument into an array of bytes.
static boolean | parseBoolean(String lexicalXSDBoolean) Converts the string argument into a boolean value.
static byte | parseByte(String lexicalXSDByte) Converts the string argument into a byte value.
static Calendar | parseDate(String lexicalXSDDate) Converts the string argument into a Calendar value.
static Calendar | parseDateTime(String lexicalXSDDateTime) Converts the string argument into a Calendar value.
static BigDecimal | parseDecimal(String lexicalXSDDecimal) Converts the string argument into a BigDecimal value.
static double | parseDouble(String lexicalXSDDouble) Converts the string argument into a double value.
static float | parseFloat(String lexicalXSDFloat) Converts the string argument into a float value.
static byte[] | parseHexBinary(String lexicalXSDHexBinary) Converts the string argument into an array of bytes.
static int | parseInt(String lexicalXSDInt) Convert the string argument into an int value.
static BigInteger | parseInteger(String lexicalXSDInteger) Convert the string argument into a BigInteger value.
static long | parseLong(String lexicalXSDLong) Converts the string argument into a long value.
static QName | parseQName(String lexicalXSDQName, NamespaceContext nsc) Converts the string argument into a byte value.
static short | parseShort(String lexicalXSDShort) Converts the string argument into a short value.
static String | parseString(String lexicalXSDString) Convert the lexical XSD string argument into a String value.
static Calendar | parseTime(String lexicalXSDTime) Converts the string argument into a Calendar value.
static long | parseUnsignedInt(String lexicalXSDUnsignedInt) Converts the string argument into a long value.
static int | parseUnsignedShort(String lexicalXSDUnsignedShort) Converts the string argument into an int value.
static String | printAnySimpleType(String val) Converts a string value into a string.
static String | printBase64Binary(byte[] val) Converts an array of bytes into a string.
static String | printBoolean(boolean val) Converts a boolean value into a string.
static String | printByte(byte val) Converts a byte value into a string.
static String | printDate(Calendar val) Converts a Calendar value into a string.
static String | printDateTime(Calendar val) Converts a Calendar value into a string.
static String | printDecimal(BigDecimal val) Converts a BigDecimal value into a string.
static String | printDouble(double val) Converts a double value into a string.
static String | printFloat(float val) Converts a float value into a string.
static String | printHexBinary(byte[] val) Converts an array of bytes into a string.
static String | printInt(int val) Converts an int value into a string.
static String | printInteger(BigInteger val) Converts a BigInteger value into a string.
static String | printLong(long val) Converts A long value into a string.
static String | printQName(QName val, NamespaceContext nsc) Converts a QName instance into a string.
static String | printShort(short val) Converts a short value into a string.
static String | printString(String val) Converts the string argument into a string.
static String | printTime(Calendar val) Converts a Calendar value into a string.
static String | printUnsignedInt(long val) Converts a long value into a string.
static String | printUnsignedShort(int val) Converts an int value into a string.
static void | setDatatypeConverter(DatatypeConverterInterface converter) This method is for JAXB provider use only.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

public static void setDatatypeConverter(DatatypeConverterInterface converter)
此方法仅适用于 JAXB 提供者。

JAXB 提供者需要在允许执行任何 JAXB 客户端编组或解组操作之前的某个时间点调用此方法。要配置用于执行打印和解析功能的转换器，这一步是必需的。

重复调用此 API 是无效的，传入第一次调用中的 DatatypeConverterInterface 实例将始终用于后续调用。

converter | 实现 DatatypeConverterInterface 类的类实例，此参数不能为 null。
Throws | IllegalArgumentException: 如果参数为 null
英文文档：

setDatatypeConverter

public static void setDatatypeConverter(DatatypeConverterInterface converter)
This method is for JAXB provider use only.

JAXB Providers are required to call this method at some point before allowing any of the JAXB client marshal or unmarshal operations to occur. This is necessary to configure the datatype converter that should be used to perform the print and parse conversions.

Calling this api repeatedly will have no effect - the DatatypeConverterInterface instance passed into the first invocation is the one that will be used from then on.

Parameters:
converter - an instance of a class that implements the DatatypeConverterInterface class - this parameter must not be null.
Throws:
IllegalArgumentException - if the parameter is null

public static String parseString(String lexicalXSDString)

将词汇 XSD 字符串参数转换为一个 String 值。

lexicalXSDString | 包含 xsd:string 的词汇表示形式的字符串。
return | 字符串参数表示的 String 值。
英文文档：

parseString

public static String parseString(String lexicalXSDString)

Convert the lexical XSD string argument into a String value.

Parameters:
lexicalXSDString - A string containing a lexical representation of xsd:string.
Returns:
A String value represented by the string argument.

public static java.math.BigInteger parseInteger(String lexicalXSDInteger)

将字符串参数转换为一个 BigInteger 值。

lexicalXSDInteger | 包含 xsd:integer 的词汇表示形式的字符串。
return | 字符串参数表示的 BigInteger 值。
Throws | NumberFormatException: 如果 lexicalXSDInteger 不是 java.math.BigInteger 值的有效字符串表示形式。
英文文档：

parseInteger

public static BigInteger parseInteger(String lexicalXSDInteger)

Convert the string argument into a BigInteger value.

Parameters:
lexicalXSDInteger - A string containing a lexical representation of xsd:integer.
Returns:
A BigInteger value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDInteger is not a valid string representation of a BigInteger value.

public static int parseInt(String lexicalXSDInt)

将字符串参数转换为一个 int 值。

lexicalXSDInt | 包含 xsd:int 的词汇表示形式的字符串。
return | 字符串参数表示的 int 值。
Throws | NumberFormatException: 如果 lexicalXSDInt 不是 int 值的有效字符串表示形式。
英文文档：

parseInt

public static int parseInt(String lexicalXSDInt)

Convert the string argument into an int value.

Parameters:
lexicalXSDInt - A string containing a lexical representation of xsd:int.
Returns:
A int value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDInt is not a valid string representation of an int value.

public static long parseLong(String lexicalXSDLong)

将字符串参数转换为一个 long 值。

lexicalXSDLong | 包含 xsd:long 的词汇表示形式的字符串。
return | 字符串参数表示的 long 值。
Throws | NumberFormatException: 如果 lexicalXSDLong 不是 long 值的有效字符串表示形式。
英文文档：

parseLong

public static long parseLong(String lexicalXSDLong)

Converts the string argument into a long value.

Parameters:
lexicalXSDLong - A string containing lexical representation of xsd:long.
Returns:
A long value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDLong is not a valid string representation of a long value.

public static short parseShort(String lexicalXSDShort)

将字符串参数转换为一个 short 值。

lexicalXSDShort | 包含 xsd:short 的词汇表示形式的字符串。
return | 字符串参数表示的 short 值。
Throws | NumberFormatException: 如果 lexicalXSDShort 不是 short 值的有效字符串表示形式。
英文文档：

parseShort

public static short parseShort(String lexicalXSDShort)

Converts the string argument into a short value.

Parameters:
lexicalXSDShort - A string containing lexical representation of xsd:short.
Returns:
A short value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDShort is not a valid string representation of a short value.

public static java.math.BigDecimal parseDecimal(String lexicalXSDDecimal)

将字符串参数转换为一个 BigDecimal 值。

lexicalXSDDecimal | 包含 xsd:decimal 的词汇表示形式的字符串。
return | 字符串参数表示的 BigDecimal 值。
Throws | NumberFormatException: 如果 lexicalXSDDecimal 不是 java.math.BigDecimal 的有效字符串表示形式。
英文文档：

parseDecimal

public static BigDecimal parseDecimal(String lexicalXSDDecimal)

Converts the string argument into a BigDecimal value.

Parameters:
lexicalXSDDecimal - A string containing lexical representation of xsd:decimal.
Returns:
A BigDecimal value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDDecimal is not a valid string representation of BigDecimal.

public static float parseFloat(String lexicalXSDFloat)

将字符串参数转换为一个 float 值。

lexicalXSDFloat | 包含 xsd:float 的词汇表示形式的字符串。
return | 字符串参数表示的 float 值。
Throws | NumberFormatException: 如果 lexicalXSDFloat 不是 float 值的有效字符串表示形式。
英文文档：

parseFloat

public static float parseFloat(String lexicalXSDFloat)

Converts the string argument into a float value.

Parameters:
lexicalXSDFloat - A string containing lexical representation of xsd:float.
Returns:
A float value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDFloat is not a valid string representation of a float value.

public static double parseDouble(String lexicalXSDDouble)

将字符串参数转换为一个 double 值。

lexicalXSDDouble | 包含 xsd:double 的词汇表示形式的字符串。
return | 字符串参数表示的 double 值。
Throws | NumberFormatException: 如果 lexicalXSDDouble 不是 double 值的有效字符串表示形式。
英文文档：

parseDouble

public static double parseDouble(String lexicalXSDDouble)

Converts the string argument into a double value.

Parameters:
lexicalXSDDouble - A string containing lexical representation of xsd:double.
Returns:
A double value represented by the string argument.
Throws:
NumberFormatException - lexicalXSDDouble is not a valid string representation of a double value.

public static boolean parseBoolean(String lexicalXSDBoolean)

将字符串参数转换为一个 boolean 值。

lexicalXSDBoolean | 包含 xsd:boolean 的词汇表示形式的字符串。
return | 字符串参数表示的 boolean 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 中为 xsd:boolean 定义的词汇值空间。
英文文档：

parseBoolean

public static boolean parseBoolean(String lexicalXSDBoolean)

Converts the string argument into a boolean value.

Parameters:
lexicalXSDBoolean - A string containing lexical representation of xsd:boolean.
Returns:
A boolean value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.

public static byte parseByte(String lexicalXSDByte)

将字符串参数转换为一个 byte 值。

lexicalXSDByte | 包含 xsd:byte 的词汇表示形式的字符串。
return | 字符串参数表示的 byte 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:byte 定义的词汇值空间。
英文文档：

parseByte

public static byte parseByte(String lexicalXSDByte)

Converts the string argument into a byte value.

Parameters:
lexicalXSDByte - A string containing lexical representation of xsd:byte.
Returns:
A byte value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.

public static javax.xml.namespace.QName parseQName(String lexicalXSDQName, javax.xml.namespace.NamespaceContext nsc)

将字符串参数转换为一个 byte 值。

字符串参数 lexicalXSDQname 必须符合 XML Schema Part 2: Datatypes 规范：QName 中指定的词汇值空间。

lexicalXSDQName | 包含 xsd:QName 的词汇表示形式的字符串。
nsc | 解释 QName 中前缀的名称空间上下文。
return | 字符串参数表示的 QName 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2 规范，或者 lexicalXSDQname 的名称空间前缀未绑定到 NamespaceContext nsc 中的 URI。
英文文档：

parseQName

public static QName parseQName(String lexicalXSDQName,
                               NamespaceContext nsc)

Converts the string argument into a byte value.

String parameter lexicalXSDQname must conform to lexical value space specifed at XML Schema Part 2:Datatypes specification:QNames

Parameters:
lexicalXSDQName - A string containing lexical representation of xsd:QName.
nsc - A namespace context for interpreting a prefix within a QName.
Returns:
A QName value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to XML Schema Part 2 specification or if namespace prefix of lexicalXSDQname is not bound to a URI in NamespaceContext nsc.

public static java.util.Calendar parseDateTime(String lexicalXSDDateTime)

将字符串参数转换为一个 Calendar 值。

lexicalXSDDateTime | 包含 xsd:datetime 的词汇表示形式的字符串。
return | 字符串参数表示的 Calendar 对象。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:dateTime 定义的词汇值空间。
英文文档：

parseDateTime

public static Calendar parseDateTime(String lexicalXSDDateTime)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDDateTime - A string containing lexical representation of xsd:datetime.
Returns:
A Calendar object represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.

public static byte[] parseBase64Binary(String lexicalXSDBase64Binary)

将字符串参数转换为一个字节数组。

lexicalXSDBase64Binary | 包含 xsd:base64Binary 的词汇表示形式的字符串。
return | 字符串参数表示的字节数组。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:base64Binary 定义的词汇值空间。
英文文档：

parseBase64Binary

public static byte[] parseBase64Binary(String lexicalXSDBase64Binary)

Converts the string argument into an array of bytes.

Parameters:
lexicalXSDBase64Binary - A string containing lexical representation of xsd:base64Binary.
Returns:
An array of bytes represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary

public static byte[] parseHexBinary(String lexicalXSDHexBinary)

将字符串参数转换为一个字节数组。

lexicalXSDHexBinary | 包含 xsd:hexBinary 的词汇表示形式的字符串。
return | 字符串参数表示的字节数组。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:hexBinary 定义的词汇值空间。
英文文档：

parseHexBinary

public static byte[] parseHexBinary(String lexicalXSDHexBinary)

Converts the string argument into an array of bytes.

Parameters:
lexicalXSDHexBinary - A string containing lexical representation of xsd:hexBinary.
Returns:
An array of bytes represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.

public static long parseUnsignedInt(String lexicalXSDUnsignedInt)

将字符串参数转换为一个 long 值。

lexicalXSDUnsignedInt | 包含 xsd:unsignedInt 的词汇表示形式的字符串。
return | 字符串参数表示的 long 值。
Throws | NumberFormatException: 如果不能将字符串参数解析为 long 值。
英文文档：

parseUnsignedInt

public static long parseUnsignedInt(String lexicalXSDUnsignedInt)

Converts the string argument into a long value.

Parameters:
lexicalXSDUnsignedInt - A string containing lexical representation of xsd:unsignedInt.
Returns:
A long value represented by the string argument.
Throws:
NumberFormatException - if string parameter can not be parsed into a long value.

public static int parseUnsignedShort(String lexicalXSDUnsignedShort)

将字符串参数转换为一个 int 值。

lexicalXSDUnsignedShort | 包含 xsd:unsignedShort 的词汇表示形式的字符串。
return | 字符串参数表示的 int 值。
Throws | NumberFormatException: 如果不能将字符串参数解析为 int 值。
英文文档：

parseUnsignedShort

public static int parseUnsignedShort(String lexicalXSDUnsignedShort)

Converts the string argument into an int value.

Parameters:
lexicalXSDUnsignedShort - A string containing lexical representation of xsd:unsignedShort.
Returns:
An int value represented by the string argument.
Throws:
NumberFormatException - if string parameter can not be parsed into an int value.

public static java.util.Calendar parseTime(String lexicalXSDTime)

将字符串参数转换为一个 Calendar 值。

lexicalXSDTime | 包含 xsd:time 的词汇表示形式的字符串。
return | 字符串参数表示的 Calendar 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:Time 定义的词汇值空间。
英文文档：

parseTime

public static Calendar parseTime(String lexicalXSDTime)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDTime - A string containing lexical representation of xsd:time.
Returns:
A Calendar value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.

public static java.util.Calendar parseDate(String lexicalXSDDate)

将字符串参数转换为一个 Calendar 值。

lexicalXSDDate | 包含 xsd:Date 的词汇表示形式的字符串。
return | 字符串参数表示的 Calendar 值。
Throws | IllegalArgumentException: 如果字符串参数不符合 XML Schema Part 2: Datatypes 为 xsd:Date 定义的词汇值空间。
英文文档：

parseDate

public static Calendar parseDate(String lexicalXSDDate)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDDate - A string containing lexical representation of xsd:Date.
Returns:
A Calendar value represented by the string argument.
Throws:
IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.

public static String parseAnySimpleType(String lexicalXSDAnySimpleType)

返回包含简单类型的词汇表示形式的字符串。

lexicalXSDAnySimpleType | 包含简单类型的词汇表示形式的字符串。
return | 包含简单类型的词汇表示形式的字符串。
英文文档：

parseAnySimpleType

public static String parseAnySimpleType(String lexicalXSDAnySimpleType)

Return a string containing the lexical representation of the simple type.

Parameters:
lexicalXSDAnySimpleType - A string containing lexical representation of the simple type.
Returns:
A string containing the lexical representation of the simple type.

public static String printString(String val)

将字符串参数转换为一个字符串。

val | 字符串值。
return | 包含 xsd:string 的词汇表示形式的字符串。
英文文档：

printString

public static String printString(String val)

Converts the string argument into a string.

Parameters:
val - A string value.
Returns:
A string containing a lexical representation of xsd:string.

public static String printInteger(java.math.BigInteger val)

将 BigInteger 值转换为一个字符串。

val | 一个 BigInteger 值
return | 包含 xsd:integer 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printInteger

public static String printInteger(BigInteger val)

Converts a BigInteger value into a string.

Parameters:
val - A BigInteger value
Returns:
A string containing a lexical representation of xsd:integer
Throws:
IllegalArgumentException - val is null.

public static String printInt(int val)

将 int 值转换为一个字符串。

val | 一个 int 值
return | 包含 xsd:int 的词汇表示形式的字符串
英文文档：

printInt

public static String printInt(int val)

Converts an int value into a string.

Parameters:
val - An int value
Returns:
A string containing a lexical representation of xsd:int

public static String printLong(long val)

将 long 值转换为一个字符串。

val | 一个 long 值
return | 包含 xsd:long 的词汇表示形式的字符串
英文文档：

printLong

public static String printLong(long val)

Converts A long value into a string.

Parameters:
val - A long value
Returns:
A string containing a lexical representation of xsd:long

public static String printShort(short val)

将 short 值转换为一个字符串。

val | 一个 short 值
return | 包含 xsd:short 的词汇表示形式的字符串
英文文档：

printShort

public static String printShort(short val)

Converts a short value into a string.

Parameters:
val - A short value
Returns:
A string containing a lexical representation of xsd:short

public static String printDecimal(java.math.BigDecimal val)

将 BigDecimal 值转换为一个字符串。

val | 一个 BigDecimal 值
return | 包含 xsd:decimal 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printDecimal

public static String printDecimal(BigDecimal val)

Converts a BigDecimal value into a string.

Parameters:
val - A BigDecimal value
Returns:
A string containing a lexical representation of xsd:decimal
Throws:
IllegalArgumentException - val is null.

public static String printFloat(float val)

将 float 值转换为一个字符串。

val | 一个 float 值
return | 包含 xsd:float 的词汇表示形式的字符串
英文文档：

printFloat

public static String printFloat(float val)

Converts a float value into a string.

Parameters:
val - A float value
Returns:
A string containing a lexical representation of xsd:float

public static String printDouble(double val)

将 double 值转换为一个字符串。

val | 一个 double 值
return | 包含 xsd:double 的词汇表示形式的字符串
英文文档：

printDouble

public static String printDouble(double val)

Converts a double value into a string.

Parameters:
val - A double value
Returns:
A string containing a lexical representation of xsd:double

public static String printBoolean(boolean val)

将 boolean 值转换为一个字符串。

val | 一个 boolean 值
return | 包含 xsd:boolean 的词汇表示形式的字符串
英文文档：

printBoolean

public static String printBoolean(boolean val)

Converts a boolean value into a string.

Parameters:
val - A boolean value
Returns:
A string containing a lexical representation of xsd:boolean

public static String printByte(byte val)

将 byte 值转换为一个字符串。

val | 一个 byte 值
return | 包含 xsd:byte 的词汇表示形式的字符串
英文文档：

printByte

public static String printByte(byte val)

Converts a byte value into a string.

Parameters:
val - A byte value
Returns:
A string containing a lexical representation of xsd:byte

public static String printQName(javax.xml.namespace.QName val, javax.xml.namespace.NamespaceContext nsc)

将 QName 实例转换为一个字符串。

val | 一个 QName 值
nsc | 解释 QName 中前缀的名称空间上下文。
return | 包含 QName 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null、nsc 为非 null 或 nsc.getPrefix(nsprefixFromVal) 为 null。
英文文档：

printQName

public static String printQName(QName val,
                                NamespaceContext nsc)

Converts a QName instance into a string.

Parameters:
val - A QName value
nsc - A namespace context for interpreting a prefix within a QName.
Returns:
A string containing a lexical representation of QName
Throws:
IllegalArgumentException - if val is null or if nsc is non-null or nsc.getPrefix(nsprefixFromVal) is null.

public static String printDateTime(java.util.Calendar val)

将 Calendar 值转换为一个字符串。

val | 一个 Calendar 值
return | 包含 xsd:dateTime 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printDateTime

public static String printDateTime(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:dateTime
Throws:
IllegalArgumentException - if val is null.

public static String printBase64Binary(byte[] val)

将字节数组转换为一个字符串。

val | 一个字节数组
return | 包含 xsd:base64Binary 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printBase64Binary

public static String printBase64Binary(byte[] val)

Converts an array of bytes into a string.

Parameters:
val - An array of bytes
Returns:
A string containing a lexical representation of xsd:base64Binary
Throws:
IllegalArgumentException - if val is null.

public static String printHexBinary(byte[] val)

将字节数组转换为一个字符串。

val | 一个字节数组
return | 包含 xsd:hexBinary 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printHexBinary

public static String printHexBinary(byte[] val)

Converts an array of bytes into a string.

Parameters:
val - An array of bytes
Returns:
A string containing a lexical representation of xsd:hexBinary
Throws:
IllegalArgumentException - if val is null.

public static String printUnsignedInt(long val)

将 long 值转换为一个字符串。

val | 一个 long 值
return | 包含 xsd:unsignedInt 的词汇表示形式的字符串
英文文档：

printUnsignedInt

public static String printUnsignedInt(long val)

Converts a long value into a string.

Parameters:
val - A long value
Returns:
A string containing a lexical representation of xsd:unsignedInt

public static String printUnsignedShort(int val)

将 int 值转换为一个字符串。

val | 一个 int 值
return | 包含 xsd:unsignedShort 的词汇表示形式的字符串
英文文档：

printUnsignedShort

public static String printUnsignedShort(int val)

Converts an int value into a string.

Parameters:
val - An int value
Returns:
A string containing a lexical representation of xsd:unsignedShort

public static String printTime(java.util.Calendar val)

将 Calendar 值转换为一个字符串。

val | 一个 Calendar 值
return | 包含 xsd:time 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printTime

public static String printTime(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:time
Throws:
IllegalArgumentException - if val is null.

public static String printDate(java.util.Calendar val)

将 Calendar 值转换为一个字符串。

val | 一个 Calendar 值
return | 包含 xsd:date 的词汇表示形式的字符串
Throws | IllegalArgumentException: 如果 val 为 null。
英文文档：

printDate

public static String printDate(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:date
Throws:
IllegalArgumentException - if val is null.

public static String printAnySimpleType(String val)

将字符串值转换为一个字符串。

val | 字符串值
return | 包含 xsd:AnySimpleType 的词汇表示形式的字符串
英文文档：

printAnySimpleType

public static String printAnySimpleType(String val)

Converts a string value into a string.

Parameters:
val - A string value
Returns:
A string containing a lexical representation of xsd:AnySimpleType
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXBContext (Java EE 5)

javax.xml.bind
Class JAXBContext

java.lang.Object
    extended by  javax.xml.bind.JAXBContext

public abstract class JAXBContext
extends Object

JAXBContext 类提供到 JAXB API 的客户端入口点。它提供了管理实现 JAXB 绑定框架操作所需的 XML/Java 绑定信息的抽象，这些操作包括：解组、编组和验证。

客户端应用程序通常使用以下两种风格的 newInstance 方法之一来获得此类的新实例，但是该方法还有其他可用的特殊形式：

  • JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )
    JAXBContext 实例是根据冒号分隔的 Java 包名称的列表进行初始化的。每个 java 包都包含 JAXB 映射类、模式派生类和/或用户注释类。此外，java 包可能包含必须处理的 JAXB 包注释。（请参阅 JLS 第 3 版的第 7.4.1 节“包注释”）。
  • JAXBContext.newInstance( com.acme.foo.Foo.class )
    JAXBContext 实例是使用作为参数传递的类以及可从这些类静态获得的类来实现初始化的。有关详细信息，请参见 #newInstance(Class...)。

特别要求：该提供者必须提供包含以下方法签名的实现类：
public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException
public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException

以下 JAXB 1.0 要求只是 java 接口/实现绑定的模式所需要的。它不适用于 JAXB 注释类。JAXB 提供者必须在每个包含模式派生类的包中生成一个 jaxb.properties 文件。该属性文件必须包含名为 javax.xml.bind.context.factory 的属性，其值为实现 createContext API 的类的名称。

该提供者提供的类不一定是可分配给 javax.xml.bind.JAXBContext 的，只是必须提供一个实现 createContext API 的类。

此外，提供者必须在执行 marshal 和 unmarshal 方法的任何客户端调用之前调用 DatatypeConverter.setDatatypeConverter api。这在配置将在执行这些操作期间使用的数据类型转换器时是必需的。

解组

Unmarshaller 类使客户端应用程序能够将 XML 数据转换为 Java 内容对象树。unmarshal 方法允许将模式中声明的任何全局 XML 元素解组为实例文档的根。此外，unmarshal 方法允许将未被识别的根元素（该元素具有一个引用了模式中声明的类型定义的 xsi:type 属性值）解组为实例文档的根。JAXBContext 对象允许跨模式集合（已在 contextPath 中列出）合并全局元素和类型定义。因为模式集合中的每个模式可能属于不同的名称空间，所以统一解组上下文的模式应该与名称空间无关。这意味着客户端应用程序能够解组 contextPath 中列出的任何模式实例的 XML 文档。例如：
JAXBContext jc = JAXBContext.newInstance( "com.acme.foo:com.acme.bar" );
Unmarshaller u = jc.createUnmarshaller();
FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) ); // ok
BarObject barObj = (BarObject)u.unmarshal( new File( "bar.xml" ) ); // ok
BazObject bazObj = (BazObject)u.unmarshal( new File( "baz.xml" ) ); // error, "com.acme.baz" not in contextPath

客户端应用程序还可以显式生成 Java 内容树，而不是解组现有的 XML 数据。对于所有 JAXB 注释值类，应用程序可以使用构造方法来创建内容。对于模式派生的接口/实现类以及未绑定到 JAXB 注释类的元素的创建，应用程序需要访问和了解每个模式派生的 ObjectFactory 类，这些类存在于 contextPath 中包含的每个 java 包中。对于每个模式派生的 java 类，都有一个生成该类型的对象的静态工厂方法。例如，假定在编译模式之后有一个包 com.acme.foo，它包含一个名为 PurchaseOrder 的模式派生接口。为了创建该类型的对象，客户端应用程序将使用如下工厂方法：

com.acme.foo.PurchaseOrder po =
com.acme.foo.ObjectFactory.createPurchaseOrder();

一旦客户端应用程序有一个模式派生对象的实例，它就可以使用 mutator 方法在该实例上设置内容。

有关生成的 ObjectFactory 类的更多信息，请参阅该规范的第 4.2 节“Java 包”。

特别要求：在包含名为 ObjectFactory 的包所需的所有对象工厂方法以及静态 newInstance( javaContentInterface ) 方法的每个包中，该提供者都必须生成一个类。

编组

Marshaller 类使客户端应用程序能够将 Java 内容树转换回 XML 数据。对使用工厂方法手动创建的内容树进行编组与对作为 unmarshal 操作结果的内容树进行编组没有什么区别。客户端可以将 java 内容树编组回 java.io.OutputStream 或 java.io.Writer 的 XML 数据。编组进程可以生成已注册 ContentHandler 的 SAX2 事件流，也可以生成一个 DOM 节点对象。客户端应用程序控制着输出编码，还控制着是将 XML 数据编组为一个完整的文档还是编组为一个片段。

下面是一个解组 XML 文档、然后将其编组回来的简单示例：

JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );

// unmarshal from foo.xml
Unmarshaller u = jc.createUnmarshaller();
FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) );

// marshal to System.out
Marshaller m = jc.createMarshaller();
m.marshal( fooObj, System.out );

验证

自 JAXB 1.0 以后，验证已经发生了很大的变化。Validator 类已经废弃，成为了一个可选项。这意味着建议您不要使用此类，实际上，根据您的 JAXB 提供者，该类甚至根本不可用。在 JAXB 1.0 运行时系统上进行部署时，依赖 Validator 的 JAXB 1.0 客户端仍然可以正常工作。在 JAXB 2.0 中，Unmarshaller 已包括一些公开 JAXP 1.3 javax.xml.validation 框架的便捷方法。有关详细信息，请参阅 setSchema(javax.xml.validation.Schema) API。

JAXB 运行时绑定框架的兼容性

以下 JAXB 1.0 限制仅适用于将模式绑定到接口/实现类。因为此绑定不需要通用的运行时系统，所以 JAXB 客户端应用程序不必尝试混合使用不同的提供者提供的运行时对象（JAXBContext、Marshaller 等）。这并不意味着客户端应用程序是不可移植的，只是意味着客户端必须使用由用来编译模式的同一提供者提供的运行时系统。
version
en
$Revision: 1.24 $ $Date: 2006/03/08 17:05:01 $
since | JAXB1.0
See also | javax.xml.bind.Marshaller, javax.xml.bind.Unmarshaller, S 7.4.1.1 "Package Annotations" in Java Language Specification, 3rd Edition
英文文档：

The JAXBContext class provides the client's entry point to the JAXB API. It provides an abstraction for managing the XML/Java binding information necessary to implement the JAXB binding framework operations: unmarshal, marshal and validate.

A client application normally obtains new instances of this class using one of these two styles for newInstance methods, although there are other specialized forms of the method available:

  • JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )
    The JAXBContext instance is initialized from a list of colon separated Java package names. Each java package contains JAXB mapped classes, schema-derived classes and/or user annotated classes. Additionally, the java package may contain JAXB package annotations that must be processed. (see JLS 3rd Edition, Section 7.4.1. Package Annotations).
  • JAXBContext.newInstance( com.acme.foo.Foo.class )
    The JAXBContext instance is intialized with class(es) passed as parameter(s) and classes that are statically reachable from these class(es). See newInstance(Class...) for details.

SPEC REQUIREMENT: the provider must supply an implementation class containing the following method signatures:
 public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException
 public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException

The following JAXB 1.0 requirement is only required for schema to java interface/implementation binding. It does not apply to JAXB annotated classes. JAXB Providers must generate a jaxb.properties file in each package containing schema derived classes. The property file must contain a property named javax.xml.bind.context.factory whose value is the name of the class that implements the createContext APIs.

The class supplied by the provider does not have to be assignable to javax.xml.bind.JAXBContext, it simply has to provide a class that implements the createContext APIs.

In addition, the provider must call the DatatypeConverter.setDatatypeConverter api prior to any client invocations of the marshal and unmarshal methods. This is necessary to configure the datatype converter that will be used during these operations.

Unmarshalling

The Unmarshaller class provides the client application the ability to convert XML data into a tree of Java content objects. The unmarshal method allows for any global XML element declared in the schema to be unmarshalled as the root of an instance document. Additionally, the unmarshal method allows for an unrecognized root element that has an xsi:type attribute's value that references a type definition declared in the schema to be unmarshalled as the root of an instance document. The JAXBContext object allows the merging of global elements and type definitions across a set of schemas (listed in the contextPath). Since each schema in the schema set can belong to distinct namespaces, the unification of schemas to an unmarshalling context should be namespace independent. This means that a client application is able to unmarshal XML documents that are instances of any of the schemas listed in the contextPath. For example:
        JAXBContext jc = JAXBContext.newInstance( "com.acme.foo:com.acme.bar" );
        Unmarshaller u = jc.createUnmarshaller();
        FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) ); // ok
        BarObject barObj = (BarObject)u.unmarshal( new File( "bar.xml" ) ); // ok
        BazObject bazObj = (BazObject)u.unmarshal( new File( "baz.xml" ) ); // error, "com.acme.baz" not in contextPath

The client application may also generate Java content trees explicitly rather than unmarshalling existing XML data. For all JAXB-annotated value classes, an application can create content using constructors. For schema-derived interface/implementation classes and for the creation of elements that are not bound to a JAXB-annotated class, an application needs to have access and knowledge about each of the schema derived ObjectFactory classes that exist in each of java packages contained in the contextPath. For each schema derived java class, there is a static factory method that produces objects of that type. For example, assume that after compiling a schema, you have a package com.acme.foo that contains a schema derived interface named PurchaseOrder. In order to create objects of that type, the client application would use the factory method like this:

       com.acme.foo.PurchaseOrder po =
           com.acme.foo.ObjectFactory.createPurchaseOrder();

Once the client application has an instance of the the schema derived object, it can use the mutator methods to set content on it.

For more information on the generated ObjectFactory classes, see Section 4.2 Java Package of the specification.

SPEC REQUIREMENT: the provider must generate a class in each package that contains all of the necessary object factory methods for that package named ObjectFactory as well as the static newInstance( javaContentInterface ) method

Marshalling

The Marshaller class provides the client application the ability to convert a Java content tree back into XML data. There is no difference between marshalling a content tree that is created manually using the factory methods and marshalling a content tree that is the result an unmarshal operation. Clients can marshal a java content tree back to XML data to a java.io.OutputStream or a java.io.Writer. The marshalling process can alternatively produce SAX2 event streams to a registered ContentHandler or produce a DOM Node object. Client applications have control over the output encoding as well as whether or not to marshal the XML data as a complete document or as a fragment.

Here is a simple example that unmarshals an XML document and then marshals it back out:

        JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );

        // unmarshal from foo.xml
        Unmarshaller u = jc.createUnmarshaller();
        FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) );

        // marshal to System.out
        Marshaller m = jc.createMarshaller();
        m.marshal( fooObj, System.out );

Validation

Validation has been changed significantly since JAXB 1.0. The Validator class has been deprecated and made optional. This means that you are advised not to use this class and, in fact, it may not even be available depending on your JAXB provider. JAXB 1.0 client applications that rely on Validator will still work properly when deployed with the JAXB 1.0 runtime system. In JAXB 2.0, the Unmarshaller has included convenince methods that expose the JAXP 1.3 javax.xml.validation framework. Please refer to the Unmarshaller.setSchema(javax.xml.validation.Schema) API for more information.

JAXB Runtime Binding Framework Compatibility

The following JAXB 1.0 restriction only applies to binding schema to interfaces/implementation classes. Since this binding does not require a common runtime system, a JAXB client application must not attempt to mix runtime objects (JAXBContext, Marshaller, etc. ) from different providers. This does not mean that the client application isn't portable, it simply means that a client has to use a runtime system provided by the same provider that was used to compile the schema.

Since:
JAXB1.0
Version:
$Revision: 1.24 $ $Date: 2006/03/08 17:05:01 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
Marshaller, Unmarshaller, S 7.4.1.1 "Package Annotations" in Java Language Specification, 3rd Edition

Field Summary
static String JAXB_CONTEXT_FACTORY
The name of the property that contains the name of the class capable of creating new JAXBContext objects.
Constructor Summary
protected JAXBContext()
Method Summary
 Binder<Node> createBinder()
Creates a Binder for W3C DOM.
<T> Binder<T>
createBinder(Class<T> domType)
Creates a Binder object that can be used for associative/in-place unmarshalling/marshalling.
 JAXBIntrospector createJAXBIntrospector()
Creates a JAXBIntrospector object that can be used to introspect JAXB objects.
abstract  Marshaller createMarshaller()
Create a Marshaller object that can be used to convert a java content tree into XML data.
abstract  Unmarshaller createUnmarshaller()
Create an Unmarshaller object that can be used to convert XML data into a java content tree.
abstract  Validator createValidator()
Deprecated. since JAXB2.0
 void generateSchema(SchemaOutputResolver outputResolver)
Generates the schema documents for this context.
static JAXBContext newInstance(Class... classesToBeBound)
Obtain a new instance of a JAXBContext class.
static JAXBContext newInstance(Class[] classesToBeBound, Map<String,?> properties)
Obtain a new instance of a JAXBContext class.
static JAXBContext newInstance(String contextPath)
Obtain a new instance of a JAXBContext class.
static JAXBContext newInstance(String contextPath, ClassLoader classLoader)
Obtain a new instance of a JAXBContext class.
static JAXBContext newInstance(String contextPath, ClassLoader classLoader, Map<String,?> properties)
Obtain a new instance of a JAXBContext class.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

JAXB_CONTEXT_FACTORY

public static final String JAXB_CONTEXT_FACTORY
The name of the property that contains the name of the class capable of creating new JAXBContext objects.

See Also:
Constant Field Values
Constructor Detail

protected JAXBContext()
英文文档：

JAXBContext

protected JAXBContext()
Method Detail

public static JAXBContext newInstance(String contextPath) throws JAXBException

获得 JAXBContext 类的新实例。

这是 newInstance 方法的一个便捷方法。它使用当前线程的上下文类加载器。要指定如何使用不同的类加载器，可以通过 Thread.setContextClassLoader() api 设置它，或者使用 newInstance 方法。

Throws JAXBException: 如果在创建 JAXBContext 时遇到错误，比如：
  1. 在包中查找 ObjectFactory.class 或 jaxb.index 失败
  2. 包含在 contextPath 中的全局元素之间出现混淆
  3. 查找上下文工厂提供者属性的值失败
  4. 混合使用相同 contextPath 上的不同提供者的模式派生包
英文文档：

newInstance

public static JAXBContext newInstance(String contextPath)
                               throws JAXBException

Obtain a new instance of a JAXBContext class.

This is a convenience method for the newInstance method. It uses the context class loader of the current thread. To specify the use of a different class loader, either set it via the Thread.setContextClassLoader() api or use the newInstance method.

Throws:
JAXBException - if an error was encountered while creating the JAXBContext such as
  1. failure to locate either ObjectFactory.class or jaxb.index in the packages
  2. an ambiguity among global elements contained in the contextPath
  3. failure to locate a value for the context factory provider property
  4. mixing schema derived packages from different providers on the same contextPath

public static JAXBContext newInstance(String contextPath, ClassLoader classLoader) throws JAXBException

获得 JAXBContext 类的新实例。

客户端应用程序必须提供上下文路径，该路径是一个冒号 (':', :) 分隔的 java 包名称列表，它包含模式派生类和/或完全限定的 JAXB 注释类。模式派生的代码是通过为每个包生成的 ObjectFactory.class 在 JAXBContext 中注册的。程序员注释的 JAXB 映射类在 jaxb.index 资源文件中列出，而不是在上下文路径中列出，列出这些类所采用的格式如下所述。注意，java 包可以包含模式派生类和用户注释 JAXB 类。此外，java 包可能包含必须处理的 JAXB 包注释。（请参阅 JLS 第 3 版的第 7.4.1 节“包注释”）。

每个 contextPath 上列出的包都必须满足下面的一个或两个条件，否则将抛出 JAXBException：

  1. 必须包含 ObjectFactory.class
  2. 必须包含 jaxb.index

jaxb.index 的格式

该文件应该包含换行符分隔的类名称列表。空格、制表符和空行被忽略。注释字符是 '#' (0x23)；每行上的第一个注释字符后面的所有字符都被忽略。文件必须使用 UTF-8 编码。从列出的类中获得的类也可以在 JAXBContext 中注册，正如 #newInstance(Class...) 定义的那样。

对 jaxb.index 文件中出现的类名称的限制是：

  • 不一定以 ".class" 结尾。
  • 类名称与包含 jaxb.index 文件的包相关。只允许使用直接出现在包含 jaxb.index 文件的包中的类。
  • 不允许使用完全限定的类名称。只允许与当前包相关的限定类名称指定一个嵌套类或内部类。

为了维护与将 JAXB 1.0 模式绑定到 java 接口/实现的兼容（可通过将模式自定义为 jaxb:globalBindings valueClass="false" 来启用此绑定）, JAXB 提供者需要确保上下文路径上的每个包都有一个 jaxb.properties 文件，该文件包含一个 javax.xml.bind.context.factory 属性值，以及解析为相同提供者的所有值。

此要求不适用于 JAXB 注释类。如果 contextPath 上列出的各种包之间存在任何全局 XML 元素名称冲突，则将抛出 JAXBException。

在相同的上下文路径中混合使用从多个 JAXB 提供者中生成的接口/实现绑定可能导致抛出 JAXBException。

contextPath | 包含模式派生类和/或 java 模式（JAXB 注释）映射类的 java 包名称的列表
classLoader | 此类加载器将用于定位实现类。
return | 新的 JAXBContext 实例
Throws JAXBException: 如果在创建 JAXBContext 时遇到错误，比如：
  1. 在包中查找 ObjectFactory.class 或 jaxb.index 失败
  2. 包含在 contextPath 中的全局元素之间出现混淆
  3. 查找上下文工厂提供者属性的值失败
  4. 混合使用相同 contextPath 上的不同提供者的模式派生包
英文文档：

newInstance

public static JAXBContext newInstance(String contextPath,
                                      ClassLoader classLoader)
                               throws JAXBException

Obtain a new instance of a JAXBContext class.

The client application must supply a context path which is a list of colon (':', \u003A) separated java package names that contain schema-derived classes and/or fully qualified JAXB-annotated classes. Schema-derived code is registered with the JAXBContext by the ObjectFactory.class generated per package. Alternatively than being listed in the context path, programmer annotated JAXB mapped classes can be listed in a jaxb.index resource file, format described below. Note that a java package can contain both schema-derived classes and user annotated JAXB classes. Additionally, the java package may contain JAXB package annotations that must be processed. (see JLS 3rd Edition, Section 7.4.1. "Package Annotations").

Every package listed on the contextPath must meet one or both of the following conditions otherwise a JAXBException will be thrown:

  1. it must contain ObjectFactory.class
  2. it must contain jaxb.index

Format for jaxb.index

The file contains a newline-separated list of class names. Space and tab characters, as well as blank lines, are ignored. The comment character is '#' (0x23); on each line all characters following the first comment character are ignored. The file must be encoded in UTF-8. Classes that are reachable, as defined in newInstance(Class...), from the listed classes are also registered with JAXBContext.

Constraints on class name occuring in a jaxb.index file are:

  • Must not end with ".class".
  • Class names are resolved relative to package containing jaxb.index file. Only classes occuring directly in package containing jaxb.index file are allowed.
  • Fully qualified class names are not allowed. A qualified class name,relative to current package, is only allowed to specify a nested or inner class.

To maintain compatibility with JAXB 1.0 schema to java interface/implementation binding, enabled by schema customization , the JAXB provider will ensure that each package on the context path has a jaxb.properties file which contains a value for the javax.xml.bind.context.factory property and that all values resolve to the same provider. This requirement does not apply to JAXB annotated classes.

If there are any global XML element name collisions across the various packages listed on the contextPath, a JAXBException will be thrown.

Mixing generated interface/impl bindings from multiple JAXB Providers in the same context path may result in a JAXBException being thrown.

Parameters:
contextPath - list of java package names that contain schema derived class and/or java to schema (JAXB-annotated) mapped classes
classLoader - This class loader will be used to locate the implementation classes.
Returns:
a new instance of a JAXBContext
Throws:
JAXBException - if an error was encountered while creating the JAXBContext such as
  1. failure to locate either ObjectFactory.class or jaxb.index in the packages
  2. an ambiguity among global elements contained in the contextPath
  3. failure to locate a value for the context factory provider property
  4. mixing schema derived packages from different providers on the same contextPath

英文文档：

newInstance

public static JAXBContext newInstance(String contextPath,
                                      ClassLoader classLoader,
                                      Map<String,?> properties)
                               throws JAXBException

Obtain a new instance of a JAXBContext class.

This is mostly the same as newInstance(String, ClassLoader), but this version allows you to pass in provider-specific properties to configure the instanciation of JAXBContext.

The interpretation of properties is up to implementations.

Parameters:
contextPath - list of java package names that contain schema derived classes
classLoader - This class loader will be used to locate the implementation classes.
properties - provider-specific properties
Returns:
a new instance of a JAXBContext
Throws:
JAXBException - if an error was encountered while creating the JAXBContext such as
  1. failure to locate either ObjectFactory.class or jaxb.index in the packages
  2. an ambiguity among global elements contained in the contextPath
  3. failure to locate a value for the context factory provider property
  4. mixing schema derived packages from different providers on the same contextPath
Since:
JAXB2.0

public static JAXBContext newInstance(Class<T>[] classesToBeBound) throws JAXBException

获得 JAXBContext 类的新实例。

客户端应用程序必须提供新上下文对象需要识别的类的列表。 新的上下文不仅要识别所有指定的类，还要识别直接/间接从指定类中静态引用的所有类。所引用类的子类或 @XmlTransient 引用类都不用在 JAXBContext 中注册。例如，在下面的 Java 代码中，如果执行 newInstance(Foo.class)，则新创建的 JAXBContext 将识别 Foo 和 Bar，但不识别 Zot 或 FooBar：

 class Foo {
      @XmlTransient FooBar c;
      Bar b;
 }
 class Bar { int x; }
 class Zot extends Bar { int y; }
 class FooBar { }
因此，典型的客户端应用程序只需指定最高层类，但需要小心。

注意，对于每个在 JAXBContext 中注册的 java 包，当存在可选的包注释时，必须对它们进行处理。（请参阅 JLS 第 3 版的第 7.4.1 节“包注释”）。

classesToBeBound | 将通过新 JAXBContext 识别的 java 类的列表。可以为空，在这种情况下，将返回只知道规范中定义的类的 JAXBContext。
return | 新的 JAXBContext 实例。该实例始终是一个非 null 的有效对象。
Throws JAXBException: 如果创建 JAXBContext 时遇到错误（但不限于这些错误），如下所示：
  1. 未发现任何 JAXB 实现
  2. 类以不正确的方式使用了 JAXB 注释
  3. 类包含有冲突的注释（比如有相同类型名称的两个类）
  4. JAXB 实现不能查找特定于提供者的带外信息（例如在开发时生成的附加文件）。
Throws | IllegalArgumentException: 如果参数中包含 null（即 newInstance(null);）
since | JAXB2.0
英文文档：

newInstance

public static JAXBContext newInstance(Class... classesToBeBound)
                               throws JAXBException

Obtain a new instance of a JAXBContext class.

The client application must supply a list of classes that the new context object needs to recognize. Not only the new context will recognize all the classes specified, but it will also recognize any classes that are directly/indirectly referenced statically from the specified classes. Subclasses of referenced classes nor @XmlTransient referenced classes are not registered with JAXBContext. For example, in the following Java code, if you do newInstance(Foo.class), the newly created JAXBContext will recognize both Foo and Bar, but not Zot or FooBar:

 class Foo {
      @XmlTransient FooBar c;
      Bar b;
 }
 class Bar { int x; }
 class Zot extends Bar { int y; }
 class FooBar { }
Therefore, a typical client application only needs to specify the top-level classes, but it needs to be careful.

Note that for each java package registered with JAXBContext, when the optional package annotations exist, they must be processed. (see JLS 3rd Edition, Section 7.4.1. "Package Annotations").

Parameters:
classesToBeBound - list of java classes to be recognized by the new JAXBContext. Can be empty, in which case a JAXBContext that only knows about spec-defined classes will be returned.
Returns:
A new instance of a JAXBContext. Always non-null valid object.
Throws:
JAXBException - if an error was encountered while creating the JAXBContext, such as (but not limited to):
  1. No JAXB implementation was discovered
  2. Classes use JAXB annotations incorrectly
  3. Classes have colliding annotations (i.e., two classes with the same type name)
  4. The JAXB implementation was unable to locate provider-specific out-of-band information (such as additional files generated at the development time.)
IllegalArgumentException - if the parameter contains null (i.e., newInstance(null);)
Since:
JAXB2.0

英文文档：

newInstance

public static JAXBContext newInstance(Class[] classesToBeBound,
                                      Map<String,?> properties)
                               throws JAXBException

Obtain a new instance of a JAXBContext class.

An overloading of newInstance(Class...) to configure 'properties' for this instantiation of JAXBContext.

The interpretation of properties is implementation specific.

Parameters:
classesToBeBound - list of java classes to be recognized by the new JAXBContext. Can be empty, in which case a JAXBContext that only knows about spec-defined classes will be returned.
Returns:
A new instance of a JAXBContext. Always non-null valid object.
Throws:
JAXBException - if an error was encountered while creating the JAXBContext, such as (but not limited to):
  1. No JAXB implementation was discovered
  2. Classes use JAXB annotations incorrectly
  3. Classes have colliding annotations (i.e., two classes with the same type name)
  4. The JAXB implementation was unable to locate provider-specific out-of-band information (such as additional files generated at the development time.)
IllegalArgumentException - if the parameter contains null (i.e., newInstance(null);)
Since:
JAXB2.0

abstract public Unmarshaller createUnmarshaller() throws JAXBException
创建一个可以用来将 XML 数据转换为 java 内容树的 Unmarshaller 对象。
return | Unmarshaller 对象
Throws | JAXBException: 如果创建 Unmarshaller 对象时遇到错误
英文文档：

createUnmarshaller

public abstract Unmarshaller createUnmarshaller()
                                         throws JAXBException
Create an Unmarshaller object that can be used to convert XML data into a java content tree.

Returns:
an Unmarshaller object
Throws:
JAXBException - if an error was encountered while creating the Unmarshaller object

abstract public Marshaller createMarshaller() throws JAXBException
创建一个可以用来将 java 内容树转换为 XML 数据的 Marshaller 对象。
return | Marshaller 对象
Throws | JAXBException: 如果创建 Marshaller 对象时遇到错误
英文文档：

createMarshaller

public abstract Marshaller createMarshaller()
                                     throws JAXBException
Create a Marshaller object that can be used to convert a java content tree into XML data.

Returns:
a Marshaller object
Throws:
JAXBException - if an error was encountered while creating the Marshaller object

abstract public Validator createValidator() throws JAXBException
Validator 已成为一个可选项，并且在 JAXB 2.0 中已过时。有关详细信息，请参阅 Validator 的 javadoc。

创建一个可用于根据源模式验证 java 内容树的 Validator 对象。

return | 一个 Validator 对象
Throws | JAXBException: 如果创建 Validator 对象时遇到错误
deprecated | 从 JAXB 2.0 开始
英文文档：

createValidator

public abstract Validator createValidator()
                                   throws JAXBException
Deprecated. since JAXB2.0

Validator has been made optional and deprecated in JAXB 2.0. Please refer to the javadoc for Validator for more detail.

Create a Validator object that can be used to validate a java content tree against its source schema.

Returns:
a Validator object
Throws:
JAXBException - if an error was encountered while creating the Validator object

英文文档：

createBinder

public <T> Binder<T> createBinder(Class<T> domType)
Creates a Binder object that can be used for associative/in-place unmarshalling/marshalling.

Parameters:
domType - select the DOM API to use by passing in its DOM Node class.
Returns:
always a new valid Binder object.
Throws:
UnsupportedOperationException - if DOM API corresponding to domType is not supported by the implementation.
Since:
JAXB2.0

public Binder createBinder()
为 W3C DOM 创建一个 Binder。
return | 总是返回新的有效 Binder 对象。
since | JAXB2.0
英文文档：

createBinder

public Binder<Node> createBinder()
Creates a Binder for W3C DOM.

Returns:
always a new valid Binder object.
Since:
JAXB2.0

public JAXBIntrospector createJAXBIntrospector()
创建一个可以用于内省 JAXB 对象的 JAXBIntrospector 对象。
return | 总是返回非 null 的有效 JAXBIntrospector 对象。
Throws | UnsupportedOperationException: 在 JAXB 1.0 实现上调用此方法将抛出 UnsupportedOperationException。
since | JAXB2.0
英文文档：

createJAXBIntrospector

public JAXBIntrospector createJAXBIntrospector()
Creates a JAXBIntrospector object that can be used to introspect JAXB objects.

Returns:
always return a non-null valid JAXBIntrospector object.
Throws:
UnsupportedOperationException - Calling this method on JAXB 1.0 implementations will throw an UnsupportedOperationException.
Since:
JAXB2.0

public void generateSchema(SchemaOutputResolver outputResolver) throws java.io.IOException
生成此上下文的模式文档。
outputResolver | 此对象控制模式将被发送的输出。
Throws | java.io.IOException: 如果 SchemaOutputResolver 抛出 IOException。
Throws | UnsupportedOperationException: 在 JAXB 1.0 实现上调用此方法将抛出 UnsupportedOperationException。
since | JAXB 2.0
英文文档：

generateSchema

public void generateSchema(SchemaOutputResolver outputResolver)
                    throws IOException
Generates the schema documents for this context.

Parameters:
outputResolver - this object controls the output to which schemas will be sent.
Throws:
IOException - if SchemaOutputResolver throws an IOException.
UnsupportedOperationException - Calling this method on JAXB 1.0 implementations will throw an UnsupportedOperationException.
Since:
JAXB 2.0
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXBElement (Java EE 5)

javax.xml.bind
Class JAXBElement<T>

java.lang.Object
    extended by  javax.xml.bind.JAXBElement<T>
All Implemented Interfaces:
Serializable
public class JAXBElement<T>
extends Object
implements Serializable

Implements: java.io.Serializable
Inner classes: JAXBElement.GlobalScope

Xml 元素的 JAXB 表示形式。

此类表示关于 Xml 元素的信息，这些信息包括模式中的元素声明，以及具有以下属性的 xml 文档中的元素实例值，如下所示：

  • 元素的 xml 标记 name
  • value 表示元素实例的属性和内容模式
  • 元素声明的 declaredType（xs:element @type 属性）
  • 元素声明的 scope
  • boolean 值形式的 nil 属性。（元素实例的 xsi:nil 属性）

declaredType 和 scope 属性是 xml 类型定义的 JAXB 类绑定。

Scope 可以是 GlobalScope，也可以是表示包含模式元素声明的复杂类型定义的 Java 类。

这里有一个属性约束，即如果 value 为 null，则 nil 一定为 true。反之则不然，以支持表示包含属性的 nil 元素。如果 nil 为 true，则 value 可能为非 null，这样它可以保存与 nil 元素关联的属性值。

since JAXB 2.0
英文文档：

JAXB representation of an Xml Element.

This class represents information about an Xml Element from both the element declaration within a schema and the element instance value within an xml document with the following properties

  • element's xml tag name
  • value represents the element instance's atttribute(s) and content model
  • element declaration's declaredType (xs:element @type attribute)
  • scope of element declaration
  • boolean nil property. (element instance's xsi:nil attribute)

The declaredType and scope property are the JAXB class binding for the xml type definition.

Scope is either JAXBElement.GlobalScope or the Java class representing the complex type definition containing the schema element declaration.

There is a property constraint that if value is null, then nil must be true. The converse is not true to enable representing a nil element with attribute(s). If nil is true, it is possible that value is non-null so it can hold the value of the attributes associated with a nil element.

Since:
JAXB 2.0
Author:
Kohsuke Kawaguchi, Joe Fialli
See Also:
Serialized Form

Nested Class Summary
static class JAXBElement.GlobalScope
Designates global scope for an xml element.
Field Summary
protected Class<T> | declaredType Java datatype binding for xml element declaration's type.
protected QName | name xml element tag name
protected boolean | nil true iff the xml element instance has xsi:nil="true".
protected Class | scope Scope of xml element declaration representing this xml element instance.
protected T | value xml element value.
Constructor Summary
JAXBElement(QName name, Class<T> declaredType, Class scope, T value)
Construct an xml element instance.
JAXBElement(QName name, Class<T> declaredType, T value)
Construct an xml element instance.
Method Summary
Class<T> | getDeclaredType() Returns the Java binding of the xml element declaration's type attribute.
QName | getName() Returns the xml element tag name.
Class | getScope() Returns scope of xml element declaration.
T | getValue() Return the content model and attribute values for this element.
boolean | isGlobalScope() Returns true iff this xml element declaration is global.
boolean | isNil() Returns true iff this element instance content model is nil.
boolean | isTypeSubstituted() Returns true iff this xml element instance's value has a different type than xml element declaration's declared type.
void | setNil(boolean value) Set whether this element has nil content.
void | setValue(T t) Set the content model and attributes of this xml element.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

name

protected final QName name
xml element tag name

英文文档：

declaredType

protected final Class<T> declaredType
Java datatype binding for xml element declaration's type.

英文文档：

scope

protected final Class scope
Scope of xml element declaration representing this xml element instance. Can be one of the following values: - JAXBElement.GlobalScope for global xml element declaration. - local element declaration has a scope set to the Java class representation of complex type defintion containing xml element declaration.

英文文档：

value

protected T value
xml element value. Represents content model and attributes of an xml element instance.

英文文档：

nil

protected boolean nil
true iff the xml element instance has xsi:nil="true".

Constructor Detail

英文文档：

JAXBElement

public JAXBElement(QName name,
                   Class<T> declaredType,
                   Class scope,
                   T value)

Construct an xml element instance.

Parameters:
name - Java binding of xml element tag name
declaredType - Java binding of xml element declaration's type
scope - Java binding of scope of xml element declaration. Passing null is the same as passing GlobalScope.class
value - Java instance representing xml element's value.
See Also:
getScope(), isTypeSubstituted()

英文文档：

JAXBElement

public JAXBElement(QName name,
                   Class<T> declaredType,
                   T value)
Construct an xml element instance. This is just a convenience method for new JAXBElement(name,declaredType,GlobalScope.class,value)

Method Detail

public Class<T> getDeclaredType()
返回 xml 元素声明的类型属性的 Java 绑定。
英文文档：

getDeclaredType

public Class<T> getDeclaredType()
Returns the Java binding of the xml element declaration's type attribute.

public javax.xml.namespace.QName getName()
返回 xml 元素标记名称。
英文文档：

getName

public QName getName()
Returns the xml element tag name.

英文文档：

setValue

public void setValue(T t)

Set the content model and attributes of this xml element.

When this property is set to null, isNil() must by true. Details of constraint are described at isNil().

See Also:
isTypeSubstituted()

public Object getValue()

返回此元素的内容模式和属性值。

关于此值为 null 时的属性约束的描述，请参见 #isNil()。

英文文档：

getValue

public T getValue()

Return the content model and attribute values for this element.

See isNil() for a description of a property constraint when this value is null

public Class<T> getScope()
返回 xml 元素声明的作用域。
return | 如果此元素位于全局作用域中，则返回 GlobalScope.class。
See also | isGlobalScope()
英文文档：

getScope

public Class getScope()
Returns scope of xml element declaration.

Returns:
GlobalScope.class if this element is of global scope.
See Also:
isGlobalScope()

public boolean isNil()

如果此元素实例内容模式为 nil，则返回 true。

当 #getValue() 为 null 时，此属性总是返回 true。注意，反之则不然，当此属性为 true 时，#getValue() 可以包含非 null 属性值。对于 nil xml 元素，包含属性是有效的。

英文文档：

isNil

public boolean isNil()

Returns true iff this element instance content model is nil.

This property always returns true when getValue() is null. Note that the converse is not true, when this property is true, getValue() can contain a non-null value for attribute(s). It is valid for a nil xml element to have attribute(s).

public void setNil(boolean value)

设置此属性是否包含 nil 内容。

See also isNil()
英文文档：

setNil

public void setNil(boolean value)

Set whether this element has nil content.

See Also:
isNil()

public boolean isGlobalScope()
如果此 xml 元素声明是全局性的，则返回 true。
英文文档：

isGlobalScope

public boolean isGlobalScope()
Returns true iff this xml element declaration is global.

public boolean isTypeSubstituted()
如果此 xml 元素实例的值的类型与 xml 元素声明的声明类型不同，则返回 true。
英文文档：

isTypeSubstituted

public boolean isTypeSubstituted()
Returns true iff this xml element instance's value has a different type than xml element declaration's declared type.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXBElement.GlobalScope (Java EE 5)

javax.xml.bind
Class JAXBElement.GlobalScope

java.lang.Object
    extended by  javax.xml.bind.JAXBElement.GlobalScope
Enclosing class:
JAXBElement<T>
public static final class JAXBElement.GlobalScope
extends Object

Contained within: JAXBElement

为 xml 元素指定全局作用域。
英文文档：

Designates global scope for an xml element.

Constructor Summary
JAXBElement.GlobalScope()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JAXBElement.GlobalScope()
英文文档：

JAXBElement.GlobalScope

public JAXBElement.GlobalScope()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXBIntrospector (Java EE 5)

javax.xml.bind
Class JAXBIntrospector

java.lang.Object
    extended by  javax.xml.bind.JAXBIntrospector

public abstract class JAXBIntrospector
extends Object

提供对 JAXB 对象的 JAXB xml 绑定数据的访问。

最初，此类只用于从概念上说明 JAXB 应用程序开发人员如何访问 xml 绑定信息，与绑定模型是从 java 到 schema 还是从 schema 到 java 无关。由于访问与 JAXB 元素相关的 XML 元素名称是经常被请求的功能，所以我们将演示如何访问此绑定信息。获取 JAXBIntrospector 实例的工厂方法是 createJAXBIntrospector()。

since | JAXB2.0
See also | createJAXBIntrospector()
英文文档：

Provide access to JAXB xml binding data for a JAXB object.

Intially, the intent of this class is to just conceptualize how a JAXB application developer can access xml binding information, independent if binding model is java to schema or schema to java. Since accessing the XML element name related to a JAXB element is a highly requested feature, demonstrate access to this binding information. The factory method to get a JAXBIntrospector instance is JAXBContext.createJAXBIntrospector().

Since:
JAXB2.0
See Also:
JAXBContext.createJAXBIntrospector()

Constructor Summary
JAXBIntrospector()
Method Summary
abstract QName | getElementName(Object jaxbElement) Get xml element qname for jaxbElement.
static Object | getValue(Object jaxbElement) Get the element value of a JAXB element.
abstract boolean | isElement(Object object) Return true iff object represents a JAXB element.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JAXBIntrospector()
英文文档：

JAXBIntrospector

public JAXBIntrospector()
Method Detail

abstract public boolean isElement(Object object)

如果 object 表示一个 JAXB 元素，则返回 true。

在以下情况中，参数 object 是一个 JAXB 元素：

  1. 它是 javax.xml.bind.JAXBElement 的实例。
  2. object 的类是使用 @ 注释的。
See also getElementName(Object)
英文文档：

isElement

public abstract boolean isElement(Object object)

Return true iff object represents a JAXB element.

Parameter object is a JAXB element for following cases:

  1. It is an instance of javax.xml.bind.JAXBElement.
  2. The class of object is annotated with @XmlRootElement.

See Also:
getElementName(Object)

abstract public javax.xml.namespace.QName getElementName(Object jaxbElement)

获取 jaxbElement 的 xml 元素 qname。

jaxbElement | #isElement(Object) 返回 true 的对象。
return | 与 jaxbElement 关联的 xml 元素 qname；如果 jaxbElement 不是 JAXB 元素，则返回 null。
英文文档：

getElementName

public abstract QName getElementName(Object jaxbElement)

Get xml element qname for jaxbElement.

Parameters:
jaxbElement - is an object that isElement(Object) returned true.
Returns:
xml element qname associated with jaxbElement; null if jaxbElement is not a JAXB Element.

public static Object getValue(Object jaxbElement)

获取 JAXB 元素的元素值。

对是与 javax.xml.bind.JAXBElement 实例一起使用还是与用 >@XmlRootElement 注释的 Java 类实例一起使用进行抽象的便捷方法。

jaxbElement | #isElement(Object) 返回 true 的对象。
return | jaxbElement 的元素值。
英文文档：

getValue

public static Object getValue(Object jaxbElement)

Get the element value of a JAXB element.

Convenience method to abstract whether working with either a javax.xml.bind.JAXBElement instance or an instance of @XmlRootElement annotated Java class.

Parameters:
jaxbElement - object that #isElement(Object) returns true.
Returns:
The element value of the jaxbElement.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SchemaOutputResolver (Java EE 5)

javax.xml.bind
Class SchemaOutputResolver

java.lang.Object
    extended by  javax.xml.bind.SchemaOutputResolver

public abstract class SchemaOutputResolver
extends Object

控制 JAXB 实现放置生成的模式文件的位置。

此抽象类的实现必须由生成模式的调用应用程序提供。

这是一个类，不是接口，这使得以后的版本可在不破坏兼容性的情况下进行改进。

英文文档：

Controls where a JAXB implementation puts the generates schema files.

An implementation of this abstract class has to be provided by the calling application to generate schemas.

This is a class, not an interface so as to allow future versions to evolve without breaking the compatibility.

Author:
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)

Constructor Summary
SchemaOutputResolver()
Method Summary
abstract  Result createOutput(String namespaceUri, String suggestedFileName)
Decides where the schema file (of the given namespace URI) will be written, and return it as a Result object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SchemaOutputResolver()
英文文档：

SchemaOutputResolver

public SchemaOutputResolver()
Method Detail

abstract public javax.xml.transform.Result createOutput(String namespaceUri, String suggestedFileName) throws java.io.IOException
确定写入模式文件（由给定名称空间 URI 指定）的位置，并以 Result 对象的形式返回它。

对于任何给定名称空间，此方法只调用一次。换句话说，一个名称空间中的所有组件总是写入相同的模式文档。

namespaceUri | 模式声明的名称空间 URI。可以为空字符串，但永远不能为 null。
suggestedFileName | JAXB 实现生成一个唯一文件名（如 "schema1.xsd"），以方便调用者使用。此名称可用于模式的文件名，或者调用者可以忽略此名称并提供自己的名称。这只是一个提示。
return | 封装实际的模式目的地的 Result 对象。 如果 Result 对象有系统 ID，则该 ID 必须是绝对系统 ID。这些系统 ID 是相对于调用者的，并且可用于 <xs:import> 语句。 如果 Result 对象没有系统 ID，则生成一个用于名称空间 URI 的模式，但它不能从其他模式显式地 <xs:import>。 如果返回 null，则跳过此名称空间 URI 的模式生成。
英文文档：

createOutput

public abstract Result createOutput(String namespaceUri,
                                    String suggestedFileName)
                             throws IOException
Decides where the schema file (of the given namespace URI) will be written, and return it as a Result object.

This method is called only once for any given namespace. IOW, all the components in one namespace is always written into the same schema document.

Parameters:
namespaceUri - The namespace URI that the schema declares. Can be the empty string, but never be null.
suggestedFileName - A JAXB implementation generates an unique file name (like "schema1.xsd") for the convenience of the callee. This name can be used for the file name of the schema, or the callee can just ignore this name and come up with its own name. This is just a hint.
Returns:
a Result object that encapsulates the actual destination of the schema. If the Result object has a system ID, it must be an absolute system ID. Those system IDs are relativized by the caller and used for <xs:import> statements. If the Result object does not have a system ID, a schema for the namespace URI is generated but it won't be explicitly <xs:import>ed from other schemas. If null is returned, the schema generation for this namespace URI will be skipped.
Throws:
IOException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXBException (Java EE 5)

javax.xml.bind
Class JAXBException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.bind.JAXBException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MarshalException, PropertyException, UnmarshalException, ValidationException
public class JAXBException
extends Exception

Extends: Throwable > Exception
Extended by: MarshalException, PropertyException, UnmarshalException, ValidationException

这是所有 JAXB 异常的根异常类。
version
en
$Revision: 1.1 $ $Date: 2004/12/14 21:50:39 $
since | JAXB1.0
See also | javax.xml.bind.JAXBContext, javax.xml.bind.Marshaller, javax.xml.bind.Unmarshaller
英文文档：

This is the root exception class for all JAXB exceptions.

Since:
JAXB1.0
Version:
$Revision: 1.1 $ $Date: 2004/12/14 21:50:39 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
JAXBContext, Marshaller, Unmarshaller, Serialized Form

Constructor Summary
JAXBException(String message)
Construct a JAXBException with the specified detail message.
JAXBException(String message, String errorCode)
Construct a JAXBException with the specified detail message and vendor specific errorCode.
JAXBException(String message, String errorCode, Throwable exception)
Construct a JAXBException with the specified detail message, vendor specific errorCode, and linkedException.
JAXBException(String message, Throwable exception)
Construct a JAXBException with the specified detail message and linkedException.
JAXBException(Throwable exception)
Construct a JAXBException with a linkedException.
Method Summary
Throwable | getCause()
String | getErrorCode() Get the vendor specific error code
Throwable | getLinkedException() Get the linked exception
void | printStackTrace() Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.
void | printStackTrace(PrintStream s) Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.
void | printStackTrace(PrintWriter s) Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintWriter.
void | setLinkedException(Throwable exception) Add a linked Exception.
String | toString() Returns a short description of this JAXBException.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public JAXBException(String message)
构造带指定详细消息的 JAXBException。errorCode 和 linkedException 将默认为 null。
message 对异常的描述
英文文档：

JAXBException

public JAXBException(String message)
Construct a JAXBException with the specified detail message. The errorCode and linkedException will default to null.

Parameters:
message - a description of the exception

public JAXBException(String message, String errorCode)
构造带指定详细消息和特定于供应商的 errorCode 的 JAXBException。linkedException 将默认为 null。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

JAXBException

public JAXBException(String message,
                     String errorCode)
Construct a JAXBException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code

public JAXBException(Throwable exception)
构造带有一个 linkedException 的 JAXBException。详细消息和特定于供应商的 errorCode 将默认为 null。
exception 链接的异常
英文文档：

JAXBException

public JAXBException(Throwable exception)
Construct a JAXBException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters:
exception - the linked exception

public JAXBException(String message, Throwable exception)
构造带指定的详细消息和 linkedException 的 JAXBException。errorCode 将默认为 null。
message | 对异常的描述
exception | 链接的异常
英文文档：

JAXBException

public JAXBException(String message,
                     Throwable exception)
Construct a JAXBException with the specified detail message and linkedException. The errorCode will default to null.

Parameters:
message - a description of the exception
exception - the linked exception

public JAXBException(String message, String errorCode, Throwable exception)
构造带指定的详细消息、特定于供应商的 errorCode 和 linkedException 的 JAXBException。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
exception | 链接的异常
英文文档：

JAXBException

public JAXBException(String message,
                     String errorCode,
                     Throwable exception)
Construct a JAXBException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception
Method Detail

public String getErrorCode()
获取特定于供应商的错误代码。
return 指定特定于供应商的错误代码的字符串
英文文档：

getErrorCode

public String getErrorCode()
Get the vendor specific error code

Returns:
a string specifying the vendor specific error code

public Throwable getLinkedException()
获取链接的异常。
return 链接的异常；如果不存在，则返回 null
英文文档：

getLinkedException

public Throwable getLinkedException()
Get the linked exception

Returns:
the linked Exception, null if none exists

public void setLinkedException(Throwable exception)
添加一个链接的异常。
exception 链接的异常（允许使用 null 值，该值指示链接的异常不存在或者是未知的）。
英文文档：

setLinkedException

public void setLinkedException(Throwable exception)
Add a linked Exception.

Parameters:
exception - the linked Exception (A null value is permitted and indicates that the linked exception does not exist or is unknown).

public String toString()
返回此 JAXBException 的简短描述。
英文文档：

toString

public String toString()
Returns a short description of this JAXBException.

Overrides:
toString in class Throwable

public void printStackTrace(java.io.PrintStream s)
打印此 JAXBException 及其对 PrintStream 的堆栈跟踪（如果为非 null，则包括该 linkedException 的堆栈跟踪）。
s 用于输出的 PrintStream
英文文档：

printStackTrace

public void printStackTrace(PrintStream s)
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintStream to use for output

public void printStackTrace()
打印此 JAXBException 及其对 System.err 的堆栈跟踪（如果为非 null，则包括 linkedException 的堆栈跟踪）。
英文文档：

printStackTrace

public void printStackTrace()
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.

Overrides:
printStackTrace in class Throwable

public void printStackTrace(java.io.PrintWriter s)
打印此 JAXBException 及其对 PrintWriter 的堆栈跟踪（如果为非 null，则包括该 linkedException 的堆栈跟踪）。
s 用于输出的 PrintWriter
英文文档：

printStackTrace

public void printStackTrace(PrintWriter s)
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintWriter.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintWriter to use for output

英文文档：

getCause

public Throwable getCause()
Overrides:
getCause in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MarshalException (Java EE 5)

javax.xml.bind
Class MarshalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.bind.JAXBException
                extended by  javax.xml.bind.MarshalException
All Implemented Interfaces:
Serializable
public class MarshalException
extends JAXBException

Extends: Throwable > Exception > JAXBException

此异常指示在执行提供者无法恢复的编组操作时发生错误。

ValidationEventHandler 可能导致执行编组操作期间抛出此异常。请参阅 ValidationEventHandler.handleEvent(ValidationEvent)。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.JAXBException, javax.xml.bind.Marshaller
英文文档：

This exception indicates that an error has occurred while performing a marshal operation that the provider is unable to recover from.

The ValidationEventHandler can cause this exception to be thrown during the marshal operations. See ValidationEventHandler.handleEvent(ValidationEvent).

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
JAXBException, Marshaller, Serialized Form

Constructor Summary
MarshalException(String message)
Construct a MarshalException with the specified detail message.
MarshalException(String message, String errorCode)
Construct a MarshalException with the specified detail message and vendor specific errorCode.
MarshalException(String message, String errorCode, Throwable exception)
Construct a MarshalException with the specified detail message, vendor specific errorCode, and linkedException.
MarshalException(String message, Throwable exception)
Construct a MarshalException with the specified detail message and linkedException.
MarshalException(Throwable exception)
Construct a MarshalException with a linkedException.
Method Summary
Methods inherited from class javax.xml.bind.JAXBException
getCause, getErrorCode, getLinkedException, printStackTrace, printStackTrace, printStackTrace, setLinkedException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public MarshalException(String message)
构造带指定详细消息的 MarshalException。errorCode 和 linkedException 将默认为 null。
message 对异常的描述
英文文档：

MarshalException

public MarshalException(String message)
Construct a MarshalException with the specified detail message. The errorCode and linkedException will default to null.

Parameters:
message - a description of the exception

public MarshalException(String message, String errorCode)
构造带指定详细消息和特定于供应商的 errorCode 的 MarshalException。linkedException 将默认为 null。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

MarshalException

public MarshalException(String message,
                        String errorCode)
Construct a MarshalException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code

public MarshalException(Throwable exception)
构造带有一个 linkedException 的 MarshalException。详细消息和特定于供应商的 errorCode 将默认为 null。
exception 链接的异常
英文文档：

MarshalException

public MarshalException(Throwable exception)
Construct a MarshalException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters:
exception - the linked exception

public MarshalException(String message, Throwable exception)
构造带指定的详细消息和 linkedException 的 MarshalException。errorCode 将默认为 null。
message | 对异常的描述
exception | 链接的异常
英文文档：

MarshalException

public MarshalException(String message,
                        Throwable exception)
Construct a MarshalException with the specified detail message and linkedException. The errorCode will default to null.

Parameters:
message - a description of the exception
exception - the linked exception

public MarshalException(String message, String errorCode, Throwable exception)
构造带指定的详细消息、特定于供应商的 errorCode 和 linkedException 的 MarshalException。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
exception | 链接的异常
英文文档：

MarshalException

public MarshalException(String message,
                        String errorCode,
                        Throwable exception)
Construct a MarshalException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PropertyException (Java EE 5)

javax.xml.bind
Class PropertyException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.bind.JAXBException
                extended by  javax.xml.bind.PropertyException
All Implemented Interfaces:
Serializable
public class PropertyException
extends JAXBException

Extends: Throwable > Exception > JAXBException

此异常指示在获取或设置属性时遇到一个错误。
version
en
$Revision: 1.1 $ $Date: 2004/12/14 21:50:40 $
since | JAXB1.0
See also | javax.xml.bind.JAXBContext, javax.xml.bind.Validator, javax.xml.bind.Unmarshaller
英文文档：

This exception indicates that an error was encountered while getting or setting a property.

Since:
JAXB1.0
Version:
$Revision: 1.1 $ $Date: 2004/12/14 21:50:40 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
JAXBContext, Validator, Unmarshaller, Serialized Form

Constructor Summary
PropertyException(String message)
Construct a PropertyException with the specified detail message.
PropertyException(String name, Object value)
Construct a PropertyException whose message field is set based on the name of the property and value.toString().
PropertyException(String message, String errorCode)
Construct a PropertyException with the specified detail message and vendor specific errorCode.
PropertyException(String message, String errorCode, Throwable exception)
Construct a PropertyException with the specified detail message, vendor specific errorCode, and linkedException.
PropertyException(String message, Throwable exception)
Construct a PropertyException with the specified detail message and linkedException.
PropertyException(Throwable exception)
Construct a PropertyException with a linkedException.
Method Summary
Methods inherited from class javax.xml.bind.JAXBException
getCause, getErrorCode, getLinkedException, printStackTrace, printStackTrace, printStackTrace, setLinkedException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public PropertyException(String message)
构造带指定详细消息的 PropertyException。errorCode 和 linkedException 将默认为 null。
message 对异常的描述
英文文档：

PropertyException

public PropertyException(String message)
Construct a PropertyException with the specified detail message. The errorCode and linkedException will default to null.

Parameters:
message - a description of the exception

public PropertyException(String message, String errorCode)
构造带指定详细消息和特定于供应商的 errorCode 的 PropertyException。linkedException 将默认为 null。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

PropertyException

public PropertyException(String message,
                         String errorCode)
Construct a PropertyException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code

public PropertyException(Throwable exception)
构造带有一个 linkedException 的 PropertyException。详细消息和特定于供应商的 errorCode 将默认为 null。
exception 链接的异常
英文文档：

PropertyException

public PropertyException(Throwable exception)
Construct a PropertyException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters:
exception - the linked exception

public PropertyException(String message, Throwable exception)
构造带指定详细消息和 linkedException 的 PropertyException。errorCode 将默认为 null。
message | 对异常的描述
exception | 链接的异常
英文文档：

PropertyException

public PropertyException(String message,
                         Throwable exception)
Construct a PropertyException with the specified detail message and linkedException. The errorCode will default to null.

Parameters:
message - a description of the exception
exception - the linked exception

public PropertyException(String message, String errorCode, Throwable exception)
构造带指定的详细消息、特定于供应商的 errorCode 和 linkedException 的 PropertyException。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
exception | 链接的异常
英文文档：

PropertyException

public PropertyException(String message,
                         String errorCode,
                         Throwable exception)
Construct a PropertyException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception

public PropertyException(String name, Object value)
构造一个基于属性名称和 value.toString() 设置其消息字段的 PropertyException。
name | 与此异常相关的属性的名称
value | 与此异常相关的属性的值
英文文档：

PropertyException

public PropertyException(String name,
                         Object value)
Construct a PropertyException whose message field is set based on the name of the property and value.toString().

Parameters:
name - the name of the property related to this exception
value - the value of the property related to this exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeConstraintException (Java EE 5)

javax.xml.bind
Class TypeConstraintException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.xml.bind.TypeConstraintException
All Implemented Interfaces:
Serializable
public class TypeConstraintException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException

此异常指示已检测到存在违反动态检查的类型约束的情况。

此异常可由生成的模式派生 Java 内容类的设置方法抛出。但是，由于快速修复验证是 JAXB 提供者支持的一项可选功能，所以并非所有设置方法都将在违反类型约束时抛出此异常。

如果在调用快速失败设置方法时抛出此异常，则要保证属性值保持不变，如同从未调用过该设置方法一样。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.ValidationEvent
英文文档：

This exception indicates that a violation of a dynamically checked type constraint was detected.

This exception can be thrown by the generated setter methods of the schema derived Java content classes. However, since fail-fast validation is an optional feature for JAXB Providers to support, not all setter methods will throw this exception when a type constraint is violated.

If this exception is throw while invoking a fail-fast setter, the value of the property is guaranteed to remain unchanged, as if the setter were never called.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
ValidationEvent, Serialized Form

Constructor Summary
TypeConstraintException(String message)
Construct a TypeConstraintException with the specified detail message.
TypeConstraintException(String message, String errorCode)
Construct a TypeConstraintException with the specified detail message and vendor specific errorCode.
TypeConstraintException(String message, String errorCode, Throwable exception)
Construct a TypeConstraintException with the specified detail message, vendor specific errorCode, and linkedException.
TypeConstraintException(String message, Throwable exception)
Construct a TypeConstraintException with the specified detail message and linkedException.
TypeConstraintException(Throwable exception)
Construct a TypeConstraintException with a linkedException.
Method Summary
String | getErrorCode() Get the vendor specific error code
Throwable | getLinkedException() Get the linked exception
void | printStackTrace() Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.
void | printStackTrace(PrintStream s) Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.
void | setLinkedException(Throwable exception) Add a linked Exception.
String | toString() Returns a short description of this TypeConstraintException.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public TypeConstraintException(String message)
构造带指定详细消息的 TypeConstraintException。errorCode 和 linkedException 将默认为 null。
message 对异常的描述
英文文档：

TypeConstraintException

public TypeConstraintException(String message)
Construct a TypeConstraintException with the specified detail message. The errorCode and linkedException will default to null.

Parameters:
message - a description of the exception

public TypeConstraintException(String message, String errorCode)
构造带指定详细消息和特定于供应商的 errorCode 的 TypeConstraintException。linkedException 将默认为 null。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

TypeConstraintException

public TypeConstraintException(String message,
                               String errorCode)
Construct a TypeConstraintException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code

public TypeConstraintException(Throwable exception)
构造带有一个 linkedException 的 TypeConstraintException。详细消息和特定于供应商的 errorCode 将默认为 null。
exception 链接的异常
英文文档：

TypeConstraintException

public TypeConstraintException(Throwable exception)
Construct a TypeConstraintException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters:
exception - the linked exception

public TypeConstraintException(String message, Throwable exception)
构造带指定详细消息和 linkedException 的 TypeConstraintException。errorCode 将默认为 null。
message | 对异常的描述
exception | 链接的异常
英文文档：

TypeConstraintException

public TypeConstraintException(String message,
                               Throwable exception)
Construct a TypeConstraintException with the specified detail message and linkedException. The errorCode will default to null.

Parameters:
message - a description of the exception
exception - the linked exception

public TypeConstraintException(String message, String errorCode, Throwable exception)
构造带指定的详细消息、特定于供应商的 errorCode 和 linkedException 的 TypeConstraintException。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
exception | 链接的异常
英文文档：

TypeConstraintException

public TypeConstraintException(String message,
                               String errorCode,
                               Throwable exception)
Construct a TypeConstraintException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception
Method Detail

public String getErrorCode()
获取特定于供应商的错误代码。
return 指定特定于供应商的错误代码的字符串
英文文档：

getErrorCode

public String getErrorCode()
Get the vendor specific error code

Returns:
a string specifying the vendor specific error code

public Throwable getLinkedException()
获取链接的异常。
return 链接的异常；如果不存在，则返回 null
英文文档：

getLinkedException

public Throwable getLinkedException()
Get the linked exception

Returns:
the linked Exception, null if none exists

public void setLinkedException(Throwable exception)
添加一个链接的异常。
exception 链接的异常（允许使用 null 值，该值指示链接的异常不存在或者是未知的）。
英文文档：

setLinkedException

public void setLinkedException(Throwable exception)
Add a linked Exception.

Parameters:
exception - the linked Exception (A null value is permitted and indicates that the linked exception does not exist or is unknown).

public String toString()
返回此 TypeConstraintException 的简短描述。
英文文档：

toString

public String toString()
Returns a short description of this TypeConstraintException.

Overrides:
toString in class Throwable

public void printStackTrace(java.io.PrintStream s)
打印此 TypeConstraintException 及其对 PrintStream 的堆栈跟踪（如果为非 null，则包括该 linkedException 的堆栈跟踪）。
s 用于输出的 PrintStream
英文文档：

printStackTrace

public void printStackTrace(PrintStream s)
Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintStream to use for output

public void printStackTrace()
打印此 TypeConstraintException 及其对 System.err 的堆栈跟踪（如果为非 null，则包括 linkedException 的堆栈跟踪。
英文文档：

printStackTrace

public void printStackTrace()
Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.

Overrides:
printStackTrace in class Throwable
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnmarshalException (Java EE 5)

javax.xml.bind
Class UnmarshalException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.bind.JAXBException
                extended by  javax.xml.bind.UnmarshalException
All Implemented Interfaces:
Serializable
public class UnmarshalException
extends JAXBException

Extends: Throwable > Exception > JAXBException

此异常指示在执行阻止 JAXB 提供者完成操作的解组操作时遇到一个错误。

ValidationEventHandler 可能导致执行解组操作期间抛出此异常。请参阅 ValidationEventHandler.handleEvent(ValidationEvent)。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.JAXBException, javax.xml.bind.Unmarshaller, javax.xml.bind.ValidationEventHandler
英文文档：

This exception indicates that an error has occurred while performing an unmarshal operation that prevents the JAXB Provider from completing the operation.

The ValidationEventHandler can cause this exception to be thrown during the unmarshal operations. See ValidationEventHandler.handleEvent(ValidationEvent).

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
JAXBException, Unmarshaller, ValidationEventHandler, Serialized Form

Constructor Summary
UnmarshalException(String message)
Construct an UnmarshalException with the specified detail message.
UnmarshalException(String message, String errorCode)
Construct an UnmarshalException with the specified detail message and vendor specific errorCode.
UnmarshalException(String message, String errorCode, Throwable exception)
Construct an UnmarshalException with the specified detail message, vendor specific errorCode, and linkedException.
UnmarshalException(String message, Throwable exception)
Construct an UnmarshalException with the specified detail message and linkedException.
UnmarshalException(Throwable exception)
Construct an UnmarshalException with a linkedException.
Method Summary
Methods inherited from class javax.xml.bind.JAXBException
getCause, getErrorCode, getLinkedException, printStackTrace, printStackTrace, printStackTrace, setLinkedException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public UnmarshalException(String message)
构造带指定详细消息的 UnmarshalException。errorCode 和 linkedException 将默认为 null。
message 对异常的描述
英文文档：

UnmarshalException

public UnmarshalException(String message)
Construct an UnmarshalException with the specified detail message. The errorCode and linkedException will default to null.

Parameters:
message - a description of the exception

public UnmarshalException(String message, String errorCode)
构造带指定详细消息和特定于供应商的 errorCode 的 UnmarshalException。linkedException 将默认为 null。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

UnmarshalException

public UnmarshalException(String message,
                          String errorCode)
Construct an UnmarshalException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code

public UnmarshalException(Throwable exception)
构造带有一个 linkedException 的 UnmarshalException。详细消息和特定于供应商的 errorCode 将默认为 null。
exception 链接的异常
英文文档：

UnmarshalException

public UnmarshalException(Throwable exception)
Construct an UnmarshalException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters:
exception - the linked exception

public UnmarshalException(String message, Throwable exception)
构造带指定详细消息和 linkedException 的 UnmarshalException。errorCode 将默认为 null。
message | 对异常的描述
exception | 链接的异常
英文文档：

UnmarshalException

public UnmarshalException(String message,
                          Throwable exception)
Construct an UnmarshalException with the specified detail message and linkedException. The errorCode will default to null.

Parameters:
message - a description of the exception
exception - the linked exception

public UnmarshalException(String message, String errorCode, Throwable exception)
构造带指定详细消息、特定于供应商的 errorCode 和 linkedException 的 UnmarshalException。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
exception | 链接的异常
英文文档：

UnmarshalException

public UnmarshalException(String message,
                          String errorCode,
                          Throwable exception)
Construct an UnmarshalException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationException (Java EE 5)

javax.xml.bind
Class ValidationException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.bind.JAXBException
                extended by  javax.xml.bind.ValidationException
All Implemented Interfaces:
Serializable
public class ValidationException
extends JAXBException

Extends: Throwable > Exception > JAXBException

此异常指示在执行验证操作时发生错误。

ValidationEventHandler 可能导致执行验证操作期间抛出此异常。请参阅 ValidationEventHandler.handleEvent(ValidationEvent)。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.JAXBException, javax.xml.bind.Validator
英文文档：

This exception indicates that an error has occurred while performing a validate operation.

The ValidationEventHandler can cause this exception to be thrown during the validate operations. See ValidationEventHandler.handleEvent(ValidationEvent).

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
JAXBException, Validator, Serialized Form

Constructor Summary
ValidationException(String message)
Construct an ValidationException with the specified detail message.
ValidationException(String message, String errorCode)
Construct an ValidationException with the specified detail message and vendor specific errorCode.
ValidationException(String message, String errorCode, Throwable exception)
Construct an ValidationException with the specified detail message, vendor specific errorCode, and linkedException.
ValidationException(String message, Throwable exception)
Construct an ValidationException with the specified detail message and linkedException.
ValidationException(Throwable exception)
Construct an ValidationException with a linkedException.
Method Summary
Methods inherited from class javax.xml.bind.JAXBException
getCause, getErrorCode, getLinkedException, printStackTrace, printStackTrace, printStackTrace, setLinkedException, toString
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ValidationException(String message)
构造带指定详细消息的 ValidationException。errorCode 和 linkedException 将默认为 null。
message 对异常的描述
英文文档：

ValidationException

public ValidationException(String message)
Construct an ValidationException with the specified detail message. The errorCode and linkedException will default to null.

Parameters:
message - a description of the exception

public ValidationException(String message, String errorCode)
构造带指定详细消息和特定于供应商的 errorCode 的 ValidationException。linkedException 将默认为 null。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
英文文档：

ValidationException

public ValidationException(String message,
                           String errorCode)
Construct an ValidationException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code

public ValidationException(Throwable exception)
构造带有一个 linkedException 的 ValidationException。详细消息和特定于供应商的 errorCode 将默认为 null。
exception 链接的异常
英文文档：

ValidationException

public ValidationException(Throwable exception)
Construct an ValidationException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters:
exception - the linked exception

public ValidationException(String message, Throwable exception)
构造带指定的详细消息和 linkedException 的 ValidationException。errorCode 将默认为 null。
message | 对异常的描述
exception | 链接的异常
英文文档：

ValidationException

public ValidationException(String message,
                           Throwable exception)
Construct an ValidationException with the specified detail message and linkedException. The errorCode will default to null.

Parameters:
message - a description of the exception
exception - the linked exception

public ValidationException(String message, String errorCode, Throwable exception)
构造带指定的详细消息、特定于供应商的 errorCode 和 linkedException 的 ValidationException。
message | 对异常的描述
errorCode | 指定特定于供应商的错误代码的字符串
exception | 链接的异常
英文文档：

ValidationException

public ValidationException(String message,
                           String errorCode,
                           Throwable exception)
Construct an ValidationException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.bind.annotation (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.bind.annotation

Defines annotations for customizing Java program elements to XML Schema mapping.

See:
Description

Interface Summary
DomHandler<ElementT,ResultT extends Result> Converts an element (and its descendants) from/to DOM (or similar) representation.

Class Summary
W3CDomHandler | DomHandler implementation for W3C DOM (org.w3c.dom package.)
XmlElement.DEFAULT | Used in XmlElement.type() to signal that the type be inferred from the signature of the property.
XmlElementDecl.GLOBAL | Used in XmlElementDecl.scope() to signal that the declaration is in the global scope.
XmlElementRef.DEFAULT | Used in XmlElementRef.type() to signal that the type be inferred from the signature of the property.
XmlSchemaType.DEFAULT | Used in XmlSchemaType.type() to signal that the type be inferred from the signature of the property.
XmlType.DEFAULT | Used in XmlType.factoryClass() to signal that either factory mehod is not used or that it's in the class with this XmlType itself.

Enum Summary
XmlAccessOrder | Used by XmlAccessorOrder to control the ordering of properties and fields in a JAXB bound class.
XmlAccessType | Used by XmlAccessorType to control serialization of fields or properties.
XmlNsForm | Enumeration of XML Schema namespace qualifications.

Annotation Types Summary
XmlAccessorOrder | Controls the ordering of fields and properties in a class.
XmlAccessorType | Controls whether fields or Javabean properties are serialized by default.
XmlAnyAttribute | Maps a JavaBean property to a map of wildcard attributes.
XmlAnyElement | Maps a JavaBean property to XML infoset representation and/or JAXB element.
XmlAttachmentRef | Marks a field/property that its XML form is a uri reference to mime content.
XmlAttribute | Maps a JavaBean property to a XML attribute.
XmlElement | Maps a JavaBean property to a XML element derived from property name.
XmlElementDecl | Maps a factory method to a XML element.
XmlElementRef | Maps a JavaBean property to a XML element derived from property's type.
XmlElementRefs | Marks a property that refers to classes with XmlElement or JAXBElement.
XmlElements | A container for multiple @XmlElement annotations.
XmlElementWrapper | Generates a wrapper element around XML representation.
XmlEnum | Maps an enum type Enum to XML representation.
XmlEnumValue | Maps an enum constant in Enum type to XML representation.
XmlID | Maps a JavaBean property to XML ID.
XmlIDREF | Maps a JavaBean property to XML IDREF.
XmlInlineBinaryData | Disable consideration of XOP encoding for datatypes that are bound to base64-encoded binary data in XML.
XmlList | Used to map a property to a list simple type.
XmlMimeType | Associates the MIME type that controls the XML representation of the property.
XmlMixed | Annotate a JavaBean multi-valued property to support mixed content.
XmlNs | Associates a namespace prefix with a XML namespace URI.
XmlRegistry | Marks a class that has XmlElementDecls.
XmlRootElement | Maps a class or an enum type to an XML element.
XmlSchema | Maps a package name to a XML namespace.
XmlSchemaType | Maps a Java type to a simple schema built-in type.
XmlSchemaTypes | A container for multiple @XmlSchemaType annotations.
XmlTransient | Prevents the mapping of a JavaBean property to XML representation.
XmlType | Maps a class or an enum type to a XML Schema type.
XmlValue | Enables mapping a class to a XML Schema complex type with a simpleContent or a XML Schema simple type.

Package javax.xml.bind.annotation Description

Defines annotations for customizing Java program elements to XML Schema mapping.

Package Specification

The following table shows the JAXB mapping annotations that can be associated with each program element.

Program Element JAXB annotation
Package
XmlAccessorOrder
XmlAccessorType
XmlSchema
XmlSchemaType
XmlSchemaTypes
XmlJavaTypeAdapter
XmlJavaTypeAdapters
Class
XmlAccessorOrder
XmlAccessorType
XmlInlineBinaryData
XmlRootElement
XmlType
XmlJavaTypeAdapter
Enum type
XmlEnum
XmlEnumValue (enum constant only)
XmlRootElement
XmlType
XmlJavaTypeAdapter
JavaBean Property/field
XmlElement
XmlElements
XmlElementRef
XmlElementRefs
XmlElementWrapper
XmlAnyElement
XmlAttribute
XmlAnyAttribute
XmlTransient
XmlValue
XmlID
XmlIDREF
XmlList
XmlMixed
XmlMimeType
XmlAttachmentRef
XmlInlineBinaryData
XmlElementDecl (only on method)
XmlJavaTypeAdapter
Parameter
XmlList
XmlAttachmentRef
XmlMimeType
XmlJavaTypeAdapter

Terminology

JavaBean property and field: For the purposes of mapping, there is no semantic difference between a field and a JavaBean property. Thus, an annotation that can be applied to a JavaBean property can always be applied to a field. Hence in the Javadoc documentation, for brevity, the term JavaBean property or property is used to mean either JavaBean property or a field. Where required, both are explicitly mentioned.

top level class: For the purpose of mapping, there is no semantic difference between a top level class and a static nested class. Thus, an annotation that can be applied to a top level class, can always be applied to a nested static class. Hence in the Javadoc documentation, for brevity, the term "top level class" or just class is used to mean either a top level class or a nested static class.

mapping annotation:A JAXB 2.0 defined program annotation based on the JSR 175 programming annotation facility.

Common Usage Constraints

The following usage constraints are defined here since they apply to more than annotation:

  • For a property, a given annotation can be applied to either read or write property but not both.
  • A property name must be different from any other property name in any of the super classes of the class being mapped.
  • A mapped field name or the decapitalized name of a mapped property must be unique within a class.

Notations

Namespace prefixes

The following namespace prefixes are used in the XML Schema fragments in this package.

Prefix | Namespace | Notes
xs | http://www.w3.org/2001/XMLSchema | Namespace of XML Schema namespace
ref | http://ws-i.org/profiles/basic/1.1/xsd | Namespace for swaref schema component
xsi | http://www.w3.org/2001/XMLSchema-instance | XML Schema namespace for instances

Since:
JAXB 2.0
Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.bind.annotation Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.bind.annotation

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.bind.annotation.W3CDomHandler (implements javax.xml.bind.annotation.DomHandler<ElementT,ResultT>)
    • javax.xml.bind.annotation.XmlElement.DEFAULT
    • javax.xml.bind.annotation.XmlElementDecl.GLOBAL
    • javax.xml.bind.annotation.XmlElementRef.DEFAULT
    • javax.xml.bind.annotation.XmlSchemaType.DEFAULT
    • javax.xml.bind.annotation.XmlType.DEFAULT

Interface Hierarchy

  • javax.xml.bind.annotation.DomHandler<ElementT,ResultT>

Annotation Type Hierarchy

  • javax.xml.bind.annotation.XmlAccessorOrder (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAccessorType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAnyAttribute (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAnyElement (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAttachmentRef (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlAttribute (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElement (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementDecl (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementRef (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementRefs (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElementWrapper (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlElements (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlEnum (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlEnumValue (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlID (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlIDREF (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlInlineBinaryData (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlList (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlMimeType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlMixed (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlNs (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlRegistry (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlRootElement (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlSchema (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlSchemaType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlSchemaTypes (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlTransient (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlType (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.XmlValue (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.xml.bind.annotation.XmlAccessOrder
      • javax.xml.bind.annotation.XmlAccessType
      • javax.xml.bind.annotation.XmlNsForm
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DomHandler (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.annotation
Interface DomHandler<ElementT,ResultT extends Result>

All Known Implementing Classes:
W3CDomHandler
public interface DomHandler<ElementT,ResultT extends Result>

Implemented by: W3CDomHandler

在元素（及其子代）与 DOM（或类似对象）表示形式之间相互转换。

此接口的实现将与 XmlAnyElement 注释一起使用，将 XML 的元素映射到信息集（如 W3C DOM）的表示形式。

实现隐藏 XML 的一部分与这些类 DOM 表示形式之间相互转换的方式，并允许 JAXB 提供者处理任意这样的库。

此接口将由库编写器实现，并由 JAXB 提供者使用。这些方法都不应该从应用程序调用。

since JAXB2.0
英文文档：

Converts an element (and its descendants) from/to DOM (or similar) representation.

Implementations of this interface will be used in conjunction with XmlAnyElement annotation to map an element of XML into a representation of infoset such as W3C DOM.

Implementations hide how a portion of XML is converted into/from such DOM-like representation, allowing JAXB providers to work with arbitrary such library.

This interface is intended to be implemented by library writers and consumed by JAXB providers. None of those methods are intended to be called from applications.

Since:
JAXB2.0
Author:
Kohsuke Kawaguchi

Method Summary
ResultT | createUnmarshaller(ValidationEventHandler errorHandler) When a JAXB provider needs to unmarshal a part of a document into an infoset representation, it first calls this method to create a Result object.
ElementT | getElement(ResultT rt) Once the portion is sent to the Result.
Source | marshal(ElementT n, ValidationEventHandler errorHandler) This method is called when a JAXB provider needs to marshal an element to XML.

Method Detail

public javax.xml.transform.Result createUnmarshaller(ValidationEventHandler errorHandler)
当 JAXB 提供者需要将文档的一部分解组为信息集表示形式时，首先要调用此方法创建一个 Result 对象。

然后 JAXB 提供者将 XML 的一部分发送到给定的结果中。这一部分 XML 总是可以形成整个 XML 文档（该文档以某个元素为根）的子树。

errorHandler | 如果在调用此方法和调用 #getElement(Result) 之间发生任何错误，则必须向此处理程序报告。 调用者必须提供一个非 null 错误处理程序。 从此方法创建的 Result 对象可以保存对此错误处理程序的引用。
return | 如果操作失败，则返回 null。必须向错误处理程序报告错误。
英文文档：

createUnmarshaller

ResultT createUnmarshaller(ValidationEventHandler errorHandler)
When a JAXB provider needs to unmarshal a part of a document into an infoset representation, it first calls this method to create a Result object.

A JAXB provider will then send a portion of the XML into the given result. Such a portion always form a subtree of the whole XML document rooted at an element.

Parameters:
errorHandler - if any error happens between the invocation of this method and the invocation of getElement(Result), they must be reported to this handler. The caller must provide a non-null error handler. The Result object created from this method may hold a reference to this error handler.
Returns:
null if the operation fails. The error must have been reported to the error handler.

英文文档：

getElement

ElementT getElement(ResultT rt)
Once the portion is sent to the Result. This method is called by a JAXB provider to obtain the unmarshalled element representation.

Multiple invocations of this method may return different objects. This method can be invoked only when the whole sub-tree are fed to the Result object.

Parameters:
rt - The Result object created by createUnmarshaller(ValidationEventHandler).
Returns:
null if the operation fails. The error must have been reported to the error handler.

英文文档：

marshal

Source marshal(ElementT n,
               ValidationEventHandler errorHandler)
This method is called when a JAXB provider needs to marshal an element to XML.

If non-null, the returned Source must contain a whole document rooted at one element, which will then be weaved into a bigger document that the JAXB provider is marshalling.

Parameters:
errorHandler - Receives any errors happened during the process of converting an element into a Source. The caller must provide a non-null error handler.
Returns:
null if there was an error. The error should have been reported to the handler.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


W3CDomHandler (Java EE 5)

javax.xml.bind.annotation
Class W3CDomHandler

java.lang.Object
    extended by  javax.xml.bind.annotation.W3CDomHandler
All Implemented Interfaces:
DomHandler<Element,DOMResult>
public class W3CDomHandler
extends Object
implements DomHandler<Element,DOMResult>

Implements: DomHandler

W3C DOM（org.w3c.dom 包）的 DomHandler 实现。
since JAXB2.0
英文文档：

DomHandler implementation for W3C DOM (org.w3c.dom package.)

Since:
JAXB2.0
Author:
Kohsuke Kawaguchi

Constructor Summary
W3CDomHandler()
Default constructor.
W3CDomHandler(DocumentBuilder builder)
Constructor that allows applications to specify which DOM implementation to be used.
Method Summary
DOMResult | createUnmarshaller(ValidationEventHandler errorHandler) When a JAXB provider needs to unmarshal a part of a document into an infoset representation, it first calls this method to create a Result object.
DocumentBuilder | getBuilder()
Element | getElement(DOMResult r) Once the portion is sent to the Result.
Source | marshal(Element element, ValidationEventHandler errorHandler) This method is called when a JAXB provider needs to marshal an element to XML.
void | setBuilder(DocumentBuilder builder)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public W3CDomHandler()
默认的构造方法。 它取决于 JAXB 提供者决定使用哪一个 DOM 实现或如何进行配置。
英文文档：

W3CDomHandler

public W3CDomHandler()
Default constructor. It is up to a JAXB provider to decide which DOM implementation to use or how that is configured.

public W3CDomHandler(javax.xml.parsers.DocumentBuilder builder)
允许应用程序指定使用哪一个 DOM 实现的构造方法。
builder 不得为 null。JAXB 使用此 DocumentBuilder 创建新的元素。
英文文档：

W3CDomHandler

public W3CDomHandler(DocumentBuilder builder)
Constructor that allows applications to specify which DOM implementation to be used.

Parameters:
builder - must not be null. JAXB uses this DocumentBuilder to create a new element.
Method Detail

public javax.xml.parsers.DocumentBuilder getBuilder()
英文文档：

getBuilder

public DocumentBuilder getBuilder()

public void setBuilder(javax.xml.parsers.DocumentBuilder builder)
英文文档：

setBuilder

public void setBuilder(DocumentBuilder builder)

public javax.xml.transform.dom.DOMResult createUnmarshaller(ValidationEventHandler errorHandler)
英文文档：

createUnmarshaller

public DOMResult createUnmarshaller(ValidationEventHandler errorHandler)
Description copied from interface: DomHandler
When a JAXB provider needs to unmarshal a part of a document into an infoset representation, it first calls this method to create a Result object.

A JAXB provider will then send a portion of the XML into the given result. Such a portion always form a subtree of the whole XML document rooted at an element.

Specified by:
createUnmarshaller in interface DomHandler<Element,DOMResult>
Parameters:
errorHandler - if any error happens between the invocation of this method and the invocation of DomHandler.getElement(Result), they must be reported to this handler. The caller must provide a non-null error handler. The Result object created from this method may hold a reference to this error handler.
Returns:
null if the operation fails. The error must have been reported to the error handler.

public org.w3c.dom.Element getElement(javax.xml.transform.dom.DOMResult r)
英文文档：

getElement

public Element getElement(DOMResult r)
Description copied from interface: DomHandler
Once the portion is sent to the Result. This method is called by a JAXB provider to obtain the unmarshalled element representation.

Multiple invocations of this method may return different objects. This method can be invoked only when the whole sub-tree are fed to the Result object.

Specified by:
getElement in interface DomHandler<Element,DOMResult>
Parameters:
r - The Result object created by DomHandler.createUnmarshaller(ValidationEventHandler).
Returns:
null if the operation fails. The error must have been reported to the error handler.

public javax.xml.transform.Source marshal(org.w3c.dom.Element element, ValidationEventHandler errorHandler)
英文文档：

marshal

public Source marshal(Element element,
                      ValidationEventHandler errorHandler)
Description copied from interface: DomHandler
This method is called when a JAXB provider needs to marshal an element to XML.

If non-null, the returned Source must contain a whole document rooted at one element, which will then be weaved into a bigger document that the JAXB provider is marshalling.

Specified by:
marshal in interface DomHandler<Element,DOMResult>
errorHandler - Receives any errors happened during the process of converting an element into a Source. The caller must provide a non-null error handler.
Returns:
null if there was an error. The error should have been reported to the handler.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlAccessOrder (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.xml.bind.annotation
Enum XmlAccessOrder

java.lang.Object
    extended by  java.lang.Enum<XmlAccessOrder>
        extended by  javax.xml.bind.annotation.XmlAccessOrder
All Implemented Interfaces:
Serializable, Comparable<XmlAccessOrder>
public enum XmlAccessOrder
extends Enum<XmlAccessOrder>

Extends: Enum<E>

由 XmlAccessorOrder 使用，用于控制 JAXB 绑定类中属性和字段的排序。
since | JAXB2.0
version
en
$Revision: 1.1 $
See also | javax.xml.bind.annotation.XmlAccessorOrder
英文文档：

Used by XmlAccessorOrder to control the ordering of properties and fields in a JAXB bound class.

Since:
JAXB2.0
Version:
$Revision: 1.1 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlAccessorOrder

Enum Constant Summary
ALPHABETICAL
The ordering of fields and properties in a class is in alphabetical order as determined by the method java.lang.String.compareTo(String anotherString).
UNDEFINED
The ordering of fields and properties in a class is undefined.
Method Summary
static XmlAccessOrder | valueOf(String name) Returns the enum constant of this type with the specified name.
static XmlAccessOrder[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

UNDEFINED

public static final XmlAccessOrder UNDEFINED
The ordering of fields and properties in a class is undefined.

英文文档：

ALPHABETICAL

public static final XmlAccessOrder ALPHABETICAL
The ordering of fields and properties in a class is in alphabetical order as determined by the method java.lang.String.compareTo(String anotherString).

Method Detail

final public static XmlAccessOrder[] values()
英文文档：

values

public static final XmlAccessOrder[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(XmlAccessOrder c : XmlAccessOrder.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static XmlAccessOrder valueOf(String name)
英文文档：

valueOf

public static XmlAccessOrder valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


XmlAccessType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.xml.bind.annotation
Enum XmlAccessType

java.lang.Object
    extended by  java.lang.Enum<XmlAccessType>
        extended by  javax.xml.bind.annotation.XmlAccessType
All Implemented Interfaces:
Serializable, Comparable<XmlAccessType>
public enum XmlAccessType
extends Enum<XmlAccessType>

Extends: Enum<E>

由 XmlAccessorType 使用，用于控制字段或属性的序列化。
since | JAXB2.0
version
en
$Revision: 1.1 $
See also | javax.xml.bind.annotation.XmlAccessorType
英文文档：

Used by XmlAccessorType to control serialization of fields or properties.

Since:
JAXB2.0
Version:
$Revision: 1.1 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlAccessorType

Enum Constant Summary
FIELD
Every non static, non transient field in a JAXB-bound class will be automatically bound to XML, unless annotated by XmlTransient.
NONE
None of the fields or properties is bound to XML unless they are specifically annotated with some of the JAXB annotations.
PROPERTY
Every getter/setter pair in a JAXB-bound class will be automatically bound to XML, unless annotated by XmlTransient.
PUBLIC_MEMBER
Every public getter/setter pair and every public field will be automatically bound to XML, unless annotated by XmlTransient.
Method Summary
static XmlAccessType | valueOf(String name) Returns the enum constant of this type with the specified name.
static XmlAccessType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

PROPERTY

public static final XmlAccessType PROPERTY
Every getter/setter pair in a JAXB-bound class will be automatically bound to XML, unless annotated by XmlTransient. Fields are bound to XML only when they are explicitly annotated by some of the JAXB annotations.

英文文档：

FIELD

public static final XmlAccessType FIELD
Every non static, non transient field in a JAXB-bound class will be automatically bound to XML, unless annotated by XmlTransient. Getter/setter pairs are bound to XML only when they are explicitly annotated by some of the JAXB annotations.

英文文档：

PUBLIC_MEMBER

public static final XmlAccessType PUBLIC_MEMBER
Every public getter/setter pair and every public field will be automatically bound to XML, unless annotated by XmlTransient. Fields or getter/setter pairs that are private, protected, or defaulted to package-only access are bound to XML only when they are explicitly annotated by the appropriate JAXB annotations.

英文文档：

NONE

public static final XmlAccessType NONE
None of the fields or properties is bound to XML unless they are specifically annotated with some of the JAXB annotations.

Method Detail

final public static XmlAccessType[] values()
英文文档：

values

public static final XmlAccessType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(XmlAccessType c : XmlAccessType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static XmlAccessType valueOf(String name)
英文文档：

valueOf

public static XmlAccessType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


XmlNsForm (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.xml.bind.annotation
Enum XmlNsForm

java.lang.Object
    extended by  java.lang.Enum<XmlNsForm>
        extended by  javax.xml.bind.annotation.XmlNsForm
All Implemented Interfaces:
Serializable, Comparable<XmlNsForm>
public enum XmlNsForm
extends Enum<XmlNsForm>

Extends: Enum<E>

XML 模式名称空间限定的枚举。

更多公共信息，请参见 javax.xml.bind.package javadoc 中的“包规范”。

使用

名称空间限定值用于此包中定义的注释。枚举值的映射如下所示：

枚举值 | XML 模式值
UNQUALIFIED | 非限定的
QUALIFIED | 限定的
UNSET | 名称空间限定属性并不存在于 XML 模式片段中。
since JAXB2.0
version
en
$Revision: 1.2 $
英文文档：

Enumeration of XML Schema namespace qualifications.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Usage

The namespace qualification values are used in the annotations defined in this packge. The enumeration values are mapped as follows:

Enum Value | XML Schema Value
UNQUALIFIED | unqualified
QUALIFIED | qualified
UNSET | namespace qualification attribute is absent from the XML Schema fragment

Since:
JAXB2.0
Version:
$Revision: 1.2 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.

Enum Constant Summary
QUALIFIED
UNQUALIFIED
UNSET
Method Summary
static XmlNsForm | valueOf(String name) Returns the enum constant of this type with the specified name.
static XmlNsForm[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

UNQUALIFIED

public static final XmlNsForm UNQUALIFIED

英文文档：

QUALIFIED

public static final XmlNsForm QUALIFIED

英文文档：

UNSET

public static final XmlNsForm UNSET
Method Detail

final public static XmlNsForm[] values()
英文文档：

values

public static final XmlNsForm[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(XmlNsForm c : XmlNsForm.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static XmlNsForm valueOf(String name)
英文文档：

valueOf

public static XmlNsForm valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


XmlAccessorOrder (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlAccessorOrder

@Inherited
@Retention(value=RUNTIME)
@Target(value={PACKAGE,TYPE})
public @interface XmlAccessorOrder

Implements: Annotation
@Inherited
@Retention(value=RUNTIME)
@Target(value={PACKAGE, TYPE})

控制类中字段和属性的排序。

用法

@XmlAccessorOrder 注释可以与以下程序元素一起使用：

  • 包
  • 顶层类

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

包上的 @XmlAccessorOrder 注释可应用于包中的所有类。继承语义的应用如下：

  • 如果类中有 @XmlAccessorOrder，则使用它。
  • 如果 @XmlAccessorOrder 存在于某个超类中，则继承它。
  • 否则，将继承包中 @XmlAccessorOrder。

默认规则：

默认情况下，如果包中不存在 @XmlAccessorOrder，那么假定使用以下包级别注释。

@XmlAccessorType(XmlAccessOrder.UNDEFINED)

默认情况下，如果类中不存在 @XmlAccessorOrder，并且没有任何超类是使用 @XmlAccessorOrder 注释的，则假定在类中使用以下默认注释：

@XmlAccessorType(XmlAccessOrder.UNDEFINED)

此注释可以于以下注释一起使用：XmlType、XmlRootElement、XmlAccessorType、XmlSchema、XmlSchemaType、XmlSchemaTypes 和 XmlJavaTypeAdapter。在包级别上它还可以与以下注释一起使用：XmlJavaTypeAdapter。

since | JAXB2.0
version
en
$Revision: 1.11 $
See also | javax.xml.bind.annotation.XmlAccessOrder
英文文档：

Controls the ordering of fields and properties in a class.

Usage

@XmlAccessorOrder annotation can be used with the following program elements:

  • package
  • a top level class

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

The annotation @XmlAccessorOrder on a package applies to all classes in a package. The following inheritance semantics apply:

  • If there is a @XmlAccessorOrder on a class, then it is used.
  • Otherwise, if a @XmlAccessorOrder exists on one of its super classes, then it is inherited.
  • Otherwise, the @XmlAccessorOrder on a package is inherited.

Defaulting Rules:

By default, if @XmlAccessorOrder on a package is absent, then the following package level annotation is assumed.

    @XmlAccessorType(XmlAccessOrder.UNDEFINED)

By default, if @XmlAccessorOrder on a class is absent and none of super classes is annotated with XmlAccessorOrder , then the following default on the class is assumed:

    @XmlAccessorType(XmlAccessOrder.UNDEFINED)

This annotation can be used with the following annotations: XmlType, XmlRootElement, XmlAccessorType, XmlSchema, XmlSchemaType, XmlSchemaTypes, , XmlJavaTypeAdapter. It can also be used with the following annotations at the package level: XmlJavaTypeAdapter.

Since:
JAXB2.0
Version:
$Revision: 1.11 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlAccessOrder

Optional Element Summary
 XmlAccessOrder value

abstract public XmlAccessOrder value()
英文文档：

value

public abstract XmlAccessOrder value
Default:
UNDEFINED
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlAccessorType (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlAccessorType

@Inherited
@Retention(value=RUNTIME)
@Target(value={PACKAGE,TYPE})
public @interface XmlAccessorType

Implements: Annotation
@Inherited
@Retention(value=RUNTIME)
@Target(value={PACKAGE, TYPE})

控制默认情况下是否对字段或 Javabean 属性进行系列化。

用法

@XmlAccessorType 注释可以与以下程序元素一起使用：

  • 包
  • 顶层类

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

此注释可控制类中的属性和字段的默认序列化。

包上的 @XmlAccessorType 注释可应用于包中的所有类。继承语义的应用如下：

  • 如果类中有 @XmlAccessorType，则使用它。
  • 如果 @XmlAccessorType 存在于该类的一个超类中，则继承它。
  • 否则，将继承包中的 @XmlAccessorOrder。

默认规则：

默认情况下，如果包中不存在 @XmlAccessorType，那么假定使用以下包级别注释。

@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)

默认情况下，如果类中不存在 @XmlAccessorType，并且没有任何超类是使用 @XmlAccessorType 注释的，则假定在类中使用以下默认注释：

@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)

此注释可与以下注释一起使用：XmlType、XmlRootElement、XmlSchema、XmlSchemaType、XmlSchemaTypes 和 XmlJavaTypeAdapter。在包级别上它还可以与以下注释一起使用：XmlJavaTypeAdapter。

since | JAXB2.0
version
en
$Revision: 1.9 $
See also | javax.xml.bind.annotation.XmlAccessType
英文文档：

Controls whether fields or Javabean properties are serialized by default.

Usage

@XmlAccessorType annotation can be used with the following program elements:

  • package
  • a top level class

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

This annotation provides control over the default serialization of properties and fields in a class.

The annotation @XmlAccessorType on a package applies to all classes in the package. The following inheritance semantics apply:

  • If there is a @XmlAccessorType on a class, then it is used.
  • Otherwise, if a @XmlAccessorType exists on one of its super classes, then it is inherited.
  • Otherwise, the @XmlAccessorType on a package is inherited.

Defaulting Rules:

By default, if @XmlAccessorType on a package is absent, then the following package level annotation is assumed.

   @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)

By default, if @XmlAccessorType on a class is absent, and none of its super classes is annotated with @XmlAccessorType, then the following default on the class is assumed:

   @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)

This annotation can be used with the following annotations: XmlType, XmlRootElement, XmlAccessorOrder, XmlSchema, XmlSchemaType, XmlSchemaTypes, , XmlJavaTypeAdapter. It can also be used with the following annotations at the package level: XmlJavaTypeAdapter.

Since:
JAXB2.0
Version:
$Revision: 1.9 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlAccessType

Optional Element Summary
 XmlAccessType value
Specifies whether fields or properties are serialized.

abstract public XmlAccessType value()
指定是否对字段或属性进行系列化。
See also javax.xml.bind.annotation.XmlAccessType
英文文档：

value

public abstract XmlAccessType value
Specifies whether fields or properties are serialized.

See Also:
XmlAccessType
Default:
PUBLIC_MEMBER
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlAnyAttribute (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlAnyAttribute

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlAnyAttribute

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

将 JavaBean 属性映射到通配符属性的映射表中。

用法

@XmlAnyAttribute 注释可以与以下程序元素一起使用：

  • JavaBean 属性
  • 非 static、非 transient 字段

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

用法受到以下约束的限制：
  • 最多只能使用 @XmlAnyAttribute 注释类中的一个字段或属性。
  • 属性或字段的类型必须是 java.util.Map。

在处理将解组成为一个值类的属性时，与另一个 JavaBean 属性不存在静态关联的（通过 XmlAttribute）每个属性都被输入 Map<QName,Object> 表示的通配符属性映射表中。属性 QName 是映射表的键。键值是属性的字符串值。

since JAXB2.0
英文文档：

Maps a JavaBean property to a map of wildcard attributes.

Usage

The @XmlAnyAttribute annotation can be used with the following program elements:

  • JavaBean property
  • non static, non transient field

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

The usage is subject to the following constraints:
  • At most one field or property in a class can be annotated with @XmlAnyAttribute.
  • The type of the property or the field must java.util.Map

While processing attributes to be unmarshalled into a value class, each attribute that is not statically associated with another JavaBean property, via XmlAttribute, is entered into the wildcard attribute map represented by Map<QName,Object>. The attribute QName is the map's key. The key's value is the String value of the attribute.

Since:
JAXB2.0
Author:
Kohsuke Kawaguchi, Sun Microsystems, Inc.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlAnyElement (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlAnyElement

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlAnyElement

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

将 JavaBean 属性映射到 XML 信息集表示形式和/或 JAXB 元素。

在将 xml 内容解组到 JAXB 注释类的实例中时，此注释充当 "catch-all" 属性。它通常注释多值的 JavaBean 属性，但它也能够出现在单值的 JavaBean 属性中。在解组过程中，与类中用于其他 JavaBean 属性的静态 @XmlElement 或 @XmlElementRef 注释不匹配的每个 xml 元素都将被添加到此 "catch-all" 属性中。

用法：

 @XmlAnyElement
 public Element[] others;

 // Collection of Element or JAXB elements.
 @XmlAnyElement(lax="true")
 public Object[] others;

 @XmlAnyElement
 private List<Element> nodes;

 @XmlAnyElement
 private Element node;

限制用法约束

此注释与 XmlElement、XmlAttribute、XmlValue、XmlElements、XmlID 和 XmlIDREF 互斥。

在类及其超类中只能有一个 XmlAnyElement 注释的 JavaBean 属性。

与其他注释的关系

此注释可与 XmlJavaTypeAdapter 一起使用，以便用户能够将他们自己的数据结构映射到 DOM，然后可将这些 DOM 组成 XML。

此注释可以按如下方式与 XmlMixed 一起使用：

 // List of java.lang.String or DOM nodes.
 @XmlAnyElement @XmlMixed
 List<Object> others;

将模式转换为 Java 类的示例

以下模式将生成以下 Java 类：

 <xs:complexType name="foo">
   <xs:sequence>
     <xs:element name="a" type="xs:int" />
     <xs:element name="b" type="xs:int" />
     <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
   </xs:sequence>
 </xs:complexType>

 class Foo {
   int a;
   int b;
   @XmlAnyElement
   List<Element> any;
 }
它可以按如下方式解组实例：

 <foo xmlns:e="extra">
   <a>1</a>
<e:other />  // this will be bound to DOM, because unmarshalling is orderless
   <b>3</b>
   <e:other />
<c>5</c>     // this will be bound to DOM, because the annotation doesn't remember namespaces.
 </foo>
以下模式将生成以下 Java 类：

 <xs:complexType name="bar">
   <xs:complexContent>
   <xs:extension base="foo">
     <xs:sequence>
       <xs:element name="c" type="xs:int" />
       <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
     </xs:sequence>
   </xs:extension>
 </xs:complexType>

class Bar extends Foo {
int c;
// Foo.getAny() also represents wildcard content for type definition bar.
 }
它可以按如下方式解组实例：

 <bar xmlns:e="extra">
   <a>1</a>
<e:other />  // this will be bound to DOM, because unmarshalling is orderless
   <b>3</b>
   <e:other />
<c>5</c>     // this now goes to Bar.c
<e:other />  // this will go to Foo.any
 </bar>

将 XmlElementRef 与 XmlAnyElement 一起使用

XmlAnyElement 注释可与 XmlElementRef 一起使用，用于指派能够参与目录树的其他元素。

以下模式将生成以下 Java 类：

 <xs:complexType name="foo">
   <xs:choice maxOccurs="unbounded" minOccurs="0">
     <xs:element name="a" type="xs:int" />
     <xs:element name="b" type="xs:int" />
     <xs:any namespace="##other" processContents="lax" />
   </xs:choice>
 </xs:complexType>

 class Foo {
   @XmlAnyElement(lax="true")
   @XmlElementRefs({
     @XmlElementRef(name="a", type="JAXBElement.class")
     @XmlElementRef(name="b", type="JAXBElement.class")
   })
   List<Object> others;
 }

 @XmlRegistry
 class ObjectFactory {
   ...
   @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
   JAXBElement<Integer> createFooA( Integer i ) { ... }

   @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
   JAXBElement<Integer> createFooB( Integer i ) { ... }
它可以按如下方式解组实例：

 <foo xmlns:e="extra">
<a>1</a>     // this will unmarshal to a <a href="../javax.xml.bind.JAXBElement.html"><code>JAXBElement</code></a> instance whose value is 1.
<e:other />  // this will unmarshal to a DOM <a href="../org.w3c.dom.Element.html"><code>Element</code></a>.
<b>3</b>     // this will unmarshal to a <a href="../javax.xml.bind.JAXBElement.html"><code>JAXBElement</code></a> instance whose value is 1.
 </foo>

W3C XML 模式 "lax" 通配符仿真

注释的 lax 元素启用了 "lax" 通配符语义的仿真。例如，当按如下方式注释 Java 源代码时：
 @XmlRootElement
 class Foo {
   @XmlAnyElement(lax=true)
   public Object[] others;
 }
那么下列文档将按如下方式解组：

 <foo>
   <unknown />
   <foo />
 </foo>

Foo foo = unmarshal();
// 1 for 'unknown', another for 'foo'
assert foo.others.length==2;
// 'unknown' unmarshals to a DOM element
assert foo.others[0] instanceof Element;
// because of lax=true, the 'foo' element eagerly
// unmarshals to a Foo object.
assert foo.others[1] instanceof Foo;
since JAXB2.0
英文文档：

Maps a JavaBean property to XML infoset representation and/or JAXB element.

This annotation serves as a "catch-all" property while unmarshalling xml content into a instance of a JAXB annotated class. It typically annotates a multi-valued JavaBean property, but it can occur on single value JavaBean property. During unmarshalling, each xml element that does not match a static @XmlElement or @XmlElementRef annotation for the other JavaBean properties on the class, is added to this "catch-all" property.

Usages:

 @XmlAnyElement
 public Element[] others;

 // Collection of Element or JAXB elements.
 @XmlAnyElement(lax="true")
 public Object[] others;

 @XmlAnyElement
 private List<Element> nodes;

 @XmlAnyElement
 private Element node;

Restriction usage constraints

This annotation is mutually exclusive with XmlElement, XmlAttribute, XmlValue, XmlElements, XmlID, and XmlIDREF.

There can be only one XmlAnyElement annotated JavaBean property in a class and its super classes.

Relationship to other annotations

This annotation can be used with XmlJavaTypeAdapter, so that users can map their own data structure to DOM, which in turn can be composed into XML.

This annotation can be used with XmlMixed like this:

 // List of java.lang.String or DOM nodes.
 @XmlAnyElement @XmlMixed
 List<Object> others;

Schema To Java example

The following schema would produce the following Java class:

 <xs:complexType name="foo">
   <xs:sequence>
     <xs:element name="a" type="xs:int" />
     <xs:element name="b" type="xs:int" />
     <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
   </xs:sequence>
 </xs:complexType>

 class Foo {
   int a;
   int b;
   @XmlAnyElement
   List<Element> any;
 }
It can unmarshal instances like

 <foo xmlns:e="extra">
   <a>1</a>
   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
   <b>3</b>
   <e:other />
   <c>5</c>     // this will be bound to DOM, because the annotation doesn't remember namespaces.
 </foo>
The following schema would produce the following Java class:

 <xs:complexType name="bar">
   <xs:complexContent>
   <xs:extension base="foo">
     <xs:sequence>
       <xs:element name="c" type="xs:int" />
       <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
     </xs:sequence>
   </xs:extension>
 </xs:complexType>

 class Bar extends Foo {
   int c;
   // Foo.getAny() also represents wildcard content for type definition bar.
 }
It can unmarshal instances like

 <bar xmlns:e="extra">
   <a>1</a>
   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
   <b>3</b>
   <e:other />
   <c>5</c>     // this now goes to Bar.c
   <e:other />  // this will go to Foo.any
 </bar>

Using XmlAnyElement with XmlElementRef

The XmlAnyElement annotation can be used with XmlElementRefs to designate additional elements that can participate in the content tree.

The following schema would produce the following Java class:

 <xs:complexType name="foo">
   <xs:choice maxOccurs="unbounded" minOccurs="0">
     <xs:element name="a" type="xs:int" />
     <xs:element name="b" type="xs:int" />
     <xs:any namespace="##other" processContents="lax" />
   </xs:choice>
 </xs:complexType>

 class Foo {
   @XmlAnyElement(lax="true")
   @XmlElementRefs({
     @XmlElementRef(name="a", type="JAXBElement.class")
     @XmlElementRef(name="b", type="JAXBElement.class")
   })
   List<Object> others;
 }

 @XmlRegistry
 class ObjectFactory {
   ...
   @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
   JAXBElement<Integer> createFooA( Integer i ) { ... }

   @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
   JAXBElement<Integer> createFooB( Integer i ) { ... }
It can unmarshal instances like

 <foo xmlns:e="extra">
   <a>1</a>     // this will unmarshal to a <A HREF="../../../../javax/xml/bind/JAXBElement.html" title="class in javax.xml.bind"><CODE>JAXBElement</CODE></A> instance whose value is 1.
   <e:other />  // this will unmarshal to a DOM <A HREF="http://java.sun.com/j2se/1.5/docs/api/org/w3c/dom/Element.html" title="class or interface in org.w3c.dom"><CODE>Element</CODE></A>.
   <b>3</b>     // this will unmarshal to a <A HREF="../../../../javax/xml/bind/JAXBElement.html" title="class in javax.xml.bind"><CODE>JAXBElement</CODE></A> instance whose value is 1.
 </foo>

W3C XML Schema "lax" wildcard emulation

The lax element of the annotation enables the emulation of the "lax" wildcard semantics. For example, when the Java source code is annotated like this:
 @XmlRootElement
 class Foo {
   @XmlAnyElement(lax=true)
   public Object[] others;
 }
then the following document will unmarshal like this:

 <foo>
   <unknown />
   <foo />
 </foo>

 Foo foo = unmarshal();
 // 1 for 'unknown', another for 'foo'
 assert foo.others.length==2;
 // 'unknown' unmarshals to a DOM element
 assert foo.others[0] instanceof Element;
 // because of lax=true, the 'foo' element eagerly
 // unmarshals to a Foo object.
 assert foo.others[1] instanceof Foo;

Since:
JAXB2.0
Author:
Kohsuke Kawaguchi

Optional Element Summary
boolean | lax Controls the unmarshaller behavior when it sees elements known to the current JAXBContext.
Class<? extends DomHandler> | value Specifies the DomHandler which is responsible for actually converting XML from/to a DOM-like data structure.

abstract public boolean lax()
在查看当前 JAXBContext 中的已知元素时控制解组行为。

当为 false 时

如果为 false，则所有与该属性匹配的元素都将被解组为 DOM，并且该属性将只包含 DOM 元素。

当为 true 时

如果为 true，则当某一元素与使用 JAXBContext 已知的 XmlAnyElement 标记的属性匹配时（例如，存在具有相同标记名称的带有 XmlRootElement 的类，或者存在具有相同标记名称的 XmlElementDecl），unmarshaller 会立即将此元素解组到 JAXB 对象，而不是解组到 DOM。此外，如果元素是未知的，但它有一个已知的 xsi:type，则通过使用未知的元素名称和设置为已知 xsi:type 的 JAXB 映射实例的 JAXBElement 值，unmarshaller 可立即将此元素解组到 JAXBElement。

因此，在解组之后，属性可能变得完全不同，它可能在包含 DOM 节点的同时还包含一些 JAXB 对象。

可以使用这种特性来仿真 W3C XML 模式的 "lax" 通配符语义。

英文文档：

lax

public abstract boolean lax
Controls the unmarshaller behavior when it sees elements known to the current JAXBContext.

When false

If false, all the elements that match the property will be unmarshalled to DOM, and the property will only contain DOM elements.

When true

If true, when an element matches a property marked with XmlAnyElement is known to JAXBContext (for example, there's a class with XmlRootElement that has the same tag name, or there's XmlElementDecl that has the same tag name), the unmarshaller will eagerly unmarshal this element to the JAXB object, instead of unmarshalling it to DOM. Additionally, if the element is unknown but it has a known xsi:type, the unmarshaller eagerly unmarshals the element to a JAXBElement, with the unknown element name and the JAXBElement value is set to an instance of the JAXB mapping of the known xsi:type.

As a result, after the unmarshalling, the property can become heterogeneous; it can have both DOM nodes and some JAXB objects at the same time.

This can be used to emulate the "lax" wildcard semantics of the W3C XML Schema.

Default:
false

abstract public Class<T> value()
指定 DomHandler，它负责实际执行 XML 与类 DOM 数据结构之间的转换。
英文文档：

value

public abstract Class<? extends DomHandler> value
Specifies the DomHandler which is responsible for actually converting XML from/to a DOM-like data structure.

Default:
javax.xml.bind.annotation.W3CDomHandler.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlAttachmentRef (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlAttachmentRef

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER})
public @interface XmlAttachmentRef

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD, PARAMETER})

标记字段/属性，其 XML 形式是对 MIME 内容的 URI 引用。MIME 内容作为附件被优化存储在行外（out-of-line）。 字段/属性必须始终映射到 DataHandler 类。

用法

since JAXB2.0

英文文档：

Marks a field/property that its XML form is a uri reference to mime content.
 The mime content is optimally stored out-of-line as an attachment.

 A field/property must always map to the DataHandler class.

Usage

 @XmlRootElement
 class Foo {
   @XmlAttachmentRef
   @XmlAttribute
   DataHandler data;

   @XmlAttachmentRef
   @XmlElement
   DataHandler body;
 }

 The above code maps to the following XML:

 <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
   <xs:complexType>
     <xs:sequence>
       <xs:element name="body" type="ref:swaRef" minOccurs="0" />
     </xs:sequence>
     <xs:attribute name="data" type="ref:swaRef" use="optional" />
   </xs:complexType>
 </xs:element>

 The above binding supports WS-I AP 1.0 WS-I Attachments Profile Version 1.0.

Since:

JAXB2.0

Author:

Kohsuke Kawaguchi

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT

Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。


XmlAttribute (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlAttribute

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlAttribute

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

将 JavaBean 属性映射到 XML 属性。

用法

@XmlAttribute 注释能够与下列程序元素一起使用：

  • JavaBean 属性
  • 字段

一个 static final 字段将被映射到 XML fixed 属性。

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

用法受到以下约束的限制：
  • 如果字段或属性的类型是集合类型，则必须将集合项类型必须映射到简单模式类型。
         // Examples
     @XmlAttribute List<Integer> items; //legal
     @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
  • 如果字段或属性的类型是非集合类型，则必须将属性或字段的类型映射到简单模式类型。
         // Examples
     @XmlAttribute int foo; // legal
     @XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
  • 此注释可与以下注释一起使用：XmlID、XmlIDREF、XmlList、XmlSchemaType、XmlValue、XmlAttachmentRef、XmlMimeType、XmlInlineBinaryData 和 javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter。
    • .

示例 1：将 JavaBean 属性映射到 XML 属性。

     //Example: Code fragment
     public class USPrice {
         @XmlAttribute
         public java.math.BigDecimal getPrice() {...} ;
         public void setPrice(java.math.BigDecimal ) {...};
     }

     <!-- Example: XML Schema fragment -->
     <xs:complexType name="USPrice">
       <xs:sequence>
       </xs:sequence>
       <xs:attribute name="price" type="xs:decimal"/>
     </xs:complexType>

示例 2：将 JavaBean 属性映射到带有匿名类型的 XML 属性。

请参阅 @XmlType 中的示例 7。

示例 3：将 JavaBean 集合属性映射到 XML 属性。

     // Example: Code fragment
     class Foo {
         ...
         @XmlAttribute List<Integer> items;
     }

     <!-- Example: XML Schema fragment -->
     <xs:complexType name="foo">
          ...
       <xs:attribute name="items">
         <xs:simpleType>
           <xs:list itemType="xs:int"/>
         </xs:simpleType>
     </xs:complexType>
version
en
$Revision: 1.14 $
since | JAXB2.0
See also | javax.xml.bind.annotation.XmlType
英文文档：

Maps a JavaBean property to a XML attribute.

Usage

The @XmlAttribute annotation can be used with the following program elements:

  • JavaBean property
  • field

A static final field is mapped to a XML fixed attribute.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

The usage is subject to the following constraints:
  • If type of the field or the property is a collection type, then the collection item type must be mapped to schema simple type.
         // Examples
     @XmlAttribute List<Integer> items; //legal
     @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
  • If the type of the field or the property is a non collection type, then the type of the property or field must map to a simple schema type.
         // Examples
     @XmlAttribute int foo; // legal
     @XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
  • This annotation can be used with the following annotations: XmlID, XmlIDREF, XmlList, XmlSchemaType, XmlValue, XmlAttachmentRef, XmlMimeType, XmlInlineBinaryData, XmlJavaTypeAdapter
    • .

Example 1: Map a JavaBean property to an XML attribute.

     //Example: Code fragment
     public class USPrice {
         @XmlAttribute
         public java.math.BigDecimal getPrice() {...} ;
         public void setPrice(java.math.BigDecimal ) {...};
     }

     <!-- Example: XML Schema fragment -->
     <xs:complexType name="USPrice">
       <xs:sequence>
       </xs:sequence>
       <xs:attribute name="price" type="xs:decimal"/>
     </xs:complexType>

Example 2: Map a JavaBean property to an XML attribute with anonymous type.

See Example 7 in @XmlType.

Example 3: Map a JavaBean collection property to an XML attribute.

     // Example: Code fragment
     class Foo {
         ...
         @XmlAttribute List<Integer> items;
     }

     <!-- Example: XML Schema fragment -->
     <xs:complexType name="foo">
         ...
       <xs:attribute name="items">
         <xs:simpleType>
           <xs:list itemType="xs:int"/>
         </xs:simpleType>
     </xs:complexType>

Since:
JAXB2.0
Version:
$Revision: 1.14 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlType

Optional Element Summary
String | name Name of the XML Schema attribute.
String | namespace Specifies the XML target namespace of the XML Schema attribute.
boolean | required Specifies if the XML Schema attribute is optional or required.

abstract public String name()
XML 模式属性的名称。默认情况下，XML 模式属性名称派生自 JavaBean 属性名称。
英文文档：

name

public abstract String name
Name of the XML Schema attribute. By default, the XML Schema attribute name is derived from the JavaBean property name.

Default:
"##default"

abstract public boolean required()
指定 XML 模式属性是可选的还是必需的。如果为 true，则将 JavaBean 属性映射到必需的 XML 模式属性。否则，将它映射到可选的 XML 模式属性。
英文文档：

required

public abstract boolean required
Specifies if the XML Schema attribute is optional or required. If true, then the JavaBean property is mapped to a XML Schema attribute that is required. Otherwise it is mapped to a XML Schema attribute that is optional.

Default:
false

abstract public String namespace()
指定 XML 模式属性的 XML 目标名称空间。
英文文档：

namespace

public abstract String namespace
Specifies the XML target namespace of the XML Schema attribute.

Default:
"##default"
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlElement (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlElement

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlElement

Implements: Annotation
Inner classes: XmlElement.DEFAULT
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

将 JavaBean 属性映射到派生自属性名称的 XML 元素。

使用

@XmlElement 注释可以与以下程序元素一起使用：

  • JavaBean 属性
  • 非静态、非瞬态字段
  • XmlElements 中的程序元素

使用上受到以下约束的限制：
  • 此注释可与以下注释一起使用：XmlID、XmlIDREF、XmlList、XmlSchemaType、XmlValue、XmlAttachmentRef、XmlMimeType、XmlInlineBinaryData、XmlElementWrapper 和 XmlJavaTypeAdapter。
  • 如果 JavaBean 属性的类型是数组的 collection 类型、索引 (indexed) 属性或参数化列表，并且此注释与 XmlElements 一起使用，那么 @XmlElement.type() 在 collection 项类型已知的情况下必须是 DEFAULT.class。

在使用 @XmlElement 注释进行注释时，JavaBean 属性被映射到 XML 模式复杂类型中的本地元素，包含的类被映射到此 XML 模式复杂类型。

示例 1：将 public 非 static 非 final 字段映射到本地元素。

     //Example: Code fragment
     public class USPrice {
         @XmlElement(name="itemprice")
         public java.math.BigDecimal price;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice"/>
       <xs:sequence>
         <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/>
       </sequence>
     </xs:complexType>

示例 2：将字段映射到 nillable 元素。

     //Example: Code fragment
     public class USPrice {
         @XmlElement(nillable=true)
         public java.math.BigDecimal price;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice">
       <xs:sequence>
         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/>
       </sequence>
     </xs:complexType>

示例 3：将字段映射到 nillable、required 元素。

     //Example: Code fragment
     public class USPrice {
         @XmlElement(nillable=true, required=true)
         public java.math.BigDecimal price;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice">
       <xs:sequence>
         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
       </sequence>
     </xs:complexType>

示例 4：将 JavaBean 属性映射到具有匿名类型的 XML 元素。

请参见 @XmlType 中的示例 6。

since JAXB2.0
version
en
$Revision: 1.19 $
英文文档：

Maps a JavaBean property to a XML element derived from property name.

Usage

@XmlElement annotation can be used with the following program elements:

  • a JavaBean property
  • non static, non transient field
  • within XmlElements

The usage is subject to the following constraints:
  • This annotation can be used with following annotations: XmlID, XmlIDREF, XmlList, XmlSchemaType, XmlValue, XmlAttachmentRef, XmlMimeType, XmlInlineBinaryData, XmlElementWrapper, XmlJavaTypeAdapter
  • if the type of JavaBean property is a collection type of array, an indexed property, or a parameterized list, and this annotation is used with XmlElements then, @XmlElement.type() must be DEFAULT.class since the collection item type is already known.

A JavaBean property, when annotated with @XmlElement annotation is mapped to a local element in the XML Schema complex type to which the containing class is mapped.

Example 1: Map a public non static non final field to local element

     //Example: Code fragment
     public class USPrice {
         @XmlElement(name="itemprice")
         public java.math.BigDecimal price;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice"/>
       <xs:sequence>
         <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/>
       </sequence>
     </xs:complexType>

Example 2: Map a field to a nillable element.

     //Example: Code fragment
     public class USPrice {
         @XmlElement(nillable=true)
         public java.math.BigDecimal price;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice">
       <xs:sequence>
         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/>
       </sequence>
     </xs:complexType>

Example 3: Map a field to a nillable, required element.

     //Example: Code fragment
     public class USPrice {
         @XmlElement(nillable=true, required=true)
         public java.math.BigDecimal price;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice">
       <xs:sequence>
         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
       </sequence>
     </xs:complexType>

Example 4: Map a JavaBean property to an XML element with anonymous type.

See Example 6 in @XmlType.

Since:
JAXB2.0
Version:
$Revision: 1.19 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.

Optional Element Summary
String | defaultValue Default value of this element.
String | name Name of the XML Schema element.
String | namespace XML target namespace of the XML Schema element.
boolean | nillable Customize the element declaration to be nillable.
boolean | required Customize the element declaration to be required.
Class | type The Java class being referenced.

abstract public String name()
XML 模式元素的名称。

如果值为 "##default"，那么元素名称派生于 JavaBean 属性名称。

英文文档：

name

public abstract String name
Name of the XML Schema element.

If the value is "##default", then element name is derived from the JavaBean property name.

Default:
"##default"

abstract public boolean nillable()
将元素声明自定义为 nillable。

如果 nillable() 为 true，那么 JavaBean 属性被映射到 XML 模式 nillable 元素声明。

英文文档：

nillable

public abstract boolean nillable
Customize the element declaration to be nillable.

If nillable() is true, then the JavaBean property is mapped to a XML Schema nillable element declaration.

Default:
false

abstract public boolean required()
自定义所需的元素声明。

如果 required() 为 true，则将 Javabean 属性映射到一个 minOccurs="1" 的 XML 模式元素声明。maxOccurs 为 "1" 表示单个赋值的属性，maxOccurs 为 "unbounded" 则表示多个赋值的属性。

如果 required() 为 false，则将 Javabean 属性映射到一个 minOccurs="0" 的 XML 模式元素声明。maxOccurs 为 "1" 表示单个赋值的属性，maxOccurs 为 "unbounded" 则表示多个赋值的属性。

英文文档：

required

public abstract boolean required
Customize the element declaration to be required.

If required() is true, then Javabean property is mapped to an XML schema element declaration with minOccurs="1". maxOccurs is "1" for a single valued property and "unbounded" for a multivalued property.

If required() is false, then the Javabean property is mapped to XML Schema element declaration with minOccurs="0". maxOccurs is "1" for a single valued property and "unbounded" for a multivalued property.

Default:
false

abstract public String namespace()
XML 模式元素的 XML 目标名称空间。

如果该值为 "##default"，则名称空间通过以下方式确定：

  1. 如果封闭包中包含 XmlSchema 注释，并且其 elementFormDefault 为 QUALIFIED，则名称空间为封闭类的名称空间。
  2. 否则名称空间为 ""（这将导致在默认名称空间中生成非限定元素）。
英文文档：

namespace

public abstract String namespace
XML target namespace of the XML Schema element.

If the value is "##default", then the namespace is determined as follows:

  1. If the enclosing package has XmlSchema annotation, and its elementFormDefault is QUALIFIED, then the namespace of the enclosing class.
  2. Otherwise "" (which produces unqualified element in the default namespace.

Default:
"##default"

abstract public String defaultValue()
此元素的默认值。

作为此注释元素的默认值指定的 '' 值被用作 null 的替代，从而允许识别 'no default value' 状态。

英文文档：

defaultValue

public abstract String defaultValue
Default value of this element.

The '' value specified as a default of this annotation element is used as a poor-man's substitute for null to allow implementations to recognize the 'no default value' state.

Default:
"\u0000"

abstract public Class<T> type()
正被引用的 Java 类。
英文文档：

type

public abstract Class type
The Java class being referenced.

Default:
javax.xml.bind.annotation.XmlElement.DEFAULT.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlElementDecl (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlElementDecl

@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface XmlElementDecl

Implements: Annotation
Inner classes: XmlElementDecl.GLOBAL
@Retention(value=RUNTIME)
@Target(value=METHOD)

将工厂方法映射到 XML 元素。

用法

该注释在 XML 模式元素声明与元素工厂方法之间创建了映射关系，元素工厂方法返回表示元素声明的 JAXBElement 实例。通常，元素工厂方法是根据 Java 包的 ObjectFactory 类中的模式生成（并注解）的，它表示元素声明的目标名称空间的绑定。因此，当注释语法允许在任何方法上使用 @XmlElementDecl 时，从语义上说，它的使用受限于元素工厂方法的注释。 用法受到以下约束的限制：
  • 包含使用 @XmlElementDecl 注释的元素工厂方法的类必须使用 XmlRegistry 标记。
  • 元素工厂方法必须采用一个可分配给 Object 的参数。

示例 1：工厂方法上的注释

     // Example: code fragment
     @XmlRegistry
     class ObjectFactory {
         @XmlElementDecl(name="foo")
         JAXBElement<String> createFoo(String s) { ... }
     }

     <!-- XML input -->
       <foo>string</foo>

     // Example: code fragment corresponding to XML input
     JAXBElement<String> o =
     (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
     // print JAXBElement instance to show values
     System.out.println(o.getName());   // prints  "{}foo"
     System.out.println(o.getValue());  // prints  "string"
     System.out.println(o.getValue().getClass()); // prints "java.lang.String"

     <!-- Example: XML schema definition -->
     <xs:element name="foo" type="xs:string"/>

示例 2：具有非本地作用域的元素声明

以下示例演示了如何在模式派生代码的元素声明绑定中使用作用域注释参数。

在此 javadoc 以后的版本中可能会替换以下示例。

     <!-- Example: XML schema definition -->
     <xs:schema>
       <xs:complexType name="pea">
         <xs:choice maxOccurs="unbounded">
           <xs:element name="foo" type="xs:string"/>
           <xs:element name="bar" type="xs:string"/>
         </xs:choice>
       </xs:complexType>
       <xs:element name="foo" type="xs:int"/>
     </xs:schema>

     // Example: expected default binding
     class Pea {
         @XmlElementRefs({
             @XmlElementRef(name="foo",type=JAXBElement.class)
             @XmlElementRef(name="bar",type=JAXBElement.class)
         })
         List<JAXBElement<String>> fooOrBar;
     }

     @XmlRegistry
     class ObjectFactory {
         @XmlElementDecl(scope=Pea.class,name="foo")
         JAXBElement createPeaFoo(String s);

         @XmlElementDecl(scope=Pea.class,name="bar")
         JAXBElement createPeaBar(String s);

         @XmlElementDecl(name="foo")
         JAXBElement createFoo(Integer i);
     }
没有作用域，createFoo 和 createPeaFoo 将变得不明确，因为它们两个都使用相同的本地名称 "foo" 映射到 XML 模式元素。
since | JAXB 2.0
See also | javax.xml.bind.annotation.XmlRegistry
英文文档：

Maps a factory method to a XML element.

Usage

The annotation creates a mapping between an XML schema element declaration and a element factory method that returns a JAXBElement instance representing the element declaration. Typically, the element factory method is generated (and annotated) from a schema into the ObjectFactory class in a Java package that represents the binding of the element declaration's target namespace. Thus, while the annotation syntax allows @XmlElementDecl to be used on any method, semantically its use is restricted to annotation of element factory method. The usage is subject to the following constraints:
  • The class containing the element factory method annotated with @XmlElementDecl must be marked with XmlRegistry.
  • The element factory method must take one parameter assignable to Object.

Example 1: Annotation on a factory method

     // Example: code fragment
     @XmlRegistry
     class ObjectFactory {
         @XmlElementDecl(name="foo")
         JAXBElement<String> createFoo(String s) { ... }
     }

     <!-- XML input -->
       <foo>string</foo>

     // Example: code fragment corresponding to XML input
     JAXBElement<String> o =
     (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
     // print JAXBElement instance to show values
     System.out.println(o.getName());   // prints  "{}foo"
     System.out.println(o.getValue());  // prints  "string"
     System.out.println(o.getValue().getClass()); // prints "java.lang.String"

     <!-- Example: XML schema definition -->
     <xs:element name="foo" type="xs:string"/>

Example 2: Element declaration with non local scope

The following example illustrates the use of scope annotation parameter in binding of element declaration in schema derived code.

The following example may be replaced in a future revision of this javadoc.

     <!-- Example: XML schema definition -->
     <xs:schema>
       <xs:complexType name="pea">
         <xs:choice maxOccurs="unbounded">
           <xs:element name="foo" type="xs:string"/>
           <xs:element name="bar" type="xs:string"/>
         </xs:choice>
       </xs:complexType>
       <xs:element name="foo" type="xs:int"/>
     </xs:schema>

     // Example: expected default binding
     class Pea {
         @XmlElementRefs({
             @XmlElementRef(name="foo",type=JAXBElement.class)
             @XmlElementRef(name="bar",type=JAXBElement.class)
         })
         List<JAXBElement<String>> fooOrBar;
     }

     @XmlRegistry
     class ObjectFactory {
         @XmlElementDecl(scope=Pea.class,name="foo")
         JAXBElement createPeaFoo(String s);

         @XmlElementDecl(scope=Pea.class,name="bar")
         JAXBElement createPeaBar(String s);

         @XmlElementDecl(name="foo")
         JAXBElement createFoo(Integer i);
     }
Without scope createFoo and createPeaFoo would become ambiguous since both of them map to a XML schema element with the same local name "foo".

Since:
JAXB 2.0
See Also:
XmlRegistry

Required Element Summary
 String name
local name of the XML element.
Optional Element Summary
String | defaultValue Default value of this element.
String | namespace namespace name of the XML element.
Class | scope scope of the mapping.
String | substitutionHeadName XML local name of a substitution group's head element.
String | substitutionHeadNamespace namespace name of a substitution group's head XML element.

Element Detail

abstract public String name()
XML 元素的本地名称。

审阅者的注释：没有默认名称；因为注释是在工厂方法上，所以能否从工厂方法名称派生方法名称不是很清楚。

See also namespace()
英文文档：

name

public abstract String name
local name of the XML element.

Note to reviewers: There is no default name; since the annotation is on a factory method, it is not clear that the method name can be derived from the factory method name.

See Also:
namespace()

abstract public Class<T> scope()
映射的作用域。

如果此值不是 XmlElementDecl.GLOBAL，那么此元素声明映射只有在指定类中才是活动的。

英文文档：

scope

public abstract Class scope
scope of the mapping.

If this is not XmlElementDecl.GLOBAL, then this element declaration mapping is only active within the specified class.

Default:
javax.xml.bind.annotation.XmlElementDecl.GLOBAL.class

abstract public String namespace()
XML 元素的名称空间名。

如果值是 "##default"，那么该值是实现包含此工厂方法类的包的名称空间名。

See also name()
英文文档：

namespace

public abstract String namespace
namespace name of the XML element.

If the value is "##default", then the value is the namespace name for the package of the class containing this factory method.

See Also:
name()
Default:
"##default"

abstract public String substitutionHeadNamespace()
替换组的头 XML 元素的名称空间名。

此值指定本地名称由 substitutionHeadName() 指定的 XML 元素的名称空间名。

如果 susbtitutionHeadName() 为 ""，则此值只能是 "##default"。但该值被忽略，因为在 susbstitutionHeadName() 的值是 "" 时，此元素不是替换组的一部分。

如果 susbtitutionHeadName() 不是 ""，并且值为 "##default"，那么名称空间名是包含用 XmlRegistry 标记的类的包所映射到的名称空间名。

如果 susbtitutionHeadName() 不是 "" 并且值不是 "##default"，那么该值是名称空间名。

See also substitutionHeadName()
英文文档：

substitutionHeadNamespace

public abstract String substitutionHeadNamespace
namespace name of a substitution group's head XML element.

This specifies the namespace name of the XML element whose local name is specified by substitutionHeadName().

If susbtitutionHeadName() is "", then this value can only be "##default". But the value is ignored since since this element is not part of susbtitution group when the value of susbstitutionHeadName() is "".

If susbtitutionHeadName() is not "" and the value is "##default", then the namespace name is the namespace name to which the package of the containing class, marked with XmlRegistry, is mapped.

If susbtitutionHeadName() is not "" and the value is not "##default", then the value is the namespace name.

See Also:
substitutionHeadName()
Default:
"##default"

abstract public String substitutionHeadName()
替换组的头元素的 XML 本地名称。

如果值是 ""，那么此元素不是任何替换组的一部分。

See also substitutionHeadNamespace()
英文文档：

substitutionHeadName

public abstract String substitutionHeadName
XML local name of a substitution group's head element.

If the value is "", then this element is not part of any substitution group.

See Also:
substitutionHeadNamespace()
Default:
""

abstract public String defaultValue()
此元素的默认值。

作为此注释元素的默认值指定的 '' 值被用作 null 的替代，从而允许识别 'no default value' 状态。

英文文档：

defaultValue

public abstract String defaultValue
Default value of this element.

The '' value specified as a default of this annotation element is used as a poor-man's substitute for null to allow implementations to recognize the 'no default value' state.

Default:
"\u0000"
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlElementRef (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlElementRef

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlElementRef

Implements: Annotation
Inner classes: XmlElementRef.DEFAULT
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

将 JavaBean 属性映射到派生于属性类型的 XML 元素。

使用

@XmlElementRef 注释可以与 JavaBean 属性一起使用或在 XmlElementRefs 中使用。

此注释将 XML 元素名称与 JavaBean 属性动态关联起来。当 JavaBean 属性使用 XmlElement 进行注释时，XML 元素名称以静态方式派生于 JavaBean 属性名称。但是，在使用此注释时，XML 元素名称派生于运行时的 JavaBean 属性类型的实例。

XML 模式替换组支持

XML 模式允许 XML 文档作者使用 XML 元素名称，这里的名称指没有在使用替换组的模式的内容模式中静态指定的名称。模式派生代码为使用元素属性 的替换组提供了支持（请参见 JAXB 2.0 规范的第 5.5.5 节：“元素属性”）。元素属性方法签名的形式如下：

public void setTerm(JAXBElement<? extends Operator>);
public JAXBElement<? extends Operator> getTerm();

用 XmlElementDecl 注释的元素工厂方法用于创建包含 XML 元素名称的 JAXBElement 实例。元素属性中出现 @XmlElementRef 注释则表示使用取自 JAXBElement 实例的元素名称，而不是从 JavaBean 属性名称中派生一个 XML 元素名称。

使用上受到以下约束的限制：

  • 如果 collection 项类型（用于 collection 属性）或属性类型（用于单个赋值属性）是 javax.xml.bind.JAXBElement，则 @XmlElementRef}.name() 和 @XmlElementRef.namespace() 必须指向一个元素工厂方法，并在使用 @XmlRegistry 注释的类中存在一个 @XmlElementDecl 注释（通常 ObjectFactory 类由模式编译器生成）：
    • @XmlElementDecl.name() 必须等于 @XmlElementRef.name()
    • @XmlElementDecl.namespace() 必须等于 @XmlElementRef.namespace()。
  • 如果 collection 项类型（用于 collection 属性）或属性类型（用于单个赋值属性）不是 javax.xml.bind.JAXBElement，则由属性或字段引用的类型必须是使用 XmlRootElement 注释的。
  • 此注释可与以下注释一起使用：XmlElementWrapper 和 XmlJavaTypeAdapter。

更多公共信息，请参见 javax.xml.bind.package javadoc 中的“包规范”。

示例 1：Ant 任务示例

以下 Java 类分层结构模拟 Ant 构建脚本。Ant 任务对应于类分层结构中的类。Ant 任务的 XML 元素名称由其对应类上的 @XmlRootElement 注释指示。
     @XmlRootElement(name="target")
     class Target {
         // The presence of @XmlElementRef indicates that the XML
         // element name will be derived from the @XmlRootElement
         // annotation on the type (for e.g. "jar" for JarTask).
         @XmlElementRef
         List<Task> tasks;
     }

     abstract class Task {
     }

     @XmlRootElement(name="jar")
     class JarTask extends Task {
         ...
     }

     @XmlRootElement(name="javac")
     class JavacTask extends Task {
         ...
     }

     <!-- XML Schema fragment -->
     <xs:element name="target" type="Target">
     <xs:complexType name="Target">
       <xs:sequence>
         <xs:choice maxOccurs="unbounded">
           <xs:element ref="jar">
           <xs:element ref="javac">
         </xs:choice>
       </xs:sequence>
     </xs:complexType>

因此下列代码片段

Target target = new Target();
target.tasks.add(new JarTask());
target.tasks.add(new JavacTask());
marshal(target);
将生成以下 XML 输出：

     <target>
       <jar>
         ....
       </jar>
       <javac>
         ....
       </javac>
     </target>

有一个类扩展了不具有 XmlRootElement 的 Task 并不是一个错误。但是这些类将无法出现在 XML 实例中（因为它们没有 XML 元素名称）。

示例 2：XML 模式替换组支持

以下示例显示用于 XML 模式替换组的注释。注释和 ObjectFactory 都派生于模式。

     @XmlElement
     class Math {
         //  The value of #type()is
         //  JAXBElement.class , which indicates the XML
         //  element name ObjectFactory - in general a class marked
         //  with @XmlRegistry. (See ObjectFactory below)
         //
         //  The #name() is "operator", a pointer to a
         // factory method annotated with a
         //  XmlElementDecl with the name "operator". Since
         //  "operator" is the head of a substitution group that
         //  contains elements "add" and "sub" elements, "operator"
         //  element can be substituted in an instance document by
         //  elements "add" or "sub". At runtime, JAXBElement
         //  instance contains the element name that has been
         //  substituted in the XML document.
         //
         @XmlElementRef(type=JAXBElement.class,name="operator")
         JAXBElement<? extends Operator> term;
     }

     @XmlRegistry
     class ObjectFactory {
         @XmlElementDecl(name="operator")
         JAXBElement<Operator> createOperator(Operator o) {...}
         @XmlElementDecl(name="add",substitutionHeadName="operator")
         JAXBElement<Operator> createAdd(Operator o) {...}
         @XmlElementDecl(name="sub",substitutionHeadName="operator")
         JAXBElement<Operator> createSub(Operator o) {...}
     }

     class Operator {
         ...
     }

因此以下代码片段

Math m = new Math();
m.term = new ObjectFactory().createAdd(new Operator());
marshal(m);
将生成以下 XML 输出：
<math>
<add>...</add>
</math>

since | JAXB2.0
See also | javax.xml.bind.annotation.XmlElementRefs
英文文档：

Maps a JavaBean property to a XML element derived from property's type.

Usage

@XmlElementRef annotation can be used with a JavaBean property or from within XmlElementRefs

This annotation dynamically associates an XML element name with the JavaBean property. When a JavaBean property is annotated with XmlElement, the XML element name is statically derived from the JavaBean property name. However, when this annotation is used, the XML element name is derived from the instance of the type of the JavaBean property at runtime.

XML Schema substitution group support

XML Schema allows a XML document author to use XML element names that were not statically specified in the content model of a schema using substitution groups. Schema derived code provides support for substitution groups using an element property, (section 5.5.5, "Element Property" of JAXB 2.0 specification). An element property method signature is of the form:

     public void setTerm(JAXBElement<? extends Operator>);
     public JAXBElement<? extends Operator> getTerm();

An element factory method annotated with XmlElementDecl is used to create a JAXBElement instance, containing an XML element name. The presence of @XmlElementRef annotation on an element property indicates that the element name from JAXBElement instance be used instead of deriving an XML element name from the JavaBean property name.

The usage is subject to the following constraints:

  • If the collection item type (for collection property) or property type (for single valued property) is JAXBElement, then @XmlElementRef}.name() and @XmlElementRef.namespace() must point an element factory method with an @XmlElementDecl annotation in a class annotated with @XmlRegistry (usually ObjectFactory class generated by the schema compiler) :
    • @XmlElementDecl.name() must equal @XmlElementRef.name()
    • @XmlElementDecl.namespace() must equal @XmlElementRef.namespace().
  • If the collection item type (for collection property) or property type (for single valued property) is not JAXBElement, then the type referenced by the property or field must be annotated with XmlRootElement.
  • This annotation can be used with the following annotations: XmlElementWrapper, XmlJavaTypeAdapter.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Example 1: Ant Task Example

The following Java class hierarchy models an Ant build script. An Ant task corresponds to a class in the class hierarchy. The XML element name of an Ant task is indicated by the @XmlRootElement annotation on its corresponding class.
     @XmlRootElement(name="target")
     class Target {
         // The presence of @XmlElementRef indicates that the XML
         // element name will be derived from the @XmlRootElement
         // annotation on the type (for e.g. "jar" for JarTask).
         @XmlElementRef
         List<Task> tasks;
     }

     abstract class Task {
     }

     @XmlRootElement(name="jar")
     class JarTask extends Task {
         ...
     }

     @XmlRootElement(name="javac")
     class JavacTask extends Task {
         ...
     }

     <!-- XML Schema fragment -->
     <xs:element name="target" type="Target">
     <xs:complexType name="Target">
       <xs:sequence>
         <xs:choice maxOccurs="unbounded">
           <xs:element ref="jar">
           <xs:element ref="javac">
         </xs:choice>
       </xs:sequence>
     </xs:complexType>

Thus the following code fragment:

     Target target = new Target();
     target.tasks.add(new JarTask());
     target.tasks.add(new JavacTask());
     marshal(target);
will produce the following XML output:

     <target>
       <jar>
         ....
       </jar>
       <javac>
         ....
       </javac>
     </target>

It is not an error to have a class that extends Task that doesn't have XmlRootElement. But they can't show up in an XML instance (because they don't have XML element names).

Example 2: XML Schema Susbstitution group support

The following example shows the annotations for XML Schema substitution groups. The annotations and the ObjectFactory are derived from the schema.

     @XmlElement
     class Math {
         //  The value of type()is
         //  JAXBElement.class , which indicates the XML
         //  element name ObjectFactory - in general a class marked
         //  with @XmlRegistry. (See ObjectFactory below)
         //
         //  The name() is "operator", a pointer to a
         // factory method annotated with a
         //  XmlElementDecl with the name "operator". Since
         //  "operator" is the head of a substitution group that
         //  contains elements "add" and "sub" elements, "operator"
         //  element can be substituted in an instance document by
         //  elements "add" or "sub". At runtime, JAXBElement
         //  instance contains the element name that has been
         //  substituted in the XML document.
         //
         @XmlElementRef(type=JAXBElement.class,name="operator")
         JAXBElement<? extends Operator> term;
     }

     @XmlRegistry
     class ObjectFactory {
         @XmlElementDecl(name="operator")
         JAXBElement<Operator> createOperator(Operator o) {...}
         @XmlElementDecl(name="add",substitutionHeadName="operator")
         JAXBElement<Operator> createAdd(Operator o) {...}
         @XmlElementDecl(name="sub",substitutionHeadName="operator")
         JAXBElement<Operator> createSub(Operator o) {...}
     }

     class Operator {
         ...
     }

Thus, the following code fragment

     Math m = new Math();
     m.term = new ObjectFactory().createAdd(new Operator());
     marshal(m);
will produce the following XML output:
     <math>
       <add>...</add>
     </math>

Since:
JAXB2.0
Author:
  • Kohsuke Kawaguchi, Sun Microsystems,Inc.
  • Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlElementRefs

Optional Element Summary
String | name
String | namespace This parameter and name() are used to determine the XML element for the JavaBean property.
Class | type The Java type being referenced.

abstract public Class<T> type()
被引用的 Java 类型。

如果该值为 DEFAULT.class，则可以从 JavaBean 属性类型推导出该类型。

英文文档：

type

public abstract Class type
The Java type being referenced.

If the value is DEFAULT.class, the type is inferred from the the type of the JavaBean property.

Default:
javax.xml.bind.annotation.XmlElementRef.DEFAULT.class

abstract public String namespace()
可以使用此参数和 #name() 来确定 JavaBean 属性的 XML 元素。

如果 type() 是 JAXBElement.class，那么 namespace() 和 name() 指向带有 XmlElementDecl 的工厂方法。XML 元素名称是工厂方法的 XmlElementDecl 注释的元素名称，如果取自其替换组中的元素（替换组的头元素）在 XML 文档中已被替换，则 XML 元素名称取自替换元素的 XmlElementDecl。

如果 #type() 不是 JAXBElement.class，那么 XML 元素名称是与使用该类型上的 XmlRootElement 注释的类型静态关联的 XML 元素名称。如果没有使用 XmlElementDecl 注释该类型，那么它是一个错误。

如果 type() 不是 JAXBElement.class，那么此值必须是 ""。

英文文档：

namespace

public abstract String namespace
This parameter and name() are used to determine the XML element for the JavaBean property.

If type() is JAXBElement.class , then namespace() and name() point to a factory method with XmlElementDecl. The XML element name is the element name from the factory method's XmlElementDecl annotation or if an element from its substitution group (of which it is a head element) has been substituted in the XML document, then the element name is from the XmlElementDecl on the substituted element.

If type() is not JAXBElement.class, then the XML element name is the XML element name statically associated with the type using the annotation XmlRootElement on the type. If the type is not annotated with an XmlElementDecl, then it is an error.

If type() is not JAXBElement.class, then this value must be "".

Default:
""

abstract public String name()
See also namespace()
英文文档：

name

public abstract String name
See Also:
namespace()
Default:
"##default"
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlElementRefs (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlElementRefs

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlElementRefs

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

标记一个属性，该属性引用带有 XmlElement 或 JAXBElement 的类。

与元素属性（带有 XmlElement 注释的属性）比较，引用属性具有不同的替换语义。在将子类分配给属性时，元素属性将生成带有 @xsi:type 的相同标记名称，而引用属性则生成一个不同的标记名称（子类上的标记名称）。

此注释可与下列注释一起使用：XmlJavaTypeAdapter 和 XmlElementWrapper。

since | JAXB2.0
See also | javax.xml.bind.annotation.XmlElementWrapper, javax.xml.bind.annotation.XmlElementRef
英文文档：

Marks a property that refers to classes with XmlElement or JAXBElement.

Compared to an element property (property with XmlElement annotation), a reference property has a different substitution semantics. When a sub-class is assigned to a property, an element property produces the same tag name with @xsi:type, whereas a reference property produces a different tag name (the tag name that's on the the sub-class.)

This annotation can be used with the following annotations: XmlJavaTypeAdapter, XmlElementWrapper.

Since:
JAXB2.0
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlElementWrapper, XmlElementRef

Required Element Summary
 XmlElementRef[] value

Element Detail

abstract public XmlElementRef[] value()
英文文档：

value

public abstract XmlElementRef[] value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlElements (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlElements

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlElements

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

多个 @XmlElement 注释的容器。 在一个程序元素上不允许使用多个相同类型的注释。因此此注释用于充当多个 @XmlElements 的容器注释，如下所示：

 @XmlElements({ @XmlElement(...),@XmlElement(...) })

@XmlElements 注释可以与以下程序元素一起使用：

  • JavaBean 属性
  • 非 static、非 transient 字段
此注释用于注释 JavaBean 集合属性（如列表）。

用法

用法受到以下约束的限制：

  • 此注释可与以下注释一起使用：@XmlIDREF 和 @XmlElementWrapper。
  • 如果将 @XmlIDREF 也指定到 JavaBean 属性，那么每个 @XmlElement.type() 都必须包含使用 @XmlID 注释的 JavaBean 属性。

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

示例 1：映射到元素列表

    // Mapped code fragment
    public class Foo {
        @XmlElements(
            @XmlElement(name="A", type=Integer.class),
            @XmlElement(name="B", type=Float.class)
         }
         public List items;
    }

    <!-- XML Representation for a List of {1,2.5}
            XML output is not wrapped using another element -->
    ...
     1
     2.5
    ...

    <!-- XML Schema fragment -->
    <xs:complexType name="Foo">
      <xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="A" type="xs:int"/>
          <xs:element name="B" type="xs:float"/>
        <xs:choice>
      </xs:sequence>
    </xs:complexType>

示例 2：映射到使用另一个元素包装的元素列表

    // Mapped code fragment
    public class Foo {
        @XmlElementWrapper(name="bar")
        @XmlElements(
            @XmlElement(name="A", type=Integer.class),
            @XmlElement(name="B", type=Float.class)
        }
        public List items;
    }

    <!-- XML Schema fragment -->
    <xs:complexType name="Foo">
      <xs:sequence>
        <xs:element name="bar">
          <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="A" type="xs:int"/>
              <xs:element name="B" type="xs:float"/>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>

示例 3：根据类型使用适配器更改元素名称。

    class Foo {
       @XmlJavaTypeAdapter(QtoPAdapter.class)
       @XmlElements({
           @XmlElement(name="A",type=PX.class),
           @XmlElement(name="B",type=PY.class)
       })
       Q bar;
    }

    @XmlType abstract class P {...}
    @XmlType(name="PX") class PX extends P {...}
    @XmlType(name="PY") class PY extends P {...}

    <!-- XML Schema fragment -->
    <xs:complexType name="Foo">
      <xs:sequence>
        <xs:element name="bar">
          <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="A" type="PX"/>
              <xs:element name="B" type="PY"/>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>

since | JAXB2.0
See also | javax.xml.bind.annotation.XmlElement, javax.xml.bind.annotation.XmlElementRef, javax.xml.bind.annotation.XmlElementRefs, javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
英文文档：

A container for multiple @XmlElement annotations. Multiple annotations of the same type are not allowed on a program element. This annotation therefore serves as a container annotation for multiple @XmlElements as follows:

 @XmlElements({ @XmlElement(...),@XmlElement(...) })

The @XmlElements annnotation can be used with the following program elements:

  • a JavaBean property
  • non static, non transient field
This annotation is intended for annotation a JavaBean collection property (e.g. List).

Usage

The usage is subject to the following constraints:

  • This annotation can be used with the following annotations: @XmlIDREF, @XmlElementWrapper.
  • If @XmlIDREF is also specified on the JavaBean property, then each @XmlElement.type() must contain a JavaBean property annotated with @XmlID.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Example 1: Map to a list of elements

    // Mapped code fragment
    public class Foo {
        @XmlElements(
            @XmlElement(name="A", type=Integer.class),
            @XmlElement(name="B", type=Float.class)
         }
         public List items;
    }

    <!-- XML Representation for a List of {1,2.5}
            XML output is not wrapped using another element -->
    ...
     1
     2.5
    ...

    <!-- XML Schema fragment -->
    <xs:complexType name="Foo">
      <xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="A" type="xs:int"/>
          <xs:element name="B" type="xs:float"/>
        <xs:choice>
      </xs:sequence>
    </xs:complexType>

Example 2: Map to a list of elements wrapped with another element

    // Mapped code fragment
    public class Foo {
        @XmlElementWrapper(name="bar")
        @XmlElements(
            @XmlElement(name="A", type=Integer.class),
            @XmlElement(name="B", type=Float.class)
        }
        public List items;
    }

    <!-- XML Schema fragment -->
    <xs:complexType name="Foo">
      <xs:sequence>
        <xs:element name="bar">
          <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="A" type="xs:int"/>
              <xs:element name="B" type="xs:float"/>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>

Example 3: Change element name based on type using an adapter.

    class Foo {
       @XmlJavaTypeAdapter(QtoPAdapter.class)
       @XmlElements({
           @XmlElement(name="A",type=PX.class),
           @XmlElement(name="B",type=PY.class)
       })
       Q bar;
    }

    @XmlType abstract class P {...}
    @XmlType(name="PX") class PX extends P {...}
    @XmlType(name="PY") class PY extends P {...}

    <!-- XML Schema fragment -->
    <xs:complexType name="Foo">
      <xs:sequence>
        <xs:element name="bar">
          <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="A" type="PX"/>
              <xs:element name="B" type="PY"/>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>

Since:
JAXB2.0
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlElement, XmlElementRef, XmlElementRefs, XmlJavaTypeAdapter

Required Element Summary
 XmlElement[] value
Collection of @XmlElement annotations

Element Detail

abstract public XmlElement[] value()
@XmlElement 注释的集合。
英文文档：

value

public abstract XmlElement[] value
Collection of @XmlElement annotations

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlElementWrapper (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlElementWrapper

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlElementWrapper

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

生成一个包装 XML 表示形式的包装器元素。 此元素主要用于生成一个包装集合的包装器 XML 元素。因此，该注释支持以下两种形式的序列化。
//Example:code fragment
int[] names;

// XML Serialization Form 1 (Unwrapped collection)
<names> ...</names>
<names> ...</names>

// XML Serialization Form 2 ( Wrapped collection )
<wrapperElement>
<names> value-of-item </names>
<names> value-of-item </names>
       ....
</wrapperElement>

通过使用或不使用具有 nillable 属性的元素，两种序列化的 XML 形式可以表示 null 集合。

使用

@XmlElementWrapper 注释可以与以下程序元素一起使用：

  • JavaBean 属性
  • 非 static、非 transient 字段

用法受到以下约束的限制：

  • 该属性必须是一个集合属性
  • 此注释可与以下注释一起使用：XmlElement、XmlElements、XmlElementRef、XmlElementRefs、XmlJavaTypeAdapter。

有关其他公共消息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

since | JAXB2.0
See also | javax.xml.bind.annotation.XmlElement, javax.xml.bind.annotation.XmlElements, javax.xml.bind.annotation.XmlElementRef, javax.xml.bind.annotation.XmlElementRefs
英文文档：

Generates a wrapper element around XML representation. This is primarily intended to be used to produce a wrapper XML element around collections. The annotation therefore supports two forms of serialization shown below.

    //Example: code fragment
      int[] names;

    // XML Serialization Form 1 (Unwrapped collection)
    <names> ... </names>
    <names> ... </names>

    // XML Serialization Form 2 ( Wrapped collection )
    <wrapperElement>
       <names> value-of-item </names>
       <names> value-of-item </names>
       ....
    </wrapperElement>

The two serialized XML forms allow a null collection to be represented either by absence or presence of an element with a nillable attribute.

Usage

The @XmlElementWrapper annotation can be used with the following program elements:

  • JavaBean property
  • non static, non transient field

The usage is subject to the following constraints:

  • The property must be a collection property
  • This annotation can be used with the following annotations: XmlElement, XmlElements, XmlElementRef, XmlElementRefs, XmlJavaTypeAdapter
    • .

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Since:
JAXB2.0
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlElement, XmlElements, XmlElementRef, XmlElementRefs

Optional Element Summary
String | name Name of the XML wrapper element.
String | namespace XML target namespace of the XML wrapper element.
boolean | nillable If true, the absence of the collection is represented by using xsi:nil='true'.

abstract public String name()
XML 包装器元素的名称。默认情况下，XML 包装器元素的名称派生于 JavaBean 属性名称。
英文文档：

name

public abstract String name
Name of the XML wrapper element. By default, the XML wrapper element name is derived from the JavaBean property name.

Default:
"##default"

abstract public String namespace()
XML 包装器元素的 XML 目标名称空间。

如果该值为 "##default"，则名称空间通过以下方式确定：

  1. 如果封闭包中包含 XmlSchema 注释，并且其 elementFormDefault 为 QUALIFIED，则名称空间为封闭类的名称空间。
  2. 否则名称空间为 ""（这将导致在默认名称空间中生成非限定的元素）。
英文文档：

namespace

public abstract String namespace
XML target namespace of the XML wrapper element.

If the value is "##default", then the namespace is determined as follows:

  1. If the enclosing package has XmlSchema annotation, and its elementFormDefault is QUALIFIED, then the namespace of the enclosing class.
  2. Otherwise "" (which produces unqualified element in the default namespace.

Default:
"##default"

abstract public boolean nillable()
如果为 true，则使用 xsi:nil='true' 表示集合不存在。否则通过不使用该元素来表示集合不存在。
英文文档：

nillable

public abstract boolean nillable
If true, the absence of the collection is represented by using xsi:nil='true'. Otherwise, it is represented by the absence of the element.

Default:
false
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlEnum (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlEnum

@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface XmlEnum

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=TYPE)

将枚举类型 Enum 映射到 XML 表示形式。

此注释以及 XmlEnumValue 提供了枚举类型到 XML 表示形式的映射。

用法

@XmlEnum 注释能够与以下程序元素一起使用：

  • 枚举类型

用法受到以下约束的限制：

  • 此注释能够与以下其他注释一起使用：XmlType 和 XmlRootElement。

有关公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

枚举类型被映射到带有 enumeration facet 的模式简单类型。模式类型派生于 @XmlEnum.value() 中指定的 Java 类型。每个枚举常量 @XmlEnumValue 都必须有一个用于 @XmlEnum.value() 类型的有效词法表示形式。

示例：请参阅 XmlEnumValue 中的示例。

since JAXB2.0
英文文档：

Maps an enum type Enum to XML representation.

This annotation, together with XmlEnumValue provides a mapping of enum type to XML representation.

Usage

The @XmlEnum annotation can be used with the following program elements:

  • enum type

The usage is subject to the following constraints:

  • This annotation can be used the following other annotations: XmlType, XmlRootElement

See "Package Specification" in javax.xml.bind.package javadoc for additional common information

An enum type is mapped to a schema simple type with enumeration facets. The schema type is derived from the Java type to which @XmlEnum.value(). Each enum constant @XmlEnumValue must have a valid lexical representation for the type @XmlEnum.value() .

Examples: See examples in XmlEnumValue

Since:
JAXB2.0

Optional Element Summary
 Class<?> value
Java type that is mapped to a XML simple type.

abstract public Class<T> value()
映射到 XML 简单类型的 Java 类型。
英文文档：

value

public abstract Class<?> value
Java type that is mapped to a XML simple type.

Default:
java.lang.String.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlEnumValue (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlEnumValue

@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface XmlEnumValue

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=FIELD)

将 Enum 类型中的枚举常量映射到 XML 表示形式。

用法

@XmlEnumValue 注释可以与以下程序元素一起使用：

  • 枚举常量

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

此注释以及 XmlEnum 提供枚举类型到 XML 表示形式的映射。

枚举类型被映射到带有 enumeration facet 的模式简单类型。模式类型派生于 @XmlEnum.value() 中指定的 Java 类型。每个枚举常量 @XmlEnumValue 都必须有一个用于 @XmlEnum.value() 类型的有效词法表示形式。

在没有此注释的情况下，name() 用作 XML 表示形式。

示例 1：映射枚举常量名称 -> enumeration facet

     //Example: Code fragment
     @XmlEnum(String.class)
     public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }

     <!-- Example: XML Schema fragment -->
     <xs:simpleType name="Card">
       <xs:restriction base="xs:string"/>
         <xs:enumeration value="CLUBS"/>
         <xs:enumeration value="DIAMONDS"/>
         <xs:enumeration value="HEARTS"/>
         <xs:enumeration value="SPADES"/>
     </xs:simpleType>

示例 2：映射枚举常量名称（值） -> enumeration facet

     //Example: code fragment
     @XmlType
     @XmlEnum(Integer.class)
     public enum Coin {
         @XmlEnumValue("1") PENNY(1),
         @XmlEnumValue("5") NICKEL(5),
         @XmlEnumValue("10") DIME(10),
         @XmlEnumValue("25") QUARTER(25) }

     <!-- Example: XML Schema fragment -->
     <xs:simpleType name="Coin">
       <xs:restriction base="xs:int">
         <xs:enumeration value="1"/>
         <xs:enumeration value="5"/>
         <xs:enumeration value="10"/>
         <xs:enumeration value="25"/>
       </xs:restriction>
     </xs:simpleType>

示例 3：映射枚举常量名称 -> enumeration facet

     //Code fragment
     @XmlType
     @XmlEnum(Integer.class)
     public enum Code {
         @XmlEnumValue("1") ONE,
         @XmlEnumValue("2") TWO;
     }

     <!-- Example: XML Schema fragment -->
     <xs:simpleType name="Code">
       <xs:restriction base="xs:int">
         <xs:enumeration value="1"/>
         <xs:enumeration value="2"/>
       </xs:restriction>
     </xs:simpleType>
since JAXB 2.0
英文文档：

Maps an enum constant in Enum type to XML representation.

Usage

The @XmlEnumValue annotation can be used with the following program elements:

  • enum constant

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

This annotation, together with XmlEnum provides a mapping of enum type to XML representation.

An enum type is mapped to a schema simple type with enumeration facets. The schema type is derived from the Java type specified in @XmlEnum.value(). Each enum constant @XmlEnumValue must have a valid lexical representation for the type @XmlEnum.value()

In the absence of this annotation, Enum.name() is used as the XML representation.

Example 1: Map enum constant name -> enumeration facet

     //Example: Code fragment
     @XmlEnum(String.class)
     public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }

     <!-- Example: XML Schema fragment -->
     <xs:simpleType name="Card">
       <xs:restriction base="xs:string"/>
         <xs:enumeration value="CLUBS"/>
         <xs:enumeration value="DIAMONDS"/>
         <xs:enumeration value="HEARTS"/>
         <xs:enumeration value="SPADES"/>
     </xs:simpleType>

Example 2: Map enum constant name(value) -> enumeration facet

     //Example: code fragment
     @XmlType
     @XmlEnum(Integer.class)
     public enum Coin {
         @XmlEnumValue("1") PENNY(1),
         @XmlEnumValue("5") NICKEL(5),
         @XmlEnumValue("10") DIME(10),
         @XmlEnumValue("25") QUARTER(25) }

     <!-- Example: XML Schema fragment -->
     <xs:simpleType name="Coin">
       <xs:restriction base="xs:int">
         <xs:enumeration value="1"/>
         <xs:enumeration value="5"/>
         <xs:enumeration value="10"/>
         <xs:enumeration value="25"/>
       </xs:restriction>
     </xs:simpleType>

Example 3: Map enum constant name -> enumeration facet

     //Code fragment
     @XmlType
     @XmlEnum(Integer.class)
     public enum Code {
         @XmlEnumValue("1") ONE,
         @XmlEnumValue("2") TWO;
     }

     <!-- Example: XML Schema fragment -->
     <xs:simpleType name="Code">
       <xs:restriction base="xs:int">
         <xs:enumeration value="1"/>
         <xs:enumeration value="2"/>
       </xs:restriction>
     </xs:simpleType>

Since:
JAXB 2.0

Required Element Summary
 String value

Element Detail

abstract public String value()
英文文档：

value

public abstract String value
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlID (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlID

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlID

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

将 JavaBean 属性映射到 XML ID。

要在 XML 序列化然后反序列化这一过程中保持对象图形的引用完整性，需要通过使用引用或容器适当地对对象引用进行编组。注释 @XmlID 和 @XmlIDREF 一起使用时允许通过容器或引用来实现 JavaBean 属性类型的自定义映射。

用法

@XmlID 注释能够与以下程序元素一起使用：
  • JavaBean 属性
  • 非 static、非 transient 字段

有关公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

用法受到以下约束的限制：
  • 只能使用 @XmlID 注释一个类中最多一个字段或属性。
  • JavaBean 属性的类型必须是 java.lang.String。
  • 能够与 @XmlID 一起使用的其他映射注释只有 @XmlElement 和 @XmlAttribute。

示例：将 JavaBean 属性的类型映射到 xs:ID

    // Example: code fragment
    public class Customer {
        @XmlAttribute
        @XmlID
        public String getCustomerID();
        public void setCustomerID(String id);
        .... other properties not shown
    }

    <!-- Example: XML Schema fragment -->
    <xs:complexType name="Customer">
      <xs:complexContent>
        <xs:sequence>
          ....
        </xs:sequence>
        <xs:attribute name="customerID" type="xs:ID"/>
      </xs:complexContent>
    </xs:complexType>
since | JAXB2.0
version
en
$Revision: 1.5 $
See also | javax.xml.bind.annotation.XmlIDREF
英文文档：

Maps a JavaBean property to XML ID.

To preserve referential integrity of an object graph across XML serialization followed by a XML deserialization, requires an object reference to be marshalled by reference or containment appropriately. Annotations @XmlID and @XmlIDREF together allow a customized mapping of a JavaBean property's type by containment or reference.

Usage

The @XmlID annotation can be used with the following program elements:
  • a JavaBean property
  • non static, non transient field

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

The usage is subject to the following constraints:
  • At most one field or property in a class can be annotated with @XmlID.
  • The JavaBean property's type must be java.lang.String.
  • The only other mapping annotations that can be used with @XmlID are:@XmlElement and @XmlAttribute.

Example: Map a JavaBean property's type to xs:ID

    // Example: code fragment
    public class Customer {
        @XmlAttribute
        @XmlID
        public String getCustomerID();
        public void setCustomerID(String id);
        .... other properties not shown
    }

    <!-- Example: XML Schema fragment -->
    <xs:complexType name="Customer">
      <xs:complexContent>
        <xs:sequence>
          ....
        </xs:sequence>
        <xs:attribute name="customerID" type="xs:ID"/>
      </xs:complexContent>
    </xs:complexType>

Since:
JAXB2.0
Version:
$Revision: 1.5 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlIDREF

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlIDREF (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlIDREF

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlIDREF

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

将 JavaBean 属性映射到 XML IDREF。

要在 XML 序列化然后反序列化这一过程中保持对象图形的引用完整性，需要通过使用引用或容器适当地对对象引用进行编组。注释 @XmlID 和 @XmlIDREF 一起使用时允许通过容器或引用来实现 JavaBean 属性类型的自定义映射。

用法

@XmlIDREF 注释能够与以下程序元素一起使用：
  • JavaBean 属性
  • 非 static、非 transient 字段

有关其他公共消息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

用法受到以下约束的限制：

  • 如果字段或属性的类型是一个 collection 类型，则集合项类型必须包含一个用 @XmlID 注释的属性或字段。
  • 如果字段或属性的类型是 single valued，则属性或字段的类型必须包含一个用 @XmlID 注释的属性或字段。

    注：如果集合项类型或属性的类型（用于非 collection 类型）是 java.lang.Object，则该实例必须包含一个用 @XmlID 属性注释的属性/字段。

  • 此注释可与以下注释一起使用：XmlElement、XmlAttribute、XmlList 和 XmlElements。

示例：将 JavaBean 属性映射到 xs:IDREF（即通过引用而不是通过包含）。

   //EXAMPLE: Code fragment
   public class Shipping {
       @XmlIDREF public Customer getCustomer();
       public void setCustomer(Customer customer);
       ....
    }

   <!-- Example: XML Schema fragment -->
   <xs:complexType name="Shipping">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:IDREF"/>
         ....
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

示例 2：以下是一个对比容器与引用的完整示例。

    // By default, Customer maps to complex type xs:Customer
    public class Customer {

        // map JavaBean property type to xs:ID
        @XmlID public String getCustomerID();
        public void setCustomerID(String id);

        // .... other properties not shown
    }

   // By default, Invoice maps to a complex type xs:Invoice
   public class Invoice {

       // map by reference
       @XmlIDREF public Customer getCustomer();
       public void setCustomer(Customer customer);

      // .... other properties not shown here
   }

   // By default, Shipping maps to complex type xs:Shipping
   public class Shipping {

       // map by reference
       @XmlIDREF public Customer getCustomer();
       public void setCustomer(Customer customer);
   }

   // at least one class must reference Customer by containment;
   // Customer instances won't be marshalled.
   @XmlElement(name="CustomerData")
   public class CustomerData {
       // map reference to Customer by containment by default.
       public Customer getCustomer();

       // maps reference to Shipping by containment by default.
       public Shipping getShipping();

       // maps reference to Invoice by containment by default.
       public Invoice getInvoice();
   }

   <!-- XML Schema mapping for above code frament -->

   <xs:complexType name="Invoice">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:IDREF"/>
         ....
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="Shipping">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:IDREF"/>
         ....
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="Customer">
     <xs:complexContent>
       <xs:sequence>
         ....
       </xs:sequence>
       <xs:attribute name="CustomerID" type="xs:ID"/>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="CustomerData">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:Customer"/>
         <xs:element name="shipping" type="xs:Shipping"/>
         <xs:element name="invoice"  type="xs:Invoice"/>
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

   <xs:element name"customerData" type="xs:CustomerData"/>

   <!-- Instance document conforming to the above XML Schema -->
    <customerData>
       <customer customerID="Alice">
           ....
       </customer>

       <shipping customer="Alice">
           ....
       </shipping>

       <invoice customer="Alice">
           ....
       </invoice>
   </customerData>

示例 3：将列表映射到 IDREF 类型的重复元素。

     // Code fragment
     public class Shipping {
         @XmlIDREF
         @XmlElement(name="Alice")
             public List customers;
     }

     <!-- XML schema fragment -->
     <xs:complexType name="Shipping">
       <xs:sequence>
         <xs:choice minOccurs="0" maxOccurs="unbounded">
           <xs:element name="Alice" type="xs:IDREF"/>
         </xs:choice>
       </xs:sequence>
     </xs:complexType>

示例 4：将列表映射到 IDREF 类型的元素列表。

     //Code fragment
     public class Shipping {
         @XmlIDREF
         @XmlElements(
             @XmlElement(name="Alice", type="Customer.class")
              @XmlElement(name="John", type="InternationalCustomer.class")
         public List customers;
     }

     <!-- XML Schema fragment -->
     <xs:complexType name="Shipping">
       <xs:sequence>
         <xs:choice minOccurs="0" maxOccurs="unbounded">
           <xs:element name="Alice" type="xs:IDREF"/>
           <xs:element name="John" type="xs:IDREF"/>
         </xs:choice>
       </xs:sequence>
     </xs:complexType>
since | JAXB2.0
version
en
$Revision: 1.12 $
See also | javax.xml.bind.annotation.XmlID
英文文档：

Maps a JavaBean property to XML IDREF.

To preserve referential integrity of an object graph across XML serialization followed by a XML deserialization, requires an object reference to be marshalled by reference or containment appropriately. Annotations @XmlID and @XmlIDREF together allow a customized mapping of a JavaBean property's type by containment or reference.

Usage

The @XmlIDREF annotation can be used with the following program elements:
  • a JavaBean property
  • non static, non transient field

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

The usage is subject to the following constraints:

  • If the type of the field or property is a collection type, then the collection item type must contain a property or field annotated with @XmlID.
  • If the field or property is single valued, then the type of the property or field must contain a property or field annotated with @XmlID.

    Note: If the collection item type or the type of the property (for non collection type) is java.lang.Object, then the instance must contain a property/field annotated with @XmlID attribute.

  • This annotation can be used with the following annotations: XmlElement, XmlAttribute, XmlList, and XmlElements.

Example: Map a JavaBean property to xs:IDREF (i.e. by reference rather than by containment)

   //EXAMPLE: Code fragment
   public class Shipping {
       @XmlIDREF public Customer getCustomer();
       public void setCustomer(Customer customer);
       ....
    }

   <!-- Example: XML Schema fragment -->
   <xs:complexType name="Shipping">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:IDREF"/>
         ....
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

Example 2: The following is a complete example of containment versus reference.

    // By default, Customer maps to complex type xs:Customer
    public class Customer {

        // map JavaBean property type to xs:ID
        @XmlID public String getCustomerID();
        public void setCustomerID(String id);

        // .... other properties not shown
    }

   // By default, Invoice maps to a complex type xs:Invoice
   public class Invoice {

       // map by reference
       @XmlIDREF public Customer getCustomer();
       public void setCustomer(Customer customer);

      // .... other properties not shown here
   }

   // By default, Shipping maps to complex type xs:Shipping
   public class Shipping {

       // map by reference
       @XmlIDREF public Customer getCustomer();
       public void setCustomer(Customer customer);
   }

   // at least one class must reference Customer by containment;
   // Customer instances won't be marshalled.
   @XmlElement(name="CustomerData")
   public class CustomerData {
       // map reference to Customer by containment by default.
       public Customer getCustomer();

       // maps reference to Shipping by containment by default.
       public Shipping getShipping();

       // maps reference to Invoice by containment by default.
       public Invoice getInvoice();
   }

   <!-- XML Schema mapping for above code frament -->

   <xs:complexType name="Invoice">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:IDREF"/>
         ....
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="Shipping">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:IDREF"/>
         ....
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="Customer">
     <xs:complexContent>
       <xs:sequence>
         ....
       </xs:sequence>
       <xs:attribute name="CustomerID" type="xs:ID"/>
     </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="CustomerData">
     <xs:complexContent>
       <xs:sequence>
         <xs:element name="customer" type="xs:Customer"/>
         <xs:element name="shipping" type="xs:Shipping"/>
         <xs:element name="invoice"  type="xs:Invoice"/>
       </xs:sequence>
     </xs:complexContent>
   </xs:complexType>

   <xs:element name"customerData" type="xs:CustomerData"/>

   <!-- Instance document conforming to the above XML Schema -->
    <customerData>
       <customer customerID="Alice">
           ....
       </customer>

       <shipping customer="Alice">
           ....
       </shipping>

       <invoice customer="Alice">
           ....
       </invoice>
   </customerData>

Example 3: Mapping List to repeating element of type IDREF

     // Code fragment
     public class Shipping {
         @XmlIDREF
         @XmlElement(name="Alice")
             public List customers;
     }

     <!-- XML schema fragment -->
     <xs:complexType name="Shipping">
       <xs:sequence>
         <xs:choice minOccurs="0" maxOccurs="unbounded">
           <xs:element name="Alice" type="xs:IDREF"/>
         </xs:choice>
       </xs:sequence>
     </xs:complexType>

Example 4: Mapping a List to a list of elements of type IDREF.

     //Code fragment
     public class Shipping {
         @XmlIDREF
         @XmlElements(
             @XmlElement(name="Alice", type="Customer.class")
              @XmlElement(name="John", type="InternationalCustomer.class")
         public List customers;
     }

     <!-- XML Schema fragment -->
     <xs:complexType name="Shipping">
       <xs:sequence>
         <xs:choice minOccurs="0" maxOccurs="unbounded">
           <xs:element name="Alice" type="xs:IDREF"/>
           <xs:element name="John" type="xs:IDREF"/>
         </xs:choice>
       </xs:sequence>
     </xs:complexType>

Since:
JAXB2.0
Version:
$Revision: 1.12 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlID

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlInlineBinaryData (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlInlineBinaryData

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,TYPE})
public @interface XmlInlineBinaryData

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD, TYPE})

禁止对绑定到 XML 中 base64-encoded 二进制数据的数据类型进行 XOP 编码。

当启用 XOP 编码时（如 isXOPPackage() 中所述），此注释禁用绑定到 base64-encoded 二进制数据的数据类型（如 Image、Source 或 byte[]），从而防止对它们进行 XOP 编码。如果 JAXB 属性使用此注释进行注释，或者 JAXB 属性的基本类型使用此注释进行注释，那么永远不会对该属性调用 addMtomAttachment(DataHandler, String, String) 和 addMtomAttachment(byte[], int, int, String, String, String)。二进制数据将总是被内联。

since JAXB2.0
英文文档：

Disable consideration of XOP encoding for datatypes that are bound to base64-encoded binary data in XML.

When XOP encoding is enabled as described in AttachmentMarshaller.isXOPPackage(), this annotation disables datatypes such as Image or Source or byte[] that are bound to base64-encoded binary from being considered for XOP encoding. If a JAXB property is annotated with this annotation or if the JAXB property's base type is annotated with this annotation, neither AttachmentMarshaller.addMtomAttachment(DataHandler, String, String) nor AttachmentMarshaller.addMtomAttachment(byte[], int, int, String, String, String) is ever called for the property. The binary data will always be inlined.

Since:
JAXB2.0
Author:
Joseph Fialli

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlList (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlList

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER})
public @interface XmlList

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD, PARAMETER})

用来将属性映射到列表简单类型。

用法

@XmlList 注释能够与以下程序元素一起使用：

  • JavaBean 属性
  • 字段

在集合属性仅使用 @XmlElement 进行注释时，将通过元素包装集合中的每一个项。例如，

 @XmlRootElement
 class Foo {
     @XmlElement
     List<String> data;
 }
将生成如下 XML：

 <foo>
<data>abc</data>
<data>def</data>
 </foo>
另一方面，@XmlList 注释允许将多个值表示为单个元素中以空格分隔的标记。例如，
 @XmlRootElement
 class Foo {
     @XmlElement
     @XmlList
     List<String> data;
 }
上述代码将生成如下 XML：

 <foo>
<data>abc def</data>
 </foo>

此注释可与以下注释一起使用：XmlElement、XmlAttribute、XmlValue 和 XmlIDREF。

  • 使用 @XmlList 和 XmlValue（在允许的情况下）是多余的，因为 XmlList 将集合类型映射到一个简单模式类型，该简单模式类型就像 XmlValue 那样是由列表派生的。
  • 使用 @XmlList 和 XmlAttribute（在允许的情况下）是多余的，因为 XmlList 将集合类型映射到一个简单模式类型，该简单模式类型就像 XmlAttribute 那样是由列表派生的。
since JAXB2.0
英文文档：

Used to map a property to a list simple type.

Usage

The @XmlList annotation can be used with the following program elements:

  • JavaBean property
  • field

When a collection property is annotated just with @XmlElement, each item in the collection will be wrapped by an element. For example,

 @XmlRootElement
 class Foo {
     @XmlElement
     List<String> data;
 }
would produce XML like this:

 <foo>
   <data>abc</data>
   <data>def</data>
 </foo>
@XmlList annotation, on the other hand, allows multiple values to be represented as whitespace-separated tokens in a single element. For example,
 @XmlRootElement
 class Foo {
     @XmlElement
     @XmlList
     List<String> data;
 }
the above code will produce XML like this:

 <foo>
   <data>abc def</data>
 </foo>

This annotation can be used with the following annotations: XmlElement, XmlAttribute, XmlValue, XmlIDREF.

  • The use of @XmlList with XmlValue while allowed, is redundant since XmlList maps a collection type to a simple schema type that derives by list just as XmlValue would.
  • The use of @XmlList with XmlAttribute while allowed, is redundant since XmlList maps a collection type to a simple schema type that derives by list just as XmlAttribute would.

Since:
JAXB2.0
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Sekhar Vajjhala, Sun Microsystems, Inc.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlMimeType (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlMimeType

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER})
public @interface XmlMimeType

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD, PARAMETER})

关联控制属性 XML 表示形式的 MIME 类型。

此注释与绑定到 XML 中 base64-encoded 二进制数据的数据类型（如 Image 或 Source）一起使用。

如果包含此注释的属性具有绑定到 xmime:contentType 属性的同级属性，并且该属性的实例中有一个值，那么该属性值具有优先权并且将控制编组。

since JAXB2.0
英文文档：

Associates the MIME type that controls the XML representation of the property.

This annotation is used in conjunction with datatypes such as Image or Source that are bound to base64-encoded binary in XML.

If a property that has this annotation has a sibling property bound to the xmime:contentType attribute, and if in the instance the property has a value, the value of the attribute takes precedence and that will control the marshalling.

Since:
JAXB2.0
Author:
Kohsuke Kawaguchi

Required Element Summary
 String value
The textual representation of the MIME type, such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.

Element Detail

abstract public String value()
MIME 类型的文本表现形式，如 "image/jpeg"、"image/*"、"text/xml; charset=iso-8859-1" 等等。
英文文档：

value

public abstract String value
The textual representation of the MIME type, such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlMixed (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlMixed

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlMixed

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

注释 JavaBean 多值属性，以支持混合内容。

用法受到以下约束的限制：

  • 能够与 @XmlElementRef、@XmlElementRefs 或 @XmlAnyElement 一起使用。

以下内容可以插入 @XmlMixed 注释的多值属性中：

  • XML 文本信息项将作为 java.lang.String 值添加。
  • 子元素信息项将作为 JAXBElement 实例或带有使用 @XmlRootElement 注释的类的实例添加。
  • 没有绑定到 JAXB 映射类的未知内容将作为 Element 插入。（假定已使用 @XmlAnyElement 对属性进行注释。）
以下是绑定和创建混合内容的一个示例：

  <!-- schema fragment having  mixed content -->
  <xs:complexType name="letterBody" mixed="true">
    <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    <xs:element name="quantity" type="xs:positiveInteger"/>
    <xs:element name="productName" type="xs:string"/>
    <!-- etc. -->
    </xs:sequence>
  </xs:complexType>
  <xs:element name="letterBody" type="letterBody"/>

 // Schema-derived Java code:
 // (Only annotations relevant to mixed content are shown below,
 //  others are ommitted.)
 import java.math.BigInteger;
 public class ObjectFactory {
     // element instance factories
     JAXBElement<LetterBody> createLetterBody(LetterBody value);
     JAXBElement<String>     createLetterBodyName(String value);
     JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
     JAXBElement<String>     createLetterBodyProductName(String value);
      // type instance factory
     LetterBody> createLetterBody();
 }

 public class LetterBody {
     // Mixed content can contain instances of Element classes
     // Name, Quantity and ProductName. Text data is represented as
    // java.util.String for text.
    @XmlMixed
     @XmlElementRefs({
        @XmlElementRef(name="productName", type=JAXBElement.class),
        @XmlElementRef(name="quantity", type=JAXBElement.class),
        @XmlElementRef(name="name", type=JAXBElement.class)})
    List getContent(){...}
 }
以下是具有混合内容的一个 XML 实例文档：

 <letterBody>
Dear Mr.<name>Robert Smith</name>
Your order of <quantity>1</quantity> <productName>Baby
Monitor</productName> shipped from our warehouse. ....
 </letterBody>
可以使用以下 JAXB API 调用来构造上述文档：

LetterBody lb = ObjectFactory.createLetterBody();
JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
List gcl = lb.getContent();  //add mixed content to general content property.
gcl.add(&quot;Dear Mr.&quot;);  // add text information item as a String.

// add child element information item
gcl.add(ObjectFactory.createLetterBodyName(&quot;Robert Smith&quot;));
gcl.add(&quot;Your order of &quot;); // add text information item as a String

// add children element information items
gcl.add(ObjectFactory.
             createLetterBodyQuantity(new BigInteger(&quot;1&quot;)));
gcl.add(ObjectFactory.createLetterBodyProductName(&quot;Baby Monitor&quot;));
gcl.add(&quot;shipped from our warehouse&quot;);  // add text information item

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

since JAXB2.0
英文文档：

Annotate a JavaBean multi-valued property to support mixed content.

The usage is subject to the following constraints:

  • can be used with @XmlElementRef, @XmlElementRefs or @XmlAnyElement

The following can be inserted into @XmlMixed annotated multi-valued property

  • XML text information items are added as values of java.lang.String.
  • Children element information items are added as instances of JAXBElement or instances with a class that is annotated with @XmlRootElement.
  • Unknown content that is not be bound to a JAXB mapped class is inserted as Element. (Assumes property annotated with @XmlAnyElement)
Below is an example of binding and creation of mixed content.

  <!-- schema fragment having  mixed content -->
  <xs:complexType name="letterBody" mixed="true">
    <xs:sequence>
        <xs:element name="name" type="xs:string"/>
        <xs:element name="quantity" type="xs:positiveInteger"/>
        <xs:element name="productName" type="xs:string"/>
        <!-- etc. -->
    </xs:sequence>
  </xs:complexType>
  <xs:element name="letterBody" type="letterBody"/>

 // Schema-derived Java code:
 // (Only annotations relevant to mixed content are shown below,
 //  others are ommitted.)
 import java.math.BigInteger;
 public class ObjectFactory {
        // element instance factories
        JAXBElement<LetterBody> createLetterBody(LetterBody value);
        JAXBElement<String>     createLetterBodyName(String value);
        JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
        JAXBElement<String>     createLetterBodyProductName(String value);
      // type instance factory
        LetterBody> createLetterBody();
 }

 public class LetterBody {
        // Mixed content can contain instances of Element classes
        // Name, Quantity and ProductName. Text data is represented as
        // java.util.String for text.
        @XmlMixed
        @XmlElementRefs({
                @XmlElementRef(name="productName", type=JAXBElement.class),
                @XmlElementRef(name="quantity", type=JAXBElement.class),
                @XmlElementRef(name="name", type=JAXBElement.class)})
        List getContent(){...}
 }
The following is an XML instance document with mixed content

 <letterBody>
 Dear Mr.<name>Robert Smith</name>
 Your order of <quantity>1</quantity> <productName>Baby
 Monitor</productName> shipped from our warehouse. ....
 </letterBody>
that can be constructed using following JAXB API calls.

 LetterBody lb = ObjectFactory.createLetterBody();
 JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
 List gcl = lb.getContent();  //add mixed content to general content property.
 gcl.add("Dear Mr.");  // add text information item as a String.

 // add child element information item
 gcl.add(ObjectFactory.createLetterBodyName("Robert Smith"));
 gcl.add("Your order of "); // add text information item as a String

 // add children element information items
 gcl.add(ObjectFactory.
                        createLetterBodyQuantity(new BigInteger("1")));
 gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));
 gcl.add("shipped from our warehouse");  // add text information item

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Since:
JAXB2.0
Author:
Kohsuke Kawaguchi

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlNs (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlNs

@Retention(value=RUNTIME)
@Target(value={})
public @interface XmlNs

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={})

关联名称空间前缀与 XML 名称空间 URI。

用法

@XmlNs 注释用于从其他程序注释中使用。

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

示例：有关示例，请参阅 XmlSchema 注释类型。

since JAXB2.0
version
en
$Revision: 1.3 $
英文文档：

Associates a namespace prefix with a XML namespace URI.

Usage

@XmlNs annotation is intended for use from other program annotations.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Example:See XmlSchema annotation type for an example.

Since:
JAXB2.0
Version:
$Revision: 1.3 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.

Required Element Summary
String | namespaceURI Namespace URI
String | prefix Namespace prefix

Element Detail

abstract public String prefix()
名称空间前缀。
英文文档：

prefix

public abstract String prefix
Namespace prefix

abstract public String namespaceURI()
名称空间 URI。
英文文档：

namespaceURI

public abstract String namespaceURI
Namespace URI

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlRegistry (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlRegistry

@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface XmlRegistry

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=TYPE)

标记具有 XmlElementDecl 的类。
since | JAXB 2.0
See also | javax.xml.bind.annotation.XmlElementDecl
英文文档：

Marks a class that has XmlElementDecls.

Since:
JAXB 2.0
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlElementDecl

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlRootElement (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlRootElement

@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface XmlRootElement

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=TYPE)

将类或枚举类型映射到 XML 元素。

用法

@XmlRootElement 注释可以与以下程序元素一起使用：

  • 顶层类
  • 枚举类型

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

当使用 @XmlRootElement 注释对顶层类或枚举类型进行注释时，类型值被表示为 XML 文档中的 XML 元素。

此注释可与以下注释一起使用： XmlType、XmlEnum、XmlAccessorType、 XmlAccessorOrder。

示例 1：将元素与 XML 模式类型关联

     // Example: Code fragment
     @XmlRootElement
     class Point {
        int x;
        int y;
        Point(int _x,int _y) {x=_x;y=_y;}
     }

     //Example: Code fragment corresponding to XML output
     marshal( new Point(3,5), System.out);

     <!-- Example: XML output -->
     <point>
       <x> 3 </x>
       <y> 5 </y>
     </point>
该注释会导致在模式中生成全局元素声明。全局元素声明与类映射到的 XML 模式类型关联。

&lt;!-- Example:XML schema definition --&gt;
     <xs:element name="point" type="point"/>
     <xs:complexType name="point">
       <xs:sequence>
         <xs:element name="x" type="xs:int"/>
         <xs:element name="y" type="xs:int"/>
       </xs:sequence>
     </xs:complexType>

示例 2：类型继承的正交性

某一类型上注释的元素声明不会被其派生类型继承。以下示例显示了这一点：

     // Example: Code fragment
     @XmlRootElement
     class Point3D extends Point {
         int z;
         Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
     }

     //Example: Code fragment corresponding to XML output *
     marshal( new Point3D(3,5,0), System.out );

     <!-- Example: XML output -->
     <!-- The element name is point3D not point -->
     <point3D>
       <x>3</x>
       <y>5</y>
       <z>0</z>
     </point3D>

     <!-- Example: XML schema definition -->
     <xs:element name="point3D" type="point3D"/>
     <xs:complexType name="point3D">
       <xs:complexContent>
         <xs:extension base="point">
           <xs:sequence>
             <xs:element name="z" type="xs:int"/>
           </xs:sequence>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
示例 3：将全局元素与该类映射到的 XML 模式类型关联。
     //Example: Code fragment
     @XmlRootElement(name="PriceElement")
     public class USPrice {
         @XmlElement
         public java.math.BigDecimal price;
     }

     <!-- Example: XML schema definition -->
     <xs:element name="PriceElement" type="USPrice"/>
     <xs:complexType name="USPrice">
       <xs:sequence>
         <xs:element name="price" type="xs:decimal"/>
       </sequence>
     </xs:complexType>
since JAXB2.0
英文文档：

Maps a class or an enum type to an XML element.

Usage

The @XmlRootElement annotation can be used with the following program elements:

  • a top level class
  • an enum type

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

When a top level class or an enum type is annotated with the @XmlRootElement annotation, then its value is represented as XML element in an XML document.

This annotation can be used with the following annotations: XmlType, XmlEnum, XmlAccessorType, XmlAccessorOrder.

Example 1: Associate an element with XML Schema type

     // Example: Code fragment
     @XmlRootElement
     class Point {
        int x;
        int y;
        Point(int _x,int _y) {x=_x;y=_y;}
     }

     //Example: Code fragment corresponding to XML output
     marshal( new Point(3,5), System.out);

     <!-- Example: XML output -->
     <point>
       <x> 3 </x>
       <y> 5 </y>
     </point>
The annotation causes an global element declaration to be produced in the schema. The global element declaration is associated with the XML schema type to which the class is mapped.

     <!-- Example: XML schema definition -->
     <xs:element name="point" type="point"/>
     <xs:complexType name="point">
       <xs:sequence>
         <xs:element name="x" type="xs:int"/>
         <xs:element name="y" type="xs:int"/>
       </xs:sequence>
     </xs:complexType>

Example 2: Orthogonality to type inheritance

An element declaration annotated on a type is not inherited by its derived types. The following example shows this.

     // Example: Code fragment
     @XmlRootElement
     class Point3D extends Point {
         int z;
         Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
     }

     //Example: Code fragment corresponding to XML output *
     marshal( new Point3D(3,5,0), System.out );

     <!-- Example: XML output -->
     <!-- The element name is point3D not point -->
     <point3D>
       <x>3</x>
       <y>5</y>
       <z>0</z>
     </point3D>

     <!-- Example: XML schema definition -->
     <xs:element name="point3D" type="point3D"/>
     <xs:complexType name="point3D">
       <xs:complexContent>
         <xs:extension base="point">
           <xs:sequence>
             <xs:element name="z" type="xs:int"/>
           </xs:sequence>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
Example 3: Associate a global element with XML Schema type to which the class is mapped.
     //Example: Code fragment
     @XmlRootElement(name="PriceElement")
     public class USPrice {
         @XmlElement
         public java.math.BigDecimal price;
     }

     <!-- Example: XML schema definition -->
     <xs:element name="PriceElement" type="USPrice"/>
     <xs:complexType name="USPrice">
       <xs:sequence>
         <xs:element name="price" type="xs:decimal"/>
       </sequence>
     </xs:complexType>

Since:
JAXB2.0
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.

Optional Element Summary
String | name local name of the XML element.
String | namespace namespace name of the XML element.

abstract public String namespace()
XML 元素的名称空间名。

如果该值为 "##default"，那么 XML 名称空间名派生于类 (XmlSchema) 的包。如果没有对包命名，那么 XML 名称空间是默认的空名称空间。

英文文档：

namespace

public abstract String namespace
namespace name of the XML element.

If the value is "##default", then the XML namespace name is derived from the package of the class ( XmlSchema ). If the package is unnamed, then the XML namespace is the default empty namespace.

Default:
"##default"

abstract public String name()
XML 元素的本地名称。

如果值为 "##default"，则名称派生于类名称。

英文文档：

name

public abstract String name
local name of the XML element.

If the value is "##default", then the name is derived from the class name.

Default:
"##default"
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlSchema (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlSchema

@Retention(value=RUNTIME)
@Target(value=PACKAGE)
public @interface XmlSchema

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=PACKAGE)

将包名称映射到 XML 名称空间。

用法

XmlSchema 注释可以与以下程序元素一起使用：

  • 包
这是一个包级别注释，它遵循 JSR 175 的第 III 节“注释”中的建议和限制。因此用法受到以下约束和建议的限制：
  • 正如 JSR 175 的第 III 节“注释”中所指出的那样，只能有一个包声明。
  • JSR 175 建议对包级别注释使用 package-info.java。遵循此建议的 JAXB 提供者将允许在 package-info.java 中定义包级别注释。

示例 1：自定义包将要映射到的 XML 名称空间名。

    @javax.xml.bind.annotation.XmlSchema (
      namespace = "http://www.example.com/MYPO1"
    )

    <!-- XML Schema fragment -->
    <schema
      xmlns=...
      xmlns:po=....
      targetNamespace="http://www.example.com/MYPO1"
    >
    <!-- prefixes generated by default are implementation
            depedenent -->

示例 2：自定义名称空间前缀、名称空间 URI 映射

    // Package level annotation
    @javax.xml.bind.annotation.XmlSchema (
      xmlns = {
        @javax.xml.bind.annotation.XmlNs(prefix = "po",
                   namespaceURI="http://www.example.com/myPO1"),

        @javax.xml.bind.annotation.XmlNs(prefix="xs",
                   namespaceURI="http://www.w3.org/2001/XMLSchema")
      )
    )

    <!-- XML Schema fragment -->
    <schema
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        targetNamespace="http://www.example.com/PO1">

示例 3：自定义 elementFormDefault

    @javax.xml.bind.annotation.XmlSchema (
      elementFormDefault=XmlNsForm.UNQUALIFIED
      ...
    )

    <!-- XML Schema fragment -->
    <schema
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        elementFormDefault="unqualified">
since JAXB2.0
version
en
$Revision: 1.9 $
英文文档：

Maps a package name to a XML namespace.

Usage

The XmlSchema annotation can be used with the following program elements:

  • package
This is a package level annotation and follows the recommendations and restrictions contained in JSR 175, section III, "Annotations". Thus the usage is subject to the following constraints and recommendations.
  • There can only be one package declaration as noted in JSR 175, section III, "Annotations".
  • JSR 175 recommends package-info.java for package level annotations. JAXB Providers that follow this recommendation will allow the package level annotations to be defined in package-info.java.

Example 1: Customize name of XML namespace to which package is mapped.

    @javax.xml.bind.annotation.XmlSchema (
      namespace = "http://www.example.com/MYPO1"
    )

    <!-- XML Schema fragment -->
    <schema
      xmlns=...
      xmlns:po=....
      targetNamespace="http://www.example.com/MYPO1"
    >
    <!-- prefixes generated by default are implementation
            depedenent -->

Example 2: Customize namespace prefix, namespace URI mapping

    // Package level annotation
    @javax.xml.bind.annotation.XmlSchema (
      xmlns = {
        @javax.xml.bind.annotation.XmlNs(prefix = "po",
                   namespaceURI="http://www.example.com/myPO1"),

        @javax.xml.bind.annotation.XmlNs(prefix="xs",
                   namespaceURI="http://www.w3.org/2001/XMLSchema")
      )
    )

    <!-- XML Schema fragment -->
    <schema
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        targetNamespace="http://www.example.com/PO1">

Example 3: Customize elementFormDefault

    @javax.xml.bind.annotation.XmlSchema (
      elementFormDefault=XmlNsForm.UNQUALIFIED
      ...
    )

    <!-- XML Schema fragment -->
    <schema
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        elementFormDefault="unqualified">

Since:
JAXB2.0
Version:
$Revision: 1.9 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.

Optional Element Summary
XmlNsForm | attributeFormDefault Namespace qualification for attributes.
XmlNsForm | elementFormDefault Namespace qualification for elements.
String | namespace Name of the XML namespace.
XmlNs[] | xmlns Customize the namespace URI, prefix associations.

abstract public XmlNs[] xmlns()
自定义名称空间 URI 和前缀的关联性。默认情况下，XML 名称空间的名称空间前缀是由 JAXB 提供者以与实现相关的方式生成的。
英文文档：

xmlns

public abstract XmlNs[] xmlns
Customize the namespace URI, prefix associations. By default, the namespace prefixes for a XML namespace are generated by a JAXB Provider in an implementation dependent way.

Default:
{}

abstract public String namespace()
XML 名称空间名。
英文文档：

namespace

public abstract String namespace
Name of the XML namespace.

Default:
""

abstract public XmlNsForm elementFormDefault()
元素的名称空间限制。默认情况下，元素默认属性不在 XML 模式片段中。
英文文档：

elementFormDefault

public abstract XmlNsForm elementFormDefault
Namespace qualification for elements. By default, element default attribute will be absent from the XML Schema fragment.

Default:
UNSET

abstract public XmlNsForm attributeFormDefault()
属性的名称空间限制。默认情况下，attributesFormDefault 不在 XML 模式片段中。
英文文档：

attributeFormDefault

public abstract XmlNsForm attributeFormDefault
Namespace qualification for attributes. By default, attributesFormDefault will be absent from the XML Schema fragment.

Default:
UNSET
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlSchemaType (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlSchemaType

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PACKAGE})
public @interface XmlSchemaType

Implements: Annotation
Inner classes: XmlSchemaType.DEFAULT
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD, PACKAGE})

将 Java 类型映射到一个简单的模式内置类型。

用法

@XmlSchemaType 注释可以与以下程序元素一起使用：

  • JavaBean 属性
  • 字段
  • 包

为 Java 类型定义的 @XmlSchemaType 注释可应用于所有对属性/字段中的 Java 类型的引用。在属性/字段中指定的 @XmlSchemaType 注释重写在包级别上指定的 @XmlSchemaType 注释。

此注释可与以下注释一起使用： XmlElement、XmlAttribute。

示例 1：自定义字段上的 XMLGregorianCalendar 的映射。

     //Example: Code fragment
     public class USPrice {
         @XmlElement
         @XmlSchemaType(name="date")
         public XMLGregorianCalendar date;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice"/>
       <xs:sequence>
         <xs:element name="date" type="xs:date"/>
       </sequence>
     </xs:complexType>

示例 2：自定义包级别的 XMLGregorianCalendar 的映射。

     package foo;
     @javax.xml.bind.annotation.XmlSchemaType(
          name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
     }
since JAXB2.0
英文文档：

Maps a Java type to a simple schema built-in type.

Usage

@XmlSchemaType annotation can be used with the following program elements:

  • a JavaBean property
  • field
  • package

@XmlSchemaType annotation defined for Java type applies to all references to the Java type from a property/field. A @XmlSchemaType annotation specified on the property/field overrides the @XmlSchemaType annotation specified at the package level.

This annotation can be used with the following annotations: XmlElement, XmlAttribute.

Example 1: Customize mapping of XMLGregorianCalendar on the field.

     //Example: Code fragment
     public class USPrice {
         @XmlElement
         @XmlSchemaType(name="date")
         public XMLGregorianCalendar date;
     }

     <!-- Example: Local XML Schema element -->
     <xs:complexType name="USPrice"/>
       <xs:sequence>
         <xs:element name="date" type="xs:date"/>
       </sequence>
     </xs:complexType>

Example 2: Customize mapping of XMLGregorianCalendar at package level

     package foo;
     @javax.xml.bind.annotation.XmlSchemaType(
          name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
     }

Since:
JAXB2.0

Required Element Summary
 String name
Optional Element Summary
String | namespace
Class | type If this annotation is used at the package level, then value of the type() must be specified.

Element Detail

abstract public String name()
英文文档：

name

public abstract String name

abstract public String namespace()
英文文档：

namespace

public abstract String namespace
Default:
"http://www.w3.org/2001/XMLSchema"

abstract public Class<T> type()
如果此注释用于包级别上，那么必须指定 type() 的值。
英文文档：

type

public abstract Class type
If this annotation is used at the package level, then value of the type() must be specified.

Default:
javax.xml.bind.annotation.XmlSchemaType.DEFAULT.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlSchemaTypes (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlSchemaTypes

@Retention(value=RUNTIME)
@Target(value=PACKAGE)
public @interface XmlSchemaTypes

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=PACKAGE)

多个 @XmlSchemaType 注释的容器。

在程序元素上不允许使用多个相同类型的注释。因此此注释用于充当多个 @XmlSchemaType 的容器注释，如下所示：

 @XmlSchemaTypes({ @XmlSchemaType(...), @XmlSchemaType(...) })

@XmlSchemaTypes 注释可用来在包级别上的定义不同类型的 XmlSchemaType。

有关其他公共消息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

since | JAXB2.0
See also | javax.xml.bind.annotation.XmlSchemaType
英文文档：

A container for multiple @XmlSchemaType annotations.

Multiple annotations of the same type are not allowed on a program element. This annotation therefore serves as a container annotation for multiple @XmlSchemaType annotations as follows:

 @XmlSchemaTypes({ @XmlSchemaType(...), @XmlSchemaType(...) })

The @XmlSchemaTypes annnotation can be used to define XmlSchemaType for different types at the package level.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Since:
JAXB2.0
Author:
  • Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlSchemaType

Required Element Summary
 XmlSchemaType[] value
Collection of @XmlSchemaType annotations

Element Detail

abstract public XmlSchemaType[] value()
@XmlSchemaType 注释的集合。
英文文档：

value

public abstract XmlSchemaType[] value
Collection of @XmlSchemaType annotations

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlTransient (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlTransient

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlTransient

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

阻止将 JavaBean 属性映射到 XML 表示形式。

@XmlTransient 注释对于解决 JavaBean 属性名称与字段名称之间的名称冲突，或者用于防止字段/属性的映射。当取消首字母大写的 JavaBean 属性名称与字段名称相同时，就可能发生名称冲突。如果 JavaBean 属性引用该字段，那么可以通过防止映射使用 @XmlTransient 注释的字段或 JavaBean 属性来解决名称冲突。

用法

@XmlTransient 注释可以与以下程序元素一起使用：

  • JavaBean 属性
  • 字段

@XmlTransient 与所有其他定义于 JAXB 的注释互相排斥。

有关其他公共消息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

示例：解决 JavaBean 属性与字段名称之间的名称冲突

   // Example: Code fragment
   public class USAddress {

       // The field name "name" collides with the property name
       // obtained by bean decapitalization of getName() below
       @XmlTransient public String name;

       String getName() {..};
       String setName() {..};
   }

   <!-- Example: XML Schema fragment -->
   <xs:complexType name="USAddress">
     <xs:sequence>
       <xs:element name="name" type="xs:string"/>
     </xs:sequence>
   </xs:complexType>
since JAXB2.0
version
en
$Revision: 1.8 $
英文文档：

Prevents the mapping of a JavaBean property to XML representation.

The @XmlTransient annotation is useful for resolving name collisions between a JavaBean property name and a field name or preventing the mapping of a field/property. A name collision can occur when the decapitalized JavaBean property name and a field name are the same. If the JavaBean property refers to the field, then the name collision can be resolved by preventing the mapping of either the field or the JavaBean property using the @XmlTransient annotation.

Usage

The @XmlTransient annotation can be used with the following program elements:

  • a JavaBean property
  • field

@XmlTransientis mutually exclusive with all other JAXB defined annotations.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Example: Resolve name collision between JavaBean property and field name

   // Example: Code fragment
   public class USAddress {

       // The field name "name" collides with the property name
       // obtained by bean decapitalization of getName() below
       @XmlTransient public String name;

       String getName() {..};
       String setName() {..};
   }

   <!-- Example: XML Schema fragment -->
   <xs:complexType name="USAddress">
     <xs:sequence>
       <xs:element name="name" type="xs:string"/>
     </xs:sequence>
   </xs:complexType>

Since:
JAXB2.0
Version:
$Revision: 1.8 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlType (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlType

@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface XmlType

Implements: Annotation
Inner classes: XmlType.DEFAULT
@Retention(value=RUNTIME)
@Target(value=TYPE)

将类或枚举类型映射到 XML 模式类型。

使用

@XmlType 注释可以与以下程序元素一起使用：

  • 顶层类
  • 枚举类型

更多公共信息，请参见 javax.xml.bind.package javadoc 中的“包规范”。

映射一个类

将一个类映射到 XML 模式类型。类是通过属性和字段表示的值的数据容器。模式类型是一个数据容器，用于模式类型的内容模式中的模式组件（如模式组、属性等）所表示的值。

要被映射，类必须拥有一个不带参数的公共构造方法，或者一个静态的不带参数的工厂方法。静态工厂方法可以使用 factoryMethod() 和 factoryClass() 注释元素来指定。在解组过程中将使用静态工厂方法或不带参数的构造方法来创建此类的实例。如果两者同时存在，则静态工厂方法将重写不带参数的构造方法。

将类映射到 XML 模式复杂类型或 XML 模式简单类型。XML 模式类型是基于类中包含的 JavaBean 属性和字段的映射派生出来的。类将要映射到的模式类型可以是已命名的，也可以是匿名的。通过使用 @XmlType(name="") 对类进行注释，可以将该类映射到匿名模式类型。

全局元素、本地元素或本地属性都可以与匿名类型关联，如下所示：

  • 全局元素：通过使用 @XmlRootElement 对类进行注释，可以派生出一个匿名类型的全局元素。请参见下面的示例 3。
  • 本地元素： JavaBean 属性，引用使用 @XmlType(name="") 注释的类且映射到与匿名类型关联的某一元素。请参见下面的示例 4。
  • 属性： JavaBean 属性，引用使用 @XmlType(name="") 注释的类且映射到与匿名类型关联的某一属性。请参见下面的示例 5。
映射到 XML 模式复杂类型
  • 如果使用 @XmlType(name="") 对类进行注释，那么该类将被映射到匿名类型。否则将类名称映射到复杂类型名称。可以使用 XmlName() 注释元素来自定义名称。
  • 映射到元素的属性和字段将映射到复杂类型中的内容模式。可以使用注释元素 propOrder() 将内容模式自定义为 xs:all 或 xs:sequence，还可以使用该元素指定 xs:sequence 中 XML 元素的顺序。
  • 可以映射到复杂类型中的属性的属性和字段。
  • XML 模式类型的 targetnamespace 可以使用注释元素 namespace() 自定义。

将类映射到 XML 模式简单类型

可以使用 @XmlValue 注释将类映射到 XML 模式简单类型。有关其他详细信息和示例，请参见 @XmlValue 注释类型。

下表显示了类到 XML 模式复杂类型或简单类型的映射。表中使用的标志符号是：

  • -> : 代表一个映射
  • [x]+ :x 出现一次或多次
  • [ @XmlValue property ]:使用 @XmlValue 注释的 JavaBean 属性
  • X :任意
目标 propOrder ClassBody ComplexType SimpleType
类 {} [property]+ -> elements complexcontent
xs:all
类 non empty [property]+ -> elements complexcontent
xs:sequence
类 X no property -> element complexcontent
empty sequence
类 X 1 [ @XmlValue property] &&
[property]+ ->attributes 		simplecontent
类 X 1 [ @XmlValue property ]&&
no properties -> attribute 		simpletype

映射一个枚举类型

将枚举类型映射到带有 enumeration facet 的 XML 模式简单类型。由于没有意义，以下注释元素将被忽略：propOrder()、factoryMethod() 和 factoryClass()。

与其他注释一起使用的方法

此注释可与以下注释一起使用：XmlRootElement、XmlAccessorOrder、XmlAccessorType、XmlEnum。但是，当此注释用于枚举类型时，将忽略 XmlAccessorOrder 和 XmlAccessorType。

示例 1：将类映射到具有 xs:sequence 属性和自定义的 JavaBean 属性排序的复杂类型。

   @XmlType(propOrder={"street", "city" , "state", "zip", "name" })
   public class USAddress {
     String getName() {..};
     void setName(String) {..};

     String getStreet() {..};
     void setStreet(String) {..};

     String getCity() {..};
     void setCity(String) {..};

     String getState() {..};
     void setState(String) {..};

     java.math.BigDecimal getZip() {..};
     void setZip(java.math.BigDecimal) {..};
   }

   <!-- XML Schema mapping for USAddress -->
   <xs:complexType name="USAddress">
     <xs:sequence>
       <xs:element name="street" type="xs:string"/>
       <xs:element name="city" type="xs:string"/>
       <xs:element name="state" type="xs:string"/>
       <xs:element name="zip" type="xs:decimal"/>
       <xs:element name="name" type="xs:string"/>
     </xs:all>
   </xs:complexType>

示例 2：将类映射到具有 xs:all 属性的复杂类型

 @XmlType(propOrder={})
 public class USAddress { ...}

 <!-- XML Schema mapping for USAddress -->
 <xs:complexType name="USAddress">
   <xs:all>
     <xs:element name="name" type="xs:string"/>
     <xs:element name="street" type="xs:string"/>
     <xs:element name="city" type="xs:string"/>
     <xs:element name="state" type="xs:string"/>
     <xs:element name="zip" type="xs:decimal"/>
   </xs:sequence>
 </xs:complexType>

示例 3：将类映射到具有匿名类型的全局元素。

   @XmlRootElement
   @XmlType(name="")
   public class USAddress { ...}

   <!-- XML Schema mapping for USAddress -->
   <xs:element name="USAddress">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="name" type="xs:string"/>
         <xs:element name="street" type="xs:string"/>
         <xs:element name="city" type="xs:string"/>
         <xs:element name="state" type="xs:string"/>
         <xs:element name="zip" type="xs:decimal"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>

示例 4：将属性映射到具有匿名类型的本地元素。

   //Example: Code fragment
   public class Invoice {
       USAddress addr;
           ...
       }

   @XmlType(name="")
   public class USAddress { ... }
   }

   <!-- XML Schema mapping for USAddress -->
   <xs:complexType name="Invoice">
     <xs:sequence>
       <xs:element name="addr">
         <xs:complexType>
           <xs:element name="name", type="xs:string"/>
           <xs:element name="city", type="xs:string"/>
           <xs:element name="city" type="xs:string"/>
           <xs:element name="state" type="xs:string"/>
           <xs:element name="zip" type="xs:decimal"/>
         </xs:complexType>
       ...
     </xs:sequence>
   </xs:complexType>

示例 5：将属性映射到具有匿名类型的属性。

     //Example: Code fragment
     public class Item {
         public String name;
         @XmlAttribute
         public USPrice price;
     }

     // map class to anonymous simple type.
     @XmlType(name="")
     public class USPrice {
         @XmlValue
         public java.math.BigDecimal price;
     }

     <!-- Example: XML Schema fragment -->
     <xs:complexType name="Item">
       <xs:sequence>
         <xs:element name="name" type="xs:string"/>
         <xs:attribute name="price">
           <xs:simpleType>
             <xs:restriction base="xs:decimal"/>
           </xs:simpleType>
         </xs:attribute>
       </xs:sequence>
     </xs:complexType>

示例 6：定义 factoryClass 和 factoryMethod

      @XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
      factoryMethod="getUSAddress")
      public class USAddress {

          private String city;
          private String name;
          private String state;
          private String street;
          private int    zip;

      public USAddress(String name, String street, String city,
          String state, int zip) {
          this.name = name;
          this.street = street;
          this.city = city;
          this.state = state;
          this.zip = zip;
      }
  }

  public class USAddressFactory {
      public static USAddress getUSAddress(){
       return new USAddress("Mark Baker", "23 Elm St",
          "Dayton", "OH", 90952);
  }

示例 7：定义 factoryMethod 并使用默认 factoryClass

      @XmlType(name="USAddressType", factoryMethod="getNewInstance")
      public class USAddress {

          private String city;
          private String name;
          private String state;
          private String street;
          private int    zip;

          private USAddress() {}

          public static USAddress getNewInstance(){
              return new USAddress();
          }
      }
since | JAXB2.0
version
en
$Revision: 1.20 $
See also | javax.xml.bind.annotation.XmlElement, javax.xml.bind.annotation.XmlAttribute, javax.xml.bind.annotation.XmlValue, javax.xml.bind.annotation.XmlSchema
英文文档：

Maps a class or an enum type to a XML Schema type.

Usage

The @XmlType annnotation can be used with the following program elements:

  • a top level class
  • an enum type

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Mapping a Class

A class maps to a XML Schema type. A class is a data container for values represented by properties and fields. A schema type is a data container for values represented by schema components within a schema type's content model (e.g. model groups, attributes etc).

To be mapped, a class must either have a public no-arg constructor or a static no-arg factory method. The static factory method can be specified in factoryMethod() and factoryClass() annotation elements. The static factory method or the no-arg constructor is used during unmarshalling to create an instance of this class. If both are present, the static factory method overrides the no-arg constructor.

A class maps to either a XML Schema complex type or a XML Schema simple type. The XML Schema type is derived based on the mapping of JavaBean properties and fields contained within the class. The schema type to which the class is mapped can either be named or anonymous. A class can be mapped to an anonymous schema type by annotating the class with @XmlType(name="").

Either a global element, local element or a local attribute can be associated with an anonymous type as follows:

  • global element: A global element of an anonymous type can be derived by annotating the class with @XmlRootElement. See Example 3 below.
  • local element: A JavaBean property that references a class annotated with @XmlType(name="") and is mapped to the element associated with the anonymous type. See Example 4 below.
  • attribute: A JavaBean property that references a class annotated with @XmlType(name="") and is mapped to the attribute associated with the anonymous type. See Example 5 below.
Mapping to XML Schema Complex Type
  • If class is annotated with @XmlType(name="") , it is mapped to an anonymous type otherwise, the class name maps to a complex type name. The XmlName() annotation element can be used to customize the name.
  • Properties and fields that are mapped to elements are mapped to a content model within a complex type. The annotation element propOrder() can be used to customize the content model to be xs:all or xs:sequence. It is used for specifying the order of XML elements in xs:sequence.
  • Properties and fields can be mapped to attributes within the complex type.
  • The targetnamespace of the XML Schema type can be customized using the annotation element namespace().

Mapping class to XML Schema simple type

A class can be mapped to a XML Schema simple type using the @XmlValue annotation. For additional details and examples, see @XmlValue annotation type.

The following table shows the mapping of the class to a XML Schema complex type or simple type. The notational symbols used in the table are:

  • -> : represents a mapping
  • [x]+ : one or more occurances of x
  • [ @XmlValue property ]: JavaBean property annotated with @XmlValue
  • X : don't care
Target propOrder ClassBody ComplexType SimpleType
Class {} [property]+ -> elements complexcontent
xs:all
Class non empty [property]+ -> elements complexcontent
xs:sequence
Class X no property -> element complexcontent
empty sequence
Class X 1 [ @XmlValue property] &&
[property]+ ->attributes 		simplecontent
Class X 1 [ @XmlValue property ]&&
no properties -> attribute 		simpletype

Mapping an enum type

An enum type maps to a XML schema simple type with enumeration facets. The following annotation elements are ignored since they are not meaningful: propOrder() , factoryMethod() , factoryClass() .

Usage with other annotations

This annotation can be used with the following annotations: XmlRootElement, XmlAccessorOrder, XmlAccessorType, XmlEnum. However, XmlAccessorOrder and XmlAccessorType are ignored when this annotation is used on an enum type.

Example 1: Map a class to a complex type with xs:sequence with a customized ordering of JavaBean properties.

   @XmlType(propOrder={"street", "city" , "state", "zip", "name" })
   public class USAddress {
     String getName() {..};
     void setName(String) {..};

     String getStreet() {..};
     void setStreet(String) {..};

     String getCity() {..};
     void setCity(String) {..};

     String getState() {..};
     void setState(String) {..};

     java.math.BigDecimal getZip() {..};
     void setZip(java.math.BigDecimal) {..};
   }

   <!-- XML Schema mapping for USAddress -->
   <xs:complexType name="USAddress">
     <xs:sequence>
       <xs:element name="street" type="xs:string"/>
       <xs:element name="city" type="xs:string"/>
       <xs:element name="state" type="xs:string"/>
       <xs:element name="zip" type="xs:decimal"/>
       <xs:element name="name" type="xs:string"/>
     </xs:all>
   </xs:complexType>

Example 2: Map a class to a complex type with xs:all

 @XmlType(propOrder={})
 public class USAddress { ...}

 <!-- XML Schema mapping for USAddress -->
 <xs:complexType name="USAddress">
   <xs:all>
     <xs:element name="name" type="xs:string"/>
     <xs:element name="street" type="xs:string"/>
     <xs:element name="city" type="xs:string"/>
     <xs:element name="state" type="xs:string"/>
     <xs:element name="zip" type="xs:decimal"/>
   </xs:sequence>
 </xs:complexType>

Example 3: Map a class to a global element with an anonymous type.

   @XmlRootElement
   @XmlType(name="")
   public class USAddress { ...}

   <!-- XML Schema mapping for USAddress -->
   <xs:element name="USAddress">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="name" type="xs:string"/>
         <xs:element name="street" type="xs:string"/>
         <xs:element name="city" type="xs:string"/>
         <xs:element name="state" type="xs:string"/>
         <xs:element name="zip" type="xs:decimal"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>

Example 4: Map a property to a local element with anonmyous type.

   //Example: Code fragment
   public class Invoice {
       USAddress addr;
           ...
       }

   @XmlType(name="")
   public class USAddress { ... }
   }

   <!-- XML Schema mapping for USAddress -->
   <xs:complexType name="Invoice">
     <xs:sequence>
       <xs:element name="addr">
         <xs:complexType>
           <xs:element name="name", type="xs:string"/>
           <xs:element name="city", type="xs:string"/>
           <xs:element name="city" type="xs:string"/>
           <xs:element name="state" type="xs:string"/>
           <xs:element name="zip" type="xs:decimal"/>
         </xs:complexType>
       ...
     </xs:sequence>
   </xs:complexType>

Example 5: Map a property to an attribute with anonymous type.

     //Example: Code fragment
     public class Item {
         public String name;
         @XmlAttribute
         public USPrice price;
     }

     // map class to anonymous simple type.
     @XmlType(name="")
     public class USPrice {
         @XmlValue
         public java.math.BigDecimal price;
     }

     <!-- Example: XML Schema fragment -->
     <xs:complexType name="Item">
       <xs:sequence>
         <xs:element name="name" type="xs:string"/>
         <xs:attribute name="price">
           <xs:simpleType>
             <xs:restriction base="xs:decimal"/>
           </xs:simpleType>
         </xs:attribute>
       </xs:sequence>
     </xs:complexType>

Example 6: Define a factoryClass and factoryMethod

      @XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
      factoryMethod="getUSAddress")
      public class USAddress {

          private String city;
          private String name;
          private String state;
          private String street;
          private int    zip;

      public USAddress(String name, String street, String city,
          String state, int zip) {
          this.name = name;
          this.street = street;
          this.city = city;
          this.state = state;
          this.zip = zip;
      }
  }

  public class USAddressFactory {
      public static USAddress getUSAddress(){
       return new USAddress("Mark Baker", "23 Elm St",
          "Dayton", "OH", 90952);
  }

Example 7: Define factoryMethod and use the default factoryClass

      @XmlType(name="USAddressType", factoryMethod="getNewInstance")
      public class USAddress {

          private String city;
          private String name;
          private String state;
          private String street;
          private int    zip;

          private USAddress() {}

          public static USAddress getNewInstance(){
              return new USAddress();
          }
      }

Since:
JAXB2.0
Version:
$Revision: 1.20 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlElement, XmlAttribute, XmlValue, XmlSchema

Optional Element Summary
Class | factoryClass Class containing a no-arg factory method for creating an instance of this class.
String | factoryMethod Name of a no-arg factory method in the class specified in factoryClass factoryClass().
String | name Name of the XML Schema type which the class is mapped.
String | namespace Name of the target namespace of the XML Schema type.
String[] | propOrder Specifies the order for XML Schema elements when class is mapped to a XML Schema complex type.

abstract public String name()
类被映射到的 XML 模式类型名称。
英文文档：

name

public abstract String name
Name of the XML Schema type which the class is mapped.

Default:
"##default"

abstract public String[] propOrder()
在将类映射到 XML 模式复杂类型时，指定 XML 模式元素的顺序。

有关 propOrder 影响类映射的方式，请参见上表。

propOrder 是类中 JavaBean 属性的名称列表。列表中的每个名称都是 JavaBean 属性的 Java 标识符的名称。JavaBean 属性被列出的顺序是 JavaBean 属性映射到 XML 模式元素的顺序。

必须列出所有映射到 XML 模式元素的 JavaBean 属性。

以 propOrder 顺序列出的 JavaBean 属性或字段不得为 transient 或使用 @XmlTransient 注释。

JavaBean 属性的默认顺序由 @XmlAccessorOrder 确定。

英文文档：

propOrder

public abstract String[] propOrder
Specifies the order for XML Schema elements when class is mapped to a XML Schema complex type.

Refer to the table for how the propOrder affects the mapping of class

The propOrder is a list of names of JavaBean properties in the class. Each name in the list is the name of a Java identifier of the JavaBean property. The order in which JavaBean properties are listed is the order of XML Schema elements to which the JavaBean properties are mapped.

All of the JavaBean properties being mapped to XML Schema elements must be listed.

A JavaBean property or field listed in propOrder must not be transient or annotated with @XmlTransient.

The default ordering of JavaBean properties is determined by @XmlAccessorOrder.

Default:
""

abstract public String namespace()
XML 模式类型的目标名称空间名。默认情况下，这是包含类的包将被映射到的目标名称空间。
英文文档：

namespace

public abstract String namespace
Name of the target namespace of the XML Schema type. By default, this is the target namespace to which the package containing the class is mapped.

Default:
"##default"

abstract public Class<T> factoryClass()
包含用来创建此类实例的不带参数的工厂方法的类。默认值为此类。

如果 factoryClass 为 DEFAULT.class 且 factoryMethod 为 ""，则没有静态工厂方法。

如果 factoryClass 为 DEFAULT.class 且 factoryMethod 不为 ""，则 factoryMethod 是此类中静态工厂方法的名称。

如果 factoryClass 不是 DEFAULT.class，则 factoryMethod 不得为 ""，且必须是 factoryClass 中指定的静态工厂方法的名称。

英文文档：

factoryClass

public abstract Class factoryClass
Class containing a no-arg factory method for creating an instance of this class. The default is this class.

If factoryClass is DEFAULT.class and factoryMethod is "", then there is no static factory method.

If factoryClass is DEFAULT.class and factoryMethod is not "", then factoryMethod is the name of a static factory method in this class.

If factoryClass is not DEFAULT.class, then factoryMethod must not be "" and must be the name of a static factory method specified in factoryClass.

Default:
javax.xml.bind.annotation.XmlType.DEFAULT.class

abstract public String factoryMethod()
一个不带参数的构造方法的名称，该构造方法在 factoryClass factoryClass() 所指定的类。
英文文档：

factoryMethod

public abstract String factoryMethod
Name of a no-arg factory method in the class specified in factoryClass factoryClass().

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlValue (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.xml.bind.annotation
Annotation Type XmlValue

@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XmlValue

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD})

支持将类映射到带有 simpleContent 的 XML 模式复杂类型或 XML 模式简单类型。

用法：

@XmlValue 注释可以与以下程序元素一起使用：

  • JavaBean 属性。
  • 非 static、非 transient 字段。

有关其他公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

用法受到以下使用约束的限制：
  • 可以使用 @XmlValue 注释注释最多一个字段或属性。
  • @XmlValue 可以与以下注释一起使用：XmlList。但是这是多余的，因为 XmlList 将类型映射到像 XmlValue 那样由列表派生的简单模式类型。
  • 如果字段或属性的类型是集合类型，那么集合项类型必须映射到简单模式类型。
  • 如果字段或属性的类型不是集合类型，那么类型必须映射到 XML 模式简单类型。

如果已注释的 JavaBean 属性是映射到 XML 模式构造的唯一类成员，那么该类将被映射到一个简单类型。 如果存在映射到 XML 属性的其他 JavaBean 属性（使用 @XmlValue 注释注释的 JavaBean 除外），那么类将被映射到带有 simpleContent 的复杂类型。

示例 1：将类映射到 XML 模式 simpleType

     // Example 1: Code fragment
     public class USPrice {
         @XmlValue
         public java.math.BigDecimal price;
     }

     <!-- Example 1: XML Schema fragment -->
     <xs:simpleType name="USPrice">
       <xs:restriction base="xs:decimal"/>
     </xs:simpleType>

示例 2：将类映射到带有 simpleContent的 XML 模式 complexType。

   // Example 2: Code fragment
   public class InternationalPrice {
       @XmlValue
       public java.math.BigDecimal price;

       @XmlAttribute
       public String currency;
   }

   <!-- Example 2: XML Schema fragment -->
   <xs:complexType name="InternationalPrice">
     <xs:simpleContent>
       <xs:extension base="xs:decimal">
         <xs:attribute name="currency" type="xs:string"/>
       </xs:extension>
     </xs:simpleContent>
   </xs:complexType>

since | JAXB2.0
version
en
$Revision: 1.6 $
See also | javax.xml.bind.annotation.XmlType
英文文档：

Enables mapping a class to a XML Schema complex type with a simpleContent or a XML Schema simple type.

Usage:

The @XmlValue annotation can be used with the following program elements:

  • a JavaBean property.
  • non static, non transient field.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

The usage is subject to the following usage constraints:
  • At most one field or property can be annotated with the @XmlValue annotation.
  • @XmlValue can be used with the following annotations: XmlList. However this is redundant since XmlList maps a type to a simple schema type that derives by list just as XmlValue would.
  • If the type of the field or property is a collection type, then the collection item type must map to a simple schema type.
  • If the type of the field or property is not a collection type, then the type must map to a XML Schema simple type.

If the annotated JavaBean property is the sole class member being mapped to XML Schema construct, then the class is mapped to a simple type. If there are additional JavaBean properties (other than the JavaBean property annotated with @XmlValue annotation) that are mapped to XML attributes, then the class is mapped to a complex type with simpleContent.

Example 1: Map a class to XML Schema simpleType

     // Example 1: Code fragment
     public class USPrice {
         @XmlValue
         public java.math.BigDecimal price;
     }

     <!-- Example 1: XML Schema fragment -->
     <xs:simpleType name="USPrice">
       <xs:restriction base="xs:decimal"/>
     </xs:simpleType>

Example 2: Map a class to XML Schema complexType with with simpleContent.

   // Example 2: Code fragment
   public class InternationalPrice {
       @XmlValue
       public java.math.BigDecimal price;

       @XmlAttribute
       public String currency;
   }

   <!-- Example 2: XML Schema fragment -->
   <xs:complexType name="InternationalPrice">
     <xs:simpleContent>
       <xs:extension base="xs:decimal">
         <xs:attribute name="currency" type="xs:string"/>
       </xs:extension>
     </xs:simpleContent>
   </xs:complexType>

Since:
JAXB2.0
Version:
$Revision: 1.6 $
Author:
Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlType

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.xml.bind.annotation.adapters (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.bind.annotation.adapters

XmlAdapter and its spec-defined sub-classes to allow arbitrary Java classes to be used with JAXB.

See:
Description

Class Summary
CollapsedStringAdapter | Built-in XmlAdapter to handle xs:token and its derived types.
HexBinaryAdapter | XmlAdapter for xs:hexBinary.
NormalizedStringAdapter | XmlAdapter to handle xs:normalizedString.
XmlAdapter<ValueType,BoundType> | Adapts a Java type for custom marshaling.
XmlJavaTypeAdapter.DEFAULT | Used in XmlJavaTypeAdapter.type() to signal that the type be inferred from the signature of the field, property, parameter or the class.

Annotation Types Summary
XmlJavaTypeAdapter | Use an adapter that implements XmlAdapter for custom marshaling.
XmlJavaTypeAdapters | A container for multiple @XmlJavaTypeAdapter annotations.

Package javax.xml.bind.annotation.adapters Description

XmlAdapter and its spec-defined sub-classes to allow arbitrary Java classes to be used with JAXB.

Package Specification

  • JAXB Specification

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • The JAXB Website

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.bind.annotation.adapters Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.bind.annotation.adapters

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
      • javax.xml.bind.annotation.adapters.CollapsedStringAdapter
      • javax.xml.bind.annotation.adapters.HexBinaryAdapter
      • javax.xml.bind.annotation.adapters.NormalizedStringAdapter
    • javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT

Annotation Type Hierarchy

  • javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter (implements java.lang.annotation.Annotation)
  • javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters (implements java.lang.annotation.Annotation)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


CollapsedStringAdapter (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.annotation.adapters
Class CollapsedStringAdapter

java.lang.Object
    extended by  javax.xml.bind.annotation.adapters.XmlAdapter<String,String>
        extended by  javax.xml.bind.annotation.adapters.CollapsedStringAdapter

public class CollapsedStringAdapter
extends XmlAdapter<String,String>

Extends: XmlAdapter

用来处理 xs:token 及其派生类型的内置 XmlAdapter。

此适配器移除前导空白和尾部空白，然后用单个空白字符“ ”截断任何制表符、CR、LF 和 SP 序列。

since JAXB 2.0
英文文档：

Built-in XmlAdapter to handle xs:token and its derived types.

This adapter removes leading and trailing whitespaces, then truncate any sequnce of tab, CR, LF, and SP by a single whitespace character ' '.

Since:
JAXB 2.0
Author:
Kohsuke Kawaguchi

Constructor Summary
CollapsedStringAdapter()
Method Summary
protected static boolean | isWhiteSpace(char ch) returns true if the specified char is a white space character.
String | marshal(String s) No-op.
String | unmarshal(String text) Removes leading and trailing whitespaces of the string given as the parameter, then truncate any sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public CollapsedStringAdapter()
英文文档：

CollapsedStringAdapter

public CollapsedStringAdapter()
Method Detail

public String unmarshal(String text)
移除作为参数提供的字符串的前导空白和尾部空白，然后用单个空白字符“ ”截断任何制表符、CR、LF 和 SP 序列。
英文文档：

unmarshal

public String unmarshal(String text)
Removes leading and trailing whitespaces of the string given as the parameter, then truncate any sequnce of tab, CR, LF, and SP by a single whitespace character ' '.

Specified by:
unmarshal in class XmlAdapter<String,String>
Parameters:
text - The value to be converted. Can be null.

public String marshal(String s)
无任何操作。仅返回作为参数提供的字符串。
英文文档：

marshal

public String marshal(String s)
No-op. Just return the same string given as the parameter.

Specified by:
marshal in class XmlAdapter<String,String>
Parameters:
s - The value to be convereted. Can be null.

protected static boolean isWhiteSpace(char ch)
如果指定的 char 是空白字符，则返回 true。
英文文档：

isWhiteSpace

protected static boolean isWhiteSpace(char ch)
returns true if the specified char is a white space character.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HexBinaryAdapter (Java EE 5)

javax.xml.bind.annotation.adapters
Class HexBinaryAdapter

java.lang.Object
    extended by  javax.xml.bind.annotation.adapters.XmlAdapter<String,byte[]>
        extended by  javax.xml.bind.annotation.adapters.HexBinaryAdapter

public final class HexBinaryAdapter
extends XmlAdapter<String,byte[]>

Extends: XmlAdapter

xs:hexBinary 的 XmlAdapter。

此 XmlAdapter 将 byte[] 绑定到 XML 中的 hexBinary 表示形式。

since JAXB 2.0
英文文档：

XmlAdapter for xs:hexBinary.

This XmlAdapter binds byte[] to the hexBinary representation in XML.

Since:
JAXB 2.0
Author:
Kohsuke Kawaguchi

Constructor Summary
HexBinaryAdapter()
Method Summary
String | marshal(byte[] bytes) Convert a bound type to a value type.
byte[] | unmarshal(String s) Convert a value type to a bound type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public HexBinaryAdapter()
英文文档：

HexBinaryAdapter

public HexBinaryAdapter()
Method Detail

public byte[] unmarshal(String s)
英文文档：

unmarshal

public byte[] unmarshal(String s)
Description copied from class: XmlAdapter
Convert a value type to a bound type.

Specified by:
unmarshal in class XmlAdapter<String,byte[]>
Parameters:
s - The value to be converted. Can be null.

public String marshal(byte[] bytes)
英文文档：

marshal

public String marshal(byte[] bytes)
Description copied from class: XmlAdapter
Convert a bound type to a value type.

Specified by:
marshal in class XmlAdapter<String,byte[]>
Parameters:
bytes - The value to be convereted. Can be null.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NormalizedStringAdapter (Java EE 5)

javax.xml.bind.annotation.adapters
Class NormalizedStringAdapter

java.lang.Object
    extended by  javax.xml.bind.annotation.adapters.XmlAdapter<String,String>
        extended by  javax.xml.bind.annotation.adapters.NormalizedStringAdapter

public final class NormalizedStringAdapter
extends XmlAdapter<String,String>

Extends: XmlAdapter

处理 xs:normalizedString 的 XmlAdapter。

此适配器移除前导空白和尾部空白，然后用单个空白字符“ ”截断所有制表符、CR 和 LF。

since JAXB 2.0
英文文档：

XmlAdapter to handle xs:normalizedString.

This adapter removes leading and trailing whitespaces, then replace any tab, CR, and LF by a whitespace character ' '.

Since:
JAXB 2.0
Author:
Kohsuke Kawaguchi

Constructor Summary
NormalizedStringAdapter()
Method Summary
protected static boolean | isWhiteSpaceExceptSpace(char ch) Returns true if the specified char is a white space character but not 0x20.
String | marshal(String s) No-op.
String | unmarshal(String text) Removes leading and trailing whitespaces of the string given as the parameter, then replace any tab, CR, and LF by a whitespace character ' '.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public NormalizedStringAdapter()
英文文档：

NormalizedStringAdapter

public NormalizedStringAdapter()
Method Detail

public String unmarshal(String text)
移除作为参数给定的字符串的前导空白和尾部空白，然后用单个空白字符“ ”替换所有制表符、CR 和 LF。
英文文档：

unmarshal

public String unmarshal(String text)
Removes leading and trailing whitespaces of the string given as the parameter, then replace any tab, CR, and LF by a whitespace character ' '.

Specified by:
unmarshal in class XmlAdapter<String,String>
Parameters:
text - The value to be converted. Can be null.

public String marshal(String s)
无任何操作。仅返回作为参数提供的字符串。
英文文档：

marshal

public String marshal(String s)
No-op. Just return the same string given as the parameter.

Specified by:
marshal in class XmlAdapter<String,String>
Parameters:
s - The value to be convereted. Can be null.

protected static boolean isWhiteSpaceExceptSpace(char ch)
如果指定的 char 是空白字符但不是 0x20，则返回 true。
英文文档：

isWhiteSpaceExceptSpace

protected static boolean isWhiteSpaceExceptSpace(char ch)
Returns true if the specified char is a white space character but not 0x20.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlAdapter (Java EE 5)

javax.xml.bind.annotation.adapters
Class XmlAdapter<ValueType,BoundType>

java.lang.Object
    extended by  javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
Type Parameters:
BoundType - The type that JAXB doesn't know how to handle. An adapter is written to allow this type to be used as an in-memory representation through the ValueType.
ValueType - The type that JAXB knows how to handle out of the box.
Direct Known Subclasses:
CollapsedStringAdapter, HexBinaryAdapter, NormalizedStringAdapter
public abstract class XmlAdapter<ValueType,BoundType>
extends Object

Extended by: CollapsedStringAdapter, HexBinaryAdapter, NormalizedStringAdapter

修改 Java 类型以适应自定义编组。

使用：

一些 Java 类型不能自然映射到 XML 表示形式，例如，HashMap 或其他非 JavaBean 类。反之，XML 表示形式可以映射到 Java 类型，但是应用程序可能会选择使用另一种 Java 类型访问 XML 表示形式。例如，默认情况下，Java 绑定规则模式将 xs:DateTime 绑定到 XmlGregorianCalendar。但应用程序可能需要将 xs:DateTime 绑定到自定义类型，例如 MyXmlGregorianCalendar。在这两种情况下，应用程序用来访问 XML 内容的 bound 类型 与映射到 XML 表示形式的 value 类型 不匹配。

此抽象类定义将 bound 类型修改为 value 类型或将 value 类型修改为 bound 类型的方法。在编组或解组过程中，由 JAXB 绑定框架调用这些方法：

  • XmlAdapter.marshal(...)：编组过程中，JAXB 绑定框架调用 XmlAdapter.marshal(..) 将 bound 类型修改为 value 类型，然后将 value 类型编组为 XML 表示形式。
  • XmlAdapter.unmarshal(...)：解组过程中，JAXB 绑定框架首先将 XML 表示形式解组为 value 类型，然后调用 XmlAdapter.unmarshal(..) 将 value 类型修改为 bound 类型。
因此编写一个适配器涉及以下步骤：
  • 编写实现此抽象类的适配器。
  • 安装使用注释 XmlJavaTypeAdapter 的适配器。

示例：自定义 HashMap 的映射。

以下示例演示了如何使用 @XmlAdapter 和 @XmlJavaTypeAdapter 自定义 HashMap 的映射。

步骤 1：确定 HashMap 需要的 XML 表示形式。

<hashmap>
<entry key="id123">this is a value</entry>
<entry key="id312">this is another value</entry>
         ...
</hashmap>

步骤 2：确定上文所示的所需 XML 表示形式应当遵循的模式定义。

<xs:complexType name="myHashMapType">
<xs:sequence>
<xs:element name="entry" type="myHashMapEntryType"
minOccurs = "0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="myHashMapEntryType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="key" type="xs:int"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

步骤 3：编写能够生成上述模式定义的 value 类型。

     public class MyHashMapType {
         List<MyHashMapEntryType> entry;
     }

     public class MyHashMapEntryType {
         @XmlAttribute
         public Integer key;

         @XmlValue
         public String value;
     }

步骤 4：编写将 value 类型 (MyHashMapType) 修改为 bound 类型（应用程序使用的 HashMap）的适配器。

public final class MyHashMapAdapter extends
XmlAdapter<HashMap, MyHashMapType> { ... } }

步骤 5：使用适配器。

     public class Foo {
         @XmlJavaTypeAdapter(MyHashMapAdapter.class)
         HashMap hashmap;
         ...
     }
上述代码片段将映射到以下模式：
<xs:complexType name="Foo">
<xs:sequence>
<xs:element name="hashmap" type="myHashMapType"
</xs:sequence>
</xs:complexType>

BoundType | JAXB 不知道如何处理的一些类型。编写一个适配器，以便允许通过 ValueType 将此类型用作内存表示形式。
ValueType | JAXB 无需其他操作便知道如何处理的类型。
since | JAXB 2.0
See also | javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
英文文档：

Adapts a Java type for custom marshaling.

Usage:

Some Java types do not map naturally to a XML representation, for example HashMap or other non JavaBean classes. Conversely, a XML repsentation may map to a Java type but an application may choose to accesss the XML representation using another Java type. For example, the schema to Java binding rules bind xs:DateTime by default to XmlGregorianCalendar. But an application may desire to bind xs:DateTime to a custom type, MyXmlGregorianCalendar, for example. In both cases, there is a mismatch between bound type , used by an application to access XML content and the value type, that is mapped to an XML representation.

This abstract class defines methods for adapting a bound type to a value type or vice versa. The methods are invoked by the JAXB binding framework during marshaling and unmarshalling:

  • XmlAdapter.marshal(...): During marshalling, JAXB binding framework invokes XmlAdapter.marshal(..) to adapt a bound type to value type, which is then marshaled to XML representation.
  • XmlAdapter.unmarshal(...): During unmarshalling, JAXB binding framework first unmarshals XML representation to a value type and then invokes XmlAdapter.unmarshal(..) to adapt the value type to a bound type.
Writing an adapter therefore involves the following steps:
  • Write an adapter that implements this abstract class.
  • Install the adapter using the annotation XmlJavaTypeAdapter

Example: Customized mapping of HashMap

The following example illustrates the use of @XmlAdapter and @XmlJavaTypeAdapter to customize the mapping of a HashMap.

Step 1: Determine the desired XML representation for HashMap.

     <hashmap>
         <entry key="id123">this is a value</entry>
         <entry key="id312">this is another value</entry>
         ...
       </hashmap>

Step 2: Determine the schema definition that the desired XML representation shown above should follow.

     <xs:complexType name="myHashMapType">
       <xs:sequence>
         <xs:element name="entry" type="myHashMapEntryType"
                        minOccurs = "0" maxOccurs="unbounded"/>
       </xs:sequence>
     </xs:complexType>

     <xs:complexType name="myHashMapEntryType">
       <xs:simpleContent>
         <xs:extension base="xs:string">
           <xs:attribute name="key" type="xs:int"/>
         </xs:extension>
       </xs:simpleContent>
     </xs:complexType>

Step 3: Write value types that can generate the above schema definition.

     public class MyHashMapType {
         List<MyHashMapEntryType> entry;
     }

     public class MyHashMapEntryType {
         @XmlAttribute
         public Integer key;

         @XmlValue
         public String value;
     }

Step 4: Write the adapter that adapts the value type, MyHashMapType to a bound type, HashMap, used by the application.

     public final class MyHashMapAdapter extends
                        XmlAdapter<HashMap, MyHashMapType> { ... }

Step 5: Use the adapter.

     public class Foo {
         @XmlJavaTypeAdapter(MyHashMapAdapter.class)
         HashMap hashmap;
         ...
     }
The above code fragment will map to the following schema:
     <xs:complexType name="Foo">
       <xs:sequence>
         <xs:element name="hashmap" type="myHashMapType"
       </xs:sequence>
     </xs:complexType>

Since:
JAXB 2.0
Author:
  • Sekhar Vajjhala, Sun Microsystems Inc.
  • Kohsuke Kawaguchi, Sun Microsystems Inc.
See Also:
XmlJavaTypeAdapter

Constructor Summary
protected XmlAdapter()
Do-nothing constructor for the derived classes.
Method Summary
abstract ValueType | marshal(BoundType v) Convert a bound type to a value type.
abstract BoundType | unmarshal(ValueType v) Convert a value type to a bound type.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected XmlAdapter()
派生类的构造方法，不执行任何操作。
英文文档：

XmlAdapter

protected XmlAdapter()
Do-nothing constructor for the derived classes.

Method Detail

英文文档：

unmarshal

public abstract BoundType unmarshal(ValueType v)
                             throws Exception
Convert a value type to a bound type.

Parameters:
v - The value to be converted. Can be null.
Throws:
Exception - if there's an error during the conversion. The caller is responsible for reporting the error to the user through ValidationEventHandler.

英文文档：

marshal

public abstract ValueType marshal(BoundType v)
                           throws Exception
Convert a bound type to a value type.

Parameters:
v - The value to be convereted. Can be null.
Throws:
Exception - if there's an error during the conversion. The caller is responsible for reporting the error to the user through ValidationEventHandler.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlJavaTypeAdapter (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.bind.annotation.adapters
Annotation Type XmlJavaTypeAdapter

@Retention(value=RUNTIME)
@Target(value={PACKAGE,FIELD,METHOD,TYPE,PARAMETER})
public @interface XmlJavaTypeAdapter

Implements: Annotation
Inner classes: XmlJavaTypeAdapter.DEFAULT
@Retention(value=RUNTIME)
@Target(value={PACKAGE, FIELD, METHOD, TYPE, PARAMETER})

对自定义编组使用实现 XmlAdapter 的适配器。

用法：

@XmlJavaTypeAdapter 注释可以与下列编程元素一起使用：

  • JavaBean 属性
  • 字段
  • 参数
  • 包
  • XmlJavaTypeAdapters 内部的元素

当对一个类定义了 @XmlJavaTypeAdapter 注释时，它将适用于该类的所有引用。

当在包级别上定义了 @XmlJavaTypeAdapter 注释时，它将适用于从该包内部到 @XmlJavaTypeAdapter.type() 的所有引用。

当对字段、属性或参数定义了 @XmlJavaTypeAdapter 注释时，注释将仅适用于这些字段、属性或参数。

字段、属性或参数上的 @XmlJavaTypeAdapter 注释重写与字段、属性或参数所引用的类关联的 @XmlJavaTypeAdapter 注释。

类上的 @XmlJavaTypeAdapter 注释重写在该类的包级别上指定的 @XmlJavaTypeAdapter 注释。

此注释可与以下注释一起使用：XmlElement、XmlAttribute、XmlElementRef、 XmlElementRefs、XmlAnyElement。此注释也可以在包级别与以下注释一起使用： XmlAccessorType、XmlSchema、XmlSchemaType、 XmlSchemaTypes。

示例：请参阅 XmlAdapter 中的示例

since | JAXB2.0
version
en
$Revision: 1.10 $
See also | javax.xml.bind.annotation.adapters.XmlAdapter
英文文档：

Use an adapter that implements XmlAdapter for custom marshaling.

Usage:

The @XmlJavaTypeAdapter annotation can be used with the following program elements:

  • a JavaBean property
  • field
  • parameter
  • package
  • from within XmlJavaTypeAdapters

When @XmlJavaTypeAdapter annotation is defined on a class, it applies to all references to the class.

When @XmlJavaTypeAdapter annotation is defined at the package level it applies to all references from within the package to @XmlJavaTypeAdapter.type().

When @XmlJavaTypeAdapter annotation is defined on the field, property or parameter, then the annotation applies to the field, property or the parameter only.

A @XmlJavaTypeAdapter annotation on a field, property or parameter overrides the @XmlJavaTypeAdapter annotation associated with the class being referenced by the field, property or parameter.

A @XmlJavaTypeAdapter annotation on a class overrides the @XmlJavaTypeAdapter annotation specified at the package level for that class.

This annotation can be used with the following other annotations: XmlElement, XmlAttribute, XmlElementRef, XmlElementRefs, XmlAnyElement. This can also be used at the package level with the following annotations: XmlAccessorType, XmlSchema, XmlSchemaType, XmlSchemaTypes.

Example: See example in XmlAdapter

Since:
JAXB2.0
Version:
$Revision: 1.10 $
Author:
  • Sekhar Vajjhala, Sun Microsystems Inc.
  • Kohsuke Kawaguchi, Sun Microsystems Inc.
See Also:
XmlAdapter

Required Element Summary
 Class<? extends XmlAdapter> value
Points to the clsss that converts a value type to a bound type or vice versa.
Optional Element Summary
 Class type
If this annotation is used at the package level, then value of the type() must be specified.

Element Detail

abstract public Class<T> value()
指向将 value 类型转换为 bound 类型或将 bound 类型转换为 value 类型的类。更多详细信息，请参阅 XmlAdapter。
英文文档：

value

public abstract Class<? extends XmlAdapter> value
Points to the clsss that converts a value type to a bound type or vice versa. See XmlAdapter for more details.

abstract public Class<T> type()
如果此注释用于包级别上，那么必须指定 type() 的值。
英文文档：

type

public abstract Class type
If this annotation is used at the package level, then value of the type() must be specified.

Default:
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT.class
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


XmlJavaTypeAdapters (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.xml.bind.annotation.adapters
Annotation Type XmlJavaTypeAdapters

@Retention(value=RUNTIME)
@Target(value=PACKAGE)
public @interface XmlJavaTypeAdapters

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=PACKAGE)

多个 @XmlJavaTypeAdapter 注释的容器。

一个编程元素上不允许使用多个相同类型的注释。因此，此注释充当多个 @XmlJavaTypeAdapter 的容器注释，如下所示：

 @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) })

@XmlJavaTypeAdapters 注释对于定义包级别上不同类型的 XmlJavaTypeAdapter 注释很有用。

有关附加的公共信息，请参阅 javax.xml.bind.package javadoc 中的“包规范”。

since | JAXB2.0
See also | javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
英文文档：

A container for multiple @XmlJavaTypeAdapter annotations.

Multiple annotations of the same type are not allowed on a program element. This annotation therefore serves as a container annotation for multiple @XmlJavaTypeAdapter as follows:

 @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) })

The @XmlJavaTypeAdapters annnotation is useful for defining XmlJavaTypeAdapter annotations for different types at the package level.

See "Package Specification" in javax.xml.bind.package javadoc for additional common information.

Since:
JAXB2.0
Author:
  • Sekhar Vajjhala, Sun Microsystems, Inc.
See Also:
XmlJavaTypeAdapter

Required Element Summary
 XmlJavaTypeAdapter[] value
Collection of @XmlJavaTypeAdapter annotations

Element Detail

abstract public XmlJavaTypeAdapter[] value()
@XmlJavaTypeAdapter 注释的集合。
英文文档：

value

public abstract XmlJavaTypeAdapter[] value
Collection of @XmlJavaTypeAdapter annotations

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.xml.bind.attachment (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.bind.attachment

This package is implemented by a MIME-based package processor that enables the interpretation and creation of optimized binary data within an MIME-based package format.

See:
Description

Class Summary
AttachmentMarshaller | Enable JAXB marshalling to optimize storage of binary data.
AttachmentUnmarshaller | Enables JAXB unmarshalling of a root document containing optimized binary data formats.

Package javax.xml.bind.attachment Description

This package is implemented by a MIME-based package processor that enables the interpretation and creation of optimized binary data within an MIME-based package format.

Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to optimized transmission of binary datatypes as an attachment. To optimally support these standards within a message passing environment, this package enables an integrated solution between a MIME-based package processor and JAXB unmarshall/marshal processes.

Package Specification

  • JAXB Specification

Related Standards

  • [1]SOAP Message Transmission Optimization Mechanism
  • [2]XML-binary Optimized Packaging
  • [3]WS-I Attachments Profile Version 1.0.
  • [4]Describing Media Content of Binary Data in XML

Since:
JAXB 2.0
Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.bind.attachment Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.bind.attachment

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.bind.attachment.AttachmentMarshaller
    • javax.xml.bind.attachment.AttachmentUnmarshaller
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


AttachmentMarshaller (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.attachment
Class AttachmentMarshaller

java.lang.Object
    extended by  javax.xml.bind.attachment.AttachmentMarshaller

public abstract class AttachmentMarshaller
extends Object

启用 JAXB 编组来优化二进制数据存储。

此 API 支持 JAXB 编组过程与基于 MIME 的包处理器之间的协作，有效地创建优化的二进制数据格式。JAXB 实现对基于 MIME 的包的根正文进行编组，将可引用 MIME 部分的创建委托给实现此抽象的基于 MIME 的包处理器。

当 #isXOPPackage() 为 true 时启用 XOP 处理。有关详细信息，请参阅 #addMtomAttachment(DataHandler, String, String)。

#addSwaRefAttachment(DataHandler) 支持 WS-I Attachment Profile 1.0，编组程序针对每个与 {http://ws-i.org/profiles/basic/1.1/xsd}swaRef 相关的 JAXB 属性调用该方法。

since | JAXB 2.0
See also | setAttachmentMarshaller(AttachmentMarshaller), XML-binary Optimized Packaging, WS-I Attachments Profile Version 1.0.
英文文档：

Enable JAXB marshalling to optimize storage of binary data.

This API enables an efficient cooperative creation of optimized binary data formats between a JAXB marshalling process and a MIME-based package processor. A JAXB implementation marshals the root body of a MIME-based package, delegating the creation of referenceable MIME parts to the MIME-based package processor that implements this abstraction.

XOP processing is enabled when isXOPPackage() is true. See addMtomAttachment(DataHandler, String, String) for details.

WS-I Attachment Profile 1.0 is supported by addSwaRefAttachment(DataHandler) being called by the marshaller for each JAXB property related to {http://ws-i.org/profiles/basic/1.1/xsd}swaRef.

Since:
JAXB 2.0
Author:
Marc Hadley, Kohsuke Kawaguchi, Joseph Fialli
See Also:
Marshaller.setAttachmentMarshaller(AttachmentMarshaller), XML-binary Optimized Packaging, WS-I Attachments Profile Version 1.0.

Constructor Summary
AttachmentMarshaller()
Method Summary
abstract String | addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) Consider binary data for optimized binary storage as an attachment.
abstract String | addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) Consider MIME content data for optimized binary storage as an attachment.
abstract String | addSwaRefAttachment(DataHandler data) Add MIME data as an attachment and return attachment's content-id, cid.
boolean | isXOPPackage() Read-only property that returns true if JAXB marshaller should enable XOP creation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public AttachmentMarshaller()
英文文档：

AttachmentMarshaller

public AttachmentMarshaller()
Method Detail

abstract public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName)

将用于优化二进制存储的 MIME 内容 data 作为附件。

正如 Creating XOP Packages 中的步骤 3 所述，当 #isXOPPackage() 为 true 时，JAXB 编组过程针对每个数据类型为 "base64Binary" 的元素调用此方法。

方法实现程序决定是将 data 单独附加还是作为 base64Binary 数据内嵌。如果实现选择将二进制数据存储作为 MIME 的一部分进行优化，则实现负责将 data 附加到基于 MIME 的包中，然后分配一个唯一的内容 id（即 cid），用来标识 MIME 消息中的 MIME 部分。此方法返回 cid，cid 使 JAXB 编组程序能够编组一个引用该 cid 的 XOP 元素，而不是编组二进制数据。当该方法返回 null 时，JAXB 编组程序将 data 作为 base64binary 数据内嵌。

此方法的调用程序要求满足以下约束条件。如果包含 data 的元素 infoset 项具有属性 xmime:contentType，或者代表 data 的 JAXB 属性/字段使用已知的 MIME 类型进行注解，则 data.getContentType() 应该被设置为 MIME 类型。

elementNamespace 和 elementLocalName 参数提供包含二进制数据的上下文。基于 MIME 的包处理器可以使用此信息，以确定二进制数据应该被内嵌还是作为附件优化。

data | 表示将被附加的数据。必须为非 null。
elementNamespace | 封装 base64Binary 数据的元素名称空间 URI。可以为空但不能为 null。
elementLocalName | 元素的本地名称。始终是非 null 的有效字符串。
return | 一个有效的内容 id URI（参见 RFC 2387），它标识包含 data 的附件。如果没有添加附件，而是应该内嵌在消息中，则返回 null。
See also | XML-binary Optimized Packaging, Describing Media Content of Binary Data in XML
英文文档：

addMtomAttachment

public abstract String addMtomAttachment(DataHandler data,
                                         String elementNamespace,
                                         String elementLocalName)

Consider MIME content data for optimized binary storage as an attachment.

This method is called by JAXB marshal process when isXOPPackage() is true, for each element whose datatype is "base64Binary", as described in Step 3 in Creating XOP Packages.

The method implementor determines whether data shall be attached separately or inlined as base64Binary data. If the implementation chooses to optimize the storage of the binary data as a MIME part, it is responsible for attaching data to the MIME-based package, and then assigning an unique content-id, cid, that identifies the MIME part within the MIME message. This method returns the cid, which enables the JAXB marshaller to marshal a XOP element that refers to that cid in place of marshalling the binary data. When the method returns null, the JAXB marshaller inlines data as base64binary data.

The caller of this method is required to meet the following constraint. If the element infoset item containing data has the attribute xmime:contentType or if the JAXB property/field representing datais annotated with a known MIME type, data.getContentType() should be set to that MIME type.

The elementNamespace and elementLocalName parameters provide the context that contains the binary data. This information could be used by the MIME-based package processor to determine if the binary data should be inlined or optimized as an attachment.

Parameters:
data - represents the data to be attached. Must be non-null.
elementNamespace - the namespace URI of the element that encloses the base64Binary data. Can be empty but never null.
elementLocalName - The local name of the element. Always a non-null valid string.
Returns:
a valid content-id URI (see RFC 2387) that identifies the attachment containing data. Otherwise, null if the attachment was not added and should instead be inlined in the message.
See Also:
XML-binary Optimized Packaging, Describing Media Content of Binary Data in XML

abstract public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName)

将用于优化二进制存储的二进制 data 作为附件。

由于内容类型未知，所以附件的 MIME 内容类型必须设置为“application/octet-stream”。

elementNamespace 和 elementLocalName 参数提供包含二进制数据的上下文。基于 MIME 的包处理器可以使用此信息，以确定二进制数据应该被内嵌，还是作为附件优化。

data | 表示将被附加的数据。必须为非 null。实际数据区域由 (data,offset,length) 元组指定。
offset | 要读取的第一个字节在数组中的偏移量；必须为非负且不大于 array.length。
length | 要从给定数组读取的字节数；必须为非负且不大于 array.length。
mimeType | 如果数据具有 JAXB 已知的关联 MIME 类型，则使用此参数传递。如果所有类型未知，则使用“application/octet-stream”。此参数不可以为 null。
elementNamespace | 封装 base64Binary 数据的元素名称空间 URI。可以为空但不能为 null。
elementLocalName | 元素的本地名称。始终是非 null 的有效字符串。
return | 包含 data 的附件的内容 id URI（即 cid）；如果数据应该内嵌，则返回 null。
See also | addMtomAttachment(DataHandler, String, String)
英文文档：

addMtomAttachment

public abstract String addMtomAttachment(byte[] data,
                                         int offset,
                                         int length,
                                         String mimeType,
                                         String elementNamespace,
                                         String elementLocalName)

Consider binary data for optimized binary storage as an attachment.

Since content type is not known, the attachment's MIME content type must be set to "application/octet-stream".

The elementNamespace and elementLocalName parameters provide the context that contains the binary data. This information could be used by the MIME-based package processor to determine if the binary data should be inlined or optimized as an attachment.

Parameters:
data - represents the data to be attached. Must be non-null. The actual data region is specified by (data,offset,length) tuple.
offset - The offset within the array of the first byte to be read; must be non-negative and no larger than array.length
length - The number of bytes to be read from the given array; must be non-negative and no larger than array.length
mimeType - If the data has an associated MIME type known to JAXB, that is passed as this parameter. If none is known, "application/octet-stream". This parameter may never be null.
elementNamespace - the namespace URI of the element that encloses the base64Binary data. Can be empty but never null.
elementLocalName - The local name of the element. Always a non-null valid string.
Returns:
content-id URI, cid, to the attachment containing data or null if data should be inlined.
See Also:
addMtomAttachment(DataHandler, String, String)

public boolean isXOPPackage()

只读属性，如果 JAXB 编组器应该启用 XOP 创建，则返回 true。

编组过程中此值不得更改。如果此值为 true，则当编组过程遇到适当的二进制数据类型时，将调用 addMtomAttachment(...) 方法。

如果此值为 true 且要编组的 XML 内容违反 Creating XOP Pacakgeshttp://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages 中的步骤 1，则 Marshaller.marshal() 必须抛出 IllegalStateException。步骤 1 中写道：“Ensure the Original XML Infoset contains no element information item with a [namespace name] of "http://www.w3.org/2004/08/xop/include" and a [local name] of Include”。

若此方法返回 true，并且在编组过程中至少有一次调用 addMtomAttachment(...) 返回内容 id，则根据 Creating XOP Pacakges 中步骤 5 的描述，基于 MIME 的包处理器必须使用 application/xop+xml 媒体类型来标记根部分。

return 当 MIME 上下文是一个 XOP 包时，返回 true。
英文文档：

isXOPPackage

public boolean isXOPPackage()

Read-only property that returns true if JAXB marshaller should enable XOP creation.

This value must not change during the marshalling process. When this value is true, the addMtomAttachment(...) method is invoked when the appropriate binary datatypes are encountered by the marshal process.

Marshaller.marshal() must throw IllegalStateException if this value is true and the XML content to be marshalled violates Step 1 in Creating XOP Pacakges http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages. "Ensure the Original XML Infoset contains no element information item with a [namespace name] of "http://www.w3.org/2004/08/xop/include" and a [local name] of Include"

When this method returns true and during the marshal process at least one call to addMtomAttachment(...) returns a content-id, the MIME-based package processor must label the root part with the application/xop+xml media type as described in Step 5 of Creating XOP Pacakges.

Returns:
true when MIME context is a XOP Package.

abstract public String addSwaRefAttachment(DataHandler data)

将 MIME data 作为附件添加，并返回附件的内容 id（即 cid）。

JAXB 编组过程针对每个归类为 {http://ws-i.org/profiles/basic/1.1/xsd}swaRef 的元素/属性调用此方法。实现此方法的基于 MIME 的包处理器负责将指定的数据附加到 MIME 附件中，并生成一个内容 id（即 cid），用来唯一地标识基于 MIME 的包内的附件。

调用程序将返回内容 id（即 cid）插入正在编组的 XML 内容中。

data | 表示将被附加的数据。必须为非 null。
return | 必须为用作 cid 的有效 URI。必须满足 WS-I Attachments Profile Version 1.0 的一致性要求 R2928。
英文文档：

addSwaRefAttachment

public abstract String addSwaRefAttachment(DataHandler data)

Add MIME data as an attachment and return attachment's content-id, cid.

This method is called by JAXB marshal process for each element/attribute typed as {http://ws-i.org/profiles/basic/1.1/xsd}swaRef. The MIME-based package processor implementing this method is responsible for attaching the specified data to a MIME attachment, and generating a content-id, cid, that uniquely identifies the attachment within the MIME-based package.

Caller inserts the returned content-id, cid, into the XML content being marshalled.

Parameters:
data - represents the data to be attached. Must be non-null.
Returns:
must be a valid URI used as cid. Must satisfy Conformance Requirement R2928 from WS-I Attachments Profile Version 1.0.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AttachmentUnmarshaller (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.attachment
Class AttachmentUnmarshaller

java.lang.Object
    extended by  javax.xml.bind.attachment.AttachmentUnmarshaller

public abstract class AttachmentUnmarshaller
extends Object

启用包含优化的二进制数据格式的根文档的 JAXB 解组。

此 API 支持 JAXB 2.0 实现与基于 MIME 的包处理器（MTOM/XOP 和 WS-I AP 1.0）之间的协作，有效地处理优化的二进制数据格式。JAXB 解组包的正文，把理解将使用的打包格式这项任务委托给实现此抽象类的基于 MIME 的包处理器。

此抽象类标识包是否需要 XOP 处理（#isXOPPackage()），并提供对使用内容 id 存储为附件的二进制内容的检索。

标识要传递给 getAttachment*(String cid) 的内容 id（即 cid）。

  • 对于 XOP 处理，cid 的信息集表示形式在 3.2 节 Interpreting XOP Packages 步骤 2a 中描述。
  • 对于 WS-I AP 1.0，cid 被标识为一个元素，或者 4.4 节 Referencing Attachments from the SOAP Envelope 中指定的类型 ref:swaRef 的属性。
since | JAXB 2.0
See also | setAttachmentUnmarshaller(AttachmentUnmarshaller), XML-binary Optimized Packaging, WS-I Attachments Profile Version 1.0., Describing Media Content of Binary Data in XML
英文文档：

Enables JAXB unmarshalling of a root document containing optimized binary data formats.

This API enables an efficient cooperative processing of optimized binary data formats between a JAXB 2.0 implementation and MIME-based package processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the understanding of the packaging format being used to a MIME-based package processor that implements this abstract class.

This abstract class identifies if a package requires XOP processing, isXOPPackage() and provides retrieval of binary content stored as attachments by content-id.

Identifying the content-id, cid, to pass to getAttachment*(String cid)

  • For XOP processing, the infoset representation of the cid is described in step 2a in Section 3.2 Interpreting XOP Packages
  • For WS-I AP 1.0, the cid is identified as an element or attribute of type ref:swaRef specified in Section 4.4 Referencing Attachments from the SOAP Envelope

Since:
JAXB 2.0
Author:
Marc Hadley, Kohsuke Kawaguchi, Joseph Fialli
See Also:
Unmarshaller.setAttachmentUnmarshaller(AttachmentUnmarshaller), XML-binary Optimized Packaging, WS-I Attachments Profile Version 1.0., Describing Media Content of Binary Data in XML

Constructor Summary
AttachmentUnmarshaller()
Method Summary
abstract byte[] | getAttachmentAsByteArray(String cid) Retrieve the attachment identified by content-id, cid, as a byte[].
abstract DataHandler | getAttachmentAsDataHandler(String cid) Lookup MIME content by content-id, cid, and return as a DataHandler.
boolean | isXOPPackage() Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public AttachmentUnmarshaller()
英文文档：

AttachmentUnmarshaller

public AttachmentUnmarshaller()
Method Detail

abstract public DataHandler getAttachmentAsDataHandler(String cid)

通过内容 id（即 cid）查找 MIME 内容，并作为 DataHandler 返回。

返回的 DataHandler 实例必须配置为满足以下必需的映射关系约束条件。

MIME 和 Java 类型之间的必需的映射关系
MIME 类型 | Java 类型
DataHandler.getContentType() | instanceof DataHandler.getContent()
image/gif | java.awt.Image
image/jpeg | java.awt.Image
text/xml or application/xml | javax.xml.transform.Source
注意，允许支持其他映射关系。

cid | 需要它是 XML 模式 xs:anyURI 数据类型的有效词法形式。如果 #isXOPPackage() ==true，则对于每个 cid: URI 模式，它都必须是有效的 URI（参见 RFC 2387）。
return | 表示 MIME 附件的 DataHandler。
Throws | IllegalArgumentException: 如果未找到给定 cid 的附件。
英文文档：

getAttachmentAsDataHandler

public abstract DataHandler getAttachmentAsDataHandler(String cid)

Lookup MIME content by content-id, cid, and return as a DataHandler.

The returned DataHandler instance must be configured to meet the following required mapping constaint.

Required Mappings between MIME and Java Types
MIME Type | Java Type
DataHandler.getContentType() | instanceof DataHandler.getContent()
image/gif | java.awt.Image
image/jpeg | java.awt.Image
text/xml or application/xml | javax.xml.transform.Source
Note that it is allowable to support additional mappings.

Parameters:
cid - It is expected to be a valid lexical form of the XML Schema xs:anyURI datatype. If isXOPPackage() ==true, it must be a valid URI per the cid: URI scheme (see RFC 2387)
Returns:
a DataHandler that represents the MIME attachment.
Throws:
IllegalArgumentException - if the attachment for the given cid is not found.

abstract public byte[] getAttachmentAsByteArray(String cid)

以 byte[] 形式检索由内容 id（即 cid）标识的附件。

.
cid | 需要它是 XML 模式 xs:anyURI 数据类型的有效词法形式。如果 #isXOPPackage() ==true，则对于每个 cid: URI 模式，它都必须是有效的 URI（参见 RFC 2387）。
return | 由 cid 所标识的附件的 byte[] 表示形式。
Throws | IllegalArgumentException: 如果未找到给定 cid 的附件。
英文文档：

getAttachmentAsByteArray

public abstract byte[] getAttachmentAsByteArray(String cid)

Retrieve the attachment identified by content-id, cid, as a byte[]

.

Parameters:
cid - It is expected to be a valid lexical form of the XML Schema xs:anyURI datatype. If isXOPPackage() ==true, it must be a valid URI per the cid: URI scheme (see RFC 2387)
Returns:
byte[] representation of attachment identified by cid.
Throws:
IllegalArgumentException - if the attachment for the given cid is not found.

public boolean isXOPPackage()

只读属性，如果 JAXB 解组程序需要执行 XOP 处理，则返回 true。

当满足 Identifying XOP Documents 中指定的约束条件时，此方法返回 true。解组过程中此值不得更改。

return 当 MIME 上下文是一个 XOP 文档时，返回 true。
英文文档：

isXOPPackage

public boolean isXOPPackage()

Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.

This method returns true when the constraints specified in Identifying XOP Documents are met. This value must not change during the unmarshalling process.

Returns:
true when MIME context is a XOP Document.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.bind.helpers (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.bind.helpers

JAXB Provider Use Only: Provides partial default implementations for some of the javax.xml.bind interfaces.

See:
Description

Class Summary
AbstractMarshallerImpl | Partial default Marshaller implementation.
AbstractUnmarshallerImpl | Partial default Unmarshaller implementation.
DefaultValidationEventHandler | JAXB 1.0 only default validation event handler.
NotIdentifiableEventImpl | Default implementation of the NotIdentifiableEvent interface.
ParseConversionEventImpl | Default implementation of the ParseConversionEvent interface.
PrintConversionEventImpl | Default implementation of the PrintConversionEvent interface.
ValidationEventImpl | Default implementation of the ValidationEvent interface.
ValidationEventLocatorImpl | Default implementation of the ValidationEventLocator interface.

Package javax.xml.bind.helpers Description

JAXB Provider Use Only: Provides partial default implementations for some of the javax.xml.bind interfaces.

JAXB Providers can extend these classes and implement the abstract methods.

Package Specification

  • JAXB Specification

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • The JAXB Website

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.bind.helpers Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.bind.helpers

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.bind.helpers.AbstractMarshallerImpl (implements javax.xml.bind.Marshaller)
    • javax.xml.bind.helpers.AbstractUnmarshallerImpl (implements javax.xml.bind.Unmarshaller)
    • javax.xml.bind.helpers.DefaultValidationEventHandler (implements javax.xml.bind.ValidationEventHandler)
    • javax.xml.bind.helpers.ValidationEventImpl (implements javax.xml.bind.ValidationEvent)
      • javax.xml.bind.helpers.NotIdentifiableEventImpl (implements javax.xml.bind.NotIdentifiableEvent)
      • javax.xml.bind.helpers.ParseConversionEventImpl (implements javax.xml.bind.ParseConversionEvent)
      • javax.xml.bind.helpers.PrintConversionEventImpl (implements javax.xml.bind.PrintConversionEvent)
    • javax.xml.bind.helpers.ValidationEventLocatorImpl (implements javax.xml.bind.ValidationEventLocator)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


AbstractMarshallerImpl (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.helpers
Class AbstractMarshallerImpl

java.lang.Object
    extended by  javax.xml.bind.helpers.AbstractMarshallerImpl
All Implemented Interfaces:
Marshaller
public abstract class AbstractMarshallerImpl
extends Object
implements Marshaller

Implements: Marshaller

部分默认 Marshaller 实现。

此类提供 javax.xml.bind.Marshaller 接口的部分默认实现。

JAXB 提供者必须实现的方法只有 marshal(Object, javax.xml.transform.Result)、marshal(Object, javax.xml.stream.XMLStreamWriter) 和 marshal(Object, javax.xml.stream.XMLEventWriter)。

version
en
$Revision: 1.7 $ $Date: 2006/03/08 17:00:39 $
since | JAXB1.0
See also | javax.xml.bind.Marshaller
英文文档：

Partial default Marshaller implementation.

This class provides a partial default implementation for the Marshaller interface.

The only methods that a JAXB Provider has to implement are
marshal(Object, javax.xml.transform.Result),
marshal(Object, javax.xml.stream.XMLStreamWriter), and
marshal(Object, javax.xml.stream.XMLEventWriter).

Since:
JAXB1.0
Version:
$Revision: 1.7 $ $Date: 2006/03/08 17:00:39 $
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
See Also:
Marshaller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.xml.bind.Marshaller
Marshaller.Listener
Field Summary
Fields inherited from interface javax.xml.bind.Marshaller
JAXB_ENCODING, JAXB_FORMATTED_OUTPUT, JAXB_FRAGMENT, JAXB_NO_NAMESPACE_SCHEMA_LOCATION, JAXB_SCHEMA_LOCATION
Constructor Summary
AbstractMarshallerImpl()
Method Summary
<A extends XmlAdapter>
A
getAdapter(Class<A> type)
Gets the adapter associated with the specified type.
 AttachmentMarshaller getAttachmentMarshaller()
protected  String getEncoding()
Convenience method for getting the current output encoding.
 ValidationEventHandler getEventHandler()
Return the current event handler or the default event handler if one hasn't been set.
protected  String getJavaEncoding(String encoding)
Gets the corresponding Java encoding name from an IANA name.
 Marshaller.Listener getListener()
Return Marshaller.Listener registered with this Marshaller.
 Node getNode(Object obj)
By default, the getNode method is unsupported and throw an UnsupportedOperationException.
protected  String getNoNSSchemaLocation()
Convenience method for getting the current noNamespaceSchemaLocation.
 Object getProperty(String name)
Default implementation of the getProperty method handles the four defined properties in Marshaller.
 Schema getSchema()
Get the JAXP 1.3 Schema object being used to perform marshal-time validation.
protected  String getSchemaLocation()
Convenience method for getting the current schemaLocation.
protected  boolean isFormattedOutput()
Convenience method for getting the formatted output flag.
protected  boolean isFragment()
Convenience method for getting the fragment flag.
 void marshal(Object obj, ContentHandler handler)
Marshal the content tree rooted at jaxbElement into SAX2 events.
 void marshal(Object obj, Node node)
Marshal the content tree rooted at jaxbElement into a DOM tree.
 void marshal(Object obj, OutputStream os)
Marshal the content tree rooted at jaxbElement into an output stream.
 void marshal(Object obj, Writer w)
Marshal the content tree rooted at jaxbElement into a Writer.
 void marshal(Object obj, XMLEventWriter writer)
Marshal the content tree rooted at jaxbElement into a XMLEventWriter.
 void marshal(Object obj, XMLStreamWriter writer)
Marshal the content tree rooted at jaxbElement into a XMLStreamWriter.
<A extends XmlAdapter>
void
setAdapter(Class<A> type, A adapter)
Associates a configured instance of XmlAdapter with this marshaller.
 void setAdapter(XmlAdapter adapter)
Associates a configured instance of XmlAdapter with this marshaller.
 void setAttachmentMarshaller(AttachmentMarshaller am)
Associate a context that enables binary data within an XML document to be transmitted as XML-binary optimized attachment.
protected  void setEncoding(String encoding)
Convenience method for setting the output encoding.
 void setEventHandler(ValidationEventHandler handler)
Allow an application to register a validation event handler.
protected  void setFormattedOutput(boolean v)
Convenience method for setting the formatted output flag.
protected  void setFragment(boolean v)
Convenience method for setting the fragment flag.
 void setListener(Marshaller.Listener listener)
Register marshal event callback Marshaller.Listener with this Marshaller.
protected  void setNoNSSchemaLocation(String location)
Convenience method for setting the noNamespaceSchemaLocation.
 void setProperty(String name, Object value)
Default implementation of the setProperty method handles the four defined properties in Marshaller.
 void setSchema(Schema schema)
Specify the JAXP 1.3 Schema object that should be used to validate subsequent marshal operations against.
protected  void setSchemaLocation(String location)
Convenience method for setting the schemaLocation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.xml.bind.Marshaller
marshal

Constructor Detail

public AbstractMarshallerImpl()
英文文档：

AbstractMarshallerImpl

public AbstractMarshallerImpl()
Method Detail

final public void marshal(Object obj, java.io.OutputStream os) throws JAXBException
英文文档：

marshal

public final void marshal(Object obj,
                          OutputStream os)
                   throws JAXBException
Description copied from interface: Marshaller
Marshal the content tree rooted at jaxbElement into an output stream.

Specified by:
marshal in interface Marshaller
Parameters:
obj - The root of content tree to be marshalled.
os - XML will be added to this stream.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.

final public void marshal(Object obj, java.io.Writer w) throws JAXBException
英文文档：

marshal

public final void marshal(Object obj,
                          Writer w)
                   throws JAXBException
Description copied from interface: Marshaller
Marshal the content tree rooted at jaxbElement into a Writer.

Specified by:
marshal in interface Marshaller
Parameters:
obj - The root of content tree to be marshalled.
w - XML will be sent to this writer.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.

final public void marshal(Object obj, org.xml.sax.ContentHandler handler) throws JAXBException
英文文档：

marshal

public final void marshal(Object obj,
                          ContentHandler handler)
                   throws JAXBException
Description copied from interface: Marshaller
Marshal the content tree rooted at jaxbElement into SAX2 events.

Specified by:
marshal in interface Marshaller
Parameters:
obj - The root of content tree to be marshalled.
handler - XML will be sent to this handler as SAX2 events.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.

final public void marshal(Object obj, org.w3c.dom.Node node) throws JAXBException
英文文档：

marshal

public final void marshal(Object obj,
                          Node node)
                   throws JAXBException
Description copied from interface: Marshaller
Marshal the content tree rooted at jaxbElement into a DOM tree.

Specified by:
marshal in interface Marshaller
Parameters:
obj - The content tree to be marshalled.
node - DOM nodes will be added as children of this node. This parameter must be a Node that accepts children (Document, DocumentFragment, or Element)
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal jaxbElement (or any object reachable from jaxbElement). See Marshalling a JAXB element.

public org.w3c.dom.Node getNode(Object obj) throws JAXBException
默认情况下，getNode 方法不受支持并抛出 java.lang.UnsupportedOperationException。 选择支持此方法的实现必须重写此方法。
英文文档：

getNode

public Node getNode(Object obj)
             throws JAXBException
By default, the getNode method is unsupported and throw an UnsupportedOperationException. Implementations that choose to support this method must override this method.

Specified by:
getNode in interface Marshaller
Parameters:
obj - - JAXB Java representation of XML content
Returns:
the DOM tree view of the contentTree
Throws:
JAXBException - If any unexpected problem occurs

protected String getEncoding()
获取当前输出编码的便捷方法。
return 当前的编码，如果没有设置编码，则返回 "UTF-8"。
英文文档：

getEncoding

protected String getEncoding()
Convenience method for getting the current output encoding.

Returns:
the current encoding or "UTF-8" if it hasn't been set.

protected void setEncoding(String encoding)
设置输出编码的便捷方法。
encoding Marshaller 类文档中指定的有效编码
英文文档：

setEncoding

protected void setEncoding(String encoding)
Convenience method for setting the output encoding.

Parameters:
encoding - a valid encoding as specified in the Marshaller class documentation

protected String getSchemaLocation()
获取当前 schemaLocation 的便捷方法。
return 当前的 schemaLocation，如果没有设置 schemaLocation，则返回 null
英文文档：

getSchemaLocation

protected String getSchemaLocation()
Convenience method for getting the current schemaLocation.

Returns:
the current schemaLocation or null if it hasn't been set

protected void setSchemaLocation(String location)
设置 schemaLocation 的便捷方法。
location schemaLocation 值
英文文档：

setSchemaLocation

protected void setSchemaLocation(String location)
Convenience method for setting the schemaLocation.

Parameters:
location - the schemaLocation value

protected String getNoNSSchemaLocation()
获取当前 noNamespaceSchemaLocation 的便捷方法。
return 当前的 noNamespaceSchemaLocation；如果没有设置 noNamespaceSchemaLocation，则返回 null
英文文档：

getNoNSSchemaLocation

protected String getNoNSSchemaLocation()
Convenience method for getting the current noNamespaceSchemaLocation.

Returns:
the current noNamespaceSchemaLocation or null if it hasn't been set

protected void setNoNSSchemaLocation(String location)
设置 noNamespaceSchemaLocation 的便捷方法。
location noNamespaceSchemaLocation 值
英文文档：

setNoNSSchemaLocation

protected void setNoNSSchemaLocation(String location)
Convenience method for setting the noNamespaceSchemaLocation.

Parameters:
location - the noNamespaceSchemaLocation value

protected boolean isFormattedOutput()
获取格式化输出标志的便捷方法。
return 格式化输出标志的当前值；如果没有设置该值，则返回 false。
英文文档：

isFormattedOutput

protected boolean isFormattedOutput()
Convenience method for getting the formatted output flag.

Returns:
the current value of the formatted output flag or false if it hasn't been set.

protected void setFormattedOutput(boolean v)
设置格式化输出标志的便捷方法。
v 格式化输出标志的值。
英文文档：

setFormattedOutput

protected void setFormattedOutput(boolean v)
Convenience method for setting the formatted output flag.

Parameters:
v - value of the formatted output flag.

protected boolean isFragment()
获取片段标志的便捷方法。
return 片段标志的当前值；如果没有设置该值，则返回 false。
英文文档：

isFragment

protected boolean isFragment()
Convenience method for getting the fragment flag.

Returns:
the current value of the fragment flag or false if it hasn't been set.

protected void setFragment(boolean v)
设置片段标志的便捷方法。
v 片段标志的值。
英文文档：

setFragment

protected void setFragment(boolean v)
Convenience method for setting the fragment flag.

Parameters:
v - value of the fragment flag.

protected String getJavaEncoding(String encoding) throws java.io.UnsupportedEncodingException
从 IANA 名称获取相应的 Java 编码名称。 此方法是派生类用来转换编码名称的 helper 方法。
Throws java.io.UnsupportedEncodingException: 如果此实现无法找到 Java 编码名称。
英文文档：

getJavaEncoding

protected String getJavaEncoding(String encoding)
                          throws UnsupportedEncodingException
Gets the corresponding Java encoding name from an IANA name. This method is a helper method for the derived class to convert encoding names.

Throws:
UnsupportedEncodingException - If this implementation couldn't find the Java encoding name.

public void setProperty(String name, Object value) throws PropertyException
setProperty 方法的默认实现处理 Marshaller 中 4 个已定义的属性。如果提供者需要处理其他属性，则应该在派生类中重写此方法。
英文文档：

setProperty

public void setProperty(String name,
                        Object value)
                 throws PropertyException
Default implementation of the setProperty method handles the four defined properties in Marshaller. If a provider needs to handle additional properties, it should override this method in a derived class.

Specified by:
setProperty in interface Marshaller
Parameters:
name - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.
value - the value of the property to be set
Throws:
PropertyException - when there is an error processing the given property or value

public Object getProperty(String name) throws PropertyException
getProperty 方法的默认实现处理 Marshaller 中 4 个已定义的属性。如果提供者需要支持特定于其他提供者的属性，则应该在派生类中重写此方法。
英文文档：

getProperty

public Object getProperty(String name)
                   throws PropertyException
Default implementation of the getProperty method handles the four defined properties in Marshaller. If a provider needs to support additional provider specific properties, it should override this method in a derived class.

Specified by:
getProperty in interface Marshaller
Parameters:
name - the name of the property to retrieve
Returns:
the value of the requested property
Throws:
PropertyException - when there is an error retrieving the given property or value property name

public ValidationEventHandler getEventHandler() throws JAXBException
See also getEventHandler()
英文文档：

getEventHandler

public ValidationEventHandler getEventHandler()
                                       throws JAXBException
Description copied from interface: Marshaller
Return the current event handler or the default event handler if one hasn't been set.

Specified by:
getEventHandler in interface Marshaller
Returns:
the current ValidationEventHandler or the default event handler if it hasn't been set
Throws:
JAXBException - if an error was encountered while getting the current event handler
See Also:
Marshaller.getEventHandler()

public void setEventHandler(ValidationEventHandler handler) throws JAXBException
See also setEventHandler(ValidationEventHandler)
英文文档：

setEventHandler

public void setEventHandler(ValidationEventHandler handler)
                     throws JAXBException
Description copied from interface: Marshaller
Allow an application to register a validation event handler.

The validation event handler will be called by the JAXB Provider if any validation errors are encountered during calls to any of the marshal API's. If the client application does not register a validation event handler before invoking one of the marshal methods, then validation events will be handled by the default event handler which will terminate the marshal operation after the first error or fatal error is encountered.

Calling this method with a null parameter will cause the Marshaller to revert back to the default default event handler.

Specified by:
setEventHandler in interface Marshaller
Parameters:
handler - the validation event handler
Throws:
JAXBException - if an error was encountered while setting the event handler
See Also:
Marshaller.setEventHandler(ValidationEventHandler)

public void marshal(Object obj, XMLEventWriter writer) throws JAXBException
英文文档：

marshal

public void marshal(Object obj,
                    XMLEventWriter writer)
             throws JAXBException
Description copied from interface: Marshaller
Marshal the content tree rooted at jaxbElement into a XMLEventWriter.

Specified by:
marshal in interface Marshaller
Parameters:
obj - The content tree rooted at jaxbElement to be marshalled.
writer - XML will be sent to this writer.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.

public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException
英文文档：

marshal

public void marshal(Object obj,
                    XMLStreamWriter writer)
             throws JAXBException
Description copied from interface: Marshaller
Marshal the content tree rooted at jaxbElement into a XMLStreamWriter.

Specified by:
marshal in interface Marshaller
Parameters:
obj - The content tree to be marshalled.
writer - XML will be sent to this writer.
Throws:
JAXBException - If any unexpected problem occurs during the marshalling.
MarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Marshaller is unable to marshal obj (or any object reachable from obj). See Marshalling a JAXB element.

public void setSchema(javax.xml.validation.Schema schema)
英文文档：

setSchema

public void setSchema(Schema schema)
Description copied from interface: Marshaller
Specify the JAXP 1.3 Schema object that should be used to validate subsequent marshal operations against. Passing null into this method will disable validation.

This method allows the caller to validate the marshalled XML as it's marshalled.

Initially this property is set to null.

Specified by:
setSchema in interface Marshaller
Parameters:
schema - Schema object to validate marshal operations against or null to disable validation

public javax.xml.validation.Schema getSchema()
英文文档：

getSchema

public Schema getSchema()
Description copied from interface: Marshaller
Get the JAXP 1.3 Schema object being used to perform marshal-time validation. If there is no Schema set on the marshaller, then this method will return null indicating that marshal-time validation will not be performed.

Specified by:
getSchema in interface Marshaller
Returns:
the Schema object being used to perform marshal-time validation or null if not present.

public void setAdapter(XmlAdapter adapter)
英文文档：

setAdapter

public void setAdapter(XmlAdapter adapter)
Description copied from interface: Marshaller
Associates a configured instance of XmlAdapter with this marshaller.

This is a convenience method that invokes setAdapter(adapter.getClass(),adapter);.

Specified by:
setAdapter in interface Marshaller
See Also:
Marshaller.setAdapter(Class,XmlAdapter)

英文文档：

setAdapter

public <A extends XmlAdapter> void setAdapter(Class<A> type,
                                              A adapter)
Description copied from interface: Marshaller
Associates a configured instance of XmlAdapter with this marshaller.

Every marshaller internally maintains a Map<Class,XmlAdapter>, which it uses for marshalling classes whose fields/methods are annotated with XmlJavaTypeAdapter.

This method allows applications to use a configured instance of XmlAdapter. When an instance of an adapter is not given, a marshaller will create one by invoking its default constructor.

Specified by:
setAdapter in interface Marshaller
Parameters:
type - The type of the adapter. The specified instance will be used when XmlJavaTypeAdapter.value() refers to this type.
adapter - The instance of the adapter to be used. If null, it will un-register the current adapter set for this type.

英文文档：

getAdapter

public <A extends XmlAdapter> A getAdapter(Class<A> type)
Description copied from interface: Marshaller
Gets the adapter associated with the specified type. This is the reverse operation of the Marshaller.setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter) method.

Specified by:
getAdapter in interface Marshaller

public void setAttachmentMarshaller(AttachmentMarshaller am)
英文文档：

setAttachmentMarshaller

public void setAttachmentMarshaller(AttachmentMarshaller am)
Description copied from interface: Marshaller

Associate a context that enables binary data within an XML document to be transmitted as XML-binary optimized attachment. The attachment is referenced from the XML document content model by content-id URIs(cid) references stored within the xml document.

Specified by:
setAttachmentMarshaller in interface Marshaller

public AttachmentMarshaller getAttachmentMarshaller()
英文文档：

getAttachmentMarshaller

public AttachmentMarshaller getAttachmentMarshaller()
Specified by:
getAttachmentMarshaller in interface Marshaller

public void setListener(Marshaller.Listener listener)
英文文档：

setListener

public void setListener(Marshaller.Listener listener)
Description copied from interface: Marshaller

Register marshal event callback Marshaller.Listener with this Marshaller.

There is only one Listener per Marshaller. Setting a Listener replaces the previous set Listener. One can unregister current Listener by setting listener to null.

Specified by:
setListener in interface Marshaller
Parameters:
listener - an instance of a class that implements Marshaller.Listener

public Marshaller.Listener getListener()
英文文档：

getListener

public Marshaller.Listener getListener()
Description copied from interface: Marshaller

Return Marshaller.Listener registered with this Marshaller.

Specified by:
getListener in interface Marshaller
Returns:
registered Marshaller.Listener or null if no Listener is registered with this Marshaller.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AbstractUnmarshallerImpl (Java EE 5)

javax.xml.bind.helpers
Class AbstractUnmarshallerImpl

java.lang.Object
    extended by  javax.xml.bind.helpers.AbstractUnmarshallerImpl
All Implemented Interfaces:
Unmarshaller
public abstract class AbstractUnmarshallerImpl
extends Object
implements Unmarshaller

Implements: Unmarshaller

部分默认 Unmarshaller 实现。

此类提供 javax.xml.bind.Unmarshaller 接口的部分默认实现。

JAXB 提供者必须实现 5 个方法：getUnmarshallerHandler、unmarshal(Node)、unmarshal(XMLReader,InputSource)、unmarshal(XMLStreamReader) 和 unmarshal(XMLEventReader)。

version
en
$Revision: 1.14 $ $Date: 2006/03/08 17:01:00 $
since | JAXB1.0
See also | javax.xml.bind.Unmarshaller
英文文档：

Partial default Unmarshaller implementation.

This class provides a partial default implementation for the Unmarshallerinterface.

A JAXB Provider has to implement five methods (getUnmarshallerHandler, unmarshal(Node), unmarshal(XMLReader,InputSource), unmarshal(XMLStreamReader), and unmarshal(XMLEventReader).

Since:
JAXB1.0
Version:
$Revision: 1.14 $ $Date: 2006/03/08 17:01:00 $
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
See Also:
Unmarshaller

Nested Class Summary
Nested classes/interfaces inherited from interface javax.xml.bind.Unmarshaller
Unmarshaller.Listener
Field Summary
protected  boolean validating
whether or not the unmarshaller will validate
Constructor Summary
AbstractUnmarshallerImpl()
Method Summary
protected  UnmarshalException createUnmarshalException(SAXException e)
Creates an UnmarshalException from a SAXException.
<A extends XmlAdapter>
A
getAdapter(Class<A> type)
Gets the adapter associated with the specified type.
 AttachmentUnmarshaller getAttachmentUnmarshaller()
 ValidationEventHandler getEventHandler()
Return the current event handler or the default event handler if one hasn't been set.
 Unmarshaller.Listener getListener()
Return Unmarshaller.Listener registered with this Unmarshaller.
 Object getProperty(String name)
Default implementation of the getProperty method always throws PropertyException since there are no required properties.
 Schema getSchema()
Get the JAXP 1.3 Schema object being used to perform unmarshal-time validation.
protected  XMLReader getXMLReader()
Obtains a configured XMLReader.
 boolean isValidating()
Indicates whether or not the Unmarshaller is configured to validate during unmarshal operations.
<A extends XmlAdapter>
void
setAdapter(Class<A> type, A adapter)
Associates a configured instance of XmlAdapter with this unmarshaller.
 void setAdapter(XmlAdapter adapter)
Associates a configured instance of XmlAdapter with this unmarshaller.
 void setAttachmentUnmarshaller(AttachmentUnmarshaller au)
Associate a context that resolves cid's, content-id URIs, to binary data passed as attachments.
 void setEventHandler(ValidationEventHandler handler)
Allow an application to register a validation event handler.
 void setListener(Unmarshaller.Listener listener)
Register unmarshal event callback Unmarshaller.Listener with this Unmarshaller.
 void setProperty(String name, Object value)
Default implementation of the setProperty method always throws PropertyException since there are no required properties.
 void setSchema(Schema schema)
Specify the JAXP 1.3 Schema object that should be used to validate subsequent unmarshal operations against.
 void setValidating(boolean validating)
Specifies whether or not the Unmarshaller should validate during unmarshal operations.
 Object unmarshal(File f)
Unmarshal XML data from the specified file and return the resulting content tree.
 Object unmarshal(InputSource source)
Unmarshal XML data from the specified SAX InputSource and return the resulting content tree.
 Object unmarshal(InputStream is)
Unmarshal XML data from the specified InputStream and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(Node node, Class<T> expectedType)
Unmarshal XML data by JAXB mapped declaredType and return the resulting content tree.
 Object unmarshal(Reader reader)
Unmarshal XML data from the specified Reader and return the resulting content tree.
 Object unmarshal(Source source)
Unmarshal XML data from the specified XML Source and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(Source source, Class<T> expectedType)
Unmarshal XML data from the specified XML Source by declaredType and return the resulting content tree.
 Object unmarshal(URL url)
Unmarshal XML data from the specified URL and return the resulting content tree.
 Object unmarshal(XMLEventReader reader)
Unmarshal XML data from the specified pull parser and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(XMLEventReader reader, Class<T> expectedType)
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.
protected abstract  Object unmarshal(XMLReader reader, InputSource source)
Unmarshals an object by using the specified XMLReader and the InputSource.
 Object unmarshal(XMLStreamReader reader)
Unmarshal XML data from the specified pull parser and return the resulting content tree.
<T> JAXBElement<T>
unmarshal(XMLStreamReader reader, Class<T> expectedType)
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.xml.bind.Unmarshaller
getUnmarshallerHandler, unmarshal

Field Detail

英文文档：

validating

protected boolean validating
whether or not the unmarshaller will validate

Constructor Detail

public AbstractUnmarshallerImpl()
英文文档：

AbstractUnmarshallerImpl

public AbstractUnmarshallerImpl()
Method Detail

protected org.xml.sax.XMLReader getXMLReader() throws JAXBException
获取配置好的 XMLReader。 此方法在客户端指定的 SAXSource 对象没有 XMLReader 时使用。 Unmarshaller 不可重入，因此我们只能使用一个 XMLReader 实例。
英文文档：

getXMLReader

protected XMLReader getXMLReader()
                          throws JAXBException
Obtains a configured XMLReader. This method is used when the client-specified SAXSource object doesn't have XMLReader. Unmarshaller is not re-entrant, so we will only use one instance of XMLReader.

Throws:
JAXBException

public Object unmarshal(javax.xml.transform.Source source) throws JAXBException
英文文档：

unmarshal

public Object unmarshal(Source source)
                 throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified XML Source and return the resulting content tree.

Implements Unmarshal Global Root Element.

SAX 2.0 Parser Pluggability

A client application can choose not to use the default parser mechanism supplied with their JAXB provider. Any SAX 2.0 compliant parser can be substituted for the JAXB provider's default mechanism. To do so, the client application must properly configure a SAXSource containing an XMLReader implemented by the SAX 2.0 parser provider. If the XMLReader has an org.xml.sax.ErrorHandler registered on it, it will be replaced by the JAXB Provider so that validation errors can be reported via the ValidationEventHandler mechanism of JAXB. If the SAXSource does not contain an XMLReader, then the JAXB provider's default parser mechanism will be used.

This parser replacement mechanism can also be used to replace the JAXB provider's unmarshal-time validation engine. The client application must properly configure their SAX 2.0 compliant parser to perform validation (as shown in the example above). Any SAXParserExceptions encountered by the parser during the unmarshal operation will be processed by the JAXB provider and converted into JAXB ValidationEvent objects which will be reported back to the client via the ValidationEventHandler registered with the Unmarshaller. Note: specifying a substitute validating SAX 2.0 parser for unmarshalling does not necessarily replace the validation engine used by the JAXB provider for performing on-demand validation.

The only way for a client application to specify an alternate parser mechanism to be used during unmarshal is via the unmarshal(SAXSource) API. All other forms of the unmarshal method (File, URL, Node, etc) will use the JAXB provider's default parser and validator mechanisms.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
source - the XML Source to unmarshal XML data from (providers are only required to support SAXSource, DOMSource, and StreamSource)
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
See Also:
Unmarshaller.unmarshal(javax.xml.transform.Source, Class)

abstract protected Object unmarshal(org.xml.sax.XMLReader reader, org.xml.sax.InputSource source) throws JAXBException
使用指定的 XMLReader 和 InputSource 解组对象。 被调用者应调用 XMLReader 的 setErrorHandler 方法，这样错误才能传递给客户端指定的 ValidationEventHandler。
英文文档：

unmarshal

protected abstract Object unmarshal(XMLReader reader,
                                    InputSource source)
                             throws JAXBException
Unmarshals an object by using the specified XMLReader and the InputSource. The callee should call the setErrorHandler method of the XMLReader so that errors are passed to the client-specified ValidationEventHandler.

Throws:
JAXBException

final public Object unmarshal(org.xml.sax.InputSource source) throws JAXBException
英文文档：

unmarshal

public final Object unmarshal(InputSource source)
                       throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified SAX InputSource and return the resulting content tree.

Implements Unmarshal Global Root Element.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
source - the input source to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

final public Object unmarshal(java.net.URL url) throws JAXBException
英文文档：

unmarshal

public final Object unmarshal(URL url)
                       throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified URL and return the resulting content tree.

Implements Unmarshal Global Root Element.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
url - the url to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

final public Object unmarshal(java.io.File f) throws JAXBException
英文文档：

unmarshal

public final Object unmarshal(File f)
                       throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified file and return the resulting content tree.

Implements Unmarshal Global Root Element.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
f - the file to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

final public Object unmarshal(java.io.InputStream is) throws JAXBException
英文文档：

unmarshal

public final Object unmarshal(InputStream is)
                       throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified InputStream and return the resulting content tree. Validation event location information may be incomplete when using this form of the unmarshal API.

Implements Unmarshal Global Root Element.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
is - the InputStream to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

final public Object unmarshal(java.io.Reader reader) throws JAXBException
英文文档：

unmarshal

public final Object unmarshal(Reader reader)
                       throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified Reader and return the resulting content tree. Validation event location information may be incomplete when using this form of the unmarshal API, because a Reader does not provide the system ID.

Implements Unmarshal Global Root Element.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
reader - the Reader to unmarshal XML data from
Returns:
the newly created root object of the java content tree
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

public boolean isValidating() throws JAXBException
指示 Unmarshaller 是否被配置为在执行解组操作期间进行验证。

注： 为了与 JAXP 保持一致，我将该方法命名为 isValidating()，而不是 getValidating()。

return | 如果 Unmarshaller 被配置为在执行解组操作期间进行验证，则返回 true，否则返回 false
Throws | JAXBException: 如果检索验证标志时发生错误
英文文档：

isValidating

public boolean isValidating()
                     throws JAXBException
Indicates whether or not the Unmarshaller is configured to validate during unmarshal operations.

Note: I named this method isValidating() to stay in-line with JAXP, as opposed to naming it getValidating().

Specified by:
isValidating in interface Unmarshaller
Returns:
true if the Unmarshaller is configured to validate during unmarshal operations, false otherwise
Throws:
JAXBException - if an error occurs while retrieving the validating flag

public void setEventHandler(ValidationEventHandler handler) throws JAXBException
允许应用程序注册一个验证事件处理程序。

如果在调用任一 unmarshal 方法期间发生验证错误，则 JAXB 提供者将调用验证事件处理程序。如果在调用解组方法之前客户端应用程序没有注册验证事件处理程序，那么将忽略所有验证事件，并有可能导致不可预料的行为。

handler | 验证事件处理程序
Throws | JAXBException: 如果在设置事件处理程序时发生错误
英文文档：

setEventHandler

public void setEventHandler(ValidationEventHandler handler)
                     throws JAXBException
Allow an application to register a validation event handler.

The validation event handler will be called by the JAXB Provider if any validation errors are encountered during calls to any of the unmarshal methods. If the client application does not register a validation event handler before invoking the unmarshal methods, then all validation events will be silently ignored and may result in unexpected behaviour.

Specified by:
setEventHandler in interface Unmarshaller
Parameters:
handler - the validation event handler
Throws:
JAXBException - if an error was encountered while setting the event handler

public void setValidating(boolean validating) throws JAXBException
指定 Unmarshaller 是否应该在执行解组操作期间进行验证。默认情况下，Unmarshaller 不进行验证。

此方法仅在调用某一解组方法之前或之后调用。

validating | 如果 Unmarshaller 应该在执行解组操作期间进行验证，则该参数为 true，否则为 false
Throws | JAXBException: 如果在执行解组操作期间启用或禁用验证时发生错误
英文文档：

setValidating

public void setValidating(boolean validating)
                   throws JAXBException
Specifies whether or not the Unmarshaller should validate during unmarshal operations. By default, the Unmarshaller does not validate.

This method may only be invoked before or after calling one of the unmarshal methods.

Specified by:
setValidating in interface Unmarshaller
Parameters:
validating - true if the Unmarshaller should validate during unmarshal, false otherwise
Throws:
JAXBException - if an error occurred while enabling or disabling validation at unmarshal time

public ValidationEventHandler getEventHandler() throws JAXBException
当前的事件处理程序；如果没有设置，则返回默认事件处理程序。
return | 当前 ValidationEventHandler，如果没有设置该处理程序，则返回默认的事件处理程序
Throws | JAXBException: 如果获取当前事件处理程序时发生错误
英文文档：

getEventHandler

public ValidationEventHandler getEventHandler()
                                       throws JAXBException
Return the current event handler or the default event handler if one hasn't been set.

Specified by:
getEventHandler in interface Unmarshaller
Returns:
the current ValidationEventHandler or the default event handler if it hasn't been set
Throws:
JAXBException - if an error was encountered while getting the current event handler

protected UnmarshalException createUnmarshalException(org.xml.sax.SAXException e)
从 SAXException 创建 UnmarshalException。 这是一个为派生类提供的实用方法。

当提供者实现的 ContentHandler 希望抛出 JAXBException 时，它需要通过 SAXException 包装该异常。如果 unmarshaller 实现盲目地使用 JAXBException 包装 SAXException ，则异常将是用另一个 JAXBException 包装的 SAXException 包装的 JAXBException。这样做很不明智。

此方法检查 SAXException 的嵌套异常并可减少过多的包装。

return 得到的 UnmarshalException
英文文档：

createUnmarshalException

protected UnmarshalException createUnmarshalException(SAXException e)
Creates an UnmarshalException from a SAXException. This is an utility method provided for the derived classes.

When a provider-implemented ContentHandler wants to throw a JAXBException, it needs to wrap the exception by a SAXException. If the unmarshaller implementation blindly wrap SAXException by JAXBException, such an exception will be a JAXBException wrapped by a SAXException wrapped by another JAXBException. This is silly.

This method checks the nested exception of SAXException and reduce those excessive wrapping.

Returns:
the resulting UnmarshalException

public void setProperty(String name, Object value) throws PropertyException
由于没有必需的属性，setProperty 方法的默认实现总是抛出 PropertyException。如果提供商需要处理其他属性，则应该在派生类中重写此方法。
英文文档：

setProperty

public void setProperty(String name,
                        Object value)
                 throws PropertyException
Default implementation of the setProperty method always throws PropertyException since there are no required properties. If a provider needs to handle additional properties, it should override this method in a derived class.

Specified by:
setProperty in interface Unmarshaller
Parameters:
name - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.
value - the value of the property to be set
Throws:
PropertyException - when there is an error processing the given property or value

public Object getProperty(String name) throws PropertyException
由于没有必需的属性，getProperty 方法的默认实现总是抛出 PropertyException。如果提供者需要处理其他属性，则应该在派生类中重写此方法。
英文文档：

getProperty

public Object getProperty(String name)
                   throws PropertyException
Default implementation of the getProperty method always throws PropertyException since there are no required properties. If a provider needs to handle additional properties, it should override this method in a derived class.

Specified by:
getProperty in interface Unmarshaller
Parameters:
name - the name of the property to retrieve
Returns:
the value of the requested property
Throws:
PropertyException - when there is an error retrieving the given property or value property name

public Object unmarshal(XMLEventReader reader) throws JAXBException
英文文档：

unmarshal

public Object unmarshal(XMLEventReader reader)
                 throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified pull parser and return the resulting content tree.

This method is an Unmarshal Global Root method.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
reader - The parser to be read.
Returns:
the newly created root object of the java content tree.
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
See Also:
Unmarshaller.unmarshal(javax.xml.stream.XMLEventReader, Class)

public Object unmarshal(XMLStreamReader reader) throws JAXBException
英文文档：

unmarshal

public Object unmarshal(XMLStreamReader reader)
                 throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified pull parser and return the resulting content tree.

Implements Unmarshal Global Root Element.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
reader - The parser to be read.
Returns:
the newly created root object of the java content tree.
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data
See Also:
Unmarshaller.unmarshal(javax.xml.stream.XMLStreamReader, Class)

英文文档：

unmarshal

public <T> JAXBElement<T> unmarshal(Node node,
                                    Class<T> expectedType)
                         throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data by JAXB mapped declaredType and return the resulting content tree.

Implements Unmarshal by Declared Type

Specified by:
unmarshal in interface Unmarshaller
Parameters:
node - the document/element to unmarshal XML data from. The caller must support at least Document and Element.
expectedType - appropriate JAXB mapped class to hold node's XML data.
Returns:
JAXB Element representation of node
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

英文文档：

unmarshal

public <T> JAXBElement<T> unmarshal(Source source,
                                    Class<T> expectedType)
                         throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal XML data from the specified XML Source by declaredType and return the resulting content tree.

Implements Unmarshal by Declared Type

See SAX 2.0 Parser Pluggability

Specified by:
unmarshal in interface Unmarshaller
Parameters:
source - the XML Source to unmarshal XML data from (providers are only required to support SAXSource, DOMSource, and StreamSource)
expectedType - appropriate JAXB mapped class to hold source's xml root element
Returns:
Java content rooted by JAXB Element
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

英文文档：

unmarshal

public <T> JAXBElement<T> unmarshal(XMLStreamReader reader,
                                    Class<T> expectedType)
                         throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.

This method implements unmarshal by declaredType.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
reader - The parser to be read.
expectedType - appropriate JAXB mapped class to hold reader's START_ELEMENT XML data.
Returns:
content tree rooted by JAXB Element representation
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

英文文档：

unmarshal

public <T> JAXBElement<T> unmarshal(XMLEventReader reader,
                                    Class<T> expectedType)
                         throws JAXBException
Description copied from interface: Unmarshaller
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.

This method implements unmarshal by declaredType.

This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the reader will be pointing at the token right after the end event.

Specified by:
unmarshal in interface Unmarshaller
Parameters:
reader - The parser to be read.
expectedType - appropriate JAXB mapped class to hold reader's START_ELEMENT XML data.
Returns:
content tree rooted by JAXB Element representation
Throws:
JAXBException - If any unexpected errors occur while unmarshalling
UnmarshalException - If the ValidationEventHandler returns false from its handleEvent method or the Unmarshaller is unable to perform the XML to Java binding. See Unmarshalling XML Data

public void setSchema(javax.xml.validation.Schema schema)
英文文档：

setSchema

public void setSchema(Schema schema)
Description copied from interface: Unmarshaller
Specify the JAXP 1.3 Schema object that should be used to validate subsequent unmarshal operations against. Passing null into this method will disable validation.

This method replaces the deprecated setValidating(boolean) API.

Initially this property is set to null.

Specified by:
setSchema in interface Unmarshaller
Parameters:
schema - Schema object to validate unmarshal operations against or null to disable validation

public javax.xml.validation.Schema getSchema()
英文文档：

getSchema

public Schema getSchema()
Description copied from interface: Unmarshaller
Get the JAXP 1.3 Schema object being used to perform unmarshal-time validation. If there is no Schema set on the unmarshaller, then this method will return null indicating that unmarshal-time validation will not be performed.

This method provides replacement functionality for the deprecated Unmarshaller.isValidating() API as well as access to the Schema object. To determine if the Unmarshaller has validation enabled, simply test the return type for null:

boolean isValidating = u.getSchema()!=null;

Specified by:
getSchema in interface Unmarshaller
Returns:
the Schema object being used to perform unmarshal-time validation or null if not present

public void setAdapter(XmlAdapter adapter)
英文文档：

setAdapter

public void setAdapter(XmlAdapter adapter)
Description copied from interface: Unmarshaller
Associates a configured instance of XmlAdapter with this unmarshaller.

This is a convenience method that invokes setAdapter(adapter.getClass(),adapter);.

Specified by:
setAdapter in interface Unmarshaller
See Also:
Unmarshaller.setAdapter(Class,XmlAdapter)

英文文档：

setAdapter

public <A extends XmlAdapter> void setAdapter(Class<A> type,
                                              A adapter)
Description copied from interface: Unmarshaller
Associates a configured instance of XmlAdapter with this unmarshaller.

Every unmarshaller internally maintains a Map<Class,XmlAdapter>, which it uses for unmarshalling classes whose fields/methods are annotated with XmlJavaTypeAdapter.

This method allows applications to use a configured instance of XmlAdapter. When an instance of an adapter is not given, an unmarshaller will create one by invoking its default constructor.

Specified by:
setAdapter in interface Unmarshaller
Parameters:
type - The type of the adapter. The specified instance will be used when XmlJavaTypeAdapter.value() refers to this type.
adapter - The instance of the adapter to be used. If null, it will un-register the current adapter set for this type.

英文文档：

getAdapter

public <A extends XmlAdapter> A getAdapter(Class<A> type)
Description copied from interface: Unmarshaller
Gets the adapter associated with the specified type. This is the reverse operation of the Unmarshaller.setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter) method.

Specified by:
getAdapter in interface Unmarshaller

public void setAttachmentUnmarshaller(AttachmentUnmarshaller au)
英文文档：

setAttachmentUnmarshaller

public void setAttachmentUnmarshaller(AttachmentUnmarshaller au)
Description copied from interface: Unmarshaller

Associate a context that resolves cid's, content-id URIs, to binary data passed as attachments.

Unmarshal time validation, enabled via Unmarshaller.setSchema(Schema), must be supported even when unmarshaller is performing XOP processing.

Specified by:
setAttachmentUnmarshaller in interface Unmarshaller

public AttachmentUnmarshaller getAttachmentUnmarshaller()
英文文档：

getAttachmentUnmarshaller

public AttachmentUnmarshaller getAttachmentUnmarshaller()
Specified by:
getAttachmentUnmarshaller in interface Unmarshaller

public void setListener(Unmarshaller.Listener listener)
英文文档：

setListener

public void setListener(Unmarshaller.Listener listener)
Description copied from interface: Unmarshaller

Register unmarshal event callback Unmarshaller.Listener with this Unmarshaller.

There is only one Listener per Unmarshaller. Setting a Listener replaces the previous set Listener. One can unregister current Listener by setting listener to null.

Specified by:
setListener in interface Unmarshaller
Parameters:
listener - provides unmarshal event callbacks for this Unmarshaller

public Unmarshaller.Listener getListener()
英文文档：

getListener

public Unmarshaller.Listener getListener()
Description copied from interface: Unmarshaller

Return Unmarshaller.Listener registered with this Unmarshaller.

Specified by:
getListener in interface Unmarshaller
Returns:
registered Unmarshaller.Listener or null if no Listener is registered with this Unmarshaller.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DefaultValidationEventHandler (Java EE 5)

javax.xml.bind.helpers
Class DefaultValidationEventHandler

java.lang.Object
    extended by  javax.xml.bind.helpers.DefaultValidationEventHandler
All Implemented Interfaces:
ValidationEventHandler
public class DefaultValidationEventHandler
extends Object
implements ValidationEventHandler

Implements: ValidationEventHandler

唯一的 JAXB 1.0 默认验证事件处理程序。对于所有根据管理模式派生代码（该代码由 JAXB 1.0 绑定编译器生成）的 JAXBContext 而创建的对象，此类是默认处理程序。

此处理程序在第一次出现错误或出现严重错误时将导致解组和验证操作失败。

对于遵守 JAXB 2.0 和以后版本的映射 JAXB 的类，此处理程序不再是默认处理器。默认验证事件处理已经更改，它在 javax.xml.bind.Unmarshaller 和 javax.xml.bind.Marshaller 中指定。

version
en
$Revision: 1.5 $
since | JAXB1.0
See also | javax.xml.bind.Unmarshaller, javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler
英文文档：

JAXB 1.0 only default validation event handler. This is the default handler for all objects created from a JAXBContext that is managing schema-derived code generated by a JAXB 1.0 binding compiler.

This handler causes the unmarshal and validate operations to fail on the first error or fatal error.

This handler is not the default handler for JAXB mapped classes following JAXB 2.0 or later versions. Default validation event handling has changed and is specified in Unmarshaller and Marshaller.

Since:
JAXB1.0
Version:
$Revision: 1.5 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
Unmarshaller, Validator, ValidationEventHandler

Constructor Summary
DefaultValidationEventHandler()
Method Summary
 boolean handleEvent(ValidationEvent event)
Receive notification of a validation warning or error.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public DefaultValidationEventHandler()
英文文档：

DefaultValidationEventHandler

public DefaultValidationEventHandler()
Method Detail

public boolean handleEvent(ValidationEvent event)
英文文档：

handleEvent

public boolean handleEvent(ValidationEvent event)
Description copied from interface: ValidationEventHandler
Receive notification of a validation warning or error. The ValidationEvent will have a ValidationEventLocator embedded in it that indicates where the error or warning occurred.

If an unchecked runtime exception is thrown from this method, the JAXB provider will treat it as if the method returned false and interrupt the current unmarshal, validate, or marshal operation.

Specified by:
handleEvent in interface ValidationEventHandler
Parameters:
event - the encapsulated validation event information. It is a provider error if this parameter is null.
Returns:
true if the JAXB Provider should attempt to continue the current unmarshal, validate, or marshal operation after handling this warning/error, false if the provider should terminate the current operation with the appropriate UnmarshalException, ValidationException, or MarshalException.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotIdentifiableEventImpl (Java EE 5)

javax.xml.bind.helpers
Class NotIdentifiableEventImpl

java.lang.Object
    extended by  javax.xml.bind.helpers.ValidationEventImpl
        extended by  javax.xml.bind.helpers.NotIdentifiableEventImpl
All Implemented Interfaces:
NotIdentifiableEvent, ValidationEvent
public class NotIdentifiableEventImpl
extends ValidationEventImpl
implements NotIdentifiableEvent

Extends: ValidationEventImpl
Implements: NotIdentifiableEvent

NotIdentifiableEvent 接口的默认实现。

允许 JAXB 提供者使用可实现 ValidationEvent 接口的任何类。提供此类只是为了方便使用。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.NotIdentifiableEvent, javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler, javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventLocator
英文文档：

Default implementation of the NotIdentifiableEvent interface.

JAXB providers are allowed to use whatever class that implements the ValidationEvent interface. This class is just provided for a convenience.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
NotIdentifiableEvent, Validator, ValidationEventHandler, ValidationEvent, ValidationEventLocator

Field Summary
Fields inherited from interface javax.xml.bind.ValidationEvent
ERROR, FATAL_ERROR, WARNING
Constructor Summary
NotIdentifiableEventImpl(int _severity, String _message, ValidationEventLocator _locator)
Create a new NotIdentifiableEventImpl.
NotIdentifiableEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
Create a new NotIdentifiableEventImpl.
Method Summary
Methods inherited from class javax.xml.bind.helpers.ValidationEventImpl
getLinkedException, getLocator, getMessage, getSeverity, setLinkedException, setLocator, setMessage, setSeverity, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.xml.bind.ValidationEvent
getLinkedException, getLocator, getMessage, getSeverity

Constructor Detail

public NotIdentifiableEventImpl(int _severity, String _message, ValidationEventLocator _locator)
创建新的 NotIdentifiableEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

NotIdentifiableEventImpl

public NotIdentifiableEventImpl(int _severity,
                                String _message,
                                ValidationEventLocator _locator)
Create a new NotIdentifiableEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied

public NotIdentifiableEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
创建新的 NotIdentifiableEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
_linkedException | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

NotIdentifiableEventImpl

public NotIdentifiableEventImpl(int _severity,
                                String _message,
                                ValidationEventLocator _locator,
                                Throwable _linkedException)
Create a new NotIdentifiableEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
_linkedException - An optional linked exception that may provide additional information about the event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParseConversionEventImpl (Java EE 5)

javax.xml.bind.helpers
Class ParseConversionEventImpl

java.lang.Object
    extended by  javax.xml.bind.helpers.ValidationEventImpl
        extended by  javax.xml.bind.helpers.ParseConversionEventImpl
All Implemented Interfaces:
ParseConversionEvent, ValidationEvent
public class ParseConversionEventImpl
extends ValidationEventImpl
implements ParseConversionEvent

Extends: ValidationEventImpl
Implements: ParseConversionEvent

ParseConversionEvent 接口的默认实现。

允许 JAXB 提供者使用实现了 ValidationEvent 接口的任何类。提供此类只是为了方便使用。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.ParseConversionEvent, javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler, javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventLocator
英文文档：

Default implementation of the ParseConversionEvent interface.

JAXB providers are allowed to use whatever class that implements the ValidationEvent interface. This class is just provided for a convenience.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
ParseConversionEvent, Validator, ValidationEventHandler, ValidationEvent, ValidationEventLocator

Field Summary
Fields inherited from interface javax.xml.bind.ValidationEvent
ERROR, FATAL_ERROR, WARNING
Constructor Summary
ParseConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator)
Create a new ParseConversionEventImpl.
ParseConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
Create a new ParseConversionEventImpl.
Method Summary
Methods inherited from class javax.xml.bind.helpers.ValidationEventImpl
getLinkedException, getLocator, getMessage, getSeverity, setLinkedException, setLocator, setMessage, setSeverity, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.xml.bind.ValidationEvent
getLinkedException, getLocator, getMessage, getSeverity

Constructor Detail

public ParseConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator)
创建新的 ParseConversionEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

ParseConversionEventImpl

public ParseConversionEventImpl(int _severity,
                                String _message,
                                ValidationEventLocator _locator)
Create a new ParseConversionEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied

public ParseConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
创建新的 ParseConversionEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
_linkedException | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

ParseConversionEventImpl

public ParseConversionEventImpl(int _severity,
                                String _message,
                                ValidationEventLocator _locator,
                                Throwable _linkedException)
Create a new ParseConversionEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
_linkedException - An optional linked exception that may provide additional information about the event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PrintConversionEventImpl (Java EE 5)

javax.xml.bind.helpers
Class PrintConversionEventImpl

java.lang.Object
    extended by  javax.xml.bind.helpers.ValidationEventImpl
        extended by  javax.xml.bind.helpers.PrintConversionEventImpl
All Implemented Interfaces:
PrintConversionEvent, ValidationEvent
public class PrintConversionEventImpl
extends ValidationEventImpl
implements PrintConversionEvent

Extends: ValidationEventImpl
Implements: PrintConversionEvent

PrintConversionEvent 接口的默认实现。

允许 JAXB 提供者使用实现了 ValidationEvent 接口的任何类。提供此类只是为了方便使用。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.PrintConversionEvent, javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler, javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventLocator
英文文档：

Default implementation of the PrintConversionEvent interface.

JAXB providers are allowed to use whatever class that implements the ValidationEvent interface. This class is just provided for a convenience.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
See Also:
PrintConversionEvent, Validator, ValidationEventHandler, ValidationEvent, ValidationEventLocator

Field Summary
Fields inherited from interface javax.xml.bind.ValidationEvent
ERROR, FATAL_ERROR, WARNING
Constructor Summary
PrintConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator)
Create a new PrintConversionEventImpl.
PrintConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
Create a new PrintConversionEventImpl.
Method Summary
Methods inherited from class javax.xml.bind.helpers.ValidationEventImpl
getLinkedException, getLocator, getMessage, getSeverity, setLinkedException, setLocator, setMessage, setSeverity, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.xml.bind.ValidationEvent
getLinkedException, getLocator, getMessage, getSeverity

Constructor Detail

public PrintConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator)
创建新的 PrintConversionEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

PrintConversionEventImpl

public PrintConversionEventImpl(int _severity,
                                String _message,
                                ValidationEventLocator _locator)
Create a new PrintConversionEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied

public PrintConversionEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
创建新的 PrintConversionEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
_linkedException | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

PrintConversionEventImpl

public PrintConversionEventImpl(int _severity,
                                String _message,
                                ValidationEventLocator _locator,
                                Throwable _linkedException)
Create a new PrintConversionEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
_linkedException - An optional linked exception that may provide additional information about the event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationEventImpl (Java EE 5)

javax.xml.bind.helpers
Class ValidationEventImpl

java.lang.Object
    extended by  javax.xml.bind.helpers.ValidationEventImpl
All Implemented Interfaces:
ValidationEvent
Direct Known Subclasses:
NotIdentifiableEventImpl, ParseConversionEventImpl, PrintConversionEventImpl
public class ValidationEventImpl
extends Object
implements ValidationEvent

Implements: ValidationEvent
Extended by: NotIdentifiableEventImpl, ParseConversionEventImpl, PrintConversionEventImpl

ValidationEvent 接口的默认实现。

允许 JAXB 提供者使用实现了 ValidationEvent 接口的任何类。提供此类只是为了方便使用。

version
en
$Revision: 1.1 $
since | JAXB1.0
See also | javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler, javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventLocator
英文文档：

Default implementation of the ValidationEvent interface.

JAXB providers are allowed to use whatever class that implements the ValidationEvent interface. This class is just provided for a convenience.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
See Also:
Validator, ValidationEventHandler, ValidationEvent, ValidationEventLocator

Field Summary
Fields inherited from interface javax.xml.bind.ValidationEvent
ERROR, FATAL_ERROR, WARNING
Constructor Summary
ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator)
Create a new ValidationEventImpl.
ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
Create a new ValidationEventImpl.
Method Summary
Throwable | getLinkedException() Retrieve the linked exception for this warning/error.
ValidationEventLocator | getLocator() Retrieve the locator for this warning/error.
String | getMessage() Retrieve the text message for this warning/error.
int | getSeverity() Retrieve the severity code for this warning/error.
void | setLinkedException(Throwable _linkedException) Set the linked exception field of this event.
void | setLocator(ValidationEventLocator _locator) Set the locator object for this event.
void | setMessage(String _message) Set the message field of this event.
void | setSeverity(int _severity) Set the severity field of this event.
String | toString() Returns a string representation of this object in a format helpful to debugging.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator)
创建新的 ValidationEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

ValidationEventImpl

public ValidationEventImpl(int _severity,
                           String _message,
                           ValidationEventLocator _locator)
Create a new ValidationEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied

public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
创建新的 ValidationEventImpl。
_severity | 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message | 此事件的 Locator 对象，可以为 null。
_locator | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
_linkedException | 一个可以提供事件的其他信息的可选链接异常，可以为 null。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

ValidationEventImpl

public ValidationEventImpl(int _severity,
                           String _message,
                           ValidationEventLocator _locator,
                           Throwable _linkedException)
Create a new ValidationEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
_linkedException - An optional linked exception that may provide additional information about the event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied
Method Detail

public int getSeverity()
英文文档：

getSeverity

public int getSeverity()
Description copied from interface: ValidationEvent
Retrieve the severity code for this warning/error.

Must be one of ValidationError.WARNING, ValidationError.ERROR, or ValidationError.FATAL_ERROR.

Specified by:
getSeverity in interface ValidationEvent
Returns:
the severity code for this warning/error

public void setSeverity(int _severity)
设置此事件的 severity 字段。
_severity | 必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一。
Throws | IllegalArgumentException: 如果提供了非法的 severity 字段
英文文档：

setSeverity

public void setSeverity(int _severity)
Set the severity field of this event.

Parameters:
_severity - Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.
Throws:
IllegalArgumentException - if an illegal severity field is supplied

public String getMessage()
英文文档：

getMessage

public String getMessage()
Description copied from interface: ValidationEvent
Retrieve the text message for this warning/error.

Specified by:
getMessage in interface ValidationEvent
Returns:
the text message for this warning/error or null if one wasn't set

public void setMessage(String _message)
设置此事件的 message 字段。
_message 字符串消息，可以为 null。
英文文档：

setMessage

public void setMessage(String _message)
Set the message field of this event.

Parameters:
_message - String message - may be null.

public Throwable getLinkedException()
英文文档：

getLinkedException

public Throwable getLinkedException()
Description copied from interface: ValidationEvent
Retrieve the linked exception for this warning/error.

Specified by:
getLinkedException in interface ValidationEvent
Returns:
the linked exception for this warning/error or null if one wasn't set

public void setLinkedException(Throwable _linkedException)
设置此事件的 linked exception 字段。
_linkedException 可选链接异常，可以为 null。
英文文档：

setLinkedException

public void setLinkedException(Throwable _linkedException)
Set the linked exception field of this event.

Parameters:
_linkedException - Optional linked exception - may be null.

public ValidationEventLocator getLocator()
英文文档：

getLocator

public ValidationEventLocator getLocator()
Description copied from interface: ValidationEvent
Retrieve the locator for this warning/error.

Specified by:
getLocator in interface ValidationEvent
Returns:
the locator that indicates where the warning/error occurred

public void setLocator(ValidationEventLocator _locator)
设置此事件的 Locator 对象。
_locator 定位符，可以为 null。
英文文档：

setLocator

public void setLocator(ValidationEventLocator _locator)
Set the locator object for this event.

Parameters:
_locator - The locator - may be null.

public String toString()
以有助于调试的格式返回此对象的字符串表示形式。
See also equals(Object)
英文文档：

toString

public String toString()
Returns a string representation of this object in a format helpful to debugging.

Overrides:
toString in class Object
See Also:
Object.equals(Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationEventLocatorImpl (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.helpers
Class ValidationEventLocatorImpl

java.lang.Object
    extended by  javax.xml.bind.helpers.ValidationEventLocatorImpl
All Implemented Interfaces:
ValidationEventLocator
public class ValidationEventLocatorImpl
extends Object
implements ValidationEventLocator

Implements: ValidationEventLocator

ValidationEventLocator 接口的默认实现。

允许 JAXB 提供者使用实现了 ValidationEventLocator 接口的任何类。提供此类只是为了方便使用。

version
en
$Revision: 1.2 $
since | JAXB1.0
See also | javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler, javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventLocator
英文文档：

Default implementation of the ValidationEventLocator interface.

JAXB providers are allowed to use whatever class that implements the ValidationEventLocator interface. This class is just provided for a convenience.

Since:
JAXB1.0
Version:
$Revision: 1.2 $
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
See Also:
Validator, ValidationEventHandler, ValidationEvent, ValidationEventLocator

Constructor Summary
ValidationEventLocatorImpl()
Creates an object with all fields unavailable.
ValidationEventLocatorImpl(Locator loc)
Constructs an object from an org.xml.sax.Locator.
ValidationEventLocatorImpl(Node _node)
Constructs an object that points to a DOM Node.
ValidationEventLocatorImpl(Object _object)
Constructs an object that points to a JAXB content object.
ValidationEventLocatorImpl(SAXParseException e)
Constructs an object from the location information of a SAXParseException.
Method Summary
int | getColumnNumber() Return the column number if available
int | getLineNumber() Return the line number if available
Node | getNode() Return a reference to the DOM Node if available
Object | getObject() Return a reference to the object in the Java content tree if available
int | getOffset() Return the byte offset if available
URL | getURL() Return the name of the XML source as a URL if available
void | setColumnNumber(int _columnNumber) Set the columnNumber field on this event locator.
void | setLineNumber(int _lineNumber) Set the lineNumber field on this event locator.
void | setNode(Node _node) Set the Node field on this event locator.
void | setObject(Object _object) Set the Object field on this event locator.
void | setOffset(int _offset) Set the offset field on this event locator.
void | setURL(URL _url) Set the URL field on this event locator.
String | toString() Returns a string representation of this object in a format helpful to debugging.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public ValidationEventLocatorImpl()
创建所有字段都不可用的对象。
英文文档：

ValidationEventLocatorImpl

public ValidationEventLocatorImpl()
Creates an object with all fields unavailable.

public ValidationEventLocatorImpl(org.xml.sax.Locator loc)
根据 org.xml.sax.Locator 构造一个对象。 对象的 ColumnNumber、LineNumber 和 URL 可以分别从 Locator 的 getColumnNumber()、getLineNumber() 和 getSystemId() 方法的返回值得到。而 Node、Object 和 Offset 均不可用。
loc | 用于填充此事件定位符的 SAX Locator 对象。
Throws | IllegalArgumentException: 如果 Locator 为 null
英文文档：

ValidationEventLocatorImpl

public ValidationEventLocatorImpl(Locator loc)
Constructs an object from an org.xml.sax.Locator. The object's ColumnNumber, LineNumber, and URL become available from the values returned by the locator's getColumnNumber(), getLineNumber(), and getSystemId() methods respectively. Node, Object, and Offset are not available.

Parameters:
loc - the SAX Locator object that will be used to populate this event locator.
Throws:
IllegalArgumentException - if the Locator is null

public ValidationEventLocatorImpl(org.xml.sax.SAXParseException e)
根据 SAXParseException 的位置信息构造一个对象。 对象的 ColumnNumber、LineNumber 和 URL 可以分别从 Locator 的 getColumnNumber()、getLineNumber() 和 getSystemId() 方法的返回值得到。而 Node、Object 和 Offset 均不可用。
e | 用于填充此事件定位符的 SAXParseException 对象。
Throws | IllegalArgumentException: 如果 SAXParseException 为 null
英文文档：

ValidationEventLocatorImpl

public ValidationEventLocatorImpl(SAXParseException e)
Constructs an object from the location information of a SAXParseException. The object's ColumnNumber, LineNumber, and URL become available from the values returned by the locator's getColumnNumber(), getLineNumber(), and getSystemId() methods respectively. Node, Object, and Offset are not available.

Parameters:
e - the SAXParseException object that will be used to populate this event locator.
Throws:
IllegalArgumentException - if the SAXParseException is null

public ValidationEventLocatorImpl(org.w3c.dom.Node _node)
构造一个指向 DOM Node 的对象。 该对象的 Node 变得可用。ColumnNumber、LineNumber、Object、Offset 和 URL 不可用。
_node | 用于填充此事件定位符的 DOM Node 对象。
Throws | IllegalArgumentException: 如果 Node 为 null
英文文档：

ValidationEventLocatorImpl

public ValidationEventLocatorImpl(Node _node)
Constructs an object that points to a DOM Node. The object's Node becomes available. ColumnNumber, LineNumber, Object, Offset, and URL are not available.

Parameters:
_node - the DOM Node object that will be used to populate this event locator.
Throws:
IllegalArgumentException - if the Node is null

public ValidationEventLocatorImpl(Object _object)
构造一个指向 JAXB 内容对象的对象。 该对象的 Object 变得可用。ColumnNumber、LineNumber、Node、Offset 和 URL 不可用。
_object | 用于填充此事件定位符的 Object。
Throws | IllegalArgumentException: 如果 Object 为 null
英文文档：

ValidationEventLocatorImpl

public ValidationEventLocatorImpl(Object _object)
Constructs an object that points to a JAXB content object. The object's Object becomes available. ColumnNumber, LineNumber, Node, Offset, and URL are not available.

Parameters:
_object - the Object that will be used to populate this event locator.
Throws:
IllegalArgumentException - if the Object is null
Method Detail

public java.net.URL getURL()
See also getURL()
英文文档：

getURL

public URL getURL()
Description copied from interface: ValidationEventLocator
Return the name of the XML source as a URL if available

Specified by:
getURL in interface ValidationEventLocator
Returns:
the name of the XML source as a URL or null if unavailable
See Also:
ValidationEventLocator.getURL()

public void setURL(java.net.URL _url)
在此事件定位符上设置 URL 字段。允许使用 null 值。
_url URL
英文文档：

setURL

public void setURL(URL _url)
Set the URL field on this event locator. Null values are allowed.

Parameters:
_url - the url

public int getOffset()
See also getOffset()
英文文档：

getOffset

public int getOffset()
Description copied from interface: ValidationEventLocator
Return the byte offset if available

Specified by:
getOffset in interface ValidationEventLocator
Returns:
the byte offset into the input source or -1 if unavailable
See Also:
ValidationEventLocator.getOffset()

public void setOffset(int _offset)
在此事件定位符上设置 offset 字段。
_offset 偏移量
英文文档：

setOffset

public void setOffset(int _offset)
Set the offset field on this event locator.

Parameters:
_offset - the offset

public int getLineNumber()
See also getLineNumber()
英文文档：

getLineNumber

public int getLineNumber()
Description copied from interface: ValidationEventLocator
Return the line number if available

Specified by:
getLineNumber in interface ValidationEventLocator
Returns:
the line number or -1 if unavailable
See Also:
ValidationEventLocator.getLineNumber()

public void setLineNumber(int _lineNumber)
在此事件定位符上设置 lineNumber 字段。
_lineNumber 行数
英文文档：

setLineNumber

public void setLineNumber(int _lineNumber)
Set the lineNumber field on this event locator.

Parameters:
_lineNumber - the line number

public int getColumnNumber()
See also getColumnNumber()
英文文档：

getColumnNumber

public int getColumnNumber()
Description copied from interface: ValidationEventLocator
Return the column number if available

Specified by:
getColumnNumber in interface ValidationEventLocator
Returns:
the column number or -1 if unavailable
See Also:
ValidationEventLocator.getColumnNumber()

public void setColumnNumber(int _columnNumber)
在此事件定位符上设置 columnNumber 字段。
_columnNumber 列数
英文文档：

setColumnNumber

public void setColumnNumber(int _columnNumber)
Set the columnNumber field on this event locator.

Parameters:
_columnNumber - the column number

public Object getObject()
See also getObject()
英文文档：

getObject

public Object getObject()
Description copied from interface: ValidationEventLocator
Return a reference to the object in the Java content tree if available

Specified by:
getObject in interface ValidationEventLocator
Returns:
a reference to the object in the Java content tree or null if unavailable
See Also:
ValidationEventLocator.getObject()

public void setObject(Object _object)
在此事件定位符上设置 Object 字段。允许使用 null 值。
_object java 内容对象
英文文档：

setObject

public void setObject(Object _object)
Set the Object field on this event locator. Null values are allowed.

Parameters:
_object - the java content object

public org.w3c.dom.Node getNode()
See also getNode()
英文文档：

getNode

public Node getNode()
Description copied from interface: ValidationEventLocator
Return a reference to the DOM Node if available

Specified by:
getNode in interface ValidationEventLocator
Returns:
a reference to the DOM Node or null if unavailable
See Also:
ValidationEventLocator.getNode()

public void setNode(org.w3c.dom.Node _node)
在此事件定位符上设置 Node 字段。允许使用 null 值。
_node 节点
英文文档：

setNode

public void setNode(Node _node)
Set the Node field on this event locator. Null values are allowed.

Parameters:
_node - the Node

public String toString()
以有助于调试的格式返回此对象的字符串表示形式。
See also equals(Object)
英文文档：

toString

public String toString()
Returns a string representation of this object in a format helpful to debugging.

Overrides:
toString in class Object
See Also:
Object.equals(Object)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.bind.util (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.bind.util

Useful client utility classes.

See:
Description

Class Summary
JAXBResult | JAXP Result implementation that unmarshals a JAXB object.
JAXBSource | JAXP Source implementation that marshals a JAXB-generated object.
ValidationEventCollector | ValidationEventHandler implementation that collects all events.

Package javax.xml.bind.util Description

Useful client utility classes.

Package Specification

  • JAXB Specification

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
  • The JAXB Website

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.bind.util Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.bind.util

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.transform.sax.SAXResult (implements javax.xml.transform.Result)
      • javax.xml.bind.util.JAXBResult
    • javax.xml.transform.sax.SAXSource (implements javax.xml.transform.Source)
      • javax.xml.bind.util.JAXBSource
    • javax.xml.bind.util.ValidationEventCollector (implements javax.xml.bind.ValidationEventHandler)
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


JAXBResult (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.util
Class JAXBResult

java.lang.Object
    extended by  javax.xml.transform.sax.SAXResult
        extended by  javax.xml.bind.util.JAXBResult
All Implemented Interfaces:
Result
public class JAXBResult
extends SAXResult

Extends: javax.xml.transform.sax.SAXResult

解组 JAXB 对象的 JAXP javax.xml.transform.Result 实现。

此实用工具类对于将 JAXB 与其他 Java/XML 技术组合很有用。

以下示例显示了如何使用 JAXB 解组 XSLT 转换得到的文档。

JAXBResult result = new JAXBResult(
JAXBContext.newInstance("org.acme.foo") );

// set up XSLT transformation
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer(new StreamSource("test.xsl"));

// run transformation
t.transform(new StreamSource("document.xml"),result);

// obtain the unmarshalled content tree
Object o = result.getResult();

SAXResult 派生于 JAXBResult 是一个实现细节。因此，通常应用程序最好不要访问 SAXResult 上定义的方法。

尤其不能尝试调用 setHandler、setLexicalHandler 和 setSystemId 方法。

英文文档：

JAXP Result implementation that unmarshals a JAXB object.

This utility class is useful to combine JAXB with other Java/XML technologies.

The following example shows how to use JAXB to unmarshal a document resulting from an XSLT transformation.

       JAXBResult result = new JAXBResult(
         JAXBContext.newInstance("org.acme.foo") );

       // set up XSLT transformation
       TransformerFactory tf = TransformerFactory.newInstance();
       Transformer t = tf.newTransformer(new StreamSource("test.xsl"));

       // run transformation
       t.transform(new StreamSource("document.xml"),result);

       // obtain the unmarshalled content tree
       Object o = result.getResult();

The fact that JAXBResult derives from SAXResult is an implementation detail. Thus in general applications are strongly discouraged from accessing methods defined on SAXResult.

In particular it shall never attempt to call the setHandler, setLexicalHandler, and setSystemId methods.

Author:
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)

Field Summary
Fields inherited from class javax.xml.transform.sax.SAXResult
FEATURE
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
Constructor Summary
JAXBResult(JAXBContext context)
Creates a new instance that uses the specified JAXBContext to unmarshal.
JAXBResult(Unmarshaller _unmarshaller)
Creates a new instance that uses the specified Unmarshaller to unmarshal an object.
Method Summary
 Object getResult()
Gets the unmarshalled object created by the transformation.
Methods inherited from class javax.xml.transform.sax.SAXResult
getHandler, getLexicalHandler, getSystemId, setHandler, setLexicalHandler, setSystemId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JAXBResult(JAXBContext context) throws JAXBException
创建一个使用指定 JAXBContext 来解组的新实例。
context | 用于创建必需的 Unmarshaller 的 JAXBContext。此参数不能为 null。
Throws | JAXBException: 如果创建 JAXBResult 时发生错误，或者上下文参数为 null。
英文文档：

JAXBResult

public JAXBResult(JAXBContext context)
           throws JAXBException
Creates a new instance that uses the specified JAXBContext to unmarshal.

Parameters:
context - The JAXBContext that will be used to create the necessary Unmarshaller. This parameter must not be null.
Throws:
JAXBException - if an error is encountered while creating the JAXBResult or if the context parameter is null.

public JAXBResult(Unmarshaller _unmarshaller) throws JAXBException
创建一个使用指定 Unmarshaller 来解组对象的新实例。

此 JAXBResult 对象将使用指定的 Unmarshaller 实例。在此对象使用某个 Unmarshaller 时，调用者负责保证该 Unmarshaller 不做其他用途。

此方法的主要目的是允许客户端配置 Unmarshaller。如果不知道操作的后果，更容易也更安全的方式是传递 JAXBContext。

_unmarshaller | Unmarshaller。此参数不得为 null。
Throws | JAXBException: 如果创建 JAXBResult 时遇到错误，或者 Unmarshaller 参数为 null。
英文文档：

JAXBResult

public JAXBResult(Unmarshaller _unmarshaller)
           throws JAXBException
Creates a new instance that uses the specified Unmarshaller to unmarshal an object.

This JAXBResult object will use the specified Unmarshaller instance. It is the caller's responsibility not to use the same Unmarshaller for other purposes while it is being used by this object.

The primary purpose of this method is to allow the client to configure Unmarshaller. Unless you know what you are doing, it's easier and safer to pass a JAXBContext.

Parameters:
_unmarshaller - the unmarshaller. This parameter must not be null.
Throws:
JAXBException - if an error is encountered while creating the JAXBResult or the Unmarshaller parameter is null.
Method Detail

public Object getResult() throws JAXBException
获取通过转换创建的已解组对象。
return | 总是返回非 null 对象。
Throws | IllegalStateException: 如果在解组对象前调用此方法。
Throws | JAXBException: 如果出现任何解组错误。注意，允许该实现在解析错误期间抛出 SAXException。
英文文档：

getResult

public Object getResult()
                 throws JAXBException
Gets the unmarshalled object created by the transformation.

Returns:
Always return a non-null object.
Throws:
IllegalStateException - if this method is called before an object is unmarshalled.
JAXBException - if there is any unmarshalling error. Note that the implementation is allowed to throw SAXException during the parsing when it finds an error.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


JAXBSource (Java EE 5)

javax.xml.bind.util
Class JAXBSource

java.lang.Object
    extended by  javax.xml.transform.sax.SAXSource
        extended by  javax.xml.bind.util.JAXBSource
All Implemented Interfaces:
Source
public class JAXBSource
extends SAXSource

Extends: javax.xml.transform.sax.SAXSource

编组 JAXB 生成的对象的 JAXP javax.xml.transform.Source 实现。

此实用工具类对于将 JAXB 与其他 Java/XML 技术组合很有用。

以下示例显示了如何使用 JAXB 编组将由 XSLT 转换的文档。

MyObject o = // get JAXB content tree

// jaxbContext is a JAXBContext object from which 'o' is created.
JAXBSource source = new JAXBSource( jaxbContext, o );

// set up XSLT transformation
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer(new StreamSource("test.xsl"));

// run transformation
t.transform(source,new StreamResult(System.out));

SAXSource 派生于 JAXBSource 是一个实现细节。因此，通常应用程序最好不要访问 SAXSource 上定义的方法。尤其不能调用 setXMLReader 和 setInputSource 方法。通过 getXMLReader 方法获取的 XMLReader 对象只能用于解析 getInputSource 方法返回的 InputSource 对象。

同样，通过 getInputSource 方法获得的 InputSource 对象只能由 getXMLReader 返回的 XMLReader 对象来解析。

英文文档：

JAXP Source implementation that marshals a JAXB-generated object.

This utility class is useful to combine JAXB with other Java/XML technologies.

The following example shows how to use JAXB to marshal a document for transformation by XSLT.

       MyObject o = // get JAXB content tree

       // jaxbContext is a JAXBContext object from which 'o' is created.
       JAXBSource source = new JAXBSource( jaxbContext, o );

       // set up XSLT transformation
       TransformerFactory tf = TransformerFactory.newInstance();
       Transformer t = tf.newTransformer(new StreamSource("test.xsl"));

       // run transformation
       t.transform(source,new StreamResult(System.out));

The fact that JAXBSource derives from SAXSource is an implementation detail. Thus in general applications are strongly discouraged from accessing methods defined on SAXSource. In particular, the setXMLReader and setInputSource methods shall never be called. The XMLReader object obtained by the getXMLReader method shall be used only for parsing the InputSource object returned by the getInputSource method.

Similarly the InputSource object obtained by the getInputSource method shall be used only for being parsed by the XMLReader object returned by the getXMLReader.

Author:
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)

Field Summary
Fields inherited from class javax.xml.transform.sax.SAXSource
FEATURE
Constructor Summary
JAXBSource(JAXBContext context, Object contentObject)
Creates a new Source for the given content object.
JAXBSource(Marshaller marshaller, Object contentObject)
Creates a new Source for the given content object.
Method Summary
Methods inherited from class javax.xml.transform.sax.SAXSource
getInputSource, getSystemId, getXMLReader, setInputSource, setSystemId, setXMLReader, sourceToInputSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public JAXBSource(JAXBContext context, Object contentObject) throws JAXBException
针对给定的内容对象创建一个新 javax.xml.transform.Source。
context | 用于创建 contentObject 的 JAXBContext。此上下文用于创建 marshaller 的新实例，不得为 null。
contentObject | JAXB 生成的类的实例，将用作 javax.xml.transform.Source（通过将它编组到 XML）。它不得为 null。
Throws | JAXBException: 如果创建 JAXBSource 时遇到错误，或者任何一个参数为 null。
英文文档：

JAXBSource

public JAXBSource(JAXBContext context,
                  Object contentObject)
           throws JAXBException
Creates a new Source for the given content object.

Parameters:
context - JAXBContext that was used to create contentObject. This context is used to create a new instance of marshaller and must not be null.
contentObject - An instance of a JAXB-generated class, which will be used as a Source (by marshalling it into XML). It must not be null.
Throws:
JAXBException - if an error is encountered while creating the JAXBSource or if either of the parameters are null.

public JAXBSource(Marshaller marshaller, Object contentObject) throws JAXBException
针对给定的内容对象创建一个新 javax.xml.transform.Source。
marshaller | 用于将 contentObject 编组到 XML 的 marshaller 实例。此实例必须根据用来构建 contentObject 的 JAXBContext 创建，不得为 null。
contentObject | JAXB 生成的类的实例，将用作 javax.xml.transform.Source（通过将它编组到 XML）。它不得为 null。
Throws | JAXBException: 如果创建 JAXBSource 时遇到错误，或者任何一个参数为 null。
英文文档：

JAXBSource

public JAXBSource(Marshaller marshaller,
                  Object contentObject)
           throws JAXBException
Creates a new Source for the given content object.

Parameters:
marshaller - A marshaller instance that will be used to marshal contentObject into XML. This must be created from a JAXBContext that was used to build contentObject and must not be null.
contentObject - An instance of a JAXB-generated class, which will be used as a Source (by marshalling it into XML). It must not be null.
Throws:
JAXBException - if an error is encountered while creating the JAXBSource or if either of the parameters are null.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ValidationEventCollector (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.bind.util
Class ValidationEventCollector

java.lang.Object
    extended by  javax.xml.bind.util.ValidationEventCollector
All Implemented Interfaces:
ValidationEventHandler
public class ValidationEventCollector
extends Object
implements ValidationEventHandler

Implements: ValidationEventHandler

收集所有事件的 ValidationEventHandler 实现。

要使用此类，则需要创建一个新实例并将其传递给 Validator、Unmarshaller 和 Marshaller 类的 setEventHandler 方法。完成对验证和解组的调用之后，调用 getEvents 方法来检索所有报告的错误和警告。

version
en
$Revision: 1.2 $
since | JAXB1.0
See also | javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler, javax.xml.bind.ValidationEvent, javax.xml.bind.ValidationEventLocator
英文文档：

ValidationEventHandler implementation that collects all events.

To use this class, create a new instance and pass it to the setEventHandler method of the Validator, Unmarshaller, Marshaller class. After the call to validate or unmarshal completes, call the getEvents method to retrieve all the reported errors and warnings.

Since:
JAXB1.0
Version:
$Revision: 1.2 $
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
Validator, ValidationEventHandler, ValidationEvent, ValidationEventLocator

Constructor Summary
ValidationEventCollector()
Method Summary
ValidationEvent[] | getEvents() Return an array of ValidationEvent objects containing a copy of each of the collected errors and warnings.
boolean | handleEvent(ValidationEvent event) Receive notification of a validation warning or error.
boolean | hasEvents() Returns true if this event collector contains at least one ValidationEvent.
void | reset() Clear all collected errors and warnings.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ValidationEventCollector()
英文文档：

ValidationEventCollector

public ValidationEventCollector()
Method Detail

public ValidationEvent[] getEvents()
返回一个 ValidationEvent 对象数组，这些对象包含所有收集的错误和警告的副本。
return 所有收集的错误和警告的副本；如果没有收集的错误和警告，则返回一个空数组
英文文档：

getEvents

public ValidationEvent[] getEvents()
Return an array of ValidationEvent objects containing a copy of each of the collected errors and warnings.

Returns:
a copy of all the collected errors and warnings or an empty array if there weren't any

public void reset()
清除所有收集的错误和警告。
英文文档：

reset

public void reset()
Clear all collected errors and warnings.

public boolean hasEvents()
如果此事件收集器至少包含一个 ValidationEvent，则返回 true。
return 如果此事件收集器至少包含一个 ValidationEvent，则返回 true，否则返回 false
英文文档：

hasEvents

public boolean hasEvents()
Returns true if this event collector contains at least one ValidationEvent.

Returns:
true if this event collector contains at least one ValidationEvent, false otherwise

public boolean handleEvent(ValidationEvent event)
英文文档：

handleEvent

public boolean handleEvent(ValidationEvent event)
Description copied from interface: ValidationEventHandler
Receive notification of a validation warning or error. The ValidationEvent will have a ValidationEventLocator embedded in it that indicates where the error or warning occurred.

If an unchecked runtime exception is thrown from this method, the JAXB provider will treat it as if the method returned false and interrupt the current unmarshal, validate, or marshal operation.

Specified by:
handleEvent in interface ValidationEventHandler
Parameters:
event - the encapsulated validation event information. It is a provider error if this parameter is null.
Returns:
true if the JAXB Provider should attempt to continue the current unmarshal, validate, or marshal operation after handling this warning/error, false if the provider should terminate the current operation with the appropriate UnmarshalException, ValidationException, or MarshalException.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.registry (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.registry

This package and its sub-packages describe the API classes and interfaces for the JAXR API.

See:
Description

Interface Summary
BulkResponse | Contains the response of a method in the API that performs a bulk operation and returns a bulk response.
BusinessLifeCycleManager | The BusinessLifeCycleManager interface, which is exposed by the Registry Service, implements the life cycle management functionality of the Registry as part of a business level API.
BusinessQueryManager | The BusinessQueryManager interface, which is exposed by the Registry Service, implements the business style query interface.
CapabilityProfile | Provides information about the capabilities of a JAXR provider.
Connection | This class represents a connection between a JAXR client and a JAXR provider.
DeclarativeQueryManager | This interface provides the ability to execute declarative queries (e.g.
FederatedConnection | Represents a single logical connection to a federation or group of registry providers.
FindQualifier | FindQualifier provides various constants that identify options that effect find method behavior.
JAXRResponse | A JAXR requests' response.
LifeCycleManager | The LifeCycleManager interface is the main interface in the API for managing life cycle operations on objects defined by the information model.
Query | The Query interface encapsulates a query in a declarative query language.
QueryManager | This is the common base interface for all QueryManagers in the API.
RegistryService | This is the principal interface implemented by a JAXR provider.

Class Summary
ConnectionFactory This is the abstract base class for factory classes for creating a JAXR connection.

Exception Summary
DeleteException | A RegistryException that occurs during a delete action.
FindException | A RegistryException that occurs during a find action.
InvalidRequestException | This exception is thrown when a JAXR client attempts to invoke an API method that is not valid for some reason.
JAXRException | Signals that a JAXR exception has occurred.
RegistryException | This is the common base class for all Exceptions that are detected on the registry provider side rather than the JAXR client side.
SaveException | A RegistryException that occurs during a save action.
UnexpectedObjectException | This exception is thrown when the JAXR provider finds a Object that is out-of-place or of the wrong type within the context of a user request.
UnsupportedCapabilityException | This exception must be thrown when a JAXR client attempts to invoke an API method that is not supported by the capability profile that is supported by the JAXR provider.

Package javax.xml.registry Description

This package and its sub-packages describe the API classes and interfaces for the JAXR API. In this package are the high-level interfaces and classes that a client uses to interact with a registry via a JAXR provider.

Figure 1 shows the primary interfaces in the JAXR API.

Primary Interfaces in the JAXR API
Figure 1. Primary Interfaces in the JAXR API

Figure 2 shows the response and exception classes in the JAXR API.

Response and Exception Classes in the JAXR API
Figure 2. Response and Exception Classes in the JAXR API

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.registry Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.registry

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.registry.ConnectionFactory
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.xml.registry.JAXRException (implements javax.xml.registry.JAXRResponse)
          • javax.xml.registry.InvalidRequestException
          • javax.xml.registry.RegistryException
            • javax.xml.registry.DeleteException
            • javax.xml.registry.FindException
            • javax.xml.registry.SaveException
          • javax.xml.registry.UnexpectedObjectException
          • javax.xml.registry.UnsupportedCapabilityException

Interface Hierarchy

  • javax.xml.registry.CapabilityProfile
  • javax.xml.registry.Connection
    • javax.xml.registry.FederatedConnection
  • javax.xml.registry.FindQualifier
  • javax.xml.registry.JAXRResponse
    • javax.xml.registry.BulkResponse
  • javax.xml.registry.LifeCycleManager
    • javax.xml.registry.BusinessLifeCycleManager
  • javax.xml.registry.Query
  • javax.xml.registry.QueryManager
    • javax.xml.registry.BusinessQueryManager
    • javax.xml.registry.DeclarativeQueryManager
  • javax.xml.registry.RegistryService
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


BulkResponse (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.registry
Interface BulkResponse

All Superinterfaces:
JAXRResponse
public interface BulkResponse
extends JAXRResponse

Implements: JAXRResponse

包含对 API 中执行批量操作的方法的响应，返回批量响应。对于批量操作，允许部分提交。

在获得部分成功的事件中（仅成功处理了对象的一个子集），BulkResponse 的 getStatus 方法必须返回 JAXRResponse.STATUS_WARNING。在这种情况下，JAXRException 实例所组成的 Collection 包含在 BulkResponse 实例中。对于妨碍请求中的某些对象成功处理的每个错误，JAXRException 都将提供相关的信息。

See also javax.xml.registry.QueryManager, javax.xml.registry.LifeCycleManager
英文文档：

Contains the response of a method in the API that performs a bulk operation and returns a bulk response. Partial commits are allowed on a bulk operation.

In the event of a partial success where only a subset of objects were processed successfully, the getStatus method of the BulkResponse must return JAXRResponse.STATUS_WARNING. In this case, a Collection of JAXRException instances is included in the BulkResponse instance. The JAXRExceptions provide information on each error that prevented some objects in the request to not be processed successfully.

Author:
Farrukh S. Najmi
See Also:
QueryManager, LifeCycleManager

Field Summary
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Method Summary
Collection | getCollection() Get the Collection of objects returned as a response of a bulk operation.
Collection | getExceptions() Get the Collection of RegistryException instances in case of partial commit.
boolean | isPartialResponse() Determines whether the response is a partial response due to large result set.
Methods inherited from interface javax.xml.registry.JAXRResponse
getRequestId, getStatus, isAvailable

Method Detail

public java.util.Collection<E> getCollection() throws JAXRException
获取作为批量操作的响应返回的对象所组成的 Collection。如果结果尚不可用，则调用者线程将阻塞于此。

功能级别：0
return | RegistryObject 实例组成的 CollectionCollection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.RegistryObject
英文文档：

getCollection

Collection getCollection()
                         throws JAXRException
Get the Collection of objects returned as a response of a bulk operation. Caller thread will block here if result is not yet available.

Capability Level: 0

Returns:
Collection of RegistryObject instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryObject

public java.util.Collection<E> getExceptions() throws JAXRException
获取部分提交情况下 RegistryException 实例所组成的 Collection。如果结果尚不可用，则调用者线程将阻塞于此。

功能级别：0
return | RegistryException 实例所组成的 Collection。如果结果可用且没有任何 RegistryException，则返回 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.RegistryException
英文文档：

getExceptions

Collection getExceptions()
                         throws JAXRException
Get the Collection of RegistryException instances in case of partial commit. Caller thread will block here if result is not yet available.

Capability Level: 0

Returns:
Collection of RegistryException instances. Return null if result is available and there is no RegistryException.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryException

public boolean isPartialResponse() throws JAXRException
确定响应是否由于结果集太大而变为部分响应。

功能级别：0
return | 如果响应是部分响应，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isPartialResponse

boolean isPartialResponse()
                          throws JAXRException
Determines whether the response is a partial response due to large result set.

Capability Level: 0

Returns:
true if the response is partial; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BusinessLifeCycleManager (Java EE 5)

javax.xml.registry
Interface BusinessLifeCycleManager

All Superinterfaces:
LifeCycleManager
public interface BusinessLifeCycleManager
extends LifeCycleManager

Implements: LifeCycleManager

BusinessLifeCycleManager 接口是通过 Registry Service 公开的，它将 Registry 的生命周期管理功能作为业务级 API 的一部分实现。注意，这里不提供验证信息，因为 Connection 接口代表客户端保持该状态和上下文。
See also javax.xml.registry.LifeCycleManager
英文文档：

The BusinessLifeCycleManager interface, which is exposed by the Registry Service, implements the life cycle management functionality of the Registry as part of a business level API. Note that there is no authentication information provided, because the Connection interface keeps that state and context on behalf of the client.

Author:
Farrukh S. Najmi
See Also:
LifeCycleManager

Field Summary
Fields inherited from interface javax.xml.registry.LifeCycleManager
ASSOCIATION, AUDITABLE_EVENT, CLASSIFICATION, CLASSIFICATION_SCHEME, CONCEPT, EMAIL_ADDRESS, EXTERNAL_IDENTIFIER, EXTERNAL_LINK, EXTRINSIC_OBJECT, INTERNATIONAL_STRING, KEY, LOCALIZED_STRING, ORGANIZATION, PERSON_NAME, POSTAL_ADDRESS, REGISTRY_ENTRY, REGISTRY_PACKAGE, SERVICE, SERVICE_BINDING, SLOT, SPECIFICATION_LINK, TELEPHONE_NUMBER, USER, VERSIONABLE
Method Summary
void | confirmAssociation(Association assoc) Confirms this Association by the User associated with the caller.
BulkResponse | deleteAssociations(Collection associationKeys) Deletes the Associations corresponding to the specified Keys.
BulkResponse | deleteClassificationSchemes(Collection schemeKeys) Deletes the ClassificationSchemes corresponding to the specified Keys.
BulkResponse | deleteConcepts(Collection conceptKeys) Deletes the Concepts corresponding to the specified Keys.
BulkResponse | deleteOrganizations(Collection organizationKeys) Deletes the organizations corresponding to the specified Keys.
BulkResponse | deleteServiceBindings(Collection bindingKeys) Deletes the ServiceBindings corresponding to the specified Keys.
BulkResponse | deleteServices(Collection serviceKeys) Deletes the services corresponding to the specified Keys.
BulkResponse | saveAssociations(Collection associations, boolean replace) Saves the specified Association instances.
BulkResponse | saveClassificationSchemes(Collection schemes) Saves the specified ClassificationScheme instances.
BulkResponse | saveConcepts(Collection concepts) Saves the specified Concepts.
BulkResponse | saveOrganizations(Collection organizations) Saves the specified Organizations.
BulkResponse | saveServiceBindings(Collection bindings) Saves the specified ServiceBindings.
BulkResponse | saveServices(Collection services) Saves the specified Services.
void | unConfirmAssociation(Association assoc) Undoes a previous confirmation of this Association by the User associated with the caller.
Methods inherited from interface javax.xml.registry.LifeCycleManager
createAssociation, createClassification, createClassification, createClassification, createClassificationScheme, createClassificationScheme, createClassificationScheme, createConcept, createConcept, createEmailAddress, createEmailAddress, createExternalIdentifier, createExternalIdentifier, createExternalLink, createExternalLink, createExtrinsicObject, createInternationalString, createInternationalString, createInternationalString, createKey, createLocalizedString, createLocalizedString, createObject, createOrganization, createOrganization, createPersonName, createPersonName, createPostalAddress, createRegistryPackage, createRegistryPackage, createService, createService, createServiceBinding, createSlot, createSlot, createSpecificationLink, createTelephoneNumber, createUser, deleteObjects, deleteObjects, deprecateObjects, getRegistryService, saveObjects, unDeprecateObjects

Method Detail

public BulkResponse saveOrganizations(java.util.Collection<E> organizations) throws JAXRException
保存指定的 Organization。

如果注册表中没有该对象，则将在注册表中创建它。如果它已经存在于注册表中且被修改过，则将在注册表中更新（替换）其状态。

允许部分提交。处理过程将在遇到第一个 SaveException 时停止。

功能级别：0
organizations | 将保存的 Organization 对象所组成的 Collection
return | 一个 BulkResponse，它包含以下对象的键所组成的 Collection：成功保存的那些对象；部分提交情况下遇到的任何 SaveException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

saveOrganizations

BulkResponse saveOrganizations(Collection organizations)
                               throws JAXRException
Saves the specified Organizations.

If the object is not in the registry, it is created in the registry. If it already exists in the registry and has been modified, its state is updated (replaced) in the registry.

Partial commits are allowed. Processing stops on first SaveException encountered.

Capability Level: 0

Parameters:
organizations - the Collection of Organization objects to be saved
Returns:
a BulkResponse containing the Collection of keys for those objects that were saved successfully and any SaveException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse saveServices(java.util.Collection<E> services) throws JAXRException
保存指定的 Service。

如果注册表中没有该对象，则将在注册表中创建它。如果它已经存在于注册表中且被修改过，则将在注册表中更新（替换）其状态。

允许部分提交。处理过程将在遇到第一个 SaveException 时停止。

功能级别：0
services | 将保存的 Service 对象所组成的 Collection
return | 一个 BulkResponse，它包含以下对象的键所组成的 Collection：成功保存的那些对象；部分提交情况下遇到的任何 SaveException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

saveServices

BulkResponse saveServices(Collection services)
                          throws JAXRException
Saves the specified Services.

If the object is not in the registry, it is created in the registry. If it already exists in the registry and has been modified, its state is updated (replaced) in the registry.

Partial commits are allowed. Processing stops on first SaveException encountered.

Capability Level: 0

Parameters:
services - the Collection of Service objects to be saved
Returns:
a BulkResponse containing the Collection of keys for those objects that were saved successfully and any SaveException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse saveServiceBindings(java.util.Collection<E> bindings) throws JAXRException
保存指定的 ServiceBinding。

如果注册表中没有该对象，则将在注册表中创建它。如果它已经存在于注册表中且被修改过，则将在注册表中更新（替换）其状态。

允许部分提交。处理过程将在遇到第一个 SaveException 时停止。

功能级别：0
bindings | 将保存的 ServiceBinding 对象所组成的 Collection
return | 一个 BulkResponse，它包含以下对象的键所组成的 Collection：成功保存的那些对象；部分提交情况下遇到的任何 SaveException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

saveServiceBindings

BulkResponse saveServiceBindings(Collection bindings)
                                 throws JAXRException
Saves the specified ServiceBindings.

If the object is not in the registry, it is created in the registry. If it already exists in the registry and has been modified, its state is updated (replaced) in the registry.

Partial commits are allowed. Processing stops on first SaveException encountered.

Capability Level: 0

Parameters:
bindings - the Collection of ServiceBinding objects to be saved
Returns:
a BulkResponse containing the Collection of keys for those objects that were saved successfully and any SaveException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse saveConcepts(java.util.Collection<E> concepts) throws JAXRException
保存指定的 Concept。

如果注册表中没有该对象，则将在注册表中创建它。如果它已经存在于注册表中且被修改过，则将在注册表中更新（替换）其状态。

允许部分提交。处理过程将在遇到第一个 SaveException 时停止。

功能级别：0
concepts | 将保存的 Concept 对象所组成的 Collection
return | 一个 BulkResponse，它包含以下对象的键所组成的 Collection：成功保存的那些对象；部分提交情况下遇到的任何 SaveException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

saveConcepts

BulkResponse saveConcepts(Collection concepts)
                          throws JAXRException
Saves the specified Concepts.

If the object is not in the registry, it is created in the registry. If it already exists in the registry and has been modified, its state is updated (replaced) in the registry.

Partial commits are allowed. Processing stops on first SaveException encountered.

Capability Level: 0

Parameters:
concepts - the Collection of Concept objects to be saved
Returns:
a BulkResponse containing the Collection of keys for those objects that were saved successfully and any SaveException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse saveClassificationSchemes(java.util.Collection<E> schemes) throws JAXRException
保存指定的 ClassificationScheme 实例。

如果注册表中没有该对象，则将在注册表中创建它。如果它已经存在于注册表中且被修改过，则将在注册表中更新（替换）其状态。

允许部分提交。处理过程将在遇到第一个 SaveException 时停止。

功能级别：0
schemes | 将保存的 ClassificationScheme 对象所组成的 Collection
return | 一个 BulkResponse，它包含以下对象的键所组成的 Collection：成功保存的那些对象；部分提交情况下遇到的任何 SaveException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

saveClassificationSchemes

BulkResponse saveClassificationSchemes(Collection schemes)
                                       throws JAXRException
Saves the specified ClassificationScheme instances.

If the object is not in the registry, it is created in the registry. If it already exists in the registry and has been modified, its state is updated (replaced) in the registry.

Partial commits are allowed. Processing stops on first SaveException encountered.

Capability Level: 0

Parameters:
schemes - the Collection of ClassificationScheme objects to be saved
Returns:
a BulkResponse containing the Collection of keys for those objects that were saved successfully and any SaveException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse saveAssociations(java.util.Collection<E> associations, boolean replace) throws JAXRException
保存指定的 Association 实例。

如果注册表中没有该对象，则将在注册表中创建它。如果它已经存在于注册表中且被修改过，则将在注册表中更新（替换）其状态。

允许部分提交。处理过程将在遇到第一个 SaveException 时停止。

功能级别：0
associations | 将保存的 Association 对象所组成的 Collection
replace | 如果设置为 true，则使用指定的关联替换调用者拥有的所有现有关联。如果设置为 false，则保存指定的关联，同时保留没有被此调用更新的所有现有关联。
return | 一个 BulkResponse，它包含以下对象的键所组成的 Collection：成功保存的那些对象；部分提交情况下遇到的任何 SaveException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

saveAssociations

BulkResponse saveAssociations(Collection associations,
                              boolean replace)
                              throws JAXRException
Saves the specified Association instances.

If the object is not in the registry, it is created in the registry. If it already exists in the registry and has been modified, its state is updated (replaced) in the registry.

Partial commits are allowed. Processing stops on first SaveException encountered.

Capability Level: 0

Parameters:
associations - the Collection of Association objects to be saved
replace - If set to true, the specified associations replace any existing associations owned by the caller. If set to false, the specified associations are saved, while any existing associations not being updated by this call are preserved.
Returns:
a BulkResponse containing the Collection of keys for those objects that were saved successfully and any SaveException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteOrganizations(java.util.Collection<E> organizationKeys) throws JAXRException
删除对应于指定 Key 的组织。

允许部分提交。处理过程将在遇到第一个 DeleteException 时停止。

功能级别：0
organizationKeys | 将删除的 Organization 对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteOrganizations

BulkResponse deleteOrganizations(Collection organizationKeys)
                                 throws JAXRException
Deletes the organizations corresponding to the specified Keys.

Partial commits are allowed. Processing stops on first DeleteException encountered.

Capability Level: 0

Parameters:
organizationKeys - the Collection of keys for the Organization objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteServices(java.util.Collection<E> serviceKeys) throws JAXRException
删除对应于指定 Key 的服务。

允许部分提交。处理过程将在遇到第一个 DeleteException 时停止。

功能级别：0
serviceKeys | 将删除的 Service 对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteServices

BulkResponse deleteServices(Collection serviceKeys)
                            throws JAXRException
Deletes the services corresponding to the specified Keys.

Partial commits are allowed. Processing stops on first DeleteException encountered.

Capability Level: 0

Parameters:
serviceKeys - the Collection of keys for the Service objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteServiceBindings(java.util.Collection<E> bindingKeys) throws JAXRException
删除对应于指定 Key 的 ServiceBinding。

允许部分提交。处理过程将在遇到第一个 DeleteException 时停止。

功能级别：0
bindingKeys | 将删除的 ServiceBinding 对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteServiceBindings

BulkResponse deleteServiceBindings(Collection bindingKeys)
                                   throws JAXRException
Deletes the ServiceBindings corresponding to the specified Keys.

Partial commits are allowed. Processing stops on first DeleteException encountered.

Capability Level: 0

Parameters:
bindingKeys - the Collection of keys for the ServiceBinding objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteConcepts(java.util.Collection<E> conceptKeys) throws JAXRException
删除对应于指定 Key 的 Concept。

允许部分提交。处理过程将在遇到第一个 DeleteException 时停止。

功能级别：0
conceptKeys | 将删除的 Concept 对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteConcepts

BulkResponse deleteConcepts(Collection conceptKeys)
                            throws JAXRException
Deletes the Concepts corresponding to the specified Keys.

Partial commits are allowed. Processing stops on first DeleteException encountered.

Capability Level: 0

Parameters:
conceptKeys - the Collection of keys for the Concept objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteClassificationSchemes(java.util.Collection<E> schemeKeys) throws JAXRException
删除对应于指定 Key 的 ClassificationScheme。

允许部分提交。处理过程将在遇到第一个 DeleteException 时停止。

功能级别：0
schemeKeys | 将删除的 ClassificationScheme 对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteClassificationSchemes

BulkResponse deleteClassificationSchemes(Collection schemeKeys)
                                         throws JAXRException
Deletes the ClassificationSchemes corresponding to the specified Keys.

Partial commits are allowed. Processing stops on first DeleteException encountered.

Capability Level: 0

Parameters:
schemeKeys - the Collection of keys for the ClassificationScheme objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteAssociations(java.util.Collection<E> associationKeys) throws JAXRException
删除对应于指定 Key 的 Association。

允许部分提交。处理过程将在遇到第一个 DeleteException 时停止。

功能级别：0
associationKeys | 将删除的 Association 对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteAssociations

BulkResponse deleteAssociations(Collection associationKeys)
                                throws JAXRException
Deletes the Associations corresponding to the specified Keys.

Partial commits are allowed. Processing stops on first DeleteException encountered.

Capability Level: 0

Parameters:
associationKeys - the Collection of keys for the Association objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public void confirmAssociation(Association assoc) throws JAXRException, InvalidRequestException
与调用者关联的 User 确认此 Association。在此 Association 中，User 必须是 sourceObject 或 targetObject 的所有者。

  • 如果 Association 是内部的，则此方法不执行任何操作并返回。
  • 如果 Association 是外部的，并且已经经过确认（isConfirmed 返回 true），则此方法不执行任何操作并返回。
  • 如果 Association 是外部的，并且未经确认，则此方法将确认与调用者关联的 User 的关联。

确认外部 Association 的细节是特定于注册表的。对于 UDDI 和 ebXML 注册表，特定于注册表的详细信息在 JAXR 规范中描述。

功能级别：0
assoc | 将确认的 Association 对象
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
Throws | InvalidRequestException: 如果 User 不是 sourceObject 或 targetObject 的所有者
英文文档：

confirmAssociation

void confirmAssociation(Association assoc)
                        throws JAXRException,
                               InvalidRequestException
Confirms this Association by the User associated with the caller. The User must be the owner of the sourceObject or the targetObject in this association.

  • If the Association is intramural, this method does nothing and returns.
  • If the Association is extramural and already confirmed (isConfirmed returns true), this method does nothing and returns.
  • If the Association is extramural and not already confirmed, this method confirms the association for the User associated with the caller.

The details of confirming an extramural Association are registry-specific. For UDDI and ebXML registries, the registry-specific details are described in the JAXR specification.

Capability Level: 0

Parameters:
assoc - the Association object to be confirmed
Throws:
JAXRException - if the JAXR provider encounters an internal error
InvalidRequestException - if the User is not the owner of the sourceObject or the targetObject

public void unConfirmAssociation(Association assoc) throws JAXRException, InvalidRequestException
与调用者关联的 User 取消此 Association 以前的确认。在此 Association 中，User 必须是 sourceObject 或 targetObject 的所有者。

  • 如果 Association 是内部的，则此方法不执行任何操作并返回。
  • 如果 Association 是外部的，并且已经经过确认（isConfirmed 返回 true），则此方法将针对请求者取消确认。
  • 如果 Association 是外部的，并且未经确认，则此方法不执行任何操作并返回。

取消外部 Association 的确认的细节是特定于注册表的。对于 UDDI 和 ebXML 注册表，特定于注册表的详细信息在 JAXR 规范中描述。

功能级别：0
assoc | 将取消确认的 Association 对象
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
Throws | InvalidRequestException: 如果 User 不是 sourceObject 或 targetObject 的所有者
英文文档：

unConfirmAssociation

void unConfirmAssociation(Association assoc)
                          throws JAXRException,
                                 InvalidRequestException
Undoes a previous confirmation of this Association by the User associated with the caller. The User must be the owner of the sourceObject or the targetObject in this association.

  • If the Association is intramural, this method does nothing and returns.
  • If the Association is extramural and already confirmed (isConfirmed returns true), this method unconfirms it for the requestor.
  • If the Association is extramural and not already confirmed, this method does nothing and returns.

The details of unconfirming an extramural Association are registry-specific. For UDDI and ebXML registries, the registry-specific details are described in the JAXR specification.

Capability Level: 0

Parameters:
assoc - the Association object to be unconfirmed
Throws:
JAXRException - if the JAXR provider encounters an internal error
InvalidRequestException - if the User is not the owner of the sourceObject or the targetObject
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BusinessQueryManager (Java EE 5)

javax.xml.registry
Interface BusinessQueryManager

All Superinterfaces:
QueryManager
public interface BusinessQueryManager
extends QueryManager

Implements: QueryManager

BusinessQueryManager 接口是通过 Registry Service 公开的，它实现业务样式的查询接口。它也被称为焦点查询接口。
See also javax.xml.registry.DeclarativeQueryManager, javax.xml.registry.FindQualifier, javax.xml.registry.BulkResponse
英文文档：

The BusinessQueryManager interface, which is exposed by the Registry Service, implements the business style query interface. It is also referred to as the focused query interface.

Author:
Farrukh S. Najmi
See Also:
DeclarativeQueryManager, FindQualifier, BulkResponse

Method Summary
BulkResponse | findAssociations(Collection findQualifiers, String sourceObjectId, String targetObjectId, Collection associationTypes) Finds all Association objects that match all of the criteria specified by the parameters of this call.
BulkResponse | findCallerAssociations(Collection findQualifiers, Boolean confirmedByCaller, Boolean confirmedByOtherParty, Collection associationTypes) Finds all Association objects owned by the caller that match all of the criteria specified by the parameters of this call.
ClassificationScheme | findClassificationSchemeByName(Collection findQualifiers, String namePattern) Finds a ClassificationScheme by name based on the specified find qualifiers and name pattern.
BulkResponse | findClassificationSchemes(Collection findQualifiers, Collection namePatterns, Collection classifications, Collection externalLinks) Finds all ClassificationScheme objects that match all of the criteria specified by the parameters of this call.
Concept | findConceptByPath(String path) Finds a Concept based on the path specified.
BulkResponse | findConcepts(Collection findQualifiers, Collection namePatterns, Collection classifications, Collection externalIdentifiers, Collection externalLinks) Finds all Concept objects that match all of the criteria specified by the parameters of this call.
BulkResponse | findOrganizations(Collection findQualifiers, Collection namePatterns, Collection classifications, Collection specifications, Collection externalIdentifiers, Collection externalLinks) Finds all Organization objects that match all of the criteria specified by the parameters of this call.
BulkResponse | findRegistryPackages(Collection findQualifiers, Collection namePatterns, Collection classifications, Collection externalLinks) Finds all RegistryPackage objects that match all of the criteria specified by the parameters of this call.
BulkResponse | findServiceBindings(Key serviceKey, Collection findQualifiers, Collection classifications, Collection specifications) Finds all ServiceBinding objects that match all of the criteria specified by the parameters of this call.
BulkResponse | findServices(Key orgKey, Collection findQualifiers, Collection namePatterns, Collection classifications, Collection specifications) Finds all Service objects that match all of the criteria specified by the parameters of this call.
Methods inherited from interface javax.xml.registry.QueryManager
getRegistryObject, getRegistryObject, getRegistryObjects, getRegistryObjects, getRegistryObjects, getRegistryObjects, getRegistryService

Method Detail

public BulkResponse findAssociations(java.util.Collection<E> findQualifiers, String sourceObjectId, String targetObjectId, java.util.Collection<E> associationTypes) throws JAXRException
查找所有符合此调用参数所指定的所有标准的 Association 对象。这是所有非 null 参数之间的逻辑 AND 操作。如果没有指定任何参数，则不返回任何 Association。

功能级别：0
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
sourceObjectId | 表示 RegistryObject ID 的 String，该 RegistryObject 必须是匹配的 Association 的 sourceObject。如果指定为 null，则忽略此参数。
targetObjectId | 表示 RegistryObject ID 的 String，该 RegistryObject 必须是匹配的 Association 的 targetObject。如果指定为 null，则忽略此参数。
associationTypes | associationTypes 所组成的 Collection。这是对整个 Collection 的逻辑 OR 操作。如果指定为 null，则忽略此参数。
return | 一个 BulkResponse，它包含 Association 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findAssociations

BulkResponse findAssociations(Collection findQualifiers,
                              String sourceObjectId,
                              String targetObjectId,
                              Collection associationTypes)
                              throws JAXRException
Finds all Association objects that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters. If no parameters are specified, no Associations are returned.

Capability Level: 0

Parameters:
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
sourceObjectId - a String that represents the id for a RegistryObject that must be the sourceObject of the Associations that match. This parameter is ignored if specified as null.
targetObjectId - a String that represents the id for a RegistryObject that must be the targetObject of the Associations that match. This parameter is ignored if specified as null.
associationTypes - a Collection of associationTypes. This is a logical OR operation across the collection. This parameter is ignored if specified as null.
Returns:
a BulkResponse containing a Collection of Associations
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse findCallerAssociations(java.util.Collection<E> findQualifiers, Boolean confirmedByCaller, Boolean confirmedByOtherParty, java.util.Collection<E> associationTypes) throws JAXRException
查找调用者拥有的所有符合此调用参数所指定的所有标准的 Association 对象。这是所有非 null 参数之间的逻辑 AND 操作。如果没有指定任何参数，则不返回任何 Association。

此调用对调用者的身份很敏感，是一个特许操作，它要求调用者向与此对象关联的 Connection 提供其身份凭据。

功能级别：0
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
confirmedByCaller | 如果为 true，则提供者必须包含涉及调用者的 Association，且该 Association 已经经过调用者的确认。如果为 false，则提供者必须包括涉及调用者的 Association，且该 Association 未经调用者的确认。如果指定为 null，则忽略此参数。
confirmedByOtherParty | 如果为 true，则提供者必须包含涉及调用者的 Association，且该 Association 已经经过其他方的确认。如果为 false，则提供者必须包括涉及调用者的 Association，且该 Association 未经其他方的确认。如果指定为 null，则忽略此参数。
associationTypes | associationTypes 所组成的 Collection。这是对整个 Collection 的逻辑 OR 操作。如果指定为 null，则忽略此参数。
return | 一个 BulkResponse，它包含 Association 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findCallerAssociations

BulkResponse findCallerAssociations(Collection findQualifiers,
                                    Boolean confirmedByCaller,
                                    Boolean confirmedByOtherParty,
                                    Collection associationTypes)
                                    throws JAXRException
Finds all Association objects owned by the caller that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters. If no parameters are specified, no Associations are returned.

This call is sensitive to the identity of the caller and is a privileged operation that requires the caller to have provided its identity credentials to the Connection associated with this object.

Capability Level: 0

Parameters:
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
confirmedByCaller - If true, provider must include Associations involving the caller that have been confirmed by the caller. If false, provider must include Associations involving the caller that have not been confirmed by the caller. This parameter is ignored if specified as null.
confirmedByOtherParty - If true, provider must include Associations involving the caller that have been confirmed by the other party. If false, provider must include Associations involving the caller that have not been confirmed by the other party. This parameter is ignored if specified as null.
associationTypes - a Collection of associationTypes. This is a logical OR operation across the collection. This parameter is ignored if specified as null.
Returns:
a BulkResponse containing a Collection of Associations
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse findOrganizations(java.util.Collection<E> findQualifiers, java.util.Collection<E> namePatterns, java.util.Collection<E> classifications, java.util.Collection<E> specifications, java.util.Collection<E> externalIdentifiers, java.util.Collection<E> externalLinks) throws JAXRException
查找所有符合此调用参数所指定的所有标准的 Organization 对象。这是所有非 null 参数之间的逻辑 AND 操作。

功能级别：0
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
namePatterns | String 或 LocalizedString 对象所组成的 Collection。每个 String 或 LocalizedString 中的值都是部分或完整的名称模式，通配符搜索按照 SQL-92 LIKE 规范的规定执行。除非在 findQualifier 中另行指定，否则这是一个逻辑 OR，任何名称匹配都视为是符合此标准的匹配。
classifications | 对对象进行分类的 Classification 对象所组成的 Collection。这类似于 UDDI 规范中的 catgegoryBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Classification 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createClassification 方法创建瞬态 Classification，以供此 Collection 使用。
specifications | 表示（代理）技术规范的 RegistryObject 所组成的 Collection。这类似于 UDDI 规范中的 tModelBag。如果是 UDDI 提供者，则 RegistryObject 是规范 Concept。如果是 ebXML 提供者，则 RegistryObject 可能是 ExtrinsicObject。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Specification 的匹配都视为是符合此标准的匹配。
externalIdentifiers | 为使用标识模式（如 DUNS）的对象提供外部标识符的 ExternalIdentifier 对象所组成的 Collection。这类似于 UDDI 规范中的 identifierBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 ExternalIdentifier 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createExternalIdentifier 方法创建瞬态 ExternalIdentifier，以供此 Collection 使用。
externalLinks | 连接对象与注册表外部内容的 ExternalLink 对象所组成的 Collection。这类似于 UDDI 规范中的 overviewDoc。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 ExternalLink 的匹配都视为是符合此标准的匹配。
return | 一个 BulkResponse，它包含 Organization 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findOrganizations

BulkResponse findOrganizations(Collection findQualifiers,
                               Collection namePatterns,
                               Collection classifications,
                               Collection specifications,
                               Collection externalIdentifiers,
                               Collection externalLinks)
                               throws JAXRException
Finds all Organization objects that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters.

Capability Level: 0

Parameters:
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
namePatterns - a Collection that may consist of either String or LocalizedString objects. Each String or value within a LocalizedString is a partial or full name pattern with wildcard searching as specified by the SQL-92 LIKE specification. Unless otherwise specified in findQualifiers, this is a logical OR, and a match on any name qualifies as a match for this criterion.
classifications - a Collection of Classification objects that classify the object. It is analogous to a catgegoryBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Classifications qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createClassification method to create a transient Classification for use in this Collection.
specifications - a Collection of RegistryObjects that represent (proxy) a technical specification. It is analogous to a tModelBag in the UDDI specification. In the case of a UDDI provider, the RegistryObject is a specification Concept. In the case of an ebXML provider, the RegistryObject is likely to be an ExtrinsicObject. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Specifications qualifies as a match for this criterion.
externalIdentifiers - a Collection of ExternalIdentifier objects that provide an external identifier for the object using an identification scheme such as DUNS. It is analogous to an identifierBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified ExternalIdentifiers qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createExternalIdentifier method to create a transient ExternalIdentifier for use in this Collection.
externalLinks - a Collection of ExternalLink objects that link the object to content outside the registry. It is analogous to an overviewDoc in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified ExternalLinks qualifies as a match for this criterion.
Returns:
a BulkResponse containing a Collection of Organizations
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse findServices(Key orgKey, java.util.Collection<E> findQualifiers, java.util.Collection<E> namePatterns, java.util.Collection<E> classifications, java.util.Collection<E> specifications) throws JAXRException
查找所有符合此调用参数所指定的所有标准的 Service 对象。这是所有非 null 参数之间的逻辑 AND 操作。

功能级别：0
orgKey | 标识 Organization 的 Key。需要 UDDI 提供者。
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
namePatterns | String 或 LocalizedString 对象所组成的 Collection。每个 String 或 LocalizedString 中的值都是部分或完整的名称模式，通配符搜索按照 SQL-92 LIKE 规范的规定执行。除非在 findQualifier 中另行指定，否则这是一个逻辑 OR，任何名称匹配都视为是符合此标准的匹配。
classifications | 对对象进行分类的 Classification 对象所组成的 Collection。这类似于 UDDI 规范中的 catgegoryBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Classification 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createClassification 方法创建瞬态 Classification，以供此 Collection 使用。
specifications | 表示（代理）技术规范的 RegistryObject 所组成的 Collection。这类似于 UDDI 规范中的 tModelBag。如果是 UDDI 提供者，则 RegistryObject 是规范 Concept。如果是 ebXML 提供者，则 RegistryObject 可能是 ExtrinsicObject。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Specification 的匹配都视为是符合此标准的匹配。
return | 一个 BulkResponse，它包含 Service 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findServices

BulkResponse findServices(Key orgKey,
                          Collection findQualifiers,
                          Collection namePatterns,
                          Collection classifications,
                          Collection specifications)
                          throws JAXRException
Finds all Service objects that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters.

Capability Level: 0

Parameters:
orgKey - Key identifying an Organization. Required for UDDI providers.
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
namePatterns - a Collection that may consist of either String or LocalizedString objects. Each String or value within a LocalizedString is a partial or full name pattern with wildcard searching as specified by the SQL-92 LIKE specification. Unless otherwise specified in findQualifiers, this is a logical OR, and a match on any name qualifies as a match for this criterion.
classifications - a Collection of Classification objects that classify the object. It is analogous to a catgegoryBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Classifications qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createClassification method to create a transient Classification for use in this Collection.
specifications - a Collection of RegistryObjects that represent (proxy) a technical specification. It is analogous to a tModelBag in the UDDI specification. In the case of a UDDI provider, the RegistryObject is a specification Concept. In the case of an ebXML provider, the RegistryObject is likely to be an ExtrinsicObject. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Specifications qualifies as a match for this criterion.
Returns:
a BulkResponse containing a Collection of Services
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse findServiceBindings(Key serviceKey, java.util.Collection<E> findQualifiers, java.util.Collection<E> classifications, java.util.Collection<E> specifications) throws JAXRException
查找所有符合此调用参数所指定的所有标准的 ServiceBinding 对象。这是所有非 null 参数之间的逻辑 AND 操作。

功能级别：0
serviceKey | 标识 Service 的 Key。需要 UDDI 提供者。
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
classifications | 对对象进行分类的 Classification 对象所组成的 Collection。这类似于 UDDI 规范中的 catgegoryBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Classification 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createClassification 方法创建瞬态 Classification，以供此 Collection 使用。
specifications | 表示（代理）技术规范的 RegistryObject 所组成的 Collection。这类似于 UDDI 规范中的 tModelBag。如果是 UDDI 提供者，则 RegistryObject 是规范 Concept。如果是 ebXML 提供者，则 RegistryObject 可能是 ExtrinsicObject。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Specification 的匹配都视为是符合此标准的匹配。
return | 一个 BulkResponse，它包含 ServiceBinding 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findServiceBindings

BulkResponse findServiceBindings(Key serviceKey,
                                 Collection findQualifiers,
                                 Collection classifications,
                                 Collection specifications)
                                 throws JAXRException
Finds all ServiceBinding objects that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters.

Capability Level: 0

Parameters:
serviceKey - Key identifying a Service. Required for UDDI providers.
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
classifications - a Collection of Classification objects that classify the object. It is analogous to a catgegoryBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Classifications qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createClassification method to create a transient Classification for use in this Collection.
specifications - a Collection of RegistryObjects that represent (proxy) a technical specification. It is analogous to a tModelBag in the UDDI specification. In the case of a UDDI provider, the RegistryObject is a specification Concept. In the case of an ebXML provider, the RegistryObject is likely to be an ExtrinsicObject. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Specifications qualifies as a match for this criterion.
Returns:
a BulkResponse containing a Collection of ServiceBindings
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse findClassificationSchemes(java.util.Collection<E> findQualifiers, java.util.Collection<E> namePatterns, java.util.Collection<E> classifications, java.util.Collection<E> externalLinks) throws JAXRException
查找所有符合此调用参数所指定的所有标准的 ClassificationScheme 对象。这是所有非 null 参数之间的逻辑 AND 操作。

功能级别：0
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
namePatterns | String 或 LocalizedString 对象所组成的 Collection。每个 String 或 LocalizedString 中的值都是部分或完整的名称模式，通配符搜索按照 SQL-92 LIKE 规范的规定执行。除非在 findQualifier 中另行指定，否则这是一个逻辑 OR，任何名称匹配都视为是符合此标准的匹配。
classifications | 对对象进行分类的 Classification 对象所组成的 Collection。这类似于 UDDI 规范中的 catgegoryBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Classification 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createClassification 方法创建瞬态 Classification，以供此 Collection 使用。
externalLinks | 连接对象与注册表外部内容的 ExternalLink 对象所组成的 Collection。这类似于 UDDI 规范中的 overviewDoc。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 ExternalLink 的匹配都视为是符合此标准的匹配。
return | 一个 BulkResponse，它包含 ClassificationScheme 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findClassificationSchemes

BulkResponse findClassificationSchemes(Collection findQualifiers,
                                       Collection namePatterns,
                                       Collection classifications,
                                       Collection externalLinks)
                                       throws JAXRException
Finds all ClassificationScheme objects that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters.

Capability Level: 0

Parameters:
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
namePatterns - a Collection that may consist of either String or LocalizedString objects. Each String or value within a LocalizedString is a partial or full name pattern with wildcard searching as specified by the SQL-92 LIKE specification. Unless otherwise specified in findQualifiers, this is a logical OR, and a match on any name qualifies as a match for this criterion.
classifications - a Collection of Classification objects that classify the object. It is analogous to a catgegoryBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Classifications qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createClassification method to create a transient Classification for use in this Collection.
externalLinks - a Collection of ExternalLink objects that link the object to content outside the registry. It is analogous to an overviewDoc in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified ExternalLinks qualifies as a match for this criterion.
Returns:
a BulkResponse containing a Collection of ClassificationSchemes
Throws:
JAXRException - if the JAXR provider encounters an internal error

public ClassificationScheme findClassificationSchemeByName(java.util.Collection<E> findQualifiers, String namePattern) throws JAXRException
根据基于指定查找限定符和名称模式的名称查找 ClassificationScheme。

功能级别：0
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
namePattern | 一个 String，它是部分或完整的名称模式，通配符搜索按照 SQL-92 LIKE 规范的规定执行
return | 与 namePattern 匹配的 ClassificationScheme；如果没有找到任何匹配项，则返回 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误如果找到多个匹配项，则抛出 InvalidRequestException。
英文文档：

findClassificationSchemeByName

ClassificationScheme findClassificationSchemeByName(Collection findQualifiers,
                                                    String namePattern)
                                                    throws JAXRException
Finds a ClassificationScheme by name based on the specified find qualifiers and name pattern.

Capability Level: 0

Parameters:
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
namePattern - a String that is a partial or full name pattern with wildcard searching as specified by the SQL-92 LIKE specification
Returns:
the ClassificationScheme matching the namePattern, or null if no match is found.
Throws:
JAXRException - if the JAXR provider encounters an internal error. Throws an InvalidRequestException if multiple matches are found.

public BulkResponse findConcepts(java.util.Collection<E> findQualifiers, java.util.Collection<E> namePatterns, java.util.Collection<E> classifications, java.util.Collection<E> externalIdentifiers, java.util.Collection<E> externalLinks) throws JAXRException
查找所有符合此调用参数所指定的所有标准的 Concept 对象。这是所有非 null 参数之间的逻辑 AND 操作。

功能级别：0
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
namePatterns | String 或 LocalizedString 对象所组成的 Collection。每个 String 或 LocalizedString 中的值都是部分或完整的名称模式，通配符搜索按照 SQL-92 LIKE 规范的规定执行。除非在 findQualifier 中另行指定，否则这是一个逻辑 OR，任何名称匹配都视为是符合此标准的匹配。
classifications | 对对象进行分类的 Classification 对象所组成的 Collection。这类似于 UDDI 规范中的 catgegoryBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Classification 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createClassification 方法创建瞬态 Classification，以供此 Collection 使用。
externalIdentifiers | 为使用标识模式（如 DUNS）的对象提供外部标识符的 ExternalIdentifier 对象所组成的 Collection。这类似于 UDDI 规范中的 identifierBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 ExternalIdentifier 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createExternalIdentifier 方法创建瞬态 ExternalIdentifier，以供此 Collection 使用。
externalLinks | 连接对象与注册表外部内容的 ExternalLink 对象所组成的 Collection。这类似于 UDDI 规范中的 overviewDoc。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 ExternalLink 的匹配都视为是符合此标准的匹配。
return | 一个 BulkResponse，它包含 Concept 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findConcepts

BulkResponse findConcepts(Collection findQualifiers,
                          Collection namePatterns,
                          Collection classifications,
                          Collection externalIdentifiers,
                          Collection externalLinks)
                          throws JAXRException
Finds all Concept objects that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters.

Capability Level: 0

Parameters:
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
namePatterns - a Collection that may consist of either String or LocalizedString objects. Each String or value within a LocalizedString is a partial or full name pattern with wildcard searching as specified by the SQL-92 LIKE specification. Unless otherwise specified in findQualifiers, this is a logical OR, and a match on any name qualifies as a match for this criterion.
classifications - a Collection of Classification objects that classify the object. It is analogous to a catgegoryBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Classifications qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createClassification method to create a transient Classification for use in this Collection.
externalIdentifiers - a Collection of ExternalIdentifier objects that provide an external identifier for the object using an identification scheme such as DUNS. It is analogous to an identifierBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified ExternalIdentifiers qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createExternalIdentifier method to create a transient ExternalIdentifier for use in this Collection.
externalLinks - a Collection of ExternalLink objects that link the object to content outside the registry. It is analogous to an overviewDoc in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified ExternalLinks qualifies as a match for this criterion.
Returns:
a BulkResponse containing a Collection of Concepts
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Concept findConceptByPath(String path) throws JAXRException
基于指定的路径查找 Concept。如果指定的路径与多个 Concept 匹配，则返回最通用（在 Concept 分层结构中较高）的那个。

功能级别：0
path | 标识 Concept 的规范路径表示，符合 JAXR 规范的定义。
return | 发现的 Concept；如果没有发现任何匹配项，则返回 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findConceptByPath

Concept findConceptByPath(String path)
                          throws JAXRException
Finds a Concept based on the path specified. If the specified path matches more than one Concept, the one that is most general (higher in the concept hierarchy) is returned.

Capability Level: 0

Parameters:
path - a canonical path expression, as defined in the JAXR specification, that identifies the Concept.
Returns:
the Concept found, or null if no match is found
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse findRegistryPackages(java.util.Collection<E> findQualifiers, java.util.Collection<E> namePatterns, java.util.Collection<E> classifications, java.util.Collection<E> externalLinks) throws JAXRException
查找所有符合此调用参数所指定的所有标准的 RegistryPackage 对象。这是所有非 null 参数之间的逻辑 AND 操作。

功能级别：1
findQualifiers | FindQualifier 接口定义的 find 限定符所组成的 Collection，FindQualifier 接口指定能影响字符串匹配、排序、boolean 谓词逻辑 (predicate logic) 之类的限定符。
namePatterns | String 或 LocalizedString 对象所组成的 Collection。每个 String 或 LocalizedString 中的值都是部分或完整的名称模式，通配符搜索按照 SQL-92 LIKE 规范的规定执行。除非在 findQualifier 中另行指定，否则这是一个逻辑 OR，任何名称匹配都视为是符合此标准的匹配。
classifications | 对对象进行分类的 Classification 对象所组成的 Collection。这类似于 UDDI 规范中的 catgegoryBag。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 Classification 的匹配都视为是符合此标准的匹配。程序员可以使用 LifeCycleManager.createClassification 方法创建瞬态 Classification，以供此 Collection 使用。
externalLinks | 连接对象与注册表外部内容的 ExternalLink 对象所组成的 Collection。这类似于 UDDI 规范中的 overviewDoc。除非在 findQualifier 中另行指定，否则这是一个逻辑 AND，所有指定 ExternalLink 的匹配都视为是符合此标准的匹配。
return | 一个 BulkResponse，它包含 RegistryPackage 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

findRegistryPackages

BulkResponse findRegistryPackages(Collection findQualifiers,
                                  Collection namePatterns,
                                  Collection classifications,
                                  Collection externalLinks)
                                  throws JAXRException
Finds all RegistryPackage objects that match all of the criteria specified by the parameters of this call. This is a logical AND operation between all non-null parameters.

Capability Level: 1

Parameters:
findQualifiers - a Collection of find qualifiers as defined by the FindQualifier interface, which specifies qualifiers that affect string matching, sorting, boolean predicate logic, and the like.
namePatterns - a Collection that may consist of either String or LocalizedString objects. Each String or value within a LocalizedString is a partial or full name pattern with wildcard searching as specified by the SQL-92 LIKE specification. Unless otherwise specified in findQualifiers, this is a logical OR, and a match on any name qualifies as a match for this criterion.
classifications - a Collection of Classification objects that classify the object. It is analogous to a catgegoryBag in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified Classifications qualifies as a match for this criterion. The programmer may use the LifeCycleManager.createClassification method to create a transient Classification for use in this Collection.
externalLinks - a Collection of ExternalLink objects that link the object to content outside the registry. It is analogous to an overviewDoc in the UDDI specification. Unless otherwise specified in findQualifiers, this is a logical AND, and a match on all specified ExternalLinks qualifies as a match for this criterion.
Returns:
a BulkResponse containing a Collection of RegistryPackages
Throws:
JAXRException - if the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CapabilityProfile (Java EE 5)

javax.xml.registry
Interface CapabilityProfile

public interface CapabilityProfile

提供关于 JAXR 提供者功能的信息。
英文文档：

Provides information about the capabilities of a JAXR provider.

Author:
Farrukh S. Najmi

Method Summary
int | getCapabilityLevel() Gets the capability level supported by the JAXR provider.
String | getVersion() Gets the JAXR specification version supported by the JAXR provider.

Method Detail

public String getVersion() throws JAXRException
获取 JAXR 提供者支持的 JAXR 规范版本。

功能级别：0
return | 规范版本
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getVersion

String getVersion()
                  throws JAXRException
Gets the JAXR specification version supported by the JAXR provider.

Capability Level: 0

Returns:
the specification version
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getCapabilityLevel() throws JAXRException
获取 JAXR 提供者支持的功能级别。

功能级别：0
return | 功能级别
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getCapabilityLevel

int getCapabilityLevel()
                       throws JAXRException
Gets the capability level supported by the JAXR provider.

Capability Level: 0

Returns:
the capability level
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Connection (Java EE 5)

javax.xml.registry
Interface Connection

All Known Subinterfaces:
FederatedConnection
public interface Connection

Implemented by: FederatedConnection

此类表示 JAXR 客户端与 JAXR 提供者之间的连接。
See also javax.xml.registry.ConnectionFactory
英文文档：

This class represents a connection between a JAXR client and a JAXR provider.

Author:
Farrukh S. Najmi
See Also:
ConnectionFactory

Method Summary
void | close() Closes a Connection when it is no longer needed.
Set | getCredentials() Gets the credentials associated with this client.
RegistryService | getRegistryService() Gets the RegistryService interface associated with the Connection.
boolean | isClosed() Indicated whether this Connection has been closed or not.
boolean | isSynchronous() Indicates whether a client uses synchronous communication with JAXR provider or not.
void | setCredentials(Set credentials) Sets the Credentials associated with this client.
void | setSynchronous(boolean sync) Sets whether the client uses synchronous communication or not.

Method Detail

public RegistryService getRegistryService() throws JAXRException
获取与 Connection 关联的 RegistryService 接口。如果 Connection 属性（例如凭据）是在客户端调用 getRegistryService 之后设置的，那么新设置的 Connection 属性对于此调用以前返回的 RegistryService 是可见的。

功能级别：0
return | 与此对象关联的 RegistryService
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{RegistryService}>
See also | javax.xml.registry.RegistryService
英文文档：

getRegistryService

RegistryService getRegistryService()
                                   throws JAXRException
Gets the RegistryService interface associated with the Connection. If a Connection property (e.g. credentials) is set after the client calls getRegistryService then the newly set Connection property is visible to the RegistryService previously returned by this call.

Capability Level: 0

Returns:
the RegistryService associated with this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryService

public void close() throws JAXRException
当不再需要某个 Connection 时关闭它。由于提供者通常会代表 Connection 在 JVM 之外分配大量资源，因此客户端应该在不需要这些资源时关闭它们。

功能级别：0
Throws JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

close

void close()
           throws JAXRException
Closes a Connection when it is no longer needed. Since a provider typically allocates significant resources outside the JVM on behalf of a Connection, clients should close them when they are not needed.

Capability Level: 0

Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isClosed() throws JAXRException
指示此 Connection 是否已关闭。

功能级别：0
return | 如果 Connection 已关闭，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isClosed

boolean isClosed()
                 throws JAXRException
Indicated whether this Connection has been closed or not.

Capability Level: 0

Returns:
true if Connection is closed; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isSynchronous() throws JAXRException
指示客户端使用同步通信还是非同步通信与 JAXR 提供者进行通信。JAXR 提供者必须支持这两种通信模式。JAXR 客户端可以选择它想使用的模式。

功能级别：0
return | 如果 Connection 是同步的（默认值），则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isSynchronous

boolean isSynchronous()
                      throws JAXRException
Indicates whether a client uses synchronous communication with JAXR provider or not. A JAXR provider must support both modes of communication. A JAXR client can choose which mode it wants to use.

Capability Level: 0

Returns:
true if Connection is synchronous (default); false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setSynchronous(boolean sync) throws JAXRException
设置客户端是否使用同步通信。JAXR 客户端可以动态更改其通信样式优先级。

功能级别：0
sync | 如果需要对 Connection 进行同步，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setSynchronous

void setSynchronous(boolean sync)
                    throws JAXRException
Sets whether the client uses synchronous communication or not. A JAXR client may dynamically change its communication style preference.

Capability Level: 0

Parameters:
sync - true if Connection is desired to be synchronous; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setCredentials(java.util.Set<E> credentials) throws JAXRException
设置与此客户端关联的 Credential。该凭据用于验证客户端和 JAXR 提供者。JAXR 客户端可以通过更改与其关联的凭据动态更改其身份。

功能级别：0
credentials | 为调用者提供与身份有关的信息的 java.lang.Object 所组成的 Collection。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setCredentials

void setCredentials(Set credentials)
                    throws JAXRException
Sets the Credentials associated with this client. The credentials is used to authenticate the client with the JAXR provider. A JAXR client may dynamically change its identity by changing the credentials associated with it.

Capability Level: 0

Parameters:
credentials - a Collection oj java.lang.Objects which provide identity related information for the caller.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Set<E> getCredentials() throws JAXRException
获取与此客户端关联的凭据。

功能级别：0
return | java.lang.Object 实例所组成的 Set。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getCredentials

Set getCredentials()
                   throws JAXRException
Gets the credentials associated with this client.

Capability Level: 0

Returns:
Set of java.lang.Object instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeclarativeQueryManager (Java EE 5)

javax.xml.registry
Interface DeclarativeQueryManager

All Superinterfaces:
QueryManager
public interface DeclarativeQueryManager
extends QueryManager

Implements: QueryManager

此接口提供执行声明性查询（例如 SQL）的能力。
英文文档：

This interface provides the ability to execute declarative queries (e.g. SQL)

Author:
Farrukh S. Najmi

Method Summary
Query | createQuery(int queryType, String queryString) Creates a Query object given a queryType (for example, QUERY_TYPE_SQL) and a String that represents a query in the syntax appropriate for queryType.
BulkResponse | executeQuery(Query query) Executes a query as specified by query parameter.
Methods inherited from interface javax.xml.registry.QueryManager
getRegistryObject, getRegistryObject, getRegistryObjects, getRegistryObjects, getRegistryObjects, getRegistryObjects, getRegistryService

Method Detail

public Query createQuery(int queryType, String queryString) throws InvalidRequestException, JAXRException
根据给定的 queryType（例如，QUERY_TYPE_SQL）和表示查询（符合 queryType 的语法）的 String，创建一个 Query 对象。

功能级别：1
queryType | 查询的类型
queryString | 查询的字符串表示形式
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
Throws | InvalidRequestException: 如果 JAXR 提供者验证查询语法（可选）且 sqlQuery 无效
See also | QUERY_TYPE_SQL, QUERY_TYPE_XQUERY, QUERY_TYPE_EBXML_FILTER_QUERY
英文文档：

createQuery

Query createQuery(int queryType,
                  String queryString)
                  throws InvalidRequestException,
                         JAXRException
Creates a Query object given a queryType (for example, QUERY_TYPE_SQL) and a String that represents a query in the syntax appropriate for queryType.

Capability Level: 1

Parameters:
queryType - the type of query
queryString - the query in its string representation
Throws:
JAXRException - If the JAXR provider encounters an internal error
InvalidRequestException - If the JAXR provider validates query syntax (optional) and the sqlQuery is not valid
See Also:
Query.QUERY_TYPE_SQL, Query.QUERY_TYPE_XQUERY, Query.QUERY_TYPE_EBXML_FILTER_QUERY

public BulkResponse executeQuery(Query query) throws JAXRException
根据 query 参数的指定执行查询。

功能级别：1
query | 要执行的查询
return | 作为查询结果的 BulkResponse
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

executeQuery

BulkResponse executeQuery(Query query)
                          throws JAXRException
Executes a query as specified by query parameter.

Capability Level: 1

Parameters:
query - the query to be executed
Returns:
the BulkResponse that is the result of the query
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FederatedConnection (Java EE 5)

javax.xml.registry
Interface FederatedConnection

All Superinterfaces:
Connection
public interface FederatedConnection
extends Connection

Implements: Connection

表示对注册表提供者联合或组的单个逻辑连接。此接口用于支持 JAXR API 的分布式查询功能。
英文文档：

Represents a single logical connection to a federation or group of registry providers. This interface is used in support of the distributed query feature of the JAXR API.

Author:
Farrukh S. Najmi

Method Summary
Methods inherited from interface javax.xml.registry.Connection
close, getCredentials, getRegistryService, isClosed, isSynchronous, setCredentials, setSynchronous

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FindQualifier (Java EE 5)

javax.xml.registry
Interface FindQualifier

public interface FindQualifier

FindQualifier 提供各种常量，这些常量标识影响 find 方法行为的选项。JAXR 提供者可以忽略任何标记为可选的限定符。JAXR 提供者必须支持没有标记为可选的限定符。
See also javax.xml.registry.BusinessQueryManager
英文文档：

FindQualifier provides various constants that identify options that effect find method behavior. A JAXR provider may silently ignore any qualifiers marked as optional. A JAXR provider must support qualifiers not marked optional.

See Also:
BusinessQueryManager

Field Summary
static String | AND_ALL_KEYS
static String | CASE_SENSITIVE_MATCH
static String | COMBINE_CLASSIFICATIONS Maps to UDDI combineCategoryBags.
static String | EXACT_NAME_MATCH
static String | OR_ALL_KEYS
static String | OR_LIKE_KEYS
static String | SERVICE_SUBSET Maps to UDDI serviceSubset.
static String | SORT_BY_DATE_ASC
static String | SORT_BY_DATE_DESC
static String | SORT_BY_NAME_ASC
static String | SORT_BY_NAME_DESC
static String | SOUNDEX Optional qualifier that allows matching strings by their sounds.

Field Detail

英文文档：

EXACT_NAME_MATCH

static final String EXACT_NAME_MATCH
See Also:
Constant Field Values

英文文档：

CASE_SENSITIVE_MATCH

static final String CASE_SENSITIVE_MATCH
See Also:
Constant Field Values

英文文档：

SORT_BY_NAME_ASC

static final String SORT_BY_NAME_ASC
See Also:
Constant Field Values

英文文档：

SORT_BY_NAME_DESC

static final String SORT_BY_NAME_DESC
See Also:
Constant Field Values

英文文档：

SORT_BY_DATE_ASC

static final String SORT_BY_DATE_ASC
See Also:
Constant Field Values

英文文档：

SORT_BY_DATE_DESC

static final String SORT_BY_DATE_DESC
See Also:
Constant Field Values

英文文档：

OR_LIKE_KEYS

static final String OR_LIKE_KEYS
See Also:
Constant Field Values

英文文档：

OR_ALL_KEYS

static final String OR_ALL_KEYS
See Also:
Constant Field Values

英文文档：

COMBINE_CLASSIFICATIONS

static final String COMBINE_CLASSIFICATIONS
Maps to UDDI combineCategoryBags. Required for JAXR UDDI providers, optional for all others.

See Also:
Constant Field Values

英文文档：

SERVICE_SUBSET

static final String SERVICE_SUBSET
Maps to UDDI serviceSubset. Required for JAXR UDDI providers, optional for all others.

See Also:
Constant Field Values

英文文档：

AND_ALL_KEYS

static final String AND_ALL_KEYS
See Also:
Constant Field Values

英文文档：

SOUNDEX

static final String SOUNDEX
Optional qualifier that allows matching strings by their sounds.

See Also:
Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXRResponse (Java EE 5)

javax.xml.registry
Interface JAXRResponse

All Known Subinterfaces:
BulkResponse
All Known Implementing Classes:
DeleteException, FindException, InvalidRequestException, JAXRException, RegistryException, SaveException, UnexpectedObjectException, UnsupportedCapabilityException
public interface JAXRResponse

Implemented by: BulkResponse, JAXRException

JAXR 请求的响应。
See also javax.xml.registry.JAXRException
英文文档：

A JAXR requests' response.

Author:
Farrukh S. Najmi
See Also:
JAXRException

Field Summary
static int | STATUS_FAILURE Status indicating a failure response.
static int | STATUS_SUCCESS Status indicating a successful response.
static int | STATUS_UNAVAILABLE Status indicating that the results are currently unavailable.
static int | STATUS_WARNING Status indicating a successful response that included at least one warning.
Method Summary
String | getRequestId() Returns the unique id for the request that generated this response.
int | getStatus() Returns the status for this response.
boolean | isAvailable() Returns true if a response is available, false otherwise.

Field Detail

英文文档：

STATUS_SUCCESS

static final int STATUS_SUCCESS
Status indicating a successful response.

See Also:
Constant Field Values

英文文档：

STATUS_WARNING

static final int STATUS_WARNING
Status indicating a successful response that included at least one warning.

See Also:
Constant Field Values

英文文档：

STATUS_FAILURE

static final int STATUS_FAILURE
Status indicating a failure response.

See Also:
Constant Field Values

英文文档：

STATUS_UNAVAILABLE

static final int STATUS_UNAVAILABLE
Status indicating that the results are currently unavailable.

See Also:
Constant Field Values
Method Detail

public String getRequestId() throws JAXRException
返回生成此响应的请求的唯一 ID。

功能级别：0
return | 请求 ID
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRequestId

String getRequestId()
                    throws JAXRException
Returns the unique id for the request that generated this response.

Capability Level: 0

Returns:
the request id
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getStatus() throws JAXRException
返回此响应的状态。

功能级别：0
return | 整数枚举值形式的状态
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | STATUS_SUCCESS
英文文档：

getStatus

int getStatus()
              throws JAXRException
Returns the status for this response.

Capability Level: 0

Returns:
the status which is an integer enumerated value
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
STATUS_SUCCESS

public boolean isAvailable() throws JAXRException
如果响应可用，则返回 true，否则返回 false。这是一个轮询方法，不得阻塞。

功能级别：0
return | 如果响应可用，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isAvailable

boolean isAvailable()
                    throws JAXRException
Returns true if a response is available, false otherwise. This is a polling method and must not block.

Capability Level: 0

Returns:
true if the response is available; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LifeCycleManager (Java EE 5)

javax.xml.registry
Interface LifeCycleManager

All Known Subinterfaces:
BusinessLifeCycleManager
public interface LifeCycleManager

Implemented by: BusinessLifeCycleManager

LifeCycleManager 接口是 API 中的主要接口，用于管理对信息模型定义的对象进行的生命周期操作。

如果客户端试图创建 JAXR 提供者的功能级别不支持的信息模型接口实例，则此接口的工厂方法必定抛出 UnsupportedCapabilityException。

英文文档：

The LifeCycleManager interface is the main interface in the API for managing life cycle operations on objects defined by the information model.

The factory methods of this interface must throw an UnsupportedCapabilityException if the client attempts to create an instance of an infomodel interface that is not supported by the capability level of the JAXR provider.

Author:
Farrukh S. Najmi

Field Summary
static String | ASSOCIATION
static String | AUDITABLE_EVENT
static String | CLASSIFICATION
static String | CLASSIFICATION_SCHEME
static String | CONCEPT
static String | EMAIL_ADDRESS
static String | EXTERNAL_IDENTIFIER
static String | EXTERNAL_LINK
static String | EXTRINSIC_OBJECT
static String | INTERNATIONAL_STRING
static String | KEY
static String | LOCALIZED_STRING
static String | ORGANIZATION
static String | PERSON_NAME
static String | POSTAL_ADDRESS
static String | REGISTRY_ENTRY
static String | REGISTRY_PACKAGE
static String | SERVICE
static String | SERVICE_BINDING
static String | SLOT
static String | SPECIFICATION_LINK
static String | TELEPHONE_NUMBER
static String | USER
static String | VERSIONABLE
Method Summary
Association | createAssociation(RegistryObject targetObject, Concept associationType) Creates an Association instance using the specified parameters.
Classification | createClassification(ClassificationScheme scheme, InternationalString name, String value) Creates a Classification instance for an external Classification using the specified InternationalString name and String value that identify a taxonomy element within the specified ClassificationScheme.
Classification | createClassification(ClassificationScheme scheme, String name, String value) Creates a Classification instance for an external Classification using the specified String name and String value that identify a taxonomy element within the specified ClassificationScheme.
Classification | createClassification(Concept concept) Creates a Classification instance for an internal Classification using the specified Concept that identifies a taxonomy element within an internal ClassificationScheme.
ClassificationScheme | createClassificationScheme(Concept concept) Creates a ClassificationScheme from a Concept that has no ClassificationScheme or parent Concept.
ClassificationScheme | createClassificationScheme(InternationalString name, InternationalString description) Creates a ClassificationScheme given the specified InternationalString parameters.
ClassificationScheme | createClassificationScheme(String name, String description) Creates a ClassificationScheme given the specified String parameters.
Concept | createConcept(RegistryObject parent, InternationalString name, String value) Creates a Concept instance using the specified parameters, where the name is an InternationalString.
Concept | createConcept(RegistryObject parent, String name, String value) Creates a Concept instance using the specified parameters, where the name is a String.
EmailAddress | createEmailAddress(String address) Creates an EmailAddress instance using an address as the parameter.
EmailAddress | createEmailAddress(String address, String type) Creates an EmailAddress instance using both an address and a type as parameters.
ExternalIdentifier | createExternalIdentifier(ClassificationScheme identificationScheme, InternationalString name, String value) Creates an ExternalIdentifier instance using the specified parameters, where the name is an InternationalString.
ExternalIdentifier | createExternalIdentifier(ClassificationScheme identificationScheme, String name, String value) Creates an ExternalIdentifier instance using the specified parameters, where the name is a String.
ExternalLink | createExternalLink(String externalURI, InternationalString description) Creates an ExternalLink instance using the specified parameters, where the description is an InternationalString.
ExternalLink | createExternalLink(String externalURI, String description) Creates an ExternalLink instance using the specified parameters, where the description is a String.
ExtrinsicObject | createExtrinsicObject(DataHandler repositoryItem) Creates an ExtrinsicObject instance using the specified parameters.
InternationalString | createInternationalString() Creates an empty InternationalString instance.
InternationalString | createInternationalString(Locale l, String s) Creates an InternationalString instance using the specified Locale and String parameters.
InternationalString | createInternationalString(String s) Creates an InternationalString instance using a String parameter and the default Locale.
Key | createKey(String id) Creates a Key instance from an ID.
LocalizedString | createLocalizedString(Locale l, String s) Creates a LocalizedString instance using the specified Locale and String parameters.
LocalizedString | createLocalizedString(Locale l, String s, String charSetName) Creates a LocalizedString instance using the specified Locale, String, and character set parameters.
Object | createObject(String interfaceName) Creates instances of information model interfaces (factory method).
Organization | createOrganization(InternationalString name) Creates an Organization instance using the specified name, where the name is an InternationalString.
Organization | createOrganization(String name) Creates an Organization instance using the specified name, where the name is a String.
PersonName | createPersonName(String fullName) Creates a PersonName instance using the specified full name.
PersonName | createPersonName(String firstName, String middleName, String lastName) Creates a PersonName instance using the specified first, middle, and last names.
PostalAddress | createPostalAddress(String streetNumber, String street, String city, String stateOrProvince, String country, String postalCode, String type) Creates a PostalAddress instance using the specified parameters.
RegistryPackage | createRegistryPackage(InternationalString name) Creates a RegistryPackage instance using the specified name, where the name is an InternationalString.
RegistryPackage | createRegistryPackage(String name) Creates a RegistryPackage instance using the specified name, where the name is a String.
Service | createService(InternationalString name) Creates a Service instance using the specified name, where the name is an InternationalString.
Service | createService(String name) Creates a Service instance using the specified name, where the name is a String.
ServiceBinding | createServiceBinding() Creates an empty ServiceBinding instance.
Slot | createSlot(String name, Collection values, String slotType) Creates a Slot instance using the specified parameters, where the value is a Collection of Strings.
Slot | createSlot(String name, String value, String slotType) Creates a Slot instance using the specified parameters, where the value is a String.
SpecificationLink | createSpecificationLink() Creates an empty SpecificationLink instance.
TelephoneNumber | createTelephoneNumber() Creates an empty TelephoneNumber instance.
User | createUser() Creates an empty User instance.
BulkResponse | deleteObjects(Collection keys) Deletes one or more previously submitted objects from the registry using the object keys.
BulkResponse | deleteObjects(Collection keys, String objectType) Deletes one or more previously submitted objects from the registry using the object keys and a specified objectType attribute.
BulkResponse | deprecateObjects(Collection keys) Deprecates one or more previously submitted objects.
RegistryService | getRegistryService() Returns the parent RegistryService that created this object.
BulkResponse | saveObjects(Collection objects) Saves one or more Objects to the registry.
BulkResponse | unDeprecateObjects(Collection keys) Undeprecates one or more previously deprecated objects.

Field Detail

英文文档：

ASSOCIATION

static final String ASSOCIATION
See Also:
Constant Field Values

英文文档：

AUDITABLE_EVENT

static final String AUDITABLE_EVENT
See Also:
Constant Field Values

英文文档：

CLASSIFICATION

static final String CLASSIFICATION
See Also:
Constant Field Values

英文文档：

CLASSIFICATION_SCHEME

static final String CLASSIFICATION_SCHEME
See Also:
Constant Field Values

英文文档：

CONCEPT

static final String CONCEPT
See Also:
Constant Field Values

英文文档：

EMAIL_ADDRESS

static final String EMAIL_ADDRESS
See Also:
Constant Field Values

英文文档：

EXTERNAL_IDENTIFIER

static final String EXTERNAL_IDENTIFIER
See Also:
Constant Field Values

英文文档：

EXTERNAL_LINK

static final String EXTERNAL_LINK
See Also:
Constant Field Values

英文文档：

EXTRINSIC_OBJECT

static final String EXTRINSIC_OBJECT
See Also:
Constant Field Values

英文文档：

INTERNATIONAL_STRING

static final String INTERNATIONAL_STRING
See Also:
Constant Field Values

英文文档：

KEY

static final String KEY
See Also:
Constant Field Values

英文文档：

LOCALIZED_STRING

static final String LOCALIZED_STRING
See Also:
Constant Field Values

英文文档：

ORGANIZATION

static final String ORGANIZATION
See Also:
Constant Field Values

英文文档：

PERSON_NAME

static final String PERSON_NAME
See Also:
Constant Field Values

英文文档：

POSTAL_ADDRESS

static final String POSTAL_ADDRESS
See Also:
Constant Field Values

英文文档：

REGISTRY_ENTRY

static final String REGISTRY_ENTRY
See Also:
Constant Field Values

英文文档：

REGISTRY_PACKAGE

static final String REGISTRY_PACKAGE
See Also:
Constant Field Values

英文文档：

SERVICE

static final String SERVICE
See Also:
Constant Field Values

英文文档：

SERVICE_BINDING

static final String SERVICE_BINDING
See Also:
Constant Field Values

英文文档：

SLOT

static final String SLOT
See Also:
Constant Field Values

英文文档：

SPECIFICATION_LINK

static final String SPECIFICATION_LINK
See Also:
Constant Field Values

英文文档：

TELEPHONE_NUMBER

static final String TELEPHONE_NUMBER
See Also:
Constant Field Values

英文文档：

USER

static final String USER
See Also:
Constant Field Values

英文文档：

VERSIONABLE

static final String VERSIONABLE
See Also:
Constant Field Values
Method Detail

public Object createObject(String interfaceName) throws JAXRException, InvalidRequestException, UnsupportedCapabilityException
创建信息模型接口的实例（工厂方法）。要创建 Organization，可按以下方式使用此方法：
Organization org = (Organization)
lifeCycleMgr.createObject(LifeCycleManager.ORGANIZATION);

功能级别：0
interfaceName | javax.xml.registry.infomodel 包中某个接口的非限定名称
return | 随后可强制转换为接口实例的 Object
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
Throws | InvalidRequestException: 如果该接口不是 javax.xml.registry.infomodel 包中的接口
Throws | UnsupportedCapabilityException: 如果客户端试图创建 JAXR 提供者的功能级别不支持的信息模型接口实例
英文文档：

createObject

Object createObject(String interfaceName)
                    throws JAXRException,
                           InvalidRequestException,
                           UnsupportedCapabilityException
Creates instances of information model interfaces (factory method). To create an Organization, use this method as follows:
 Organization org = (Organization)
    lifeCycleMgr.createObject(LifeCycleManager.ORGANIZATION);

Capability Level: 0

Parameters:
interfaceName - the unqualified name of an interface in the javax.xml.registry.infomodel package
Returns:
an Object that can then be cast to an instance of the interface
Throws:
JAXRException - if the JAXR provider encounters an internal error
InvalidRequestException - if the interface is not an interface in the javax.xml.registry.infomodel package
UnsupportedCapabilityException - if the client attempts to create an instance of an infomodel interface that is not supported by the capability level of the JAXR provider

public Association createAssociation(RegistryObject targetObject, Concept associationType) throws JAXRException
使用指定参数创建一个 Association 实例。sourceObject 保留为 null，将在 Association 添加到 RegistryObject 时设置。

注意，对于 UDDI 提供者，只能在 Organization 之间创建 Association。

功能级别：0
targetObject | 用于 Association 的目标 RegistryObject
associationType | Association 的关联类型
return | 创建的 Association 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createAssociation

Association createAssociation(RegistryObject targetObject,
                              Concept associationType)
                              throws JAXRException
Creates an Association instance using the specified parameters. The sourceObject is left null and will be set when the Association is added to a RegistryObject.

Note that for a UDDI provider an Association may only be created between Organizations.

Capability Level: 0

Parameters:
targetObject - the target RegistryObject for the association
associationType - the association type for the Association
Returns:
the Association instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Classification createClassification(ClassificationScheme scheme, String name, String value) throws JAXRException
创建一个类型为外部 Classification 的 Classification 实例，使用指定 String 名称和 String 值标识指定 ClassificationScheme 中的分类元素。

功能级别：0
scheme | 将使用的 ClassificationScheme
name | 分类元素的名称（一个 String）
value | 分类元素的值
return | 创建的 Classification 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createClassification

Classification createClassification(ClassificationScheme scheme,
                                    String name,
                                    String value)
                                    throws JAXRException
Creates a Classification instance for an external Classification using the specified String name and String value that identify a taxonomy element within the specified ClassificationScheme.

Capability Level: 0

Parameters:
scheme - the ClassificationScheme to be used
name - the name of the taxonomy element (a String)
value - the value of the taxonomy element
Returns:
the Classification instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Classification createClassification(ClassificationScheme scheme, InternationalString name, String value) throws JAXRException
创建一个类型为外部 Classification 的 Classification 实例，使用指定 InternationalString 名称和 String 值标识指定 ClassificationScheme 中的分类元素。

功能级别：0
scheme | 将使用的 ClassificationScheme
name | 分类元素的名称（一个 InternationalString）
value | 分类元素的值
return | 创建的 Classification 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createClassification

Classification createClassification(ClassificationScheme scheme,
                                    InternationalString name,
                                    String value)
                                    throws JAXRException
Creates a Classification instance for an external Classification using the specified InternationalString name and String value that identify a taxonomy element within the specified ClassificationScheme.

Capability Level: 0

Parameters:
scheme - the ClassificationScheme to be used
name - the name of the taxonomy element (an InternationalString)
value - the value of the taxonomy element
Returns:
the Classification instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Classification createClassification(Concept concept) throws JAXRException, InvalidRequestException
创建一个类型为内部 Classification 的 Classification 实例，使用指定的 Concept 标识内部 ClassificationScheme 中的分类元素。

功能级别：0
concept | 标识分类元素的 Concept
return | 创建的 Classification 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
Throws | InvalidRequestException: 如果 Concept 不属于某个 ClassificationScheme
英文文档：

createClassification

Classification createClassification(Concept concept)
                                    throws JAXRException,
                                           InvalidRequestException
Creates a Classification instance for an internal Classification using the specified Concept that identifies a taxonomy element within an internal ClassificationScheme.

Capability Level: 0

Parameters:
concept - the Concept that identifies the taxonomy element
Returns:
the Classification instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error
InvalidRequestException - if the Concept is not under a ClassificationScheme

public ClassificationScheme createClassificationScheme(String name, String description) throws JAXRException, InvalidRequestException
根据指定的 String 参数创建 ClassificationScheme。

功能级别：0
name | ClassificationScheme 的名称（一个 String）
description | ClassificationScheme 的描述（一个 String）
return | 创建的 ClassificationScheme 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createClassificationScheme

ClassificationScheme createClassificationScheme(String name,
                                                String description)
                                                throws JAXRException,
                                                       InvalidRequestException
Creates a ClassificationScheme given the specified String parameters.

Capability Level: 0

Parameters:
name - the name of the ClassificationScheme (a String)
description - a description of the ClassificationScheme (a String)
Returns:
the ClassificationScheme instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error
InvalidRequestException

public ClassificationScheme createClassificationScheme(InternationalString name, InternationalString description) throws JAXRException, InvalidRequestException
根据指定的 InternationalString 参数创建 ClassificationScheme。

功能级别：0
name | ClassificationScheme 的名称（一个 InternationalString）
description | ClassificationScheme 的描述（一个 InternationalString）
return | 创建的 ClassificationScheme 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createClassificationScheme

ClassificationScheme createClassificationScheme(InternationalString name,
                                                InternationalString description)
                                                throws JAXRException,
                                                       InvalidRequestException
Creates a ClassificationScheme given the specified InternationalString parameters.

Capability Level: 0

Parameters:
name - the name of the ClassificationScheme (an InternationalString)
description - a description of the ClassificationScheme (an InternationalString)
Returns:
the ClassificationScheme instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error
InvalidRequestException

public ClassificationScheme createClassificationScheme(Concept concept) throws JAXRException, InvalidRequestException
根据没有任何 ClassificationScheme 或父 Concept 的 Concept 创建 ClassificationScheme。

此方法是一个特殊情况下使用的方法，用于执行从 Concept 到 ClassificationScheme 的类型安全转换。

提供此方法是为了支持将 BusinessQueryManager findConcept 调用返回的 Concept 安全地强制转换为 ClassificationScheme。编程人员负责确保 Concept 在语义上确实是一个 ClassificationScheme。

此方法是必需的，因为在 UDDI 规范中，tModel 可能有多种用途，无法知道将 tModel 映射到 Concept 的时间以及将 tModel 映射到 ClassificationScheme 的时间。UDDI 规范将确认的任务留给编程人员，因此，此方法也这样做。

功能级别：0
concept | 将使用的 Concept
return | 创建的 ClassificationScheme 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
Throws | InvalidRequestException: 如果 Concept 有一个父 Concept，或者属于某个 ClassificationScheme
英文文档：

createClassificationScheme

ClassificationScheme createClassificationScheme(Concept concept)
                                                throws JAXRException,
                                                       InvalidRequestException
Creates a ClassificationScheme from a Concept that has no ClassificationScheme or parent Concept.

This method is a special-case method to do a type-safe conversion from Concept to ClassificationScheme.

This method is provided to allow for Concepts returned by the BusinessQueryManager findConcepts call to be safely cast to ClassificationScheme. It is up to the programmer to make sure that the Concept is indeed semantically a ClassificationScheme.

This method is necessary because in the UDDI specification a tModel may serve multiple purposes, and there is no way to know when a tModel maps to a Concept and when it maps to a ClassificationScheme. The UDDI specification leaves the determination to the programmer, and consequently so does this method.

Capability Level: 0

Parameters:
concept - the Concept to be used
Returns:
the ClassificationScheme instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error
InvalidRequestException - if the Concept has a parent Concept or is under a ClassificationScheme

public Concept createConcept(RegistryObject parent, String name, String value) throws JAXRException
使用指定的参数创建 Concept 实例，其中 name 是一个 String。

功能级别：0
parent | 对父 ClassificationScheme 或 Concept 的引用
name | Concept 的名称（一个 String）
value | Concept 的值
return | 创建的 Concept 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createConcept

Concept createConcept(RegistryObject parent,
                      String name,
                      String value)
                      throws JAXRException
Creates a Concept instance using the specified parameters, where the name is a String.

Capability Level: 0

Parameters:
parent - a reference either to a parent ClassificationScheme or to a Concept
name - the name of the concept (a String)
value - the value of the concept
Returns:
the Concept instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Concept createConcept(RegistryObject parent, InternationalString name, String value) throws JAXRException
使用指定的参数创建 Concept 实例，其中 name 是一个 InternationalString。

功能级别：0
parent | 对父 ClassificationScheme 或 Concept 的引用
name | Concept 的名称（一个 InternationalString）
value | Concept 的值
return | 创建的 Concept 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createConcept

Concept createConcept(RegistryObject parent,
                      InternationalString name,
                      String value)
                      throws JAXRException
Creates a Concept instance using the specified parameters, where the name is an InternationalString.

Capability Level: 0

Parameters:
parent - a reference either to a parent ClassificationScheme or to a Concept
name - the name of the concept (an InternationalString)
value - the value of the concept
Returns:
the Concept instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public EmailAddress createEmailAddress(String address) throws JAXRException
创建一个 EmailAddress 实例，使用 address 作为参数。

功能级别：0
address | 电子邮件地址
return | 创建的 EmailAddress 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createEmailAddress

EmailAddress createEmailAddress(String address)
                                throws JAXRException
Creates an EmailAddress instance using an address as the parameter.

Capability Level: 0

Parameters:
address - the email address
Returns:
the EmailAddress instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public EmailAddress createEmailAddress(String address, String type) throws JAXRException
创建一个 EmailAddress 实例，使用 address 和 type 作为参数。

功能级别：0
address | 电子邮件地址
type | 地址的类型
return | 创建的 EmailAddress 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createEmailAddress

EmailAddress createEmailAddress(String address,
                                String type)
                                throws JAXRException
Creates an EmailAddress instance using both an address and a type as parameters.

Capability Level: 0

Parameters:
address - the email address
type - the type of the address
Returns:
the EmailAddress instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public ExternalIdentifier createExternalIdentifier(ClassificationScheme identificationScheme, String name, String value) throws JAXRException
使用指定的参数创建 ExternalIdentifier 实例，其中 name 是一个 String。

功能级别：0
identificationScheme | 使用的 ClassificationScheme
name | 外部标识符的名称（一个 String）
value | 外部标识符的值
return | 创建的 ExternalIdentifier 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createExternalIdentifier

ExternalIdentifier createExternalIdentifier(ClassificationScheme identificationScheme,
                                            String name,
                                            String value)
                                            throws JAXRException
Creates an ExternalIdentifier instance using the specified parameters, where the name is a String.

Capability Level: 0

Parameters:
identificationScheme - the ClassificationScheme used
name - the name of the external identifier (a String)
value - the value of the external identifier
Returns:
the ExternalIdentifier instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public ExternalIdentifier createExternalIdentifier(ClassificationScheme identificationScheme, InternationalString name, String value) throws JAXRException
使用指定的参数创建 ExternalIdentifier 实例，其中 name 是一个 InternationalString。

功能级别：0
identificationScheme | 使用的 ClassificationScheme
name | 外部标识符的名称（一个 InternationalString）
value | 外部标识符的值
return | 创建的 ExternalIdentifier 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createExternalIdentifier

ExternalIdentifier createExternalIdentifier(ClassificationScheme identificationScheme,
                                            InternationalString name,
                                            String value)
                                            throws JAXRException
Creates an ExternalIdentifier instance using the specified parameters, where the name is an InternationalString.

Capability Level: 0

Parameters:
identificationScheme - the ClassificationScheme used
name - the name of the external identifier (an InternationalString)
value - the value of the external identifier
Returns:
the ExternalIdentifier instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public ExternalLink createExternalLink(String externalURI, String description) throws JAXRException
使用指定的参数创建 ExternalLink 实例，其中 description 是一个 String。

功能级别：0
externalURI | 外部 URI
description | 链接的描述（一个 String）
return | 创建的 ExternalLink 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createExternalLink

ExternalLink createExternalLink(String externalURI,
                                String description)
                                throws JAXRException
Creates an ExternalLink instance using the specified parameters, where the description is a String.

Capability Level: 0

Parameters:
externalURI - the external URI
description - a description of the link (a String)
Returns:
the ExternalLink instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public ExternalLink createExternalLink(String externalURI, InternationalString description) throws JAXRException
使用指定的参数创建 ExternalLink 实例，其中 description 是一个 InternationalString。

功能级别：0
externalURI | 外部 URI
description | 链接的描述（一个 InternationalString）
return | 创建的 ExternalLink 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createExternalLink

ExternalLink createExternalLink(String externalURI,
                                InternationalString description)
                                throws JAXRException
Creates an ExternalLink instance using the specified parameters, where the description is an InternationalString.

Capability Level: 0

Parameters:
externalURI - the external URI
description - a description of the link (an InternationalString)
Returns:
the ExternalLink instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public ExtrinsicObject createExtrinsicObject(DataHandler repositoryItem) throws JAXRException
使用指定的参数创建 ExtrinsicObject 实例。

功能级别：1
repositoryItem | 存储库条目的 DataHandler。不得为 null。
return | 创建的 ExtrinsicObject 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createExtrinsicObject

ExtrinsicObject createExtrinsicObject(DataHandler repositoryItem)
                                      throws JAXRException
Creates an ExtrinsicObject instance using the specified parameters.

Capability Level: 1

Parameters:
repositoryItem - the DataHandler for the repository item. Must not be null.
Returns:
the ExtrinsicObject instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public InternationalString createInternationalString() throws JAXRException
创建一个空的 InternationalString 实例。

功能级别：0
return | 创建的 InternationalString 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createInternationalString

InternationalString createInternationalString()
                                              throws JAXRException
Creates an empty InternationalString instance.

Capability Level: 0

Returns:
the InternationalString instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public InternationalString createInternationalString(String s) throws JAXRException
使用 String 参数和默认 Locale 创建 InternationalString 实例。

功能级别：0
s | 用于创建 InternationalString 的 String
return | 创建的 InternationalString 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createInternationalString

InternationalString createInternationalString(String s)
                                              throws JAXRException
Creates an InternationalString instance using a String parameter and the default Locale.

Capability Level: 0

Parameters:
s - the String from which to create the InternationalString
Returns:
the InternationalString instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public InternationalString createInternationalString(java.util.Locale l, String s) throws JAXRException
使用指定 Locale 和 String 参数创建 InternationalString 实例。

功能级别：0
l | 用于创建 InternationalString 的 Locale
s | 用于创建 InternationalString 的 String
return | 创建的 InternationalString 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createInternationalString

InternationalString createInternationalString(Locale l,
                                              String s)
                                              throws JAXRException
Creates an InternationalString instance using the specified Locale and String parameters.

Capability Level: 0

Parameters:
l - the Locale in which to create the InternationalString
s - the String from which to create the InternationalString
Returns:
the InternationalString instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Key createKey(String id) throws JAXRException
根据 ID 创建一个 Key 实例。

功能级别：0
id | 用于创建 Key 的 ID 字符串
return | 创建的 Key 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createKey

Key createKey(String id)
              throws JAXRException
Creates a Key instance from an ID.

Capability Level: 0

Parameters:
id - the ID string from which to create the Key
Returns:
the Key instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public LocalizedString createLocalizedString(java.util.Locale l, String s) throws JAXRException
使用指定 Locale 和 String 参数创建 LocalizedString 实例。

功能级别：0
l | 用于创建 LocalizedString 的 Locale
s | 用于创建 LocalizedString 的 String
return | 创建的 LocalizedString 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createLocalizedString

LocalizedString createLocalizedString(Locale l,
                                      String s)
                                      throws JAXRException
Creates a LocalizedString instance using the specified Locale and String parameters.

Capability Level: 0

Parameters:
l - the Locale in which to create the LocalizedString
s - the String from which to create the LocalizedString
Returns:
the LocalizedString instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public LocalizedString createLocalizedString(java.util.Locale l, String s, String charSetName) throws JAXRException
使用指定的 Locale、String 和字符集参数创建 LocalizedString 实例。

功能级别：0
l | 用于创建 LocalizedString 的 Locale
s | 用于创建 LocalizedString 的 String
charSetName | 将使用的字符集的名称
return | 创建的 LocalizedString 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createLocalizedString

LocalizedString createLocalizedString(Locale l,
                                      String s,
                                      String charSetName)
                                      throws JAXRException
Creates a LocalizedString instance using the specified Locale, String, and character set parameters.

Capability Level: 0

Parameters:
l - the Locale in which to create the LocalizedString
s - the String from which to create the LocalizedString
charSetName - the name of the character set to use
Returns:
the LocalizedString instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Organization createOrganization(String name) throws JAXRException
使用指定的名称创建 Organization 实例，其中 name 是一个 String。

功能级别：0
name | Organization 的名称
return | 创建的 Organization 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createOrganization

Organization createOrganization(String name)
                                throws JAXRException
Creates an Organization instance using the specified name, where the name is a String.

Capability Level: 0

Parameters:
name - the name of the Organization
Returns:
the Organization instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Organization createOrganization(InternationalString name) throws JAXRException
使用指定的名称创建 Organization 实例，其中 name 是一个 InternationalString。

功能级别：0
name | Organization 的名称
return | 创建的 Organization 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createOrganization

Organization createOrganization(InternationalString name)
                                throws JAXRException
Creates an Organization instance using the specified name, where the name is an InternationalString.

Capability Level: 0

Parameters:
name - the name of the Organization
Returns:
the Organization instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public PersonName createPersonName(String firstName, String middleName, String lastName) throws JAXRException
使用指定的姓名创建 PersonName 实例。

功能级别：1
firstName | 某个人的名
middleName | 某个人的中间名
lastName | 某个人的姓氏
return | 创建的 PersonName 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createPersonName

PersonName createPersonName(String firstName,
                            String middleName,
                            String lastName)
                            throws JAXRException
Creates a PersonName instance using the specified first, middle, and last names.

Capability Level: 1

Parameters:
firstName - the person's first name
middleName - the person's middle name
lastName - the person's last name
Returns:
the PersonName instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public PersonName createPersonName(String fullName) throws JAXRException
使用指定的全名创建 PersonName 实例。

功能级别：0
fullName | 某个人的全名
return | 创建的 PersonName 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createPersonName

PersonName createPersonName(String fullName)
                            throws JAXRException
Creates a PersonName instance using the specified full name.

Capability Level: 0

Parameters:
fullName - the person's full name
Returns:
the PersonName instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public PostalAddress createPostalAddress(String streetNumber, String street, String city, String stateOrProvince, String country, String postalCode, String type) throws JAXRException
使用指定的参数创建 PostalAddress 实例。

功能级别：0
streetNumber | 街道编号
street | 街道名称
city | 城市名称
stateOrProvince | 州或省的名称
country | 国家名称
postalCode | 邮政编码（比如 US ZIP 编码）
type | 地址的类型
return | 创建的 PostalAddress 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createPostalAddress

PostalAddress createPostalAddress(String streetNumber,
                                  String street,
                                  String city,
                                  String stateOrProvince,
                                  String country,
                                  String postalCode,
                                  String type)
                                  throws JAXRException
Creates a PostalAddress instance using the specified parameters.

Capability Level: 0

Parameters:
streetNumber - the street number
street - the street name
city - the city name
stateOrProvince - the state or province name
country - the country name
postalCode - the postal code (such as a US ZIP code)
type - the type of the address
Returns:
the PostalAddress instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public RegistryPackage createRegistryPackage(String name) throws JAXRException
使用指定的名称创建 RegistryPackage 实例，其中 name 是一个 String。

功能级别：1
name | 注册表包的名称（一个 String）
return | 创建的 RegistryPackage 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createRegistryPackage

RegistryPackage createRegistryPackage(String name)
                                      throws JAXRException
Creates a RegistryPackage instance using the specified name, where the name is a String.

Capability Level: 1

Parameters:
name - the name of the registry package (a String)
Returns:
the RegistryPackage instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public RegistryPackage createRegistryPackage(InternationalString name) throws JAXRException
使用指定的名称创建 RegistryPackage 实例，其中 name 是一个 InternationalString。

功能级别：1
name | 注册表包的名称（一个 InternationalString）
return | 创建的 RegistryPackage 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createRegistryPackage

RegistryPackage createRegistryPackage(InternationalString name)
                                      throws JAXRException
Creates a RegistryPackage instance using the specified name, where the name is an InternationalString.

Capability Level: 1

Parameters:
name - the name of the registry package (an InternationalString)
Returns:
the RegistryPackage instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Service createService(String name) throws JAXRException
使用指定的名称创建 Service 实例，其中 name 是一个 String。

功能级别：0
name | Service 的名称（一个 String）
return | 创建的 Service 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createService

Service createService(String name)
                      throws JAXRException
Creates a Service instance using the specified name, where the name is a String.

Capability Level: 0

Parameters:
name - the name of the Service (a String)
Returns:
the Service instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Service createService(InternationalString name) throws JAXRException
使用指定的名称创建 Service 实例，其中 name 是一个 InternationalString。

功能级别：0
name | Service 的名称（一个 InternationalString）
return | 创建的 Service 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createService

Service createService(InternationalString name)
                      throws JAXRException
Creates a Service instance using the specified name, where the name is an InternationalString.

Capability Level: 0

Parameters:
name - the name of the Service (an InternationalString)
Returns:
the Service instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public ServiceBinding createServiceBinding() throws JAXRException
创建一个空 ServiceBinding 实例。

功能级别：0
return | 创建的 ServiceBinding 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createServiceBinding

ServiceBinding createServiceBinding()
                                    throws JAXRException
Creates an empty ServiceBinding instance.

Capability Level: 0

Returns:
the ServiceBinding instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Slot createSlot(String name, String value, String slotType) throws JAXRException
使用指定的参数创建 Slot 实例，其中 value 是一个 String。

功能级别：0
name | Slot 的名称
value | 值（一个 String）
slotType | Slot 类型
return | 创建的 Slot 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createSlot

Slot createSlot(String name,
                String value,
                String slotType)
                throws JAXRException
Creates a Slot instance using the specified parameters, where the value is a String.

Capability Level: 0

Parameters:
name - the name of the Slot
value - the value (a String)
slotType - the slot type
Returns:
the Slot instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public Slot createSlot(String name, java.util.Collection<E> values, String slotType) throws JAXRException
使用指定的参数创建 Slot 实例，其中 value 是 String 所组成的 Collection。

功能级别：0
name | Slot 的名称
value | 值（String 所组成的 Collection）
slotType | Slot 类型
return | 创建的 Slot 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createSlot

Slot createSlot(String name,
                Collection values,
                String slotType)
                throws JAXRException
Creates a Slot instance using the specified parameters, where the value is a Collection of Strings.

Capability Level: 0

Parameters:
name - the name of the Slot
value - the value (a Collection of Strings)
slotType - the slot type
Returns:
the Slot instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public SpecificationLink createSpecificationLink() throws JAXRException
创建一个空 SpecificationLink 实例。

功能级别：0
return | 创建的 SpecificationLink 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createSpecificationLink

SpecificationLink createSpecificationLink()
                                          throws JAXRException
Creates an empty SpecificationLink instance.

Capability Level: 0

Returns:
the SpecificationLink instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public TelephoneNumber createTelephoneNumber() throws JAXRException
创建一个空 TelephoneNumber 实例。

功能级别：0
return | 创建的 TelephoneNumber 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createTelephoneNumber

TelephoneNumber createTelephoneNumber()
                                      throws JAXRException
Creates an empty TelephoneNumber instance.

Capability Level: 0

Returns:
the TelephoneNumber instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public User createUser() throws JAXRException
创建一个空 User 实例。

功能级别：0
return | 创建的 User 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

createUser

User createUser()
                throws JAXRException
Creates an empty User instance.

Capability Level: 0

Returns:
the User instance created
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse saveObjects(java.util.Collection<E> objects) throws JAXRException
将一个或多个 Object 保存到注册表。对象可以是 RegistryObject 子类实例。

如果注册表中没有该对象，则将在注册表中创建它。如果它已经存在于注册表中且被修改过，则将在注册表中更新（替换）其状态。

功能级别：0
objects | 可能的异构 RegistryObject 实例所组成的 Collection
return | 一个 BulkResponse，它包含以下对象的键所组成的 Collection：成功保存的那些对象；部分提交情况下遇到的任何 SaveException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

saveObjects

BulkResponse saveObjects(Collection objects)
                         throws JAXRException
Saves one or more Objects to the registry. An object may be a RegistryObject subclass instance.

If an object is not in the registry, it is created in the registry. If it already exists in the registry and has been modified, then its state is updated (replaced) in the registry.

Capability Level: 0

Parameters:
objects - a potentially heterogeneous Collection of RegistryObject instances
Returns:
a BulkResponse containing the Collection of keys for those objects that were saved successfully and any SaveException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deprecateObjects(java.util.Collection<E> keys) throws JAXRException
废弃以前提交的一个或多个对象。废弃操作将对象标记为 "soon to be deleted"。废弃某个对象后，JAXR 提供者不得允许提交对该对象的任何新引用（例如，新的 Associations、Classifications 和 ExternalLinks）。如果客户端执行可导致对废弃对象的新引用的 API 调用，则 JAXR 提供者必定抛出 JAXRException 中的 java.lang.IllegalStateException。但是，对废弃对象的现有引用可以继续正常使用。

功能级别：1
keys | 将废弃的对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功废弃的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 JAXRException
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deprecateObjects

BulkResponse deprecateObjects(Collection keys)
                              throws JAXRException
Deprecates one or more previously submitted objects. Deprecation marks an object as "soon to be deleted". Once an object is deprecated, the JAXR provider must not allow any new references (e.g. new Associations, Classifications and ExternalLinks) to that object to be submitted. If a client makes an API call that results in a new reference to a deprecated object, the JAXR provider must throw a java.lang.IllegalStateException within a JAXRException. However, existing references to a deprecated object continue to function normally.

Capability Level: 1

Parameters:
keys - a Collection of keys for the objects to be deprecated
Returns:
a BulkResponse containing the Collection of keys for those objects that were deprecated successfully and any JAXRException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse unDeprecateObjects(java.util.Collection<E> keys) throws JAXRException
取消以前废弃的一个或多个对象的废弃状态。如果某个对象以前没有废弃，这也不是一个错误，不会抛出任何异常。取消废弃某个对象后，JAXR 提供者必须再次允许提交对该对象的新引用（例如，新的 Associations、Classifications 和 ExternalLinks）。

功能级别：1
keys | 将取消废弃的对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功废弃的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 JAXRException
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

unDeprecateObjects

BulkResponse unDeprecateObjects(Collection keys)
                                throws JAXRException
Undeprecates one or more previously deprecated objects. If an object was not previously deprecated, it is not an error, and no exception is thrown. Once an object is undeprecated, the JAXR provider must again allow new references (e.g. new Associations, Classifications and ExternalLinks) to that object to be submitted.

Capability Level: 1

Parameters:
keys - a Collection of keys for the objects to be undeprecated
Returns:
a BulkResponse containing the Collection of keys for those objects that were deprecated successfully and any JAXRException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteObjects(java.util.Collection<E> keys) throws JAXRException
使用对象键从注册表中删除以前提交的一个或多个对象。

功能级别：1
keys | 将删除的对象的键所组成的 Collection
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteObjects

BulkResponse deleteObjects(Collection keys)
                           throws JAXRException
Deletes one or more previously submitted objects from the registry using the object keys.

Capability Level: 1

Parameters:
keys - a Collection of keys for the objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public BulkResponse deleteObjects(java.util.Collection<E> keys, String objectType) throws JAXRException
使用对象键和指定的 objectType 属性从注册表中删除以前提交的一个或多个对象。

功能级别：0
keys | 将删除的对象的键所组成的 Collection
objectType | 将删除的对象的 objectType 属性
return | 一个 BulkResponse，它包含成功删除的那些对象的键所组成的 Collection，以及部分提交情况下遇到的任何 DeleteException。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

deleteObjects

BulkResponse deleteObjects(Collection keys,
                           String objectType)
                           throws JAXRException
Deletes one or more previously submitted objects from the registry using the object keys and a specified objectType attribute.

Capability Level: 0

Parameters:
keys - a Collection of keys for the objects to be deleted
objectType - the objectType attribute for the objects to be deleted
Returns:
a BulkResponse containing the Collection of keys for those objects that were deleted successfully and any DeleteException that was encountered in case of partial commit
Throws:
JAXRException - if the JAXR provider encounters an internal error

public RegistryService getRegistryService() throws JAXRException
返回创建此对象的父 RegistryService。

功能级别：0
return | 父 RegistryService
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{javax.xml.registry.RegistryService}>
英文文档：

getRegistryService

RegistryService getRegistryService()
                                   throws JAXRException
Returns the parent RegistryService that created this object.

Capability Level: 0

Returns:
the parent RegistryService
Throws:
JAXRException - if the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Query (Java EE 5)

javax.xml.registry
Interface Query

public interface Query

Query 接口用声明性查询语言封装查询。目前，Query 只能是 SQL 查询或者 ebXML Filter Query。将来可能添加对其他查询语言（如 XQL 查询）的支持。查询必须符合某种固定模式，这由 JAXR 规范定义。
英文文档：

The Query interface encapsulates a query in a declarative query language. Currently a Query can be an SQL query or an ebXML Filter Query only. In future support for other query languages such as XQL query may be added. The query must conform to a fixed schema as defined by the JAXR specification.

Author:
Farrukh S. Najmi

Field Summary
static int | QUERY_TYPE_EBXML_FILTER_QUERY An OASIS ebXML Registry XML Filter Query type.
static int | QUERY_TYPE_SQL An SQL query type.
static int | QUERY_TYPE_XQUERY A W3C XQuery type.
Method Summary
int | getType() Gets the type of Query (for example, QUERY_TYPE_SQL).
String | toString() Returns the String representing the query.

Field Detail

英文文档：

QUERY_TYPE_SQL

static final int QUERY_TYPE_SQL
An SQL query type.

See Also:
Constant Field Values

英文文档：

QUERY_TYPE_XQUERY

static final int QUERY_TYPE_XQUERY
A W3C XQuery type.

See Also:
Constant Field Values

英文文档：

QUERY_TYPE_EBXML_FILTER_QUERY

static final int QUERY_TYPE_EBXML_FILTER_QUERY
An OASIS ebXML Registry XML Filter Query type.

See Also:
Constant Field Values
Method Detail

public int getType() throws JAXRException
获得 Query 类型（例如，QUERY_TYPE_SQL）。

功能级别：1
return | 查询的类型
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | QUERY_TYPE_SQL, QUERY_TYPE_XQUERY, QUERY_TYPE_EBXML_FILTER_QUERY
英文文档：

getType

int getType()
            throws JAXRException
Gets the type of Query (for example, QUERY_TYPE_SQL).

Capability Level: 1

Returns:
the type of query
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
QUERY_TYPE_SQL, QUERY_TYPE_XQUERY, QUERY_TYPE_EBXML_FILTER_QUERY

public String toString()
返回表示查询的 String。例如，在使用 SQL 查询的情况下，以字符串形式的返回 SQL 查询。

功能级别：1
return 此查询的 String 表示形式
英文文档：

toString

String toString()
Returns the String representing the query. For example, in the case of an SQL query, returns the SQL query as a string.

Capability Level: 1

Overrides:
toString in class Object
Returns:
the String representation for this query
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QueryManager (Java EE 5)

javax.xml.registry
Interface QueryManager

All Known Subinterfaces:
BusinessQueryManager, DeclarativeQueryManager
public interface QueryManager

Implemented by: BusinessQueryManager, DeclarativeQueryManager

这是 API 中所有 QueryManager 的公共基本接口。
英文文档：

This is the common base interface for all QueryManagers in the API.

Author:
Farrukh S. Najmi

Method Summary
RegistryObject | getRegistryObject(String id) Gets the RegistryObject specified by the Id.
RegistryObject | getRegistryObject(String id, String objectType) Gets the RegistryObject specified by the Id and type of object.
BulkResponse | getRegistryObjects() Gets the RegistryObjects owned by the caller.
BulkResponse | getRegistryObjects(Collection objectKeys) Gets the specified RegistryObjects.
BulkResponse | getRegistryObjects(Collection objectKeys, String objectTypes) Gets the specified RegistryObjects.
BulkResponse | getRegistryObjects(String objectType) Gets the RegistryObjects owned by the caller, that are of the specified type.
RegistryService | getRegistryService() Returns the parent RegistryService that created this object.

Method Detail

public RegistryObject getRegistryObject(String id, String objectType) throws JAXRException
获取通过对象的 ID 和类型指定的 RegistryObject。

功能级别：0
id | RegistryObject 的 Key 的 ID。
objectType | 取自 LifeCycleManager 的常量定义，指定所需对象的类型。
return | 作为具体类型（例如，Organization、User 等）返回的 RegistryObject。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRegistryObject

RegistryObject getRegistryObject(String id,
                                 String objectType)
                                 throws JAXRException
Gets the RegistryObject specified by the Id and type of object.

Capability Level: 0

Parameters:
id - is the id of the Key for a RegistryObject.
objectType - is a constant definition from LifeCycleManager that specifies the type of object desired.
Returns:
the RegistryObject, returned as its concrete type (e.g. Organization, User etc.).
Throws:
JAXRException - If the JAXR provider encounters an internal error

public RegistryObject getRegistryObject(String id) throws JAXRException
获取通过 ID 指定的 RegistryObject。

功能级别：1
id | 所需对象的 ID
return | 作为具体类型（例如，Organization、User 等）返回的 RegistryObject。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRegistryObject

RegistryObject getRegistryObject(String id)
                                 throws JAXRException
Gets the RegistryObject specified by the Id.

Capability Level: 1

Parameters:
id - the id for the desired object
Returns:
the RegistryObject, returned as its concrete type (e.g. Organization, User etc.).
Throws:
JAXRException - If the JAXR provider encounters an internal error

public BulkResponse getRegistryObjects(java.util.Collection<E> objectKeys) throws JAXRException
获取指定的 RegistryObject。对象将作为其具体的类型返回（例如，Organization、User 等）。

功能级别：1
objectKeys | 所需对象的 Key 对象所组成的 Collection
return | BulkResponse，它包含 RegistryObject（例如，Organization、User 等）所组成的异构 Collection。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRegistryObjects

BulkResponse getRegistryObjects(Collection objectKeys)
                                throws JAXRException
Gets the specified RegistryObjects. The objects are returned as their concrete type (e.g. Organization, User etc.).

Capability Level: 1

Parameters:
objectKeys - a Collection of Key objects for the desired objects
Returns:
BulkResponse containing a heterogeneous Collection of RegistryObjects (e.g. Organization, User etc.).
Throws:
JAXRException - If the JAXR provider encounters an internal error

public BulkResponse getRegistryObjects(java.util.Collection<E> objectKeys, String objectTypes) throws JAXRException
获取指定的 RegistryObject。对象将作为其具体的类型返回（例如，Organization、User 等）。

功能级别：0
objectKeys | 所需对象的 Key 对象所组成的 Collection
objectTypes | 允许根据类型过滤所需对象的 String 对象所组成的 Collection
return | BulkResponse，它包含 RegistryObject（例如，Organization、User 等）所组成的异构 Collection。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRegistryObjects

BulkResponse getRegistryObjects(Collection objectKeys,
                                String objectTypes)
                                throws JAXRException
Gets the specified RegistryObjects. The objects are returned as their concrete type (e.g. Organization, User etc.).

Capability Level: 0

Parameters:
objectKeys - a Collection of Key objects for the desired objects
objectTypes - a Collection of String objects that allow filtering desired objects by their type
Returns:
BulkResponse containing a heterogeneous Collection of RegistryObjects (e.g. Organization, User etc.).
Throws:
JAXRException - If the JAXR provider encounters an internal error

public BulkResponse getRegistryObjects() throws JAXRException
获取调用者拥有的 RegistryObject。对象将作为其具体的类型返回（例如，Organization、User 等）。

功能级别：0
return | BulkResponse，它包含 RegistryObject（例如，Organization、User 等）所组成的异构 Collection。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRegistryObjects

BulkResponse getRegistryObjects()
                                throws JAXRException
Gets the RegistryObjects owned by the caller. The objects are returned as their concrete type (e.g. Organization, User etc.).

Capability Level: 0

Returns:
BulkResponse containing a heterogeneous Collection of RegistryObjects (e.g. Organization, User etc.).
Throws:
JAXRException - If the JAXR provider encounters an internal error

public BulkResponse getRegistryObjects(String objectType) throws JAXRException
获取调用者拥有的 RegistryObject，这些 RegistryObject 属于指定类型。对象将作为其具体的类型返回（例如，Organization、User 等）。

功能级别：0
objectType | 定义所查找对象类型的常量。关于对象类型的常量，请参见 LifeCycleManager。
return | BulkResponse，它包含 RegistryObject（例如，Organization、User 等）所组成的异构 Collection。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | ORGANIZATION
英文文档：

getRegistryObjects

BulkResponse getRegistryObjects(String objectType)
                                throws JAXRException
Gets the RegistryObjects owned by the caller, that are of the specified type. The objects are returned as their concrete type (e.g. Organization, User etc.).

Capability Level: 0

Parameters:
objectType - Is a constant that defines the type of object sought. See LifeCycleManager for constants for object types.
Returns:
BulkResponse containing a heterogeneous Collection of RegistryObjects (e.g. Organization, User etc.).
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
LifeCycleManager.ORGANIZATION

public RegistryService getRegistryService() throws JAXRException
返回创建此对象的父 RegistryService。

功能级别：0
return | 创建此对象的 RegistryService
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{javax.xml.registry.RegistryService}>
英文文档：

getRegistryService

RegistryService getRegistryService()
                                   throws JAXRException
Returns the parent RegistryService that created this object.

Capability Level: 0

Returns:
the RegistryService created this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RegistryService (Java EE 5)

javax.xml.registry
Interface RegistryService

public interface RegistryService

此类是 JAXR 提供者实现的主体接口。注册表客户端可通过到某个注册表的 Connection 获取此接口。它提供客户端使用的方法，以发现 JAXR 提供者实现的各种特定于功能的接口。
See also javax.xml.registry.Connection
英文文档：

This is the principal interface implemented by a JAXR provider. A registry client can get this interface from a Connection to a registry. It provides the methods that are used by the client to discover various capability specific interfaces implemented by the JAXR provider.

Author:
Farrukh S. Najmi
See Also:
Connection

Method Summary
BulkResponse | getBulkResponse(String requestId) Returns the BulkResponse associated with specified requestId.
BusinessLifeCycleManager | getBusinessLifeCycleManager() Returns the BusinessLifeCycleManager object implemented by the JAXR provider.
BusinessQueryManager | getBusinessQueryManager() Returns the BusinessQueryManager object implemented by the JAXR provider.
CapabilityProfile | getCapabilityProfile() Returns the CapabilityProfile for the JAXR provider.
DeclarativeQueryManager | getDeclarativeQueryManager() Returns the DeclarativeQueryManager object implemented by the JAXR provider.
ClassificationScheme | getDefaultPostalScheme() Gets the default user-defined postal scheme for codifying the attributes of PostalAddress.
String | makeRegistrySpecificRequest(String request) Takes a String that is an XML request in a registry-specific format, sends the request to the registry, and returns a String that is the registry-specific XML response.

Method Detail

public CapabilityProfile getCapabilityProfile() throws JAXRException
返回 JAXR 提供者的 CapabilityProfile。

功能级别：0
return | JAXR 提供者的 CapabilityProfile
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{javax.xml.registry.CapabilityProfile}>
See also | javax.xml.registry.LifeCycleManager
英文文档：

getCapabilityProfile

CapabilityProfile getCapabilityProfile()
                                       throws JAXRException
Returns the CapabilityProfile for the JAXR provider.

Capability Level: 0

Returns:
the CapabilityProfile for a JAXR provider
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
LifeCycleManager

public BusinessLifeCycleManager getBusinessLifeCycleManager() throws JAXRException
返回 JAXR 提供者实现的 BusinessLifeCycleManager 对象。

功能级别：0
return | BusinessLifeCycleManager
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{javax.xml.registry.BusinessLifeCycleManager}>
See also | javax.xml.registry.LifeCycleManager
英文文档：

getBusinessLifeCycleManager

BusinessLifeCycleManager getBusinessLifeCycleManager()
                                                     throws JAXRException
Returns the BusinessLifeCycleManager object implemented by the JAXR provider.

Capability Level: 0

Returns:
the BusinessLifeCycleManager
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
LifeCycleManager

public BusinessQueryManager getBusinessQueryManager() throws JAXRException
返回 JAXR 提供者实现的 BusinessQueryManager 对象。

功能级别：0
return | BusinessQueryManaer
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{BusinessQueryManager}>
directed |
英文文档：

getBusinessQueryManager

BusinessQueryManager getBusinessQueryManager()
                                             throws JAXRException
Returns the BusinessQueryManager object implemented by the JAXR provider.

Capability Level: 0

Returns:
the BusinessQueryManaer
Throws:
JAXRException - If the JAXR provider encounters an internal error

public DeclarativeQueryManager getDeclarativeQueryManager() throws JAXRException, UnsupportedCapabilityException
返回 JAXR 提供者实现的 DeclarativeQueryManager 对象。

功能级别：1
return | DeclarativeQueryManager
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{DeclarativeQueryManager}>
directed |
英文文档：

getDeclarativeQueryManager

DeclarativeQueryManager getDeclarativeQueryManager()
                                                   throws JAXRException,
                                                          UnsupportedCapabilityException
Returns the DeclarativeQueryManager object implemented by the JAXR provider.

Capability Level: 1

Returns:
the DeclarativeQueryManager
Throws:
JAXRException - If the JAXR provider encounters an internal error
UnsupportedCapabilityException

public BulkResponse getBulkResponse(String requestId) throws InvalidRequestException, JAXRException
返回与指定 requestId 关联的 BulkResponse。客户端获取特定 requestId 的 BulkResponse 后，任何获取同一个 requestId 的 Bulkresponse 的后续调用都将导致 InvalidRequestException。

功能级别：0
requestId | 上一个异步请求的 ID
return | 包含指定请求的结果的 BulkResponse
Throws | InvalidRequestException: 如果不存在指定 requestId 的响应
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getBulkResponse

BulkResponse getBulkResponse(String requestId)
                             throws InvalidRequestException,
                                    JAXRException
Returns the BulkResponse associated with specified requestId. Once a client retrieves a BulkResponse for a particular requestId any subsequent calls to retrieve the Bulkresponse for the same requestId should result in an InvalidRequestException.

Capability Level: 0

Parameters:
requestId - the id for a previous asynchronous request
Returns:
the BulkResponse that contains the result for the specified request
Throws:
InvalidRequestException - if no responses exist for specified requestId
JAXRException - If the JAXR provider encounters an internal error

public ClassificationScheme getDefaultPostalScheme() throws JAXRException
获取用来对 PostalAddress 的属性进行编码的默认用户定义邮政方案。

功能级别：0
return | 作为默认邮政方案的 ClassificationScheme
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getDefaultPostalScheme

ClassificationScheme getDefaultPostalScheme()
                                            throws JAXRException
Gets the default user-defined postal scheme for codifying the attributes of PostalAddress.

Capability Level: 0

Returns:
the ClassificationScheme that is the default postal scheme
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String makeRegistrySpecificRequest(String request) throws JAXRException
使用的 String 是特定于注册表的格式的 XML 请求，将该请求发送到注册表，并返回作为特定于注册表的 XML 响应的 String。

功能级别：0
request | String 表示形式的特定于注册表的请求
return | 作为特定于注册表的 XML 响应的 String
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

makeRegistrySpecificRequest

String makeRegistrySpecificRequest(String request)
                                   throws JAXRException
Takes a String that is an XML request in a registry-specific format, sends the request to the registry, and returns a String that is the registry-specific XML response.

Capability Level: 0

Parameters:
request - the registry-specific request in a String representation
Returns:
the String that is the XML response in a registry-specific manner
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ConnectionFactory (Java EE 5)

javax.xml.registry
Class ConnectionFactory

java.lang.Object
    extended by  javax.xml.registry.ConnectionFactory

public abstract class ConnectionFactory
extends Object

此类是用于创建 JAXR 连接的工厂类的抽象基类。JAXR ConnectionFactory 对象是以特定于提供者的方式配置的，用于创建与注册表提供者的连接。

使用 JNDI API 查找 ConnectionFactory

客户端查找 JAXR ConnectionFactory 的首选方法在 Java Naming and Directory InterfaceTM (JNDI) API 中。ConnectionFactory 对象以特定于提供者的方式向命名服务注册，比如基于 JNDI API 的服务。此注册将 ConnectionFactory 对象与逻辑名称关联。当应用程序想与提供者（该提供者与 ConnectionFactory 对象关联）建立连接时，它根据提供的逻辑名称进行查找。然后应用程序可以使用返回的 ConnectionFactory 对象创建与消息传递提供者的连接。

不使用 JNDI API 查找 ConnectionFactory

JAXR API 提供了查找 JAXR ConnectionFactory 的替代方法，该方法不需要使用 JNDI API。此方法对 JAXR API 提供的抽象类 ConnectionFactory 使用 newInstance 静态方法实现查找。newInstance 方法返回一个 JAXR ConnectionFactory。客户端可以定义系统属性 javax.xml.registry.ConnectionFactoryClass，以指示 newInstance 方法应该实例化哪个工厂类。如果没有设置此属性，则 JAXR 提供者必须返回默认 ConnectionFactory 实例。
See also javax.xml.registry.Connection
英文文档：

This is the abstract base class for factory classes for creating a JAXR connection. A JAXR ConnectionFactory object is configured in a provider-specific way to create connections with registry providers.

Looking Up a ConnectionFactory Using the JNDI API

The preferred way for a client to look up a JAXR ConnectionFactory is within the Java Naming and Directory InterfaceTM (JNDI) API. A ConnectionFactory object is registered with a naming service in a provider specific way, such as one based on the JNDI API. This registration associates the ConnectionFactory object with a logical name. When an application wants to establish a connection with the provider associated with that ConnectionFactory object, it does a lookup, providing the logical name. The application can then use the ConnectionFactory object that is returned to create a connection to the messaging provider.

Looking Up a ConnectionFactory Without Using the JNDI API

The JAXR API provides an alternative way to look up a JAXR ConnectionFactory that does not require the use of the JNDI API. This is done using the newInstance static method on the abstract class ConnectionFactory provided in the JAXR API. The newInstance method returns a JAXR ConnectionFactory. The client may indicate which factory class should be instantiated by the newInstance method by defining the system property javax.xml.registry.ConnectionFactoryClass. If this property is not set, the JAXR provider must return a default ConnectionFactory instance.

Author:
Farrukh S. Najmi
See Also:
Connection

Constructor Summary
ConnectionFactory()
Method Summary
abstract Connection | createConnection() Create a named connection.
abstract FederatedConnection | createFederatedConnection(Collection connections) Create a FederatedConnection.
abstract Properties | getProperties() Gets the Properties used during createConnection and createFederatedConnection calls.
static ConnectionFactory | newInstance() Creates a default ConnectionFactory object.
abstract void | setProperties(Properties properties) Sets the Properties used during createConnection and createFederatedConnection calls.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public ConnectionFactory()
英文文档：

ConnectionFactory

public ConnectionFactory()
Method Detail

abstract public void setProperties(java.util.Properties properties) throws JAXRException
设置调用 createConnection 和 createFederatedConnection 期间使用的属性。

标准连接属性：
javax.xml.registry.queryManagerURL - 用于目标注册表提供者中的查询管理器服务的 URL String
javax.xml.registry.lifeCycleManagerURL - 用于目标注册表提供者中的生命周期管理器服务的 URL String。如果未指定，则必须使用上文描述的 queryManagerURL 的默认值
javax.xml.registry.semanticEquivalences - 遵守语义等价规范的 String
javax.xml.registry.security.authenticationMethod - 为 JAXR 提供者提供提示的 String，该提示关于使用注册表提供者进行验证时将使用的验证方法。可能的值包括但不限于 "UDDI_GET_AUTHTOKEN"、"HTTP_BASIC"、"CLIENT_CERTIFICATE" 和 "MS_PASSPORT"
javax.xml.registry.uddi.maxRows - 指定将为查找操作返回的最大行数的整数。此属性特定于 UDDI 提供者
javax.xml.registry.postalAddressScheme - 指定 ClassificationScheme ID 的 String，该 ClassificationScheme 用作此连接的默认邮政地址方案

功能级别：0
properties | 配置属性，该属性由 JAXR 规范指定，也可以是特定于提供者的。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setProperties

public abstract void setProperties(Properties properties)
                            throws JAXRException
Sets the Properties used during createConnection and createFederatedConnection calls.

Standard Connection Properties:
javax.xml.registry.queryManagerURL - URL String for the query manager service within the target registry provider
javax.xml.registry.lifeCycleManagerURL - URL String for the life cycle manager service within the target registry provider. If unspecified, must default to value of the queryManagerURL described above
javax.xml.registry.semanticEquivalences - String that allows specification of semantic equivalences
javax.xml.registry.security.authenticationMethod - string that provides a hint to the JAXR provider on the authentication method to be used when authenticating with the registry provider. Possible value include but are not limited to "UDDI_GET_AUTHTOKEN", "HTTP_BASIC", "CLIENT_CERTIFICATE", "MS_PASSPORT"
javax.xml.registry.uddi.maxRows - integer that specifies the maximum number of rows to be returned for find operations. This property is specific for UDDI providers
javax.xml.registry.postalAddressScheme - String that specifies the id of a ClassificationScheme that is used as the default postal address scheme for this connection

Capability Level: 0

Parameters:
properties - configuration properties that are either specified by JAXR specification or are provider specific.
Throws:
JAXRException - If the JAXR provider encounters an internal error

abstract public java.util.Properties getProperties() throws JAXRException
获取调用 createConnection 和 createFederatedConnection 期间使用的属性。

功能级别：0
return | 为此对象定义的属性
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getProperties

public abstract Properties getProperties()
                                  throws JAXRException
Gets the Properties used during createConnection and createFederatedConnection calls.

Capability Level: 0

Returns:
the Properties defined for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

abstract public Connection createConnection() throws JAXRException
创建指定连接。这类连接可用于与 JAXR 提供者进行通信。

功能级别：0
return | 此调用创建的 Connection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
link
en
dependency
label
en
creates
associates | <{Connection}>
英文文档：

createConnection

public abstract Connection createConnection()
                                     throws JAXRException
Create a named connection. Such a connection can be used to communicate with a JAXR provider.

Capability Level: 0

Returns:
the Connection created by this call
Throws:
JAXRException - If the JAXR provider encounters an internal error

abstract public FederatedConnection createFederatedConnection(java.util.Collection<E> connections) throws JAXRException
创建一个 FederatedConnection。

功能级别：0（可选）
connections | Connection 对象所组成的 Collection。注意，Connection 对象也可以是 FederatedConnection 对象。
return | 此调用创建的 FederatedConnection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
link
en
dependency
label
en
creates
associates | <{Federation}>
英文文档：

createFederatedConnection

public abstract FederatedConnection createFederatedConnection(Collection connections)
                                                       throws JAXRException
Create a FederatedConnection.

Capability Level: 0 (optional)

Parameters:
connections - Is a Collection of Connection objects. Note that Connection objects may also be FederatedConnection objects.
Returns:
the FederatedConnection created by this call
Throws:
JAXRException - If the JAXR provider encounters an internal error

public static ConnectionFactory newInstance() throws JAXRException
创建默认 ConnectionFactory 对象。
return | 新的 ConnectionFactory 实例
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

newInstance

public static ConnectionFactory newInstance()
                                     throws JAXRException
Creates a default ConnectionFactory object.

Returns:
a new instance of a ConnectionFactory
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeleteException (Java EE 5)

javax.xml.registry
Class DeleteException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
                extended by  javax.xml.registry.RegistryException
                    extended by  javax.xml.registry.DeleteException
All Implemented Interfaces:
Serializable, JAXRResponse
public class DeleteException
extends RegistryException

Extends: Throwable > Exception > JAXRException > RegistryException

执行 delete 操作期间发生的 RegistryException。
英文文档：

A RegistryException that occurs during a delete action.

Author:
Farrukh S. Najmi
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.xml.registry.JAXRException
cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
DeleteException()
Constructs a JAXRException object with no reason or embedded Throwable.
DeleteException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
DeleteException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
DeleteException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Methods inherited from class javax.xml.registry.RegistryException
getErrorObjectKey, setErrorObjectKey
Methods inherited from class javax.xml.registry.JAXRException
getCause, getMessage, getRequestId, getStatus, initCause, isAvailable
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public DeleteException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

DeleteException

public DeleteException()
Constructs a JAXRException object with no reason or embedded Throwable.

public DeleteException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

DeleteException

public DeleteException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public DeleteException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

DeleteException

public DeleteException(String reason,
                       Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public DeleteException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

DeleteException

public DeleteException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FindException (Java EE 5)

javax.xml.registry
Class FindException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
                extended by  javax.xml.registry.RegistryException
                    extended by  javax.xml.registry.FindException
All Implemented Interfaces:
Serializable, JAXRResponse
public class FindException
extends RegistryException

Extends: Throwable > Exception > JAXRException > RegistryException

执行 find 操作期间发生的 RegistryException。
英文文档：

A RegistryException that occurs during a find action.

Author:
Farrukh S. Najmi
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.xml.registry.JAXRException
cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
FindException()
Constructs a JAXRException object with no reason or embedded Throwable.
FindException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
FindException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
FindException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Methods inherited from class javax.xml.registry.RegistryException
getErrorObjectKey, setErrorObjectKey
Methods inherited from class javax.xml.registry.JAXRException
getCause, getMessage, getRequestId, getStatus, initCause, isAvailable
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public FindException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

FindException

public FindException()
Constructs a JAXRException object with no reason or embedded Throwable.

public FindException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

FindException

public FindException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public FindException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

FindException

public FindException(String reason,
                     Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public FindException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

FindException

public FindException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InvalidRequestException (Java EE 5)

javax.xml.registry
Class InvalidRequestException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
                extended by  javax.xml.registry.InvalidRequestException
All Implemented Interfaces:
Serializable, JAXRResponse
public class InvalidRequestException
extends JAXRException

Extends: Throwable > Exception > JAXRException

当 JAXR 客户端试图调用由于某种原因而无效的 API 方法时，抛出此异常。
英文文档：

This exception is thrown when a JAXR client attempts to invoke an API method that is not valid for some reason.

Author:
Farrukh S. Najmi
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.xml.registry.JAXRException
cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
InvalidRequestException()
Constructs a JAXRException object with no reason or embedded Throwable.
InvalidRequestException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
InvalidRequestException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
InvalidRequestException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Methods inherited from class javax.xml.registry.JAXRException
getCause, getMessage, getRequestId, getStatus, initCause, isAvailable
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public InvalidRequestException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

InvalidRequestException

public InvalidRequestException()
Constructs a JAXRException object with no reason or embedded Throwable.

public InvalidRequestException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

InvalidRequestException

public InvalidRequestException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public InvalidRequestException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

InvalidRequestException

public InvalidRequestException(String reason,
                               Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public InvalidRequestException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

InvalidRequestException

public InvalidRequestException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXRException (Java EE 5)

javax.xml.registry
Class JAXRException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
All Implemented Interfaces:
Serializable, JAXRResponse
Direct Known Subclasses:
InvalidRequestException, RegistryException, UnexpectedObjectException, UnsupportedCapabilityException
public class JAXRException
extends Exception
implements JAXRResponse

Extends: Throwable > Exception
Implements: JAXRResponse
Extended by: InvalidRequestException, RegistryException, UnexpectedObjectException, UnsupportedCapabilityException

表示发生了 JAXR 异常。除了标准原因 String 之外，该异常不包含其他成员。
See also javax.xml.registry.JAXRResponse
英文文档：

Signals that a JAXR exception has occurred. It contains no members other than the standard reason String.

Author:
Nicholas Kassem, Mark Hapner, Rajiv Mordani, Farrukh Najmi
See Also:
JAXRResponse, Serialized Form

Field Summary
protected  Throwable cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
JAXRException()
Constructs a JAXRException object with no reason or embedded Throwable.
JAXRException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
JAXRException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
JAXRException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Throwable | getCause() Returns the Throwable embedded in this JAXRException if there is one.
String | getMessage() Returns the detail message for this JAXRException object.
String | getRequestId() Returns the unique id for the request that generated this response.
int | getStatus() Returns the status for this response.
Throwable | initCause(Throwable cause) Initializes the cause of this throwable to the specified value.
boolean | isAvailable() Returns true if a response is available, false otherwise.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

cause

protected Throwable cause
Constructor Detail

public JAXRException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

JAXRException

public JAXRException()
Constructs a JAXRException object with no reason or embedded Throwable.

public JAXRException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

JAXRException

public JAXRException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public JAXRException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

JAXRException

public JAXRException(String reason,
                     Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public JAXRException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

JAXRException

public JAXRException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Method Detail

public String getMessage()
返回此 JAXRException 对象的详细消息。

如果有嵌入的 Throwable，并且 JAXRException 对象没有自己的详细消息，则此方法将返回嵌入 Throwable 中的详细消息。

return 此 JAXRException 的错误或警告消息；如果没有此类消息，则返回嵌入 Throwable（如果有）的消息
英文文档：

getMessage

public String getMessage()
Returns the detail message for this JAXRException object.

If there is an embedded Throwable, and if the JAXRException object has no detail message of its own, this method will return the detail message from the embedded Throwable.

Overrides:
getMessage in class Throwable
Returns:
the error or warning message for this JAXRException or, if it has none, the message of the embedded Throwable, if there is one

public Throwable getCause()
返回此 JAXRException 中嵌入的 Throwable（如果有）。否则，此方法返回 null。
return 嵌入的 Throwable；如果不存在嵌入的 Throwable，则返回 null
英文文档：

getCause

public Throwable getCause()
Returns the Throwable embedded in this JAXRException if there is one. Otherwise, this method returns null.

Overrides:
getCause in class Throwable
Returns:
the embedded Throwable or null if there is none

public Throwable initCause(Throwable cause)
将此 throwable 的cause（原因） 初始化为指定值。（cause 是导致抛出此 throwable 的 throwable。）

此方法最多可以调用一次。此方法通常从构造方法中调用，或者在创建 throwable 后立即调用。如果此 throwable 是通过 #JAXRException(Throwable) 或 #JAXRException(String,Throwable) 创建的，则此方法一次也不能调用。

cause | 原因（保存此原因，以便以后通过 #getCause() 方法获取它）。 （允许该参数为 null 值，指出原因是不存在的或是未知的。）
return | 对此 Throwable 实例的引用。
Throws | IllegalArgumentException: 如果 cause 是此抛出对象。（抛出对象不能是它自己的原因。）
Throws | IllegalStateException: 如果此 throwable 是通过 #JAXRException(Throwable) 或 #JAXRException(String,Throwable) 创建的，或者已经对此 throwable 调用了此方法。
英文文档：

initCause

public Throwable initCause(Throwable cause)
Initializes the cause of this throwable to the specified value. (The cause is the throwable that caused this throwable to get thrown.)

This method can be called at most once. It is generally called from within the constructor, or immediately after creating the throwable. If this throwable was created with JAXRException(Throwable) or JAXRException(String,Throwable), this method cannot be called even once.

Overrides:
initCause in class Throwable
Parameters:
cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Returns:
a reference to this Throwable instance.
Throws:
IllegalArgumentException - if cause is this throwable. (A throwable cannot be its own cause.)
IllegalStateException - if this throwable was created with JAXRException(Throwable) or JAXRException(String,Throwable), or this method has already been called on this throwable.

public String getRequestId()
英文文档：

getRequestId

public String getRequestId()
Description copied from interface: JAXRResponse
Returns the unique id for the request that generated this response.

Capability Level: 0

Specified by:
getRequestId in interface JAXRResponse
Returns:
the request id

public int getStatus()
英文文档：

getStatus

public int getStatus()
Description copied from interface: JAXRResponse
Returns the status for this response.

Capability Level: 0

Specified by:
getStatus in interface JAXRResponse
Returns:
the status which is an integer enumerated value
See Also:
JAXRResponse.STATUS_SUCCESS

public boolean isAvailable() throws JAXRException
如果响应是可用的，则返回 true，否则返回 false。这是一个轮询方法，不得阻塞。
英文文档：

isAvailable

public boolean isAvailable()
                    throws JAXRException
Returns true if a response is available, false otherwise. This is a polling method and must not block.

Specified by:
isAvailable in interface JAXRResponse
Returns:
true if the response is available; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RegistryException (Java EE 5)

javax.xml.registry
Class RegistryException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
                extended by  javax.xml.registry.RegistryException
All Implemented Interfaces:
Serializable, JAXRResponse
Direct Known Subclasses:
DeleteException, FindException, SaveException
public class RegistryException
extends JAXRException

Extends: Throwable > Exception > JAXRException
Extended by: DeleteException, FindException, SaveException

此类是所有在注册表提供者端（而不是 JAXR 客户端）检测到的 Exception 的公共基类。
英文文档：

This is the common base class for all Exceptions that are detected on the registry provider side rather than the JAXR client side.

Author:
Farrukh S. Najmi
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.xml.registry.JAXRException
cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
RegistryException()
Constructs a JAXRException object with no reason or embedded Throwable.
RegistryException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
RegistryException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
RegistryException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Key | getErrorObjectKey() Gets the Key to the first object that encountered an error in the registry.
void | setErrorObjectKey(Key key) Sets the Key to the first object that encountered an error in the registry.
Methods inherited from class javax.xml.registry.JAXRException
getCause, getMessage, getRequestId, getStatus, initCause, isAvailable
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public RegistryException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

RegistryException

public RegistryException()
Constructs a JAXRException object with no reason or embedded Throwable.

public RegistryException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

RegistryException

public RegistryException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public RegistryException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

RegistryException

public RegistryException(String reason,
                         Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public RegistryException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

RegistryException

public RegistryException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Method Detail

public Key getErrorObjectKey() throws JAXRException
获取注册表中遇到错误的第一个对象的 Key。
return 第一个出错对象的键
英文文档：

getErrorObjectKey

public Key getErrorObjectKey()
                      throws JAXRException
Gets the Key to the first object that encountered an error in the registry.

Returns:
the key to the first object in error
Throws:
JAXRException

public void setErrorObjectKey(Key key) throws JAXRException
设置注册表中遇到错误的第一个对象的 Key。
key 第一个出错对象的键
英文文档：

setErrorObjectKey

public void setErrorObjectKey(Key key)
                       throws JAXRException
Sets the Key to the first object that encountered an error in the registry.

Parameters:
key - the key to the first object in error
Throws:
JAXRException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SaveException (Java EE 5)

javax.xml.registry
Class SaveException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
                extended by  javax.xml.registry.RegistryException
                    extended by  javax.xml.registry.SaveException
All Implemented Interfaces:
Serializable, JAXRResponse
public class SaveException
extends RegistryException

Extends: Throwable > Exception > JAXRException > RegistryException

执行 save 操作期间发生的 RegistryException。
英文文档：

A RegistryException that occurs during a save action.

Author:
Farrukh S. Najmi
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.xml.registry.JAXRException
cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
SaveException()
Constructs a JAXRException object with no reason or embedded Throwable.
SaveException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
SaveException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
SaveException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Methods inherited from class javax.xml.registry.RegistryException
getErrorObjectKey, setErrorObjectKey
Methods inherited from class javax.xml.registry.JAXRException
getCause, getMessage, getRequestId, getStatus, initCause, isAvailable
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public SaveException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

SaveException

public SaveException()
Constructs a JAXRException object with no reason or embedded Throwable.

public SaveException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

SaveException

public SaveException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public SaveException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

SaveException

public SaveException(String reason,
                     Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public SaveException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

SaveException

public SaveException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnexpectedObjectException (Java EE 5)

javax.xml.registry
Class UnexpectedObjectException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
                extended by  javax.xml.registry.UnexpectedObjectException
All Implemented Interfaces:
Serializable, JAXRResponse
public class UnexpectedObjectException
extends JAXRException

Extends: Throwable > Exception > JAXRException

当 JAXR 提供者发现用户请求上下文中某个 Object 位于错误位置或属于错误类型时，抛出此异常。例如，如果 BusinessLifeCycleManager 中的 saveOrganizations 请求发现请求保存了不属于客户端提供的 Object 所组成的 Collection 中的对象，那么它将抛出此 Exception。
英文文档：

This exception is thrown when the JAXR provider finds a Object that is out-of-place or of the wrong type within the context of a user request. For example a saveOrganizations request in BusinessLifeCycleManager would throw this Exception if it found an Object other than Organization in the Collection of Objects provided by client to be saved by the request.

Author:
Farrukh S. Najmi
See Also:
Serialized Form

Field Summary
Fields inherited from class javax.xml.registry.JAXRException
cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
UnexpectedObjectException()
Constructs a JAXRException object with no reason or embedded Throwable.
UnexpectedObjectException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
UnexpectedObjectException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
UnexpectedObjectException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Methods inherited from class javax.xml.registry.JAXRException
getCause, getMessage, getRequestId, getStatus, initCause, isAvailable
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public UnexpectedObjectException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

UnexpectedObjectException

public UnexpectedObjectException()
Constructs a JAXRException object with no reason or embedded Throwable.

public UnexpectedObjectException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

UnexpectedObjectException

public UnexpectedObjectException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public UnexpectedObjectException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

UnexpectedObjectException

public UnexpectedObjectException(String reason,
                                 Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public UnexpectedObjectException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

UnexpectedObjectException

public UnexpectedObjectException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


UnsupportedCapabilityException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.registry
Class UnsupportedCapabilityException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.registry.JAXRException
                extended by  javax.xml.registry.UnsupportedCapabilityException
All Implemented Interfaces:
Serializable, JAXRResponse
public class UnsupportedCapabilityException
extends JAXRException

Extends: Throwable > Exception > JAXRException

当 JAXR 客户端试图调用功能配置文件（受 JAXR 提供者支持）不支持的 API 方法时，必须抛出此异常。
See also javax.xml.registry.RegistryService
英文文档：

This exception must be thrown when a JAXR client attempts to invoke an API method that is not supported by the capability profile that is supported by the JAXR provider.

Author:
Farrukh S. Najmi
See Also:
RegistryService, Serialized Form

Field Summary
Fields inherited from class javax.xml.registry.JAXRException
cause
Fields inherited from interface javax.xml.registry.JAXRResponse
STATUS_FAILURE, STATUS_SUCCESS, STATUS_UNAVAILABLE, STATUS_WARNING
Constructor Summary
UnsupportedCapabilityException()
Constructs a JAXRException object with no reason or embedded Throwable.
UnsupportedCapabilityException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
UnsupportedCapabilityException(String reason, Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
UnsupportedCapabilityException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.
Method Summary
Methods inherited from class javax.xml.registry.JAXRException
getCause, getMessage, getRequestId, getStatus, initCause, isAvailable
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public UnsupportedCapabilityException()
构造不带原因或嵌入 Throwable 的 JAXRException 对象。
英文文档：

UnsupportedCapabilityException

public UnsupportedCapabilityException()
Constructs a JAXRException object with no reason or embedded Throwable.

public UnsupportedCapabilityException(String reason)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

UnsupportedCapabilityException

public UnsupportedCapabilityException(String reason)
Constructs a JAXRException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public UnsupportedCapabilityException(String reason, Throwable cause)
构造一个 JAXRException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的 Throwable。
reason | 对导致异常的原因的描述
cause | 将嵌入此 JAXRException 对象的 Throwable 对象
英文文档：

UnsupportedCapabilityException

public UnsupportedCapabilityException(String reason,
                                      Throwable cause)
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this JAXRException object

public UnsupportedCapabilityException(Throwable cause)
构造使用给定 Throwable 对象初始化的 JAXRException 对象。
cause 导致此 Exception 的 Throwable
英文文档：

UnsupportedCapabilityException

public UnsupportedCapabilityException(Throwable cause)
Constructs a JAXRException object initialized with the given Throwable object.

Parameters:
cause - the Throwable that caused this Exception
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.registry.infomodel (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.registry.infomodel

This package describes the information model for the JAXR API.

See:
Description

Interface Summary
Association | A RegistryObject instance may be associated with zero or more RegistryObject instances.
AuditableEvent | AuditableEvent instances provide a long term record of events that effect a change of state in a RegistryObject.
Classification | The Classification interface is used to classify RegistryObject instances.
ClassificationScheme | A ClassificationScheme instance represents a taxonomy that may be used to classify or categorize RegistryObject instances.
Concept | The Concept interface is used to represent taxonomy elements and their structural relationship with each other in order to describe an internal taxonomy.
EmailAddress | Represents an email address.
ExtensibleObject | An ExtensibleObject is one that allows itself to be extended by utilizing dynamically added Slots that add arbitrary attributes to the object on a per instance basis.
ExternalIdentifier | ExternalIdentifier instances provide the additional identifier information to RegistryObjects such as DUNS number, Social Security Number, or an alias name of the organization.
ExternalLink | ExternalLink instances model a named URI to content that may reside outside the registry.
ExtrinsicObject | ExtrinsicObjects provide metadata that describes submitted content whose type is not intrinsically known to the registry and therefore must be described by means of additional attributes (e.g., mime type).
InternationalString | This interface represents a String that has been internationalized into several Locales.
Key | Represents a unique key that identifies a RegistryObject.
LocalizedString | This interface is used as a simple wrapper interface that associates a String with its Locale.
Organization | Organization instances provide information on organizations such as a Submitting Organization.
PersonName | Represents a person's name.
PostalAddress | PostalAddress is a simple re-usable entity class that defines attributes of a postal Address.
RegistryEntry | The RegistryEntry interface is a base interface for interfaces in the model that require additional metadata beyond what is provided by the RegistryObject interface.
RegistryObject | The RegistryObject class is an abstract base class used by most classes in the model.
RegistryPackage | RegistryPackage instances are RegistryEntries that group logically related RegistryEntries together.
Service | Service instances are RegistryObjects that provide information on services (for example, web services) offered by an Organization.
ServiceBinding | ServiceBinding instances are RegistryObjects that represent technical information on a specific way to access a specific interface offered by a Service instance.
Slot | Slot instances provide a dynamic way to add arbitrary attributes to RegistryObject instances.
SpecificationLink | A SpecificationLink provides the linkage between a ServiceBinding and one of its technical specifications that describes how to use the service using the ServiceBinding.
TelephoneNumber | A simple re-usable entity class that defines attributes of a telephone number.
URIValidator | Defines common behavior expected of any class that validates URIs.
User | User instances are RegistryObjects that are used to provide information about registered users within the registry.
Versionable | The Versionable interface defines the behavior common to classes that are capable of creating versions of their instances.

Package javax.xml.registry.infomodel Description

This package describes the information model for the JAXR API. It is based largely on the ebXML Registry Information Model with enhancements to support other registry specifications such as UDDI.

The class diagram in Figure 1 shows the public view of the information model.

Information Model Public View
Figure 1. Information Model Public View

The class diagram in Figure 2 shows the inheritance view of the information model.

Information Model Detailed View
Figure 2. Information Model Detailed View

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.registry.infomodel Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.registry.infomodel

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.xml.registry.infomodel.EmailAddress
  • javax.xml.registry.infomodel.ExtensibleObject
    • javax.xml.registry.infomodel.PostalAddress
    • javax.xml.registry.infomodel.RegistryObject
      • javax.xml.registry.infomodel.Association
      • javax.xml.registry.infomodel.AuditableEvent
      • javax.xml.registry.infomodel.Classification
      • javax.xml.registry.infomodel.Concept
      • javax.xml.registry.infomodel.ExternalIdentifier
      • javax.xml.registry.infomodel.ExternalLink (also extends javax.xml.registry.infomodel.URIValidator)
      • javax.xml.registry.infomodel.Organization
      • javax.xml.registry.infomodel.RegistryEntry (also extends javax.xml.registry.infomodel.Versionable)
        • javax.xml.registry.infomodel.ClassificationScheme
        • javax.xml.registry.infomodel.ExtrinsicObject
        • javax.xml.registry.infomodel.RegistryPackage
        • javax.xml.registry.infomodel.Service
      • javax.xml.registry.infomodel.ServiceBinding (also extends javax.xml.registry.infomodel.URIValidator)
      • javax.xml.registry.infomodel.SpecificationLink
      • javax.xml.registry.infomodel.User
  • javax.xml.registry.infomodel.InternationalString
  • javax.xml.registry.infomodel.Key
  • javax.xml.registry.infomodel.LocalizedString
  • javax.xml.registry.infomodel.PersonName
  • javax.xml.registry.infomodel.Slot
  • javax.xml.registry.infomodel.TelephoneNumber
  • javax.xml.registry.infomodel.URIValidator
    • javax.xml.registry.infomodel.ExternalLink (also extends javax.xml.registry.infomodel.RegistryObject)
    • javax.xml.registry.infomodel.ServiceBinding (also extends javax.xml.registry.infomodel.RegistryObject)
  • javax.xml.registry.infomodel.Versionable
    • javax.xml.registry.infomodel.RegistryEntry (also extends javax.xml.registry.infomodel.RegistryObject)
      • javax.xml.registry.infomodel.ClassificationScheme
      • javax.xml.registry.infomodel.ExtrinsicObject
      • javax.xml.registry.infomodel.RegistryPackage
      • javax.xml.registry.infomodel.Service
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Association (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.registry.infomodel
Interface Association

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface Association
extends RegistryObject

Implements: RegistryObject

RegistryObject 实例可以与 0 个或多个 RegistryObject 实例关联。信息模型定义一个 Association 接口，可以使用该接口的实例将任意两个 RegistryObject 实例关联。

Association 的示例

这种关联的一个示例如下：在两个 ClassificationScheme 实例之间，其中一个 ClassificationScheme 替代了另一个 ClassificationScheme，如图 1 所示。在提交一个 ClassificationScheme 新版本时可能出现这种情况。在图 1 中，可以看到新版 NAICS ClassificationScheme 与旧版 NAICS ClassificationScheme 之间的 Association 是如何定义的。

RegistryObject Association 的示例
图 1. RegistryObject Association 的示例

源对象和目标对象

Association 实例表示源 RegistryObject 与目标 RegistryObject 之间的关联。它们分别称为 Association 实例的 sourceObject 和 targetObject。在确定 Association 的方向语义时，了解哪个对象是 sourceObject 以及哪个对象是 targetObject 非常重要。在图 1 的示例中，重点在于用较新版本的 NAICS ClassificationScheme 作为 sourceObject，用较旧版本的 NAICS ClassificationScheme 作为 targetObject，因为 associationType 意味着使用 sourceObject 替代 targetObject（而非相反）。

Association 类型

每个 Association 都必须有一个标识关联类型的 associationType 属性。associationType 属性是枚举 Concept 的引用，枚举 Concept 由 JAXR 规范中的预定义 associationType ClassificationScheme 定义。我们的示例使用了名为 Supersedes 的预定义 associationType Concept。

内部 Association

Association 接口最常见的用法是：User "u" 创建了两个 RegistryObject "o1" 和 "o2" 之间的 Association "a"，其中 Association "a" 以及 RegistryObject "o1" 和 "o2" 都是由同一 User "u" 创建的对象。这是最简单的一种用法，其中的关联在定义 Association 的用户所拥有的两个对象之间。这种关联称为内部关联 (intramural association)。图 2 扩展了上面图 1 中的示例，作为内部关联的例子。

内部 Association 的示例
图 2. 内部 Association 的示例

外部 Association

信息模型还支持更复杂的用法：User "u1" 创建了两个 RegistryObject "o1" 和 "o2" 之间的 Association "a"，其中 Association "a" 归 User "u1" 所有，但 RegistryObject "o1" 和 "o2" 则分别归 User "u2" 和 User "u3" 所有。这种用法中的 Association 如下：拥有所关联的一个或两个对象的 User 与定义 Association 的 User 不同。这种关联称为外部关联 (extramural association)。Association 接口提供了一个称为 isExtramural 的便捷方法，如果 Association 实例是外部 Association，则该方法返回 true。图 3 扩展了上面图 1 中的示例，作为外部关联的例子。注意，外部关联可能有两个不同的 User，而不是图 3 中所示的三个。在这种情况下，其中一个用户拥有所涉及的三个对象（Association、sourceObject 和 targetObject）中的两个。

外部 Association 的示例
图 3. 外部 Association 的示例

Association 的确认

关联可能需要由 Association 所涉及对象的拥有方进行确认。这一节描述所涉及的各方进行关联确认的语义。

内部 Association 的确认

内部关联可以被视为事实声明，不需要明确的步骤来确认 Association 的真实性。换句话说，内部关联隐式地认为已经经过了确认。

外部 Association 的确认

外部关联可以被视为单方面断言，直到其他（外部）方（示例中的 User "u2" 和 "u3"）确认之后才认为它是真实的。拥有 sourceObject 或 targetObject 的外部方可能会调用 BusinessLifeCycleManager 接口的 confirmAssociation 方法。

未经确认的 Association 的可见性

外部关联要求，若要外部 Association 对该 Association 中未涉及的第三方可见，它所做的断言必须经过每个外部方的确认。这样可以确保未经确认的 Association 对于第三方注册客户端是不可见的。

可能的确认状态

假定大多数情况下，一个外部 Association 有三个不同的 User 实例，如图 3 所示。若要获得完全确认，需要所有其他（外部）方（示例中的 User "u2" 和 "u3"）都确认该外部 Association。Association 接口中的方法 isConfirmedBySourceOwner 和 isConfiremedByTargetOwner 可以访问 sourceObject 和 targetObject 的确认状态。名为 isConfirmed 的第三个便捷方法提供了确定 Association 是否得到完全确认的方式。因此，外部 Association 的确认状态存在以下四种可能：
  • Association 既没有经过 sourceObject 所有者的确认，也没有经过 targetObject 所有者的确认。
  • Association 经过了 sourceObject 所有者的确认，但没有经过 targetObject 所有者的确认。
  • Association 没有经过 sourceObject 所有者的确认，但经过了 targetObject 所有者的确认。
  • Association 经过了 sourceObject 所有者的确认，也经过了 targetObject 所有者的确认。这是 Association 经过了完全确认的唯一状态。
See also javax.xml.registry.infomodel.RegistryObject
英文文档：

A RegistryObject instance may be associated with zero or more RegistryObject instances. The information model defines an Association interface, an instance of which may be used to associate any two RegistryObject instances.

Example of an Association

One example of such an association is between two ClassificationScheme instances, where one ClassificationScheme supersedes the other ClassificationScheme as shown in Figure 1. This may be the case when a new version of a ClassificationScheme is submitted. In Figure 1, we see how an Association is defined between a new version of the NAICS ClassificationScheme and an older version of the NAICS ClassificationScheme.

Example of RegistryObject Association
Figure 1. Example of RegistryObject Association

Source and Target Objects

An Association instance represents an association between a source RegistryObject and a target RegistryObject. These are referred to as sourceObject and targetObject for the Association instance. It is important which object is the sourceObject and which is the targetObject as it determines the directional semantics of an Association. In the example in Figure 1, it is important to make the newer version of NAICS ClassificationScheme be the sourceObject and the older version of NAICS be the targetObject because the associationType implies that the sourceObject supersedes the targetObject (and not the other way around).

Association Types

Each Association must have an associationType attribute that identifies the type of that association. The associationType attribute is a reference to an enumeration Concept as defined by the predefined associationType ClassificationScheme in the JAXR specification. Our example uses the pre-defined associationType Concept named Supersedes.

Intramural Associations

A common use case for the Association interface is when a User "u" creates an Association "a" between two RegistryObjects "o1" and "o2" where association "a" and RegistryObjects "o1" and "o2" are objects that were created by the same User "u". This is the simplest use case where the association is between two objects that are owned by same User that is defining the Association. Such associations are referred to as intramural associations. Figure 2 extends the previous example in Figure 1 for the intramural association case.

Example of Intramural Association
Figure 2. Example of Intramural Association

Extramural Association

The information model also allows a more sophisticated use case where a User "u1" creates an Association "a" between two RegistryObjects "o1" and "o2" where association "a" is owned by User "u1", but RegistryObjects "o1" and "o2" are owned by User "u2" and User "u3" respectively. In this use case the Association is being defined where either or both objects that are being associated are owned by a User different from the User defining the Association. Such associations are referred to as extramural associations. The Association interface provides a convenience method called isExtramural that returns true if the Association instance is an extramural Association. Figure 3 extends the previous example in Figure 1 for the extramural association case. Note that it is possible for an extramural association to have two distinct Users rather than three distinct Users as shown in Figure 3. In such case, one of the two users owns two of the three objects involved (Association, sourceObject and targetObject).

Example of Extramural Association
Figure 3. Example of Extramural Association

Confirmation of an Association

An association may need to be confirmed by the parties whose objects are involved in that Association. This section describes the semantics of confirmation of an association by the parties involved.

Confirmation of Intramural Associations

Intramural associations may be viewed as declarations of truth and do not require any explicit steps to confirm that Association as being true. In other words, intramural associations are implicitly considered be confirmed.

Confirmation of Extramural Associations

Extramural associations may be viewed as a unilateral assertion that may not be viewed as truth until it has been confirmed by the other (extramural) parties (Users "u2" and "u3" in example). The confirmAssociation method on the BusinessLifeCycleManager interface may be called by the extramural parties that own the sourceObject or targetObject.

Visibility of Unconfirmed Associations

Extramural associations require each extramural party to confirm the assertion being made by the extramural Association before the Association is visible to 3rd parties that are not involved in the Association. This ensures that unconfirmed Associations are not visible to 3rd party registry clients.

Possible Confirmation States

Assume the most general case where there are three distinct User instances as shown in Figure 23 for an extramural Association. The extramural Association needs to be confirmed by both the other (extramural) parties (Users "u2" and "u3" in example) in order to be fully confirmed. The methods isConfirmedBySourceOwner and isConfiremedByTargetOwner in the Association interface provide access to confirmation state for both the sourceObject and targetObject. A third convenience method called isConfirmed provides a way to determine whether the Association is fully confirmed or not. So there are the following four possibilities related to confirmation state of an extramural Association:
  • The Association is confirmed neither by the owner of the sourceObject nor is it confirmed by owner of targetObject.
  • The Association is confirmed by the owner of the sourceObject but it is not confirmed by owner of targetObject.
  • The Association is not confirmed by the owner of the sourceObject but it is confirmed by owner of targetObject.
  • The Association is confirmed by the owner of the sourceObject and it is confirmed by owner of targetObject. This is the only state where the Association is fully confirmed.

Author:
Farrukh S. Najmi
See Also:
RegistryObject

Method Summary
Concept | getAssociationType() Gets the association type for this Association.
RegistryObject | getSourceObject() Gets the Object that is the source of this Association.
RegistryObject | getTargetObject() Gets the Object that is the target of this Association.
boolean | isConfirmed() Determines whether an Association has been confirmed completely.
boolean | isConfirmedBySourceOwner() Determines whether an Association has been confirmed by the owner of the source object.
boolean | isConfirmedByTargetOwner() Determines whether an Association has been confirmed by the owner of the target object.
boolean | isExtramural() Determines whether an Association is extramural or not.
void | setAssociationType(Concept associationType) Sets the association type for this Association.
void | setSourceObject(RegistryObject srcObject) Sets the Object that is the source of this Association.
void | setTargetObject(RegistryObject targetObject) Sets the Object that is the target of this Association.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public RegistryObject getSourceObject() throws JAXRException
获取作为此 Association 的源的 Object。

功能级别：0
return | 作为此 Association 的源对象的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getSourceObject

RegistryObject getSourceObject()
                               throws JAXRException
Gets the Object that is the source of this Association.

Capability Level: 0

Returns:
The RegistryObject that is the source object of this Association
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setSourceObject(RegistryObject srcObject) throws JAXRException
设置作为此 Association 的源的 Object。

功能级别：0
srcObject | 作为此 Association 的源对象的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setSourceObject

void setSourceObject(RegistryObject srcObject)
                     throws JAXRException
Sets the Object that is the source of this Association.

Capability Level: 0

Parameters:
srcObject - the RegistryObject that is the source object of this Association
Throws:
JAXRException - If the JAXR provider encounters an internal error

public RegistryObject getTargetObject() throws JAXRException
获取作为此 Association 的目标的 Object。

功能级别：0
return | 作为此 Association 的目标对象的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getTargetObject

RegistryObject getTargetObject()
                               throws JAXRException
Gets the Object that is the target of this Association.

Capability Level: 0

Returns:
The RegistryObject that is the target object of this Association
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setTargetObject(RegistryObject targetObject) throws JAXRException
设置作为此 Association 的目标的 Object。

功能级别：0
targetObject | 作为此 Association 的目标对象的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setTargetObject

void setTargetObject(RegistryObject targetObject)
                     throws JAXRException
Sets the Object that is the target of this Association.

Capability Level: 0

Parameters:
targetObject - the RegistryObject that is the target object of this Association
Throws:
JAXRException - If the JAXR provider encounters an internal error

public Concept getAssociationType() throws JAXRException
获取此 Association 的关联类型。

功能级别：0
return | 此 Association 的关联类型，它是 AssociationType ClassificationScheme 中的一个 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getAssociationType

Concept getAssociationType()
                           throws JAXRException
Gets the association type for this Association.

Capability Level: 0

Returns:
The association type for this Association which is a Concept in the AssociationType ClassificationScheme
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setAssociationType(Concept associationType) throws JAXRException
设置此 Association 的关联类型。

功能级别：0
associationType | 此 Association 的关联类型，它是 AssociationType ClassificationScheme 中的一个 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setAssociationType

void setAssociationType(Concept associationType)
                        throws JAXRException
Sets the association type for this Association.

Capability Level: 0

Parameters:
associationType - the association type for this Association which is a Concept in the AssociationType ClassificationScheme
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isExtramural() throws JAXRException
确定 Association 是否为外部 Association。

如果拥有源和/或目标对象的 User 与创建此外部 Association 的 User 不同，则该外部关联必须由拥有源和/或目标对象的 User 进行确认。若要外部 Association 对第三方可见，sourceObject 和 targetObject 所有者都必须确认它。

功能级别：0
return | 如果拥有 sourceObject 和/或 targetObject 的 User 与创建 Association 的 User 不同，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isExtramural

boolean isExtramural()
                     throws JAXRException
Determines whether an Association is extramural or not.

An Extramural Association must be confirmed by the User(s) that own the source and/or targert object, if they are different from the User who creates this extramural association. Both the sourceObject and targetObject owners must confirm an extramural Association, in order for it to be visible to third parties.

Capability Level: 0

Returns:
true if the sourceObject and/or the targetObject are owned by a User that is different from the User that created the Association; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isConfirmedBySourceOwner() throws JAXRException
确定源对象的所有者是否已经确认了某个 Association。

功能级别：0
return | 如果 sourceObject 的所有者已经确认了关联，则返回 true；否则返回 false。对于内部 Association 总是返回 true
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isConfirmedBySourceOwner

boolean isConfirmedBySourceOwner()
                                 throws JAXRException
Determines whether an Association has been confirmed by the owner of the source object.

Capability Level: 0

Returns:
true if the association has been confirmed by the owner of the sourceObject; false otherwise. For intramural Associations always return true
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isConfirmedByTargetOwner() throws JAXRException
确定目标对象的所有者是否已经确认了某个 Association。

功能级别：0
return | 如果 targetObject 的所有者已经确认了关联，则返回 true；否则返回 false。对于内部 Association 总是返回 true
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isConfirmedByTargetOwner

boolean isConfirmedByTargetOwner()
                                 throws JAXRException
Determines whether an Association has been confirmed by the owner of the target object.

Capability Level: 0

Returns:
true if the association has been confirmed by the owner of the targetObject; false otherwise. For intramural Associations always return true
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isConfirmed() throws JAXRException
确定某个 Association 是否已经完全确认。

仅当 isConfirmed 返回 true 时关联才对第三方（Association 未涉及）可见。

功能级别：0
return | 如果 isConfirmedBySourceOwner 和 isConfirmedByTargetOwner 方法都返回 true，则返回 true；否则返回 false。对于内部 Association 总是返回 true
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | isConfirmedBySourceOwner(), isConfirmedByTargetOwner()
英文文档：

isConfirmed

boolean isConfirmed()
                    throws JAXRException
Determines whether an Association has been confirmed completely.

An association should only be visible to third parties (not involved with the Association) if isConfirmed returns true.

Capability Level: 0

Returns:
true if the isConfirmedBySourceOwner and isConfirmedByTargetOwner methods both return true; false otherwise. For intramural Associations always return true
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
isConfirmedBySourceOwner(), isConfirmedByTargetOwner()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AuditableEvent (Java EE 5)

javax.xml.registry.infomodel
Interface AuditableEvent

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface AuditableEvent
extends RegistryObject

Implements: RegistryObject

AuditableEvent 实例对影响 RegistryObject 状态更改的事件进行长期记录。此类事件通常是客户端发起请求的结果。AuditableEvent 实例由注册表服务生成，用于记录此类事件。

此类事件常常影响 RegistryObject 生命周期中的更改。例如，客户端请求可以对 RegistryObject 执行 Create、Update、Deprecate 或 Delete 操作。对于不改变 RegistryObject 状态的请求，不会创建任何 AuditableEvent。具体来说，只读请求不会生成 AuditableEvent。在将 RegistryObject 归类、分配到某个 Package、与另一个 Object 关联时，不会为此生成任何 AuditableEvent。

RegistryObject 将与某个有序的 AuditableEvent 实例 Collection 关联，这些实例提供了该 Object 完整的审计轨迹。

See also javax.xml.registry.infomodel.RegistryObject
英文文档：

AuditableEvent instances provide a long term record of events that effect a change of state in a RegistryObject. Such events are usually a result of a client initiated request. AuditableEvent instances are generated by the registry service to log such events.

Often such events effect a change in the life cycle of a RegistryObject. For example a client request could Create, Update, Deprecate or Delete a RegistryObject. No AuditableEvent is created for requests that do not alter the state of a RegistryObject. Specifically, read-only requests do not generate an AuditableEvent. No AuditableEvent is generated for a RegistryObject when it is classified, assigned to a Package or associated with another Object.

A RegistryObject is associated with an ordered Collection of AuditableEvent instances that provide a complete audit trail for that Object.

Author:
Farrukh S. Najmi
See Also:
RegistryObject

Field Summary
static int | EVENT_TYPE_CREATED An event where a RegistryObject is created.
static int | EVENT_TYPE_DELETED An event where a RegistryObject is deleted.
static int | EVENT_TYPE_DEPRECATED An event where a RegistryObject is deprecated.
static int | EVENT_TYPE_UNDEPRECATED An event where a RegistryObject is undeprecated.
static int | EVENT_TYPE_UPDATED An event where a RegistryObject is updated.
static int | EVENT_TYPE_VERSIONED An event where a RegistryObject is versioned.
Method Summary
int | getEventType() Gets the type of this event.
RegistryObject | getRegistryObject() Gets the RegistryObject associated with this AuditableEvent.
Timestamp | getTimestamp() Gets the Timestamp for when this event occurred.
User | getUser() Gets the User associated with this object.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Field Detail

英文文档：

EVENT_TYPE_CREATED

static final int EVENT_TYPE_CREATED
An event where a RegistryObject is created.

See Also:
Constant Field Values

英文文档：

EVENT_TYPE_DELETED

static final int EVENT_TYPE_DELETED
An event where a RegistryObject is deleted.

See Also:
Constant Field Values

英文文档：

EVENT_TYPE_DEPRECATED

static final int EVENT_TYPE_DEPRECATED
An event where a RegistryObject is deprecated.

See Also:
Constant Field Values

英文文档：

EVENT_TYPE_UPDATED

static final int EVENT_TYPE_UPDATED
An event where a RegistryObject is updated.

See Also:
Constant Field Values

英文文档：

EVENT_TYPE_VERSIONED

static final int EVENT_TYPE_VERSIONED
An event where a RegistryObject is versioned.

See Also:
Constant Field Values

英文文档：

EVENT_TYPE_UNDEPRECATED

static final int EVENT_TYPE_UNDEPRECATED
An event where a RegistryObject is undeprecated.

See Also:
Constant Field Values
Method Detail

public User getUser() throws JAXRException
获得与此对象关联的 User。

功能级别：1
return | 发送请求生成此 AuditableEvent 的 User。不得为 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
label
en
requestor
supplierCardinality | 1
directed
associates | <{User}>
英文文档：

getUser

User getUser()
             throws JAXRException
Gets the User associated with this object.

Capability Level: 1

Returns:
the User that sent the request that generated this this AuditableEvent. Must not be null
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.sql.Timestamp getTimestamp() throws JAXRException
获取表示此事件发生时间的 Timestamp。

功能级别：1
return | 记录事件发生时间的时间戳
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getTimestamp

Timestamp getTimestamp()
                       throws JAXRException
Gets the Timestamp for when this event occurred.

Capability Level: 1

Returns:
the timestamp that records the time the event occured
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getEventType() throws JAXRException
获取此事件的类型。

功能级别：1
return | 此事件的类型
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | EVENT_TYPE_CREATED
英文文档：

getEventType

int getEventType()
                 throws JAXRException
Gets the type of this event.

Capability Level: 1

Returns:
the type of this event
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
EVENT_TYPE_CREATED

public RegistryObject getRegistryObject() throws JAXRException
获取与此 AuditableEvent 关联的 RegistryObject。

功能级别：1
return | 作为此事件焦点的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRegistryObject

RegistryObject getRegistryObject()
                                 throws JAXRException
Gets the RegistryObject associated with this AuditableEvent.

Capability Level: 1

Returns:
the RegistryObject that was the focus of this event
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Classification (Java EE 5)

javax.xml.registry.infomodel
Interface Classification

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface Classification
extends RegistryObject

Implements: RegistryObject

Classification 接口用于对 RegistryObject 实例进行分类。通过向 RegistryObject 添加 0 个或多个 Classification 实例，可以从多个角度对 RegistryObject 进行分类。例如，Organization 可以根据行业、销售的产品和地理位置进行分类。在此示例中，至少向 RegistryObject 添加了 3 个 Classification 实例。RegistryObject 接口提供了一些 addClassification 方法，使客户端能够向 RegistryObject 添加 Classification 实例。

图 1 展示了 Classification 如何使用 ClassificationScheme 对 RegistryObject 进行分类。

使用 ClassificationScheme 对对象进行分类
图 1. 使用 ClassificationScheme 对对象进行分类

内部分类和外部分类

在 JAXR 提供者中，可以使用以下方式之一表示分类：
  1. 分类元素及其彼此之间的结构关系可从 JAXR 提供者中获得。这种情况称为内部分类 (Internal Taxonomy)，因为 JAXR 提供者可以从内部获得分类结构。
  2. 分类元素及其彼此之间的结构关系在 JAXR 提供者外部的某个地方表示。这种情况称为外部分类 (External Taxonomy)，因为 JAXR 提供者无法从内部获得分类结构。

内部 Classification 和外部 Classification

Classification 接口允许使用 ClassificationScheme 对 RegistryObject 进行分类，不管 ClassificationScheme 表示内部分类还是外部分类。当 Classification 实例使用表示内部分类的 ClassificationScheme 时，它被称为内部 Classification。当 Classification 实例使用表示外部分类的 ClassificationScheme 时，它被称为外部 Classification。

内部 Classification

当 Classification 实例使用内部分类对 RegistryObject 进行分类时，它被称为内部 Classification。若要 Classification 使用内部分类，客户端必须对 Classification 调用 setConcept 方法，并定义对 Classification 实例中 Concept 实例的引用。客户端不必调用 setClassificationScheme 进行内部 Classification，因为分类 Concept 已知其根 ClassificationScheme。

内部 Classification 的示例

图 2 展示了一个使用 Concept 表示分类元素的内部 Classification 示例。该示例使用可用作内部分类的 NAICS 标准分类将 Organization 实例归类为 Book Publisher。注意，为了节省空间，该图没有显示 ?Book Publishers? 节点与 NAICS ClassificationScheme 之间的所有 Concept。假如显示这些 Concept，它们将通过每个 Concept 的父属性链接在一起。

内部 Classification 的示例
图 2. 内部 Classification 的示例

外部 Classification

当 Classification 实例使用外部分类对 RegistryObject 进行分类时，它被称为外部 Classification。客户端必须对 Classification 调用 setValue 方法，并定义一个唯一值，该值在理论上表示外部定义其结构的分类中的某个分类对象。客户端必须对外部 Classification 调用 setClassificationScheme，因为没有其他方式能够推断出表示外部分类的 ClassificationScheme。

外部 Classification 的示例

图 3 展示了一个外部 Classification 示例。该示例使用的场景与 Classification 使用 NAICS 标准分类将 Organization 实例归类为 Book Publisher 时使用的场景相同。但是，此时 JAXR 提供者无法从内部获得 NAICS 分类结构，并因此没有任何 Concept 实例。这时使用 Classification 的名称和值属性准确指定 Book Publisher 的分类元素。注意，名称是可选的，但值是必需的。

外部 Classification 的示例
图 3. 外部 Classification 的示例

多个 Classification 的示例

下一个示例展示了如何通过多个 Classification 方案对 RegistryObject 进行分类。在此例中，使用名为 Industry 和 Geography 的两个内部 ClassificationScheme 对几个 Organization RegistryObject 进行分类（根据其行业和地理位置）。在图 4 中，为了节省空间和提高可读性，没有明确显示 Classification 实例，而是将它隐含在 RegistryObject（阴影显示的叶节点）与相关 Concept 之间的关联中。

多个 Classification 的示例
图 4. 多个 Classification 的示例
See also javax.xml.registry.infomodel.RegistryObject, javax.xml.registry.infomodel.Concept
英文文档：

The Classification interface is used to classify RegistryObject instances. A RegistryObject may be classified along multiple dimensions by adding zero or more Classification instances to the RegistryObject. For example, an Organization may be classified by its industry, by the products it sells and by its geographical location. In this example the RegistryObject would have at least three Classification instances added to it. The RegistryObject interface provides several addClassification methods to allow a client to add Classification instances to a Registry Object.

Figure 1 shows how a Classification classifies a RegistryObject using a ClassificationScheme.

Using a ClassificationScheme to Classify an Object
Figure 1. Using a ClassificationScheme to Classify an Object

Internal vs. External Taxonomies

A taxonomy may be represented within a JAXR provider in one of the following ways:
  1. The taxonomy elements and their structural relationship with each other are available within the JAXR provider. This case is referred to as Internal Taxonomy since the structure of the taxonomy is available internal to the JAXR provider.
  2. The taxonomy elements and their structural relationship with each other is represented somewhere external to the JAXR provider. This case is referred to as External Taxonomy since the structure of the taxonomy is not available to the JAXR provider.

Internal vs. External Classifications

The Classification interface allows the classification of RegistryObjects using a ClassificationScheme whether the ClassificationScheme represents an internal taxonomy or an external taxonomy. When a Classification instance uses a ClassificationScheme representing an internal taxonomy then it is referred to as an internal Classification. When a Classification instance uses a ClassificationScheme representing an external taxonomy then it is referred to as an external Classification.

Internal Classification

When a Classification instance is used to classify a RegistryObject using an internal taxonomy it is referred to as an internal Classification. A client must call the setConcept method on a Classification and define a reference to a Concept instance from the Classification instance in order for that Classification to use an internal taxonomy. It is not necessary for the client to call setClassificationScheme for internal Classifications since the classifying Concept already knows it root ClassificationScheme.

Example of Internal Classification

Figure 2 shows an example of internal classification using a Concept to represent a taxonomy element. The example classifies an Organization instance as a Book Publisher using the NAICS standard taxonomy available as an internal taxonomy. Note that the figure does not show all the Concepts between the ?Book Publishers? node and the NAICS ClassificationScheme to save space. Had they been there they would have been linked together by the parent attribute of each Concept.

Example of Internal Classification
Figure 2. Example of Internal Classification

External Classification

When a Classification instance is used to classify a RegistryObject using an external taxonomy it is referred to as an external Classification. A client must call the setValue method on a Classification and define a unique value that logically represents a taxonomy element within the taxonomy whose structure is defined externally. It is necessary for the client call setClassificationScheme for external Classifications since there is no other way to infer the ClassificationScheme that represents the external taxonomy.

Example of External Classification

Figure 3 shows an example of external classification. The example uses the same scenario where a Classification classifies an Organization instance as a Book Publisher using the NAICS standard taxonomy. However, this time the structure of the NAICS taxonomy is not available internally to the JAXR provider and consequently there is no Concept instance. Instead, the name and value attributes of the Classification are used to pinpoint the Book Publisher's taxonomy element. Note that name is optional but value is required.

Example of External Classification
Figure 3. Example of External Classification

An Example of Multiple Classifications

The next example shows how a RegistryObject may be classified by multiple classification schemes. In this example, two internal ClassificationSchemes named Industry and Geography are used to classify several Organization RegistryObjects by their industry and Geography. In Figure 4, in order to save space and improve readability, the Classification instances are not explicitly shown but are implied as associations between the RegistryObjects (shaded leaf node) and the associated Concepts.

Example of Multiple Classifications
Figure 4. Example of Multiple Classifications

Author:
Farrukh S. Najmi
See Also:
RegistryObject, Concept

Method Summary
ClassificationScheme | getClassificationScheme() Gets the ClassificationScheme that is used in classifying the object.
RegistryObject | getClassifiedObject() Gets the Object that is being classified.
Concept | getConcept() Gets the Concept that is classifying the object.
String | getValue() Gets the taxonomy value for this Classification.
boolean | isExternal() Returns true if this is an external classification.
void | setClassificationScheme(ClassificationScheme classificationScheme) Sets the ClassificationScheme for this external classification.
void | setClassifiedObject(RegistryObject classifiedObject) Sets the object that is being classified.
void | setConcept(Concept concept) Sets the concept for this internal classification.
void | setValue(String value) Sets the taxonomy value for this external Classification.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public Concept getConcept() throws JAXRException
获取对对象进行分类的 Concept。

功能级别：0
return | 对已分类的对象进行分类的 Concept。如果这是一个外部 Classification，则返回 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
clientCardinality | 0..*
associationAsClass
en
Classification
英文文档：

getConcept

Concept getConcept()
                   throws JAXRException
Gets the Concept that is classifying the object.

Capability Level: 0

Returns:
the Concept that is classifying the classified object. null if this is a external Classification
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setConcept(Concept concept) throws JAXRException
设置此内部 Classification 的 Concept。

此方法不能与 setClassificationScheme 方法一起使用。

功能级别：0
concept | 对已分类对象进行分类的 Concept。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setConcept

void setConcept(Concept concept)
                throws JAXRException
Sets the concept for this internal classification.

This method should be used mutually exclusively with the setClassificationScheme method.

Capability Level: 0

Parameters:
concept - the Concept that is classifying the classified object.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public ClassificationScheme getClassificationScheme() throws JAXRException
获取用来对对象进行分类的 ClassificationScheme。如果 Classification 是内部 Classification，则此方法应该返回对表示分类元素的 Concept 调用 getClassificationScheme 方法所返回的值。

功能级别：0
return | 此 Classification 使用的 ClassificationScheme
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{ClassificationScheme}>
supplierCardinality | 0..1
label
en
classificationScheme
See also | javax.xml.registry.infomodel.ClassificationScheme
英文文档：

getClassificationScheme

ClassificationScheme getClassificationScheme()
                                             throws JAXRException
Gets the ClassificationScheme that is used in classifying the object. If the Classification is an internal Classification then this method should return the value returned by calling the getClassificationScheme method on the Concept representing the taxonomy element.

Capability Level: 0

Returns:
the ClassificationScheme used by this Classification
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
ClassificationScheme

public void setClassificationScheme(ClassificationScheme classificationScheme) throws JAXRException
设置此外部 Classification 的 ClassificationScheme。

调用此方法还必须调用 setValue 方法。此方法不能与 setConcept 方法一起使用。

功能级别：0
classificationScheme | 此 Classification 使用的 ClassificationScheme
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setClassificationScheme

void setClassificationScheme(ClassificationScheme classificationScheme)
                             throws JAXRException
Sets the ClassificationScheme for this external classification.

If this method is called then you must also call setValue method. This method should be used mutually exclusively with the setConcept method.

Capability Level: 0

Parameters:
classificationScheme - the ClassificationScheme used by this Classification
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getValue() throws JAXRException
获取此 Classification 的分类值。

功能级别：0
return | 如果是外部 Classification，则返回分类元素的值；如果是内部 Classification，则返回表示分类元素的 Concept 的值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getValue

String getValue()
                throws JAXRException
Gets the taxonomy value for this Classification.

Capability Level: 0

Returns:
the value of the taxonomy element if external Classification; the value of the Concept representing the taxonomy element if internal Classification
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setValue(String value) throws JAXRException
设置此外部 Classification 的分类值。

功能级别：0
value | 此外部 Classification 使用的分类值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValue

void setValue(String value)
              throws JAXRException
Sets the taxonomy value for this external Classification.

Capability Level: 0

Parameters:
value - the taxonomy value used by this external Classification
Throws:
JAXRException - If the JAXR provider encounters an internal error

public RegistryObject getClassifiedObject() throws JAXRException
获取将分类的 Object。

功能级别：0
return | 根据此 Classification 进行分类的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getClassifiedObject

RegistryObject getClassifiedObject()
                                   throws JAXRException
Gets the Object that is being classified.

Capability Level: 0

Returns:
the RegistryObject that is classified by this Classification
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setClassifiedObject(RegistryObject classifiedObject) throws JAXRException
设置将分类的对象。

功能级别：0
classifiedObject | 根据此 Classification 进行分类的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setClassifiedObject

void setClassifiedObject(RegistryObject classifiedObject)
                         throws JAXRException
Sets the object that is being classified.

Capability Level: 0

Parameters:
classifiedObject - the RegistryObject that is classified by this Classification
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isExternal() throws JAXRException
如果这是一个外部 Classification，则返回 true。

功能级别：0
return | 如果这是一个外部 Classification，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isExternal

boolean isExternal()
                   throws JAXRException
Returns true if this is an external classification.

Capability Level: 0

Returns:
true if this is an external Classification; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ClassificationScheme (Java EE 5)

javax.xml.registry.infomodel
Interface ClassificationScheme

All Superinterfaces:
ExtensibleObject, RegistryEntry, RegistryObject, Versionable
public interface ClassificationScheme
extends RegistryEntry

Implements: RegistryEntry

ClassificationScheme 实例表示可用来对 RegistryObject 实例进行分类或归类的分类法。科学中常见的 ClassificationScheme 示例是生物的分类，生物是按树状结构进行归类的。另一个示例是图书馆使用的 Dewey Decimal 系统，它可以对书籍和其他出版物进行归类。电子商务中常见的示例是 North American Industry Classification System (NAICS)，这是一个根据业务和服务所属的行业对它们进行分类的分类方案。

图 1 展示了 Classification 如何使用 ClassificationScheme 对 RegistryObject 进行分类。

使用 ClassificationScheme 对对象进行分类
图 1. 使用 ClassificationScheme 对对象进行分类
英文文档：

A ClassificationScheme instance represents a taxonomy that may be used to classify or categorize RegistryObject instances. A very common example of a classification scheme in science is the Classification of living things where living things are categorized in under a tree like structure. Another example is the Dewey Decimal system used in libraries to categorize books and other publications. A common example in eBusiness is that of North American Industry Classification System (NAICS), which is a classification scheme used to classify businesses and services by the industry to which they belong.

Figure 1 shows how a ClassificationScheme is used by a Classification to classify a RegistryObject.

Using a ClassificationScheme to Classify an Object
Figure 1. Using a ClassificationScheme to Classify an Object

Field Summary
static int | VALUE_TYPE_EMBEDDED_PATH Each taxonomy value in ClassificationScheme embeds the full path from scheme to that Concept.
static int | VALUE_TYPE_NON_UNIQUE Taxonomy values in ClassificationScheme may be repeated within the same scheme.
static int | VALUE_TYPE_UNIQUE Each taxonomy value in ClassificationScheme is unique.
Fields inherited from interface javax.xml.registry.infomodel.RegistryEntry
STABILITY_DYNAMIC, STABILITY_DYNAMIC_COMPATIBLE, STABILITY_STATIC, STATUS_APPROVED, STATUS_DEPRECATED, STATUS_SUBMITTED, STATUS_WITHDRAWN
Method Summary
void | addChildConcept(Concept concept) Adds a child Concept.
void | addChildConcepts(Collection concepts) Adds a Collection of Concept children.
int | getChildConceptCount() Gets number of children.
Collection | getChildrenConcepts() Gets all immediate children Concepts.
Collection | getDescendantConcepts() Gets all descendant Concepts.
int | getValueType() Gets the value type for this object.
boolean | isExternal() Determines whether this ClassificationScheme is an external ClassificationScheme or an internal ClassificationScheme.
void | removeChildConcept(Concept concept) Removes a child Concept.
void | removeChildConcepts(Collection concepts) Removes a Collection of children Concepts.
void | setValueType(int valueType) Sets the value type for this object.
Methods inherited from interface javax.xml.registry.infomodel.RegistryEntry
getExpiration, getStability, getStatus, setExpiration, setStability
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots
Methods inherited from interface javax.xml.registry.infomodel.Versionable
getMajorVersion, getMinorVersion, getUserVersion, setMajorVersion, setMinorVersion, setUserVersion

Field Detail

英文文档：

VALUE_TYPE_UNIQUE

static final int VALUE_TYPE_UNIQUE
Each taxonomy value in ClassificationScheme is unique.

See Also:
Constant Field Values

英文文档：

VALUE_TYPE_EMBEDDED_PATH

static final int VALUE_TYPE_EMBEDDED_PATH
Each taxonomy value in ClassificationScheme embeds the full path from scheme to that Concept. This also implies that each taxonomy value is unique.

See Also:
Constant Field Values

英文文档：

VALUE_TYPE_NON_UNIQUE

static final int VALUE_TYPE_NON_UNIQUE
Taxonomy values in ClassificationScheme may be repeated within the same scheme. However, two Concepts that have the same parent cannot have the same value.

See Also:
Constant Field Values
Method Detail

public void addChildConcept(Concept concept) throws JAXRException
添加一个子 Concept。

功能级别：0
concept | 作为此对象的子对象添加的 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addChildConcept

void addChildConcept(Concept concept)
                     throws JAXRException
Adds a child Concept.

Capability Level: 0

Parameters:
concept - the concept being added as a child of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addChildConcepts(java.util.Collection<E> concepts) throws JAXRException
添加一个 Concept 子代所组成的 Collection。

功能级别：0
concepts | 作为此对象子代添加的 Concept 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addChildConcepts

void addChildConcepts(Collection concepts)
                      throws JAXRException
Adds a Collection of Concept children.

Capability Level: 0

Parameters:
concepts - the Collection of Concepts being added as a children of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeChildConcept(Concept concept) throws JAXRException
移除一个子 Concept。

功能级别：0
concept | 作为此对象的子对象移除的 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeChildConcept

void removeChildConcept(Concept concept)
                        throws JAXRException
Removes a child Concept.

Capability Level: 0

Parameters:
concept - the concept being removed as a child Concept of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeChildConcepts(java.util.Collection<E> concepts) throws JAXRException
移除一个 Concept 子代所组成的 Collection。

功能级别：0
concepts | 作为此对象子代移除的 Concept 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeChildConcepts

void removeChildConcepts(Collection concepts)
                         throws JAXRException
Removes a Collection of children Concepts.

Capability Level: 0

Parameters:
concepts - the Collection of Concepts being removed as children Concepts of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getChildConceptCount() throws JAXRException
获取子代的数量。

功能级别：0
return | 子代 Concept 的数量
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getChildConceptCount

int getChildConceptCount()
                         throws JAXRException
Gets number of children.

Capability Level: 0

Returns:
the number of children Concepts
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getChildrenConcepts() throws JAXRException
获取所有直接子代 Concept。

功能级别：0
return | Concept 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.Concept
英文文档：

getChildrenConcepts

Collection getChildrenConcepts()
                               throws JAXRException
Gets all immediate children Concepts.

Capability Level: 0

Returns:
Collection of Concept instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Concept

public java.util.Collection<E> getDescendantConcepts() throws JAXRException
获取所有后代 Concept。

功能级别：0
return | Concept 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.Concept
英文文档：

getDescendantConcepts

Collection getDescendantConcepts()
                                 throws JAXRException
Gets all descendant Concepts.

Capability Level: 0

Returns:
Collection of Concept instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Concept

public boolean isExternal() throws JAXRException
确定此 ClassificationScheme 是外部 ClassificationScheme 还是内部 ClassificationScheme。

功能级别：0
return | 如果这是一个外部 ClassificationScheme，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isExternal

boolean isExternal()
                   throws JAXRException
Determines whether this ClassificationScheme is an external ClassificationScheme or an internal ClassificationScheme.

Capability Level: 0

Returns:
trueif this is an external ClassificationScheme; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getValueType() throws JAXRException
获取此对象的值类型。值类型描述如何在方案中定义分类值。

功能级别：1
return | 描述此 ClassificationScheme 支持的值类型的整数常量
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | VALUE_TYPE_UNIQUE, VALUE_TYPE_EMBEDDED_PATH, VALUE_TYPE_NON_UNIQUE
英文文档：

getValueType

int getValueType()
                 throws JAXRException
Gets the value type for this object. The value type describes how taxonomy values are defined within the scheme.

Capability Level: 1

Returns:
an integer constant that describes the type of values supported by this ClassificationScheme
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
VALUE_TYPE_UNIQUE, VALUE_TYPE_EMBEDDED_PATH, VALUE_TYPE_NON_UNIQUE

public void setValueType(int valueType) throws JAXRException
设置此对象的值类型。

功能级别：1
valueType | 描述此 ClassificationScheme 支持的值类型的整数常量
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | VALUE_TYPE_UNIQUE, VALUE_TYPE_EMBEDDED_PATH, VALUE_TYPE_NON_UNIQUE
英文文档：

setValueType

void setValueType(int valueType)
                  throws JAXRException
Sets the value type for this object.

Capability Level: 1

Parameters:
valueType - an integer constant that describes the type of values supported by this ClassificationScheme
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
VALUE_TYPE_UNIQUE, VALUE_TYPE_EMBEDDED_PATH, VALUE_TYPE_NON_UNIQUE
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Concept (Java EE 5)

javax.xml.registry.infomodel
Interface Concept

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface Concept
extends RegistryObject

Implements: RegistryObject

Concept 接口用于表示分类元素及其彼此之间的结构关系，以便描述内部分类。Concept 实例用于定义树结构，其中树根是 ClassificationScheme 实例，树中的每个节点是 Concept 实例。可以定义两个 Concept 相等。

图 1 展示了如何使用 Concept 实例表示分类元素及其彼此之间的结构关系，以便描述内部分类。

使用 Concept 表示分类元素
图 1. 使用 Concept 表示分类元素
See also javax.xml.registry.infomodel.RegistryObject, javax.xml.registry.infomodel.Classification, javax.xml.registry.infomodel.ClassificationScheme
英文文档：

The Concept interface is used to represent taxonomy elements and their structural relationship with each other in order to describe an internal taxonomy. Concept instances are used to define tree structures where the root of the tree is a ClassificationScheme instance and each node in the tree is a Concept instance. Two Concepts may be defined as being equivalent.

Figure 1 shows how Concept instances are used to represent taxonomy elements and their structural relationship with each other in order to describe an internal taxonomy.

Using Concepts to Represent Taxonomy Elements
Figure 1. Using Concepts to Represent Taxonomy Elements

Author:
Farrukh S. Najmi
See Also:
RegistryObject, Classification, ClassificationScheme

Method Summary
void | addChildConcept(Concept concept) Adds a child Concept.
void | addChildConcepts(Collection concepts) Adds a Collection of Concept children.
int | getChildConceptCount() Gets number of children.
Collection | getChildrenConcepts() Gets all immediate children Concepts.
ClassificationScheme | getClassificationScheme() Gets the ClassificationScheme that this Concept is a descendent of.
Collection | getDescendantConcepts() Gets all descendant Concepts.
RegistryObject | getParent() Gets the parent Concept or ClassificationScheme for this object.
Concept | getParentConcept() Gets the parent Concept or null if parent is a ClassificationScheme.
String | getPath() Gets the canonical path representation for this Concept.
String | getValue() Gets the value (usually a code in a taxonomy) associated with this Concept.
void | removeChildConcept(Concept concept) Removes a child Concept.
void | removeChildConcepts(Collection concepts) Removes a Collection of children Concepts.
void | setValue(String value) Sets the value (usually a taxonomy value) associated with this Concept.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public String getValue() throws JAXRException
获取与此 Concept 关联的值（通常是某个分类中的代码）。

功能级别：0
return | 与此 Concept 关联的值（通常为分类值）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getValue

String getValue()
                throws JAXRException
Gets the value (usually a code in a taxonomy) associated with this Concept.

Capability Level: 0

Returns:
the value (usually a taxonomy value) associated with this Concept
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setValue(String value) throws JAXRException
设置与此 Concept 关联的值（通常是一个分类值）。

功能级别：0
value | 与此 Concept 关联的值（通常为分类值）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValue

void setValue(String value)
              throws JAXRException
Sets the value (usually a taxonomy value) associated with this Concept.

Capability Level: 0

Parameters:
value - the value (usually a taxonomy value) associated with this Concept
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addChildConcept(Concept concept) throws JAXRException
添加一个子 Concept。

功能级别：0
concept | 作为此对象的子对象添加的 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addChildConcept

void addChildConcept(Concept concept)
                     throws JAXRException
Adds a child Concept.

Capability Level: 0

Parameters:
concept - the concept being added as a child of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addChildConcepts(java.util.Collection<E> concepts) throws JAXRException
添加一个 Concept 子代所组成的 Collection。

功能级别：0
concepts | 作为此对象子代添加的 Concept 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addChildConcepts

void addChildConcepts(Collection concepts)
                      throws JAXRException
Adds a Collection of Concept children.

Capability Level: 0

Parameters:
concepts - the Collection of Concepts being added as a children of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeChildConcept(Concept concept) throws JAXRException
移除一个子 Concept。

功能级别：0
concept | 作为此对象的子对象移除的 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeChildConcept

void removeChildConcept(Concept concept)
                        throws JAXRException
Removes a child Concept.

Capability Level: 0

Parameters:
concept - the concept being removed as a child Concept of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeChildConcepts(java.util.Collection<E> concepts) throws JAXRException
移除一个 Concept 子代所组成的 Collection。

功能级别：0
concepts | 作为此对象子代移除的 Concept 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeChildConcepts

void removeChildConcepts(Collection concepts)
                         throws JAXRException
Removes a Collection of children Concepts.

Capability Level: 0

Parameters:
concepts - the Collection of Concepts being removed as children Concepts of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getChildConceptCount() throws JAXRException
获取子代的数量。

功能级别：0
return | 子代 Concept 的数量
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getChildConceptCount

int getChildConceptCount()
                         throws JAXRException
Gets number of children.

Capability Level: 0

Returns:
the number of children Concepts
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getChildrenConcepts() throws JAXRException
获取所有直接子代 Concept。

功能级别：0
return | Concept 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.Concept
英文文档：

getChildrenConcepts

Collection getChildrenConcepts()
                               throws JAXRException
Gets all immediate children Concepts.

Capability Level: 0

Returns:
Collection of Concept instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Concept

public java.util.Collection<E> getDescendantConcepts() throws JAXRException
获取所有后代 Concept。

功能级别：0
return | Concept 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.Concept
英文文档：

getDescendantConcepts

Collection getDescendantConcepts()
                                 throws JAXRException
Gets all descendant Concepts.

Capability Level: 0

Returns:
Collection of Concept instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Concept

public Concept getParentConcept() throws JAXRException
获取父 Concept；如果父 Concept 是 ClassificationScheme，则返回 null。

功能级别：0
return | 作为此对象的父对象的 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
label
en
parent
directed
supplierCardinality | 0..1
associates | <{javax.xml.registry.infomodel.Concept}>
英文文档：

getParentConcept

Concept getParentConcept()
                         throws JAXRException
Gets the parent Concept or null if parent is a ClassificationScheme.

Capability Level: 0

Returns:
the Concept that is the parent of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public ClassificationScheme getClassificationScheme() throws JAXRException
获取作为此 Concept 祖先的 ClassificationScheme。

功能级别：0
return | 作为此对象的祖先的 ClassificationScheme。可以返回 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
label
en
classificationScheme
directed
supplierCardinality | 0..1
associates | <{javax.xml.registry.infomodel.ClassificationScheme}>
英文文档：

getClassificationScheme

ClassificationScheme getClassificationScheme()
                                             throws JAXRException
Gets the ClassificationScheme that this Concept is a descendent of.

Capability Level: 0

Returns:
the ClassificationScheme that is the ancestor of this object. May return null
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getPath() throws JAXRException
获取此 Concept 的规范路径表示形式。

功能级别：0
return | 此对象的规范路径 String 表示形式
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getPath

String getPath()
               throws JAXRException
Gets the canonical path representation for this Concept.

Capability Level: 0

Returns:
the canonical path String representing this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public RegistryObject getParent() throws JAXRException
获取此对象的父 Concept 或 ClassificationScheme。

功能级别：0
return | 此对象的父 Concept 或 ClassificationScheme
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getParent

RegistryObject getParent()
                         throws JAXRException
Gets the parent Concept or ClassificationScheme for this object.

Capability Level: 0

Returns:
the parent Concept or ClassificationScheme for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EmailAddress (Java EE 5)

javax.xml.registry.infomodel
Interface EmailAddress

public interface EmailAddress

表示电子邮件地址。
See also javax.xml.registry.infomodel.User
英文文档：

Represents an email address.

Author:
Farrukh S. Najmi
See Also:
User

Method Summary
String | getAddress() Returns the email address for this object.
String | getType() Gets the type for this object.
void | setAddress(String address) Sets the email address for this object.
void | setType(String type) Sets the type for this object.

Method Detail

public String getAddress() throws JAXRException
返回此对象的电子邮件地址。默认值为 NULL 字符串。

功能级别：0
return | 实际电子邮件地址（例如 john.doe@acme.com）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getAddress

String getAddress()
                  throws JAXRException
Returns the email address for this object. Default is a NULL String.

Capability Level: 0

Returns:
the actual email address (e.g. john.doe@acme.com)
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setAddress(String address) throws JAXRException
设置此对象的电子邮件地址。

功能级别：0
address | 实际电子邮件地址（例如 john.doe@acme.com）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setAddress

void setAddress(String address)
                throws JAXRException
Sets the email address for this object.

Capability Level: 0

Parameters:
address - the actual email address (e.g. john.doe@acme.com)
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getType() throws JAXRException
获取此对象的类型。默认值为 NULL 字符串。

功能级别：0
return | 此对象的使用类型，它是一个任意值（例如，"Home" 或 "Office"）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getType

String getType()
               throws JAXRException
Gets the type for this object. Default is a NULL String.

Capability Level: 0

Returns:
the usage type for this object which is an arbitrary value (e.g. "Home" or "Office")
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setType(String type) throws JAXRException
设置此对象的类型。

功能级别：0
type | 此对象的使用类型，它是一个任意值（例如，"Home" 或 "Office"）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setType

void setType(String type)
             throws JAXRException
Sets the type for this object.

Capability Level: 0

Parameters:
type - the usage type for this object which is an arbitrary value (e.g. "Home" or "Office")
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExtensibleObject (Java EE 5)

javax.xml.registry.infomodel
Interface ExtensibleObject

All Known Subinterfaces:
Association, AuditableEvent, Classification, ClassificationScheme, Concept, ExternalIdentifier, ExternalLink, ExtrinsicObject, Organization, PostalAddress, RegistryEntry, RegistryObject, RegistryPackage, Service, ServiceBinding, SpecificationLink, User
public interface ExtensibleObject

Implemented by: PostalAddress, RegistryObject

ExtensibleObject 可以利用动态添加的 Slot 扩展自身，这些 Slot 以实例为单位向对象添加任意属性。
See also javax.xml.registry.infomodel.Slot
英文文档：

An ExtensibleObject is one that allows itself to be extended by utilizing dynamically added Slots that add arbitrary attributes to the object on a per instance basis.

Author:
Farrukh S. Najmi
See Also:
Slot

Method Summary
void | addSlot(Slot slot) Adds a Slot to this object.
void | addSlots(Collection slots) Adds more Slots to this object.
Slot | getSlot(String slotName) Gets the slot specified by slotName.
Collection | getSlots() Returns the Slots associated with this object.
void | removeSlot(String slotName) Removes a Slot from this object.
void | removeSlots(Collection slotNames) Removes specified Slots from this object.

Method Detail

public void addSlot(Slot slot) throws JAXRException
将 Slot 添加到此对象。

功能级别：0
slot | 将添加到此对象的 Slot 对象
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addSlot

void addSlot(Slot slot)
             throws JAXRException
Adds a Slot to this object.

Capability Level: 0

Parameters:
slot - the Slot object being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addSlots(java.util.Collection<E> slots) throws JAXRException
将多个 Slot 添加到此对象。

功能级别：0
slots | 将添加到此对象的 Slot 对象所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
associates | <{Slot}>
undirected
supplierRole
en
slots
link
en
aggregationByValue
英文文档：

addSlots

void addSlots(Collection slots)
              throws JAXRException
Adds more Slots to this object.

Capability Level: 0

Parameters:
slots - the Collection of Slot objects being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeSlot(String slotName) throws JAXRException
从此对象中移除一个 Slot。Slot 通过其名称识别。

功能级别：0
slotName | 将从此对象中移除的 Slot 对象的名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeSlot

void removeSlot(String slotName)
                throws JAXRException
Removes a Slot from this object. The Slot is identified by its name.

Capability Level: 0

Parameters:
slotName - the name for the Slot object being removed from this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeSlots(java.util.Collection<E> slotNames) throws JAXRException
从此对象中移除指定的 Slot。Slot 通过其名称识别。

功能级别：0
slotNames | 将从此对象中移除的 Slot 对象的名称所组成的 Collection。必须是 String 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
associates | <{Slot}>
undirected
supplierRole
en
slots
link
en
aggregationByValue
英文文档：

removeSlots

void removeSlots(Collection slotNames)
                 throws JAXRException
Removes specified Slots from this object. The Slots are identified by its name.

Capability Level: 0

Parameters:
slotNames - the Collection of names for Slot objects being removed from this object. Must be a Collection of Strings
Throws:
JAXRException - If the JAXR provider encounters an internal error

public Slot getSlot(String slotName) throws JAXRException
获取用 slotName 指定的 slot。

功能级别：0
slotName | 所需 Slot 对象的名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getSlot

Slot getSlot(String slotName)
             throws JAXRException
Gets the slot specified by slotName.

Capability Level: 0

Parameters:
slotName - the name of the desired Slot object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getSlots() throws JAXRException
返回与此对象关联的 Slot。

功能级别：0
return | Slot 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
associates | <{Slot}>
undirected
supplierRole
en
slots
link
en
aggregationByValue
英文文档：

getSlots

Collection getSlots()
                    throws JAXRException
Returns the Slots associated with this object.

Capability Level: 0

Returns:
Collection of Slot instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExternalIdentifier (Java EE 5)

javax.xml.registry.infomodel
Interface ExternalIdentifier

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface ExternalIdentifier
extends RegistryObject

Implements: RegistryObject

ExternalIdentifier 实例为 DUNS 号码、Social Security Number 或组织别名之类的 RegistryObject 提供附加标识符信息。从 RegistryObject 继承的属性名称用于包含标识方案（"DUNS"、"Social Security Number" 等等），属性值包含实际信息（例如实际的 DUNS 号码）。每个 RegistryObject 都可以有 0 个或多个 ExternalIdentifier。
See also javax.xml.registry.infomodel.RegistryObject
英文文档：

ExternalIdentifier instances provide the additional identifier information to RegistryObjects such as DUNS number, Social Security Number, or an alias name of the organization. The attribute name inherited from RegistryObject is used to contain the identification scheme ("DUNS" "Social Security Number", etc.), and the attribute value contains the actual information (e.g. the actual DUNS number). Each RegistryObject may have 0 or more ExternalIdentifiers.

Author:
Farrukh S. Najmi
See Also:
RegistryObject

Method Summary
ClassificationScheme | getIdentificationScheme() Gets the ClassificationScheme that is used as the identification scheme for identifying this object.
RegistryObject | getRegistryObject() Gets the parent RegistryObject for this ExternalIdentifier.
String | getValue() Gets the value of an ExternalIdentifier.
void | setIdentificationScheme(ClassificationScheme identificationScheme) Sets the ClassificationScheme that is used as the identification scheme for identifying this object.
void | setValue(String value) Sets the value of an ExternalIdentifier.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public RegistryObject getRegistryObject() throws JAXRException
获取此 ExternalIdentifier 的父 RegistryObject。要设置 registryObject，需要对 RegistryObject 调用 addExternalIdentifier。

功能级别：0
return | 此对象标识符的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | addExternalIdentifier(ExternalIdentifier ei)
英文文档：

getRegistryObject

RegistryObject getRegistryObject()
                                 throws JAXRException
Gets the parent RegistryObject for this ExternalIdentifier. To set the registryObject call addExternalIdentifier on a RegistryObject.

Capability Level: 0

Returns:
the RegistryObject that this object identifies
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryObject.addExternalIdentifier(ExternalIdentifier ei)

public String getValue() throws JAXRException
获取 ExternalIdentifier 的值。

功能级别：0
return | 此对象定义的标识值（例如，公司的 DUNS 编码）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getValue

String getValue()
                throws JAXRException
Gets the value of an ExternalIdentifier.

Capability Level: 0

Returns:
the identification value defined by this object (e.g. a company's DUNS number)
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setValue(String value) throws JAXRException
设置 ExternalIdentifier 的值。

功能级别：0
value | 此对象定义的标识值（例如，公司的 DUNS 编码）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValue

void setValue(String value)
              throws JAXRException
Sets the value of an ExternalIdentifier.

Capability Level: 0

Parameters:
value - the identification value defined by this object (e.g. a company's DUNS number)
Throws:
JAXRException - If the JAXR provider encounters an internal error

public ClassificationScheme getIdentificationScheme() throws JAXRException
获取用作标识此对象的标识方案的 ClassificationScheme。

功能级别：0
return | 用作标识方案（例如 "DUNS"）的 ClassificationScheme
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
clientCardinality | 0..*
associationAsClass
en
Classification
英文文档：

getIdentificationScheme

ClassificationScheme getIdentificationScheme()
                                             throws JAXRException
Gets the ClassificationScheme that is used as the identification scheme for identifying this object.

Capability Level: 0

Returns:
the ClassificationScheme that is used as the identification scheme (e.g. "DUNS")
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setIdentificationScheme(ClassificationScheme identificationScheme) throws JAXRException
设置用作标识此对象的标识方案的 ClassificationScheme。

功能级别：0
identificationScheme | 用作标识方案（例如 "DUNS"）的 ClassificationScheme
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setIdentificationScheme

void setIdentificationScheme(ClassificationScheme identificationScheme)
                             throws JAXRException
Sets the ClassificationScheme that is used as the identification scheme for identifying this object.

Capability Level: 0

Parameters:
identificationScheme - the ClassificationScheme that is used as the identification scheme (e.g. "DUNS")
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExternalLink (Java EE 5)

javax.xml.registry.infomodel
Interface ExternalLink

All Superinterfaces:
ExtensibleObject, RegistryObject, URIValidator
public interface ExternalLink
extends RegistryObject, URIValidator

Implements: RegistryObject, URIValidator

ExternalLink 实例模拟指向内容（可能位于注册表之外）的指定 URI。RegistryObject 可以与任意数量的 ExternalLink 关联，以注释带有指向外部内容的外部链接的 RegistryObject。

考虑以下情况：Submitting Organization 提交一个注册表条目（例如，一个 DTD），并希望将一些外部内容与该对象（例如 Submitting Organization 的主页）关联。ExternalLink 支持此功能。

See also javax.xml.registry.infomodel.RegistryObject
英文文档：

ExternalLink instances model a named URI to content that may reside outside the registry. RegistryObject may be associated with any number of ExternalLinks to annotate a RegistryObject with external links to external content.

Consider the case where a Submitting Organization submits a repository item (e.g. a DTD) and wants to associate some external content to that object (e.g. the Submitting Organization's home page). The ExternalLink enables this capability.

Author:
Farrukh S. Najmi
See Also:
RegistryObject

Method Summary
String | getExternalURI() Gets URI to the an external resource.
Collection | getLinkedObjects() Gets the collection of RegistryObjects that are annotated by this ExternalLink.
void | setExternalURI(String uri) Sets URI for an external resource.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots
Methods inherited from interface javax.xml.registry.infomodel.URIValidator
getValidateURI, setValidateURI

Method Detail

public java.util.Collection<E> getLinkedObjects() throws JAXRException
获取此 ExternalLink 注释的 RegistryObject 所组成的 Collection。

功能级别：0
return | RegistryObject 所组成的 Collection。如果不存在任何此对象注释的 RegistryObject，则返回一个空 Collection。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getLinkedObjects

Collection getLinkedObjects()
                            throws JAXRException
Gets the collection of RegistryObjects that are annotated by this ExternalLink.

Capability Level: 0

Returns:
Collection of RegistryObjects. Return an empty Collection if no RegistryObjects are annotated by this object.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getExternalURI() throws JAXRException
获取指向外部资源的 URI。默认值为 NULL 字符串。

功能级别：0
return | 此对象的 URI 字符串（例如 "http://java.sun.com"）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getExternalURI

String getExternalURI()
                      throws JAXRException
Gets URI to the an external resource. Default is a NULL String.

Capability Level: 0

Returns:
the URI String for this object (e.g. "http://java.sun.com")
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setExternalURI(String uri) throws JAXRException
设置指向外部资源的 URI。

功能级别：0
uri | 此对象的 URI 字符串（例如 "http://java.sun.com"）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setExternalURI

void setExternalURI(String uri)
                    throws JAXRException
Sets URI for an external resource.

Capability Level: 0

Parameters:
uri - the URI String for this object (e.g. "http://java.sun.com")
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ExtrinsicObject (Java EE 5)

javax.xml.registry.infomodel
Interface ExtrinsicObject

All Superinterfaces:
ExtensibleObject, RegistryEntry, RegistryObject, Versionable
public interface ExtrinsicObject
extends RegistryEntry

Implements: RegistryEntry

ExtrinsicObject 提供描述所提交内容的元数据，这些内容的类型对于注册表而言实质上是未知的，因此必须使用附加属性（例如，mime 类型）描述它们。

通过 ExtrinsicObject 描述内容的示例包括 Collaboration Protocol Profiles (CPP)、业务流程描述和模式。

英文文档：

ExtrinsicObjects provide metadata that describes submitted content whose type is not intrinsically known to the registry and therefore must be described by means of additional attributes (e.g., mime type).

Examples of content described by ExtrinsicObject include Collaboration Protocol Profiles (CPP), business process descriptions, and schemas.

Author:
Farrukh S. Najmi

Field Summary
Fields inherited from interface javax.xml.registry.infomodel.RegistryEntry
STABILITY_DYNAMIC, STABILITY_DYNAMIC_COMPATIBLE, STABILITY_STATIC, STATUS_APPROVED, STATUS_DEPRECATED, STATUS_SUBMITTED, STATUS_WITHDRAWN
Method Summary
String | getMimeType() Gets the mime type associated with this object.
DataHandler | getRepositoryItem() Gets the repository item for this object.
boolean | isOpaque() Determines whether the ExtrinsicObject is opaque (not readable) by the registry operator.
void | setMimeType(String mimeType) Sets the mime type associated with this object.
void | setOpaque(boolean isOpaque) Sets whether the ExtrinsicObject is opaque (not readable) by the registry.
void | setRepositoryItem(DataHandler repositoryItem) Sets the repository item for this object.
Methods inherited from interface javax.xml.registry.infomodel.RegistryEntry
getExpiration, getStability, getStatus, setExpiration, setStability
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots
Methods inherited from interface javax.xml.registry.infomodel.Versionable
getMajorVersion, getMinorVersion, getUserVersion, setMajorVersion, setMinorVersion, setUserVersion

Method Detail

public String getMimeType() throws JAXRException
获取与此对象关联的 mime 类型。默认值为 NULL 字符串。

功能级别：1
return | 与此对象关联的 mime 类型
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getMimeType

String getMimeType()
                   throws JAXRException
Gets the mime type associated with this object. Default is a NULL String.

Capability Level: 1

Returns:
the mime type associated with this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setMimeType(String mimeType) throws JAXRException
设置与此对象关联的 mime 类型。

功能级别：1
mimeType | 与此对象关联的 mime 类型
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setMimeType

void setMimeType(String mimeType)
                 throws JAXRException
Sets the mime type associated with this object.

Capability Level: 1

Parameters:
mimeType - the mime type associated with this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean isOpaque() throws JAXRException
确定 ExtrinsicObject 对于注册表操作符是否是不透明的（不可读的）。

在某些情况下，Submitting Organization 可以提交加密内容，甚至注册表无法读取的内容。此属性使注册表能够了解是否处于这种情况。

功能级别：1
return | 如果可以通过注册表操作符读取 ExtrinsicObject，则返回 true；否则返回 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

isOpaque

boolean isOpaque()
                 throws JAXRException
Determines whether the ExtrinsicObject is opaque (not readable) by the registry operator.

In some situations, a Submitting Organization may submit content that is encrypted and not even readable by the registry. This attribute allows the registry to know whether this is the case.

Capability Level: 1

Returns:
true if the ExtrinsicObject is readable by the registry operator; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setOpaque(boolean isOpaque) throws JAXRException
设置 ExtrinsicObject 对于注册表操作符是否是不透明的（不可读的）。

功能级别：1
isOpaque | 如果可以通过注册表操作符读取 ExtrinsicObject，则该参数是设置为 true 的 boolean 值；否则为 false
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setOpaque

void setOpaque(boolean isOpaque)
               throws JAXRException
Sets whether the ExtrinsicObject is opaque (not readable) by the registry.

Capability Level: 1

Parameters:
isOpaque - boolean value set to true if the ExtrinsicObject is readable by the registry operator; false otherwise
Throws:
JAXRException - If the JAXR provider encounters an internal error

public DataHandler getRepositoryItem() throws JAXRException
获取此对象的注册表条目。不得返回 null。

功能级别：1
return | 注册表条目的 DataHandler
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRepositoryItem

DataHandler getRepositoryItem()
                              throws JAXRException
Gets the repository item for this object. Must not return null.

Capability Level: 1

Returns:
the DataHandler for the repository item
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setRepositoryItem(DataHandler repositoryItem) throws JAXRException
设置此对象的注册表条目。

功能级别：1
repositoryItem | 注册表条目的 DataHandler。不得为 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setRepositoryItem

void setRepositoryItem(DataHandler repositoryItem)
                       throws JAXRException
Sets the repository item for this object.

Capability Level: 1

Parameters:
repositoryItem - the DataHandler for the repository item. Must not be null
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


InternationalString (Java EE 5)

javax.xml.registry.infomodel
Interface InternationalString

public interface InternationalString

此接口表示已经国际化到几个 Locale 中的 String。当 String 属性必须是国际化格式时，使用此接口替代 String 类型。InternationalString 接口的实例由 LocalizedString 实例所组成的 Collection 组成，其中每个 String 对应于一个特定的 Locale。InternationalString 接口提供了一些 set/get 方法，用于添加或获取 InternationalString 实例特定于语言环境的 String 值。
See also javax.xml.registry.infomodel.LocalizedString
英文文档：

This interface represents a String that has been internationalized into several Locales. This interface is used as a replacement for the String type whenever a String attribute needs to be I18N capable. An instance of the InternationalString interface composes within it a Collection of LocalizedString instances, where each String is specific to a particular Locale. The InternationalString interface provides set/get methods for adding or getting locale specific String values for the InternationalString instance.

Author:
Farrukh S. Najmi
See Also:
LocalizedString

Method Summary
 void addLocalizedString(LocalizedString localizedString)
Adds a LocalizedString to this object.
 void addLocalizedStrings(Collection localizedStrings)
Adds many LocalizedStrings to this object.
 LocalizedString getLocalizedString(Locale locale, String charsetName)
Gets the LocalizedString for the specified Locale and charsetName.
 Collection getLocalizedStrings()
Returns the LocalizedStrings associated with this object.
 String getValue()
Gets the String value for the Locale returned by Locale.getDefault().
 String getValue(Locale locale)
Gets the String value for the specified Locale.
 void removeLocalizedString(LocalizedString localizedString)
Removes a LocalizedString from this object.
 void removeLocalizedStrings(Collection localizedStrings)
Removes specified LocalizedStrings to this object.
 void setValue(Locale locale, String value)
Sets the String value for the specified Locale.
 void setValue(String value)
Sets the String value for the Locale returned by Locale.getDefault().

Method Detail

public String getValue() throws JAXRException
获取对应于 Locale.getDefault() 所返回 Locale 的 String 值。

功能级别：0
return | 对应于 Locale.getDefault() 所返回 Locale 的 String 值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getValue

String getValue()
                throws JAXRException
Gets the String value for the Locale returned by Locale.getDefault().

Capability Level: 0

Returns:
the String value for the Locale returned by Locale.getDefault()
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getValue(java.util.Locale locale) throws JAXRException
获取对应于指定 Locale 的 String 值。如果没有找到对应于指定语言环境的特定于语言环境的值，则返回 null。

功能级别：0
locale | 所需值的 Locale
return | 对应于指定 Locale 的 String 值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getValue

String getValue(Locale locale)
                throws JAXRException
Gets the String value for the specified Locale. Return null if no locale specific value is found for the specified locale.

Capability Level: 0

Parameters:
locale - The Locale for the desired value
Returns:
the String value for the specified Locale
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setValue(String value) throws JAXRException
设置对应于 Locale.getDefault() 所返回 Locale 的 String 值。

功能级别：0
value | 对应于 Locale.getDefault() 所返回 Locale 的 String 值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValue

void setValue(String value)
              throws JAXRException
Sets the String value for the Locale returned by Locale.getDefault().

Capability Level: 0

Parameters:
value - the String value for the Locale returned by Locale.getDefault()
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setValue(java.util.Locale locale, String value) throws JAXRException
设置对应于指定 Locale 的 String 值。

功能级别：0
locale | 将设置此值的语言环境
value | 将设置的值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValue

void setValue(Locale locale,
              String value)
              throws JAXRException
Sets the String value for the specified Locale.

Capability Level: 0

Parameters:
locale - The locale for this value being set
value - The value being set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addLocalizedString(LocalizedString localizedString) throws JAXRException
将 LocalizedString 添加到此对象。

功能级别：0
localizedString | 将添加到此对象的 LocalizedString
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addLocalizedString

void addLocalizedString(LocalizedString localizedString)
                        throws JAXRException
Adds a LocalizedString to this object.

Capability Level: 0

Parameters:
localizedString - the LocalizedString being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addLocalizedStrings(java.util.Collection<E> localizedStrings) throws JAXRException
将多个 LocalizedString 添加到此对象。

功能级别：0
localizedStrings | 将添加到此对象的 LocalizedString 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addLocalizedStrings

void addLocalizedStrings(Collection localizedStrings)
                         throws JAXRException
Adds many LocalizedStrings to this object.

Capability Level: 0

Parameters:
localizedStrings - the Collection of LocalizedStrings being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeLocalizedString(LocalizedString localizedString) throws JAXRException
从此对象中移除一个 LocalizedString。

功能级别：0
localizedString | 将从此对象中移除的 LocalizedString
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeLocalizedString

void removeLocalizedString(LocalizedString localizedString)
                           throws JAXRException
Removes a LocalizedString from this object.

Capability Level: 0

Parameters:
localizedString - the LocalizedString being removed from this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeLocalizedStrings(java.util.Collection<E> localizedStrings) throws JAXRException
移除此对象的指定 LocalizedString。

功能级别：0
localizedStrings | 将从此对象中移除的 LocalizedString 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeLocalizedStrings

void removeLocalizedStrings(Collection localizedStrings)
                            throws JAXRException
Removes specified LocalizedStrings to this object.

Capability Level: 0

Parameters:
localizedStrings - the Collection of LocalizedStrings being removed from this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public LocalizedString getLocalizedString(java.util.Locale locale, String charsetName) throws JAXRException
获取对应于指定 Locale 和 charsetName 的 LocalizedString。

功能级别：0
locale | 所需 LocalizedString 的语言环境
charsetName | 所需 LocalizedString 的字符集名称
return | 与指定语言环境和字符集匹配的 LocalizedString
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getLocalizedString

LocalizedString getLocalizedString(Locale locale,
                                   String charsetName)
                                   throws JAXRException
Gets the LocalizedString for the specified Locale and charsetName.

Capability Level: 0

Parameters:
locale - The loacle for the desired LocalizedStrings
charsetName - The character set name for the desired LocalizedStrings
Returns:
the LocalizedString that matches specified locale and character set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getLocalizedStrings() throws JAXRException
返回与此对象关联的 LocalizedString。

功能级别：0
return | LocalizedString 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.LocalizedString
英文文档：

getLocalizedStrings

Collection getLocalizedStrings()
                               throws JAXRException
Returns the LocalizedStrings associated with this object.

Capability Level: 0

Returns:
Collection of LocalizedString instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
LocalizedString
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Key (Java EE 5)

javax.xml.registry.infomodel
Interface Key

public interface Key

表示标识 RegistryObject 的唯一键。必须是 DCE 128 UUID。
See also javax.xml.registry.infomodel.RegistryObject
英文文档：

Represents a unique key that identifies a RegistryObject. Must be a DCE 128 UUID.

Author:
Farrukh S. Najmi
See Also:
RegistryObject

Method Summary
String | getId() Returns the unique Id of this key.
void | setId(String id) Sets the unique id associated with this key.

Method Detail

public String getId() throws JAXRException
返回此键的唯一 Id。默认值为 NULL 字符串。

功能级别：0
return | 此对象的 ID
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getId

String getId()
             throws JAXRException
Returns the unique Id of this key. Default is a NULL String.

Capability Level: 0

Returns:
the id for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setId(String id) throws JAXRException
设置与此键关联的唯一 ID。

功能级别：0
id | 将为此对象定义的 ID
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setId

void setId(String id)
           throws JAXRException
Sets the unique id associated with this key.

Capability Level: 0

Parameters:
id - the id being defined for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LocalizedString (Java EE 5)

javax.xml.registry.infomodel
Interface LocalizedString

public interface LocalizedString

此接口用作将 String 与其 Locale 关联的简单包装器接口。InternationalString 接口中需要该接口，其中保留了 LocalizedString 实例所组成的 Collection。每个 LocalizedString 实例都有一个 Locale 和一个 String 实例。
See also javax.xml.registry.infomodel.InternationalString
英文文档：

This interface is used as a simple wrapper interface that associates a String with its Locale. The interface is needed in the InternationalString interface where a Collection of LocalizedString instances are kept. Each LocalizedString instance has a Locale and a String instance.

Author:
Farrukh S. Najmi
See Also:
InternationalString

Field Summary
static String DEFAULT_CHARSET_NAME
The default name returned by getCharsetName if no other name has explicitly been set.
Method Summary
String | getCharsetName() Gets the canonical name for the charset for this object.
Locale | getLocale() Get the Locale for this object.
String | getValue() Get the String value for this object.
void | setCharsetName(String charsetName) Set the canonical name for the charset for this object.
void | setLocale(Locale locale) Set the Locale for this object.
void | setValue(String value) Set the String value for the specified object.

Field Detail

英文文档：

DEFAULT_CHARSET_NAME

static final String DEFAULT_CHARSET_NAME
The default name returned by getCharsetName if no other name has explicitly been set.

See Also:
Constant Field Values
Method Detail

public String getCharsetName() throws JAXRException
获取此对象字符集的规范名称。在没有定义字符集名称时，必须返回默认字符集。

功能级别：0
return | 此对象使用的字符集的字符集名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | DEFAULT_CHARSET_NAME
英文文档：

getCharsetName

String getCharsetName()
                      throws JAXRException
Gets the canonical name for the charset for this object. Must return the default charset when there is no charset name defined.

Capability Level: 0

Returns:
the character set name for the character set used by this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
DEFAULT_CHARSET_NAME

public java.util.Locale getLocale() throws JAXRException
获取此对象的 Locale。如果没有定义 Locale，则必须返回默认 Locale。

功能级别：0
return | 此对象使用的 Locale
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | getDefault()
英文文档：

getLocale

Locale getLocale()
                 throws JAXRException
Get the Locale for this object. Must return the default Locale when no Locale has been defined.

Capability Level: 0

Returns:
the Locale used by this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Locale.getDefault()

public String getValue() throws JAXRException
获取此对象的 String 值。

功能级别：0
return | 此对象定义的值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getValue

String getValue()
                throws JAXRException
Get the String value for this object.

Capability Level: 0

Returns:
the value defined by this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setCharsetName(String charsetName) throws JAXRException
设置此对象字符集的规范名称。

功能级别：0
charsetName | 此对象使用的字符集的字符集名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setCharsetName

void setCharsetName(String charsetName)
                    throws JAXRException
Set the canonical name for the charset for this object.

Capability Level: 0

Parameters:
charsetName - the character set name for the character set used by this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setLocale(java.util.Locale locale) throws JAXRException
设置此对象的 Locale。

功能级别：0
locale | 此对象使用的 Locale
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setLocale

void setLocale(Locale locale)
               throws JAXRException
Set the Locale for this object.

Capability Level: 0

Parameters:
locale - the Locale used by this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setValue(String value) throws JAXRException
设置指定对象的 String 值。

功能级别：0
value | 此对象定义的值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValue

void setValue(String value)
              throws JAXRException
Set the String value for the specified object.

Capability Level: 0

Parameters:
value - the value defined by this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Organization (Java EE 5)

javax.xml.registry.infomodel
Interface Organization

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface Organization
extends RegistryObject

Implements: RegistryObject

Organization 实例提供关于组织（比如 Submitting Organization）的信息。每个 Organization 实例可能都包含一个对父 Organization 的引用。此外，它还可能包含一个定义组织内部主要联系人的联系人属性。Organization 还有一个地址属性。
See also javax.xml.registry.infomodel.Service
英文文档：

Organization instances provide information on organizations such as a Submitting Organization. Each Organization instance may have a reference to a parent Organization. In addition it may have a contact attribute defining the primary contact within the organization. An Organization also has an address attribute.

Author:
Farrukh S. Najmi
See Also:
Service

Method Summary
void | addChildOrganization(Organization organization) Adds a child Organization.
void | addChildOrganizations(Collection organizations) Adds a Collection of Organization children.
void | addService(Service service) Adds a child Service.
void | addServices(Collection services) Adds a Collection of Service children.
void | addUser(User user) Adds a User.
void | addUsers(Collection users) Adds a Collection of Users.
int | getChildOrganizationCount() Gets number of children.
Collection | getChildOrganizations() Gets all immediate children Organizations.
Collection | getDescendantOrganizations() Gets all descendant Organizations.
Organization | getParentOrganization() Gets the parent (container) organization.
PostalAddress | getPostalAddress() Gets the Address for this Organization.
User | getPrimaryContact() Gets the primary Contact for this Organization.
Organization | getRootOrganization() Gets the root organization.
Collection | getServices() Gets all children Services.
Collection | getTelephoneNumbers(String phoneType) Gets the telephone numbers for this User that match the specified telephone number type.
Collection | getUsers() Gets the Collection of Users affiliated with this Organization.
void | removeChildOrganization(Organization organization) Removes a child Organization.
void | removeChildOrganizations(Collection organizations) Removes a Collection of children Organizations.
void | removeService(Service service) Removes a Service from this object.
void | removeServices(Collection services) Removes a Collection of children Services from this object.
void | removeUser(User user) Removes a User.
void | removeUsers(Collection users) Removes a Collection of Users.
void | setPostalAddress(PostalAddress address) Sets the address for this Organization.
void | setPrimaryContact(User primaryContact) Sets the primary contact for this Organization.
void | setTelephoneNumbers(Collection phoneNumbers) Sets the various telephone numbers for this user.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public PostalAddress getPostalAddress() throws JAXRException
获取此 Organization 的地址。

功能级别：1
return | 此 Organization 的 PostalAddress
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1
directed
link
en
aggregationByValue
associates | <{PostalAddress}>
英文文档：

getPostalAddress

PostalAddress getPostalAddress()
                               throws JAXRException
Gets the Address for this Organization.

Capability Level: 1

Returns:
the PostalAddress for this Organization
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setPostalAddress(PostalAddress address) throws JAXRException
设置此 Organization 的地址。

功能级别：1
address | 此 Organization 的 PostalAddress
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setPostalAddress

void setPostalAddress(PostalAddress address)
                      throws JAXRException
Sets the address for this Organization.

Capability Level: 1

Parameters:
address - the PostalAddress for this Organization
Throws:
JAXRException - If the JAXR provider encounters an internal error

public User getPrimaryContact() throws JAXRException
获取此 Organization 的主要联系人。主要联系人是 Organization 的 User 之一，它是对 Organization 实例调用 getUsers 所返回的值。

功能级别：0
return | 作为此 Organization 主要联系人的 User。不得为 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1
directed
link
en
aggregationByValue
supplierRole
en
primaryContact
associates | <{User}>
英文文档：

getPrimaryContact

User getPrimaryContact()
                       throws JAXRException
Gets the primary Contact for this Organization. The primary contact is one of the Users of the Organization, as returned by the getUsers call on an Organization instance.

Capability Level: 0

Returns:
the User that is the primary Contact for this Organization. Must not be null
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setPrimaryContact(User primaryContact) throws JAXRException
设置此 Organization 的主要联系人。如果主要联系人不在此对象的现有 User 实例所组成的 Collection 中，则必须将它添加到该 Collection。如果主要联系人已经在此对象的现有 User 实例所组成的 Collection 中，则不应该将它作为重复条目添加到该 User Collection。无论是哪种情况，主要联系人都是此对象的 User 实例所组成的 Collection 中已标识的 User 实例。

功能级别：0
primaryContact | 作为此 Organization 主要联系人的 User
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setPrimaryContact

void setPrimaryContact(User primaryContact)
                       throws JAXRException
Sets the primary contact for this Organization. If the primary contact is not in the existing Collection of User instances for this object then it must be added to that Collection. If the primary contact is already in the existing Collection of User instances for this object, then it should not be added to the Users collection as a duplicate entry. In either case, the primary contact is a distinguished User instance within the Collection of User instances for this Object.

Capability Level: 0

Parameters:
primaryContact - the User that is the primary Contact for this Organization
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addUser(User user) throws JAXRException
添加一个 User。

功能级别：0
user | 将添加到此对象的 User
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addUser

void addUser(User user)
             throws JAXRException
Adds a User.

Capability Level: 0

Parameters:
user - the User being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addUsers(java.util.Collection<E> users) throws JAXRException
添加一个 User 所组成的 Collection。

功能级别：0
users | 将添加到此对象的 User 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addUsers

void addUsers(Collection users)
              throws JAXRException
Adds a Collection of Users.

Capability Level: 0

Parameters:
users - the Collection of Users being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeUser(User user) throws JAXRException
移除一个 User。

功能级别：0
user | 将从此对象中移除的 User
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeUser

void removeUser(User user)
                throws JAXRException
Removes a User.

Capability Level: 0

Parameters:
user - the User being removed from this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeUsers(java.util.Collection<E> users) throws JAXRException
移除一个 User 所组成的 Collection。

功能级别：0
users | 将从此对象中移除的 User 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeUsers

void removeUsers(Collection users)
                 throws JAXRException
Removes a Collection of Users.

Capability Level: 0

Parameters:
users - the Collection of Users being removed from this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getUsers() throws JAXRException
获取隶属此 Organization 的 User 所组成的 Collection。其中一名用户被指定为主要联系人。

功能级别：0
return | User 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
associates | <{User}>
label
en
users
link
en
aggregationByValue
See also | javax.xml.registry.infomodel.User
英文文档：

getUsers

Collection getUsers()
                    throws JAXRException
Gets the Collection of Users affiliated with this Organization. One of these users is designated as the primary contact.

Capability Level: 0

Returns:
Collection of User instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
User

public java.util.Collection<E> getTelephoneNumbers(String phoneType) throws JAXRException
获取此 User 匹配指定电话号码类型的电话号码。如果 phoneType 为 null，则返回所有 telephoneNumber。

功能级别：0
return | TelephoneNumber 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
phoneType | 指定所需电话号码类型的 String
supplierCardinality | 1
associates | <{TelephoneNumber}>
directed
supplierRole
en
phones
clientCardinality | 1..
See also | javax.xml.registry.infomodel.TelephoneNumber
英文文档：

getTelephoneNumbers

Collection getTelephoneNumbers(String phoneType)
                               throws JAXRException
Gets the telephone numbers for this User that match the specified telephone number type. If phoneType is null return all telephoneNumbers.

Capability Level: 0

Parameters:
phoneType - a String that specifies the type of phone numbers desired
Returns:
Collection of TelephoneNumber instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
TelephoneNumber

public void setTelephoneNumbers(java.util.Collection<E> phoneNumbers) throws JAXRException
为此用户设置各种电话号码。

功能级别：0
phoneNumbers | 设置用于此对象的 TelephoneNumber
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setTelephoneNumbers

void setTelephoneNumbers(Collection phoneNumbers)
                         throws JAXRException
Sets the various telephone numbers for this user.

Capability Level: 0

Parameters:
phoneNumbers - the TelephoneNumbers being set for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addService(Service service) throws JAXRException
添加一个子 Service。

功能级别：0
service | 将添加到此对象的 Service
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addService

void addService(Service service)
                throws JAXRException
Adds a child Service.

Capability Level: 0

Parameters:
service - the Service being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addServices(java.util.Collection<E> services) throws JAXRException
添加一个 Service 子代所组成的 Collection。

功能级别：0
services | 将添加到此对象的 Service 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addServices

void addServices(Collection services)
                 throws JAXRException
Adds a Collection of Service children.

Capability Level: 0

Parameters:
services - the Collection of Services being added to this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeService(Service service) throws JAXRException
从此对象中移除一个 Service。

功能级别：0
service | 将从此对象中移除的 Service
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeService

void removeService(Service service)
                   throws JAXRException
Removes a Service from this object.

Capability Level: 0

Parameters:
service - the Service being removed from this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeServices(java.util.Collection<E> services) throws JAXRException
从此对象中移除一个子代 Service 所组成的 Collection。

功能级别：0
services | 将从此对象中移除的 Service 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeServices

void removeServices(Collection services)
                    throws JAXRException
Removes a Collection of children Services from this object.

Capability Level: 0

Parameters:
services - the Collection of Services being removed from this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getServices() throws JAXRException
获取所有子代 Service。

功能级别：0
return | Service 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
associates | <{javax.xml.registry.infomodel.Service}>
link
en
aggregationByValue
See also | javax.xml.registry.infomodel.Service
英文文档：

getServices

Collection getServices()
                       throws JAXRException
Gets all children Services.

Capability Level: 0

Returns:
Collection of Service instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Service

public void addChildOrganization(Organization organization) throws JAXRException
添加一个子 Organization。

功能级别：1
organization | 将添加的子 Organization
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addChildOrganization

void addChildOrganization(Organization organization)
                          throws JAXRException
Adds a child Organization.

Capability Level: 1

Parameters:
organization - the child Organization being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addChildOrganizations(java.util.Collection<E> organizations) throws JAXRException
添加一个 Organization 子代所组成的 Collection。

功能级别：1
organizations | 将添加的子 Organization 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addChildOrganizations

void addChildOrganizations(Collection organizations)
                           throws JAXRException
Adds a Collection of Organization children.

Capability Level: 1

Parameters:
organizations - the Collection of child Organizations being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeChildOrganization(Organization organization) throws JAXRException
移除一个子 Organization。

功能级别：1
organization | 将移除的子 Organization
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeChildOrganization

void removeChildOrganization(Organization organization)
                             throws JAXRException
Removes a child Organization.

Capability Level: 1

Parameters:
organization - the child Organization being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeChildOrganizations(java.util.Collection<E> organizations) throws JAXRException
移除一个 Organization 子代所组成的 Collection。

功能级别：1
organizations | 将移除的子 Organization 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeChildOrganizations

void removeChildOrganizations(Collection organizations)
                              throws JAXRException
Removes a Collection of children Organizations.

Capability Level: 1

Parameters:
organizations - the Collection of child Organizations being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getChildOrganizationCount() throws JAXRException
获取子代的数量。

功能级别：1
return | 子代 Organization 的数量
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getChildOrganizationCount

int getChildOrganizationCount()
                              throws JAXRException
Gets number of children.

Capability Level: 1

Returns:
the number of children Organizations
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getChildOrganizations() throws JAXRException
获取所有直接子代 Organization。

功能级别：1
return | Organization 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.Organization
英文文档：

getChildOrganizations

Collection getChildOrganizations()
                                 throws JAXRException
Gets all immediate children Organizations.

Capability Level: 1

Returns:
Collection of Organization instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Organization

public java.util.Collection<E> getDescendantOrganizations() throws JAXRException
获取所有后代 Organization。

功能级别：1
return | Organization 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.Organization
英文文档：

getDescendantOrganizations

Collection getDescendantOrganizations()
                                      throws JAXRException
Gets all descendant Organizations.

Capability Level: 1

Returns:
Collection of Organization instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Organization

public Organization getParentOrganization() throws JAXRException
获取父（容器）Organization。

功能级别：1
return | 父 Organization；如果没有父 Organization，则返回 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getParentOrganization

Organization getParentOrganization()
                                   throws JAXRException
Gets the parent (container) organization.

Capability Level: 1

Returns:
the parent Organization or null if object has no parent Organization
Throws:
JAXRException - If the JAXR provider encounters an internal error

public Organization getRootOrganization() throws JAXRException
获取根 Organization。

功能级别：1
return | 根 Organization；如果没有父 Organization，则返回 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRootOrganization

Organization getRootOrganization()
                                 throws JAXRException
Gets the root organization.

Capability Level: 1

Returns:
the root Organization or null if object has no parent Organization
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PersonName (Java EE 5)

javax.xml.registry.infomodel
Interface PersonName

public interface PersonName

表示某个人的名字。
英文文档：

Represents a person's name.

Author:
Farrukh S. Najmi

Method Summary
String | getFirstName() Gets the first name for this Person.
String | getFullName() Gets the fully formatted name for this person.
String | getLastName() Gets the last name (surname) for this Person.
String | getMiddleName() Gets the middle name for this Person.
void | setFirstName(String firstName) Sets the first name for this Person.
void | setFullName(String fullName) Sets the fully formatted name for this person.
void | setLastName(String lastName) Sets the last name (surname) for this Person.
void | setMiddleName(String middleName) Sets the middle name for this Person.

Method Detail

public String getLastName() throws JAXRException
获取此 Person 的姓氏（姓）。默认值为 NULL 字符串。

功能级别：1
return | 某个人的姓氏
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getLastName

String getLastName()
                   throws JAXRException
Gets the last name (surname) for this Person. Default is a NULL String.

Capability Level: 1

Returns:
the person's last name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setLastName(String lastName) throws JAXRException
设置此 Person 的姓氏（姓）。

功能级别：1
lastName | 某个人的姓氏
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setLastName

void setLastName(String lastName)
                 throws JAXRException
Sets the last name (surname) for this Person.

Capability Level: 1

Parameters:
lastName - the person's last name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getFirstName() throws JAXRException
获取此 Person 的名。默认值为空字符串。

功能级别：1
return | 某个人的名
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getFirstName

String getFirstName()
                    throws JAXRException
Gets the first name for this Person. Default is an empty String.

Capability Level: 1

Returns:
the person's first name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setFirstName(String firstName) throws JAXRException
设置此 Person 的名。

功能级别：1
firstName | 某个人的名
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setFirstName

void setFirstName(String firstName)
                  throws JAXRException
Sets the first name for this Person.

Capability Level: 1

Parameters:
firstName - the person's first name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getMiddleName() throws JAXRException
获取此 Person 的中间名。默认值为空字符串。

功能级别：1
return | 某个人的中间名
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getMiddleName

String getMiddleName()
                     throws JAXRException
Gets the middle name for this Person. Default is an empty String.

Capability Level: 1

Returns:
the person's middle name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setMiddleName(String middleName) throws JAXRException
设置此 Person 的中间名。

功能级别：1
middleName | 某个人的中间名
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setMiddleName

void setMiddleName(String middleName)
                   throws JAXRException
Sets the middle name for this Person.

Capability Level: 1

Parameters:
middleName - the person's middle name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getFullName() throws JAXRException
获得此 Person 的全名。默认值为空字符串。

功能级别：0
return | 某个人的全名
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getFullName

String getFullName()
                   throws JAXRException
Gets the fully formatted name for this person. Default is an empty String.

Capability Level: 0

Returns:
the person's full name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setFullName(String fullName) throws JAXRException
设置此 Person 的全名。

功能级别：0
fullName | 某个人的全名
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setFullName

void setFullName(String fullName)
                 throws JAXRException
Sets the fully formatted name for this person.

Capability Level: 0

Parameters:
fullName - the person's full name
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


PostalAddress (Java EE 5)

javax.xml.registry.infomodel
Interface PostalAddress

All Superinterfaces:
ExtensibleObject
public interface PostalAddress
extends ExtensibleObject

Implements: ExtensibleObject

PostalAddress 是一个简单的可重用实体类，它定义邮政 Address 的属性。
英文文档：

PostalAddress is a simple re-usable entity class that defines attributes of a postal Address.

Author:
Farrukh S. Najmi

Method Summary
String | getCity() Returns the city.
String | getCountry() Returns the country.
String | getPostalCode() Returns the postal or zip code.
ClassificationScheme | getPostalScheme() Returns a user-defined postal scheme for codifying the attributes of PostalAddress.
String | getStateOrProvince() Returns the state or province.
String | getStreet() Returns the street name.
String | getStreetNumber() Returns the street number.
String | getType() Returns the type of address (for example, "headquarters") as a String.
void | setCity(String city) Sets the city.
void | setCountry(String country) Sets the country.
void | setPostalCode(String postalCode) Sets the postal or zip code.
void | setPostalScheme(ClassificationScheme scheme) Sets a user-defined postal scheme for codifying the attributes of PostalAddress.
void | setStateOrProvince(String stateOrProvince) Sets the state or province.
void | setStreet(String street) Sets the street name.
void | setStreetNumber(String streetNumber) Sets the street number.
void | setType(String type) Sets the type of address (for example, "headquarters") as a String.
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public String getStreet() throws JAXRException
返回街道名称。默认值为空字符串。

功能级别：0
return | 街道名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getStreet

String getStreet()
                 throws JAXRException
Returns the street name. Default is an empty String.

Capability Level: 0

Returns:
the street name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setStreet(String street) throws JAXRException
设置街道名称。

功能级别：0
street | 街道名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setStreet

void setStreet(String street)
               throws JAXRException
Sets the street name.

Capability Level: 0

Parameters:
street - the street name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getStreetNumber() throws JAXRException
返回街道编号。默认值为空字符串。

功能级别：0
return | 街道编号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getStreetNumber

String getStreetNumber()
                       throws JAXRException
Returns the street number. Default is an empty String.

Capability Level: 0

Returns:
the street number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setStreetNumber(String streetNumber) throws JAXRException
设置街道编号。

功能级别：0
streetNumber | 街道编号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setStreetNumber

void setStreetNumber(String streetNumber)
                     throws JAXRException
Sets the street number.

Capability Level: 0

Parameters:
streetNumber - the street number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getCity() throws JAXRException
返回城市。默认值为空字符串。

功能级别：0
return | 城市
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getCity

String getCity()
               throws JAXRException
Returns the city. Default is an empty String.

Capability Level: 0

Returns:
the city
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setCity(String city) throws JAXRException
设置城市。

功能级别：0
city | 城市
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setCity

void setCity(String city)
             throws JAXRException
Sets the city.

Capability Level: 0

Parameters:
city - the city
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getStateOrProvince() throws JAXRException
返回州或省。默认值为空字符串。

功能级别：0
return | 州或省
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getStateOrProvince

String getStateOrProvince()
                          throws JAXRException
Returns the state or province. Default is an empty String.

Capability Level: 0

Returns:
the state or province
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setStateOrProvince(String stateOrProvince) throws JAXRException
设置州或省。

功能级别：0
stateOrProvince | 州或省
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setStateOrProvince

void setStateOrProvince(String stateOrProvince)
                        throws JAXRException
Sets the state or province.

Capability Level: 0

Parameters:
stateOrProvince - the state or province
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getPostalCode() throws JAXRException
返回邮政编码。默认值为空字符串。

功能级别：0
return | 邮政编码（例如，US 邮编）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getPostalCode

String getPostalCode()
                     throws JAXRException
Returns the postal or zip code. Default is an empty String.

Capability Level: 0

Returns:
the postal code (e.g. US zip code)
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setPostalCode(String postalCode) throws JAXRException
设置邮政编码。

功能级别：0
postalCode | 邮政编码（例如，US 邮编）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setPostalCode

void setPostalCode(String postalCode)
                   throws JAXRException
Sets the postal or zip code.

Capability Level: 0

Parameters:
postalCode - the postal code (e.g. US zip code)
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getCountry() throws JAXRException
返回国家。默认值为空字符串。

功能级别：0
return | 国家
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getCountry

String getCountry()
                  throws JAXRException
Returns the country. Default is an empty String.

Capability Level: 0

Returns:
the country
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setCountry(String country) throws JAXRException
设置国家。

功能级别：0
country | 国家
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setCountry

void setCountry(String country)
                throws JAXRException
Sets the country.

Capability Level: 0

Parameters:
country - the country
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getType() throws JAXRException
以 String 形式返回地址类型（例如，"headquarters"）。

功能级别：0
return | 此 PostalAddress 的类型。这是一个任意字符串（例如 "Home"、"Office"）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getType

String getType()
               throws JAXRException
Returns the type of address (for example, "headquarters") as a String.

Capability Level: 0

Returns:
the type for this PostalAddress. This is an arbitrary String (e.g. "Home", "Office")
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setType(String type) throws JAXRException
以 String 形式设置地址类型（例如，"headquarters"）。

功能级别：0
type | 此 PostalAddress 的类型。这是一个任意字符串（例如 "Home"、"Office"）
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setType

void setType(String type)
             throws JAXRException
Sets the type of address (for example, "headquarters") as a String.

Capability Level: 0

Parameters:
type - the type for this PostalAddress. This is an arbitrary String (e.g. "Home", "Office")
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setPostalScheme(ClassificationScheme scheme) throws JAXRException
设置用于对 PostalAddress 的属性进行编码的用户定义的邮政方案。

功能级别：0
scheme | 用户定义的邮政方案。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setPostalScheme

void setPostalScheme(ClassificationScheme scheme)
                     throws JAXRException
Sets a user-defined postal scheme for codifying the attributes of PostalAddress.

Capability Level: 0

Parameters:
scheme - the user defined postal scheme.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public ClassificationScheme getPostalScheme() throws JAXRException
返回用于对 PostalAddress 属性进行编码的用户定义的邮政方案。如果没有为此对象定义邮政方案，则必须返回 RegistryService#getDefaultPostalScheme() 所返回的默认值

功能级别：0
return | 用户定义的邮政方案。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | getDefaultPostalScheme()
英文文档：

getPostalScheme

ClassificationScheme getPostalScheme()
                                     throws JAXRException
Returns a user-defined postal scheme for codifying the attributes of PostalAddress. If none is defined for this object, then must return the default value returned by RegistryService#getDefaultPostalScheme()

Capability Level: 0

Returns:
the user defined postal scheme.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryService.getDefaultPostalScheme()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RegistryEntry (Java EE 5)

javax.xml.registry.infomodel
Interface RegistryEntry

All Superinterfaces:
ExtensibleObject, RegistryObject, Versionable
All Known Subinterfaces:
ClassificationScheme, ExtrinsicObject, RegistryPackage, Service
public interface RegistryEntry
extends RegistryObject, Versionable

Implements: RegistryObject, Versionable
Implemented by: ClassificationScheme, ExtrinsicObject, RegistryPackage, Service

RegistryEntry 接口是模型中各个接口的基本接口，除了 RegistryObject 接口提供的元数据以外，该模型还需要其他元数据。模型中的少数接口表示注册表中的高级（粗粒度）对象，该注册表需要其他元数据，比如版本信息和指示稳定性和易失性的信息。
英文文档：

The RegistryEntry interface is a base interface for interfaces in the model that require additional metadata beyond what is provided by the RegistryObject interface. A few interfaces in the model represent high level (coarse grain) objects in the registry that require additional metadata such as version information and indication of the stability or volatility of the information.

Author:
Farrukh S. Najmi

Field Summary
static int | STABILITY_DYNAMIC RegistryEntry may change at any time.
static int | STABILITY_DYNAMIC_COMPATIBLE RegistryEntry may change at any time, however the changes will be backward compatible.
static int | STABILITY_STATIC RegistryEntry will not change.
static int | STATUS_APPROVED RegistryEntry has been submitted and approved.
static int | STATUS_DEPRECATED RegistryEntry has been deprecated.
static int | STATUS_SUBMITTED RegistryEntry has been submitted.
static int | STATUS_WITHDRAWN RegistryEntry has been withdrawn by the submitter.
Method Summary
Date | getExpiration() Gets expirationDate attribute of the RegistryEntry within the Registry.
int | getStability() Gets the stability indicator for the RegistryEntry within the Registry.
int | getStatus() Gets the life cycle status of the RegistryEntry within the registry.
void | setExpiration(Date expiration) Sets the expirationDate.
void | setStability(int stability) Sets the stability indicator for the RegistryEntry.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots
Methods inherited from interface javax.xml.registry.infomodel.Versionable
getMajorVersion, getMinorVersion, getUserVersion, setMajorVersion, setMinorVersion, setUserVersion

Field Detail

英文文档：

STATUS_SUBMITTED

static final int STATUS_SUBMITTED
RegistryEntry has been submitted.

See Also:
Constant Field Values

英文文档：

STATUS_APPROVED

static final int STATUS_APPROVED
RegistryEntry has been submitted and approved.

See Also:
Constant Field Values

英文文档：

STATUS_DEPRECATED

static final int STATUS_DEPRECATED
RegistryEntry has been deprecated.

See Also:
Constant Field Values

英文文档：

STATUS_WITHDRAWN

static final int STATUS_WITHDRAWN
RegistryEntry has been withdrawn by the submitter.

See Also:
Constant Field Values

英文文档：

STABILITY_DYNAMIC

static final int STABILITY_DYNAMIC
RegistryEntry may change at any time.

See Also:
Constant Field Values

英文文档：

STABILITY_DYNAMIC_COMPATIBLE

static final int STABILITY_DYNAMIC_COMPATIBLE
RegistryEntry may change at any time, however the changes will be backward compatible.

See Also:
Constant Field Values

英文文档：

STABILITY_STATIC

static final int STABILITY_STATIC
RegistryEntry will not change.

See Also:
Constant Field Values
Method Detail

public int getStatus() throws JAXRException
获取注册表中 RegistryEntry 的生命周期状态。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
See
en
RegistryEntry#STATUS_SUBMITTED
return | 整数枚举形式的生命周期状态
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getStatus

int getStatus()
              throws JAXRException
Gets the life cycle status of the RegistryEntry within the registry.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Returns:
the life cycle status as an integer enumeration
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getStability() throws JAXRException
获取 Registry 中 RegistryEntry 的稳定性指示符。稳定性指示符由提交者提供，它指示内容的稳定性级别。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
return | 整数枚举形式的稳定性指示符
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | STABILITY_DYNAMIC
英文文档：

getStability

int getStability()
                 throws JAXRException
Gets the stability indicator for the RegistryEntry within the Registry. The stability indicator is provided by the submitter as an indication of the level of stability for the content.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Returns:
the stability indicator as an integer enumeration
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
STABILITY_DYNAMIC

public void setStability(int stability) throws JAXRException
设置 RegistryEntry 的稳定性指示符。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
stability | 稳定性指示符
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setStability

void setStability(int stability)
                  throws JAXRException
Sets the stability indicator for the RegistryEntry.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Parameters:
stability - the stability indicator
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Date getExpiration() throws JAXRException
获取 Registry 中 RegistryEntry 的 expirationDate 属性。此属性对稳定性属性提供的稳定性指示定义了一个时间限制。到达 expirationDate 时间后，生效的稳定性属性变为 STABILITY_DYNAMIC，这意味着内容可能在任意时间以任意方式发生更改。null 值意味着稳定性属性没有到期时间。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
return | 稳定性指示符的到期 Date
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getExpiration

Date getExpiration()
                   throws JAXRException
Gets expirationDate attribute of the RegistryEntry within the Registry. This attribute defines a time limit upon the stability indication provided by the stability attribute. Once the expirationDate has been reached the stability attribute in effect becomes STABILITY_DYNAMIC implying that content can change at any time and in any manner. A null value implies that there is no expiration on stability attribute.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Returns:
the expiration Date for the stability indicator
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setExpiration(java.util.Date expiration) throws JAXRException
设置 expirationDate。

功能级别：1
expiration | 稳定性指示符的到期 Date
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setExpiration

void setExpiration(Date expiration)
                   throws JAXRException
Sets the expirationDate.

Capability Level: 1

Parameters:
expiration - the expiration Date for the stability indicator
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RegistryObject (Java EE 5)

javax.xml.registry.infomodel
Interface RegistryObject

All Superinterfaces:
ExtensibleObject
All Known Subinterfaces:
Association, AuditableEvent, Classification, ClassificationScheme, Concept, ExternalIdentifier, ExternalLink, ExtrinsicObject, Organization, RegistryEntry, RegistryPackage, Service, ServiceBinding, SpecificationLink, User
public interface RegistryObject
extends ExtensibleObject

Implements: ExtensibleObject
Implemented by: Association, AuditableEvent, Classification, Concept, ExternalIdentifier, ExternalLink, Organization, RegistryEntry, ServiceBinding, SpecificationLink, User

RegistryObject 类是模型中大多数类使用的抽象基类。它提供注册表对象所需的最少的元数据。它还提供了一些访问相关对象的方法，这些方法为注册表对象提供其他动态元数据。
See also javax.xml.registry.infomodel.RegistryEntry
英文文档：

The RegistryObject class is an abstract base class used by most classes in the model. It provides minimal metadata for registry objects. It also provides methods for accessing related objects that provide additional dynamic metadata for the registry object.

Author:
Farrukh S. Najmi
See Also:
RegistryEntry

Method Summary
void | addAssociation(Association association) Adds specified Association to use this object as source.
void | addAssociations(Collection associations) Adds specified Associations to use this object as source.
void | addClassification(Classification classification) Adds specified Classification to this object.
void | addClassifications(Collection classifications) Adds specified Classifications to this object.
void | addExternalIdentifier(ExternalIdentifier externalIdentifier) Adds specified ExternalIdentifier as an external identifier to this object.
void | addExternalIdentifiers(Collection externalIdentifiers) Adds specified ExternalIdentifiers as an external identifiers to this object.
void | addExternalLink(ExternalLink externalLink) Adds specified ExternalLink to this object.
void | addExternalLinks(Collection externalLinks) Adds specified ExternalLinks to this object.
Collection | getAssociatedObjects() Returns the collection of RegistryObject instances associated with this object.
Collection | getAssociations() Gets all Associations where this object is source.
Collection | getAuditTrail() Returns the complete audit trail of all requests that effected a state change in this object as an ordered Collection of AuditableEvent objects.
Collection | getClassifications() Gets the Classification instances that classify this object.
InternationalString | getDescription() Gets the textual description for this object.
Collection | getExternalIdentifiers() Returns the ExternalIdentifiers associated with this object that are external identifiers for this object.
Collection | getExternalLinks() Returns the ExternalLinks associated with this object.
Key | getKey() Gets the key representing the universally unique ID (UUID) for this object.
LifeCycleManager | getLifeCycleManager() Returns the LifeCycleManager that created this object.
InternationalString | getName() Gets the user-friendly name of this object.
Concept | getObjectType() Gets the object type that best describes the RegistryObject.
Collection | getRegistryPackages() Returns the Package associated with this object.
Organization | getSubmittingOrganization() Gets the Organization that submitted this RegistryObject.
void | removeAssociation(Association association) Removes specified Association from this object.
void | removeAssociations(Collection associations) Removes specified Associations from this object.
void | removeClassification(Classification classification) Removes specified Classification from this object.
void | removeClassifications(Collection classifications) Removes specified Classifications from this object.
void | removeExternalIdentifier(ExternalIdentifier externalIdentifier) Removes specified ExternalIdentifier as an external identifier from this object.
void | removeExternalIdentifiers(Collection externalIdentifiers) Removes specified ExternalIdentifiers as an external identifiers from this object.
void | removeExternalLink(ExternalLink externalLink) Removes specified ExternalLink from this object.
void | removeExternalLinks(Collection externalLinks) Removes specified ExternalLinks from this object.
void | setAssociations(Collection associations) Replaces all previous Associations from this object with specified Associations.
void | setClassifications(Collection classifications) Replaces all previous Classifications with specified Classifications.
void | setDescription(InternationalString description) Sets the context independent textual description for this object.
void | setExternalIdentifiers(Collection externalIdentifiers) Replaces all previous external identifiers with specified Collection of ExternalIdentifiers as an external identifier.
void | setExternalLinks(Collection externalLinks) Replaces all previous ExternalLinks with specified ExternalLinks.
void | setKey(Key key) Sets the key representing the universally unique ID (UUID) for this object.
void | setName(InternationalString name) Sets user-friendly name of object in repository.
String | toXML() Returns a registry provider specific XML representation of this Object.
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public Key getKey() throws JAXRException
获取表示此对象的通用唯一 ID (UUID) 的键。

功能级别：0
return | 此对象的 Key
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getKey

Key getKey()
           throws JAXRException
Gets the key representing the universally unique ID (UUID) for this object.

Capability Level: 0

Returns:
the Key for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public InternationalString getDescription() throws JAXRException
获取此对象的文本描述。

功能级别：0
return | 此对象的描述，不得为 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getDescription

InternationalString getDescription()
                                   throws JAXRException
Gets the textual description for this object.

Capability Level: 0

Returns:
the description for this object which must not be null
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setDescription(InternationalString description) throws JAXRException
设置此对象与上下文无关的文本描述。

功能级别：0
description | 此对象的描述
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setDescription

void setDescription(InternationalString description)
                    throws JAXRException
Sets the context independent textual description for this object.

Capability Level: 0

Parameters:
description - the description for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public InternationalString getName() throws JAXRException
获取此对象用户友好的名称。

功能级别：0
return | 此对象的名称，不得为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getName

InternationalString getName()
                            throws JAXRException
Gets the user-friendly name of this object.

Capability Level: 0

Returns:
the name for this object which must not be null.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setName(InternationalString name) throws JAXRException
设置存储库中对象的用户友好的名称。

功能级别：0
name | 此对象的名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setName

void setName(InternationalString name)
             throws JAXRException
Sets user-friendly name of object in repository.

Capability Level: 0

Parameters:
name - the name for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setKey(Key key) throws JAXRException
设置表示此对象的通用唯一 ID (UUID) 的键。

功能级别：0
key | 此对象的键
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setKey

void setKey(Key key)
            throws JAXRException
Sets the key representing the universally unique ID (UUID) for this object.

Capability Level: 0

Parameters:
key - the key for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String toXML() throws JAXRException
返回此 Object 的特定于注册表提供者的 XML 表示形式。无法通过 API 访问特定于提供者的信息元素时，可以将此方法用作获取这些信息的秘密途径。实现可以选择抛出 UnsupportedCapabilityException。

功能级别：0
return | 包含此对象 XML 表示形式的 String
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

toXML

String toXML()
             throws JAXRException
Returns a registry provider specific XML representation of this Object. This may be used as a last resort back door way to get to a provider specific information element that is not accessible via the API. Implementation may choose to throw a UnsupportedCapabilityException.

Capability Level: 0

Returns:
the String containing the XML representation for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addClassification(Classification classification) throws JAXRException
将指定 Classification 添加到此对象。使用此对象的引用直接替换 Classification 中的 classifiedObject。

功能级别：0
classification | 将添加的 Classification
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addClassification

void addClassification(Classification classification)
                       throws JAXRException
Adds specified Classification to this object. Silently replaces the classifiedObject in Classification with reference to this object.

Capability Level: 0

Parameters:
classification - the Classification being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addClassifications(java.util.Collection<E> classifications) throws JAXRException
将指定的 Classification 添加到此对象。使用此对象的引用直接替换 Classification 中的 classifiedObject。

功能级别：0
classifications | 将要添加的 Classification 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addClassifications

void addClassifications(Collection classifications)
                        throws JAXRException
Adds specified Classifications to this object. Silently replaces the classifiedObject in Classifications with reference to this object.

Capability Level: 0

Parameters:
classifications - the Collection of Classifications being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeClassification(Classification classification) throws JAXRException
从此对象中移除指定的 Classification。

功能级别：0
classification | 将移除的 Classification
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeClassification

void removeClassification(Classification classification)
                          throws JAXRException
Removes specified Classification from this object.

Capability Level: 0

Parameters:
classification - the Classification being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeClassifications(java.util.Collection<E> classifications) throws JAXRException
从此对象中移除指定的 Classification。

功能级别：0
classifications | 将移除的 Classification 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeClassifications

void removeClassifications(Collection classifications)
                           throws JAXRException
Removes specified Classifications from this object.

Capability Level: 0

Parameters:
classifications - the Collection of Classifications being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setClassifications(java.util.Collection<E> classifications) throws JAXRException
用指定的 Classification 替换以前所有的 Classification。

功能级别：0
classifications | 将设置的 Classification 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setClassifications

void setClassifications(Collection classifications)
                        throws JAXRException
Replaces all previous Classifications with specified Classifications.

Capability Level: 0

Parameters:
classifications - the Collection of Classifications being set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getClassifications() throws JAXRException
获取对此对象进行分类的 Classification 实例。

功能级别：0
return | Classification 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
link
en
aggregationByValue
associates | <{Classification}>
supplierCardinality | 0..*
label
en
classifications
See also | javax.xml.registry.infomodel.Classification
英文文档：

getClassifications

Collection getClassifications()
                              throws JAXRException
Gets the Classification instances that classify this object.

Capability Level: 0

Returns:
Collection of Classification instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Classification

public java.util.Collection<E> getAuditTrail() throws JAXRException
以 AuditableEvent 对象的有序 Collection 形式返回引起此对象状态更改的所有请求的完整审计追踪。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
return | AuditableEvent 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
link
en
aggregationByValue
associates | <{AuditableEvent}>
supplierCardinality | 1..*
label
en
auditTrail
See also | javax.xml.registry.infomodel.AuditableEvent
英文文档：

getAuditTrail

Collection getAuditTrail()
                         throws JAXRException
Returns the complete audit trail of all requests that effected a state change in this object as an ordered Collection of AuditableEvent objects.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Returns:
Collection of AuditableEvent instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
AuditableEvent

public void addAssociation(Association association) throws JAXRException
添加指定的 Association，使用此对象作为源。使用此对象的引用直接替换 Association 中的 sourceObject。

功能级别：0
association | 将添加的 Association
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addAssociation

void addAssociation(Association association)
                    throws JAXRException
Adds specified Association to use this object as source. Silently replaces the sourceObject in Association with reference to this object.

Capability Level: 0

Parameters:
association - the Association being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addAssociations(java.util.Collection<E> associations) throws JAXRException
添加指定的 Association，使用此对象作为源。使用此对象的引用直接替换 Association 中的 sourceObject。

功能级别：0
associations | 将添加的 Association 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addAssociations

void addAssociations(Collection associations)
                     throws JAXRException
Adds specified Associations to use this object as source. Silently replaces the sourceObject in Associations with reference to this object.

Capability Level: 0

Parameters:
associations - the Collection of Associations being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeAssociation(Association association) throws JAXRException
从此对象中移除指定的 Association。

功能级别：0
association | 将移除的 Association
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeAssociation

void removeAssociation(Association association)
                       throws JAXRException
Removes specified Association from this object.

Capability Level: 0

Parameters:
association - the Association being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeAssociations(java.util.Collection<E> associations) throws JAXRException
从此对象中移除指定的 Association。

功能级别：0
associations | 将移除的 Association 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeAssociations

void removeAssociations(Collection associations)
                        throws JAXRException
Removes specified Associations from this object.

Capability Level: 0

Parameters:
associations - the Collection of Associations being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setAssociations(java.util.Collection<E> associations) throws JAXRException
用指定的 Association 替换此对象中所有以前的 Association。

功能级别：0
associations | 将设置的 Association 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setAssociations

void setAssociations(Collection associations)
                     throws JAXRException
Replaces all previous Associations from this object with specified Associations.

Capability Level: 0

Parameters:
associations - the Collection of Associations being set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getAssociations() throws JAXRException
获取使用此对象作为源的所有 Association。

功能级别：0
return | Association 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | javax.xml.registry.infomodel.Association
英文文档：

getAssociations

Collection getAssociations()
                           throws JAXRException
Gets all Associations where this object is source.

Capability Level: 0

Returns:
Collection of Association instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
Association

public java.util.Collection<E> getAssociatedObjects() throws JAXRException
返回与此对象关联的 RegistryObject 实例所组成的 Collection。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
return | RegistryObject 实例组成的 CollectionCollection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associationAsClass | <{Association}>
supplierCardinality | 0..*
clientCardinality | 0..*
associates | <{RegistryObject}>
undirected
label
en
associatedObjects
See also | javax.xml.registry.infomodel.RegistryObject
英文文档：

getAssociatedObjects

Collection getAssociatedObjects()
                                throws JAXRException
Returns the collection of RegistryObject instances associated with this object.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Returns:
Collection of RegistryObject instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryObject

public void addExternalIdentifier(ExternalIdentifier externalIdentifier) throws JAXRException
添加指定的 ExternalIdentifier，将它作为此对象的外部标识符。使用此对象的引用直接替换 ExternalIdentifier 中的 registryObject。

功能级别：0
externalIdentifier | 将添加的 ExternalIdentifier
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addExternalIdentifier

void addExternalIdentifier(ExternalIdentifier externalIdentifier)
                           throws JAXRException
Adds specified ExternalIdentifier as an external identifier to this object. Silently replaces the registryObject in ExternalIdentifier with reference to this object.

Capability Level: 0

Parameters:
externalIdentifier - the ExternalIdentifier being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addExternalIdentifiers(java.util.Collection<E> externalIdentifiers) throws JAXRException
添加指定的 ExternalIdentifier，将它作为此对象的外部标识符。使用此对象的引用直接替换 ExternalIdentifier 中的 registryObject。

功能级别：0
externalIdentifiers | 将添加的 ExternalIdentifier 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addExternalIdentifiers

void addExternalIdentifiers(Collection externalIdentifiers)
                            throws JAXRException
Adds specified ExternalIdentifiers as an external identifiers to this object. Silently replaces the registryObject in ExternalIdentifiers with reference to this object.

Capability Level: 0

Parameters:
externalIdentifiers - the Collection of ExternalIdentifiers being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeExternalIdentifier(ExternalIdentifier externalIdentifier) throws JAXRException
从此对象中移除作为外部标识符的指定 ExternalIdentifier。

功能级别：0
externalIdentifier | 将移除的 ExternalIdentifier
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeExternalIdentifier

void removeExternalIdentifier(ExternalIdentifier externalIdentifier)
                              throws JAXRException
Removes specified ExternalIdentifier as an external identifier from this object.

Capability Level: 0

Parameters:
externalIdentifier - the ExternalIdentifier being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeExternalIdentifiers(java.util.Collection<E> externalIdentifiers) throws JAXRException
从此对象中移除作为外部标识符的指定 ExternalIdentifier。

功能级别：0
externalIdentifiers | 将移除的 ExternalIdentifier 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeExternalIdentifiers

void removeExternalIdentifiers(Collection externalIdentifiers)
                               throws JAXRException
Removes specified ExternalIdentifiers as an external identifiers from this object.

Capability Level: 0

Parameters:
externalIdentifiers - the Collection of ExternalIdentifiers being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setExternalIdentifiers(java.util.Collection<E> externalIdentifiers) throws JAXRException
使用作为外部标识符的指定 ExternalIdentifier 所组成的 Collection 替换以前所有的外部标识符。

功能级别：0
externalIdentifiers | 将设置的 ExternalIdentifier 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setExternalIdentifiers

void setExternalIdentifiers(Collection externalIdentifiers)
                            throws JAXRException
Replaces all previous external identifiers with specified Collection of ExternalIdentifiers as an external identifier.

Capability Level: 0

Parameters:
externalIdentifiers - the Collection of ExternalIdentifiers being set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getExternalIdentifiers() throws JAXRException
返回与此对象关联的 ExternalIdentifier，它们是此对象的外部标识符。

功能级别：0
return | ExternalIdentifier 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{ExternalIdentifier}>
supplierCardinality | 0..*
undirected
supplierRole
en
externalIdentifiers
link
en
aggregationByValue
See also | javax.xml.registry.infomodel.ExternalIdentifier
英文文档：

getExternalIdentifiers

Collection getExternalIdentifiers()
                                  throws JAXRException
Returns the ExternalIdentifiers associated with this object that are external identifiers for this object.

Capability Level: 0

Returns:
Collection of ExternalIdentifier instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
ExternalIdentifier

public void addExternalLink(ExternalLink externalLink) throws JAXRException
将指定的 ExternalLink 添加到此对象。

功能级别：0
externalLinks | 将添加的 ExternalLink
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addExternalLink

void addExternalLink(ExternalLink externalLink)
                     throws JAXRException
Adds specified ExternalLink to this object.

Capability Level: 0

Parameters:
externalLinks - the ExternalLink being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addExternalLinks(java.util.Collection<E> externalLinks) throws JAXRException
将指定的 ExternalLink 添加到此对象。

功能级别：0
externalLinks | 将添加的 ExternalLink 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addExternalLinks

void addExternalLinks(Collection externalLinks)
                      throws JAXRException
Adds specified ExternalLinks to this object.

Capability Level: 0

Parameters:
externalLinks - the Collection of ExternalLinks being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeExternalLink(ExternalLink externalLink) throws JAXRException
从此对象中移除指定的 ExternalLink。

功能级别：0
externalLink | 将移除的 ExternalLink
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeExternalLink

void removeExternalLink(ExternalLink externalLink)
                        throws JAXRException
Removes specified ExternalLink from this object.

Capability Level: 0

Parameters:
externalLink - the ExternalLink being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeExternalLinks(java.util.Collection<E> externalLinks) throws JAXRException
从此对象中移除指定的 ExternalLink。

功能级别：0
externalLinks | 将移除的 ExternalLink 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeExternalLinks

void removeExternalLinks(Collection externalLinks)
                         throws JAXRException
Removes specified ExternalLinks from this object.

Capability Level: 0

Parameters:
externalLinks - the Collection of ExternalLinks being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setExternalLinks(java.util.Collection<E> externalLinks) throws JAXRException
用指定的 ExternalLink 替换以前所有的 ExternalLink。

功能级别：0
externalLink | 将设置的 ExternalLink 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setExternalLinks

void setExternalLinks(Collection externalLinks)
                      throws JAXRException
Replaces all previous ExternalLinks with specified ExternalLinks.

Capability Level: 0

Parameters:
externalLink - the Collection of ExternalLinks being set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getExternalLinks() throws JAXRException
返回与此对象关联的 ExternalLink。

功能级别：0
return | ExternalLink 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associationAsClass | <{Association}>
associates | <{ExternalLink}>
supplierCardinality | 0..*
clientCardinality | 1..*
undirected
supplierRole
en
externalLinks
clientRole
en
linkedObjects
See also | javax.xml.registry.infomodel.ExternalLink
英文文档：

getExternalLinks

Collection getExternalLinks()
                            throws JAXRException
Returns the ExternalLinks associated with this object.

Capability Level: 0

Returns:
Collection of ExternalLink instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
ExternalLink

public Concept getObjectType() throws JAXRException
获取最能说明 RegistryObject 的对象类型。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
return | 对象类型，它是名为 ObjectType 的预定义 ClassificationScheme 中的一个 Concept
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getObjectType

Concept getObjectType()
                      throws JAXRException
Gets the object type that best describes the RegistryObject.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Returns:
the object type as a Concept within the pre-defined ClassificationScheme named ObjectType
Throws:
JAXRException - If the JAXR provider encounters an internal error

public Organization getSubmittingOrganization() throws JAXRException
获取已提交此 RegistryObject 的 Organization。
return | 已将此对象提交到注册表的 Organization
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getSubmittingOrganization

Organization getSubmittingOrganization()
                                       throws JAXRException
Gets the Organization that submitted this RegistryObject.

Returns:
the Organization that submitted this object to the registry
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getRegistryPackages() throws JAXRException
返回与此对象关联的 Package。

功能级别：1
在更低的功能级别中，此方法必须抛出 UnsupportedCapabilityException。
return | RegistryPackage 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 0..*
clientCardinality | 1..*
associates | <{RegistryPackage}>
undirected
clientRole
en
memberObjects
supplierRole
en
packages
associationAsClass | <{Association}>
See also | javax.xml.registry.infomodel.RegistryPackage
英文文档：

getRegistryPackages

Collection getRegistryPackages()
                               throws JAXRException
Returns the Package associated with this object.

Capability Level: 1
This method must throw UnsupportedCapabilityException in lower capability levels.

Returns:
Collection of RegistryPackage instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryPackage

public LifeCycleManager getLifeCycleManager() throws JAXRException
返回创建此对象的 LifeCycleManager。

功能级别：0
return | 创建此对象的 LifeCycleManager 对象
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getLifeCycleManager

LifeCycleManager getLifeCycleManager()
                                     throws JAXRException
Returns the LifeCycleManager that created this object.

Capability Level: 0

Returns:
the LifeCycleManager objet that created this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


RegistryPackage (Java EE 5)

javax.xml.registry.infomodel
Interface RegistryPackage

All Superinterfaces:
ExtensibleObject, RegistryEntry, RegistryObject, Versionable
public interface RegistryPackage
extends RegistryEntry

Implements: RegistryEntry

RegistryPackage 实例是将逻辑相关的 RegistryEntry 组织在一起的 RegistryEntry。一个包可以包含任意数量的 RegistryObject。RegistryObject 可以是任意数量的 Package 的成员。
See also javax.xml.registry.infomodel.RegistryObject
英文文档：

RegistryPackage instances are RegistryEntries that group logically related RegistryEntries together. A package may contain any number of RegistryObjects. A RegistryObject may be a member of any number of Packages.

Author:
Farrukh S. Najmi
See Also:
RegistryObject

Field Summary
Fields inherited from interface javax.xml.registry.infomodel.RegistryEntry
STABILITY_DYNAMIC, STABILITY_DYNAMIC_COMPATIBLE, STABILITY_STATIC, STATUS_APPROVED, STATUS_DEPRECATED, STATUS_SUBMITTED, STATUS_WITHDRAWN
Method Summary
void | addRegistryObject(RegistryObject registryObject) Adds a child RegistryObject as member.
void | addRegistryObjects(Collection registryObjects) Adds a Collection of RegistryObject children as members.
Set | getRegistryObjects() Gets the collection of member RegistryObjects of this RegistryPackage.
void | removeRegistryObject(RegistryObject registryObject) Removes a child RegistryObject from membership.
void | removeRegistryObjects(Collection registryObjects) Removes a Collection of children RegistryObjects from membership.
Methods inherited from interface javax.xml.registry.infomodel.RegistryEntry
getExpiration, getStability, getStatus, setExpiration, setStability
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots
Methods inherited from interface javax.xml.registry.infomodel.Versionable
getMajorVersion, getMinorVersion, getUserVersion, setMajorVersion, setMinorVersion, setUserVersion

Method Detail

public void addRegistryObject(RegistryObject registryObject) throws JAXRException
添加一个子 RegistryObject 作为成员。

功能级别：1
registryObject | 将添加的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addRegistryObject

void addRegistryObject(RegistryObject registryObject)
                       throws JAXRException
Adds a child RegistryObject as member.

Capability Level: 1

Parameters:
registryObject - the RegistryObject being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addRegistryObjects(java.util.Collection<E> registryObjects) throws JAXRException
添加一个 RegistryObject 子代所组成的 Collection 作为成员。

功能级别：1
registryObjects | 将添加的 RegistryObject 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addRegistryObjects

void addRegistryObjects(Collection registryObjects)
                        throws JAXRException
Adds a Collection of RegistryObject children as members.

Capability Level: 1

Parameters:
registryObjects - the Collection of RegistryObjects being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeRegistryObject(RegistryObject registryObject) throws JAXRException
从成员关系中移除一个子 RegistryObject。

功能级别：1
registryObject | 将移除的 RegistryObject
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeRegistryObject

void removeRegistryObject(RegistryObject registryObject)
                          throws JAXRException
Removes a child RegistryObject from membership.

Capability Level: 1

Parameters:
registryObject - the RegistryObject being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeRegistryObjects(java.util.Collection<E> registryObjects) throws JAXRException
从成员关系中移除一个子代 RegistryObject 所组成的 Collection。

功能级别：1
registryObjects | 将移除的 RegistryObject 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeRegistryObjects

void removeRegistryObjects(Collection registryObjects)
                           throws JAXRException
Removes a Collection of children RegistryObjects from membership.

Capability Level: 1

Parameters:
registryObjects - the Collection of RegistryObject being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Set<E> getRegistryObjects() throws JAXRException
获取此 RegistryPackage 的成员 RegistryObject 所组成的 Collection。

功能级别：1
return | 作为此对象的成员的 RegistryObject 所组成的 Set
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getRegistryObjects

Set getRegistryObjects()
                       throws JAXRException
Gets the collection of member RegistryObjects of this RegistryPackage.

Capability Level: 1

Returns:
the Set of RegistryObjects that are members of this object
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Service (Java EE 5)

javax.xml.registry.infomodel
Interface Service

All Superinterfaces:
ExtensibleObject, RegistryEntry, RegistryObject, Versionable
public interface Service
extends RegistryEntry

Implements: RegistryEntry

Service 实例是提供关于 Organization 所提供服务（例如，Web 服务）的信息的 RegistryObject。一个 Service 可以包含一组 ServiceBinding 实例。映射到 UDDI 中的 BusinessService。
See also javax.xml.registry.infomodel.ServiceBinding
英文文档：

Service instances are RegistryObjects that provide information on services (for example, web services) offered by an Organization. A Service may have a set of ServiceBinding instances. Maps to a BusinessService in UDDI.

Author:
Farrukh S. Najmi
See Also:
ServiceBinding

Field Summary
Fields inherited from interface javax.xml.registry.infomodel.RegistryEntry
STABILITY_DYNAMIC, STABILITY_DYNAMIC_COMPATIBLE, STABILITY_STATIC, STATUS_APPROVED, STATUS_DEPRECATED, STATUS_SUBMITTED, STATUS_WITHDRAWN
Method Summary
void | addServiceBinding(ServiceBinding serviceBinding) Adds a child ServiceBinding.
void | addServiceBindings(Collection serviceBindings) Adds a Collection of ServiceBinding children.
Organization | getProvidingOrganization() Gets the Organization that provides this service.
Collection | getServiceBindings() Gets all children ServiceBindings.
void | removeServiceBinding(ServiceBinding serviceBinding) Removes a child ServiceBinding.
void | removeServiceBindings(Collection serviceBindings) Removes a Collection of children ServiceBindings.
void | setProvidingOrganization(Organization providingOrganization) Sets the Organization that provides this service.
Methods inherited from interface javax.xml.registry.infomodel.RegistryEntry
getExpiration, getStability, getStatus, setExpiration, setStability
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots
Methods inherited from interface javax.xml.registry.infomodel.Versionable
getMajorVersion, getMinorVersion, getUserVersion, setMajorVersion, setMinorVersion, setUserVersion

Method Detail

public Organization getProvidingOrganization() throws JAXRException
获取提供此服务的 Organization。提供服务的 Organization 可以为 null。提供服务的 Organization 可以不同于 RegistryObject#getSubmittingOrganization 定义的 Submitting Organization。

功能级别：0
return | 提供此服务的 Organization
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | getSubmittingOrganization()
英文文档：

getProvidingOrganization

Organization getProvidingOrganization()
                                      throws JAXRException
Gets the Organization that provides this service. Providing Organization may be null. The providing Organization may be different from the Submitting Organization as defined by RegistryObject#getSubmittingOrganization.

Capability Level: 0

Returns:
the Organization that provides this service
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
RegistryObject.getSubmittingOrganization()

public void setProvidingOrganization(Organization providingOrganization) throws JAXRException
设置提供此服务的 Organization。

功能级别：0
providingOrganization | 提供此服务的 Organization
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setProvidingOrganization

void setProvidingOrganization(Organization providingOrganization)
                              throws JAXRException
Sets the Organization that provides this service.

Capability Level: 0

Parameters:
providingOrganization - the Organization that provides this service
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addServiceBinding(ServiceBinding serviceBinding) throws JAXRException
添加一个子 ServiceBinding。

功能级别：0
serviceBinding | 将添加的 ServiceBinding
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addServiceBinding

void addServiceBinding(ServiceBinding serviceBinding)
                       throws JAXRException
Adds a child ServiceBinding.

Capability Level: 0

Parameters:
serviceBinding - the ServiceBinding being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addServiceBindings(java.util.Collection<E> serviceBindings) throws JAXRException
添加一个 ServiceBinding 子代所组成的 Collection。

功能级别：0
serviceBindings | 将添加的 ServiceBinding 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addServiceBindings

void addServiceBindings(Collection serviceBindings)
                        throws JAXRException
Adds a Collection of ServiceBinding children.

Capability Level: 0

Parameters:
serviceBindings - the Collection of ServiceBindings being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeServiceBinding(ServiceBinding serviceBinding) throws JAXRException
移除一个子 ServiceBinding。

功能级别：0
serviceBinding | 将移除的 ServiceBinding
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeServiceBinding

void removeServiceBinding(ServiceBinding serviceBinding)
                          throws JAXRException
Removes a child ServiceBinding.

Capability Level: 0

Parameters:
serviceBinding - the ServiceBinding being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeServiceBindings(java.util.Collection<E> serviceBindings) throws JAXRException
移除一个 ServiceBinding 子代所组成的 Collection。

功能级别：0
serviceBindings | 将添加的 ServiceBinding 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeServiceBindings

void removeServiceBindings(Collection serviceBindings)
                           throws JAXRException
Removes a Collection of children ServiceBindings.

Capability Level: 0

Parameters:
serviceBindings - the Collection of ServiceBindings being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getServiceBindings() throws JAXRException
获取所有子代 ServiceBinding。

功能级别：0
return | ServiceBinding 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1..*
associates | <{javax.xml.registry.infomodel.ServiceBinding}>
link
en
aggregationByValue
See also | javax.xml.registry.infomodel.ServiceBinding
英文文档：

getServiceBindings

Collection getServiceBindings()
                              throws JAXRException
Gets all children ServiceBindings.

Capability Level: 0

Returns:
Collection of ServiceBinding instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
ServiceBinding
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServiceBinding (Java EE 5)

javax.xml.registry.infomodel
Interface ServiceBinding

All Superinterfaces:
ExtensibleObject, RegistryObject, URIValidator
public interface ServiceBinding
extends RegistryObject, URIValidator

Implements: RegistryObject, URIValidator

ServiceBinding 实例是表示技术信息的 RegistryObject，这些技术可以用特殊方式访问 Service 实例提供的特定接口。一个 ServiceBinding 可以包含一组 SpecificationLink 实例。映射到 UDDI 中的 BindingTemplate。
See also javax.xml.registry.infomodel.Concept
英文文档：

ServiceBinding instances are RegistryObjects that represent technical information on a specific way to access a specific interface offered by a Service instance. A ServiceBinding may have a set of SpecificationLink instances. Maps to a BindingTemplate in UDDI.

Author:
Farrukh S. Najmi
See Also:
Concept

Method Summary
void | addSpecificationLink(SpecificationLink specificationLink) Adds a child SpecificationLink.
void | addSpecificationLinks(Collection specificationLinks) Adds a Collection of SpecificationLink children.
String | getAccessURI() Gets the URI that gives access to the service via this binding.
Service | getService() Gets the parent service for which this is a binding.
Collection | getSpecificationLinks() Gets all children SpecificationLinks.
ServiceBinding | getTargetBinding() Gets the next ServiceBinding in case there is a redirection from one service provider to another service provider.
void | removeSpecificationLink(SpecificationLink specificationLink) Removes a child SpecificationLink.
void | removeSpecificationLinks(Collection specificationLinks) Removes a Collection of children SpecificationLinks.
void | setAccessURI(String uri) Sets the URI that gives access to the service via this binding.
void | setTargetBinding(ServiceBinding binding) Sets the next ServiceBinding in case there is a redirection.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots
Methods inherited from interface javax.xml.registry.infomodel.URIValidator
getValidateURI, setValidateURI

Method Detail

public String getAccessURI() throws JAXRException
获取通过此绑定提供服务访问的 URI。默认值为 NULL 字符串。

功能级别：0
return | 通过此绑定提供服务访问的 URI
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getAccessURI

String getAccessURI()
                    throws JAXRException
Gets the URI that gives access to the service via this binding. Default is a NULL String.

Capability Level: 0

Returns:
the URI that gives access to the service via this binding
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setAccessURI(String uri) throws JAXRException
设置通过此绑定提供服务访问的 URI。accessURI 与 targetBinding 是互斥的。如果在已经定义了一个非 null targetBinding 的情况下设置 accessURI，则 JAXR 提供者必定抛出 InvalidRequestException。

功能级别：0
uri | 通过此绑定提供服务访问的 URI
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setAccessURI

void setAccessURI(String uri)
                  throws JAXRException
Sets the URI that gives access to the service via this binding. The accessURI is mutually exclusive from targetBinding. JAXR Provider must throw an InvalidRequestException if an accessURI is set when there is already a non-null targetBinding defined.

Capability Level: 0

Parameters:
uri - the URI that gives access to the service via this binding
Throws:
JAXRException - If the JAXR provider encounters an internal error

public ServiceBinding getTargetBinding() throws JAXRException
从一个服务提供者重定向到另一个服务提供者时获取下一个 ServiceBinding。

功能级别：0
return | 存在服务重定向时的下一个 ServiceBinding
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getTargetBinding

ServiceBinding getTargetBinding()
                                throws JAXRException
Gets the next ServiceBinding in case there is a redirection from one service provider to another service provider.

Capability Level: 0

Returns:
the next ServiceBinding in case there is a service redirection
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setTargetBinding(ServiceBinding binding) throws JAXRException
设置存在重定向时的下一个 ServiceBinding。targetBinding 与 accessURI 是互斥的。如果在定义了一个非 null accessURI 的情况下设置 targetBinding，则 JAXR 提供者必定抛出 InvalidRequestExcpetion。

功能级别：0
binding | 此对象重定向的目标 ServiceBinding
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setTargetBinding

void setTargetBinding(ServiceBinding binding)
                      throws JAXRException
Sets the next ServiceBinding in case there is a redirection. The targetBinding is mutually exclusive from the accessURI. JAXR Provider must throw an InvalidRequestExcpetion if a targetBinding is set when there is already a non-null accessURI defined.

Capability Level: 0

Parameters:
binding - the target ServiceBinding to which this object is redirected to
Throws:
JAXRException - If the JAXR provider encounters an internal error

public Service getService() throws JAXRException
获取绑定此服务的父服务。

功能级别：0
return | 父 Service 对象
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getService

Service getService()
                   throws JAXRException
Gets the parent service for which this is a binding.

Capability Level: 0

Returns:
the parent Service object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addSpecificationLink(SpecificationLink specificationLink) throws JAXRException
添加一个子 SpecificationLink。

功能级别：0
specificationLink | 将添加的 SpecificationLink
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addSpecificationLink

void addSpecificationLink(SpecificationLink specificationLink)
                          throws JAXRException
Adds a child SpecificationLink.

Capability Level: 0

Parameters:
specificationLink - the SpecificationLink being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void addSpecificationLinks(java.util.Collection<E> specificationLinks) throws JAXRException
添加一个 SpecificationLink 子代所组成的 Collection。

功能级别：0
specificationLinks | 将添加的 SpecificationLink 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

addSpecificationLinks

void addSpecificationLinks(Collection specificationLinks)
                           throws JAXRException
Adds a Collection of SpecificationLink children.

Capability Level: 0

Parameters:
specificationLinks - the Collection of SpecificationLinks being added
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeSpecificationLink(SpecificationLink specificationLink) throws JAXRException
移除一个子 SpecificationLink。

功能级别：0
specificationLink | 将添加的 SpecificationLink
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeSpecificationLink

void removeSpecificationLink(SpecificationLink specificationLink)
                             throws JAXRException
Removes a child SpecificationLink.

Capability Level: 0

Parameters:
specificationLink - the SpecificationLink being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void removeSpecificationLinks(java.util.Collection<E> specificationLinks) throws JAXRException
移除一个 SpecificationLink 子代所组成的 Collection。

功能级别：0
specificationLinks | 将移除的 SpecificationLink 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

removeSpecificationLinks

void removeSpecificationLinks(Collection specificationLinks)
                              throws JAXRException
Removes a Collection of children SpecificationLinks.

Capability Level: 0

Parameters:
specificationLinks - the Collection of SpecificationLinks being removed
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getSpecificationLinks() throws JAXRException
获取所有子代 SpecificationLink。

功能级别：0
return | SpecificationLink 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1..*
associates | <{javax.xml.registry.infomodel.SpecificationLink}>
link
en
aggregationByValue
See also | javax.xml.registry.infomodel.SpecificationLink
英文文档：

getSpecificationLinks

Collection getSpecificationLinks()
                                 throws JAXRException
Gets all children SpecificationLinks.

Capability Level: 0

Returns:
Collection of SpecificationLink instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
SpecificationLink
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Slot (Java EE 5)

javax.xml.registry.infomodel
Interface Slot

public interface Slot

Slot 实例提供向 RegistryObject 实例添加任意属性的动态方式。这种将属性动态添加到 RegistryObject 实例的能力支持注册信息模型 (Registry Information Model) 中的可扩展性。

RegistryObject 可以包含 0 个或多个 Slot。一个 Slot 由一个名称、一个 slotType 和一个值 Collection 组成。Slot 的名称在 RegistryObject 实例中对于本地是唯一的。类似地，Slot 的值在 Slot 实例中对于本地也是唯一的。因为 Slot 表示一个可扩展属性，该属性的值可以是一个 Collection，所以 Slot 可以包含一个值所组成的 Collection，而不是单个值。slotType 属性可以有选择地指定 Slot 的类型和种类。

See also javax.xml.registry.infomodel.ExtensibleObject
英文文档：

Slot instances provide a dynamic way to add arbitrary attributes to RegistryObject instances. This ability to add attributes dynamically to RegistryObject instances enables extensibility within the Registry Information Model.

A RegistryObject may have 0 or more Slots. A slot is composed of a name, a slotType and a collection of values. The name of a slot is locally unique within the RegistryObject instance. Similarly, the value of a Slot is locally unique within a slot instance. Since a Slot represents an extensible attribute whose value may be a collection, a Slot is allowed to have a collection of values rather than a single value. The slotType attribute may optionally specify a type or category for the slot.

Author:
Farrukh S. Najmi
See Also:
ExtensibleObject

Field Summary
static String | ADDRESS_LINES_SLOT Name for pre-defined Slot used in PostalAddress by JAXR UDDI provider.
static String | AUTHORIZED_NAME_SLOT Name for pre-defined Slot used in Organization and ClassificationScheme by JAXR UDDI provider.
static String | OPERATOR_SLOT Name for pre-defined Slot used in Organization and ClassificationScheme by JAXR UDDI provider.
static String | SORT_CODE_SLOT Name for pre-defined Slot used in PostalAddress by JAXR UDDI provider.
Method Summary
String | getName() Gets the name for this Slot.
String | getSlotType() Gets the slotType for this Slot.
Collection | getValues() Gets the values for this Slot.
void | setName(String name) Sets the name for this Slot.
void | setSlotType(String slotType) Sets the slotType for this Slot.
void | setValues(Collection values) Sets the values for this Slot.

Field Detail

英文文档：

SORT_CODE_SLOT

static final String SORT_CODE_SLOT
Name for pre-defined Slot used in PostalAddress by JAXR UDDI provider.

See Also:
Constant Field Values

英文文档：

ADDRESS_LINES_SLOT

static final String ADDRESS_LINES_SLOT
Name for pre-defined Slot used in PostalAddress by JAXR UDDI provider.

See Also:
Constant Field Values

英文文档：

AUTHORIZED_NAME_SLOT

static final String AUTHORIZED_NAME_SLOT
Name for pre-defined Slot used in Organization and ClassificationScheme by JAXR UDDI provider.

See Also:
Constant Field Values

英文文档：

OPERATOR_SLOT

static final String OPERATOR_SLOT
Name for pre-defined Slot used in Organization and ClassificationScheme by JAXR UDDI provider.

See Also:
Constant Field Values
Method Detail

public String getName() throws JAXRException
获取此 Slot 的名称。默认值为 NULL 字符串。

功能级别：0
return | 名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getName

String getName()
               throws JAXRException
Gets the name for this Slot. Default is a NULL String.

Capability Level: 0

Returns:
the name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setName(String name) throws JAXRException
设置此 Slot 的名称。默认值为 NULL 字符串。

功能级别：0
name | 名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setName

void setName(String name)
             throws JAXRException
Sets the name for this Slot. Default is a NULL String.

Capability Level: 0

Parameters:
name - the name
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getSlotType() throws JAXRException
获取此 Slot 的 slotType。默认值为 NULL 字符串。

功能级别：0
return | 任意 String 形式的 Slot 类型
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getSlotType

String getSlotType()
                   throws JAXRException
Gets the slotType for this Slot. Default is a NULL String.

Capability Level: 0

Returns:
the slot type which is an arbitrary String
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setSlotType(String slotType) throws JAXRException
设置此 Slot 的 slotType。

功能级别：0
slotType | 任意 String 形式的 Slot 类型
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setSlotType

void setSlotType(String slotType)
                 throws JAXRException
Sets the slotType for this Slot.

Capability Level: 0

Parameters:
slotType - the slot type which is an arbitrary String
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getValues() throws JAXRException
获取此 Slot 的值。

功能级别：0
return | 表示此 Slot 的值的 String 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
See also | java.lang.String
英文文档：

getValues

Collection getValues()
                     throws JAXRException
Gets the values for this Slot.

Capability Level: 0

Returns:
Collection of String instances representing the values for this Slot. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
String

public void setValues(java.util.Collection<E> values) throws JAXRException
设置此 Slot 的值。

功能级别：0
values | 此 Slot 的值
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValues

void setValues(Collection values)
               throws JAXRException
Sets the values for this Slot.

Capability Level: 0

Parameters:
values - the values for this Slot
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SpecificationLink (Java EE 5)

javax.xml.registry.infomodel
Interface SpecificationLink

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface SpecificationLink
extends RegistryObject

Implements: RegistryObject

SpecificationLink 提供 ServiceBinding 与其中一个技术规范（描述如何借助 ServiceBinding 使用服务）之间的链接。例如，ServiceBinding 可能包含一个 SpecificationLink 实例，该实例描述如何使用 WSDL 文档或 CORBA IDL 文档形式的技术规范访问服务。它的作用相当于 UDDI 中 tModelInstanceInfo 和 instanceDetails 结构的联合。
See also javax.xml.registry.infomodel.Concept
英文文档：

A SpecificationLink provides the linkage between a ServiceBinding and one of its technical specifications that describes how to use the service using the ServiceBinding. For example, a ServiceBinding may have a SpecificationLink instance that describes how to access the service using a technical specification in the form of a WSDL document or a CORBA IDL document. It serves the same purpose as the union of the tModelInstanceInfo and instanceDetails structures in UDDI.

Author:
Farrukh S. Najmi
See Also:
Concept

Method Summary
ServiceBinding | getServiceBinding() Gets the parent ServiceBinding for this SpecificationLink.
RegistryObject | getSpecificationObject() Gets the specification object for this object.
InternationalString | getUsageDescription() Gets the description of usage parameters.
Collection | getUsageParameters() Gets any usage parameters.
void | setSpecificationObject(RegistryObject obj) Sets the specification object for this object.
void | setUsageDescription(InternationalString usageDescription) Sets the description of usage parameters.
void | setUsageParameters(Collection usageParameters) Sets any usage parameters.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public RegistryObject getSpecificationObject() throws JAXRException
获取此对象的规范对象。

功能级别：0
return | 作为规范对象的 RegistryObject。对于 UDDI 提供者，规范对象必须是没有父级的 Concept。对于 ebXML 提供者，它可能是 ExtrinsicObject。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
associates | <{RegistryObject}>
supplierCardinality | 1
directed |
英文文档：

getSpecificationObject

RegistryObject getSpecificationObject()
                                      throws JAXRException
Gets the specification object for this object.

Capability Level: 0

Returns:
the RegistryObject that is the specification object. For a UDDI provider the specification object must be a Concept with no parent. For an ebXML provider it is likely to be an ExtrinsicObject.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setSpecificationObject(RegistryObject obj) throws JAXRException
设置此对象的规范对象。

功能级别：0
obj | 作为规范对象的 RegistryObject。对于 UDDI 提供者，规范对象必须是没有父级的 Concept。对于 ebXML 提供者，它可能是 ExtrinsicObject。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setSpecificationObject

void setSpecificationObject(RegistryObject obj)
                            throws JAXRException
Sets the specification object for this object.

Capability Level: 0

Parameters:
obj - the RegistryObject that is the specification object. For a UDDI provider the specification object must be a Concept with no parent. For an ebXML provider it is likely to be an ExtrinsicObject.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public InternationalString getUsageDescription() throws JAXRException
获取使用参数的描述。默认值为空字符串。

功能级别：0
return | 此对象的使用描述，不得为 null
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getUsageDescription

InternationalString getUsageDescription()
                                        throws JAXRException
Gets the description of usage parameters. Default is an empty String.

Capability Level: 0

Returns:
the usage description for this object, which must not be null
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setUsageDescription(InternationalString usageDescription) throws JAXRException
设置使用参数的描述。

功能级别：0
usageDescription | 此对象的使用参数的描述
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setUsageDescription

void setUsageDescription(InternationalString usageDescription)
                         throws JAXRException
Sets the description of usage parameters.

Capability Level: 0

Parameters:
usageDescription - the description of usage parameters for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getUsageParameters() throws JAXRException
获取任何使用参数。使用参数是一个任意 String，该 String 描述如何使用可通过此 SpecificationLink 访问的技术规范。每个参数都是一个 String。

功能级别：0
return | String 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getUsageParameters

Collection getUsageParameters()
                              throws JAXRException
Gets any usage parameters. A usage parameter is an arbitrary String that describes how to use the technical specification accessed via this SpecificationLink. Each parameter is a String.

Capability Level: 0

Returns:
the Collection of String instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setUsageParameters(java.util.Collection<E> usageParameters) throws JAXRException
设置任何使用参数。每个参数都是一个 String.

功能级别：0
usageParameters | 使用参数 String 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setUsageParameters

void setUsageParameters(Collection usageParameters)
                        throws JAXRException
Sets any usage parameters. Each parameter is a String

Capability Level: 0

Parameters:
usageParameters - the Collection of usage parameter Strings
Throws:
JAXRException - If the JAXR provider encounters an internal error

public ServiceBinding getServiceBinding() throws JAXRException
获取此 SpecificationLink 的父 ServiceBinding。

功能级别：0
return | 包含此对象的父 ServiceBinding
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getServiceBinding

ServiceBinding getServiceBinding()
                                 throws JAXRException
Gets the parent ServiceBinding for this SpecificationLink.

Capability Level: 0

Returns:
the parent ServiceBinding within which this object is composed
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TelephoneNumber (Java EE 5)

javax.xml.registry.infomodel
Interface TelephoneNumber

public interface TelephoneNumber

定义电话号码的属性的简单可重用实体类。
英文文档：

A simple re-usable entity class that defines attributes of a telephone number.

Author:
Farrukh S. Najmi

Method Summary
String | getAreaCode() Gets the area code.
String | getCountryCode() Gets the country code.
String | getExtension() Gets the internal extension.
String | getNumber() Gets the telephone number suffix, not including the country or area code.
String | getType() The type of telephone number (for example, "fax").
String | getUrl() Gets the URL that can dial this number electronically.
void | setAreaCode(String areaCode) Sets the area code.
void | setCountryCode(String countryCode) Sets country code.
void | setExtension(String extension) Sets the internal extension.
void | setNumber(String number) Sets the telephone number suffix, not including the country or area code.
void | setType(String type) Sets the type of telephone number (for example, "fax").
void | setUrl(String url) Sets the URL that can dial this number electronically.

Method Detail

public String getCountryCode() throws JAXRException
获取国家代码。默认值为空字符串。

功能级别：1
return | 国家代码
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getCountryCode

String getCountryCode()
                      throws JAXRException
Gets the country code. Default is an empty String.

Capability Level: 1

Returns:
the country code
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getAreaCode() throws JAXRException
获取地区代码。默认值为空字符串。

功能级别：1
return | 地区代码
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getAreaCode

String getAreaCode()
                   throws JAXRException
Gets the area code. Default is an empty String.

Capability Level: 1

Returns:
the area code
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getNumber() throws JAXRException
获取电话号码后缀，不包括国家代码或地区代码。默认值为空字符串。

功能级别：0
return | 电话号码
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getNumber

String getNumber()
                 throws JAXRException
Gets the telephone number suffix, not including the country or area code. Default is an empty String.

Capability Level: 0

Returns:
the telephone number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getExtension() throws JAXRException
获取分机号。默认值为空字符串。

功能级别：1
return | 分机号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getExtension

String getExtension()
                    throws JAXRException
Gets the internal extension. Default is an empty String.

Capability Level: 1

Returns:
the internal extension number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getUrl() throws JAXRException
获取可以通过电脑拨打此号码的 URL。默认值为 NULL 字符串。

功能级别：1
return | URL
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getUrl

String getUrl()
              throws JAXRException
Gets the URL that can dial this number electronically. Default is a NULL String.

Capability Level: 1

Returns:
the url
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getType() throws JAXRException
电话号码的类型（例如 "fax"）。任意 String 都可以。

功能级别：0
return | 此 TelephoneNumber 的类型，它是任意 String
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getType

String getType()
               throws JAXRException
The type of telephone number (for example, "fax"). Any String would do.

Capability Level: 0

Returns:
the type for this TelephoneNumber, which is an arbitrary String
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setCountryCode(String countryCode) throws JAXRException
设置国家代码。

功能级别：1
countryCode | 国家代码
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setCountryCode

void setCountryCode(String countryCode)
                    throws JAXRException
Sets country code.

Capability Level: 1

Parameters:
countryCode - the country code
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setAreaCode(String areaCode) throws JAXRException
设置地区代码。

功能级别：1
areaCode | 地区代码
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setAreaCode

void setAreaCode(String areaCode)
                 throws JAXRException
Sets the area code.

Capability Level: 1

Parameters:
areaCode - the area code
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setNumber(String number) throws JAXRException
设置电话号码后缀，不包括国家代码或地区代码。

功能级别：0
number | 电话号码
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setNumber

void setNumber(String number)
               throws JAXRException
Sets the telephone number suffix, not including the country or area code.

Capability Level: 0

Parameters:
number - the telephone number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setExtension(String extension) throws JAXRException
设置分机号。

功能级别：1
extension | 分机号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setExtension

void setExtension(String extension)
                  throws JAXRException
Sets the internal extension.

Capability Level: 1

Parameters:
extension - the internal extension number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setUrl(String url) throws JAXRException
设置可通过电脑拨打此号码的 URL。

功能级别：1
url | URL 字符串
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setUrl

void setUrl(String url)
            throws JAXRException
Sets the URL that can dial this number electronically.

Capability Level: 1

Parameters:
url - the URL string
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setType(String type) throws JAXRException
设置电话号码类型（例如 "fax"）。任何 String 都可以。

功能级别：0
type | 此 TelephoneNumber 的类型，它是任意 String
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setType

void setType(String type)
             throws JAXRException
Sets the type of telephone number (for example, "fax"). Any String will do.

Capability Level: 0

Parameters:
type - the type for this TelephoneNumber, which is an arbitrary String
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


URIValidator (Java EE 5)

javax.xml.registry.infomodel
Interface URIValidator

All Known Subinterfaces:
ExternalLink, ServiceBinding
public interface URIValidator

Implemented by: ExternalLink, ServiceBinding

定义验证 URI 的任何类应有的共同行为。
英文文档：

Defines common behavior expected of any class that validates URIs.

Author:
Farrukh S. Najmi

Method Summary
boolean | getValidateURI() Gets whether to do URI validation for this object.
void | setValidateURI(boolean validate) Sets whether to do URI validation for this object.

Method Detail

public void setValidateURI(boolean validate) throws JAXRException
设置是否对此对象进行 URI 验证。默认值为 true。

功能级别：0
validate | true 意味着 JAXR 提供者必须在设置 URI 时执行 URI 验证；false 意味着关闭验证
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setValidateURI

void setValidateURI(boolean validate)
                    throws JAXRException
Sets whether to do URI validation for this object. Default is true.

Capability Level: 0

Parameters:
validate - true implies JAXR provider must perform validation of URIs when they are set; false implies validation is turned off
Throws:
JAXRException - If the JAXR provider encounters an internal error

public boolean getValidateURI() throws JAXRException
获取是否对此对象进行 URI 验证的指示。

功能级别：0
return | true 意味着 JAXR 提供者必须在设置 URI 时执行 URI 验证；false 意味着关闭验证
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getValidateURI

boolean getValidateURI()
                       throws JAXRException
Gets whether to do URI validation for this object.

Capability Level: 0

Returns:
true implies JAXR provider must perform validation of URIs when they are set; false implies validation is turned off
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


User (Java EE 5)

javax.xml.registry.infomodel
Interface User

All Superinterfaces:
ExtensibleObject, RegistryObject
public interface User
extends RegistryObject

Implements: RegistryObject

User 实例是用于提供向注册表注册的用户信息的 RegistryObject。User 隶属于 Organization。User 对象用于对 RegistryObject 的审计追踪。
See also javax.xml.registry.infomodel.Organization, javax.xml.registry.infomodel.AuditableEvent
英文文档：

User instances are RegistryObjects that are used to provide information about registered users within the registry. Users are affiliated with Organizations. User objects are used in the audit trail for a RegistryObject.

Author:
Farrukh S. Najmi
See Also:
Organization, AuditableEvent

Method Summary
Collection | getEmailAddresses() Gets the email addresses for this User.
Organization | getOrganization() Gets the Organization that this User is affiliated with.
PersonName | getPersonName() Returns the name of this User.
Collection | getPostalAddresses() Gets the postal address for this User.
Collection | getTelephoneNumbers(String phoneType) Gets the telephone numbers for this User that match the specified telephone number type.
String | getType() Gets the type for this User.
URL | getUrl() Gets the URL to the web page for this User.
void | setEmailAddresses(Collection emailAddresses) Sets the Collection of EmailAddress instances for this User.
void | setPersonName(PersonName personName) Sets the name of this User.
void | setPostalAddresses(Collection addresses) Sets the addresses for this User.
void | setTelephoneNumbers(Collection phoneNumbers) Sets the various telephone numbers for this user.
void | setType(String type) Sets the type for this User.
void | setUrl(URL url) Sets the URL to the web page for this User.
Methods inherited from interface javax.xml.registry.infomodel.RegistryObject
addAssociation, addAssociations, addClassification, addClassifications, addExternalIdentifier, addExternalIdentifiers, addExternalLink, addExternalLinks, getAssociatedObjects, getAssociations, getAuditTrail, getClassifications, getDescription, getExternalIdentifiers, getExternalLinks, getKey, getLifeCycleManager, getName, getObjectType, getRegistryPackages, getSubmittingOrganization, removeAssociation, removeAssociations, removeClassification, removeClassifications, removeExternalIdentifier, removeExternalIdentifiers, removeExternalLink, removeExternalLinks, setAssociations, setClassifications, setDescription, setExternalIdentifiers, setExternalLinks, setKey, setName, toXML
Methods inherited from interface javax.xml.registry.infomodel.ExtensibleObject
addSlot, addSlots, getSlot, getSlots, removeSlot, removeSlots

Method Detail

public Organization getOrganization() throws JAXRException
获取此 User 隶属的 Organization。

功能级别：0
return | 此 User 隶属的 Organization
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1
associates | <{Organization}>
directed
supplierRole
en
affiliatedWith
clientCardinality | 1..*
英文文档：

getOrganization

Organization getOrganization()
                             throws JAXRException
Gets the Organization that this User is affiliated with.

Capability Level: 0

Returns:
the Organization that this User is affiliated with
Throws:
JAXRException - If the JAXR provider encounters an internal error

public PersonName getPersonName() throws JAXRException
返回此 User 的名称。

功能级别：0
return | 此 User 的名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getPersonName

PersonName getPersonName()
                         throws JAXRException
Returns the name of this User.

Capability Level: 0

Returns:
the name of this User
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setPersonName(PersonName personName) throws JAXRException
设置此 User 的名称。

功能级别：0
personName | 此 User 的名称
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setPersonName

void setPersonName(PersonName personName)
                   throws JAXRException
Sets the name of this User.

Capability Level: 0

Parameters:
personName - the name of this User
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getPostalAddresses() throws JAXRException
获取此 User 的邮政地址。

功能级别：0
return | PostalAddress 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1
associates | <{PostalAddress}>
directed
supplierRole
en
addresses
clientCardinality | 1..*
See also | javax.xml.registry.infomodel.PostalAddress
英文文档：

getPostalAddresses

Collection getPostalAddresses()
                              throws JAXRException
Gets the postal address for this User.

Capability Level: 0

Returns:
Collection of PostalAddress instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
PostalAddress

public void setPostalAddresses(java.util.Collection<E> addresses) throws JAXRException
设置此 User 的地址。

功能级别：0
addresses | PostAddress 实例所组成的 Collection。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setPostalAddresses

void setPostalAddresses(Collection addresses)
                        throws JAXRException
Sets the addresses for this User.

Capability Level: 0

Parameters:
addresses - Is a Collection of PostAddress instances.
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.net.URL getUrl() throws JAXRException
获取指向此 User 的 Web 页面的 URL。

功能级别：1
return | 此 User 主页的 URL
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getUrl

URL getUrl()
           throws JAXRException
Gets the URL to the web page for this User.

Capability Level: 1

Returns:
the URL for this User's home page
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setUrl(java.net.URL url) throws JAXRException
设置指向此 User 的 Web 页面的 URL。

功能级别：1
url | 此 User 主页的 URL
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setUrl

void setUrl(URL url)
            throws JAXRException
Sets the URL to the web page for this User.

Capability Level: 1

Parameters:
url - the URL for this User's home page
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getTelephoneNumbers(String phoneType) throws JAXRException
获取此 User 匹配指定电话号码类型的电话号码。

功能级别：0
return | TelephoneNumber 实例所组成的 Collection。Collection 可以为空，但不能为 null。
phoneType | 指定要返回的电话号码的类型。如果 phoneType 为 null，则返回所有 telephoneNumber
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1
associates | <{TelephoneNumber}>
directed
supplierRole
en
phones
clientCardinality | 1..*
See also | javax.xml.registry.infomodel.TelephoneNumber
英文文档：

getTelephoneNumbers

Collection getTelephoneNumbers(String phoneType)
                               throws JAXRException
Gets the telephone numbers for this User that match the specified telephone number type.

Capability Level: 0

Parameters:
phoneType - specifies the type of phone numbers to be returned. If phoneType is null, return all telephoneNumbers
Returns:
Collection of TelephoneNumber instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
TelephoneNumber

public void setTelephoneNumbers(java.util.Collection<E> phoneNumbers) throws JAXRException
为此用户设置各种电话号码。

功能级别：0
phoneNumbers | 将设置的 TelephoneNumber 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setTelephoneNumbers

void setTelephoneNumbers(Collection phoneNumbers)
                         throws JAXRException
Sets the various telephone numbers for this user.

Capability Level: 0

Parameters:
phoneNumbers - the Collection of TelephoneNumbers to be set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public java.util.Collection<E> getEmailAddresses() throws JAXRException
获取此 User 的电子邮件地址。

功能级别：0
return | EmailAddress 实例所组成的 Collection。Collection 可以为空，但不能为 null。
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
supplierCardinality | 1
associates | <{EmailAddress}>
directed
supplierRole
en
emailAddresses
clientCardinality | 0..*
See also | javax.xml.registry.infomodel.EmailAddress
英文文档：

getEmailAddresses

Collection getEmailAddresses()
                             throws JAXRException
Gets the email addresses for this User.

Capability Level: 0

Returns:
Collection of EmailAddress instances. The Collection may be empty but not null.
Throws:
JAXRException - If the JAXR provider encounters an internal error
See Also:
EmailAddress

public void setEmailAddresses(java.util.Collection<E> emailAddresses) throws JAXRException
设置此 User 的 EmailAddress 实例所组成的 Collection。

功能级别：0
emailAddresses | 将设置的 EmailAddress 所组成的 Collection
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setEmailAddresses

void setEmailAddresses(Collection emailAddresses)
                       throws JAXRException
Sets the Collection of EmailAddress instances for this User.

Capability Level: 0

Parameters:
emailAddresses - the Collection of EmailAddresses to be set
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getType() throws JAXRException
获取此 User 的类型。默认值为 NULL 字符串。

功能级别：0
return | 此 User 的类型，它是任意 String
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getType

String getType()
               throws JAXRException
Gets the type for this User. Default is a NULL String.

Capability Level: 0

Returns:
the type for this User, which is an arbitrary String
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setType(String type) throws JAXRException
设置此 User 的类型。

功能级别：0
type | 此 User 的类型，它是任意 String
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setType

void setType(String type)
             throws JAXRException
Sets the type for this User.

Capability Level: 0

Parameters:
type - the type for this User, which is an arbitrary String
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Versionable (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.registry.infomodel
Interface Versionable

All Known Subinterfaces:
ClassificationScheme, ExtrinsicObject, RegistryEntry, RegistryPackage, Service
public interface Versionable

Implemented by: RegistryEntry

Versionable 接口定义能够创建自己的实例版本的那些类的共同行为。目前，所有 RegistryEntry 类都必须实现 Versionable 接口。
See also javax.xml.registry.infomodel.RegistryEntry
英文文档：

The Versionable interface defines the behavior common to classes that are capable of creating versions of their instances. At present all RegistryEntry classes are required to implement the Versionable interface.

Author:
Farrukh S. Najmi
See Also:
RegistryEntry

Method Summary
int | getMajorVersion() Gets the major revision number for this version of the Versionable object.
int | getMinorVersion() Gets the minor revision number for this version of the Versionable object.
String | getUserVersion() Gets the user-specified revision number for this version of the Versionable object.
void | setMajorVersion(int majorVersion) Sets the major revision number for this version of the Versionable object.
void | setMinorVersion(int minorVersion) Sets the minor revision number for this version of the Versionable object.
void | setUserVersion(String userVersion) Sets the user specified revision number for this version of the Versionable object.

Method Detail

public int getMajorVersion() throws JAXRException
获取此 Versionable 对象版本的主版本号。

功能级别：1
return | 此对象的主版本
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getMajorVersion

int getMajorVersion()
                    throws JAXRException
Gets the major revision number for this version of the Versionable object.

Capability Level: 1

Returns:
the major version for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setMajorVersion(int majorVersion) throws JAXRException
设置此 Versionable 对象版本的主版本号。

功能级别：1
majorVersion | 主版本号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setMajorVersion

void setMajorVersion(int majorVersion)
                     throws JAXRException
Sets the major revision number for this version of the Versionable object.

Capability Level: 1

Parameters:
majorVersion - the major version number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public int getMinorVersion() throws JAXRException
获取此 Versionable 对象版本的次版本号。

功能级别：1
return | 此对象的次版本
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getMinorVersion

int getMinorVersion()
                    throws JAXRException
Gets the minor revision number for this version of the Versionable object.

Capability Level: 1

Returns:
the minor version for this object
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setMinorVersion(int minorVersion) throws JAXRException
设置此 Versionable 对象版本的次版本号。

功能级别：1
minorVersion | 次版本号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setMinorVersion

void setMinorVersion(int minorVersion)
                     throws JAXRException
Sets the minor revision number for this version of the Versionable object.

Capability Level: 1

Parameters:
minorVersion - the minor version number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public String getUserVersion() throws JAXRException
获取此 Versionable 对象版本的用户定义的版本号。

功能级别：1
return | 用户定义的版本号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

getUserVersion

String getUserVersion()
                      throws JAXRException
Gets the user-specified revision number for this version of the Versionable object.

Capability Level: 1

Returns:
the user-defined version number
Throws:
JAXRException - If the JAXR provider encounters an internal error

public void setUserVersion(String userVersion) throws JAXRException
设置此 Versionable 对象版本的用户定义的版本号。

功能级别：1
userVersion | 用户定义的版本号
Throws | JAXRException: 如果 JAXR 提供者遇到内部错误
英文文档：

setUserVersion

void setUserVersion(String userVersion)
                    throws JAXRException
Sets the user specified revision number for this version of the Versionable object.

Capability Level: 1

Parameters:
userVersion - the user-defined version number
Throws:
JAXRException - If the JAXR provider encounters an internal error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.rpc (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.rpc

This package contains the core JAX-RPC APIs for the client programming model.

See:
Description

Interface Summary
Call | The javax.xml.rpc.Call interface provides support for the dynamic invocation of a service endpoint.
Service | Service class acts as a factory of the following: Dynamic proxy for the target service endpoint.
Stub | The interface javax.xml.rpc.Stub is the common base interface for the stub classes.

Class Summary
NamespaceConstants | Constants used in JAX-RPC for namespace prefixes and URIs
ParameterMode | The javax.xml.rpc.ParameterMode is a type-safe enumeration for parameter mode.
ServiceFactory | The javax.xml.rpc.ServiceFactory is an abstract class that provides a factory for the creation of instances of the type javax.xml.rpc.Service.

Exception Summary
JAXRPCException | The javax.xml.rpc.JAXRPCException is thrown from the core JAX-RPC APIs to indicate an exception related to the JAX-RPC runtime mechanisms.
ServiceException | The javax.xml.rpc.ServiceException is thrown from the methods in the javax.xml.rpc.Service interface and ServiceFactory class.

Package javax.xml.rpc Description

This package contains the core JAX-RPC APIs for the client programming model.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.rpc Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.rpc

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.rpc.NamespaceConstants
    • javax.xml.rpc.ParameterMode
    • javax.xml.rpc.ServiceFactory
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.xml.rpc.JAXRPCException
        • javax.xml.rpc.ServiceException

Interface Hierarchy

  • javax.xml.rpc.Call
  • javax.xml.rpc.Service
  • javax.xml.rpc.Stub
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Call (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc
Interface Call

public interface Call

javax.xml.rpc.Call 接口提供对服务端点动态调用的支持。javax.xml.rpc.Service 接口充当创建 Call 实例的工厂。

创建了 Call 实例后，就可以使用各种设置方法和获取方法配置此 Call 实例。

version 1.0
英文文档：

The javax.xml.rpc.Call interface provides support for the dynamic invocation of a service endpoint. The javax.xml.rpc.Service interface acts as a factory for the creation of Call instances.

Once a Call instance is created, various setter and getter methods may be used to configure this Call instance.

Version:
1.0
Author:
Rahul Sharma

Field Summary
static String | ENCODINGSTYLE_URI_PROPERTY Standard property for encoding Style: Encoding style specified as a namespace URI.
static String | OPERATION_STYLE_PROPERTY Standard property for operation style.
static String | PASSWORD_PROPERTY Standard property: Password for authentication Type: java.lang.String
static String | SESSION_MAINTAIN_PROPERTY Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint.
static String | SOAPACTION_URI_PROPERTY Standard property for SOAPAction.
static String | SOAPACTION_USE_PROPERTY Standard property for SOAPAction.
static String | USERNAME_PROPERTY Standard property: User name for authentication Type: java.lang.String
Method Summary
void | addParameter(String paramName, QName xmlType, Class javaType, ParameterMode parameterMode) Adds a parameter type and mode for a specific operation.
void | addParameter(String paramName, QName xmlType, ParameterMode parameterMode) Adds a parameter type and mode for a specific operation.
QName | getOperationName() Gets the name of the operation to be invoked using this Call instance.
Map | getOutputParams() Returns a Map of {name, value} for the output parameters of the last invoked operation.
List | getOutputValues() Returns a List values for the output parameters of the last invoked operation.
QName | getParameterTypeByName(String paramName) Gets the XML type of a parameter by name
QName | getPortTypeName() Gets the qualified name of the port type.
Object | getProperty(String name) Gets the value of a named property.
Iterator | getPropertyNames() Gets the names of configurable properties supported by this Call object.
QName | getReturnType() Gets the return type for a specific operation
String | getTargetEndpointAddress() Gets the address of a target service endpoint.
Object | invoke(Object[] inputParams) Invokes a specific operation using a synchronous request-response interaction mode.
Object | invoke(QName operationName, Object[] inputParams) Invokes a specific operation using a synchronous request-response interaction mode.
void | invokeOneWay(Object[] inputParams) Invokes a remote method using the one-way interaction mode.
boolean | isParameterAndReturnSpecRequired(QName operationName) Indicates whether addParameter and setReturnType methods are to be invoked to specify the parameter and return type specification for a specific operation.
void | removeAllParameters() Removes all specified parameters from this Call instance.
void | removeProperty(String name) Removes a named property.
void | setOperationName(QName operationName) Sets the name of the operation to be invoked using this Call instance.
void | setPortTypeName(QName portType) Sets the qualified name of the port type.
void | setProperty(String name, Object value) Sets the value for a named property.
void | setReturnType(QName xmlType) Sets the return type for a specific operation.
void | setReturnType(QName xmlType, Class javaType) Sets the return type for a specific operation.
void | setTargetEndpointAddress(String address) Sets the address of the target service endpoint.

Field Detail

英文文档：

USERNAME_PROPERTY

static final String USERNAME_PROPERTY
Standard property: User name for authentication

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

PASSWORD_PROPERTY

static final String PASSWORD_PROPERTY
Standard property: Password for authentication

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

OPERATION_STYLE_PROPERTY

static final String OPERATION_STYLE_PROPERTY
Standard property for operation style. This property is set to "rpc" if the operation style is rpc; "document" if the operation style is document.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

SOAPACTION_USE_PROPERTY

static final String SOAPACTION_USE_PROPERTY
Standard property for SOAPAction. This boolean property indicates whether or not SOAPAction is to be used. The default value of this property is false indicating that the SOAPAction is not used.

Type: java.lang.Boolean

See Also:
Constant Field Values

英文文档：

SOAPACTION_URI_PROPERTY

static final String SOAPACTION_URI_PROPERTY
Standard property for SOAPAction. Indicates the SOAPAction URI if the javax.xml.rpc.soap.http.soapaction.use property is set to true.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

ENCODINGSTYLE_URI_PROPERTY

static final String ENCODINGSTYLE_URI_PROPERTY
Standard property for encoding Style: Encoding style specified as a namespace URI. The default value is the SOAP 1.1 encoding http://schemas.xmlsoap.org/soap/encoding/

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

SESSION_MAINTAIN_PROPERTY

static final String SESSION_MAINTAIN_PROPERTY
Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint. If this property is set to true, the service client indicates that it wants the session to be maintained. If set to false, the session is not maintained. The default value for this property is false.

Type: java.lang.Boolean

See Also:
Constant Field Values
Method Detail

public boolean isParameterAndReturnSpecRequired(javax.xml.namespace.QName operationName)
指示是否调用 addParameter 和 setReturnType 方法指定参数，并为特定操作返回类型规范。
operationName | 操作的限定名称
return | 如果 Call 实现类要求为指定的操作在客户端代码中调用 addParameter 和 setReturnType，则返回 true。否则此方法返回 false。
Throws | IllegalArgumentException: 如果指定了无效的操作名称
英文文档：

isParameterAndReturnSpecRequired

boolean isParameterAndReturnSpecRequired(QName operationName)
Indicates whether addParameter and setReturnType methods are to be invoked to specify the parameter and return type specification for a specific operation.

Parameters:
operationName - Qualified name of the operation
Returns:
Returns true if the Call implementation class requires addParameter and setReturnType to be invoked in the client code for the specified operation. This method returns false otherwise.
Throws:
IllegalArgumentException - If invalid operation name is specified

public void addParameter(String paramName, javax.xml.namespace.QName xmlType, ParameterMode parameterMode)
为特定操作添加参数类型和模式。注意，在调用 invoke 方法之前，客户端代码不能调用任何 addParameter 和 setReturnType 方法。在这种情况下，Call 实现类通过对参数进行反射（使用 WSDL 描述和配置的类型映射注册表）来确定参数类型。
paramName | 参数的名称
xmlType | 参数的 XML 类型
parameterMode | 参数的模式，ParameterMode.IN、ParameterMode.OUT 或者 ParameterMode.INOUT
Throws | javax.xml.rpc.JAXRPCException:: 如果方法 isParameterAndReturnSpecRequired 对此操作返回 false，则可能抛出此异常。
Throws | IllegalArgumentException: 如果指定了任何非法参数名称或 XML 类型
See also | isParameterAndReturnSpecRequired
英文文档：

addParameter

void addParameter(String paramName,
                  QName xmlType,
                  ParameterMode parameterMode)
Adds a parameter type and mode for a specific operation. Note that the client code may not call any addParameter and setReturnType methods before calling the invoke method. In this case, the Call implementation class determines the parameter types by using reflection on parameters, using the WSDL description and configured type mapping registry.

Parameters:
paramName - Name of the parameter
xmlType - XML type of the parameter
parameterMode - Mode of the parameter-whether ParameterMode.IN, ParameterMode.OUT, or ParameterMode.INOUT,
Throws:
javax.xml.rpc.JAXRPCException: - This exception may be thrown if the method isParameterAndReturnSpecRequired returns false for this operation.
IllegalArgumentException - If any illegal parameter name or XML type is specified
See Also:
isParameterAndReturnSpecRequired(javax.xml.namespace.QName)

public void addParameter(String paramName, javax.xml.namespace.QName xmlType, Class<T> javaType, ParameterMode parameterMode)
为特定操作添加参数类型和模式。此方法用于指定 OUT 或 INOUT 参数的 Java 类型。
paramName | 参数的名称
xmlType | 参数的 XML 类型
javaType | 参数的 Java 类
parameterMode | 参数的模式，ParameterMode.IN、OUT 或者 INOUT
Throws JAXRPCException:
  • 如果方法 isParameterAndReturnSpecRequired 返回 false 时调用了此方法，则抛出此异常。
  • 如果指定的 XML 类型和 Java 类型映射无效。例如，TypeMappingRegistry 没有用于此映射的 Serializer。
Throws | IllegalArgumentException: 如果指定了任何非法参数名称或 XML 类型
Throws | UnsupportedOperationException: 如果此方法不受支持
See also | isParameterAndReturnSpecRequired
英文文档：

addParameter

void addParameter(String paramName,
                  QName xmlType,
                  Class javaType,
                  ParameterMode parameterMode)
Adds a parameter type and mode for a specific operation. This method is used to specify the Java type for either OUT or INOUT parameters.

Parameters:
paramName - Name of the parameter
xmlType - XML type of the parameter
javaType - Java class of the parameter
parameterMode - Mode of the parameter-whether ParameterMode.IN, OUT or INOUT
Throws:
JAXRPCException -
  • This exception may be thrown if this method is invoked when the method isParameterAndReturnSpecRequired returns false.
  • If specified XML type and Java type mapping is not valid. For example, TypeMappingRegistry has no serializers for this mapping.
IllegalArgumentException - If any illegal parameter name or XML type is specified
UnsupportedOperationException - If this method is not supported
See Also:
isParameterAndReturnSpecRequired(javax.xml.namespace.QName)

public javax.xml.namespace.QName getParameterTypeByName(String paramName)
根据名称获取参数的 XML 类型。
paramName | 参数的名称
return | 返回指定参数的 XML 类型
英文文档：

getParameterTypeByName

QName getParameterTypeByName(String paramName)
Gets the XML type of a parameter by name

Parameters:
paramName - Name of the parameter
Returns:
Returns XML type for the specified parameter

public void setReturnType(javax.xml.namespace.QName xmlType)
设置特定操作的返回类型。调用 setReturnType(null) 移除此 Call 对象的返回类型。
xmlType | 返回值的 XML 数据类型
Throws | JAXRPCException: 在方法 isParameterAndReturnSpecRequired 返回 false 时抛出此异常。
Throws | IllegalArgumentException: 如果指定了非法的 XML 类型
英文文档：

setReturnType

void setReturnType(QName xmlType)
Sets the return type for a specific operation. Invoking setReturnType(null) removes the return type for this Call object.

Parameters:
xmlType - XML data type of the return value
Throws:
JAXRPCException - This exception may be thrown when the method isParameterAndReturnSpecRequired returns false.
IllegalArgumentException - If an illegal XML type is specified

public void setReturnType(javax.xml.namespace.QName xmlType, Class<T> javaType)
设置特定操作的返回类型。
type | 返回值的 XML 数据类型
javaType | 返回值的 Java 类
Throws JAXRPCException:
  • 如果方法 isParameterAndReturnSpecRequired 返回 false 时调用了此方法，则抛出此异常。
  • 如果使用标准类型映射或 TypeMapping 注册表无法映射 XML 类型和 Java 类型
Throws | UnsupportedOperationException: 如果此方法不受支持
Throws | IllegalArgumentException: 如果指定了非法的 XML 类型
英文文档：

setReturnType

void setReturnType(QName xmlType,
                   Class javaType)
Sets the return type for a specific operation.

Parameters:
type - XML data type of the return value
javaType - Java Class of the return value
Throws:
JAXRPCException -
  • This exception may be thrown if this method is invoked when the method isParameterAndReturnSpecRequired returns false.
  • If XML type and Java type cannot be mapped using the standard type mapping or TypeMapping registry
UnsupportedOperationException - If this method is not supported
IllegalArgumentException - If an illegal XML type is specified

public javax.xml.namespace.QName getReturnType()
获取特定操作的返回类型。
return 返回返回值的 XML 类型
英文文档：

getReturnType

QName getReturnType()
Gets the return type for a specific operation

Returns:
Returns the XML type for the return value

public void removeAllParameters()
从此 Call 实例中移除所有指定参数。注意，此方法只移除参数，不移除返回类型。setReturnType(null) 用于移除返回类型。
Throws JAXRPCException: 如果在方法 isParameterAndReturnSpecRequired 为此 Call 操作返回 false 时调用此方法，则抛出此异常。
英文文档：

removeAllParameters

void removeAllParameters()
Removes all specified parameters from this Call instance. Note that this method removes only the parameters and not the return type. The setReturnType(null) is used to remove the return type.

Throws:
JAXRPCException - This exception may be thrown If this method is called when the method isParameterAndReturnSpecRequired returns false for this Call's operation.

public javax.xml.namespace.QName getOperationName()
获取将使用此 Call 实例调用的操作的名称。
return 操作的限定名称
英文文档：

getOperationName

QName getOperationName()
Gets the name of the operation to be invoked using this Call instance.

Returns:
Qualified name of the operation

public void setOperationName(javax.xml.namespace.QName operationName)
设置将使用此 Call 实例调用的操作的名称。
operationName 将使用 Call 实例调用的操作的 QName
英文文档：

setOperationName

void setOperationName(QName operationName)
Sets the name of the operation to be invoked using this Call instance.

Parameters:
operationName - QName of the operation to be invoked using the Call instance

public javax.xml.namespace.QName getPortTypeName()
获取端口类型的限定名称。
return 端口类型的限定名称
英文文档：

getPortTypeName

QName getPortTypeName()
Gets the qualified name of the port type.

Returns:
Qualified name of the port type

public void setPortTypeName(javax.xml.namespace.QName portType)
设置端口类型的限定名称。
portType 端口类型的限定名称
英文文档：

setPortTypeName

void setPortTypeName(QName portType)
Sets the qualified name of the port type.

Parameters:
portType - Qualified name of the port type

public void setTargetEndpointAddress(String address)
设置目标服务端点的地址。此地址必须对应于绑定中为此 Call 实例指定的传输。
address 目标服务端点的地址，以 URI 的形式指定
英文文档：

setTargetEndpointAddress

void setTargetEndpointAddress(String address)
Sets the address of the target service endpoint. This address must correspond to the transport specified in the binding for this Call instance.

Parameters:
address - Address of the target service endpoint; specified as an URI

public String getTargetEndpointAddress()
获取目标服务端点的地址。
return 返回 URI 形式的目标服务端点地址
英文文档：

getTargetEndpointAddress

String getTargetEndpointAddress()
Gets the address of a target service endpoint.

Returns:
Address of the target service endpoint as an URI

public void setProperty(String name, Object value)
设置指定属性的值。JAX-RPC 规范指定了一个标准属性集，可以将它传递给 Call.setProperty 方法。
name | 属性的名称
value | 属性的值
Throws JAXRPCException:
  • 如果指定了一个可选的标准属性名称，但此 Call 实现类不支持此属性的配置。
  • 如果指定了无效（或不受支持的）的属性名称，或者传递了不匹配属性类型的值。
  • 如果配置有效属性的过程中出现错误。
英文文档：

setProperty

void setProperty(String name,
                 Object value)
Sets the value for a named property. JAX-RPC specification specifies a standard set of properties that may be passed to the Call.setProperty method.

Parameters:
name - Name of the property
value - Value of the property
Throws:
JAXRPCException -
  • If an optional standard property name is specified, however this Call implementation class does not support the configuration of this property.
  • If an invalid (or unsupported) property name is specified or if a value of mismatched property type is passed.
  • If there is any error in the configuration of a valid property.

public Object getProperty(String name)
获取指定属性的值。
name | 属性的名称
return | 指定属性的值
Throws | JAXRPCException: 如果传递无效或不受支持的属性名称。
英文文档：

getProperty

Object getProperty(String name)
Gets the value of a named property.

Parameters:
name - Name of the property
Returns:
Value of the named property
Throws:
JAXRPCException - if an invalid or unsupported property name is passed.

public void removeProperty(String name)
移除指定属性。
name | 属性的名称
return | boolean 如果移除指定属性，则返回 true；否则返回 false
Throws | JAXRPCException: 如果传递无效或不受支持的属性名称。
英文文档：

removeProperty

void removeProperty(String name)
Removes a named property.

Parameters:
name - Name of the property
Throws:
JAXRPCException - if an invalid or unsupported property name is passed.

public java.util.Iterator<E> getPropertyNames()
获取此 Call 对象支持的可配置属性的名称。
return 属性名称的 Iterator
英文文档：

getPropertyNames

Iterator getPropertyNames()
Gets the names of configurable properties supported by this Call object.

Returns:
Iterator for the property names

public Object invoke(Object[] inputParams) throws java.rmi.RemoteException
使用同步请求-响应交互模式调用特定操作。
inputParams | Object[] -- 此调用的参数。这只包括输入参数
return | 返回返回值或 null
Throws | java.rmi.RemoteException: 如果远程方法调用中存在任何错误
Throws | SOAPFaultException: 指示 SOAP 错误
Throws JAXRPCException:
  • 如果 Call 对象的配置中存在错误
  • 如果 inputParams 与所需参数集（通过 addParameter 调用指定或在相应的 WSDL 中指定）不匹配
  • 如果没有正确指定参数和返回类型
英文文档：

invoke

Object invoke(Object[] inputParams)
              throws RemoteException
Invokes a specific operation using a synchronous request-response interaction mode.

Parameters:
inputParams - Object[]--Parameters for this invocation. This includes only the input params
Returns:
Returns the return value or null
Throws:
RemoteException - if there is any error in the remote method invocation
SOAPFaultException - Indicates a SOAP fault
JAXRPCException -
  • If there is an error in the configuration of the Call object
  • If inputParams do not match the required parameter set (as specified through the addParameter invocations or in the corresponding WSDL)
  • If parameters and return type are incorrectly specified

public Object invoke(javax.xml.namespace.QName operationName, Object[] inputParams) throws java.rmi.RemoteException
使用同步请求-响应交互模式调用特定操作。
operationName | 操作的 QName
inputParams | Object[] -- 此调用的参数。这仅包括输入参数。
return | 返回返回值或 null
Throws | java.rmi.RemoteException: 如果远程方法调用中存在任何错误。
Throws | SOAPFaultException: 指示 SOAP 错误
Throws JAXRPCException:
  • 如果 Call 对象的配置中存在错误
  • 如果 inputParams 与所需参数集（通过 addParameter 调用指定或在相应 WSDL 中指定）不匹配
  • 如果没有正确指定参数和返回类型
英文文档：

invoke

Object invoke(QName operationName,
              Object[] inputParams)
              throws RemoteException
Invokes a specific operation using a synchronous request-response interaction mode.

Parameters:
operationName - QName of the operation
inputParams - Object[]--Parameters for this invocation. This includes only the input params.
Returns:
Return value or null
Throws:
RemoteException - if there is any error in the remote method invocation.
SOAPFaultException - Indicates a SOAP fault
JAXRPCException -
  • If there is an error in the configuration of the Call object
  • If inputParams do not match the required parameter set (as specified through the addParameter invocations or in the corresponding WSDL)
  • If parameters and return type are incorrectly specified

public void invokeOneWay(Object[] inputParams)
使用单向交互模式调用远程方法。等待此远程方法调用的服务器处理完成时，客户端线程通常不会阻塞。当使用的协议为 SOAP/HTTP 时，在收到 HTTP 响应代码或发生错误前，此方法应该阻塞。 此方法不得抛出任何远程异常。此方法在处理单向远程调用期间可能抛出 JAXRPCException。
inputParams | Object[] -- 此调用的参数。这仅包括输入参数。
Throws | JAXRPCException: 如果在 Call 对象的配置中存在错误（例如：以不正确方式为单向调用指定非 void 返回类型），或者在执行单向远程调用期间存在错误
英文文档：

invokeOneWay

void invokeOneWay(Object[] inputParams)
Invokes a remote method using the one-way interaction mode. The client thread does not normally block waiting for the completion of the server processing for this remote method invocation. When the protocol in use is SOAP/HTTP, this method should block until an HTTP response code has been received or an error occurs. This method must not throw any remote exceptions. This method may throw a JAXRPCException during the processing of the one-way remote call.

Parameters:
inputParams - Object[]--Parameters for this invocation. This includes only the input params.
Throws:
JAXRPCException - if there is an error in the configuration of the Call object (example: a non-void return type has been incorrectly specified for the one-way call) or if there is any error during the invocation of the one-way remote call

public java.util.Map<K, V> getOutputParams()
返回上一次调用操作的输出参数的 Map {name, value}。所返回 Map 中的参数名称的类型为 java.lang.String。
return | Map 上一次 Call.invoke() 的输出参数。如果没有输出参数，则返回空 Map。
Throws | JAXRPCException: 如果对单向操作调用此方法，或者在调用 invoke 方法之前调用此方法。
英文文档：

getOutputParams

Map getOutputParams()
Returns a Map of {name, value} for the output parameters of the last invoked operation. The parameter names in the returned Map are of type java.lang.String.

Returns:
Map Output parameters for the last Call.invoke(). Empty Map is returned if there are no output parameters.
Throws:
JAXRPCException - If this method is invoked for a one-way operation or is invoked before any invoke method has been called.

public java.util.List<E> getOutputValues()
返回上一次调用操作的输出参数的 List 值。
return | 输出参数的 java.util.List 值。如果没有输出值，则返回空 List。
Throws | JAXRPCException: 如果对单向操作调用此方法，或者在调用 invoke 方法之前调用此方法。
英文文档：

getOutputValues

List getOutputValues()
Returns a List values for the output parameters of the last invoked operation.

Returns:
java.util.List Values for the output parameters. An empty List is returned if there are no output values.
Throws:
JAXRPCException - If this method is invoked for a one-way operation or is invoked before any invoke method has been called.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Service (Java EE 5)

javax.xml.rpc
Interface Service

public interface Service

Implements: RegistryEntry

Service 实例是提供关于 Organization 所提供服务（例如，Web 服务）的信息的 RegistryObject。一个 Service 可以包含一组 ServiceBinding 实例。映射到 UDDI 中的 BusinessService。
See also javax.xml.registry.infomodel.ServiceBinding
英文文档：

Service class acts as a factory of the following:

  • Dynamic proxy for the target service endpoint.
  • Instance of the type javax.xml.rpc.Call for the dynamic invocation of a remote operation on the target service endpoint.
  • Instance of a generated stub class

Version:
1.0
Author:
Rahul Sharma
See Also:
Call, Stub

Method Summary
Call | createCall() Creates a Call object not associated with specific operation or target service endpoint.
Call | createCall(QName portName) Creates a Call instance.
Call | createCall(QName portName, QName operationName) Creates a Call instance.
Call | createCall(QName portName, String operationName) Creates a Call instance.
Call[] | getCalls(QName portName) Gets an array of preconfigured Call objects for invoking operations on the specified port.
HandlerRegistry | getHandlerRegistry() Returns the configured HandlerRegistry instance for this Service instance.
Remote | getPort(Class serviceEndpointInterface) The getPort method returns either an instance of a generated stub implementation class or a dynamic proxy.
Remote | getPort(QName portName, Class serviceEndpointInterface) The getPort method returns either an instance of a generated stub implementation class or a dynamic proxy.
Iterator | getPorts() Returns an Iterator for the list of QNames of service endpoints grouped by this service
QName | getServiceName() Gets the name of this service.
TypeMappingRegistry | getTypeMappingRegistry() Gets the TypeMappingRegistry for this Service object.
URL | getWSDLDocumentLocation() Gets the location of the WSDL document for this Service.

Method Detail

英文文档：

getPort

Remote getPort(QName portName,
               Class serviceEndpointInterface)
               throws ServiceException
The getPort method returns either an instance of a generated stub implementation class or a dynamic proxy. A service client uses this dynamic proxy to invoke operations on the target service endpoint. The serviceEndpointInterface specifies the service endpoint interface that is supported by the created dynamic proxy or stub instance.

Parameters:
portName - Qualified name of the service endpoint in the WSDL service description
serviceEndpointInterface - Service endpoint interface supported by the dynamic proxy or stub instance
Returns:
java.rmi.Remote Stub instance or dynamic proxy that supports the specified service endpoint interface
Throws:
ServiceException - This exception is thrown in the following cases:
  • If there is an error in creation of the dynamic proxy or stub instance
  • If there is any missing WSDL metadata as required by this method
  • Optionally, if an illegal serviceEndpointInterface or portName is specified
See Also:
Proxy, InvocationHandler

英文文档：

getPort

Remote getPort(Class serviceEndpointInterface)
               throws ServiceException
The getPort method returns either an instance of a generated stub implementation class or a dynamic proxy. The parameter serviceEndpointInterface specifies the service endpoint interface that is supported by the returned stub or proxy. In the implementation of this method, the JAX-RPC runtime system takes the responsibility of selecting a protocol binding (and a port) and configuring the stub accordingly. The returned Stub instance should not be reconfigured by the client.

Parameters:
serviceEndpointInterface - Service endpoint interface
Returns:
Stub instance or dynamic proxy that supports the specified service endpoint interface
Throws:
ServiceException -
  • If there is an error during creation of stub instance or dynamic proxy
  • If there is any missing WSDL metadata as required by this method
  • Optionally, if an illegal serviceEndpointInterface is specified

英文文档：

getCalls

Call[] getCalls(QName portName)
                throws ServiceException
Gets an array of preconfigured Call objects for invoking operations on the specified port. There is one Call object per operation that can be invoked on the specified port. Each Call object is pre-configured and does not need to be configured using the setter methods on Call interface.

Each invocation of the getCalls method returns a new array of preconfigured Call objects

This method requires the Service implementation class to have access to the WSDL related metadata.

Parameters:
portName - Qualified name for the target service endpoint
Returns:
Call[] Array of pre-configured Call objects
Throws:
ServiceException - If this Service class does not have access to the required WSDL metadata or if an illegal portName is specified.

英文文档：

createCall

Call createCall(QName portName)
                throws ServiceException
Creates a Call instance.

Parameters:
portName - Qualified name for the target service endpoint
Returns:
Call instance
Throws:
ServiceException - If any error in the creation of the Call object

英文文档：

createCall

Call createCall(QName portName,
                QName operationName)
                throws ServiceException
Creates a Call instance.

Parameters:
portName - Qualified name for the target service endpoint
operationName - Qualified Name of the operation for which this Call object is to be created.
Returns:
Call instance
Throws:
ServiceException - If any error in the creation of the Call object

英文文档：

createCall

Call createCall(QName portName,
                String operationName)
                throws ServiceException
Creates a Call instance.

Parameters:
portName - Qualified name for the target service endpoint
operationName - Name of the operation for which this Call object is to be created.
Returns:
Call instance
Throws:
ServiceException - If any error in the creation of the Call object

英文文档：

createCall

Call createCall()
                throws ServiceException
Creates a Call object not associated with specific operation or target service endpoint. This Call object needs to be configured using the setter methods on the Call interface.

Returns:
Call object
Throws:
ServiceException - If any error in the creation of the Call object

英文文档：

getServiceName

QName getServiceName()
Gets the name of this service.

Returns:
Qualified name of this service

英文文档：

getPorts

Iterator getPorts()
                  throws ServiceException
Returns an Iterator for the list of QNames of service endpoints grouped by this service

Returns:
Returns java.util.Iterator with elements of type javax.xml.namespace.QName
Throws:
ServiceException - If this Service class does not have access to the required WSDL metadata

英文文档：

getWSDLDocumentLocation

URL getWSDLDocumentLocation()
Gets the location of the WSDL document for this Service.

Returns:
URL for the location of the WSDL document for this service

英文文档：

getTypeMappingRegistry

TypeMappingRegistry getTypeMappingRegistry()
Gets the TypeMappingRegistry for this Service object. The returned TypeMappingRegistry instance is pre-configured to support the standard type mapping between XML and Java types types as required by the JAX-RPC specification.

Returns:
The TypeMappingRegistry for this Service object.
Throws:
java.lang.UnsupportedOperationException - if the Service class does not support the configuration of TypeMappingRegistry.

英文文档：

getHandlerRegistry

HandlerRegistry getHandlerRegistry()
Returns the configured HandlerRegistry instance for this Service instance.

Returns:
HandlerRegistry
Throws:
java.lang.UnsupportedOperationException - if the Service class does not support the configuration of a HandlerRegistry
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Stub (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc
Interface Stub

public interface Stub

接口 javax.xml.rpc.Stub 是 Stub 类的公共基本接口。所有生成的 Stub 类都需要实现 javax.xml.rpc.Stub 接口。Stub 类的实例表示目标服务端口的客户端代理或 Stub 实例。

javax.xml.rpc.Stub 接口为动态配置 Stub 实例提供了一个可扩展的属性机制。

version | 0.1
See also | javax.xml.rpc.Service
英文文档：

The interface javax.xml.rpc.Stub is the common base interface for the stub classes. All generated stub classes are required to implement the javax.xml.rpc.Stub interface. An instance of a stub class represents a client side proxy or stub instance for the target service endpoint.

The javax.xml.rpc.Stub interface provides an extensible property mechanism for the dynamic configuration of a stub instance.

Version:
0.1
Author:
Rahul Sharma
See Also:
Service

Field Summary
static String | ENDPOINT_ADDRESS_PROPERTY Standard property: Target service endpoint address.
static String | PASSWORD_PROPERTY Standard property: Password for authentication.
static String | SESSION_MAINTAIN_PROPERTY Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint.
static String | USERNAME_PROPERTY Standard property: User name for authentication.
Method Summary
Object | _getProperty(String name) Gets the value of a specific configuration property.
Iterator | _getPropertyNames() Returns an Iterato view of the names of the properties that can be configured on this stub instance.
void | _setProperty(String name, Object value) Sets the name and value of a configuration property for this Stub instance.

Field Detail

英文文档：

USERNAME_PROPERTY

static final String USERNAME_PROPERTY
Standard property: User name for authentication.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

PASSWORD_PROPERTY

static final String PASSWORD_PROPERTY
Standard property: Password for authentication.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

ENDPOINT_ADDRESS_PROPERTY

static final String ENDPOINT_ADDRESS_PROPERTY
Standard property: Target service endpoint address. The URI scheme for the endpoint address specification must correspond to the protocol/transport binding for this stub class.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

SESSION_MAINTAIN_PROPERTY

static final String SESSION_MAINTAIN_PROPERTY
Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint. If this property is set to true, the service client indicates that it wants the session to be maintained. If set to false, the session is not maintained. The default value for this property is false.

Type: java.lang.Boolean

See Also:
Constant Field Values
Method Detail

public void _setProperty(String name, Object value)
设置此 Stub 实例的配置属性的名称和值。如果 Stub 实例包含相同属性的值，那么将替换旧值。

注意，_setProperty 方法可能不检查已配置属性值的有效性。例如，对于目标服务端口地址的标准属性，_setProperty 方法不会检查其有效性。在这种情况下，Stub 配置错误在远程方法调用时检测。

name | 配置属性的名称
value | 属性的值
Throws JAXRPCException:
  • 如果指定了可一个选标的准属性名称，但此 Stub 实现类不支持此属性的配置。
  • 如果指定了无效（或不受支持的）的属性名称，或者传递了不匹配属性类型的值。
  • 如果配置有效属性的过程中出现错误。
英文文档：

_setProperty

void _setProperty(String name,
                  Object value)
Sets the name and value of a configuration property for this Stub instance. If the Stub instances contains a value of the same property, the old value is replaced.

Note that the _setProperty method may not perform validity check on a configured property value. An example is the standard property for the target service endpoint address that is not checked for validity in the _setProperty method. In this case, stub configuration errors are detected at the remote method invocation.

Parameters:
name - Name of the configuration property
value - Value of the property
Throws:
JAXRPCException -
  • If an optional standard property name is specified, however this Stub implementation class does not support the configuration of this property.
  • If an invalid or unsupported property name is specified or if a value of mismatched property type is passed.
  • If there is any error in the configuration of a valid property.

public Object _getProperty(String name)
获取特定配置属性的值。
name | 将获取其值的属性的名称
return | 配置属性的值
Throws | JAXRPCException: 如果传递无效或不受支持的属性名称。
英文文档：

_getProperty

Object _getProperty(String name)
Gets the value of a specific configuration property.

Parameters:
name - Name of the property whose value is to be retrieved
Returns:
Value of the configuration property
Throws:
JAXRPCException - if an invalid or unsupported property name is passed.

public java.util.Iterator<E> _getPropertyNames()
返回可在此 Stub 实例上配置的属性名称的 Iterator 视图。
return 类型为 java.lang.String 的属性名称的 Iterator
英文文档：

_getPropertyNames

Iterator _getPropertyNames()
Returns an Iterato view of the names of the properties that can be configured on this stub instance.

Returns:
Iterator for the property names of the type java.lang.String
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


NamespaceConstants (Java EE 5)

javax.xml.rpc
Class NamespaceConstants

java.lang.Object
    extended by  javax.xml.rpc.NamespaceConstants

public class NamespaceConstants
extends Object

在名称空间前缀和 URI 的 JAX-RPC 中使用的常量。
version 1.0
英文文档：

Constants used in JAX-RPC for namespace prefixes and URIs

Version:
1.0
Author:
Rahul Sharma

Field Summary
static String | NSPREFIX_SCHEMA_XSD Namespace prefix for XML schema XSD
static String | NSPREFIX_SCHEMA_XSI Namespace prefix for XML Schema XSI
static String | NSPREFIX_SOAP_ENCODING Namespace prefix for SOAP Encoding
static String | NSPREFIX_SOAP_ENVELOPE Namespace prefix for SOAP Envelope
static String | NSURI_SCHEMA_XSD Namespace URI for XML Schema XSD
static String | NSURI_SCHEMA_XSI Namespace URI for XML Schema XSI
static String | NSURI_SOAP_ENCODING Nameapace URI for SOAP 1.1 Encoding
static String | NSURI_SOAP_ENVELOPE Nameapace URI for SOAP 1.1 Envelope
static String | NSURI_SOAP_NEXT_ACTOR Nameapace URI for SOAP 1.1 next actor role
Constructor Summary
NamespaceConstants()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

NSPREFIX_SOAP_ENVELOPE

public static final String NSPREFIX_SOAP_ENVELOPE
Namespace prefix for SOAP Envelope

See Also:
Constant Field Values

英文文档：

NSPREFIX_SOAP_ENCODING

public static final String NSPREFIX_SOAP_ENCODING
Namespace prefix for SOAP Encoding

See Also:
Constant Field Values

英文文档：

NSPREFIX_SCHEMA_XSD

public static final String NSPREFIX_SCHEMA_XSD
Namespace prefix for XML schema XSD

See Also:
Constant Field Values

英文文档：

NSPREFIX_SCHEMA_XSI

public static final String NSPREFIX_SCHEMA_XSI
Namespace prefix for XML Schema XSI

See Also:
Constant Field Values

英文文档：

NSURI_SOAP_ENVELOPE

public static final String NSURI_SOAP_ENVELOPE
Nameapace URI for SOAP 1.1 Envelope

See Also:
Constant Field Values

英文文档：

NSURI_SOAP_ENCODING

public static final String NSURI_SOAP_ENCODING
Nameapace URI for SOAP 1.1 Encoding

See Also:
Constant Field Values

英文文档：

NSURI_SOAP_NEXT_ACTOR

public static final String NSURI_SOAP_NEXT_ACTOR
Nameapace URI for SOAP 1.1 next actor role

See Also:
Constant Field Values

英文文档：

NSURI_SCHEMA_XSD

public static final String NSURI_SCHEMA_XSD
Namespace URI for XML Schema XSD

See Also:
Constant Field Values

英文文档：

NSURI_SCHEMA_XSI

public static final String NSURI_SCHEMA_XSI
Namespace URI for XML Schema XSI

See Also:
Constant Field Values
Constructor Detail

public NamespaceConstants()
英文文档：

NamespaceConstants

public NamespaceConstants()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ParameterMode (Java EE 5)

javax.xml.rpc
Class ParameterMode

java.lang.Object
    extended by  javax.xml.rpc.ParameterMode

public class ParameterMode
extends Object

javax.xml.rpc.ParameterMode 是类型安全的参数模式枚举。此类在 Call API 中使用，用于指定参数传递模式。
version | 1.0
See also | javax.xml.rpc.Call
英文文档：

The javax.xml.rpc.ParameterMode is a type-safe enumeration for parameter mode. This class is used in the CallAPI to specify parameter passing modes.

Version:
1.0
Author:
Rahul Sharma
See Also:
Call

Field Summary
static ParameterMode | IN IN mode for parameter passing
static ParameterMode | INOUT INOUT mode for parameter passing
static ParameterMode | OUT OUT mode for parameter passing
Method Summary
 String toString()
Returns a String describing this ParameterMode object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

英文文档：

IN

public static final ParameterMode IN
IN mode for parameter passing

英文文档：

OUT

public static final ParameterMode OUT
OUT mode for parameter passing

英文文档：

INOUT

public static final ParameterMode INOUT
INOUT mode for parameter passing

Method Detail

public String toString()
返回描述此 ParameterMode 对象的 String。
return 对象的字符串表示形式。
英文文档：

toString

public String toString()
Returns a String describing this ParameterMode object.

Overrides:
toString in class Object
Returns:
A string representation of the object.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServiceFactory (Java EE 5)

javax.xml.rpc
Class ServiceFactory

java.lang.Object
    extended by  javax.xml.rpc.ServiceFactory

public abstract class ServiceFactory
extends Object

javax.xml.rpc.ServiceFactory 是一个抽象类，提供用于创建类型为 javax.xml.rpc.Service 的实例的工厂。此抽象类遵循抽象静态工厂设计模式。这使基于 J2SE 的客户端能够以可移植方式创建 Service 实例，而无需使用 Service 实现类的构造方法。

ServiceFactory 实现类是使用系统属性 SERVICEFACTORY_PROPERTY 设置的。

version | 1.1
See also | javax.xml.rpc.Service
英文文档：

The javax.xml.rpc.ServiceFactory is an abstract class that provides a factory for the creation of instances of the type javax.xml.rpc.Service. This abstract class follows the abstract static factory design pattern. This enables a J2SE based client to create a Service instance in a portable manner without using the constructor of the Service implementation class.

The ServiceFactory implementation class is set using the system property SERVICEFACTORY_PROPERTY.

Version:
1.1
Author:
Rahul Sharma, Roberto Chinnici
See Also:
Service

Field Summary
static String SERVICEFACTORY_PROPERTY
A constant representing the property used to lookup the name of a ServiceFactory implementation class.
Constructor Summary
protected ServiceFactory()
Method Summary
abstract Service | createService(QName serviceName) Create a Service instance.
abstract Service | createService(URL wsdlDocumentLocation, QName serviceName) Create a Service instance.
abstract Service | loadService(Class serviceInterface) Create an instance of the generated service implementation class for a given service interface, if available.
abstract Service | loadService(URL wsdlDocumentLocation, Class serviceInterface, Properties properties) Create an instance of the generated service implementation class for a given service interface, if available.
abstract Service | loadService(URL wsdlDocumentLocation, QName serviceName, Properties properties) Create an instance of the generated service implementation class for a given service, if available.
static ServiceFactory | newInstance() Gets an instance of the ServiceFactory Only one copy of a factory exists and is returned to the application each time this method is called.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

SERVICEFACTORY_PROPERTY

public static final String SERVICEFACTORY_PROPERTY
A constant representing the property used to lookup the name of a ServiceFactory implementation class.

See Also:
Constant Field Values
Constructor Detail

protected ServiceFactory()
英文文档：

ServiceFactory

protected ServiceFactory()
Method Detail

public static ServiceFactory newInstance() throws ServiceException
获取 ServiceFactory 实例。

仅存在一个工厂副本，每次调用此方法时，都会将该副本返回给应用程序。

可以通过设置 javax.xml.rpc.ServiceFactory 系统属性重写要使用的实现类。

英文文档：

newInstance

public static ServiceFactory newInstance()
                                  throws ServiceException
Gets an instance of the ServiceFactory

Only one copy of a factory exists and is returned to the application each time this method is called.

The implementation class to be used can be overridden by setting the javax.xml.rpc.ServiceFactory system property.

Throws:
ServiceException

abstract public Service createService(java.net.URL wsdlDocumentLocation, javax.xml.namespace.QName serviceName) throws ServiceException
创建 Service 实例。
wsdlDocumentLocation | 服务 WSDL 文档位置的 URL
serviceName | 服务的 QName
Throws | ServiceException: 如果在创建指定服务的过程中发生任何错误
英文文档：

createService

public abstract Service createService(URL wsdlDocumentLocation,
                                      QName serviceName)
                               throws ServiceException
Create a Service instance.

Parameters:
wsdlDocumentLocation - URL for the WSDL document location for the service
serviceName - QName for the service
Throws:
ServiceException - If any error in creation of the specified service

abstract public Service createService(javax.xml.namespace.QName serviceName) throws ServiceException
创建 Service 实例。
serviceName | 服务的 QName
Throws | ServiceException: 如果在创建指定服务的过程中发生任何错误
英文文档：

createService

public abstract Service createService(QName serviceName)
                               throws ServiceException
Create a Service instance.

Parameters:
serviceName - QName for the service
Throws:
ServiceException - If any error in creation of the specified service

abstract public Service loadService(Class<T> serviceInterface) throws ServiceException
创建用于给定服务接口（如果可用）的已生成服务实现类的实例。
serviceInterface | 服务接口
Throws | ServiceException: 如果在创建指定服务时发生错误，包括无法定位生成的服务实现类的情况
英文文档：

loadService

public abstract Service loadService(Class serviceInterface)
                             throws ServiceException
Create an instance of the generated service implementation class for a given service interface, if available.

Parameters:
serviceInterface - Service interface
Throws:
ServiceException - If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located

abstract public Service loadService(java.net.URL wsdlDocumentLocation, Class<T> serviceInterface, java.util.Properties properties) throws ServiceException
创建用于给定服务接口（如果可用）的已生成服务实现类的实例。 实现可以使用提供的 wsdlDocumentLocation 和 properties 帮助定位生成的实现类。如果不存在这种类，则抛出 ServiceException。
wsdlDocumentLocation | 指向服务的 WSDL 文档位置的 URL；或者为 mull
serviceInterface | 服务接口
properties | 可帮助定位生成的服务实现类的特定于实现的属性集
Throws | ServiceException: 如果在创建指定服务时发生错误，包括无法定位生成的服务实现类的情况
英文文档：

loadService

public abstract Service loadService(URL wsdlDocumentLocation,
                                    Class serviceInterface,
                                    Properties properties)
                             throws ServiceException
Create an instance of the generated service implementation class for a given service interface, if available. An implementation may use the provided wsdlDocumentLocation and properties to help locate the generated implementation class. If no such class is present, a ServiceException will be thrown.

Parameters:
wsdlDocumentLocation - URL for the WSDL document location for the service or null
serviceInterface - Service interface
properties - A set of implementation-specific properties to help locate the generated service implementation class
Throws:
ServiceException - If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located

abstract public Service loadService(java.net.URL wsdlDocumentLocation, javax.xml.namespace.QName serviceName, java.util.Properties properties) throws ServiceException
创建用于给定服务（如果可用）的已生成服务实现类的实例。 该服务使用 wsdlDocumentLocation 和 serviceName 参数唯一标识。 实现可以使用提供的 properties 帮助定位生成的实现类。如果不存在这种类，则抛出 ServiceException。
wsdlDocumentLocation | 指向服务的 WSDL 文档位置的 URL；或者为 mull
serviceName | 服务的限定名称
properties | 可帮助定位生成的服务实现类的特定于实现的属性集
Throws | ServiceException: 如果在创建指定服务时发生错误，包括无法定位生成的服务实现类的情况
英文文档：

loadService

public abstract Service loadService(URL wsdlDocumentLocation,
                                    QName serviceName,
                                    Properties properties)
                             throws ServiceException
Create an instance of the generated service implementation class for a given service, if available. The service is uniquely identified by the wsdlDocumentLocation and serviceName arguments. An implementation may use the provided properties to help locate the generated implementation class. If no such class is present, a ServiceException will be thrown.

Parameters:
wsdlDocumentLocation - URL for the WSDL document location for the service or null
serviceName - Qualified name for the service
properties - A set of implementation-specific properties to help locate the generated service implementation class
Throws:
ServiceException - If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


JAXRPCException (Java EE 5)

javax.xml.rpc
Class JAXRPCException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.xml.rpc.JAXRPCException
All Implemented Interfaces:
Serializable
public class JAXRPCException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException

javax.xml.rpc.JAXRPCException 是从核心 JAX-RPC API 中抛出的，指示与 JAX-RPC 运行时机制有关的异常。
version 1.0
英文文档：

The javax.xml.rpc.JAXRPCException is thrown from the core JAX-RPC APIs to indicate an exception related to the JAX-RPC runtime mechanisms.

Version:
1.0
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
JAXRPCException()
Constructs a new exception with null as its detail message.
JAXRPCException(String message)
Constructs a new exception with the specified detail message.
JAXRPCException(String message, Throwable cause)
Constructs a new exception with the specified detail message and cause.
JAXRPCException(Throwable cause)
Constructs a new JAXRPCException with the specified cause and a detail message of (cause==null ?
Method Summary
 Throwable getLinkedCause()
Gets the Linked cause
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

public JAXRPCException()
构造一个新异常，它的详细消息为 null。cause 没有初始化。
英文文档：

JAXRPCException

public JAXRPCException()
Constructs a new exception with null as its detail message. The cause is not initialized.

public JAXRPCException(String message)
构造具有指定详细消息的新异常。cause 没有初始化。
message 详细消息，以后可使用 getMessage 方法检索
英文文档：

JAXRPCException

public JAXRPCException(String message)
Constructs a new exception with the specified detail message. The cause is not initialized.

Parameters:
message - The detail message which is later retrieved using the getMessage method

public JAXRPCException(String message, Throwable cause)
构造一个具有指定详细消息和 cause 的新异常。
message | 详细消息，以后可使用 getMessage 方法检索
cause | 保存此 cause，以便以后通过 getCause 方法检索
英文文档：

JAXRPCException

public JAXRPCException(String message,
                       Throwable cause)
Constructs a new exception with the specified detail message and cause.

Parameters:
message - The detail message which is later retrieved using the getMessage method
cause - The cause which is saved for the later retrieval throw by the getCause method

public JAXRPCException(Throwable cause)
构造一个新的 JAXRPCException，其指定 cause 和详细消息满足 (cause==null ? null :cause.toString())（通常包含 cause 的类和详细消息）。
cause 保存此 cause，以便以后通过 getCause 方法检索。（允许 null 值，指示 cause 是不存在的或是未知的。）
英文文档：

JAXRPCException

public JAXRPCException(Throwable cause)
Constructs a new JAXRPCException with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Parameters:
cause - The cause which is saved for the later retrieval throw by the getCause method. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Method Detail

public Throwable getLinkedCause()
获取链接的 cause。
return 此异常的 cause；如果 cause 不存在或未知，则返回 null
英文文档：

getLinkedCause

public Throwable getLinkedCause()
Gets the Linked cause

Returns:
The cause of this Exception or null if the cause is noexistent or unknown
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ServiceException (Java EE 5)

javax.xml.rpc
Class ServiceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.rpc.ServiceException
All Implemented Interfaces:
Serializable
public class ServiceException
extends Exception

Extends: Throwable > Exception

javax.xml.rpc.ServiceException 从 javax.xml.rpc.Service 接口和 ServiceFactory 类中的方法抛出。
version 1.0
英文文档：

The javax.xml.rpc.ServiceException is thrown from the methods in the javax.xml.rpc.Service interface and ServiceFactory class.

Version:
1.0
Author:
Rahul Sharma
See Also:
Serialized Form

Constructor Summary
ServiceException()
Constructs a new exception with null as its detail message.
ServiceException(String message)
Constructs a new exception with the specified detail message.
ServiceException(String message, Throwable cause)
Constructs a new exception with the specified detail message and cause.
ServiceException(Throwable cause)
Constructs a new exception with the specified cause and a detail message of (cause==null ?
Method Summary
 Throwable getLinkedCause()
Gets the Linked cause
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

public ServiceException()
构造一个新异常，它的详细消息为 null。cause 没有初始化。
英文文档：

ServiceException

public ServiceException()
Constructs a new exception with null as its detail message. The cause is not initialized.

public ServiceException(String message)
构造具有指定详细消息的新异常。cause 没有初始化。
message 详细消息，以后可使用 getMessage 方法获取
英文文档：

ServiceException

public ServiceException(String message)
Constructs a new exception with the specified detail message. The cause is not initialized.

Parameters:
message - The detail message which is later retrieved using the getMessage method

public ServiceException(String message, Throwable cause)
构造一个具有指定详细消息和 cause 的新异常。
message | 详细消息，以后可使用 getMessage 方法获取
cause | 保存此 cause，以后可通过 getCause 方法获取
英文文档：

ServiceException

public ServiceException(String message,
                        Throwable cause)
Constructs a new exception with the specified detail message and cause.

Parameters:
message - The detail message which is later retrieved using the getMessage method
cause - The cause which is saved for the later retrieval throw by the getCause method

public ServiceException(Throwable cause)
构造一个新的 JAXRPCException，其指定 cause 和详细消息满足 (cause==null ? null :cause.toString())（通常包含 cause 的类和详细消息）。
cause 保存此 cause，以便以后通过 getCause 方法检索。（允许 null 值，指示 cause 是不存在的或是未知的。）
英文文档：

ServiceException

public ServiceException(Throwable cause)
Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Parameters:
cause - The cause which is saved for the later retrieval throw by the getCause method. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Method Detail

public Throwable getLinkedCause()
获取链接的 cause。
return 此异常的 cause；如果 cause 不存在或未知，则返回 null
英文文档：

getLinkedCause

public Throwable getLinkedCause()
Gets the Linked cause

Returns:
The cause of this Exception or null if the cause is noexistent or unknown
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.rpc.encoding (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.rpc.encoding

This package defines APIs for the extensible type mapping framework.

See:
Description

Interface Summary
DeserializationContext | The javax.xml.rpc.encoding.DeserializationContext interface is implemented by the JAX-RPC runtime system in an XML processing mechanism specific manner.
Deserializer | The javax.xml.rpc.encoding.Deserializer interface defines a base interface for deserializers.
DeserializerFactory | The javax.xml.rpc.encoding.DeserializerFactory is a factory of deserializers.
SerializationContext | The javax.xml.rpc.encoding.SerializationContext interface is implemented by the JAX-RPC runtime system in an XML processing mechanism specific manner.
Serializer | The javax.xml.rpc.encoding.Serializer interface defines the base interface for serializers.
SerializerFactory | The javax.xml.rpc.encoding.SerializerFactory is a factory of the serializers.
TypeMapping | The javax.xml.rpc.encoding.TypeMapping is the base interface for the representation of a type mapping.
TypeMappingRegistry | The interface javax.xml.rpc.encoding.TypeMappingRegistry defines a registry of TypeMapping instances for various encoding styles.

Class Summary
XMLType Constants for common XML Schema and SOAP 1.1 types.

Package javax.xml.rpc.encoding Description

This package defines APIs for the extensible type mapping framework.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.rpc.encoding Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.rpc.encoding

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.rpc.encoding.XMLType

Interface Hierarchy

  • javax.xml.rpc.encoding.DeserializationContext
  • java.io.Serializable
    • javax.xml.rpc.encoding.Deserializer
    • javax.xml.rpc.encoding.DeserializerFactory
    • javax.xml.rpc.encoding.Serializer
    • javax.xml.rpc.encoding.SerializerFactory
    • javax.xml.rpc.encoding.TypeMappingRegistry
  • javax.xml.rpc.encoding.SerializationContext
  • javax.xml.rpc.encoding.TypeMapping
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


DeserializationContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.encoding
Interface DeserializationContext

public interface DeserializationContext

javax.xml.rpc.encoding.DeserializationContext 接口由 JAX-RPC 运行时系统以特定于 XML 处理机制的方式实现。Deserializer 使用此接口访问和维护反序列化期间的上下文信息。
version 1.0
英文文档：

The javax.xml.rpc.encoding.DeserializationContext interface is implemented by the JAX-RPC runtime system in an XML processing mechanism specific manner. A deserializer uses this interface to access and maintain context information during the deserialization..

Version:
1.0
Author:
Rahul Sharma

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Deserializer (Java EE 5)

javax.xml.rpc.encoding
Interface Deserializer

All Superinterfaces:
Serializable
public interface Deserializer
extends Serializable

Implements: java.io.Serializable

javax.xml.rpc.encoding.Deserializer 接口定义 Deserializer 的基本接口。Deserializer 使用特定 XML 处理机制并根据指定的类型映射和编码样式将 XML 表示形式转换为 Java 对象。
version 1.0
英文文档：

The javax.xml.rpc.encoding.Deserializer interface defines a base interface for deserializers. A Deserializer converts an XML representation to a Java object using a specific XML processing mechanism and based on the specified type mapping and encoding style.

Version:
1.0
Author:
Rahul Sharma

Method Summary
 String getMechanismType()
Gets the type of the XML processing mechanism and representation used by this Deserializer.

Method Detail

public String getMechanismType()
获取此 Deserializer 使用的 XML 处理机制类型和表示形式。
return XML 处理机制类型
英文文档：

getMechanismType

String getMechanismType()
Gets the type of the XML processing mechanism and representation used by this Deserializer.

Returns:
XML processing mechanism type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DeserializerFactory (Java EE 5)

javax.xml.rpc.encoding
Interface DeserializerFactory

All Superinterfaces:
Serializable
public interface DeserializerFactory
extends Serializable

Implements: java.io.Serializable

javax.xml.rpc.encoding.DeserializerFactory 是 Deserializer 的工厂。DeserializerFactory 向 TypeMapping 实例注册，该过程是 TypeMappingRegistry 的一部分。
version | 1.0
See also | javax.xml.rpc.encoding.Serializer
英文文档：

The javax.xml.rpc.encoding.DeserializerFactory is a factory of deserializers. A DeserializerFactory is registered with a TypeMapping instance as part of the TypeMappingRegistry.

Version:
1.0
Author:
Rahul Sharma
See Also:
Serializer

Method Summary
Deserializer | getDeserializerAs(String mechanismType) Returns a Deserializer for the specified XML processing mechanism type.
Iterator | getSupportedMechanismTypes() Returns a list of all XML processing mechanism types supported by this DeserializerFactory.

Method Detail

public Deserializer getDeserializerAs(String mechanismType)
返回指定 XML 处理机制类型的 Deserializer。
mechanismType | XML 处理机制类型 [待确定：有效常量的定义]
Throws | JAXRPCException: 如果 DeserializerFactory 不支持指定的 XML 处理机制
英文文档：

getDeserializerAs

Deserializer getDeserializerAs(String mechanismType)
Returns a Deserializer for the specified XML processing mechanism type.

Parameters:
mechanismType - XML processing mechanism type [TBD: definition of valid constants]
Throws:
JAXRPCException - If DeserializerFactory does not support the specified XML processing mechanism

public java.util.Iterator<E> getSupportedMechanismTypes()
返回此 DeserializerFactory 支持的所有 XML 处理机制类型所组成的列表。
return 受支持 XML 处理机制类型的唯一标识符列表
英文文档：

getSupportedMechanismTypes

Iterator getSupportedMechanismTypes()
Returns a list of all XML processing mechanism types supported by this DeserializerFactory.

Returns:
List of unique identifiers for the supported XML processing mechanism types
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SerializationContext (Java EE 5)

javax.xml.rpc.encoding
Interface SerializationContext

public interface SerializationContext

javax.xml.rpc.encoding.SerializationContext 接口由 JAX-RPC 运行时系统以特定于 XML 处理机制的方式实现。Serializer 在序列化期间使用 SerializationContext 接口获取与 XML 处理机制有关的上下文信息，并管理特定于序列化的信息。
version | 1.0
See also | javax.xml.rpc.encoding.Serializer
英文文档：

The javax.xml.rpc.encoding.SerializationContext interface is implemented by the JAX-RPC runtime system in an XML processing mechanism specific manner. A serializer uses the SerializationContext interface during the serialization to get the context information related to the XML processing mechanism and to manage information specific to serialization.

Version:
1.0
Author:
Rahul Sharma
See Also:
Serializer

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Serializer (Java EE 5)

javax.xml.rpc.encoding
Interface Serializer

All Superinterfaces:
Serializable
public interface Serializer
extends Serializable

Implements: java.io.Serializable

javax.xml.rpc.encoding.Serializer 接口定义了 Serializer 的基本接口。Serializer 使用特定 XML 处理机制并根据指定的类型映射和编码样式将 Java 对象转换为 XML 表示形式。
version 1.0
英文文档：

The javax.xml.rpc.encoding.Serializer interface defines the base interface for serializers. A Serializer converts a Java object to an XML representation using a specific XML processing mechanism and based on the specified type mapping and encoding style.

Version:
1.0
Author:
Rahul Sharma

Method Summary
 String getMechanismType()
Gets the type of the XML processing mechanism and representation used by this Serializer.

Method Detail

public String getMechanismType()
获取此 Serializer 使用的 XML 处理机制类型和表示形式。
return XML 处理机制类型
英文文档：

getMechanismType

String getMechanismType()
Gets the type of the XML processing mechanism and representation used by this Serializer.

Returns:
XML processing mechanism type
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SerializerFactory (Java EE 5)

javax.xml.rpc.encoding
Interface SerializerFactory

All Superinterfaces:
Serializable
public interface SerializerFactory
extends Serializable

Implements: java.io.Serializable

javax.xml.rpc.encoding.SerializerFactory 是 Serializer 的工厂。SerializerFactory 向 TypeMapping 对象注册，该过程是 TypeMappingRegistry 的一部分。
version | 1.0
See also | javax.xml.rpc.encoding.Serializer
英文文档：

The javax.xml.rpc.encoding.SerializerFactory is a factory of the serializers. A SerializerFactory is registered with a TypeMapping object as part of the TypeMappingRegistry.

Version:
1.0
Author:
Rahul Sharma
See Also:
Serializer

Method Summary
Serializer | getSerializerAs(String mechanismType) Returns a Serializer for the specified XML processing mechanism type.
Iterator | getSupportedMechanismTypes() Returns a list of all XML processing mechanism types supported by this SerializerFactory.

Method Detail

public Serializer getSerializerAs(String mechanismType)
返回指定 XML 处理机制类型的 Serializer。
mechanismType | XML 处理机制类型 [待确定：有效常量的定义]
Throws | JAXRPCException: 如果 SerializerFactory 不支持指定的 XML 处理机制
Throws | IllegalArgumentException: 如果指定了无效的机制类型。
英文文档：

getSerializerAs

Serializer getSerializerAs(String mechanismType)
Returns a Serializer for the specified XML processing mechanism type.

Parameters:
mechanismType - XML processing mechanism type [TBD: definition of valid constants]
Throws:
JAXRPCException - If SerializerFactory does not support the specified XML processing mechanism
IllegalArgumentException - If an invalid mechanism type is specified.

public java.util.Iterator<E> getSupportedMechanismTypes()
返回此 SerializerFactory 支持的所有 XML 处理机制类型所组成的列表。
return 受支持 XML 处理机制类型的唯一标识符列表
英文文档：

getSupportedMechanismTypes

Iterator getSupportedMechanismTypes()
Returns a list of all XML processing mechanism types supported by this SerializerFactory.

Returns:
List of unique identifiers for the supported XML processing mechanism types
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeMapping (Java EE 5)

javax.xml.rpc.encoding
Interface TypeMapping

public interface TypeMapping

javax.xml.rpc.encoding.TypeMapping 是用于类型映射表示形式的基本接口。TypeMapping 实现类可以支持一个或多个编码样式。

对于支持的编码样式，TypeMapping 实例维护一个类型元组集{Java 类型, SerializerFactory, DeserializerFactory, XML 类型}。

version 1.0
英文文档：

The javax.xml.rpc.encoding.TypeMapping is the base interface for the representation of a type mapping. A TypeMapping implementation class may support one or more encoding styles.

For its supported encoding styles, a TypeMapping instance maintains a set of tuples of the type {Java type, SerializerFactory, DeserializerFactory, XML type}.

Version:
1.0
Author:
Rahul Sharma

Method Summary
DeserializerFactory | getDeserializer(Class javaType, QName xmlType) Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.
SerializerFactory | getSerializer(Class javaType, QName xmlType) Gets the SerializerFactory registered for the specified pair of Java type and XML data type.
String[] | getSupportedEncodings() Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance.
boolean | isRegistered(Class javaType, QName xmlType) Checks whether or not type mapping between specified XML type and Java type is registered.
void | register(Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf) Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type.
void | removeDeserializer(Class javaType, QName xmlType) Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.
void | removeSerializer(Class javaType, QName xmlType) Removes the SerializerFactory registered for the specified pair of Java type and XML data type.
void | setSupportedEncodings(String[] encodingStyleURIs) Sets the encodingStyle URIs supported by this TypeMapping instance.

Method Detail

public String[] getSupportedEncodings()
返回此 TypeMapping 实例支持的 encodingStyle URI（String[] 形式）。仅包含独立于编码样式的 Serializer 和 Deserializer 的 TypeMapping 从此方法返回 null。
return 受支持编码样式的 encodingStyle URI 所组成的数组
英文文档：

getSupportedEncodings

String[] getSupportedEncodings()
Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance. A TypeMapping that contains only encoding style independent serializers and deserializers returns null from this method.

Returns:
Array of encodingStyle URIs for the supported encoding styles

public void setSupportedEncodings(String[] encodingStyleURIs)
设置此 TypeMapping 实例支持的 encodingStyle URI。仅包含独立于编码的 Serializer 和 Deserializer 的 TypeMapping 要求使用 null 作为此方法的参数。
encodingStyleURIs 受支持编码样式的 encodingStyle URI 所组成的数组
英文文档：

setSupportedEncodings

void setSupportedEncodings(String[] encodingStyleURIs)
Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping that contains only encoding independent serializers and deserializers requires null as the parameter for this method.

Parameters:
encodingStyleURIs - Array of encodingStyle URIs for the supported encoding styles

public boolean isRegistered(Class<T> javaType, javax.xml.namespace.QName xmlType)
检查是否注册了指定 XML 类型与 Java 类型之间的类型映射。
javaType | Java 类型的类
QName | XML 数据类型的限定名称
return | 一个 boolean 值，如果注册了指定 XML 类型与 Java 类型之间的类型映射，则返回 true；否则返回 false
英文文档：

isRegistered

boolean isRegistered(Class javaType,
                     QName xmlType)
Checks whether or not type mapping between specified XML type and Java type is registered.

Parameters:
javaType - Class of the Java type
QName - Qualified name of the XML data type
Returns:
boolean; true if type mapping between the specified XML type and Java type is registered; otherwise false

public void register(Class<T> javaType, javax.xml.namespace.QName xmlType, SerializerFactory sf, DeserializerFactory dsf)
注册用于 XML 类型与 Java 类型之间的特定类型映射的 SerializerFactory 和 DeserializerFactory。此方法将替换任何现有的已注册 SerializerFactory DeserializerFactory 实例。
javaType | Java 类型的类
QName | XML 数据类型的限定名称
sf
en
SerializerFactory
dsf
en
DeserializerFactory
Throws | JAXRPCException: 如果注册期间发生错误
英文文档：

register

void register(Class javaType,
              QName xmlType,
              SerializerFactory sf,
              DeserializerFactory dsf)
Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type. This method replaces any existing registered SerializerFactory DeserializerFactory instances.

Parameters:
javaType - Class of the Java type
QName - Qualified name of the XML data type
sf - SerializerFactory
dsf - DeserializerFactory
Throws:
JAXRPCException - If any error during the registration

public SerializerFactory getSerializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
获取已针对指定的 Java 类型和 XML 数据类型对注册的 SerializerFactory。
javaType | Java 类型的类
QName | XML 数据类型的限定名称
return | 已注册的 SerializerFactory；如果没有任何已注册的工厂，则返回 null
英文文档：

getSerializer

SerializerFactory getSerializer(Class javaType,
                                QName xmlType)
Gets the SerializerFactory registered for the specified pair of Java type and XML data type.

Parameters:
javaType - Class of the Java type
QName - Qualified name of the XML data type
Returns:
Registered SerializerFactory or null if there is no registered factory

public DeserializerFactory getDeserializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
获取已针对指定的 Java 类型和 XML 数据类型对注册的 DeserializerFactory。
javaType | Java 类型的类
QName | XML 数据类型的限定名称
return | 已注册的 DeserializerFactory；如果没有任何已注册的工厂，则返回 null
英文文档：

getDeserializer

DeserializerFactory getDeserializer(Class javaType,
                                    QName xmlType)
Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.

Parameters:
javaType - Class of the Java type
QName - Qualified name of the XML data type
Returns:
Registered DeserializerFactory or null if there is no registered factory

public void removeSerializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
移除已针对指定的 Java 类型和 XML 数据类型对注册的 SerializerFactory。
Throws JAXRPCException: 如果在移除已注册 SerializerFactory 的过程中出现错误
英文文档：

removeSerializer

void removeSerializer(Class javaType,
                      QName xmlType)
Removes the SerializerFactory registered for the specified pair of Java type and XML data type.

Throws:
JAXRPCException - If there is error in removing the registered SerializerFactory

public void removeDeserializer(Class<T> javaType, javax.xml.namespace.QName xmlType)
移除已针对指定的 Java 类型和 XML 数据类型类注册的 DeserializerFactory。
Throws JAXRPCException: 如果在移除已注册 DeserializerFactory 的过程中出现错误
英文文档：

removeDeserializer

void removeDeserializer(Class javaType,
                        QName xmlType)
Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.

Throws:
JAXRPCException - If there is error in removing the registered DeserializerFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


TypeMappingRegistry (Java EE 5)

javax.xml.rpc.encoding
Interface TypeMappingRegistry

All Superinterfaces:
Serializable
public interface TypeMappingRegistry
extends Serializable

Implements: java.io.Serializable

接口 javax.xml.rpc.encoding.TypeMappingRegistry 定义用于各种编码样式的 TypeMapping 实例的注册表。
version 1.0
英文文档：

The interface javax.xml.rpc.encoding.TypeMappingRegistry defines a registry of TypeMapping instances for various encoding styles.

Version:
1.0
Author:
Rahul Sharma

Method Summary
void | clear() Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.
TypeMapping | createTypeMapping() Creates a new empty TypeMapping object.
TypeMapping | getDefaultTypeMapping() Gets the registered default TypeMapping instance.
String[] | getRegisteredEncodingStyleURIs() Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.
TypeMapping | getTypeMapping(String encodingStyleURI) Returns the registered TypeMapping for the specified encodingStyle URI.
TypeMapping | register(String encodingStyleURI, TypeMapping mapping) Registers a TypeMapping instance with the TypeMappingRegistry.
void | registerDefault(TypeMapping mapping) Registers the TypeMapping instance that is default for all encoding styles supported by the TypeMappingRegistry.
boolean | removeTypeMapping(TypeMapping mapping) Removes a TypeMapping from the TypeMappingRegistry.
TypeMapping | unregisterTypeMapping(String encodingStyleURI) Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.

Method Detail

public TypeMapping register(String encodingStyleURI, TypeMapping mapping)
向 TypeMappingRegistry 注册 TypeMapping 实例。此方法替代任何现有的已注册 TypeMapping 实例，以获取指定的 encodingStyleURI。
encodingStyleURI | 指定为 URI 的编码样式。例如 "http://schemas.xmlsoap.org/soap/encoding/"
mapping | TypeMapping 实例
return | 与指定 encodingStyleURI 关联的旧 TypeMapping；如果没有任何与指定 encodingStyleURI 关联的 TypeMapping，则返回 null
Throws | JAXRPCException: 如果注册指定 encodingStyleURI 的 TypeMapping 的过程中发现错误。
英文文档：

register

TypeMapping register(String encodingStyleURI,
                     TypeMapping mapping)
Registers a TypeMapping instance with the TypeMappingRegistry. This method replaces any existing registered TypeMapping instance for the specified encodingStyleURI.

Parameters:
encodingStyleURI - An encoding style specified as an URI. An example is "http://schemas.xmlsoap.org/soap/encoding/"
mapping - TypeMapping instance
Returns:
Previous TypeMapping associated with the specified encodingStyleURI, or null if there was no TypeMapping associated with the specified encodingStyleURI
Throws:
JAXRPCException - If there is an error in the registration of the TypeMapping for the specified encodingStyleURI.

public void registerDefault(TypeMapping mapping)
注册 TypeMapping 实例，该实例是 TypeMappingRegistry 支持的所有编码样式的默认值。默认 TypeMapping 应该包含独立于任何编码样式并能与任何编码样式一起使用的 Serializer 和 Deserializer。连续调用 registerDefault 方法将替换任何现有的默认 TypeMapping 实例。

如果注册了默认的 TypeMapping，那么通过 TypeMappingRegistry.register 方法（用于 encodingStyle URI 集合）注册的其他 TypeMapping 实例都将重写默认的 TypeMapping。

mapping | TypeMapping 实例
Throws | JAXRPCException: 如果注册默认 TypeMapping 的过程中发现错误
英文文档：

registerDefault

void registerDefault(TypeMapping mapping)
Registers the TypeMapping instance that is default for all encoding styles supported by the TypeMappingRegistry. A default TypeMapping should include serializers and deserializers that are independent of and usable with any encoding style. Successive invocations of the registerDefault method replace any existing default TypeMapping instance.

If the default TypeMapping is registered, any other TypeMapping instances registered through the TypeMappingRegistry.register method (for a set of encodingStyle URIs) override the default TypeMapping.

Parameters:
mapping - TypeMapping instance
Throws:
JAXRPCException - If there is an error in the registration of the default TypeMapping

public TypeMapping getDefaultTypeMapping()
获取已注册的默认 TypeMapping 实例。如果注册表中没有任何已注册的默认 TypeMapping，则此方法返回 null。
return 已注册的默认 TypeMapping 实例或 null
英文文档：

getDefaultTypeMapping

TypeMapping getDefaultTypeMapping()
Gets the registered default TypeMapping instance. This method returns null if there is no registered default TypeMapping in the registry.

Returns:
The registered default TypeMapping instance or null

public String[] getRegisteredEncodingStyleURIs()
返回此 TypeMappingRegistry 实例中已注册 encodingStyle URI 所组成的列表。
return 已注册 encodingStyle URI 所组成的数组
英文文档：

getRegisteredEncodingStyleURIs

String[] getRegisteredEncodingStyleURIs()
Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.

Returns:
Array of the registered encodingStyle URIs

public TypeMapping getTypeMapping(String encodingStyleURI)
返回用于指定 encodingStyle URI 的已注册 TypeMapping。如果没有任何用于指定 encodingStyleURI 的已注册 TypeMapping，则此方法返回 null。
encodingStyleURI | 指定为 URI 的编码样式
return | 指定 encodingStyleURI 的 TypeMapping 或 null
英文文档：

getTypeMapping

TypeMapping getTypeMapping(String encodingStyleURI)
Returns the registered TypeMapping for the specified encodingStyle URI. If there is no registered TypeMapping for the specified encodingStyleURI, this method returns null.

Parameters:
encodingStyleURI - Encoding style specified as an URI
Returns:
TypeMapping for the specified encodingStyleURI or null

public TypeMapping createTypeMapping()
创建一个新的空 TypeMapping 对象。
return TypeMapping 实例
英文文档：

createTypeMapping

TypeMapping createTypeMapping()
Creates a new empty TypeMapping object.

Returns:
TypeMapping instance

public TypeMapping unregisterTypeMapping(String encodingStyleURI)
从指定的 encodingStyleURI 中注销某个 TypeMapping 实例（如果存在）。
encodingStyleURI | 指定为 URI 的编码样式
return | 已经注销的 TypeMapping 实例；如果没有任何用于指定 encodingStyleURI 的已注册 TypeMapping，则返回 null
英文文档：

unregisterTypeMapping

TypeMapping unregisterTypeMapping(String encodingStyleURI)
Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.

Parameters:
encodingStyleURI - Encoding style specified as an URI
Returns:
TypeMapping instance that has been unregistered or null if there was no TypeMapping registered for the specified encodingStyleURI

public boolean removeTypeMapping(TypeMapping mapping)
从 TypeMappingRegistry 中移除 TypeMapping。TypeMapping 与一个或多个 encodingStyleURI 关联。此方法注销所有关联 encodingStyleURIs 中的指定 TypeMapping 实例，然后从注册表中移除此 TypeMapping 实例。
mapping | 将要移除的 TypeMapping
return | 如果从 TypeMappingRegistry 中移除了指定的 TypeMapping，则返回 true；如果指定的 TypeMapping 不在 TypeMappingRegistry 中，则返回 false
英文文档：

removeTypeMapping

boolean removeTypeMapping(TypeMapping mapping)
Removes a TypeMapping from the TypeMappingRegistry. A TypeMapping is associated with 1 or more encodingStyleURIs. This method unregisters the specified TypeMapping instance from all associated encodingStyleURIs and then removes this TypeMapping instance from the registry.

Parameters:
mapping - TypeMapping to be removed
Returns:
true if specified TypeMapping is removed from the TypeMappingRegistry; false if the specified TypeMapping was not in the TypeMappingRegistry

public void clear()
从此 TypeMappingRegistry 中移除所有已注册的 TypeMapping 和 encodingStyleURI。
英文文档：

clear

void clear()
Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLType (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.encoding
Class XMLType

java.lang.Object
    extended by  javax.xml.rpc.encoding.XMLType

public class XMLType
extends Object

用于公共 XML 模式和 SOAP 1.1 类型的常量。
version 1.0
英文文档：

Constants for common XML Schema and SOAP 1.1 types.

Version:
1.0
Author:
Rahul Sharma

Field Summary
static QName | SOAP_ARRAY The name of the SOAP-ENC:Array type.
static QName | SOAP_BASE64 The name of the SOAP-ENC:base64 type.
static QName | SOAP_BOOLEAN The name of the SOAP-ENC:boolean type.
static QName | SOAP_BYTE The name of the SOAP-ENC:byte type.
static QName | SOAP_DOUBLE The name of the SOAP-ENC:double type.
static QName | SOAP_FLOAT The name of the SOAP-ENC:float type.
static QName | SOAP_INT The name of the SOAP-ENC:int type.
static QName | SOAP_LONG The name of the SOAP-ENC:long type.
static QName | SOAP_SHORT The name of the SOAP-ENC:short type.
static QName | SOAP_STRING The name of the SOAP-ENC:string type.
static QName | XSD_BASE64 The name of the xsd:base64Binary type.
static QName | XSD_BOOLEAN The name of the xsd:boolean type.
static QName | XSD_BYTE The name of the xsd:byte type.
static QName | XSD_DATETIME The name of the xsd:dateTime type.
static QName | XSD_DECIMAL The name of the xsd:decimal type.
static QName | XSD_DOUBLE The name of the xsd:double type.
static QName | XSD_FLOAT The name of the xsd:float type.
static QName | XSD_HEXBINARY The name of the xsd:hexBinary type.
static QName | XSD_INT The name of the xsd:int type.
static QName | XSD_INTEGER The name of the xsd:integer type.
static QName | XSD_LONG The name of the xsd:long type.
static QName | XSD_QNAME The name of the xsd:QName type.
static QName | XSD_SHORT The name of the xsd:short type.
static QName | XSD_STRING The name of the xsd:string type.
Constructor Summary
XMLType()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

XSD_STRING

public static final QName XSD_STRING
The name of the xsd:string type.

英文文档：

XSD_FLOAT

public static final QName XSD_FLOAT
The name of the xsd:float type.

英文文档：

XSD_BOOLEAN

public static final QName XSD_BOOLEAN
The name of the xsd:boolean type.

英文文档：

XSD_DOUBLE

public static final QName XSD_DOUBLE
The name of the xsd:double type.

英文文档：

XSD_INTEGER

public static final QName XSD_INTEGER
The name of the xsd:integer type.

英文文档：

XSD_INT

public static final QName XSD_INT
The name of the xsd:int type.

英文文档：

XSD_LONG

public static final QName XSD_LONG
The name of the xsd:long type.

英文文档：

XSD_SHORT

public static final QName XSD_SHORT
The name of the xsd:short type.

英文文档：

XSD_DECIMAL

public static final QName XSD_DECIMAL
The name of the xsd:decimal type.

英文文档：

XSD_BASE64

public static final QName XSD_BASE64
The name of the xsd:base64Binary type.

英文文档：

XSD_HEXBINARY

public static final QName XSD_HEXBINARY
The name of the xsd:hexBinary type.

英文文档：

XSD_BYTE

public static final QName XSD_BYTE
The name of the xsd:byte type.

英文文档：

XSD_DATETIME

public static final QName XSD_DATETIME
The name of the xsd:dateTime type.

英文文档：

XSD_QNAME

public static final QName XSD_QNAME
The name of the xsd:QName type.

英文文档：

SOAP_STRING

public static final QName SOAP_STRING
The name of the SOAP-ENC:string type.

英文文档：

SOAP_BOOLEAN

public static final QName SOAP_BOOLEAN
The name of the SOAP-ENC:boolean type.

英文文档：

SOAP_DOUBLE

public static final QName SOAP_DOUBLE
The name of the SOAP-ENC:double type.

英文文档：

SOAP_BASE64

public static final QName SOAP_BASE64
The name of the SOAP-ENC:base64 type.

英文文档：

SOAP_FLOAT

public static final QName SOAP_FLOAT
The name of the SOAP-ENC:float type.

英文文档：

SOAP_INT

public static final QName SOAP_INT
The name of the SOAP-ENC:int type.

英文文档：

SOAP_LONG

public static final QName SOAP_LONG
The name of the SOAP-ENC:long type.

英文文档：

SOAP_SHORT

public static final QName SOAP_SHORT
The name of the SOAP-ENC:short type.

英文文档：

SOAP_BYTE

public static final QName SOAP_BYTE
The name of the SOAP-ENC:byte type.

英文文档：

SOAP_ARRAY

public static final QName SOAP_ARRAY
The name of the SOAP-ENC:Array type.

Constructor Detail

public XMLType()
英文文档：

XMLType

public XMLType()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.rpc.handler (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.rpc.handler

This package defines APIs for SOAP Message Handlers

See:
Description

Interface Summary
Handler | The javax.xml.rpc.handler.Handler interface is required to be implemented by a SOAP message handler.
HandlerChain | The javax.xml.rpc.handler.HandlerChain represents a list of handlers.
HandlerRegistry | The javax.xml.rpc.handler.HandlerRegistry provides support for the programmatic configuration of handlers in a HandlerRegistry.
MessageContext | The interface MessageContext abstracts the message context that is processed by a handler in the handle method.

Class Summary
GenericHandler | The javax.xml.rpc.handler.GenericHandler class implements the Handler interface.
HandlerInfo | The javax.xml.rpc.handler.HandlerInfo represents information about a handler in the HandlerChain.

Package javax.xml.rpc.handler Description

This package defines APIs for SOAP Message Handlers

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.rpc.handler Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.rpc.handler

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.rpc.handler.GenericHandler (implements javax.xml.rpc.handler.Handler)
    • javax.xml.rpc.handler.HandlerInfo (implements java.io.Serializable)

Interface Hierarchy

  • javax.xml.rpc.handler.Handler
  • java.lang.Iterable<T>
    • java.util.Collection<E>
      • java.util.List<E>
        • javax.xml.rpc.handler.HandlerChain
  • javax.xml.rpc.handler.MessageContext
  • java.io.Serializable
    • javax.xml.rpc.handler.HandlerRegistry
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Handler (Java EE 5)

javax.xml.rpc.handler
Interface Handler

All Known Implementing Classes:
GenericHandler
public interface Handler

Implemented by: GenericHandler

javax.xml.rpc.handler.Handler 接口需要由 SOAP 消息处理程序实现。用于 SOAP 消息处理程序的 handleRequest、handleResponse 和 handleFault 方法将能够访问 SOAPMessageContext 的 SOAPMessage。这些方法的实现可以修改 SOAPMessage，包括头和正文元素。
version 1.0
英文文档：

The javax.xml.rpc.handler.Handler interface is required to be implemented by a SOAP message handler. The handleRequest, handleResponse and handleFault methods for a SOAP message handler get access to the SOAPMessage from the SOAPMessageContext. The implementation of these methods can modify the SOAPMessage including the headers and body elements.

Version:
1.0
Author:
Rahul Sharma

Method Summary
void | destroy() The destroy method indicates the end of lifecycle for a Handler instance.
QName[] | getHeaders() Gets the header blocks that can be processed by this Handler instance.
boolean | handleFault(MessageContext context) The handleFault method processes the SOAP faults based on the SOAP message processing model.
boolean | handleRequest(MessageContext context) The handleRequest method processes the request message.
boolean | handleResponse(MessageContext context) The handleResponse method processes the response SOAP message.
void | init(HandlerInfo config) The init method enables the Handler instance to initialize itself.

Method Detail

public boolean handleRequest(MessageContext context)
handleRequest 方法可处理请求消息。
context | MessageContext 参数提供对请求消息的访问。
return boolean 指示处理模式
  • 返回 true 指示连续处理请求处理程序链。HandlerChain 负责调用下一个实体。下一个实体可能是 HandlerChain 中的下一个处理程序；如果此处理程序是链中的最后一个处理程序，则下一个实体是服务端点对象。
  • 返回 false 表示阻塞请求处理程序链。在这种情况下，进一步处理请求处理程序链将被阻塞，目标服务端点未分发。JAX-RPC 运行时系统负责使用 SOAPMessageContext 调用响应处理程序链的下一个处理程序。Handler 实现类负责使用 handleRequest 和/或 handleResponse 方法设置相应的响应 SOAP 消息。在默认处理模型中，响应处理程序链从同一个 Handler 实例（该实例返回 false）开始处理，按执行顺序的反方向进行。
Throws | JAXRPCException: 此异常指示特定于处理程序的运行时错误。如果 handleRequest 方法抛出 JAXRPCException，则 HandlerChain 将终止此处理程序链的进一步处理。在服务器端，HandlerChain 生成一个 SOAP 错误，指示导致消息无法处理的原因不是消息本身的内容，而是处理消息过程中出现的运行时错误。在客户端，异常传播到客户端代码
Throws | SOAPFaultException: 指示 SOAP 错误。Handler 实现类负责使用 handleRequest 和/或 handleFault 方法设置 SOAP 消息中的 SOAP 错误。如果服务器端请求处理程序的 handleRequest 方法抛出 SOAPFaultException，则 HandlerChain 将终止此处理程序链中请求处理程序的进一步处理，并对 SOAP 消息上下文中的 HandlerChain 调用 handleFault 方法。接下来，HandlerChain 对处理程序链中已注册的处理程序调用 handleFault，从抛出异常的 Handler 实例开始，按执行顺序的反方向进行。客户端请求处理程序的 handleRequest 方法不应抛出 SOAPFaultException。
英文文档：

handleRequest

boolean handleRequest(MessageContext context)
The handleRequest method processes the request message.

Parameters:
context - MessageContext parameter provides access to the request message.
Returns:
boolean Indicates the processing mode
  • Return true to indicate continued processing of the request handler chain. The HandlerChain takes the responsibility of invoking the next entity. The next entity may be the next handler in the HandlerChain or if this handler is the last handler in the chain, the next entity is the service endpoint object.
  • Return false to indicate blocking of the request handler chain. In this case, further processing of the request handler chain is blocked and the target service endpoint is not dispatched. The JAX-RPC runtime system takes the responsibility of invoking the response handler chain next with the SOAPMessageContext. The Handler implementation class has the the responsibility of setting the appropriate response SOAP message in either handleRequest and/or handleResponse method. In the default processing model, the response handler chain starts processing from the same Handler instance (that returned false) and goes backward in the execution sequence.
Throws:
JAXRPCException - This exception indicates handler specific runtime error. If JAXRPCException is thrown by a handleRequest method, the HandlerChain terminates the further processing of this handler chain. On the server side, the HandlerChain generates a SOAP fault that indicates that the message could not be processed for reasons not directly attributable to the contents of the message itself but rather to a runtime error during the processing of the message. On the client side, the exception is propagated to the client code
SOAPFaultException - This indicates a SOAP fault. The Handler implementation class has the the responsibility of setting the SOAP fault in the SOAP message in either handleRequest and/or handleFault method. If SOAPFaultException is thrown by a server-side request handler's handleRequest method, the HandlerChain terminates the further processing of the request handlers in this handler chain and invokes the handleFault method on the HandlerChain with the SOAP message context. Next, the HandlerChain invokes the handleFault method on handlers registered in the handler chain, beginning with the Handler instance that threw the exception and going backward in execution. The client-side request handler's handleRequest method should not throw the SOAPFaultException.

public boolean handleResponse(MessageContext context)
handleResponse 方法可处理响应 SOAP 消息。
context | MessageContext 参数提供对响应 SOAP 消息的访问
return 指示处理模式的 boolean 值
  • 返回 true 指示继续处理响应处理程序链。HandlerChain 对处理程序链中的下一个 Handler 调用 handleResponse 方法。
  • 返回 false 指示阻塞响应处理程序链。在这种情况下，不调用处理程序链中的其他响应处理程序。
Throws | JAXRPCException: 指示特定于处理程序的运行时错误。如果 handleResponse 方法抛出 JAXRPCException，则 HandlerChain 将终止此处理程序链的进一步处理。在服务器端，HandlerChain 生成一个 SOAP 错误，指示导致消息无法处理的原因不是消息本身的内容，而是处理消息过程中出现的运行时错误。在客户端，运行时异常传播到客户端代码。
英文文档：

handleResponse

boolean handleResponse(MessageContext context)
The handleResponse method processes the response SOAP message.

Parameters:
context - MessageContext parameter provides access to the response SOAP message
Returns:
boolean Indicates the processing mode
  • Return true to indicate continued processing ofthe response handler chain. The HandlerChain invokes the handleResponse method on the next Handler in the handler chain.
  • Return false to indicate blocking of the response handler chain. In this case, no other response handlers in the handler chain are invoked.
Throws:
JAXRPCException - Indicates handler specific runtime error. If JAXRPCException is thrown by a handleResponse method, the HandlerChain terminates the further processing of this handler chain. On the server side, the HandlerChain generates a SOAP fault that indicates that the message could not be processed for reasons not directly attributable to the contents of the message itself but rather to a runtime error during the processing of the message. On the client side, the runtime exception is propagated to the client code.

public boolean handleFault(MessageContext context)
handleFault 方法根据 SOAP 消息处理模型处理 SOAP 错误。
context | MessageContext 参数提供对 SOAP 消息的访问
return 指示处理模式的 boolean 值
  • 返回 true 指示继续处理 SOAP 错误。HandlerChain 对处理程序链中的下一个 Handler 调用 handleFault 方法。
  • 返回 false 指示结束 SOAP 错误的处理。在这种情况下，不调用处理程序链中的其他处理程序。
Throws | JAXRPCException: 指示特定于处理程序的运行时错误。如果 handleFault 方法抛出 JAXRPCException，则 HandlerChain 将终止此处理程序链的进一步处理。在服务器端，HandlerChain 生成一个 SOAP 错误，指示导致消息无法处理的原因不是消息本身的内容，而是处理消息过程中出现的运行时错误。在客户端，JAXRPCException 传播到客户端代码。
英文文档：

handleFault

boolean handleFault(MessageContext context)
The handleFault method processes the SOAP faults based on the SOAP message processing model.

Parameters:
context - MessageContext parameter provides access to the SOAP message
Returns:
boolean Indicates the processing mode
  • Return true to indicate continued processing of SOAP Fault. The HandlerChain invokes the handleFault method on the next Handler in the handler chain.
  • Return false to indicate end of the SOAP fault processing. In this case, no other handlers in the handler chain are invoked.
Throws:
JAXRPCException - Indicates handler specific runtime error. If JAXRPCException is thrown by a handleFault method, the HandlerChain terminates the further processing of this handler chain. On the server side, the HandlerChain generates a SOAP fault that indicates that the message could not be processed for reasons not directly attributable to the contents of the message itself but rather to a runtime error during the processing of the message. On the client side, the JAXRPCException is propagated to the client code.

public void init(HandlerInfo config)
init 方法使 Handler 实例能够初始化自身。init 方法将处理程序配置作为 HandlerInfo 实例传递。HandlerInfo 用于在初始化期间配置 Handler（例如：建立对外部资源或服务的访问）。

使用 init 方法，Handler 可以访问任何资源（例如，访问日志服务或数据库），并将这些资源作为其实例变量的一部分维护。注意，这些实例变量不得具有任何特定于各种处理方法所执行的 SOAP 消息处理的状态。

HandlerInfo | 初始化此处理程序的配置
Throws | JAXRPCException: 如果初始化处理程序失败
英文文档：

init

void init(HandlerInfo config)
The init method enables the Handler instance to initialize itself. The init method passes the handler configuration as a HandlerInfo instance. The HandlerInfo is used to configure the Handler (for example: setup access to an external resource or service) during the initialization.

In the init method, the Handler class may get access to any resources (for example; access to a logging service or database) and maintain these as part of its instance variables. Note that these instance variables must not have any state specific to the SOAP message processing performed in the various handle method.

Parameters:
HandlerInfo - Configuration for the initialization of this handler
Throws:
JAXRPCException - If initialization of the handler fails

public void destroy()
destroy 方法指示 Handler 实例的生命周期结束。Handler 实现类应该释放其资源，并在 destroy 方法的实现中执行 cleanup 操作。
Throws JAXRPCException: 如果销毁过程中发生错误
英文文档：

destroy

void destroy()
The destroy method indicates the end of lifecycle for a Handler instance. The Handler implementation class should release its resources and perform cleanup in the implementation of the destroy method.

Throws:
JAXRPCException - If any error during destroy

public javax.xml.namespace.QName[] getHeaders()
获取可以由此处理程序实例处理的头块。
return 此处理程序实例处理的头块的 QName 所组成的数组。QName 是头块最外面的元素的限定名称。
英文文档：

getHeaders

QName[] getHeaders()
Gets the header blocks that can be processed by this Handler instance.

Returns:
Array of QNames of header blocks processed by this handler instance. QName is the qualified name of the outermost element of the Header block.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerChain (Java EE 5)

javax.xml.rpc.handler
Interface HandlerChain

All Superinterfaces:
Collection, Iterable, List
public interface HandlerChain
extends List

Implements: java.util.List<E>

javax.xml.rpc.handler.HandlerChain 表示一个处理程序列表。HandlerChain 中所有元素的类型都是 javax.xml.rpc.handler.Handler。

HandlerChain 接口的实现类抽象化用来调用已注册处理程序的策略和机制。

version | 1.0
See also | javax.xml.rpc.handler.HandlerChain
英文文档：

The javax.xml.rpc.handler.HandlerChain represents a list of handlers. All elements in the HandlerChain are of the type javax.xml.rpc.handler.Handler.

An implementation class for the HandlerChain interface abstracts the policy and mechanism for the invocation of the registered handlers.

Version:
1.0
Author:
Rahul Sharma
See Also:
HandlerChain

Method Summary
void | destroy() Indicates the end of lifecycle for a HandlerChain.
String[] | getRoles() Gets SOAP actor roles registered for this HandlerChain at this SOAP node.
boolean | handleFault(MessageContext context) The handleFault method initiates the SOAP fault processing for this handler chain.
boolean | handleRequest(MessageContext context) The handleRequest method initiates the request processing for this handler chain.
boolean | handleResponse(MessageContext context) The handleResponse method initiates the response processing for this handler chain.
void | init(Map config) Initializes the configuration for a HandlerChain.
void | setRoles(String[] soapActorNames) Sets SOAP Actor roles for this HandlerChain.
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray

Method Detail

public boolean handleRequest(MessageContext context)
handleRequest 方法初始化此处理程序链的请求处理。
context | MessageContext 参数提供对请求 SOAP 消息的访问。
return | 一个 boolean 值，如果处理了链中的所有处理程序，则返回 true。如果链中某个处理程序从其 handleRequest 方法返回 false，则返回 false。
Throws | JAXRPCException: 如果发生处理错误
See also | handleRequest
英文文档：

handleRequest

boolean handleRequest(MessageContext context)
The handleRequest method initiates the request processing for this handler chain.

Parameters:
context - MessageContext parameter provides access to the request SOAP message.
Returns:
boolean Returns true if all handlers in chain have been processed. Returns false if a handler in the chain returned false from its handleRequest method.
Throws:
JAXRPCException - if any processing error happens
See Also:
Handler.handleRequest(javax.xml.rpc.handler.MessageContext)

public boolean handleResponse(MessageContext context)
handleResponse 方法初始化此处理程序链的响应处理。
context | MessageContext 参数提供对响应 SOAP 消息的访问。
return | 一个 boolean 值，如果处理了链中的所有处理程序，则返回 true。如果链中某个处理程序从其 handleResponse 方法返回 false，则返回 false。
Throws | JAXRPCException: 如果发生处理错误
See also | handleResponse
英文文档：

handleResponse

boolean handleResponse(MessageContext context)
The handleResponse method initiates the response processing for this handler chain.

Parameters:
context - MessageContext parameter provides access to the response SOAP message.
Returns:
boolean Returns true if all handlers in chain have been processed. Returns false if a handler in the chain returned false from its handleResponse method.
Throws:
JAXRPCException - if any processing error happens
See Also:
Handler.handleResponse(javax.xml.rpc.handler.MessageContext)

public boolean handleFault(MessageContext context)
handleFault 方法初始化此处理程序链的 SOAP 默认处理。
context | MessageContext 参数提供对 SOAP 消息的访问。
return | 一个 boolean 值，如果处理了链中的所有处理程序，则返回 true。如果链中某个处理程序从其 handleFault 方法返回 false，则返回 false。
Throws | JAXRPCException: 如果发生处理错误
See also | handleFault
英文文档：

handleFault

boolean handleFault(MessageContext context)
The handleFault method initiates the SOAP fault processing for this handler chain.

Parameters:
context - MessageContext parameter provides access to the SOAP message.
Returns:
boolean Returns true if all handlers in chain have been processed. Returns false if a handler in the chain returned false from its handleFault method.
Throws:
JAXRPCException - if any processing error happens
See Also:
Handler.handleFault(javax.xml.rpc.handler.MessageContext)

public void init(java.util.Map<K, V> config)
初始化 HandlerChain 的配置。
config | 用于初始化此处理程序链的配置
Throws | JAXRPCException: 如果初始化期间出现错误
英文文档：

init

void init(Map config)
Initializes the configuration for a HandlerChain.

Parameters:
config - Configuration for the initialization of this handler chain
Throws:
JAXRPCException - If any error during initialization

public void destroy()
指示 HandlerChain 的生命周期结束。
Throws JAXRPCException: 如果销毁过程中发生错误
英文文档：

destroy

void destroy()
Indicates the end of lifecycle for a HandlerChain.

Throws:
JAXRPCException - If any error during destroy

public void setRoles(String[] soapActorNames)
设置此 HandlerChain 的 SOAP 参与者角色。这指定了一个角色集，针对在此 SOAP 节点上处理的 SOAP 消息，此 HandlerChain 将实现这些角色。HandlerChain 假定的这些角色在通过 HandlerChain 处理个别 SOAP 消息期间不得改变。

HandlerChain 总是扮演特殊的 SOAP 参与者角色 next。关于这个特殊的 SOAP 参与者的 URI 名称，请参考 SOAP 规范。无需使用此方法设置这个特殊角色。

soapActorNames | SOAP 参与者名称的 URI
See also | javax.xml.rpc.NamespaceConstants
英文文档：

setRoles

void setRoles(String[] soapActorNames)
Sets SOAP Actor roles for this HandlerChain. This specifies the set of roles in which this HandlerChain is to act for the SOAP message processing at this SOAP node. These roles assumed by a HandlerChain must be invariant during the processing of an individual SOAP message through the HandlerChain.

A HandlerChain always acts in the role of the special SOAP actor next. Refer to the SOAP specification for the URI name for this special SOAP actor. There is no need to set this special role using this method.

Parameters:
soapActorNames - URIs for SOAP actor name
See Also:
NamespaceConstants

public String[] getRoles()
获取针对此 HandlerChain 在此 SOAP 节点注册的 SOAP 参与者角色。返回的数组包含特殊 SOAP 参与者 next。
return | URI 形式的 SOAP 参与者角色 (String[])
See also | javax.xml.rpc.NamespaceConstants
英文文档：

getRoles

String[] getRoles()
Gets SOAP actor roles registered for this HandlerChain at this SOAP node. The returned array includes the special SOAP actor next.

Returns:
String[] SOAP Actor roles as URIs
See Also:
NamespaceConstants
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


HandlerRegistry (Java EE 5)

javax.xml.rpc.handler
Interface HandlerRegistry

All Superinterfaces:
Serializable
public interface HandlerRegistry
extends Serializable

Implements: java.io.Serializable

javax.xml.rpc.handler.HandlerRegistry 提供对 HandlerRegistry 中处理程序的编程配置的支持。

处理程序链是在每个服务端点的基础上注册的，正如端口的限定名称所指示的那样。getHandlerChain 返回指定服务端点的处理程序链（java.util.List 形式）。返回的处理程序链是使用 java.util.List 接口配置的。此列表中的每个元素都必须是 Java 类型 javax.xml.rpc.handler.HandlerInfo。

version | 1.0
See also | javax.xml.rpc.Service
英文文档：

The javax.xml.rpc.handler.HandlerRegistry provides support for the programmatic configuration of handlers in a HandlerRegistry.

A handler chain is registered per service endpoint, as indicated by the qualified name of a port. The getHandlerChain returns the handler chain (as a java.util.List) for the specified service endpoint. The returned handler chain is configured using the java.util.List interface. Each element in this list is required to be of the Java type javax.xml.rpc.handler.HandlerInfo.

Version:
1.0
Author:
Rahul Sharma
See Also:
Service

Method Summary
List | getHandlerChain(QName portName) Gets the handler chain for the specified service endpoint.
void | setHandlerChain(QName portName, List chain) Sets the handler chain for the specified service endpoint as a java.util.List.

Method Detail

public java.util.List<E> getHandlerChain(javax.xml.namespace.QName portName)
获取指定服务端点的处理程序链。返回的 List 用于配置此 HandlerRegistry 中的此特定处理程序链。此列表中的每个元素必须是 Java 类型 javax.xml.rpc.handler.HandlerInfo。
portName | 目标服务端点的限定名称
return | java.util.List 处理程序链
Throws | IllegalArgumentException: 如果指定了无效的 portName
英文文档：

getHandlerChain

List getHandlerChain(QName portName)
Gets the handler chain for the specified service endpoint. The returned List is used to configure this specific handler chain in this HandlerRegistry. Each element in this list is required to be of the Java type javax.xml.rpc.handler.HandlerInfo.

Parameters:
portName - Qualified name of the target service endpoint
Returns:
java.util.List Handler chain
Throws:
IllegalArgumentException - If an invalid portName is specified

public void setHandlerChain(javax.xml.namespace.QName portName, java.util.List<E> chain)
设置指定服务端点的处理程序链（java.util.List 形式）。此列表中的每个元素必须是 Java 类型 javax.xml.rpc.handler.HandlerInfo。
portName | 目标服务端点的限定名称
chain | 表示处理程序链的配置的列表
Throws | JAXRPCException: 如果处理程序链的配置中存在错误
Throws | UnsupportedOperationException: 如果不支持此设置操作。执行此操作是为了避免重写预先配置的处理程序链。
Throws | IllegalArgumentException: 如果指定了无效的 portName
英文文档：

setHandlerChain

void setHandlerChain(QName portName,
                     List chain)
Sets the handler chain for the specified service endpoint as a java.util.List. Each element in this list is required to be of the Java type javax.xml.rpc.handler.HandlerInfo.

Parameters:
portName - Qualified name of the target service endpoint
chain - A List representing configuration for the handler chain
Throws:
JAXRPCException - If any error in the configuration of the handler chain
UnsupportedOperationException - If this set operation is not supported. This is done to avoid any overriding of a pre-configured handler chain.
IllegalArgumentException - If an invalid portName is specified
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.handler
Interface MessageContext

All Known Subinterfaces:
SOAPMessageContext
public interface MessageContext

Implemented by: SOAPMessageContext

接口 MessageContext 抽象化由 handle 方法中的处理程序处理的消息上下文。

MessageContext 接口提供管理属性集的方法。MessageContext 属性使处理程序链中的处理程序能够共享相关处理状态。

version | 1.1
See also | javax.xml.rpc.handler.Handler
英文文档：

The interface MessageContext abstracts the message context that is processed by a handler in the handle method.

The MessageContext interface provides methods to manage a property set. MessageContext properties enable handlers in a handler chain to share processing related state.

Version:
1.1
Author:
Rahul Sharma, Roberto Chinnici
See Also:
Handler

Method Summary
boolean | containsProperty(String name) Returns true if the MessageContext contains a property with the specified name.
Object | getProperty(String name) Gets the value of a specific property from the MessageContext
Iterator | getPropertyNames() Returns an Iterator view of the names of the properties in this MessageContext
void | removeProperty(String name) Removes a property (name-value pair) from the MessageContext
void | setProperty(String name, Object value) Sets the name and value of a property associated with the MessageContext.

Method Detail

public void setProperty(String name, Object value)
设置与 MessageContext 关联的某个属性的名称和值。如果 MessageContext 包含相同属性的值，则替换旧值。
name | 与 MessageContext 关联的属性的名称
value | 属性的值
Throws | IllegalArgumentException: 如果属性的某些方面不允许它存储在上下文中
Throws | UnsupportedOperationException: 如果不支持此方法
英文文档：

setProperty

void setProperty(String name,
                 Object value)
Sets the name and value of a property associated with the MessageContext. If the MessageContext contains a value of the same property, the old value is replaced.

Parameters:
name - Name of the property associated with the MessageContext
value - Value of the property
Throws:
IllegalArgumentException - If some aspect of the property is prevents it from being stored in the context
UnsupportedOperationException - If this method is not supported.

public Object getProperty(String name)
获取 MessageContext 中某个特定属性的值。
name | 将获取其值的属性的名称
return | 属性的值
Throws | IllegalArgumentException: 如果指定的属性名称不合法
英文文档：

getProperty

Object getProperty(String name)
Gets the value of a specific property from the MessageContext

Parameters:
name - Name of the property whose value is to be retrieved
Returns:
Value of the property
Throws:
IllegalArgumentException - if an illegal property name is specified

public void removeProperty(String name)
从 MessageContext 中移除某个属性（名称-值对）。
name | 将移除的属性的名称
Throws | IllegalArgumentException: 如果指定的属性名称不合法
英文文档：

removeProperty

void removeProperty(String name)
Removes a property (name-value pair) from the MessageContext

Parameters:
name - Name of the property to be removed
Throws:
IllegalArgumentException - if an illegal property name is specified

public boolean containsProperty(String name)
如果 MessageContext 包含具有指定名称的属性，则返回 true。
name | 将测试是否存在的属性的名称
return | 如果 MessageContext 包含该属性，则返回 true；否则返回 false
英文文档：

containsProperty

boolean containsProperty(String name)
Returns true if the MessageContext contains a property with the specified name.

Parameters:
name - Name of the property whose presense is to be tested
Returns:
Returns true if the MessageContext contains the property; otherwise false

public java.util.Iterator<E> getPropertyNames()
返回此 MessageContext 中属性名称的 Iterator 视图。
return 属性名称的 Iterator
英文文档：

getPropertyNames

Iterator getPropertyNames()
Returns an Iterator view of the names of the properties in this MessageContext

Returns:
Iterator for the property names
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


GenericHandler (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.handler
Class GenericHandler

java.lang.Object
    extended by  javax.xml.rpc.handler.GenericHandler
All Implemented Interfaces:
Handler
public abstract class GenericHandler
extends Object
implements Handler

Implements: Handler

javax.xml.rpc.handler.GenericHandler 类实现 Handler 接口。SOAP Message Handler 开发人员通常应该子类化 GenericHandler 类，除非 Handler 类需要另一个类作为超类。

GenericHandler 类是一个帮助简化 Handler 编写过程的便捷抽象类。此类提供生命周期方法 init 和 destroy 的默认实现，还提供各种处理方法。Handler 开发人员应该重写需要限定为派生 Handler 实现类的一部分的方法。

version 1.0
英文文档：

The javax.xml.rpc.handler.GenericHandler class implements the Handler interface. SOAP Message Handler developers should typically subclass GenericHandler class unless the Handler class needs another class as a superclass.

The GenericHandler class is a convenience abstract class that makes writing Handlers easy. This class provides default implementations of the lifecycle methods init and destroy and also different handle methods. A Handler developer should only override methods that it needs to specialize as part of the derived Handler implementation class.

Version:
1.0
Author:
Rahul Sharma

Constructor Summary
protected GenericHandler()
Default constructor
Method Summary
void | destroy() The destroy method indicates the end of lifecycle for a Handler instance.
abstract QName[] | getHeaders() Gets the header blocks processed by this Handler instance.
boolean | handleFault(MessageContext context) The handleFault method processes the SOAP faults based on the SOAP message processing model.
boolean | handleRequest(MessageContext context) The handleRequest method processes the request SOAP message.
boolean | handleResponse(MessageContext context) The handleResponse method processes the response message.
void | init(HandlerInfo config) The init method to enable the Handler instance to initialize itself.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected GenericHandler()
默认构造方法。
英文文档：

GenericHandler

protected GenericHandler()
Default constructor

Method Detail

public boolean handleRequest(MessageContext context)
handleRequest 方法可处理请求 SOAP 消息。此方法的默认实现返回 true。这指示处理程序链应该继续处理请求 SOAP 消息。如果派生的 Handler 类需要限定此方法的实现，则应该重写此方法。
See also handleRequest
英文文档：

handleRequest

public boolean handleRequest(MessageContext context)
The handleRequest method processes the request SOAP message. The default implementation of this method returns true. This indicates that the handler chain should continue processing of the request SOAP message. This method should be overridden if the derived Handler class needs to specialize implementation of this method.

Specified by:
handleRequest in interface Handler
Parameters:
context - MessageContext parameter provides access to the request message.
Returns:
boolean Indicates the processing mode
  • Return true to indicate continued processing of the request handler chain. The HandlerChain takes the responsibility of invoking the next entity. The next entity may be the next handler in the HandlerChain or if this handler is the last handler in the chain, the next entity is the service endpoint object.
  • Return false to indicate blocking of the request handler chain. In this case, further processing of the request handler chain is blocked and the target service endpoint is not dispatched. The JAX-RPC runtime system takes the responsibility of invoking the response handler chain next with the SOAPMessageContext. The Handler implementation class has the the responsibility of setting the appropriate response SOAP message in either handleRequest and/or handleResponse method. In the default processing model, the response handler chain starts processing from the same Handler instance (that returned false) and goes backward in the execution sequence.
See Also:
Handler.handleRequest(javax.xml.rpc.handler.MessageContext)

public boolean handleResponse(MessageContext context)
handleResponse 方法可处理响应消息。此方法的默认实现返回 true。这指示处理程序链应该继续处理响应 SOAP 消息。如果派生的 Handler 类需要限定此方法的实现，则应该重写此方法。
See also handleResponse
英文文档：

handleResponse

public boolean handleResponse(MessageContext context)
The handleResponse method processes the response message. The default implementation of this method returns true. This indicates that the handler chain should continue processing of the response SOAP message. This method should be overridden if the derived Handler class needs to specialize implementation of this method.

Specified by:
handleResponse in interface Handler
Parameters:
context - MessageContext parameter provides access to the response SOAP message
Returns:
boolean Indicates the processing mode
  • Return true to indicate continued processing ofthe response handler chain. The HandlerChain invokes the handleResponse method on the next Handler in the handler chain.
  • Return false to indicate blocking of the response handler chain. In this case, no other response handlers in the handler chain are invoked.
See Also:
Handler.handleResponse(javax.xml.rpc.handler.MessageContext)

public boolean handleFault(MessageContext context)
handleFault 方法根据 SOAP 消息处理模型处理 SOAP 错误。此方法的默认实现返回 true。这指示处理程序链应该继续处理 SOAP 错误。如果派生的 Handler 类需要限定此方法的实现，则应该重写此方法。
See also handleFault
英文文档：

handleFault

public boolean handleFault(MessageContext context)
The handleFault method processes the SOAP faults based on the SOAP message processing model. The default implementation of this method returns true. This indicates that the handler chain should continue processing of the SOAP fault. This method should be overridden if the derived Handler class needs to specialize implementation of this method.

Specified by:
handleFault in interface Handler
Parameters:
context - MessageContext parameter provides access to the SOAP message
Returns:
boolean Indicates the processing mode
  • Return true to indicate continued processing of SOAP Fault. The HandlerChain invokes the handleFault method on the next Handler in the handler chain.
  • Return false to indicate end of the SOAP fault processing. In this case, no other handlers in the handler chain are invoked.
See Also:
Handler.handleFault(javax.xml.rpc.handler.MessageContext)

public void init(HandlerInfo config)
init 方法使 Handler 实例能够初始化自身。如果派生的 Handler 类需要限定此方法的实现，则应该重写此方法。
See also init
英文文档：

init

public void init(HandlerInfo config)
The init method to enable the Handler instance to initialize itself. This method should be overridden if the derived Handler class needs to specialize implementation of this method.

Specified by:
init in interface Handler
See Also:
Handler.init(javax.xml.rpc.handler.HandlerInfo)

public void destroy()
destroy 方法指示 Handler 实例的生命周期结束。如果派生的 Handler 类需要限定此方法的实现，则应该重写此方法。
See also destroy
英文文档：

destroy

public void destroy()
The destroy method indicates the end of lifecycle for a Handler instance. This method should be overridden if the derived Handler class needs to specialize implementation of this method.

Specified by:
destroy in interface Handler
See Also:
Handler.destroy()

abstract public javax.xml.namespace.QName[] getHeaders()
获取此 Handler 实例处理的头块 (header block)。
return 此处理程序实例处理的头块的 QName 所组成的数组。QName 是头块最外面的元素的限定名称。
英文文档：

getHeaders

public abstract QName[] getHeaders()
Gets the header blocks processed by this Handler instance.

Specified by:
getHeaders in interface Handler
Returns:
Array of QNames of header blocks processed by this handler instance. QName is the qualified name of the outermost element of the Header block.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HandlerInfo (Java EE 5)

javax.xml.rpc.handler
Class HandlerInfo

java.lang.Object
    extended by  javax.xml.rpc.handler.HandlerInfo
All Implemented Interfaces:
Serializable
public class HandlerInfo
extends Object
implements Serializable

Implements: java.io.Serializable

javax.xml.rpc.handler.HandlerInfo 表示有关 HandlerChain 中某个处理程序的信息。HandlerInfo 实例传入 Handler.init 方法，用于初始化 Handler 实例。
version | 1.0
See also | javax.xml.rpc.handler.HandlerChain
英文文档：

The javax.xml.rpc.handler.HandlerInfo represents information about a handler in the HandlerChain. A HandlerInfo instance is passed in the Handler.init method to initialize a Handler instance.

Version:
1.0
Author:
Rahul Sharma
See Also:
HandlerChain, Serialized Form

Constructor Summary
HandlerInfo()
Default constructor
HandlerInfo(Class handlerClass, Map config, QName[] headers)
Constructor for HandlerInfo
Method Summary
Class | getHandlerClass() Gets the Handler class
Map | getHandlerConfig() Gets the Handler configuration
QName[] | getHeaders() Gets the header blocks processed by this Handler.
void | setHandlerClass(Class handlerClass) Sets the Handler class
void | setHandlerConfig(Map config) Sets the Handler configuration as java.util.Map
void | setHeaders(QName[] headers) Sets the header blocks processed by this Handler.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public HandlerInfo()
默认构造方法。
英文文档：

HandlerInfo

public HandlerInfo()
Default constructor

public HandlerInfo(Class<T> handlerClass, java.util.Map<K, V> config, javax.xml.namespace.QName[] headers)
HandlerInfo 的构造方法。
handlerClass | Handler 的 Java 类
config | java.util.Map 形式的处理程序配置
headers | 此 Handler 处理的头块的 QName。QName 是头块最外面的元素的限定名称。
英文文档：

HandlerInfo

public HandlerInfo(Class handlerClass,
                   Map config,
                   QName[] headers)
Constructor for HandlerInfo

Parameters:
handlerClass - Java Class for the Handler
config - Handler Configuration as a java.util.Map
headers - QNames for the header blocks processed by this Handler. QName is the qualified name of the outermost element of a header block
Method Detail

public void setHandlerClass(Class<T> handlerClass)
设置 Handler 类。
handlerClass Handler 的类
英文文档：

setHandlerClass

public void setHandlerClass(Class handlerClass)
Sets the Handler class

Parameters:
handlerClass - Class for the Handler

public Class<T> getHandlerClass()
获取 Handler 类。
return 如果没有设置任何 Handler 类，则返回 null；否则返回设置的 Handler 类
英文文档：

getHandlerClass

public Class getHandlerClass()
Gets the Handler class

Returns:
Returns null if no Handler class has been set; otherwise the set handler class

public void setHandlerConfig(java.util.Map<K, V> config)
以 java.util.Map 形式设置 Handler 配置。
config 配置映射
英文文档：

setHandlerConfig

public void setHandlerConfig(Map config)
Sets the Handler configuration as java.util.Map

Parameters:
config - Configuration map

public java.util.Map<K, V> getHandlerConfig()
获取 Handler 配置。
return 如果没有设置任何配置映射，则返回空 Map；否则返回设置的配置映射
英文文档：

getHandlerConfig

public Map getHandlerConfig()
Gets the Handler configuration

Returns:
Returns empty Map if no configuration map has been set; otherwise returns the set configuration map

public void setHeaders(javax.xml.namespace.QName[] headers)
设置此 Handler 处理的头块。
headers 头块的 QName。QName 是 SOAP 头块最外面的元素的限定名称。
英文文档：

setHeaders

public void setHeaders(QName[] headers)
Sets the header blocks processed by this Handler.

Parameters:
headers - QNames of the header blocks. QName is the qualified name of the outermost element of the SOAP header block

public javax.xml.namespace.QName[] getHeaders()
获取此 Handler 处理的头块。
return 头块的 QName 所组成的数组。如果没有使用 setHeaders 方法设置任何头块，则返回 null。
英文文档：

getHeaders

public QName[] getHeaders()
Gets the header blocks processed by this Handler.

Returns:
Array of QNames for the header blocks. Returns null if no header blocks have been set using the setHeaders method.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.rpc.handler.soap (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.rpc.handler.soap

This package defines APIs for SOAP Message Handlers

See:
Description

Interface Summary
SOAPMessageContext The interface javax.xml.rpc.soap.SOAPMessageContext provides access to the SOAP message for either RPC request or response.

Package javax.xml.rpc.handler.soap Description

This package defines APIs for SOAP Message Handlers

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.rpc.handler.soap Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.rpc.handler.soap

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.xml.rpc.handler.MessageContext
    • javax.xml.rpc.handler.soap.SOAPMessageContext
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


SOAPMessageContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.handler.soap
Interface SOAPMessageContext

All Superinterfaces:
MessageContext
public interface SOAPMessageContext
extends MessageContext

Implements: MessageContext

接口 javax.xml.rpc.soap.SOAPMessageContext 提供对 RPC 请求或响应的 SOAP 消息的访问。javax.xml.soap.SOAPMessage 为带有附件的 SOAP 1.1 消息表示形式指定标准的 Java API。
version | 1.0
See also | javax.xml.soap.SOAPMessage
英文文档：

The interface javax.xml.rpc.soap.SOAPMessageContext provides access to the SOAP message for either RPC request or response. The javax.xml.soap.SOAPMessage specifies the standard Java API for the representation of a SOAP 1.1 message with attachments.

Version:
1.0
Author:
Rahul Sharma
See Also:
SOAPMessage

Method Summary
SOAPMessage | getMessage() Gets the SOAPMessage from this message context
String[] | getRoles() Gets the SOAP actor roles associated with an execution of the HandlerChain and its contained Handler instances.
void | setMessage(SOAPMessage message) Sets the SOAPMessage in this message context
Methods inherited from interface javax.xml.rpc.handler.MessageContext
containsProperty, getProperty, getPropertyNames, removeProperty, setProperty

Method Detail

public SOAPMessage getMessage()
从此消息上下文中获取 SOAPMessage。
return 返回 SOAPMessage；如果此消息上下文中没有 SOAPMessage，则返回 null。
英文文档：

getMessage

SOAPMessage getMessage()
Gets the SOAPMessage from this message context

Returns:
Returns the SOAPMessage; returns null if no SOAPMessage is present in this message context

public void setMessage(SOAPMessage message)
在此消息上下文中设置 SOAPMessage。
message | SOAP 消息
Throws | JAXRPCException: 如果在此消息上下文中设置 SOAPMessage 时发生任何错误
Throws | UnsupportedOperationException: 如果此操作不受支持
英文文档：

setMessage

void setMessage(SOAPMessage message)
Sets the SOAPMessage in this message context

Parameters:
message - SOAP message
Throws:
JAXRPCException - If any error during the setting of the SOAPMessage in this message context
UnsupportedOperationException - If this operation is not supported

public String[] getRoles()
获取与执行 HandlerChain 及其包含的 Handler 实例关联的 SOAP 参与者角色。注意，SOAP 参与者角色适用于 SOAP 节点，并使用 HandlerChain.setRoles 和 HandlerChain.getRoles 进行管理。HandlerChain 中的 Handler 实例使用有关 SOAP 参与者角色的信息来处理 SOAP 头块。注意，在通过 HandlerChain 处理 SOAP 消息的过程中，SOAP 参与者角色不变。
return | SOAP 参与者角色的 URI 所组成的数组
See also | setRoles, getRoles
英文文档：

getRoles

String[] getRoles()
Gets the SOAP actor roles associated with an execution of the HandlerChain and its contained Handler instances. Note that SOAP actor roles apply to the SOAP node and are managed using HandlerChain.setRoles and HandlerChain.getRoles. Handler instances in the HandlerChain use this information about the SOAP actor roles to process the SOAP header blocks. Note that the SOAP actor roles are invariant during the processing of SOAP message through the HandlerChain.

Returns:
Array of URIs for SOAP actor roles
See Also:
HandlerChain.setRoles(java.lang.String[]), HandlerChain.getRoles()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.rpc.holders (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.rpc.holders

This package contains the standard Java Holder classes.

See:
Description

Interface Summary
Holder The java.xml.rpc.holders.Holder interface represents the base interface for both standard and generated Holder classes.

Class Summary
BigDecimalHolder
BigIntegerHolder
BooleanHolder
BooleanWrapperHolder
ByteArrayHolder
ByteHolder
ByteWrapperHolder
CalendarHolder
DoubleHolder
DoubleWrapperHolder
FloatHolder
FloatWrapperHolder
IntegerWrapperHolder
IntHolder
LongHolder
LongWrapperHolder
ObjectHolder
QNameHolder
ShortHolder
ShortWrapperHolder
StringHolder

Package javax.xml.rpc.holders Description

This package contains the standard Java Holder classes.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.rpc.holders Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.rpc.holders

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.rpc.holders.BigDecimalHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.BigIntegerHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.BooleanHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.BooleanWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ByteArrayHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ByteHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ByteWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.CalendarHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.DoubleHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.DoubleWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.FloatHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.FloatWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.IntegerWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.IntHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.LongHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.LongWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ObjectHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.QNameHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ShortHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.ShortWrapperHolder (implements javax.xml.rpc.holders.Holder)
    • javax.xml.rpc.holders.StringHolder (implements javax.xml.rpc.holders.Holder)

Interface Hierarchy

  • javax.xml.rpc.holders.Holder
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Holder (Java EE 5)

javax.xml.rpc.holders
Interface Holder

All Known Implementing Classes:
BigDecimalHolder, BigIntegerHolder, BooleanHolder, BooleanWrapperHolder, ByteArrayHolder, ByteHolder, ByteWrapperHolder, CalendarHolder, DoubleHolder, DoubleWrapperHolder, FloatHolder, FloatWrapperHolder, IntegerWrapperHolder, IntHolder, LongHolder, LongWrapperHolder, ObjectHolder, QNameHolder, ShortHolder, ShortWrapperHolder, StringHolder
public interface Holder

Implemented by: BigDecimalHolder, BigIntegerHolder, BooleanHolder, BooleanWrapperHolder, ByteArrayHolder, ByteHolder, ByteWrapperHolder, CalendarHolder, DoubleHolder, DoubleWrapperHolder, FloatHolder, FloatWrapperHolder, IntegerWrapperHolder, IntHolder, LongHolder, LongWrapperHolder, ObjectHolder, QNameHolder, ShortHolder, ShortWrapperHolder, StringHolder

java.xml.rpc.holders.Holder 接口表示用于标准 Holder 类和生成的 Holder 类的基本接口。生成的 Holder 类需要实现此 Holder 接口。
version 1.0
英文文档：

The java.xml.rpc.holders.Holder interface represents the base interface for both standard and generated Holder classes. A generated Holder class is required to implement this Holder interface.

Version:
1.0
Author:
Rahul Sharma

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BigDecimalHolder (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.holders
Class BigDecimalHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.BigDecimalHolder
All Implemented Interfaces:
Holder
public final class BigDecimalHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 BigDecimal value
Constructor Summary
BigDecimalHolder()
BigDecimalHolder(BigDecimal myBigDecimal)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public BigDecimal value
Constructor Detail

public BigDecimalHolder()
英文文档：

BigDecimalHolder

public BigDecimalHolder()

public BigDecimalHolder(java.math.BigDecimal myBigDecimal)
英文文档：

BigDecimalHolder

public BigDecimalHolder(BigDecimal myBigDecimal)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


BigIntegerHolder (Java EE 5)

javax.xml.rpc.holders
Class BigIntegerHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.BigIntegerHolder
All Implemented Interfaces:
Holder
public final class BigIntegerHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 BigInteger value
Constructor Summary
BigIntegerHolder()
BigIntegerHolder(BigInteger myBigInteger)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public BigInteger value
Constructor Detail

public BigIntegerHolder()
英文文档：

BigIntegerHolder

public BigIntegerHolder()

public BigIntegerHolder(java.math.BigInteger myBigInteger)
英文文档：

BigIntegerHolder

public BigIntegerHolder(BigInteger myBigInteger)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BooleanHolder (Java EE 5)

javax.xml.rpc.holders
Class BooleanHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.BooleanHolder
All Implemented Interfaces:
Holder
public final class BooleanHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 boolean value
Constructor Summary
BooleanHolder()
BooleanHolder(boolean myboolean)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public boolean value
Constructor Detail

public BooleanHolder()
英文文档：

BooleanHolder

public BooleanHolder()

public BooleanHolder(boolean myboolean)
英文文档：

BooleanHolder

public BooleanHolder(boolean myboolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BooleanWrapperHolder (Java EE 5)

javax.xml.rpc.holders
Class BooleanWrapperHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.BooleanWrapperHolder
All Implemented Interfaces:
Holder
public final class BooleanWrapperHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Boolean value
Constructor Summary
BooleanWrapperHolder()
BooleanWrapperHolder(Boolean myboolean)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Boolean value
Constructor Detail

public BooleanWrapperHolder()
英文文档：

BooleanWrapperHolder

public BooleanWrapperHolder()

public BooleanWrapperHolder(Boolean myboolean)
英文文档：

BooleanWrapperHolder

public BooleanWrapperHolder(Boolean myboolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ByteArrayHolder (Java EE 5)

javax.xml.rpc.holders
Class ByteArrayHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.ByteArrayHolder
All Implemented Interfaces:
Holder
public final class ByteArrayHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 byte[] value
Constructor Summary
ByteArrayHolder()
ByteArrayHolder(byte[] mybyteArray)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public byte[] value
Constructor Detail

public ByteArrayHolder()
英文文档：

ByteArrayHolder

public ByteArrayHolder()

public ByteArrayHolder(byte[] mybyteArray)
英文文档：

ByteArrayHolder

public ByteArrayHolder(byte[] mybyteArray)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ByteHolder (Java EE 5)

javax.xml.rpc.holders
Class ByteHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.ByteHolder
All Implemented Interfaces:
Holder
public final class ByteHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 byte value
Constructor Summary
ByteHolder()
ByteHolder(byte mybyte)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public byte value
Constructor Detail

public ByteHolder()
英文文档：

ByteHolder

public ByteHolder()

public ByteHolder(byte mybyte)
英文文档：

ByteHolder

public ByteHolder(byte mybyte)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ByteWrapperHolder (Java EE 5)

javax.xml.rpc.holders
Class ByteWrapperHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.ByteWrapperHolder
All Implemented Interfaces:
Holder
public final class ByteWrapperHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Byte value
Constructor Summary
ByteWrapperHolder()
ByteWrapperHolder(Byte mybyte)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Byte value
Constructor Detail

public ByteWrapperHolder()
英文文档：

ByteWrapperHolder

public ByteWrapperHolder()

public ByteWrapperHolder(Byte mybyte)
英文文档：

ByteWrapperHolder

public ByteWrapperHolder(Byte mybyte)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


CalendarHolder (Java EE 5)

javax.xml.rpc.holders
Class CalendarHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.CalendarHolder
All Implemented Interfaces:
Holder
public final class CalendarHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Calendar value
Constructor Summary
CalendarHolder()
CalendarHolder(Calendar myCalendar)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Calendar value
Constructor Detail

public CalendarHolder()
英文文档：

CalendarHolder

public CalendarHolder()

public CalendarHolder(java.util.Calendar myCalendar)
英文文档：

CalendarHolder

public CalendarHolder(Calendar myCalendar)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DoubleHolder (Java EE 5)

javax.xml.rpc.holders
Class DoubleHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.DoubleHolder
All Implemented Interfaces:
Holder
public final class DoubleHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 double value
Constructor Summary
DoubleHolder()
DoubleHolder(double mydouble)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public double value
Constructor Detail

public DoubleHolder()
英文文档：

DoubleHolder

public DoubleHolder()

public DoubleHolder(double mydouble)
英文文档：

DoubleHolder

public DoubleHolder(double mydouble)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DoubleWrapperHolder (Java EE 5)

javax.xml.rpc.holders
Class DoubleWrapperHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.DoubleWrapperHolder
All Implemented Interfaces:
Holder
public final class DoubleWrapperHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Double value
Constructor Summary
DoubleWrapperHolder()
DoubleWrapperHolder(Double mydouble)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Double value
Constructor Detail

public DoubleWrapperHolder()
英文文档：

DoubleWrapperHolder

public DoubleWrapperHolder()

public DoubleWrapperHolder(Double mydouble)
英文文档：

DoubleWrapperHolder

public DoubleWrapperHolder(Double mydouble)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FloatHolder (Java EE 5)

javax.xml.rpc.holders
Class FloatHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.FloatHolder
All Implemented Interfaces:
Holder
public final class FloatHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 float value
Constructor Summary
FloatHolder()
FloatHolder(float myfloat)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public float value
Constructor Detail

public FloatHolder()
英文文档：

FloatHolder

public FloatHolder()

public FloatHolder(float myfloat)
英文文档：

FloatHolder

public FloatHolder(float myfloat)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FloatWrapperHolder (Java EE 5)

javax.xml.rpc.holders
Class FloatWrapperHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.FloatWrapperHolder
All Implemented Interfaces:
Holder
public final class FloatWrapperHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Float value
Constructor Summary
FloatWrapperHolder()
FloatWrapperHolder(Float myfloat)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Float value
Constructor Detail

public FloatWrapperHolder()
英文文档：

FloatWrapperHolder

public FloatWrapperHolder()

public FloatWrapperHolder(Float myfloat)
英文文档：

FloatWrapperHolder

public FloatWrapperHolder(Float myfloat)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntegerWrapperHolder (Java EE 5)

javax.xml.rpc.holders
Class IntegerWrapperHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.IntegerWrapperHolder
All Implemented Interfaces:
Holder
public final class IntegerWrapperHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Integer value
Constructor Summary
IntegerWrapperHolder()
IntegerWrapperHolder(Integer myint)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Integer value
Constructor Detail

public IntegerWrapperHolder()
英文文档：

IntegerWrapperHolder

public IntegerWrapperHolder()

public IntegerWrapperHolder(Integer myint)
英文文档：

IntegerWrapperHolder

public IntegerWrapperHolder(Integer myint)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


IntHolder (Java EE 5)

javax.xml.rpc.holders
Class IntHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.IntHolder
All Implemented Interfaces:
Holder
public final class IntHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 int value
Constructor Summary
IntHolder()
IntHolder(int myint)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public int value
Constructor Detail

public IntHolder()
英文文档：

IntHolder

public IntHolder()

public IntHolder(int myint)
英文文档：

IntHolder

public IntHolder(int myint)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LongHolder (Java EE 5)

javax.xml.rpc.holders
Class LongHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.LongHolder
All Implemented Interfaces:
Holder
public final class LongHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 long value
Constructor Summary
LongHolder()
LongHolder(long mylong)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public long value
Constructor Detail

public LongHolder()
英文文档：

LongHolder

public LongHolder()

public LongHolder(long mylong)
英文文档：

LongHolder

public LongHolder(long mylong)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LongWrapperHolder (Java EE 5)

javax.xml.rpc.holders
Class LongWrapperHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.LongWrapperHolder
All Implemented Interfaces:
Holder
public final class LongWrapperHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Long value
Constructor Summary
LongWrapperHolder()
LongWrapperHolder(Long mylong)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Long value
Constructor Detail

public LongWrapperHolder()
英文文档：

LongWrapperHolder

public LongWrapperHolder()

public LongWrapperHolder(Long mylong)
英文文档：

LongWrapperHolder

public LongWrapperHolder(Long mylong)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ObjectHolder (Java EE 5)

javax.xml.rpc.holders
Class ObjectHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.ObjectHolder
All Implemented Interfaces:
Holder
public final class ObjectHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Object value
Constructor Summary
ObjectHolder()
ObjectHolder(Object value)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Object value
Constructor Detail

public ObjectHolder()
英文文档：

ObjectHolder

public ObjectHolder()

public ObjectHolder(Object value)
英文文档：

ObjectHolder

public ObjectHolder(Object value)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


QNameHolder (Java EE 5)

javax.xml.rpc.holders
Class QNameHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.QNameHolder
All Implemented Interfaces:
Holder
public final class QNameHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 QName value
Constructor Summary
QNameHolder()
QNameHolder(QName myQName)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public QName value
Constructor Detail

public QNameHolder()
英文文档：

QNameHolder

public QNameHolder()

public QNameHolder(javax.xml.namespace.QName myQName)
英文文档：

QNameHolder

public QNameHolder(QName myQName)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ShortHolder (Java EE 5)

javax.xml.rpc.holders
Class ShortHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.ShortHolder
All Implemented Interfaces:
Holder
public final class ShortHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 short value
Constructor Summary
ShortHolder()
ShortHolder(short myshort)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public short value
Constructor Detail

public ShortHolder()
英文文档：

ShortHolder

public ShortHolder()

public ShortHolder(short myshort)
英文文档：

ShortHolder

public ShortHolder(short myshort)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ShortWrapperHolder (Java EE 5)

javax.xml.rpc.holders
Class ShortWrapperHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.ShortWrapperHolder
All Implemented Interfaces:
Holder
public final class ShortWrapperHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 Short value
Constructor Summary
ShortWrapperHolder()
ShortWrapperHolder(Short myshort)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public Short value
Constructor Detail

public ShortWrapperHolder()
英文文档：

ShortWrapperHolder

public ShortWrapperHolder()

public ShortWrapperHolder(Short myshort)
英文文档：

ShortWrapperHolder

public ShortWrapperHolder(Short myshort)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StringHolder (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.holders
Class StringHolder

java.lang.Object
    extended by  javax.xml.rpc.holders.StringHolder
All Implemented Interfaces:
Holder
public final class StringHolder
extends Object
implements Holder

Implements: Holder

英文文档：

Field Summary
 String value
Constructor Summary
StringHolder()
StringHolder(String myString)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public String value
Constructor Detail

public StringHolder()
英文文档：

StringHolder

public StringHolder()

public StringHolder(String myString)
英文文档：

StringHolder

public StringHolder(String myString)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.rpc.server (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.rpc.server

This package defines APIs for the servlet based JAX-RPC endpoint model.

See:
Description

Interface Summary
ServiceLifecycle | The javax.xml.rpc.server.ServiceLifecycle defines a lifecycle interface for a JAX-RPC service endpoint.
ServletEndpointContext | The ServletEndpointContext provides an endpoint context maintained by the underlying servlet container based JAX-RPC runtime system.

Package javax.xml.rpc.server Description

This package defines APIs for the servlet based JAX-RPC endpoint model.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.rpc.server Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.rpc.server

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.xml.rpc.server.ServiceLifecycle
  • javax.xml.rpc.server.ServletEndpointContext
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


ServiceLifecycle (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.server
Interface ServiceLifecycle

public interface ServiceLifecycle

javax.xml.rpc.server.ServiceLifecycle 定义用于 JAX-RPC 服务端点的生命周期接口。如果该服务端点类实现 ServiceLifeycle 接口，则要求基于 servlet 容器的 JAX-RPC 运行时系统管理相应服务端点对象的生命周期。
version 1.0
英文文档：

The javax.xml.rpc.server.ServiceLifecycle defines a lifecycle interface for a JAX-RPC service endpoint. If the service endpoint class implements the ServiceLifeycle interface, the servlet container based JAX-RPC runtime system is required to manage the lifecycle of the corresponding service endpoint objects.

Version:
1.0
Author:
Rahul Sharma

Method Summary
void | destroy() JAX-RPC runtime system ends the lifecycle of a service endpoint instance by invoking the destroy method.
void | init(Object context) Used for initialization of a service endpoint.

Method Detail

public void init(Object context) throws ServiceException
此方法用于初始化服务端点。在初始化服务端点实例（服务端点类实例）之后，JAX-RPC 运行时系统将调用 init 方法。服务端点类使用 init 方法初始化其配置，并建立对所有外部资源的访问。init 方法中的 context 参数使端点实例能够访问底层 JAX-RPC 运行时系统提供的端点上下文。

init 方法实现应该将 context 参数的类型强制转换为相应的 Java 类型。对于基于 servlet 容器的 JAX-RPC 运行时系统上部署的服务端点，context 参数的类型为 Java 类型 javax.xml.rpc.server.ServletEndpointContext。ServletEndpointContext 提供由底层基于 servlet 容器的 JAX-RPC 运行时系统所维护的端点上下文。

context | JAX-RPC 服务端点的端点上下文
Throws | ServiceException: 如果初始化服务端点过程中出现错误；如果在 init 方法中提供了非法上下文
英文文档：

init

void init(Object context)
          throws ServiceException
Used for initialization of a service endpoint. After a service endpoint instance (an instance of a service endpoint class) is instantiated, the JAX-RPC runtime system invokes the init method. The service endpoint class uses the init method to initialize its configuration and setup access to any external resources. The context parameter in the init method enables the endpoint instance to access the endpoint context provided by the underlying JAX-RPC runtime system.

The init method implementation should typecast the context parameter to an appropriate Java type. For service endpoints deployed on a servlet container based JAX-RPC runtime system, the context parameter is of the Java type javax.xml.rpc.server.ServletEndpointContext. The ServletEndpointContext provides an endpoint context maintained by the underlying servlet container based JAX-RPC runtime system

Parameters:
context - Endpoint context for a JAX-RPC service endpoint
Throws:
ServiceException - If any error in initialization of the service endpoint; or if any illegal context has been provided in the init method

public void destroy()
JAX-RPC 运行时系统通过调用 destroy 方法结束服务端点实例的生命周期。服务端点释放它在 destroy 方法实现中占用的资源。
英文文档：

destroy

void destroy()
JAX-RPC runtime system ends the lifecycle of a service endpoint instance by invoking the destroy method. The service endpoint releases its resourcesin the implementation of the destroy method.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ServletEndpointContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.server
Interface ServletEndpointContext

public interface ServletEndpointContext

ServletEndpointContext 提供由底层基于 servlet 容器的 JAX-RPC 运行时系统所维护的端点上下文。对于基于 servlet 容器的 JAX-RPC 运行时系统上部署的服务端点，ServiceLifecycle.init 方法中的 context 参数的类型必须为 Java 类型 javax.xml.rpc.server.ServletEndpointContext。

基于 servlet 容器的 JAX-RPC 运行时系统实现 ServletEndpointContext 接口。每次在端点类上执行方法调用时，JAX-RPC 运行时系统都必须提供相应的会话、消息上下文、servlet 上下文和用户主体信息。

version 1.1
英文文档：

The ServletEndpointContext provides an endpoint context maintained by the underlying servlet container based JAX-RPC runtime system. For service endpoints deployed on a servlet container based JAX-RPC runtime system, the context parameter in the ServiceLifecycle.init method is required to be of the Java type javax.xml.rpc.server.ServletEndpointContext.

A servlet container based JAX-RPC runtime system implements the ServletEndpointContext interface. The JAX-RPC runtime system is required to provide appropriate session, message context, servlet context and user principal information per method invocation on the endpoint class.

Version:
1.1
Author:
Rahul Sharma, Roberto Chinnici

Method Summary
HttpSession | getHttpSession() The getHttpSession method returns the current HTTP session (as a javax.servlet.http.HTTPSession).
MessageContext | getMessageContext() The method getMessageContext returns the MessageContext targeted for this endpoint instance.
ServletContext | getServletContext() The method getServletContext returns the ServletContext associated with the web application that contain this endpoint.
Principal | getUserPrincipal() Returns a java.security.Principal instance that contains the name of the authenticated user for the current method invocation on the endpoint instance.
boolean | isUserInRole(String role) Returns a boolean indicating whether the authenticated user for the current method invocation on the endpoint instance is included in the specified logical "role".

Method Detail

public MessageContext getMessageContext()
方法 getMessageContext 返回以此端点实例为目标的 MessageContext。这使服务端点实例能够访问由请求 HandlerChain（及其包含的 Handler 实例）传播到目标端点实例的 MessageContext，并能够共享任何与 SOAP 消息处理有关的上下文。端点实例可以访问和操作 MessageContext，并与响应 HandlerChain 共享与 SOAP 消息处理相关的上下文。
return | MessageContext；如果没有关联的 MessageContext，则此方法返回 null。
Throws | IllegalStateException: 如果服务端点实例在远程方法实现范围以外调用此方法。
See also | javax.xml.rpc.handler.MessageContext, javax.xml.rpc.handler.HandlerChain, javax.xml.rpc.handler.Handler
英文文档：

getMessageContext

MessageContext getMessageContext()
The method getMessageContext returns the MessageContext targeted for this endpoint instance. This enables the service endpoint instance to acccess the MessageContext propagated by request HandlerChain (and its contained Handler instances) to the target endpoint instance and to share any SOAP message processing related context. The endpoint instance can access and manipulate the MessageContext and share the SOAP message processing related context with the response HandlerChain.

Returns:
MessageContext; If there is no associated MessageContext, this method returns null.
Throws:
IllegalStateException - if this method is invoked outside a remote method implementation by a service endpoint instance.
See Also:
MessageContext, HandlerChain, Handler

public java.security.Principal getUserPrincipal()
返回 java.security.Principal 实例，该实例包含当前对端点实例调用的方法的已验证用户名。如果不存在任何关联的主体，则此方法返回 null。底层 JAX-RPC 运行时系统负责为对服务端点实例调用的远程方法提供相应的已验证主体。
return | 一个 java.security.Principal，它用于与 servlet 端点实例的当前调用关联的已验证主体；如果没有任何与方法调用关联的已验证用户，则返回 null。
See also | java.security.Principal
英文文档：

getUserPrincipal

Principal getUserPrincipal()
Returns a java.security.Principal instance that contains the name of the authenticated user for the current method invocation on the endpoint instance. This method returns null if there is no associated principal yet. The underlying JAX-RPC runtime system takes the responsibility of providing the appropriate authenticated principal for a remote method invocation on the service endpoint instance.

Returns:
A java.security.Principal for the authenticated principal associated with the current invocation on the servlet endpoint instance; Returns null if there no authenticated user associated with a method invocation.
See Also:
Principal

public HttpSession getHttpSession()
getHttpSession 方法返回当前 HTTP 会话（javax.servlet.http.HTTPSession 形式）。当由远程服务实现中的服务端点调用时，getHttpSession 返回当前与此方法调用关联的 HTTP 会话。如果当前没有任何处于活动状态且与此服务端点关联的 HTTP 会话，则此方法返回 null。端点类不应该依赖于总是存在的活动 HTTP 会话；底层 JAX-RPC 运行时系统负责管理是否存在活动的 HTTP 会话。

如果由非 HTTP 绑定端点调用，那么 getHttpSession 方法将抛出 JAXRPCException。

return | 与当前调用关联的 HTTP 会话；如果没有任何活动会话，则返回 null。
Throws | JAXRPCException: 如果此方法由非 HTTP 绑定端点调用
See also | javax.servlet.http.HttpSession
英文文档：

getHttpSession

HttpSession getHttpSession()
The getHttpSession method returns the current HTTP session (as a javax.servlet.http.HTTPSession). When invoked by the service endpoint within a remote method implementation, the getHttpSession returns the HTTP session associated currently with this method invocation. This method returns null if there is no HTTP session currently active and associated with this service endpoint. An endpoint class should not rely on an active HTTP session being always there; the underlying JAX-RPC runtime system is responsible for managing whether or not there is an active HTTP session.

The getHttpSession method throws JAXRPCException if invoked by an non HTTP bound endpoint.

Returns:
The HTTP session associated with the current invocation or null if there is no active session.
Throws:
JAXRPCException - If this method invoked by any non-HTTP bound endpoint
See Also:
HttpSession

public ServletContext getServletContext()
方法 getServletContext 返回与包含此端点的 Web 应用程序关联的 ServletContext。根据 Servlet 规范，每个 JVM 的每个 Web 应用程序（安装为 WAR）都有一个上下文。基于 servlet 的服务端点是作为 Web 应用程序的一部分部署的。
return
en
ServletContext
See also javax.servlet.ServletContext
英文文档：

getServletContext

ServletContext getServletContext()
The method getServletContext returns the ServletContext associated with the web application that contain this endpoint. According to the Servlet specification, There is one context per web application (installed as a WAR) per JVM . A servlet based service endpoint is deployed as part of a web application.

Returns:
ServletContext
See Also:
ServletContext

public boolean isUserInRole(String role)
返回一个 boolean 值，指示指定的逻辑“角色”中是否包含当前对端点实例调用的方法的已验证用户。
role | 指定角色名称的 String
return | 一个 boolean 值，指示与当前方法调用关联的已验证用户是否属于给定角色；如果用户未经过验证，则返回 false
英文文档：

isUserInRole

boolean isUserInRole(String role)
Returns a boolean indicating whether the authenticated user for the current method invocation on the endpoint instance is included in the specified logical "role".

Parameters:
role - a String specifying the name of the role
Returns:
a boolean indicating whether the authenticated user associated with the current method invocation belongs to a given role; false if the user has not been authenticated
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.rpc.soap (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.rpc.soap

This package defines APIs specific to the SOAP binding.

See:
Description

Exception Summary
SOAPFaultException The SOAPFaultException exception represents a SOAP fault.

Package javax.xml.rpc.soap Description

This package defines APIs specific to the SOAP binding.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.rpc.soap Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.rpc.soap

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.xml.rpc.soap.SOAPFaultException
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


SOAPFaultException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.rpc.soap
Class SOAPFaultException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.xml.rpc.soap.SOAPFaultException
All Implemented Interfaces:
Serializable
public class SOAPFaultException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException

SOAPFaultException 异常表示 SOAP 错误。

SOAP 错误中的消息部分映射到 faultdetail 元素的内容，该元素可通过对 SOAPFaultException 调用 getDetail 方法进行访问。javax.xml.soap.SOAPFactory 上的 createDetail 方法可以创建一个 javax.xml.soap.Detail 实例。

faultstring 提供人类可读的 SOAP 错误描述。faultcode 元素提供 SOAP 错误的算法映射。

有关 SOAP 错误的更多细节，请参见 SOAP 1.1 和 WSDL 1.1 规范。

version | 1.0
See also | javax.xml.soap.Detail, createDetail
英文文档：

The SOAPFaultException exception represents a SOAP fault.

The message part in the SOAP fault maps to the contents of faultdetail element accessible through the getDetail method on the SOAPFaultException. The method createDetail on the javax.xml.soap.SOAPFactory creates an instance of the javax.xml.soap.Detail.

The faultstring provides a human-readable description of the SOAP fault. The faultcode element provides an algorithmic mapping of the SOAP fault.

Refer to SOAP 1.1 and WSDL 1.1 specifications for more details of the SOAP faults.

Version:
1.0
Author:
Rahul Sharma
See Also:
Detail, SOAPFactory.createDetail(), Serialized Form

Constructor Summary
SOAPFaultException(QName faultcode, String faultstring, String faultactor, Detail faultdetail)
Constructor for the SOAPFaultException
Method Summary
Detail | getDetail() Gets the detail element.
String | getFaultActor() Gets the faultactor element.
QName | getFaultCode() Gets the faultcode element.
String | getFaultString() Gets the faultstring element.
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

public SOAPFaultException(javax.xml.namespace.QName faultcode, String faultstring, String faultactor, Detail faultdetail)
SOAPFaultException 的构造方法。
faultCode | SOAP faultcode 的 QName
faultstring | SOAP 错误的 faultstring 元素
faultactor | SOAP 错误的 faultactor 元素
faultdetail | SOAP 错误的 faultdetail 元素
See also | createDetail
英文文档：

SOAPFaultException

public SOAPFaultException(QName faultcode,
                          String faultstring,
                          String faultactor,
                          Detail faultdetail)
Constructor for the SOAPFaultException

Parameters:
faultCode - QName for the SOAP faultcode
faultstring - faultstring element of SOAP fault
faultactor - faultactor element of SOAP fault
faultdetail - faultdetail element of SOAP fault
See Also:
SOAPFactory.createDetail()
Method Detail

public javax.xml.namespace.QName getFaultCode()
获取 faultcode 元素。faultcode 元素提供标识错误的算法机制。SOAP 定义涵盖基本 SOAP 错误的一个小型 SOAP 错误集。
return faultcode 元素的 QName
英文文档：

getFaultCode

public QName getFaultCode()
Gets the faultcode element. The faultcode element provides an algorithmic mechanism for identifying the fault. SOAP defines a small set of SOAP fault codes covering basic SOAP faults.

Returns:
QName of the faultcode element

public String getFaultString()
获取 faultstring 元素。faultstring 提供人类可读的 SOAP 错误描述，不用于算法处理。
return SOAP 错误的 faultstring 元素
英文文档：

getFaultString

public String getFaultString()
Gets the faultstring element. The faultstring provides a human-readable description of the SOAP fault and is not intended for algorithmic processing.

Returns:
faultstring element of the SOAP fault

public String getFaultActor()
获取 faultactor 元素。faultactor 元素指示 SOAP 消息路径上的哪个 SOAP 节点是错误发生的原因。它指示错误来源。
return SOAP 错误的 faultactor 元素
英文文档：

getFaultActor

public String getFaultActor()
Gets the faultactor element. The faultactor element provides information about which SOAP node on the SOAP message path caused the fault to happen. It indicates the source of the fault.

Returns:
faultactor element of the SOAP fault

public Detail getDetail()
获取 detail 元素。detail 元素用于携带与 SOAP 正文有关的特定于应用程序的错误信息。
detail | 错误的 detail 元素
See also | javax.xml.soap.Detail
英文文档：

getDetail

public Detail getDetail()
Gets the detail element. The detail element is intended for carrying application specific error information related to the SOAP Body.

Parameters:
detail - element of the SOAP fault
See Also:
Detail
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.soap (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.soap

Provides the API for creating and building SOAP messages.

See:
Description

Interface Summary
Detail | A container for DetailEntry objects.
DetailEntry | The content for a Detail object, giving details for a SOAPFault object.
Name | A representation of an XML name.
Node | A representation of a node (element) in an XML document.
SOAPBody | An object that represents the contents of the SOAP body element in a SOAP message.
SOAPBodyElement | A SOAPBodyElement object represents the contents in a SOAPBody object.
SOAPConstants | The definition of constants pertaining to the SOAP protocol.
SOAPElement | An object representing an element of a SOAP message that is allowed but not specifically prescribed by a SOAP specification.
SOAPEnvelope | The container for the SOAPHeader and SOAPBody portions of a SOAPPart object.
SOAPFault | An element in the SOAPBody object that contains error and/or status information.
SOAPFaultElement | A representation of the contents in a SOAPFault object.
SOAPHeader | A representation of the SOAP header element.
SOAPHeaderElement | An object representing the contents in the SOAP header part of the SOAP envelope.
Text | A representation of a node whose value is text.

Class Summary
AttachmentPart | A single attachment to a SOAPMessage object.
MessageFactory | A factory for creating SOAPMessage objects.
MimeHeader | An object that stores a MIME header name and its value.
MimeHeaders | A container for MimeHeader objects, which represent the MIME headers present in a MIME part of a message.
SAAJMetaFactory | The access point for the implementation classes of the factories defined in the SAAJ API.
SAAJResult | Acts as a holder for the results of a JAXP transformation or a JAXB marshalling, in the form of a SAAJ tree.
SOAPConnection | A point-to-point connection that a client can use for sending messages directly to a remote party (represented by a URL, for instance).
SOAPConnectionFactory | A factory for creating SOAPConnection objects.
SOAPElementFactory | Deprecated. - Use javax.xml.soap.SOAPFactory for creating SOAPElements.
SOAPFactory | SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree.
SOAPMessage | The root class for all SOAP messages.
SOAPPart | The container for the SOAP-specific portion of a SOAPMessage object.

Exception Summary
SOAPException An exception that signals that a SOAP exception has occurred.

Package javax.xml.soap Description

Provides the API for creating and building SOAP messages. This package is defined in the SOAP with Attachments API for JavaTM (SAAJ) 1.3 specification.

The API in the javax.xml.soap package allows you to do the following:

  • create a point-to-point connection to a specified endpoint
  • create a SOAP message
  • create an XML fragment
  • add content to the header of a SOAP message
  • add content to the body of a SOAP message
  • create attachment parts and add content to them
  • access/add/modify parts of a SOAP message
  • create/add/modify SOAP fault information
  • extract content from a SOAP message
  • send a SOAP request-response message

In addition the APIs in the javax.xml.soap package extend their counterparts in the org.w3c.dom package. This means that the SOAPPart of a SOAPMessage is also a DOM Level 2 Document, and can be manipulated as such by applications, tools and libraries that use DOM (see http://www.w3.org/DOM/ for more information). It is important to note that, while it is possible to use DOM APIs to add ordinary DOM nodes to a SAAJ tree, the SAAJ APIs are still required to return SAAJ types when examining or manipulating the tree. In order to accomplish this the SAAJ APIs (specifically SOAPElement.getChildElements()) are allowed to silently replace objects that are incorrectly typed relative to SAAJ requirements with equivalent objects of the required type. These replacements must never cause the logical structure of the tree to change, so from the perspective of the DOM APIs the tree will remain unchanged. However, the physical composition of the tree will have changed so that references to the nodes that were replaced will refer to nodes that are no longer a part of the tree. The SAAJ APIs are not allowed to make these replacements if they are not required so the replacement objects will never subsequently be silently replaced by future calls to the SAAJ API.

What this means in practical terms is that an application that starts to use SAAJ APIs on a tree after manipulating it using DOM APIs must assume that the tree has been translated into an all SAAJ tree and that any references to objects within the tree that were obtained using DOM APIs are no longer valid. Switching from SAAJ APIs to DOM APIs is not allowed to cause invalid references and neither is using SAAJ APIs exclusively. It is only switching from using DOM APIs on a particular SAAJ tree to using SAAJ APIs that causes the risk of invalid references.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.soap Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.soap

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.soap.AttachmentPart
    • javax.xml.transform.dom.DOMResult (implements javax.xml.transform.Result)
      • javax.xml.soap.SAAJResult
    • javax.xml.soap.MessageFactory
    • javax.xml.soap.MimeHeader
    • javax.xml.soap.MimeHeaders
    • javax.xml.soap.SAAJMetaFactory
    • javax.xml.soap.SOAPConnection
    • javax.xml.soap.SOAPConnectionFactory
    • javax.xml.soap.SOAPElementFactory
    • javax.xml.soap.SOAPFactory
    • javax.xml.soap.SOAPMessage
    • javax.xml.soap.SOAPPart (implements org.w3c.dom.Document, javax.xml.soap.Node)
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • javax.xml.soap.SOAPException

Interface Hierarchy

  • javax.xml.soap.Name
  • org.w3c.dom.Node
    • org.w3c.dom.CharacterData
      • org.w3c.dom.Text
        • javax.xml.soap.Text (also extends javax.xml.soap.Node)
    • org.w3c.dom.Element
      • javax.xml.soap.SOAPElement (also extends javax.xml.soap.Node)
        • javax.xml.soap.DetailEntry
        • javax.xml.soap.SOAPBody
        • javax.xml.soap.SOAPBodyElement
          • javax.xml.soap.SOAPFault
        • javax.xml.soap.SOAPEnvelope
        • javax.xml.soap.SOAPFaultElement
          • javax.xml.soap.Detail
        • javax.xml.soap.SOAPHeader
        • javax.xml.soap.SOAPHeaderElement
    • javax.xml.soap.Node
      • javax.xml.soap.SOAPElement (also extends org.w3c.dom.Element)
        • javax.xml.soap.DetailEntry
        • javax.xml.soap.SOAPBody
        • javax.xml.soap.SOAPBodyElement
          • javax.xml.soap.SOAPFault
        • javax.xml.soap.SOAPEnvelope
        • javax.xml.soap.SOAPFaultElement
          • javax.xml.soap.Detail
        • javax.xml.soap.SOAPHeader
        • javax.xml.soap.SOAPHeaderElement
      • javax.xml.soap.Text (also extends org.w3c.dom.Text)
  • javax.xml.soap.SOAPConstants
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Detail (Java EE 5)

javax.xml.soap
Interface Detail

All Superinterfaces:
Element, Node, SOAPElement, SOAPFaultElement
public interface Detail
extends SOAPFaultElement

Implements: SOAPFaultElement

DetailEntry 对象的容器。DetailEntry 对象给出特定于应用程序的详细错误信息，以及与包含该对象的 SOAPBody 对象相关的详细错误信息。

可以使用方法 SOAPFault.getDetail 来检索 Detail 对象（SOAPFault 对象的一部分）。该 Detail 接口提供两个方法。第一种方法创建一个新 DetailEntry 对象，且自动将其添加到 Detail 对象。第二种方法获取 Detail 对象中包含的 DetailEntry 对象列表。

以下代码片段（其中 sf 是 SOAPFault 对象）获取它的 Detail 对象 (d)，将新的 DetailEntry 对象添加到 d，然后获取 d 中所有 DetailEntry 对象列表。该代码片段还创建要传递给方法 addDetailEntry 的 Name 对象。变量 se（用于创建 Name 对象）是一个 SOAPEnvelope 对象。

Detail d = sf.getDetail();
Name name = se.createName("GetLastTradePrice", "WOMBAT",
"http://www.wombat.org/trader");
d.addDetailEntry(name);
Iterator it = d.getDetailEntries();
英文文档：

A container for DetailEntry objects. DetailEntry objects give detailed error information that is application-specific and related to the SOAPBody object that contains it.

A Detail object, which is part of a SOAPFault object, can be retrieved using the method SOAPFault.getDetail. The Detail interface provides two methods. One creates a new DetailEntry object and also automatically adds it to the Detail object. The second method gets a list of the DetailEntry objects contained in a Detail object.

The following code fragment, in which sf is a SOAPFault object, gets its Detail object (d), adds a new DetailEntry object to d, and then gets a list of all the DetailEntry objects in d. The code also creates a Name object to pass to the method addDetailEntry. The variable se, used to create the Name object, is a SOAPEnvelope object.

    Detail d = sf.getDetail();
    Name name = se.createName("GetLastTradePrice", "WOMBAT",
                                "http://www.wombat.org/trader");
    d.addDetailEntry(name);
    Iterator it = d.getDetailEntries();

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
DetailEntry | addDetailEntry(Name name) Creates a new DetailEntry object with the given name and adds it to this Detail object.
DetailEntry | addDetailEntry(QName qname) Creates a new DetailEntry object with the given QName and adds it to this Detail object.
Iterator | getDetailEntries() Gets an Iterator over all of the DetailEntrys in this Detail object.
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public DetailEntry addDetailEntry(Name name) throws SOAPException
使用给定名称创建新的 DetailEntry 对象，并将其添加到此 Detail 对象。
name | 标识新 DetailEntry 对象的 Name 对象
Throws | SOAPException: 当将 DetailEntry 对象添加到此 Detail 对象过程中存在问题时，抛出该异常。
See also | addDetailEntry(QName qname)
英文文档：

addDetailEntry

DetailEntry addDetailEntry(Name name)
                           throws SOAPException
Creates a new DetailEntry object with the given name and adds it to this Detail object.

Parameters:
name - a Name object identifying the new DetailEntry object
Throws:
SOAPException - thrown when there is a problem in adding a DetailEntry object to this Detail object.
See Also:
addDetailEntry(QName qname)

public DetailEntry addDetailEntry(javax.xml.namespace.QName qname) throws SOAPException
使用给定 QName 创建新的 DetailEntry 对象，并将其添加到此 Detail 对象。与使用 Name 的方法相比，应优先考虑此方法。
qname | 标识新 DetailEntry 对象的 QName 对象
Throws | SOAPException: 当将 DetailEntry 对象添加到此 Detail 对象过程中存在问题时，抛出该异常。
since | SAAJ 1.3
See also | addDetailEntry(Name name)
英文文档：

addDetailEntry

DetailEntry addDetailEntry(QName qname)
                           throws SOAPException
Creates a new DetailEntry object with the given QName and adds it to this Detail object. This method is the preferred over the one using Name.

Parameters:
qname - a QName object identifying the new DetailEntry object
Throws:
SOAPException - thrown when there is a problem in adding a DetailEntry object to this Detail object.
Since:
SAAJ 1.3
See Also:
addDetailEntry(Name name)

public java.util.Iterator<E> getDetailEntries()
获取在此 Detail 对象中所有 DetailEntry 上进行迭代的迭代器。
return 一个 Iterator 对象，可在此 Detail 对象中的 DetailEntry 对象上进行迭代
英文文档：

getDetailEntries

Iterator getDetailEntries()
Gets an Iterator over all of the DetailEntrys in this Detail object.

Returns:
an Iterator object over the DetailEntry objects in this Detail object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DetailEntry (Java EE 5)

javax.xml.soap
Interface DetailEntry

All Superinterfaces:
Element, Node, SOAPElement
public interface DetailEntry
extends SOAPElement

Implements: SOAPElement

Detail 对象的内容，给出 SOAPFault 对象的详细信息。DetailEntry 对象是特定于应用程序的，它携带与包含它的 SOAPBody 对象相关的错误信息。
英文文档：

The content for a Detail object, giving details for a SOAPFault object. A DetailEntry object, which carries information about errors related to the SOAPBody object that contains it, is application-specific.

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Name (Java EE 5)

javax.xml.soap
Interface Name

public interface Name

XML 名称的表示形式。此接口提供的方法可获取本地和限定于命名空间的名称，以及与名称的命名空间关联的前缀。它还能够获取命名空间的 URI。

以下是一个元素中命名空间声明的示例。

<wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader">
（"xmlns" 代表 "XML namespace"。）下文显示了 Name 接口中的方法将返回的内容。
  • getQualifiedName 将返回 "prefix:LocalName" = "WOMBAT:GetLastTradePrice"
  • getURI 将返回 "http://www.wombat.org/trader"
  • getLocalName 将返回 "GetLastTracePrice"
  • getPrefix 将返回 "WOMBAT"

XML 命名空间用于辨别 SOAP 标识符与特定于应用程序的标识符。

Name 对象是使用方法 SOAPEnvelope.createName 创建的，该方法有两种形式。一种方法创建带有本地名称、命名空间前缀和命名空间 URI 的 Name 对象，另一种方法创建只带有本地名称的 Name 对象。以下代码行（其中 se 是一个 SOAPEnvelope 对象）创建带有所有三个元素的新 Name 对象。

Name name = se.createName("GetLastTradePrice", "WOMBAT",
"http://www.wombat.org/trader");
以下代码行给出一个如何使用对象 Name 的示例。变量 element 是一个 SOAPElement 对象。此代码创建带有给定名称的新 SOAPElement 对象并将其添加到 element。
element.addChildElement(name);

Name 接口在将来的 SAAJ 版本中可能会被废弃，并被 javax.xml.namespace.QName 取代。

See also SOAPEnvelope.createName, SOAPFactory.createName
英文文档：

A representation of an XML name. This interface provides methods for getting the local and namespace-qualified names and also for getting the prefix associated with the namespace for the name. It is also possible to get the URI of the namespace.

The following is an example of a namespace declaration in an element.

   <wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader">
("xmlns" stands for "XML namespace".) The following shows what the methods in the Name interface will return.
  • getQualifiedName will return "prefix:LocalName" = "WOMBAT:GetLastTradePrice"
  • getURI will return "http://www.wombat.org/trader"
  • getLocalName will return "GetLastTracePrice"
  • getPrefix will return "WOMBAT"

XML namespaces are used to disambiguate SOAP identifiers from application-specific identifiers.

Name objects are created using the method SOAPEnvelope.createName, which has two versions. One method creates Name objects with a local name, a namespace prefix, and a namespace URI. and the second creates Name objects with just a local name. The following line of code, in which se is a SOAPEnvelope object, creates a new Name object with all three.

     Name name = se.createName("GetLastTradePrice", "WOMBAT",
                                "http://www.wombat.org/trader");
The following line of code gives an example of how a Name object can be used. The variable element is a SOAPElement object. This code creates a new SOAPElement object with the given name and adds it to element.
     element.addChildElement(name);

The Name interface may be deprecated in a future release of SAAJ in favor of javax.xml.namespace.QName

See Also:
SOAPEnvelope.createName, SOAPFactory.createName

Method Summary
String | getLocalName() Gets the local name part of the XML name that this Name object represents.
String | getPrefix() Returns the prefix that was specified when this Name object was initialized.
String | getQualifiedName() Gets the namespace-qualified name of the XML name that this Name object represents.
String | getURI() Returns the URI of the namespace for the XML name that this Name object represents.

Method Detail

public String getLocalName()
获取此 Name 对象表示的 XML 名称的本地名称部分。
return 给出本地名称的字符串
英文文档：

getLocalName

String getLocalName()
Gets the local name part of the XML name that this Name object represents.

Returns:
a string giving the local name

public String getQualifiedName()
获取此 Name 对象表示的 XML 名称限定于命名空间的名称。
return 字符串形式的限定于命名空间的名称。
英文文档：

getQualifiedName

String getQualifiedName()
Gets the namespace-qualified name of the XML name that this Name object represents.

Returns:
the namespace-qualified name as a string

public String getPrefix()
返回初始化此 Name 对象时指定的前缀。此前缀与此 Name 对象表示的 XML 名称的命名空间关联。
return 字符串形式的数据
英文文档：

getPrefix

String getPrefix()
Returns the prefix that was specified when this Name object was initialized. This prefix is associated with the namespace for the XML name that this Name object represents.

Returns:
the prefix as a string

public String getURI()
返回此 Name 对象表示的 XML 名称命名空间的 URI。
return 字符串形式的 URI
英文文档：

getURI

String getURI()
Returns the URI of the namespace for the XML name that this Name object represents.

Returns:
the URI as a string
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Node (Java EE 5)

javax.xml.soap
Interface Node

All Superinterfaces:
Node
All Known Subinterfaces:
Detail, DetailEntry, SOAPBody, SOAPBodyElement, SOAPElement, SOAPEnvelope, SOAPFault, SOAPFaultElement, SOAPHeader, SOAPHeaderElement, Text
public interface Node
extends Node

Implements: org.w3c.dom.Node
Implemented by: SOAPElement, SOAPPart, Text

XML 文档中节点（元素）的表示形式。此接口扩展了标准的 DOM Node 接口，具有一些能获取和设置节点值、获取和设置父节点、移除节点的方法。
英文文档：

A representation of a node (element) in an XML document. This interface extnends the standard DOM Node interface with methods for getting and setting the value of a node, for getting and setting the parent of a node, and for removing a node.

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
void | detachNode() Removes this Node object from the tree.
SOAPElement | getParentElement() Returns the parent element of this Node object.
String | getValue() Returns the value of this node if this is a Text node or the value of the immediate child of this node otherwise.
void | recycleNode() Notifies the implementation that this Node object is no longer being used by the application and that the implementation is free to reuse this object for nodes that may be created later.
void | setParentElement(SOAPElement parent) Sets the parent of this Node object to the given SOAPElement object.
void | setValue(String value) If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node.
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public String getValue()
如果这是一个 Text 节点，则返回此节点的值，否则返回此节点的直接子节点值。如果此 Node 有一个直接子节点是 Text 节点，则返回该直接子节点的值。如果存在一个以上的 Text 节点，则返回第一个 Text 节点的值。否则返回 null。
return 如果此节点是一个 Text 节点或该文本由此 Node 对象（该对象是一个 Text 对象）的第一个直接子节点（如果这种子节点存在）包含，则返回带有此节点文本的 String；否则返回 null。
英文文档：

getValue

String getValue()
Returns the value of this node if this is a Text node or the value of the immediate child of this node otherwise. If there is an immediate child of this Node that it is a Text node then it's value will be returned. If there is more than one Text node then the value of the first Text Node will be returned. Otherwise null is returned.

Returns:
a String with the text of this node if this is a Text node or the text contained by the first immediate child of this Node object that is a Text object if such a child exists; null otherwise.

public void setValue(String value)
如果这是一个 Text 节点，则此方法会设置它的值，否则该方法设置此节点的直接 (Text) 子节点值。仅当存在子节点且该节点是 Text 节点时，才能设置此节点的直接子节点值，如果没有子节点，则将创建 Text 子节点。
Throws | IllegalStateException: 如果该节点不是 Text 节点，也没有子节点或者有一个子节点但不是 Text 节点。
since | SAAJ 1.2
英文文档：

setValue

void setValue(String value)
If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node. The value of the immediate child of this node can be set only if, there is one child node and that node is a Text node, or if there are no children in which case a child Text node will be created.

Throws:
IllegalStateException - if the node is not a Text node and either has more than one child node or has a child node that is not a Text node.
Since:
SAAJ 1.2

public void setParentElement(SOAPElement parent) throws SOAPException
将此 Node 对象的父节点设置为给定的 SOAPElement 对象。
parent | 要设置为此 Node 对象父节点的 SOAPElement 对象
Throws | SOAPException: 如果将父节点设置为给定元素时出现错误
See also | getParentElement
英文文档：

setParentElement

void setParentElement(SOAPElement parent)
                      throws SOAPException
Sets the parent of this Node object to the given SOAPElement object.

Parameters:
parent - the SOAPElement object to be set as the parent of this Node object
Throws:
SOAPException - if there is a problem in setting the parent to the given element
See Also:
getParentElement()

public SOAPElement getParentElement()
返回此 Node 对象的父元素。如果树没有存入内存，则此方法抛出 UnsupportedOperationException。
return | 此 Node 对象的父节点 SOAPElement 对象；如果此 Node 对象为根节点，则返回 null
Throws | UnsupportedOperationException: 如果整个树没有存入内存
See also | setParentElement
英文文档：

getParentElement

SOAPElement getParentElement()
Returns the parent element of this Node object. This method can throw an UnsupportedOperationException if the tree is not kept in memory.

Returns:
the SOAPElement object that is the parent of this Node object or null if this Node object is root
Throws:
UnsupportedOperationException - if the whole tree is not kept in memory
See Also:
setParentElement(javax.xml.soap.SOAPElement)

public void detachNode()
从树中移除此 Node 对象。
英文文档：

detachNode

void detachNode()
Removes this Node object from the tree.

public void recycleNode()
通知实现此 Node 对象不再由应用程序使用，对于以后可能创建的节点，实现可以随意重用此对象。

调用 recycleNode 方法意味着以前调用过 detachNode 方法。

英文文档：

recycleNode

void recycleNode()
Notifies the implementation that this Node object is no longer being used by the application and that the implementation is free to reuse this object for nodes that may be created later.

Calling the method recycleNode implies that the method detachNode has been called previously.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPBody (Java EE 5)

javax.xml.soap
Interface SOAPBody

All Superinterfaces:
Element, Node, SOAPElement
public interface SOAPBody
extends SOAPElement

Implements: SOAPElement

表示 SOAP 消息中 SOAP 正文元素内容的对象。SOAP 正文元素由能影响特定于应用程序内容的处理方式的 XML 数据组成。

SOAPBody 对象包含了 SOAPBodyElement 对象，后者具有 SOAP 正文的内容。携带状态和/或错误信息的 SOAPFault 对象是 SOAPBodyElement 对象的一个示例。

See also javax.xml.soap.SOAPFault
英文文档：

An object that represents the contents of the SOAP body element in a SOAP message. A SOAP body element consists of XML data that affects the way the application-specific content is processed.

A SOAPBody object contains SOAPBodyElement objects, which have the content for the SOAP body. A SOAPFault object, which carries status and/or error information, is an example of a SOAPBodyElement object.

See Also:
SOAPFault

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
SOAPBodyElement | addBodyElement(Name name) Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.
SOAPBodyElement | addBodyElement(QName qname) Creates a new SOAPBodyElement object with the specified QName and adds it to this SOAPBody object.
SOAPBodyElement | addDocument(Document document) Adds the root node of the DOM Document to this SOAPBody object.
SOAPFault | addFault() Creates a new SOAPFault object and adds it to this SOAPBody object.
SOAPFault | addFault(Name faultCode, String faultString) Creates a new SOAPFault object and adds it to this SOAPBody object.
SOAPFault | addFault(Name faultCode, String faultString, Locale locale) Creates a new SOAPFault object and adds it to this SOAPBody object.
SOAPFault | addFault(QName faultCode, String faultString) Creates a new SOAPFault object and adds it to this SOAPBody object.
SOAPFault | addFault(QName faultCode, String faultString, Locale locale) Creates a new SOAPFault object and adds it to this SOAPBody object.
Document | extractContentAsDocument() Creates a new DOM Document and sets the first child of this SOAPBody as it's document element.
SOAPFault | getFault() Returns the SOAPFault object in this SOAPBody object.
boolean | hasFault() Indicates whether a SOAPFault object exists in this SOAPBody object.
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public SOAPFault addFault() throws SOAPException
创建新的 SOAPFault 对象，并将其添加到此 SOAPBody 对象。新的 SOAPFault 会将强制性 (mandatory) 子元素设置为默认值。SOAPFault 的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault，这取决于创建 MessageFactory 实例时指定的 protocol。

一个 SOAPBody 最多只能包含一个 SOAPFault 子元素。

return | 新的 SOAPFault 对象
Throws | SOAPException: 如果存在 SOAP 错误
英文文档：

addFault

SOAPFault addFault()
                   throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object. The new SOAPFault will have default values set for the mandatory child elements. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

A SOAPBody may contain at most one SOAPFault child element.

Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error

public SOAPFault addFault(Name faultCode, String faultString, java.util.Locale locale) throws SOAPException
创建新的 SOAPFault 对象，并将其添加到此 SOAPBody 对象。SOAPFault 的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault，这取决于创建 MessageFactory 实例时指定的 protocol。

对于 SOAP 1.2，faultCode 参数是 Fault/Code/Value 元素的值，faultString 参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1，faultCode 参数是 faultcode 元素的值，faultString 参数是 faultstring 元素的值。

一个 SOAPBody 最多只能包含一个 SOAPFault 子元素。

faultCode | Name 对象，给出要设置的错误代码；必须是正使用的 SOAP 规范的版本中定义的错误代码之一
faultString | 一个 String，给出对错误的解释
locale | java.util.Locale 对象，指示 faultString 的本地语言
return | 新的 SOAPFault 对象
Throws | SOAPException: 如果存在 SOAP 错误
since | SAAJ 1.2
See also | setFaultCode, setFaultString
英文文档：

addFault

SOAPFault addFault(Name faultCode,
                   String faultString,
                   Locale locale)
                   throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

A SOAPBody may contain at most one SOAPFault child element.

Parameters:
faultCode - a Name object giving the fault code to be set; must be one of the fault codes defined in the Version of SOAP specification in use
faultString - a String giving an explanation of the fault
locale - a Locale object indicating the native language of the faultString
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.2
See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name), SOAPFault.setFaultString(java.lang.String)

public SOAPFault addFault(javax.xml.namespace.QName faultCode, String faultString, java.util.Locale locale) throws SOAPException
创建新的 SOAPFault 对象，并将其添加到此 SOAPBody 对象。SOAPFault 的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault，这取决于创建 MessageFactory 实例时指定的 protocol。

对于 SOAP 1.2，faultCode 参数是 Fault/Code/Value 元素的值，faultString 参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1，faultCode 参数是 faultcode 元素的值，faultString 参数是 faultstring 元素的值。

一个 SOAPBody 最多只能包含一个 SOAPFault 子元素。

faultCode | QName 对象，给出要设置的错误代码；必须是正使用的 SOAP 规范的版本中定义的错误代码之一。
faultString | String，给出错误的解释
locale | Locale 对象，指示 faultString 的本地语言
return | 新的 SOAPFault 对象
Throws | SOAPException: 如果存在 SOAP 错误
since | SAAJ 1.3
See also | setFaultCode, setFaultString, addFault(Name faultCode, String faultString, Locale locale)
英文文档：

addFault

SOAPFault addFault(QName faultCode,
                   String faultString,
                   Locale locale)
                   throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

A SOAPBody may contain at most one SOAPFault child element.

Parameters:
faultCode - a QName object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use.
faultString - a String giving an explanation of the fault
locale - a Locale object indicating the native language of the faultString
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.3
See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name),
SOAPFault.setFaultString(java.lang.String),
addFault(Name faultCode, String faultString, Locale locale)

public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
创建新的 SOAPFault 对象，并将其添加到此 SOAPBody 对象。SOAPFault 的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault，这取决于创建 MessageFactory 实例时指定的 protocol。

对于 SOAP 1.2，faultCode 参数是 Fault/Code/Value 元素的值，faultString 参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1，faultCode 参数是 faultcode 元素的值，faultString 参数是 faultstring 元素的值。

如果是 SOAP 1.2 错误，Fault/Reason/Text 元素上强制性 xml:lang 属性的默认值将设置为 java.util.Locale.getDefault()

一个 SOAPBody 最多只能包含一个 SOAPFault 子元素。

faultCode | Name 对象，给出要设置的错误代码；必须是正使用的 SOAP 规范的版本中定义的错误代码之一
faultString | String，给出错误的解释
return | 新的 SOAPFault 对象
Throws | SOAPException: 如果存在 SOAP 错误
since | SAAJ 1.2
See also | setFaultCode, setFaultString
英文文档：

addFault

SOAPFault addFault(Name faultCode,
                   String faultString)
                   throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang attribute on the Fault/Reason/Text element will be set to java.util.Locale.getDefault()

A SOAPBody may contain at most one SOAPFault child element.

Parameters:
faultCode - a Name object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use
faultString - a String giving an explanation of the fault
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.2
See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name), SOAPFault.setFaultString(java.lang.String)

public SOAPFault addFault(javax.xml.namespace.QName faultCode, String faultString) throws SOAPException
创建新的 SOAPFault 对象，并将其添加到此 SOAPBody 对象。SOAPFault 的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault，这取决于创建 MessageFactory 实例时指定的 protocol。

对于 SOAP 1.2，faultCode 参数是 Fault/Code/Value 元素的值，faultString 参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1，faultCode 参数是 faultcode 元素的值，faultString 参数是 faultstring 元素的值。

如果是 SOAP 1.2 错误，Fault/Reason/Text 元素上强制性 xml:lang 属性的默认值将设置为 java.util.Locale.getDefault()

一个 SOAPBody 最多只能包含一个 SOAPFault 子元素

faultCode | QName 对象，给出要设置的错误代码；必须是正使用的 SOAP 规范的版本中定义的错误代码之一
faultString | String，给出错误的解释
return | 新的 SOAPFault 对象
Throws | SOAPException: 如果存在 SOAP 错误
since | SAAJ 1.3
See also | setFaultCode, setFaultString, addFault(Name faultCode, String faultString)
英文文档：

addFault

SOAPFault addFault(QName faultCode,
                   String faultString)
                   throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang attribute on the Fault/Reason/Text element will be set to java.util.Locale.getDefault()

A SOAPBody may contain at most one SOAPFault child element

Parameters:
faultCode - a QName object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use
faultString - a String giving an explanation of the fault
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.3
See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name),
SOAPFault.setFaultString(java.lang.String),
addFault(Name faultCode, String faultString)

public boolean hasFault()
指示此 SOAPBody 对象中是否存在 SOAPFault 对象。
return 如果此 SOAPBody 对象中存在 SOAPFault 对象，则返回 true；否则返回 false
英文文档：

hasFault

boolean hasFault()
Indicates whether a SOAPFault object exists in this SOAPBody object.

Returns:
true if a SOAPFault object exists in this SOAPBody object; false otherwise

public SOAPFault getFault()
返回此 SOAPBody 对象中的 SOAPFault 对象。
return 此 SOAPBody 对象中的 SOAPFault 对象（如果存在）；若不存在，则返回 null。
英文文档：

getFault

SOAPFault getFault()
Returns the SOAPFault object in this SOAPBody object.

Returns:
the SOAPFault object in this SOAPBody object if present, null otherwise.

public SOAPBodyElement addBodyElement(Name name) throws SOAPException
使用指定名称创建新的 SOAPBodyElement 对象，并将其添加到此 SOAPBody 对象。
name | Name 对象，带有新 SOAPBodyElement 对象的名称
return | 新的 SOAPBodyElement 对象
Throws | SOAPException: 如果发生 SOAP 错误
See also | addBodyElement(javax.xml.namespace.QName)
英文文档：

addBodyElement

SOAPBodyElement addBodyElement(Name name)
                               throws SOAPException
Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.

Parameters:
name - a Name object with the name for the new SOAPBodyElement object
Returns:
the new SOAPBodyElement object
Throws:
SOAPException - if a SOAP error occurs
See Also:
addBodyElement(javax.xml.namespace.QName)

public SOAPBodyElement addBodyElement(javax.xml.namespace.QName qname) throws SOAPException
使用指定 QName 创建新的 SOAPBodyElement 对象，并将其添加到此 SOAPBody 对象。
qname | QName 对象，带有新 SOAPBodyElement 对象的名称
return | 新的 SOAPBodyElement 对象
Throws | SOAPException: 如果发生 SOAP 错误
since | SAAJ 1.3
See also | addBodyElement(Name)
英文文档：

addBodyElement

SOAPBodyElement addBodyElement(QName qname)
                               throws SOAPException
Creates a new SOAPBodyElement object with the specified QName and adds it to this SOAPBody object.

Parameters:
qname - a QName object with the qname for the new SOAPBodyElement object
Returns:
the new SOAPBodyElement object
Throws:
SOAPException - if a SOAP error occurs
Since:
SAAJ 1.3
See Also:
addBodyElement(Name)

public SOAPBodyElement addDocument(org.w3c.dom.Document document) throws SOAPException
将 DOM org.w3c.dom.Document 的根节点添加到此 SOAPBody 对象。

调用此方法会使 document 参数失效。在调用 addDocument 时，客户端应用程序应丢弃所有对此 Document 及其内容的引用。继续使用此类引用的应用程序将产生不确定的行为。

document | Document 对象，该对象的根节点将被添加到此 SOAPBody。
return | 表示被添加根节点的 SOAPBodyElement。
Throws | SOAPException: 如果无法添加 Document
since | SAAJ 1.2
英文文档：

addDocument

SOAPBodyElement addDocument(Document document)
                            throws SOAPException
Adds the root node of the DOM Document to this SOAPBody object.

Calling this method invalidates the document parameter. The client application should discard all references to this Document and its contents upon calling addDocument. The behavior of an application that continues to use such references is undefined.

Parameters:
document - the Document object whose root node will be added to this SOAPBody.
Returns:
the SOAPBodyElement that represents the root node that was added.
Throws:
SOAPException - if the Document cannot be added
Since:
SAAJ 1.2

public org.w3c.dom.Document extractContentAsDocument() throws SOAPException
创建新的 DOM org.w3c.dom.Document，并将此 SOAPBody 的第一个子元素设置为它的文档元素。子 SOAPElement 作为进程的一部分被移除。
return | SOAPBody 内容的 org.w3c.dom.Document 表示形式。
Throws | SOAPException: 如果不存在任何 SOAPBody 的子 SOAPElement。
since | SAAJ 1.3
英文文档：

extractContentAsDocument

Document extractContentAsDocument()
                                  throws SOAPException
Creates a new DOM Document and sets the first child of this SOAPBody as it's document element. The child SOAPElement is removed as part of the process.

Returns:
the Document representation of the SOAPBody content.
Throws:
SOAPException - if there is not exactly one child SOAPElement of the SOAPBody.
Since:
SAAJ 1.3
Overview  Package   Class  Tree  Deprecated  Index  Help
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


SOAPBodyElement (Java EE 5)

javax.xml.soap
Interface SOAPBodyElement

All Superinterfaces:
Element, Node, SOAPElement
All Known Subinterfaces:
SOAPFault
public interface SOAPBodyElement
extends SOAPElement

Implements: SOAPElement
Implemented by: SOAPFault

表示 SOAPBody 对象中内容的 SOAPBodyElement 对象。SOAPFault 接口是一个已经定义的 SOAPBodyElement 对象。

可以创建新的 SOAPBodyElement 对象，并使用 SOAPBody 的 addBodyElement 方法将其添加到 SOAPBody 对象。在以下代码行中，sb 是一个 SOAPBody 对象，myName 是一个 Name 对象。

SOAPBodyElement sbe = sb.addBodyElement(myName);
英文文档：

A SOAPBodyElement object represents the contents in a SOAPBody object. The SOAPFault interface is a SOAPBodyElement object that has been defined.

A new SOAPBodyElement object can be created and added to a SOAPBody object with the SOAPBody method addBodyElement. In the following line of code, sb is a SOAPBody object, and myName is a Name object.

    SOAPBodyElement sbe = sb.addBodyElement(myName);

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPConstants (Java EE 5)

javax.xml.soap
Interface SOAPConstants

public interface SOAPConstants

与 SOAP 协议有关的常量的定义。
英文文档：

The definition of constants pertaining to the SOAP protocol.

Field Summary
static String | DEFAULT_SOAP_PROTOCOL The default protocol: SOAP 1.1 for backwards compatibility.
static String | DYNAMIC_SOAP_PROTOCOL Used to create MessageFactory instances that create SOAPMessages whose concrete type is based on the Content-Type MIME header passed to the createMessage method.
static String | SOAP_1_1_CONTENT_TYPE The media type of the Content-Type MIME header in SOAP 1.1.
static String | SOAP_1_1_PROTOCOL Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.1 specification.
static String | SOAP_1_2_CONTENT_TYPE The media type of the Content-Type MIME header in SOAP 1.2.
static String | SOAP_1_2_PROTOCOL Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.2 specification
static QName | SOAP_DATAENCODINGUNKNOWN_FAULT SOAP 1.2 DataEncodingUnknown Fault
static String | SOAP_ENV_PREFIX The default namespace prefix for http://www.w3.org/2003/05/soap-envelope
static QName | SOAP_MUSTUNDERSTAND_FAULT SOAP 1.2 MustUnderstand Fault
static QName | SOAP_RECEIVER_FAULT SOAP 1.2 Receiver Fault
static QName | SOAP_SENDER_FAULT SOAP 1.2 Sender Fault
static QName | SOAP_VERSIONMISMATCH_FAULT SOAP 1.2 VersionMismatch Fault
static String | URI_NS_SOAP_1_1_ENVELOPE The namespace identifier for the SOAP 1.1 envelope.
static String | URI_NS_SOAP_1_2_ENCODING The namespace identifier for the SOAP 1.2 encoding.
static String | URI_NS_SOAP_1_2_ENVELOPE The namespace identifier for the SOAP 1.2 envelope.
static String | URI_NS_SOAP_ENCODING The namespace identifier for the SOAP 1.1 encoding.
static String | URI_NS_SOAP_ENVELOPE The namespace identifier for the SOAP 1.1 envelope, All SOAPElements in this namespace are defined by the SOAP 1.1 specification.
static String | URI_SOAP_1_2_ROLE_NEXT The URI identifying the next application processing a SOAP request as the intended role for a SOAP 1.2 header entry (see section 2.2 of part 1 of the SOAP 1.2 specification).
static String | URI_SOAP_1_2_ROLE_NONE The URI specifying the role None in SOAP 1.2.
static String | URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER The URI identifying the ultimate receiver of the SOAP 1.2 message.
static String | URI_SOAP_ACTOR_NEXT The URI identifying the next application processing a SOAP request as the intended actor for a SOAP 1.1 header entry (see section 4.2.2 of the SOAP 1.1 specification).

Field Detail

英文文档：

DYNAMIC_SOAP_PROTOCOL

static final String DYNAMIC_SOAP_PROTOCOL
Used to create MessageFactory instances that create SOAPMessages whose concrete type is based on the Content-Type MIME header passed to the createMessage method. If no Content-Type header is passed then the createMessage may throw an IllegalArgumentException or, in the case of the no argument version of createMessage, an UnsupportedOperationException.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

SOAP_1_1_PROTOCOL

static final String SOAP_1_1_PROTOCOL
Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.1 specification.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

SOAP_1_2_PROTOCOL

static final String SOAP_1_2_PROTOCOL
Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.2 specification

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

DEFAULT_SOAP_PROTOCOL

static final String DEFAULT_SOAP_PROTOCOL
The default protocol: SOAP 1.1 for backwards compatibility.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

URI_NS_SOAP_1_1_ENVELOPE

static final String URI_NS_SOAP_1_1_ENVELOPE
The namespace identifier for the SOAP 1.1 envelope.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

URI_NS_SOAP_1_2_ENVELOPE

static final String URI_NS_SOAP_1_2_ENVELOPE
The namespace identifier for the SOAP 1.2 envelope.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

URI_NS_SOAP_ENVELOPE

static final String URI_NS_SOAP_ENVELOPE
The namespace identifier for the SOAP 1.1 envelope, All SOAPElements in this namespace are defined by the SOAP 1.1 specification.

See Also:
Constant Field Values

英文文档：

URI_NS_SOAP_ENCODING

static final String URI_NS_SOAP_ENCODING
The namespace identifier for the SOAP 1.1 encoding. An attribute named encodingStyle in the URI_NS_SOAP_ENVELOPE namespace and set to the value URI_NS_SOAP_ENCODING can be added to an element to indicate that it is encoded using the rules in section 5 of the SOAP 1.1 specification.

See Also:
Constant Field Values

英文文档：

URI_NS_SOAP_1_2_ENCODING

static final String URI_NS_SOAP_1_2_ENCODING
The namespace identifier for the SOAP 1.2 encoding.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

SOAP_1_1_CONTENT_TYPE

static final String SOAP_1_1_CONTENT_TYPE
The media type of the Content-Type MIME header in SOAP 1.1.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

SOAP_1_2_CONTENT_TYPE

static final String SOAP_1_2_CONTENT_TYPE
The media type of the Content-Type MIME header in SOAP 1.2.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

URI_SOAP_ACTOR_NEXT

static final String URI_SOAP_ACTOR_NEXT
The URI identifying the next application processing a SOAP request as the intended actor for a SOAP 1.1 header entry (see section 4.2.2 of the SOAP 1.1 specification).

This value can be passed to
SOAPHeader.examineMustUnderstandHeaderElements(String),
SOAPHeader.examineHeaderElements(String) and
SOAPHeader.extractHeaderElements(String)

See Also:
Constant Field Values

英文文档：

URI_SOAP_1_2_ROLE_NEXT

static final String URI_SOAP_1_2_ROLE_NEXT
The URI identifying the next application processing a SOAP request as the intended role for a SOAP 1.2 header entry (see section 2.2 of part 1 of the SOAP 1.2 specification).

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

URI_SOAP_1_2_ROLE_NONE

static final String URI_SOAP_1_2_ROLE_NONE
The URI specifying the role None in SOAP 1.2.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER

static final String URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER
The URI identifying the ultimate receiver of the SOAP 1.2 message.

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

SOAP_ENV_PREFIX

static final String SOAP_ENV_PREFIX
The default namespace prefix for http://www.w3.org/2003/05/soap-envelope

Since:
SAAJ 1.3
See Also:
Constant Field Values

英文文档：

SOAP_VERSIONMISMATCH_FAULT

static final QName SOAP_VERSIONMISMATCH_FAULT
SOAP 1.2 VersionMismatch Fault

Since:
SAAJ 1.3

英文文档：

SOAP_MUSTUNDERSTAND_FAULT

static final QName SOAP_MUSTUNDERSTAND_FAULT
SOAP 1.2 MustUnderstand Fault

Since:
SAAJ 1.3

英文文档：

SOAP_DATAENCODINGUNKNOWN_FAULT

static final QName SOAP_DATAENCODINGUNKNOWN_FAULT
SOAP 1.2 DataEncodingUnknown Fault

Since:
SAAJ 1.3

英文文档：

SOAP_SENDER_FAULT

static final QName SOAP_SENDER_FAULT
SOAP 1.2 Sender Fault

Since:
SAAJ 1.3

英文文档：

SOAP_RECEIVER_FAULT

static final QName SOAP_RECEIVER_FAULT
SOAP 1.2 Receiver Fault

Since:
SAAJ 1.3
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPElement (Java EE 5)

javax.xml.soap
Interface SOAPElement

All Superinterfaces:
Element, Node
All Known Subinterfaces:
Detail, DetailEntry, SOAPBody, SOAPBodyElement, SOAPEnvelope, SOAPFault, SOAPFaultElement, SOAPHeader, SOAPHeaderElement
public interface SOAPElement
extends Node, Element

Implements: Node, org.w3c.dom.Element
Implemented by: DetailEntry, SOAPBody, SOAPBodyElement, SOAPEnvelope, SOAPFaultElement, SOAPHeader, SOAPHeaderElement

表示 SOAP 规范允许使用但未特别规定的 SOAP 消息元素的对象。此接口充当 SOAP 规范特别规定的那些对象的基本接口。

此接口中要求返回特定于 SAAJ 的对象的那些方法可以“安静地”替换树中的节点，以便按要求成功返回正确类型的对象。有关详细信息，请参见 #getChildElements() 和 HREF="package-summary.html#package_description">javax.xml.soap 。

英文文档：

An object representing an element of a SOAP message that is allowed but not specifically prescribed by a SOAP specification. This interface serves as the base interface for those objects that are specifically prescribed by a SOAP specification.

Methods in this interface that are required to return SAAJ specific objects may "silently" replace nodes in the tree as required to successfully return objects of the correct type. See getChildElements() and javax.xml.soap for details.

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
SOAPElement | addAttribute(Name name, String value) Adds an attribute with the specified name and value to this SOAPElement object.
SOAPElement | addAttribute(QName qname, String value) Adds an attribute with the specified name and value to this SOAPElement object.
SOAPElement | addChildElement(Name name) Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
SOAPElement | addChildElement(QName qname) Creates a new SOAPElement object initialized with the given QName object and adds the new element to this SOAPElement object.
SOAPElement | addChildElement(SOAPElement element) Add a SOAPElement as a child of this SOAPElement instance.
SOAPElement | addChildElement(String localName) Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object.
SOAPElement | addChildElement(String localName, String prefix) Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
SOAPElement | addChildElement(String localName, String prefix, String uri) Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
SOAPElement | addNamespaceDeclaration(String prefix, String uri) Adds a namespace declaration with the specified prefix and URI to this SOAPElement object.
SOAPElement | addTextNode(String text) Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
QName | createQName(String localName, String prefix) Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.
Iterator | getAllAttributes() Returns an Iterator over all of the attribute Name objects in this SOAPElement object.
Iterator | getAllAttributesAsQNames() Returns an Iterator over all of the attributes in this SOAPElement as QName objects.
String | getAttributeValue(Name name) Returns the value of the attribute with the specified name.
String | getAttributeValue(QName qname) Returns the value of the attribute with the specified qname.
Iterator | getChildElements() Returns an Iterator over all the immediate child Nodes of this element.
Iterator | getChildElements(Name name) Returns an Iterator over all the immediate child Nodes of this element with the specified name.
Iterator | getChildElements(QName qname) Returns an Iterator over all the immediate child Nodes of this element with the specified qname.
Name | getElementName() Returns the name of this SOAPElement object.
QName | getElementQName() Returns the qname of this SOAPElement object.
String | getEncodingStyle() Returns the encoding style for this SOAPElement object.
Iterator | getNamespacePrefixes() Returns an Iterator over the namespace prefix Strings declared by this element.
String | getNamespaceURI(String prefix) Returns the URI of the namespace that has the given prefix.
Iterator | getVisibleNamespacePrefixes() Returns an Iterator over the namespace prefix Strings visible to this element.
boolean | removeAttribute(Name name) Removes the attribute with the specified name.
boolean | removeAttribute(QName qname) Removes the attribute with the specified qname.
void | removeContents() Detaches all children of this SOAPElement.
boolean | removeNamespaceDeclaration(String prefix) Removes the namespace declaration corresponding to the given prefix.
SOAPElement | setElementQName(QName newName) Changes the name of this Element to newName if possible.
void | setEncodingStyle(String encodingStyle) Sets the encoding style for this SOAPElement object to one specified.
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public SOAPElement addChildElement(Name name) throws SOAPException
创建使用给定 Name 对象初始化的新 SOAPElement 对象，并将该新元素添加到此 SOAPElement 对象。

此方法在以后的 SAAJ 版本中可能会被废弃，并用 addChildElement(javax.xml.namespace.QName) 取代。

name | Name 对象，带有新元素的 XML 名称
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时发生错误
See also | addChildElement(javax.xml.namespace.QName)
英文文档：

addChildElement

SOAPElement addChildElement(Name name)
                            throws SOAPException
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.

This method may be deprecated in a future release of SAAJ in favor of addChildElement(javax.xml.namespace.QName)

Parameters:
name - a Name object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
See Also:
addChildElement(javax.xml.namespace.QName)

public SOAPElement addChildElement(javax.xml.namespace.QName qname) throws SOAPException
创建使用给定 QName 对象初始化的新 SOAPElement 对象，并将该新元素添加到此 SOAPElement 对象。新 SOAPElement 的 namespace、localname 和 prefix 都取自 qname 参数。
qname | QName 对象，带有新元素的 XML 名称
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时发生错误
since | SAAJ 1.3
See also | addChildElement(Name)
英文文档：

addChildElement

SOAPElement addChildElement(QName qname)
                            throws SOAPException
Creates a new SOAPElement object initialized with the given QName object and adds the new element to this SOAPElement object. The namespace, localname and prefix of the new SOAPElement are all taken from the qname argument.

Parameters:
qname - a QName object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
Since:
SAAJ 1.3
See Also:
addChildElement(Name)

public SOAPElement addChildElement(String localName) throws SOAPException
创建使用指定本地名称初始化的新 SOAPElement 对象，并将该新元素添加到此 SOAPElement 对象。新的 SOAPElement 继承任何作用域内的默认名称空间。
localName | 给出元素本地名称的 String
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时发生错误
英文文档：

addChildElement

SOAPElement addChildElement(String localName)
                            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object. The new SOAPElement inherits any in-scope default namespace.

Parameters:
localName - a String giving the local name for the element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
创建使用指定本地名称和前缀初始化的新 SOAPElement 对象，并将该新元素添加到此 SOAPElement 对象。
localName | 给出新元素本地名称的 String
prefix | 给出新元素名称空间前缀的 String
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果 prefix 在此 SOAPElement 上下文中无效，或者在创建 SOAPElement 对象时发生错误
英文文档：

addChildElement

SOAPElement addChildElement(String localName,
                            String prefix)
                            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.

Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if the prefix is not valid in the context of this SOAPElement or if there is an error in creating the SOAPElement object

public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException
创建使用指定本地名称、前缀和 URI 初始化的新 SOAPElement 对象，并将该新元素添加到此 SOAPElement 对象。
localName | 给出新元素本地名称的 String
prefix | 给出新元素名称空间前缀的 String
uri | 给出新元素所属空间名称 URI 的 String
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时发生错误
英文文档：

addChildElement

SOAPElement addChildElement(String localName,
                            String prefix,
                            String uri)
                            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.

Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
uri - a String giving the URI of the namespace to which the new element belongs
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

public SOAPElement addChildElement(SOAPElement element) throws SOAPException
将 SOAPElement 作为此 SOAPElement 实例的子级添加。应该由 SOAPFactory 来创建 SOAPElement。调用者不应依靠此方式添加到 XML 树的元素实例。实现最后可以将传递的 SOAPElement 的内容复制到一个不同 SOAPElement 实现的实例中。例如，如果对 SOAPHeader 调用 addChildElement()，则 element 将被复制到 SOAPHeaderElement 的实例中。

以 element 为根的片段将作为一个整体添加，如果发生错误，则不添加。

以 element 为根的片段不能包含名为 "Envelope"、"Header" 或 "Body" 且属于 SOAP 名称空间的元素。片段中出现的任何名称空间前缀都应该使用片段本身中适当的名称空间声明来完整解析。

element | 要作为新子级添加的 SOAPElement
Throws | SOAPException: 如果在作为子级添加此元素时出现错误
return | 一个实例，表示实际添加到树的新 SOAP 元素。
英文文档：

addChildElement

SOAPElement addChildElement(SOAPElement element)
                            throws SOAPException
Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is expected to be created by a SOAPFactory. Callers should not rely on the element instance being added as is into the XML tree. Implementations could end up copying the content of the SOAPElement passed into an instance of a different SOAPElement implementation. For instance if addChildElement() is called on a SOAPHeader, element will be copied into an instance of a SOAPHeaderElement.

The fragment rooted in element is either added as a whole or not at all, if there was an error.

The fragment rooted in element cannot contain elements named "Envelope", "Header" or "Body" and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully resolved using appropriate namespace declarations within the fragment itself.

Parameters:
element - the SOAPElement to be added as a new child
Returns:
an instance representing the new SOAP element that was actually added to the tree.
Throws:
SOAPException - if there was an error in adding this element as a child

public void removeContents()
分离此 SOAPElement 的所有子级。

此方法对回滚部分完成的 SOAPHeaders 和 SOAPBodys 的构造很有用，便于准备在检测到错误条件时发送错误。它对于回收 SOAP 消息中的文档各部分也很有用。

since SAAJ 1.2
英文文档：

removeContents

void removeContents()
Detaches all children of this SOAPElement.

This method is useful for rolling back the construction of partially completed SOAPHeaders and SOAPBodys in preparation for sending a fault when an error condition is detected. It is also useful for recycling portions of a document within a SOAP message.

Since:
SAAJ 1.2

public SOAPElement addTextNode(String text) throws SOAPException
创建使用给定 String 初始化的新 Text 对象，并将其添加到此 SOAPElement 对象。
text | 带有要添加文本内容的 String 对象
return | 将插入新 Text 对象的 SOAPElement 对象
Throws | SOAPException: 如果在创建新 Text 时发生错误，或者将它作为子级附加到此 SOAPElement 不合法
英文文档：

addTextNode

SOAPElement addTextNode(String text)
                        throws SOAPException
Creates a new Text object initialized with the given String and adds it to this SOAPElement object.

Parameters:
text - a String object with the textual content to be added
Returns:
the SOAPElement object into which the new Text object was inserted
Throws:
SOAPException - if there is an error in creating the new Text object or if it is not legal to attach it as a child to this SOAPElement

public SOAPElement addAttribute(Name name, String value) throws SOAPException
将带有指定名称和值的属性添加到此 SOAPElement 对象。
name | 带有属性名称的 Name 对象
value | 给出属性值的 String
return | 将插入属性的 SOAPElement 对象
Throws | SOAPException: 如果在创建属性时发生错误，或者在此 SOAPElement 上设置带有 Name name 的属性无效。
See also | addAttribute(javax.xml.namespace.QName, String)
英文文档：

addAttribute

SOAPElement addAttribute(Name name,
                         String value)
                         throws SOAPException
Adds an attribute with the specified name and value to this SOAPElement object.

Parameters:
name - a Name object with the name of the attribute
value - a String giving the value of the attribute
Returns:
the SOAPElement object into which the attribute was inserted
Throws:
SOAPException - if there is an error in creating the Attribute, or it is invalid to set an attribute with Name name on this SOAPElement.
See Also:
addAttribute(javax.xml.namespace.QName, String)

public SOAPElement addAttribute(javax.xml.namespace.QName qname, String value) throws SOAPException
将带有指定名称和值的属性添加到此 SOAPElement 对象。
qname | 带有属性名称的 QName 对象
value | 给出属性值的 String
return | 将插入属性的 SOAPElement 对象
Throws | SOAPException: 如果在创建属性时出现错误，如果在此 SOAPElement 上设置带有 QName qname 的属性无效。
since | SAAJ 1.3
See also | addAttribute(Name, String)
英文文档：

addAttribute

SOAPElement addAttribute(QName qname,
                         String value)
                         throws SOAPException
Adds an attribute with the specified name and value to this SOAPElement object.

Parameters:
qname - a QName object with the name of the attribute
value - a String giving the value of the attribute
Returns:
the SOAPElement object into which the attribute was inserted
Throws:
SOAPException - if there is an error in creating the Attribute, or it is invalid to set an attribute with QName qname on this SOAPElement.
Since:
SAAJ 1.3
See Also:
addAttribute(Name, String)

public SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException
将带有指定前缀和 URI 的名称空间声明添加到此 SOAPElement 对象。
prefix | 给出名称空间前缀的 String
uri | 给出名称空间 URI 的 String
return | 将插入名称空间声明的 SOAPElement 对象。
Throws | SOAPException: 如果在创建名称空间时发生错误
英文文档：

addNamespaceDeclaration

SOAPElement addNamespaceDeclaration(String prefix,
                                    String uri)
                                    throws SOAPException
Adds a namespace declaration with the specified prefix and URI to this SOAPElement object.

Parameters:
prefix - a String giving the prefix of the namespace
uri - a String giving the uri of the namespace
Returns:
the SOAPElement object into which this namespace declaration was inserted.
Throws:
SOAPException - if there is an error in creating the namespace

public String getAttributeValue(Name name)
返回带有指定名称的属性值。
name | 带有属性名称的 Name 对象
return | 给出指定属性值的 String，如果没有这种属性，则返回 Null
See also | getAttributeValue(javax.xml.namespace.QName)
英文文档：

getAttributeValue

String getAttributeValue(Name name)
Returns the value of the attribute with the specified name.

Parameters:
name - a Name object with the name of the attribute
Returns:
a String giving the value of the specified attribute, Null if there is no such attribute
See Also:
getAttributeValue(javax.xml.namespace.QName)

public String getAttributeValue(javax.xml.namespace.QName qname)
返回带有指定 qname 的属性值。
qname | 带有属性 qname 的 QName 对象
return | 给出指定属性值的 String，如果没有这种属性，则返回 Null
since | SAAJ 1.3
See also | getAttributeValue(Name)
英文文档：

getAttributeValue

String getAttributeValue(QName qname)
Returns the value of the attribute with the specified qname.

Parameters:
qname - a QName object with the qname of the attribute
Returns:
a String giving the value of the specified attribute, Null if there is no such attribute
Since:
SAAJ 1.3
See Also:
getAttributeValue(Name)

public java.util.Iterator<E> getAllAttributes()
返回可在此 SOAPElement 对象中所有属性 Name 对象上进行迭代的 Iterator。迭代器可以用于获取属性名称，然后可将这些名称传递给方法 getAttributeValue 以检索每个属性的值。
return | 在属性名称上进行迭代的迭代器
See also | getAllAttributesAsQNames()
英文文档：

getAllAttributes

Iterator getAllAttributes()
Returns an Iterator over all of the attribute Name objects in this SOAPElement object. The iterator can be used to get the attribute names, which can then be passed to the method getAttributeValue to retrieve the value of each attribute.

Returns:
an iterator over the names of the attributes
See Also:
getAllAttributesAsQNames()

public java.util.Iterator<E> getAllAttributesAsQNames()
返回可在此 SOAPElement 对象（以 QName 对象的形式）中的所有属性上进行迭代的 Iterator。迭代器可以用于获取属性 QName，然后可将这些名称传递给方法 getAttributeValue 以检索每个属性的值。
return | 在属性的 QNames 上进行迭代的迭代器
since | SAAJ 1.3
See also | getAllAttributes()
英文文档：

getAllAttributesAsQNames

Iterator getAllAttributesAsQNames()
Returns an Iterator over all of the attributes in this SOAPElement as QName objects. The iterator can be used to get the attribute QName, which can then be passed to the method getAttributeValue to retrieve the value of each attribute.

Returns:
an iterator over the QNames of the attributes
Since:
SAAJ 1.3
See Also:
getAllAttributes()

public String getNamespaceURI(String prefix)
返回带有给定前缀的名称空间的 URI。
prefix | 一个 String，给出用来搜索的名称空间前缀
return | 一个 String，带有给定前缀名称空间的 URI
英文文档：

getNamespaceURI

String getNamespaceURI(String prefix)
Returns the URI of the namespace that has the given prefix.

Parameters:
prefix - a String giving the prefix of the namespace for which to search
Returns:
a String with the uri of the namespace that has the given prefix

public java.util.Iterator<E> getNamespacePrefixes()
返回可在此元素声明的名称空间前缀 String 上进行迭代的 Iterator。由此迭代器返回的前缀可以传递给方法 getNamespaceURI，以检索每个名称空间的 URI。
return 在此 SOAPElement 对象的名称空间前缀上进行迭代的迭代器
英文文档：

getNamespacePrefixes

Iterator getNamespacePrefixes()
Returns an Iterator over the namespace prefix Strings declared by this element. The prefixes returned by this iterator can be passed to the method getNamespaceURI to retrieve the URI of each namespace.

Returns:
an iterator over the namespace prefixes in this SOAPElement object

public java.util.Iterator<E> getVisibleNamespacePrefixes()
返回在此元素可见的名称空间前缀 String 上进行迭代的 Iterator。由此迭代器返回的前缀可以传递给方法 getNamespaceURI，以检索每个名称空间的 URI。
return | 在此 SOAPElement 对象作用域内的名称空间前缀上进行迭代的迭代器
since | SAAJ 1.2
英文文档：

getVisibleNamespacePrefixes

Iterator getVisibleNamespacePrefixes()
Returns an Iterator over the namespace prefix Strings visible to this element. The prefixes returned by this iterator can be passed to the method getNamespaceURI to retrieve the URI of each namespace.

Returns:
an iterator over the namespace prefixes are within scope of this SOAPElement object
Since:
SAAJ 1.2

public javax.xml.namespace.QName createQName(String localName, String prefix) throws SOAPException
创建一个 QName，其名称空间 URI 应与此 SOAPElement 上下文中的参数、prefix 相关联。新 QName 的其余元素都直接取自参数、localName 和 prefix。
localName | 包含名称本地部分的 String。
prefix | 包含名称前缀的 String。
return | 一个 QName，带有指定的 localName 和 prefix，以及与此 SOAPElement 上下文中的 prefix 关联的名称空间。如果将 prefix 作为参数提供给 #getNamespaceURI(String)，则此名称空间将与该方法返回的名称空间相同。
Throws | SOAPException: 如果无法创建 QName。
since | SAAJ 1.3
英文文档：

createQName

QName createQName(String localName,
                  String prefix)
                  throws SOAPException
Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement. The remaining elements of the new QName are taken directly from the parameters, localName and prefix.

Parameters:
localName - a String containing the local part of the name.
prefix - a String containing the prefix for the name.
Returns:
a QName with the specified localName and prefix, and with a namespace that is associated with the prefix in the context of this SOAPElement. This namespace will be the same as the one that would be returned by getNamespaceURI(String) if it were given prefix as it's parameter.
Throws:
SOAPException - if the QName cannot be created.
Since:
SAAJ 1.3

public Name getElementName()
返回此 SOAPElement 对象的名称。
return 具有此 SOAPElement 对象名称的 Name 对象
英文文档：

getElementName

Name getElementName()
Returns the name of this SOAPElement object.

Returns:
a Name object with the name of this SOAPElement object

public javax.xml.namespace.QName getElementQName()
返回此 SOAPElement 对象的 qname。
return | 具有此 SOAPElement 对象 qname 的 QName 对象
since | SAAJ 1.3
See also | getElementName()
英文文档：

getElementQName

QName getElementQName()
Returns the qname of this SOAPElement object.

Returns:
a QName object with the qname of this SOAPElement object
Since:
SAAJ 1.3
See Also:
getElementName()

public SOAPElement setElementQName(javax.xml.namespace.QName newName) throws SOAPException
如果可能，将此 Element 的名称更改为 newName。SOAP 定义的元素，如 SOAPEnvelope、SOAPHeader、SOAPBody 等，都无法使用此方法更改它们的名称。任何此类尝试都会导致抛出 SOAPException。

调用者不应依靠按此方式重命名的元素实例。实现最后可以将 SOAPElement 的内容复制到重命名实例。

newName | Element 的新名称。
Throws | SOAPException: 如果不允许更改此 Element 的名称。
return | 重命名的节点
since | SAAJ 1.3
英文文档：

setElementQName

SOAPElement setElementQName(QName newName)
                            throws SOAPException
Changes the name of this Element to newName if possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.

Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the SOAPElement to a renamed instance.

Parameters:
newName - the new name for the Element.
Returns:
The renamed Node
Throws:
SOAPException - if changing the name of this Element is not allowed.
Since:
SAAJ 1.3

public boolean removeAttribute(Name name)
移除带有指定名称的属性。
name | Name 对象，带有要移除属性的名称
return | 如果成功移除了属性，则返回 true；否则返回 false
See also | removeAttribute(javax.xml.namespace.QName)
英文文档：

removeAttribute

boolean removeAttribute(Name name)
Removes the attribute with the specified name.

Parameters:
name - the Name object with the name of the attribute to be removed
Returns:
true if the attribute was removed successfully; false if it was not
See Also:
removeAttribute(javax.xml.namespace.QName)

public boolean removeAttribute(javax.xml.namespace.QName qname)
移除带有指定 qname 的属性。
qname | QName 对象，带有要移除属性的 qname
return | 如果成功移除了属性，则返回 true；否则返回 false
since | SAAJ 1.3
See also | removeAttribute(Name)
英文文档：

removeAttribute

boolean removeAttribute(QName qname)
Removes the attribute with the specified qname.

Parameters:
qname - the QName object with the qname of the attribute to be removed
Returns:
true if the attribute was removed successfully; false if it was not
Since:
SAAJ 1.3
See Also:
removeAttribute(Name)

public boolean removeNamespaceDeclaration(String prefix)
移除对应于给定前缀的名称空间声明。
prefix | 一个 String，给出用来搜索的前缀
return | 如果成功移除了名称空间声明，则返回 true；否则返回 false
英文文档：

removeNamespaceDeclaration

boolean removeNamespaceDeclaration(String prefix)
Removes the namespace declaration corresponding to the given prefix.

Parameters:
prefix - a String giving the prefix for which to search
Returns:
true if the namespace declaration was removed successfully; false if it was not

public java.util.Iterator<E> getChildElements()
返回可在此元素的所有直接子 Node 上进行迭代的 Iterator。这包括 javax.xml.soap.Text 对象以及 SOAPElement 对象。

调用此方法可能导致子 Element、SOAPElement 和 org.w3c.dom.Text 节点被适合于此父节点类型的 SOAPElement、SOAPHeaderElement、SOAPBodyElement 或 javax.xml.soap.Text 节点替换。因此，调用的应用程序必须将任何现有的对通过 DOM API 获取的那些子节点的引用视为无效，并将其丢弃或用此 Iterator 返回的值进行更新。可以通过调用等效的 DOM API 来避免此行为。有关更多信息，请参阅 HREF="package-summary.html#package_description">javax.xml.soap 。

return 带有此 SOAPElement 对象内容的迭代器
英文文档：

getChildElements

Iterator getChildElements()
Returns an Iterator over all the immediate child Nodes of this element. This includes javax.xml.soap.Text objects as well as SOAPElement objects.

Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by SOAPElement, SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node. As a result the calling application must treat any existing references to these child nodes that have been obtained through DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator. This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.

Returns:
an iterator with the content of this SOAPElement object

public java.util.Iterator<E> getChildElements(Name name)
返回可在带有指定名称的此元素所有直接子 Node 上进行迭代的 Iterator。所有这些子节点都将是 SOAPElement 节点。

调用此方法可能导致子 Element、SOAPElement 和 org.w3c.dom.Text 节点被适合于此父节点类型的 SOAPElement、SOAPHeaderElement、SOAPBodyElement 或 javax.xml.soap.Text 节点替换。因此，调用的应用程序必须将任何现有的对通过 DOM API 获取的那些子节点的引用视为无效，并将其丢弃或用此 Iterator 返回的值进行更新。可以通过调用等效的 DOM API 来避免此行为。有关更多信息，请参阅 HREF="package-summary.html#package_description">javax.xml.soap 。

name | Name 对象，带有要返回的子元素的名称
return | 在带有指定名称的此 SOAPElement 对象的所有元素上进行迭代的 Iterator 对象
See also | getChildElements(javax.xml.namespace.QName)
英文文档：

getChildElements

Iterator getChildElements(Name name)
Returns an Iterator over all the immediate child Nodes of this element with the specified name. All of these children will be SOAPElement nodes.

Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by SOAPElement, SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node. As a result the calling application must treat any existing references to these child nodes that have been obtained through DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator. This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.

Parameters:
name - a Name object with the name of the child elements to be returned
Returns:
an Iterator object over all the elements in this SOAPElement object with the specified name
See Also:
getChildElements(javax.xml.namespace.QName)

public java.util.Iterator<E> getChildElements(javax.xml.namespace.QName qname)
返回可在带有指定 qname 的此元素所有直接子 Node 上进行迭代的 Iterator。所有这些子节点都将是 SOAPElement 节点。

调用此方法可能导致子 Element、SOAPElement 和 org.w3c.dom.Text 节点被适合于此父节点类型的 SOAPElement、SOAPHeaderElement、SOAPBodyElement 或 javax.xml.soap.Text 节点替换。因此，调用的应用程序必须将任何现有的对通过 DOM API 获取的那些子节点的引用视为无效，并将其丢弃或用此 Iterator 返回的值进行更新。可以通过调用等效的 DOM API 来避免此行为。有关更多信息，请参阅 HREF="package-summary.html#package_description">javax.xml.soap 。

qname | QName 对象，带有要返回的子元素的 qname
return | 在带有指定 qname 的此 SOAPElement 对象的所有元素上进行迭代的 Iterator 对象
since | SAAJ 1.3
See also | getChildElements(Name)
英文文档：

getChildElements

Iterator getChildElements(QName qname)
Returns an Iterator over all the immediate child Nodes of this element with the specified qname. All of these children will be SOAPElement nodes.

Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by SOAPElement, SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node. As a result the calling application must treat any existing references to these child nodes that have been obtained through DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator. This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.

Parameters:
qname - a QName object with the qname of the child elements to be returned
Returns:
an Iterator object over all the elements in this SOAPElement object with the specified qname
Since:
SAAJ 1.3
See Also:
getChildElements(Name)

public void setEncodingStyle(String encodingStyle) throws SOAPException
将此 SOAPElement 对象的编码样式设置为指定样式。
encodingStyle | 给出编码样式的 String
Throws | IllegalArgumentException: 如果在设置编码样式时出现问题。
Throws | SOAPException: 如果为此 SOAPElement 设置的编码样式无效。
See also | getEncodingStyle
英文文档：

setEncodingStyle

void setEncodingStyle(String encodingStyle)
                      throws SOAPException
Sets the encoding style for this SOAPElement object to one specified.

Parameters:
encodingStyle - a String giving the encoding style
Throws:
IllegalArgumentException - if there was a problem in the encoding style being set.
SOAPException - if setting the encodingStyle is invalid for this SOAPElement.
See Also:
getEncodingStyle()

public String getEncodingStyle()
返回此 SOAPElement 对象的编码样式。
return | 给出编码样式的 String
See also | setEncodingStyle
英文文档：

getEncodingStyle

String getEncodingStyle()
Returns the encoding style for this SOAPElement object.

Returns:
a String giving the encoding style
See Also:
setEncodingStyle(java.lang.String)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPEnvelope (Java EE 5)

javax.xml.soap
Interface SOAPEnvelope

All Superinterfaces:
Element, Node, SOAPElement
public interface SOAPEnvelope
extends SOAPElement

Implements: SOAPElement

SOAPPart 对象的 SOAPHeader 和 SOAPBody 部分的容器。默认情况下，使用带有 SOAPEnvelope 对象的 SOAPPart 对象创建 SOAPMessage 对象。SOAPEnvelope 对象默认带有空 SOAPBody 对象和空 SOAPHeader 对象。SOAPBody 对象是必需的，SOAPHeader 对象虽然是可选的，但在大多数情况下都会用到。如果不需要 SOAPHeader 对象，则可以删除该对象（稍后将显示该操作）。

客户端可以通过调用方法 SOAPEnvelope.getHeader 和 SOAPEnvelope.getBody 来访问 SOAPHeader 和 SOAPBody 对象。以下代码行首先使用 SOAPMessage 对象 message 获取 SOAPPart 对象 sp，然后使用后者获取 SOAPEnvelope 对象 se，最后调用上述的两种方法。

SOAPPart sp = message.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPHeader sh = se.getHeader();
SOAPBody sb = se.getBody();

检索 SOAPEnvelope 对象当前的正文或头，然后将其删除并添加一个新正文或头，这样就能更改该对象的正文或头。javax.xml.soap.Node 方法 deleteNode 删除调用它的 XML 元素（节点）。例如，以下代码行删除由方法 getBody 检索的 SOAPBody 对象。

se.getBody().detachNode();
要创建用来替换被移除对象的 SOAPHeader 对象，客户端应使用方法 SOAPEnvelope.addHeader，该方法创建一个新头并将其添加到 SOAPEnvelope 对象。类似地，方法 addBody 创建一个新 SOAPBody 对象并将其添加到 SOAPEnvelope 对象。以下代码片段检索当前的头，然后将其删除并添加一个新头。接下来检索当前的正文，然后将其删除并添加一个新正文。
SOAPPart sp = message.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
se.getHeader().detachNode();
SOAPHeader sh = se.addHeader();
se.getBody().detachNode();
SOAPBody sb = se.addBody();
在已经存在的情况下添加 SOAPBody 或 SOAPHeader 是错误的。

SOAPEnvelope 接口提供了三种创建 Name 对象的方法。第一种方法使用本地名称、名称空间前缀以及名称空间 URI 创建 Name 对象。第二种方法使用本地名称和名称空间前缀创建 Name 对象，第三种方法只使用本地名称创建 Name 对象。以下代码行（其中 se 是一个 SOAPEnvelope 对象）创建带有所有三个元素的新 Name 对象。

Name name = se.createName("GetLastTradePrice", "WOMBAT",
"http://www.wombat.org/trader");
英文文档：

The container for the SOAPHeader and SOAPBody portions of a SOAPPart object. By default, a SOAPMessage object is created with a SOAPPart object that has a SOAPEnvelope object. The SOAPEnvelope object by default has an empty SOAPBody object and an empty SOAPHeader object. The SOAPBody object is required, and the SOAPHeader object, though optional, is used in the majority of cases. If the SOAPHeader object is not needed, it can be deleted, which is shown later.

A client can access the SOAPHeader and SOAPBody objects by calling the methods SOAPEnvelope.getHeader and SOAPEnvelope.getBody. The following lines of code use these two methods after starting with the SOAPMessage object message to get the SOAPPart object sp, which is then used to get the SOAPEnvelope object se.

     SOAPPart sp = message.getSOAPPart();
     SOAPEnvelope se = sp.getEnvelope();
     SOAPHeader sh = se.getHeader();
     SOAPBody sb = se.getBody();

It is possible to change the body or header of a SOAPEnvelope object by retrieving the current one, deleting it, and then adding a new body or header. The javax.xml.soap.Node method deleteNode deletes the XML element (node) on which it is called. For example, the following line of code deletes the SOAPBody object that is retrieved by the method getBody.

      se.getBody().detachNode();
To create a SOAPHeader object to replace the one that was removed, a client uses the method SOAPEnvelope.addHeader, which creates a new header and adds it to the SOAPEnvelope object. Similarly, the method addBody creates a new SOAPBody object and adds it to the SOAPEnvelope object. The following code fragment retrieves the current header, removes it, and adds a new one. Then it retrieves the current body, removes it, and adds a new one.
     SOAPPart sp = message.getSOAPPart();
     SOAPEnvelope se = sp.getEnvelope();
     se.getHeader().detachNode();
     SOAPHeader sh = se.addHeader();
     se.getBody().detachNode();
     SOAPBody sb = se.addBody();
It is an error to add a SOAPBody or SOAPHeader object if one already exists.

The SOAPEnvelope interface provides three methods for creating Name objects. One method creates Name objects with a local name, a namespace prefix, and a namesapce URI. The second method creates Name objects with a local name and a namespace prefix, and the third creates Name objects with just a local name. The following line of code, in which se is a SOAPEnvelope object, creates a new Name object with all three.

     Name name = se.createName("GetLastTradePrice", "WOMBAT",
                                "http://www.wombat.org/trader");

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
SOAPBody | addBody() Creates a SOAPBody object and sets it as the SOAPBody object for this SOAPEnvelope object.
SOAPHeader | addHeader() Creates a SOAPHeader object and sets it as the SOAPHeader object for this SOAPEnvelope object.
Name | createName(String localName) Creates a new Name object initialized with the given local name.
Name | createName(String localName, String prefix, String uri) Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.
SOAPBody | getBody() Returns the SOAPBody object associated with this SOAPEnvelope object.
SOAPHeader | getHeader() Returns the SOAPHeader object for this SOAPEnvelope object.
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public Name createName(String localName, String prefix, String uri) throws SOAPException
创建使用给定本地名称、名称空间前缀和名称空间 URL 初始化的新 Name 对象。

此工厂方法创建在 SOAP/XML 文档中使用的 Name 对象。

localName | 给出本地名称的 String
prefix | 给出名称空间前缀的 String
uri | 给出名称空间 URI 的 String
return | 使用给定本地名称、名称空间前缀和名称空间 URI 初始化的 Name 对象
Throws | SOAPException: 如果存在 SOAP 错误
英文文档：

createName

Name createName(String localName,
                String prefix,
                String uri)
                throws SOAPException
Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.

This factory method creates Name objects for use in the SOAP/XML document.

Parameters:
localName - a String giving the local name
prefix - a String giving the prefix of the namespace
uri - a String giving the URI of the namespace
Returns:
a Name object initialized with the given local name, namespace prefix, and namespace URI
Throws:
SOAPException - if there is a SOAP error

public Name createName(String localName) throws SOAPException
创建使用给定本地名称初始化的新 Name 对象。

此工厂方法创建在 SOAP/XML 文档中使用的 Name 对象。

localName | 给出本地名称的 String
return | 使用给定本地名称初始化的 Name 对象
Throws | SOAPException: 如果存在 SOAP 错误
英文文档：

createName

Name createName(String localName)
                throws SOAPException
Creates a new Name object initialized with the given local name.

This factory method creates Name objects for use in the SOAP/XML document.

Parameters:
localName - a String giving the local name
Returns:
a Name object initialized with the given local name
Throws:
SOAPException - if there is a SOAP error

public SOAPHeader getHeader() throws SOAPException
返回此 SOAPEnvelope 对象的 SOAPHeader 对象。

默认情况下，使用包含空 SOAPHeader 对象的 SOAPEnvelope 对象创建新 SOAPMessage 对象。因此，只要没有移除了头且尚未添加新头，方法 getHeader 将总是返回 SOAPHeader 对象。

return | SOAPHeader 对象，如果没有该对象，则返回 null
Throws | SOAPException: 如果在获取 SOAPHeader 对象时出现问题
英文文档：

getHeader

SOAPHeader getHeader()
                     throws SOAPException
Returns the SOAPHeader object for this SOAPEnvelope object.

A new SOAPMessage object is by default created with a SOAPEnvelope object that contains an empty SOAPHeader object. As a result, the method getHeader will always return a SOAPHeader object unless the header has been removed and a new one has not been added.

Returns:
the SOAPHeader object or null if there is none
Throws:
SOAPException - if there is a problem obtaining the SOAPHeader object

public SOAPBody getBody() throws SOAPException
返回与此 SOAPEnvelope 对象关联的 SOAPBody 对象。

默认情况下，使用包含空 SOAPBody 对象的 SOAPEnvelope 对象创建 SOAPMessage 对象。因此，只要没有移除了正文且尚未添加新正文，方法 getBody 将总是返回 SOAPBody 对象。

return | 此 SOAPEnvelope 对象的 SOAPBody 的对象，如果没有该对象，则返回 null
Throws | SOAPException: 如果在获取 SOAPBody 对象时出现问题
英文文档：

getBody

SOAPBody getBody()
                 throws SOAPException
Returns the SOAPBody object associated with this SOAPEnvelope object.

A new SOAPMessage object is by default created with a SOAPEnvelope object that contains an empty SOAPBody object. As a result, the method getBody will always return a SOAPBody object unless the body has been removed and a new one has not been added.

Returns:
the SOAPBody object for this SOAPEnvelope object or null if there is none
Throws:
SOAPException - if there is a problem obtaining the SOAPBody object

public SOAPHeader addHeader() throws SOAPException
创建一个 SOAPHeader 对象，并将其设置为此 SOAPEnvelope 对象的 SOAPHeader 对象。

当信封已包含头时，添加头是非法的。因此，此方法应该在移除了现有的头之后调用。

return | 新的 SOAPHeader 对象
Throws | SOAPException: 如果此 SOAPEnvelope 对象已包含一个有效的 SOAPHeader 对象
英文文档：

addHeader

SOAPHeader addHeader()
                     throws SOAPException
Creates a SOAPHeader object and sets it as the SOAPHeader object for this SOAPEnvelope object.

It is illegal to add a header when the envelope already contains a header. Therefore, this method should be called only after the existing header has been removed.

Returns:
the new SOAPHeader object
Throws:
SOAPException - if this SOAPEnvelope object already contains a valid SOAPHeader object

public SOAPBody addBody() throws SOAPException
创建一个 SOAPBody 对象，并将其设置为此 SOAPEnvelope 对象的 SOAPBody 对象。

当信封已包含正文时，添加正文是非法的。因此，此方法应该在移除了现有的正文之后调用。

return | 新的 SOAPBody 对象
Throws | SOAPException: 如果此 SOAPEnvelope 对象已包含一个有效的 SOAPBody 对象
英文文档：

addBody

SOAPBody addBody()
                 throws SOAPException
Creates a SOAPBody object and sets it as the SOAPBody object for this SOAPEnvelope object.

It is illegal to add a body when the envelope already contains a body. Therefore, this method should be called only after the existing body has been removed.

Returns:
the new SOAPBody object
Throws:
SOAPException - if this SOAPEnvelope object already contains a valid SOAPBody object
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPFault (Java EE 5)

javax.xml.soap
Interface SOAPFault

All Superinterfaces:
Element, Node, SOAPBodyElement, SOAPElement
public interface SOAPFault
extends SOAPBodyElement

Implements: SOAPBodyElement

SOAPBody 对象中的元素，包含错误和/或状态信息。此信息可能与 SOAPMessage 对象中的错误相关，也可能与和消息本身的内容无关的问题相关。与消息本身无关的问题通常是处理过程中的错误，如无法与上游服务器通信。

SOAPFault 具有 SOAP 1.1 或 SOAP 1.2 规范中定义的子元素，具体取决于创建 MessageFactory 实例时指定的 protocol。

英文文档：

An element in the SOAPBody object that contains error and/or status information. This information may relate to errors in the SOAPMessage object or to problems that are not related to the content in the message itself. Problems not related to the message itself are generally errors in processing, such as the inability to communicate with an upstream server.

Depending on the protocol specified while creating the MessageFactory instance, a SOAPFault has sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification.

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Detail | addDetail() Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.
void | addFaultReasonText(String text, Locale locale) Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale.
void | appendFaultSubcode(QName subcode) Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault.
Detail | getDetail() Returns the optional detail element for this SOAPFault object.
String | getFaultActor() Gets the fault actor for this SOAPFault object.
String | getFaultCode() Gets the fault code for this SOAPFault object.
Name | getFaultCodeAsName() Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object.
QName | getFaultCodeAsQName() Gets the fault code for this SOAPFault object as a QName object.
String | getFaultNode() Returns the optional Node element value for this SOAPFault object.
Iterator | getFaultReasonLocales() Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items.
String | getFaultReasonText(Locale locale) Returns the Reason Text associated with the given Locale.
Iterator | getFaultReasonTexts() Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.
String | getFaultRole() Returns the optional Role element value for this SOAPFault object.
String | getFaultString() Gets the fault string for this SOAPFault object.
Locale | getFaultStringLocale() Gets the locale of the fault string for this SOAPFault object.
Iterator | getFaultSubcodes() Gets the Subcodes for this SOAPFault as an iterator over QNames.
boolean | hasDetail() Returns true if this SOAPFault has a Detail subelement and false otherwise.
void | removeAllFaultSubcodes() Removes any Subcodes that may be contained by this SOAPFault.
void | setFaultActor(String faultActor) Sets this SOAPFault object with the given fault actor.
void | setFaultCode(Name faultCodeQName) Sets this SOAPFault object with the given fault code.
void | setFaultCode(QName faultCodeQName) Sets this SOAPFault object with the given fault code.
void | setFaultCode(String faultCode) Sets this SOAPFault object with the give fault code.
void | setFaultNode(String uri) Creates or replaces any existing Node element value for this SOAPFault object.
void | setFaultRole(String uri) Creates or replaces any existing Role element value for this SOAPFault object.
void | setFaultString(String faultString) Sets the fault string for this SOAPFault object to the given string.
void | setFaultString(String faultString, Locale locale) Sets the fault string for this SOAPFault object to the given string and localized to the given locale.
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public void setFaultCode(Name faultCodeQName) throws SOAPException
使用给定的错误代码设置此 SOAPFault 对象。

给出有关错误信息的错误代码是在 SOAP 1.1 规范中定义的。错误代码是强制性的 (mandatory)，必须是 QName 类型。此方法提供设置错误代码的便捷方式。例如，

SOAPEnvelope se = ...;
// Create a qualified name in the SOAP namespace with a localName
// of "Client".Note that prefix parameter is optional and is null
// here which causes the implementation to use an appropriate prefix.
Name qname = se.createName("Client", null,
SOAPConstants.URI_NS_SOAP_ENVELOPE);
SOAPFault fault = ...;
fault.setFaultCode(qname);
相比 #setFaultCode(String) 方法，最好优先使用此方法。
faultCodeQName | 给出要设置的错误代码的 Name 对象。它必须是限定于名称空间的。
Throws | SOAPException: 如果在将 faultcode 元素添加到底层 XML 树时出现错误。
since | SAAJ 1.2
See also | getFaultCodeAsName
英文文档：

setFaultCode

void setFaultCode(Name faultCodeQName)
                  throws SOAPException
Sets this SOAPFault object with the given fault code.

Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification. A fault code is mandatory and must be of type Name. This method provides a convenient way to set a fault code. For example,

 SOAPEnvelope se = ...;
 // Create a qualified name in the SOAP namespace with a localName
 // of "Client". Note that prefix parameter is optional and is null
 // here which causes the implementation to use an appropriate prefix.
 Name qname = se.createName("Client", null,
                            SOAPConstants.URI_NS_SOAP_ENVELOPE);
 SOAPFault fault = ...;
 fault.setFaultCode(qname);
It is preferable to use this method over setFaultCode(String).

Parameters:
faultCodeQName - a Name object giving the fault code to be set. It must be namespace qualified.
Throws:
SOAPException - if there was an error in adding the faultcode element to the underlying XML tree.
Since:
SAAJ 1.2
See Also:
getFaultCodeAsName()

public void setFaultCode(javax.xml.namespace.QName faultCodeQName) throws SOAPException
使用给定的错误代码设置此 SOAPFault 对象。相比 #setFaultCode(Name) 方法，最好优先使用此方法。
faultCodeQName | 提供要设置的错误代码的 QName 对象。它必须是限定于名称空间的。
Throws | SOAPException: 如果在将 faultcode 元素添加到底层 XML 树时出现错误。
since | SAAJ 1.3
See also | getFaultCodeAsQName, setFaultCode(Name), getFaultCodeAsQName()
英文文档：

setFaultCode

void setFaultCode(QName faultCodeQName)
                  throws SOAPException
Sets this SOAPFault object with the given fault code. It is preferable to use this method over setFaultCode(Name).

Parameters:
faultCodeQName - a QName object giving the fault code to be set. It must be namespace qualified.
Throws:
SOAPException - if there was an error in adding the faultcode element to the underlying XML tree.
Since:
SAAJ 1.3
See Also:
getFaultCodeAsQName(), setFaultCode(Name), getFaultCodeAsQName()

public void setFaultCode(String faultCode) throws SOAPException
使用给定的错误代码设置此 SOAPFault 对象。

给出有关错误信息的错误代码是在 SOAP 1.1 规范中定义的。此元素在 SOAP 1.1 中是强制性的。因为错误代码要求是 QName，所以最好使用此方法的 #setFaultCode(Name) 形式。

faultCode | 提供要设置的错误代码的 String。它必须是 "prefix:localName" 形式，其中前缀是用名称空间声明定义的。
Throws | SOAPException: 如果在将 faultCode 添加到底层 XML 树时出现错误。
See also | setFaultCode(Name), getFaultCode, addNamespaceDeclaration
英文文档：

setFaultCode

void setFaultCode(String faultCode)
                  throws SOAPException
Sets this SOAPFault object with the give fault code.

Fault codes, which given information about the fault, are defined in the SOAP 1.1 specification. This element is mandatory in SOAP 1.1. Because the fault code is required to be a QName it is preferable to use the setFaultCode(Name) form of this method.

Parameters:
faultCode - a String giving the fault code to be set. It must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.
Throws:
SOAPException - if there was an error in adding the faultCode to the underlying XML tree.
See Also:
setFaultCode(Name), getFaultCode(), SOAPElement.addNamespaceDeclaration(java.lang.String, java.lang.String)

public Name getFaultCodeAsName()
以 SAAJ Name 对象形式获取此 SOAPFault 对象的强制性 SOAP 1.1 错误代码。SOAP 1.1 规范要求 "faultcode" 元素的值为 QName 类型。此方法以 SAAJ Name 对象的形式返回 QName 形式的元素内容。应该使用此方法来代替 getFaultCode 方法，因为它允许应用程序方便地访问名称空间名，而不需要其他解析。
return | 表示错误代码的 Name
since | SAAJ 1.2
See also | setFaultCode(Name)
英文文档：

getFaultCodeAsName

Name getFaultCodeAsName()
Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object. The SOAP 1.1 specification requires the value of the "faultcode" element to be of type QName. This method returns the content of the element as a QName in the form of a SAAJ Name object. This method should be used instead of the getFaultCode method since it allows applications to easily access the namespace name without additional parsing.

Returns:
a Name representing the faultcode
Since:
SAAJ 1.2
See Also:
setFaultCode(Name)

public javax.xml.namespace.QName getFaultCodeAsQName()
以 QName 对象形式获取此 SOAPFault 对象的错误代码。
return | 表示错误代码的 QName
since | SAAJ 1.3
See also | setFaultCode(QName)
英文文档：

getFaultCodeAsQName

QName getFaultCodeAsQName()
Gets the fault code for this SOAPFault object as a QName object.

Returns:
a QName representing the faultcode
Since:
SAAJ 1.3
See Also:
setFaultCode(QName)

public java.util.Iterator<E> getFaultSubcodes()
以 QNames 迭代器形式获取此 SOAPFault 的 Subcode。
return | 访问 QNames 序列的 Iterator 此 Iterator 不应支持可选的 remove 方法。Subcode 返回的顺序反映了 Subcode 在错误代码中从上到下的层次结构。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。
since | SAAJ 1.3
英文文档：

getFaultSubcodes

Iterator getFaultSubcodes()
Gets the Subcodes for this SOAPFault as an iterator over QNames.

Returns:
an Iterator that accesses a sequence of QNames. This Iterator should not support the optional remove method. The order in which the Subcodes are returned reflects the hierarchy of Subcodes present in the fault from top to bottom.
Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Subcode.
Since:
SAAJ 1.3

public void removeAllFaultSubcodes()
移除此 SOAPFault 可能包含的任何 Subcode。在调用 appendFaultSubcode 之前，对 getFaultSubcodes 的后续调用将返回空迭代器。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。
since | SAAJ 1.3
英文文档：

removeAllFaultSubcodes

void removeAllFaultSubcodes()
Removes any Subcodes that may be contained by this SOAPFault. Subsequent calls to getFaultSubcodes will return an empty iterator until a call to appendFaultSubcode is made.

Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Subcode.
Since:
SAAJ 1.3

public void appendFaultSubcode(javax.xml.namespace.QName subcode) throws SOAPException
将 Subcode 添加到此 SOAPFault 包含的 Subcode 序列的末尾。SOAP 1.2 中引入的 Subcode 由递归子元素序列表示，该序列由 SOAP Fault 的强制 Code 子元素排列形成。
subcode | 包含 Subcode 值的 QName。
Throws | SOAPException: 如果在设置 Subcode 时出现错误
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。
since | SAAJ 1.3
英文文档：

appendFaultSubcode

void appendFaultSubcode(QName subcode)
                        throws SOAPException
Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault. Subcodes, which were introduced in SOAP 1.2, are represented by a recursive sequence of subelements rooted in the mandatory Code subelement of a SOAP Fault.

Parameters:
subcode - a QName containing the Value of the Subcode.
Throws:
SOAPException - if there was an error in setting the Subcode
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Subcode.
Since:
SAAJ 1.3

public String getFaultCode()
获取此 SOAPFault 对象的错误代码。
return | 带有错误代码的 String
See also | getFaultCodeAsName, setFaultCode
英文文档：

getFaultCode

String getFaultCode()
Gets the fault code for this SOAPFault object.

Returns:
a String with the fault code
See Also:
getFaultCodeAsName(), setFaultCode(javax.xml.soap.Name)

public void setFaultActor(String faultActor) throws SOAPException
使用给定的错误参与者 (actor) 设置此 SOAPFault 对象。

错误参与者是消息路径中导致发生错误的接收方。

如果此 SOAPFault 支持 SOAP 1.2，则此调用等效于 #setFaultRole(String)

faultActor | 一个 String，标识导致此 SOAPFault 对象的参与者
Throws | SOAPException: 如果在将 faultActor 添加到底层 XML 树时出现错误。
See also | getFaultActor
英文文档：

setFaultActor

void setFaultActor(String faultActor)
                   throws SOAPException
Sets this SOAPFault object with the given fault actor.

The fault actor is the recipient in the message path who caused the fault to happen.

If this SOAPFault supports SOAP 1.2 then this call is equivalent to setFaultRole(String)

Parameters:
faultActor - a String identifying the actor that caused this SOAPFault object
Throws:
SOAPException - if there was an error in adding the faultActor to the underlying XML tree.
See Also:
getFaultActor()

public String getFaultActor()
获取此 SOAPFault 对象的错误参与者。

如果此 SOAPFault 支持 SOAP 1.2，那么此调用等效于 #getFaultRole()。

return | 一个 String，给出消息路径中导致此 SOAPFault 对象的参与者
See also | setFaultActor
英文文档：

getFaultActor

String getFaultActor()
Gets the fault actor for this SOAPFault object.

If this SOAPFault supports SOAP 1.2 then this call is equivalent to getFaultRole()

Returns:
a String giving the actor in the message path that caused this SOAPFault object
See Also:
setFaultActor(java.lang.String)

public void setFaultString(String faultString) throws SOAPException
将此 SOAPFault 对象的错误字符串设定为给定字符串。

如果此 SOAPFault 是支持 SOAP 1.2 的消息的一部分，则此调用等效于：

addFaultReasonText(faultString, Locale.getDefault());

faultString | 一个 String，给出对错误的解释
Throws | SOAPException: 如果在将 faultString 添加到底层 XML 树时出现错误。
See also | getFaultString
英文文档：

setFaultString

void setFaultString(String faultString)
                    throws SOAPException
Sets the fault string for this SOAPFault object to the given string.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

      addFaultReasonText(faultString, Locale.getDefault());

Parameters:
faultString - a String giving an explanation of the fault
Throws:
SOAPException - if there was an error in adding the faultString to the underlying XML tree.
See Also:
getFaultString()

public void setFaultString(String faultString, java.util.Locale locale) throws SOAPException
将此 SOAPFault 对象的错误字符串设定为给定字符串，并本地化为给定语言环境。

如果此 SOAPFault 是支持 SOAP 1.2 的消息的一部分，则此调用等效于：

addFaultReasonText(faultString, locale);

faultString | 一个 String，给出对错误的解释
locale | 一个 Locale 对象，指示 faultString 的本地语言
Throws | SOAPException: 如果在将 faultString 添加到底层 XML 树时出现错误。
since | SAAJ 1.2
See also | getFaultString
英文文档：

setFaultString

void setFaultString(String faultString,
                    Locale locale)
                    throws SOAPException
Sets the fault string for this SOAPFault object to the given string and localized to the given locale.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

      addFaultReasonText(faultString, locale);

Parameters:
faultString - a String giving an explanation of the fault
locale - a Locale object indicating the native language of the faultString
Throws:
SOAPException - if there was an error in adding the faultString to the underlying XML tree.
Since:
SAAJ 1.2
See Also:
getFaultString()

public String getFaultString()
获取此 SOAPFault 对象的错误字符串。

如果此 SOAPFault 是支持 SOAP 1.2 的消息的一部分，则此调用等效于：

String reason = null;
try {
reason = (String) getFaultReasonTexts().next();
} catch (SOAPException e) {}
return reason;

return | 一个 String，给出对错误的解释
See also | setFaultString(String), setFaultString(String, Locale)
英文文档：

getFaultString

String getFaultString()
Gets the fault string for this SOAPFault object.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

    String reason = null;
    try {
        reason = (String) getFaultReasonTexts().next();
    } catch (SOAPException e) {}
    return reason;

Returns:
a String giving an explanation of the fault
See Also:
setFaultString(String), setFaultString(String, Locale)

public java.util.Locale getFaultStringLocale()
获取此 SOAPFault 对象错误字符串的语言环境。

如果此 SOAPFault 是支持 SOAP 1.2 的消息的一部分，则此调用等效于：

Locale locale = null;
try {
locale = (Locale) getFaultReasonLocales().next();
} catch (SOAPException e) {}
return locale;

return | 一个 Locale 对象，指示默认字符串的本地语言，如果没有指定语言环境，则返回 null
since | SAAJ 1.2
See also | setFaultString(String, Locale)
英文文档：

getFaultStringLocale

Locale getFaultStringLocale()
Gets the locale of the fault string for this SOAPFault object.

If this SOAPFault is part of a message that supports SOAP 1.2 then this call is equivalent to:

    Locale locale = null;
    try {
        locale = (Locale) getFaultReasonLocales().next();
    } catch (SOAPException e) {}
    return locale;

Returns:
a Locale object indicating the native language of the fault string or null if no locale was specified
Since:
SAAJ 1.2
See Also:
setFaultString(String, Locale)

public boolean hasDetail()
如果此 SOAPFault 有一个 Detail 子元素，则返回 true，否则返回 false。与 (getDetail()!=null) 等效。
return | 如果此 SOAPFault 有一个 Detail 子元素，则返回 true，否则返回 false。
since | SAAJ 1.3
英文文档：

hasDetail

boolean hasDetail()
Returns true if this SOAPFault has a Detail subelement and false otherwise. Equivalent to (getDetail()!=null).

Returns:
true if this SOAPFault has a Detail subelement and false otherwise.
Since:
SAAJ 1.3

public Detail getDetail()
返回此 SOAPFault 对象的可选 detail 元素。

Detail 对象携带了特定于应用程序的错误信息，如果该错误信息是 SOAP 1.1 Fault，则其范围限于 SOAPBodyElement 对象中的错误。

return 带有特定于应用程序的错误信息的 Detail 对象（如果存在）；如果不存在此类对象，则返回 null。
英文文档：

getDetail

Detail getDetail()
Returns the optional detail element for this SOAPFault object.

A Detail object carries application-specific error information, the scope of the error information is restricted to faults in the SOAPBodyElement objects if this is a SOAP 1.1 Fault.

Returns:
a Detail object with application-specific error information if present, null otherwise

public Detail addDetail() throws SOAPException
创建可选的 Detail 对象，并将其设置为此 SOAPFault 对象的 Detail 对象。

当错误已包含详细信息时，添加详细信息是非法的。因此，此方法应该在移除了现有的详细信息之后调用。

return | 新的 Detail 对象
Throws | SOAPException: 如果此 SOAPFault 对象已包含一个有效的 Detail 对象
英文文档：

addDetail

Detail addDetail()
                 throws SOAPException
Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.

It is illegal to add a detail when the fault already contains a detail. Therefore, this method should be called only after the existing detail has been removed.

Returns:
the new Detail object
Throws:
SOAPException - if this SOAPFault object already contains a valid Detail object

public java.util.Iterator<E> getFaultReasonLocales() throws SOAPException
返回一个 Iterator，它可以在与 Reason Text 项关联的 Locale 独特序列上进行迭代。这些 Locale 都可以用于对 getFaultReasonText 的调用，以便获取 Reason Text 字符串的本地化版本。
return | 一个 Iterator，可在与 Reason Text 项关联的 Locale 对象序列上进行迭代。
Throws | SOAPException: 如果检索错误 Reason 语言环境时出现错误。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
since | SAAJ 1.3
英文文档：

getFaultReasonLocales

Iterator getFaultReasonLocales()
                               throws SOAPException
Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items. Any of these Locales can be used in a call to getFaultReasonText in order to obtain a localized version of the Reason Text string.

Returns:
an Iterator over a sequence of Locale objects for which there are associated Reason Text items.
Throws:
SOAPException - if there was an error in retrieving the fault Reason locales.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
Since:
SAAJ 1.3

public java.util.Iterator<E> getFaultReasonTexts() throws SOAPException
返回一个 Iterator，它可以在包含此 SOAPFault 所有 Reason Text 项的 String 对象序列上进行迭代。
return | 一个 Iterator，可在 env:Fault/env:Reason/env:Text 项上进行迭代。
Throws | SOAPException: 如果检索错误 Reason 文本时出现错误。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
since | SAAJ 1.3
英文文档：

getFaultReasonTexts

Iterator getFaultReasonTexts()
                             throws SOAPException
Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.

Returns:
an Iterator over env:Fault/env:Reason/env:Text items.
Throws:
SOAPException - if there was an error in retrieving the fault Reason texts.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
Since:
SAAJ 1.3

public String getFaultReasonText(java.util.Locale locale) throws SOAPException
返回与给定 Locale 关联的 Reason Text。如果存在一个以上这种 Reason Text，则返回第一个与 Text 匹配的 Reason Text。
locale | 本地化 Reason Text 时需要的 Locale
return | 与 locale 关联的 Reason Text
Throws | SOAPException: 如果针对指定语言环境检索错误 Reason 文本时出现错误。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
since | SAAJ 1.3
See also | getFaultString
英文文档：

getFaultReasonText

String getFaultReasonText(Locale locale)
                          throws SOAPException
Returns the Reason Text associated with the given Locale. If more than one such Reason Text exists the first matching Text is returned

Parameters:
locale - -- the Locale for which a localized Reason Text is desired
Returns:
the Reason Text associated with locale
Throws:
SOAPException - if there was an error in retrieving the fault Reason text for the specified locale .
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
Since:
SAAJ 1.3
See Also:
getFaultString()

public void addFaultReasonText(String text, java.util.Locale locale) throws SOAPException
追加或替换包含指定文本消息的 Reason Text 项，以及从 locale 派生的 xml:lang。如果已经存在带有此 xml:lang 的 Reason Text 项，则其文本值将被 text 替换。locale 参数不应为 null。

代码示例：

SOAPFault fault = ...;
fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);

text | 原因消息字符串
locale | 表示消息语言环境的 Locale 对象
Throws | SOAPException: 如果在添加 Reason 文本时出现错误，或者传递的 locale 为 null。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
since | SAAJ 1.3
英文文档：

addFaultReasonText

void addFaultReasonText(String text,
                        Locale locale)
                        throws SOAPException
Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale. If a Reason Text item with this xml:lang already exists its text value will be replaced with text. The locale parameter should not be null

Code sample:

 SOAPFault fault = ...;
 fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);

Parameters:
text - -- reason message string
locale - -- Locale object representing the locale of the message
Throws:
SOAPException - if there was an error in adding the Reason text or the locale passed was null.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Reason.
Since:
SAAJ 1.3

public String getFaultNode()
返回此 SOAPFault 对象的可选 Node 元素值。Node 元素在 SOAP 1.2 中是可选的。
return | String 形式的 env:Fault/env:Node 元素的内容，如果没有此类内容，则返回 null
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Node。
since | SAAJ 1.3
英文文档：

getFaultNode

String getFaultNode()
Returns the optional Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2.

Returns:
Content of the env:Fault/env:Node element as a String or null if none
Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Node.
Since:
SAAJ 1.3

public void setFaultNode(String uri) throws SOAPException
创建或替换此 SOAPFault 对象的任何现有 Node 元素。Node 元素在 SOAP 1.2 中是可选的。
Throws | SOAPException: 如果在设置此 SOAPFault 对象的 Node 时出现错误。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Node。
since | SAAJ 1.3
英文文档：

setFaultNode

void setFaultNode(String uri)
                  throws SOAPException
Creates or replaces any existing Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2.

Throws:
SOAPException - if there was an error in setting the Node for this SOAPFault object.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Node.
Since:
SAAJ 1.3

public String getFaultRole()
返回此 SOAPFault 对象的可选 Role 元素值。Role 元素在 SOAP 1.2 中是可选的。
return | String 形式的 env:Fault/env:Role 元素的内容，如果没有此类内容，则返回 null
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
since | SAAJ 1.3
英文文档：

getFaultRole

String getFaultRole()
Returns the optional Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2.

Returns:
Content of the env:Fault/env:Role element as a String or null if none
Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
Since:
SAAJ 1.3

public void setFaultRole(String uri) throws SOAPException
创建或替换此 SOAPFault 对象的任何现有 Role 元素。Role 元素在 SOAP 1.2 中是可选的。
uri | Role 的 URI
Throws | SOAPException: 如果在设置此 SOAPFault 对象的 Role 时出现错误。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
since | SAAJ 1.3
英文文档：

setFaultRole

void setFaultRole(String uri)
                  throws SOAPException
Creates or replaces any existing Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2.

Parameters:
uri - - the URI of the Role
Throws:
SOAPException - if there was an error in setting the Role for this SOAPFault object.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
Since:
SAAJ 1.3
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPFaultElement (Java EE 5)

javax.xml.soap
Interface SOAPFaultElement

All Superinterfaces:
Element, Node, SOAPElement
All Known Subinterfaces:
Detail
public interface SOAPFaultElement
extends SOAPElement

Implements: SOAPElement
Implemented by: Detail

SOAPFault 对象内容的表示形式。Detail 接口是一个 SOAPFaultElement。

使用 SOAPElement 的 addTextNode 方法向 SOAPFaultElement 添加内容。

英文文档：

A representation of the contents in a SOAPFault object. The Detail interface is a SOAPFaultElement.

Content is added to a SOAPFaultElement using the SOAPElement method addTextNode.

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPHeader (Java EE 5)

javax.xml.soap
Interface SOAPHeader

All Superinterfaces:
Element, Node, SOAPElement
public interface SOAPHeader
extends SOAPElement

Implements: SOAPElement

SOAP 头元素的表示形式。SOAP 头元素由能影响消息提供者处理特定于应用程序内容的方式的 XML 数据组成。例如，事务语义、验证信息等，都可以被指定为 SOAPHeader 对象的内容。

SOAPEnvelope 对象默认包含一个空 SOAPHeader 对象。如果不需要 SOAPHeader 对象（可选），则可以使用以下代码行检索和删除该对象。变量 se 是一个 SOAPEnvelope 对象。

se.getHeader().detachNode();
SOAPHeader 对象是使用 SOAPEnvelope 的 addHeader 方法创建的。只有在移除现有的头之后，才能调用此方法创建新头并将其添加到信封中。
se.getHeader().detachNode();
SOAPHeader sh = se.addHeader();

SOAPHeader 对象只能将 SOAPHeaderElement 对象作为其直接子级。方法 addHeaderElement 创建一个新 HeaderElement 对象并将其添加到 SOAPHeader 对象。在以下代码行中，方法 addHeaderElement 的参数是一个 Name 对象，该对象是新 HeaderElement 对象的名称。

SOAPHeaderElement shElement = sh.addHeaderElement(name);
See also javax.xml.soap.SOAPHeaderElement
英文文档：

A representation of the SOAP header element. A SOAP header element consists of XML data that affects the way the application-specific content is processed by the message provider. For example, transaction semantics, authentication information, and so on, can be specified as the content of a SOAPHeader object.

A SOAPEnvelope object contains an empty SOAPHeader object by default. If the SOAPHeader object, which is optional, is not needed, it can be retrieved and deleted with the following line of code. The variable se is a SOAPEnvelope object.

      se.getHeader().detachNode();
A SOAPHeader object is created with the SOAPEnvelope method addHeader. This method, which creates a new header and adds it to the envelope, may be called only after the existing header has been removed.
      se.getHeader().detachNode();
      SOAPHeader sh = se.addHeader();

A SOAPHeader object can have only SOAPHeaderElement objects as its immediate children. The method addHeaderElement creates a new HeaderElement object and adds it to the SOAPHeader object. In the following line of code, the argument to the method addHeaderElement is a Name object that is the name for the new HeaderElement object.

      SOAPHeaderElement shElement = sh.addHeaderElement(name);

See Also:
SOAPHeaderElement

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
SOAPHeaderElement | addHeaderElement(Name name) Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
SOAPHeaderElement | addHeaderElement(QName qname) Creates a new SOAPHeaderElement object initialized with the specified qname and adds it to this SOAPHeader object.
SOAPHeaderElement | addNotUnderstoodHeaderElement(QName name) Creates a new NotUnderstood SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
SOAPHeaderElement | addUpgradeHeaderElement(Iterator supportedSOAPURIs) Creates a new Upgrade SOAPHeaderElement object initialized with the specified List of supported SOAP URIs and adds it to this SOAPHeader object.
SOAPHeaderElement | addUpgradeHeaderElement(String supportedSoapUri) Creates a new Upgrade SOAPHeaderElement object initialized with the specified supported SOAP URI and adds it to this SOAPHeader object.
SOAPHeaderElement | addUpgradeHeaderElement(String[] supportedSoapUris) Creates a new Upgrade SOAPHeaderElement object initialized with the specified array of supported SOAP URIs and adds it to this SOAPHeader object.
Iterator | examineAllHeaderElements() Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.
Iterator | examineHeaderElements(String actor) Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor.
Iterator | examineMustUnderstandHeaderElements(String actor) Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.
Iterator | extractAllHeaderElements() Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object and detaches them from this SOAPHeader object.
Iterator | extractHeaderElements(String actor) Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and detaches them from this SOAPHeader object.
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException
创建使用指定名称初始化的新的 SOAPHeaderElement 对象，并将其添加到此 SOAPHeader 对象。
name | 带有新 SOAPHeaderElement 对象名称的 Name 对象
return | 插入此 SOAPHeader 对象的新的 SOAPHeaderElement 对象
Throws | SOAPException: 如果发生 SOAP 错误
See also | addHeaderElement(javax.xml.namespace.QName)
英文文档：

addHeaderElement

SOAPHeaderElement addHeaderElement(Name name)
                                   throws SOAPException
Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.

Parameters:
name - a Name object with the name of the new SOAPHeaderElement object
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs
See Also:
addHeaderElement(javax.xml.namespace.QName)

public SOAPHeaderElement addHeaderElement(javax.xml.namespace.QName qname) throws SOAPException
创建使用指定 qname 初始化的新的 SOAPHeaderElement 对象，并将其添加到此 SOAPHeader 对象。
qname | 带有新 SOAPHeaderElement 对象 qname 的 QName 对象
return | 插入此 SOAPHeader 对象的新的 SOAPHeaderElement 对象
Throws | SOAPException: 如果发生 SOAP 错误
since | SAAJ 1.3
See also | addHeaderElement(Name)
英文文档：

addHeaderElement

SOAPHeaderElement addHeaderElement(QName qname)
                                   throws SOAPException
Creates a new SOAPHeaderElement object initialized with the specified qname and adds it to this SOAPHeader object.

Parameters:
qname - a QName object with the qname of the new SOAPHeaderElement object
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs
Since:
SAAJ 1.3
See Also:
addHeaderElement(Name)

public java.util.Iterator<E> examineMustUnderstandHeaderElements(String actor)
返回可在此 SOAPHeader 对象中所有符合以下条件的 SOAPHeaderElement 对象上进行迭代的 Iterator：具有指定的 actor 以及一个值等于 true 的 MustUnderstand 属性。

在 SOAP 1.2 中，env:actor 属性应替换为 env:role 属性，但实质上语义是相同的。

actor | 一个 String，给出要搜索的 actor/role 的 URI
return | 一个 Iterator 对象，可在所有符合以下条件的 SOAPHeaderElement 对象上进行迭代：包含指定的 actor / role 并标记为 MustUnderstand
since | SAAJ 1.2
See also | examineHeaderElements, extractHeaderElements, URI_SOAP_ACTOR_NEXT
英文文档：

examineMustUnderstandHeaderElements

Iterator examineMustUnderstandHeaderElements(String actor)
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.

In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.

Parameters:
actor - a String giving the URI of the actor / role for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects that contain the specified actor / role and are marked as MustUnderstand
Since:
SAAJ 1.2
See Also:
examineHeaderElements(java.lang.String), extractHeaderElements(java.lang.String), SOAPConstants.URI_SOAP_ACTOR_NEXT

public java.util.Iterator<E> examineHeaderElements(String actor)
返回可在此 SOAPHeader 对象中具有指定的 actor 的 SOAPHeaderElement 对象上进行迭代的 Iterator。actor 是一个全局属性，指示消息到达其最终接收者之前应对该消息进行处理的中间参与方。actor 接收并处理消息，然后将该消息发送到下一个 actor。默认 actor 是消息的最终预定接收方，所以如果 SOAPHeader 对象中没有包括 actor 属性，那么 message 将与消息正文一起发送到最终接收者。

在 SOAP 1.2 中，env:actor 属性应替换为 env:role 属性，但实质上语义是相同的。

actor | 一个 String，给出要搜索的 actor/role 的 URI
return | 一个 Iterator 对象，可在所有包含指定 actor / role 的 SOAPHeaderElement 对象上进行迭代
See also | extractHeaderElements, URI_SOAP_ACTOR_NEXT
英文文档：

examineHeaderElements

Iterator examineHeaderElements(String actor)
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor. An actor is a global attribute that indicates the intermediate parties that should process a message before it reaches its ultimate receiver. An actor receives the message and processes it before sending it on to the next actor. The default actor is the ultimate intended recipient for the message, so if no actor attribute is included in a SOAPHeader object, it is sent to the ultimate receiver along with the message body.

In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.

Parameters:
actor - a String giving the URI of the actor / role for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects that contain the specified actor / role
See Also:
extractHeaderElements(java.lang.String), SOAPConstants.URI_SOAP_ACTOR_NEXT

public java.util.Iterator<E> extractHeaderElements(String actor)
返回可在此 SOAPHeader 对象中所有具有指定 actor 的 SOAPHeaderElement 对象上进行迭代的 Iterator，并将这些 SOAPHeaderElement 对象从此 SOAPHeader 对象中分离出来。

此方法允许 actor 处理并移除适用于它的 SOAPHeader 对象部分，然后将该消息发送到下一个 actor。

在 SOAP 1.2 中，env:actor 属性应替换为 env:role 属性，但实质上语义是相同的。

actor | 一个 String，给出要搜索的 actor/role 的 URI
return | 一个 Iterator 对象，可在所有包含指定 actor / role 的 SOAPHeaderElement 对象上进行迭代
See also | examineHeaderElements, URI_SOAP_ACTOR_NEXT
英文文档：

extractHeaderElements

Iterator extractHeaderElements(String actor)
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and detaches them from this SOAPHeader object.

This method allows an actor to process the parts of the SOAPHeader object that apply to it and to remove them before passing the message on to the next actor.

In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.

Parameters:
actor - a String giving the URI of the actor / role for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects that contain the specified actor / role
See Also:
examineHeaderElements(java.lang.String), SOAPConstants.URI_SOAP_ACTOR_NEXT

public SOAPHeaderElement addNotUnderstoodHeaderElement(javax.xml.namespace.QName name) throws SOAPException
创建使用指定名称初始化的新的 NotUnderstood SOAPHeaderElement 对象，并将其添加到此 SOAPHeader 对象。只有 SOAP 1.2 支持此操作。
name | 带有不可理解的 SOAPHeaderElement 对象名称的 QName 对象。
return | 插入此 SOAPHeader 对象的新的 SOAPHeaderElement 对象
Throws | SOAPException: 如果发生 SOAP 错误。
Throws | UnsupportedOperationException: 如果这是一个 SOAP 1.1 Header。
since | SAAJ 1.3
英文文档：

addNotUnderstoodHeaderElement

SOAPHeaderElement addNotUnderstoodHeaderElement(QName name)
                                                throws SOAPException
Creates a new NotUnderstood SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object. This operation is supported only by SOAP 1.2.

Parameters:
name - a QName object with the name of the SOAPHeaderElement object that was not understood.
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs.
UnsupportedOperationException - if this is a SOAP 1.1 Header.
Since:
SAAJ 1.3

public SOAPHeaderElement addUpgradeHeaderElement(java.util.Iterator<E> supportedSOAPURIs) throws SOAPException
创建使用指定的 SOAP URI 支持列表初始化的新的 Upgrade SOAPHeaderElement 对象，并将其添加到此 SOAPHeader 对象。SOAP 1.1 头和 SOAP 1.2 头上都支持此操作。
supportedSOAPURIs | 带有受支持 SOAP 版本 URI 的 Iterator 对象。
return | 插入此 SOAPHeader 对象的新的 SOAPHeaderElement 对象
Throws | SOAPException: 如果发生 SOAP 错误。
since | SAAJ 1.3
英文文档：

addUpgradeHeaderElement

SOAPHeaderElement addUpgradeHeaderElement(Iterator supportedSOAPURIs)
                                          throws SOAPException
Creates a new Upgrade SOAPHeaderElement object initialized with the specified List of supported SOAP URIs and adds it to this SOAPHeader object. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.

Parameters:
supportedSOAPURIs - an Iterator object with the URIs of SOAP versions supported.
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs.
Since:
SAAJ 1.3

public SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) throws SOAPException
创建使用指定 SOAP URI 支持数组初始化的新的 Upgrade SOAPHeaderElement 对象，并将其添加到此 SOAPHeader 对象。SOAP 1.1 头和 SOAP 1.2 头上都支持此操作。
supportedSoapUris | 受支持 SOAP 版本的 URI 数组
return | 插入此 SOAPHeader 对象的新的 SOAPHeaderElement 对象
Throws | SOAPException: 如果发生 SOAP 错误。
since | SAAJ 1.3
英文文档：

addUpgradeHeaderElement

SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris)
                                          throws SOAPException
Creates a new Upgrade SOAPHeaderElement object initialized with the specified array of supported SOAP URIs and adds it to this SOAPHeader object. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.

Parameters:
supportedSoapUris - an array of the URIs of SOAP versions supported.
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs.
Since:
SAAJ 1.3

public SOAPHeaderElement addUpgradeHeaderElement(String supportedSoapUri) throws SOAPException
创建使用指定受支持 SOAP URI 初始化的新的 Upgrade SOAPHeaderElement 对象，并将其添加到此 SOAPHeader 对象。SOAP 1.1 头和 SOAP 1.2 头上都支持此操作。
supportedSoapUri | 受支持 SOAP 版本的 URI。
return | 插入此 SOAPHeader 对象的新的 SOAPHeaderElement 对象
Throws | SOAPException: 如果发生 SOAP 错误。
since | SAAJ 1.3
英文文档：

addUpgradeHeaderElement

SOAPHeaderElement addUpgradeHeaderElement(String supportedSoapUri)
                                          throws SOAPException
Creates a new Upgrade SOAPHeaderElement object initialized with the specified supported SOAP URI and adds it to this SOAPHeader object. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.

Parameters:
supportedSoapUri - the URI of SOAP the version that is supported.
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs.
Since:
SAAJ 1.3

public java.util.Iterator<E> examineAllHeaderElements()
返回可在此 SOAPHeader 对象中所有 SOAPHeaderElement 对象上进行迭代的 Iterator。
return | 一个 Iterator 对象，可在此 SOAPHeader 对象包含的所有 SOAPHeaderElement 对象上进行迭代
since | SAAJ 1.2
See also | extractAllHeaderElements
英文文档：

examineAllHeaderElements

Iterator examineAllHeaderElements()
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.

Returns:
an Iterator object over all the SOAPHeaderElement objects contained by this SOAPHeader
Since:
SAAJ 1.2
See Also:
extractAllHeaderElements()

public java.util.Iterator<E> extractAllHeaderElements()
返回可在此 SOAPHeader 对象中所有 SOAPHeaderElement 对象上进行迭代的 Iterator，并将这些 SOAPHeaderElement 对象从此 SOAPHeader 对象中分离出来。
return | 一个 Iterator 对象，可在此 SOAPHeader 对象包含的所有 SOAPHeaderElement 对象上进行迭代
since | SAAJ 1.2
See also | examineAllHeaderElements
英文文档：

extractAllHeaderElements

Iterator extractAllHeaderElements()
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object and detaches them from this SOAPHeader object.

Returns:
an Iterator object over all the SOAPHeaderElement objects contained by this SOAPHeader
Since:
SAAJ 1.2
See Also:
examineAllHeaderElements()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPHeaderElement (Java EE 5)

javax.xml.soap
Interface SOAPHeaderElement

All Superinterfaces:
Element, Node, SOAPElement
public interface SOAPHeaderElement
extends SOAPElement

Implements: SOAPElement

表示 SOAP 信封 SOAP 头部分的内容的对象。SOAPHeader 对象的直接子级只能用 SOAPHeaderElement 对象的形式表示。

SOAPHeaderElement 对象可以将其他 SOAPElement 对象作为其子级。

英文文档：

An object representing the contents in the SOAP header part of the SOAP envelope. The immediate children of a SOAPHeader object can be represented only as SOAPHeaderElement objects.

A SOAPHeaderElement object can have other SOAPElement objects as its children.

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Method Summary
String | getActor() Returns the uri of the actor attribute of this SOAPHeaderElement.
boolean | getMustUnderstand() Returns the boolean value of the mustUnderstand attribute for this SOAPHeaderElement.
boolean | getRelay() Returns the boolean value of the relay attribute for this SOAPHeaderElement
String | getRole() Returns the value of the Role attribute of this SOAPHeaderElement.
void | setActor(String actorURI) Sets the actor associated with this SOAPHeaderElement object to the specified actor.
void | setMustUnderstand(boolean mustUnderstand) Sets the mustUnderstand attribute for this SOAPHeaderElement object to be either true or false.
void | setRelay(boolean relay) Sets the relay attribute for this SOAPHeaderElement to be either true or false.
void | setRole(String uri) Sets the Role associated with this SOAPHeaderElement object to the specified Role.
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Method Detail

public void setActor(String actorURI)
将与此 SOAPHeaderElement 对象关联的 actor 设置为指定 actor。actor 的默认值为：SOAPConstants.URI_SOAP_ACTOR_NEXT。

如果此 SOAPHeaderElement 支持 SOAP 1.2，则此调用等效于 #setRole(String)

actorURI | 给出要设置 actor URI 的 String
Throws | IllegalArgumentException: 如果在设置 actor 时出现问题。
See also | getActor
英文文档：

setActor

void setActor(String actorURI)
Sets the actor associated with this SOAPHeaderElement object to the specified actor. The default value of an actor is: SOAPConstants.URI_SOAP_ACTOR_NEXT

If this SOAPHeaderElement supports SOAP 1.2 then this call is equivalent to setRole(String)

Parameters:
actorURI - a String giving the URI of the actor to set
Throws:
IllegalArgumentException - if there is a problem in setting the actor.
See Also:
getActor()

public void setRole(String uri) throws SOAPException
将与此 SOAPHeaderElement 对象关联的 Role 设置为指定 Role。
uri | Role 的 URI
Throws | SOAPException: 如果在设置 role 时出现错误
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
since | SAAJ 1.3
英文文档：

setRole

void setRole(String uri)
             throws SOAPException
Sets the Role associated with this SOAPHeaderElement object to the specified Role.

Parameters:
uri - - the URI of the Role
Throws:
SOAPException - if there is an error in setting the role
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
Since:
SAAJ 1.3

public String getActor()
返回此 SOAPHeaderElement actor 属性的 URL。

如果此 SOAPHeaderElement 支持 SOAP 1.2，则此调用等效于 #getRole()

return | 给出 actor URI 的 String
See also | setActor
英文文档：

getActor

String getActor()
Returns the uri of the actor attribute of this SOAPHeaderElement.

If this SOAPHeaderElement supports SOAP 1.2 then this call is equivalent to getRole()

Returns:
a String giving the URI of the actor
See Also:
setActor(java.lang.String)

public String getRole()
返回此 SOAPHeaderElement Role 属性的值。
return | 给出 Role URI 的 String
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
since | SAAJ 1.3
英文文档：

getRole

String getRole()
Returns the value of the Role attribute of this SOAPHeaderElement.

Returns:
a String giving the URI of the Role
Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
Since:
SAAJ 1.3

public void setMustUnderstand(boolean mustUnderstand)
将此 SOAPHeaderElement 对象的 mustUnderstand 属性设置为 true 或 false。

如果 mustUnderstand 属性处于开状态，则收到 SOAPHeaderElement 的 actor 必须对其进行正确处理。在 SOAPHeaderElement 对象修改消息的情况下，这可确保消息能被正确的修改。

mustUnderstand | 该参数为 true 时，将 mustUnderstand 属性设置为 true；该参数为 false 时，则将其设置为 false
Throws | IllegalArgumentException: 如果在设置 mustUnderstand 属性时出现问题。
See also | getMustUnderstand, setRelay
英文文档：

setMustUnderstand

void setMustUnderstand(boolean mustUnderstand)
Sets the mustUnderstand attribute for this SOAPHeaderElement object to be either true or false.

If the mustUnderstand attribute is on, the actor who receives the SOAPHeaderElement must process it correctly. This ensures, for example, that if the SOAPHeaderElement object modifies the message, that the message is being modified correctly.

Parameters:
mustUnderstand - true to set the mustUnderstand attribute to true; false to set it to false
Throws:
IllegalArgumentException - if there is a problem in setting the mustUnderstand attribute
See Also:
getMustUnderstand(), setRelay(boolean)

public boolean getMustUnderstand()
返回此 SOAPHeaderElement mustUnderstand 属性的 boolean 值。
return 如果启用了此 SOAPHeaderElement 对象的 mustUnderstand 属性，则返回 true；否则返回 false
英文文档：

getMustUnderstand

boolean getMustUnderstand()
Returns the boolean value of the mustUnderstand attribute for this SOAPHeaderElement.

Returns:
true if the mustUnderstand attribute of this SOAPHeaderElement object is turned on; false otherwise

public void setRelay(boolean relay) throws SOAPException
将此 SOAPHeaderElement 的 relay 属性设置为 true 或 false。

SOAP relay 属性设置为 true 指示 SOAP 头块必须通过其指定的所有节点进行中继，但实际并不处理该头块。此属性在 mustUnderstand 属性设置为 true 或被最终接收者（默认）指定的头块处被忽略。此属性的默认值为 false。

relay | relay 属性的新值
Throws | SOAPException: 如果在设置 relay 属性时出现问题。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Relay 属性。
since | SAAJ 1.3
See also | setMustUnderstand, getRelay
英文文档：

setRelay

void setRelay(boolean relay)
              throws SOAPException
Sets the relay attribute for this SOAPHeaderElement to be either true or false.

The SOAP relay attribute is set to true to indicate that the SOAP header block must be relayed by any node that is targeted by the header block but not actually process it. This attribute is ignored on header blocks whose mustUnderstand attribute is set to true or that are targeted at the ultimate reciever (which is the default). The default value of this attribute is false.

Parameters:
relay - the new value of the relay attribute
Throws:
SOAPException - if there is a problem in setting the relay attribute.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Relay attribute.
Since:
SAAJ 1.3
See Also:
setMustUnderstand(boolean), getRelay()

public boolean getRelay()
返回此 SOAPHeaderElement relay 属性的 boolean 值。
return | 如果 relay 属性已开启，则返回 true；否则返回 false
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Relay 属性。
since | SAAJ 1.3
See also | getMustUnderstand, setRelay
英文文档：

getRelay

boolean getRelay()
Returns the boolean value of the relay attribute for this SOAPHeaderElement

Returns:
true if the relay attribute is turned on; false otherwise
Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Relay attribute.
Since:
SAAJ 1.3
See Also:
getMustUnderstand(), setRelay(boolean)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Text (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.soap
Interface Text

All Superinterfaces:
CharacterData, Node, Text
public interface Text
extends Node, Text

Implements: Node, org.w3c.dom.Text

值为文本的节点的表示形式。Text 对象可以表示是内容注释或文本注释的文本。
英文文档：

A representation of a node whose value is text. A Text object may represent text that is content or text that is a comment.

Method Summary
 boolean isComment()
Retrieves whether this Text object represents a comment.
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Text
getWholeText, isElementContentWhitespace, replaceWholeText, splitText
Methods inherited from interface org.w3c.dom.CharacterData
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData

Method Detail

public boolean isComment()
检索此 Text 对象是否表示一个注释。
return 如果此 Text 对象是一个注释，则返回 true；否则返回 false
英文文档：

isComment

boolean isComment()
Retrieves whether this Text object represents a comment.

Returns:
true if this Text object is a comment; false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


AttachmentPart (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.soap
Class AttachmentPart

java.lang.Object
    extended by  javax.xml.soap.AttachmentPart

public abstract class AttachmentPart
extends Object

SOAPMessage 对象的一个附件。SOAPMessage 对象可以包含 0 个、1 个或多个 AttachmentPart 对象。每个 AttachmentPart 对象由两部分组成：特定于应用程序的内容和关联的 MIME 头。MIME 头由可用于标识和描述内容的名称/值对组成。

AttachmentPart 对象必须符合某些标准。

  1. 它必须符合 MIME [RFC2045] 标准
  2. 它必须包含内容
  3. 头部分必须包含以下头内容：
    • Content-Type
      此头标识 AttachmentPart 对象内容中的数据类型，必须符合 [RFC2045]。以下是一个 Content-Type 头的示例：
      Content-Type:application/xml
      以下代码行（其中 ap 是一个 AttachmentPart 对象）设置前一示例中显示的头。
      ap.setMimeHeader("Content-Type", "application/xml");

AttachmentPart 对象的内容部分没有任何限制。内容可以是简单的纯文本对象、复杂的 XML 文档或图像文件。

AttachmentPart 对象是使用方法 SOAPMessage.createAttachmentPart 创建的。设置 MIME 头之后，使用方法 SOAPMessage.addAttachmentPart 将 AttachmentPart 对象添加到创建它的消息中。

以下代码片段（其中 m 是一个 SOAPMessage 对象，contentStringl 是一个 String）创建 AttachmentPart 的实例，使用一些内容和头信息设置 AttachmentPart 对象，并将 AttachmentPart 对象添加到 SOAPMessage 对象。

AttachmentPart ap1 = m.createAttachmentPart();
ap1.setContent(contentString1, "text/plain");
m.addAttachmentPart(ap1);

以下代码片段创建第二个 AttachmentPart 实例并将其添加到同一消息中。jpegData 是表示 jpeg 文件的一个二进制字节缓冲区。

AttachmentPart ap2 = m.createAttachmentPart();
byte[] jpegData =  ...;
ap2.setContent(new ByteArrayInputStream(jpegData), "image/jpeg");
m.addAttachmentPart(ap2);

getContent 方法检索 AttachmentPart 对象的内容和头。根据存在 DataContentHandler 对象的不同，返回的 Object 可能是与 MIME 类型相对应的类型化的 Java 对象，也可能是以字节形式包含内容的 InputStream 对象。

String content1 = ap1.getContent();
java.io.InputStream content2 = ap2.getContent();
方法 clearContent 从 AttachmentPart 对象中移除所有内容，但不影响其头信息。
ap1.clearContent();
英文文档：

A single attachment to a SOAPMessage object. A SOAPMessage object may contain zero, one, or many AttachmentPart objects. Each AttachmentPart object consists of two parts, application-specific content and associated MIME headers. The MIME headers consists of name/value pairs that can be used to identify and describe the content.

An AttachmentPart object must conform to certain standards.

  1. It must conform to MIME [RFC2045] standards
  2. It MUST contain content
  3. The header portion MUST include the following header:
    • Content-Type
      This header identifies the type of data in the content of an AttachmentPart object and MUST conform to [RFC2045]. The following is an example of a Content-Type header:
             Content-Type:  application/xml
      The following line of code, in which ap is an AttachmentPart object, sets the header shown in the previous example.
             ap.setMimeHeader("Content-Type", "application/xml");

There are no restrictions on the content portion of an AttachmentPart object. The content may be anything from a simple plain text object to a complex XML document or image file.

An AttachmentPart object is created with the method SOAPMessage.createAttachmentPart. After setting its MIME headers, the AttachmentPart object is added to the message that created it with the method SOAPMessage.addAttachmentPart.

The following code fragment, in which m is a SOAPMessage object and contentStringl is a String, creates an instance of AttachmentPart, sets the AttachmentPart object with some content and header information, and adds the AttachmentPart object to the SOAPMessage object.

     AttachmentPart ap1 = m.createAttachmentPart();
     ap1.setContent(contentString1, "text/plain");
     m.addAttachmentPart(ap1);

The following code fragment creates and adds a second AttachmentPart instance to the same message. jpegData is a binary byte buffer representing the jpeg file.

     AttachmentPart ap2 = m.createAttachmentPart();
     byte[] jpegData =  ...;
     ap2.setContent(new ByteArrayInputStream(jpegData), "image/jpeg");
     m.addAttachmentPart(ap2);

The getContent method retrieves the contents and header from an AttachmentPart object. Depending on the DataContentHandler objects present, the returned Object can either be a typed Java object corresponding to the MIME type or an InputStream object that contains the content as bytes.

     String content1 = ap1.getContent();
     java.io.InputStream content2 = ap2.getContent();
The method clearContent removes all the content from an AttachmentPart object but does not affect its header information.
     ap1.clearContent();

Constructor Summary
AttachmentPart()
Method Summary
abstract void | addMimeHeader(String name, String value) Adds a MIME header with the specified name and value to this AttachmentPart object.
abstract void | clearContent() Clears out the content of this AttachmentPart object.
abstract Iterator | getAllMimeHeaders() Retrieves all the headers for this AttachmentPart object as an iterator over the MimeHeader objects.
abstract InputStream | getBase64Content() Returns an InputStream which can be used to obtain the content of AttachmentPart as Base64 encoded character data, this method would base64 encode the raw bytes of the attachment and return.
abstract Object | getContent() Gets the content of this AttachmentPart object as a Java object.
String | getContentId() Gets the value of the MIME header whose name is "Content-ID".
String | getContentLocation() Gets the value of the MIME header whose name is "Content-Location".
String | getContentType() Gets the value of the MIME header whose name is "Content-Type".
abstract DataHandler | getDataHandler() Gets the DataHandler object for this AttachmentPart object.
abstract Iterator | getMatchingMimeHeaders(String[] names) Retrieves all MimeHeader objects that match a name in the given array.
abstract String[] | getMimeHeader(String name) Gets all the values of the header identified by the given String.
abstract Iterator | getNonMatchingMimeHeaders(String[] names) Retrieves all MimeHeader objects whose name does not match a name in the given array.
abstract InputStream | getRawContent() Gets the content of this AttachmentPart object as an InputStream as if a call had been made to getContent and no DataContentHandler had been registered for the content-type of this AttachmentPart.
abstract byte[] | getRawContentBytes() Gets the content of this AttachmentPart object as a byte[] array as if a call had been made to getContent and no DataContentHandler had been registered for the content-type of this AttachmentPart.
abstract int | getSize() Returns the number of bytes in this AttachmentPart object.
abstract void | removeAllMimeHeaders() Removes all the MIME header entries.
abstract void | removeMimeHeader(String header) Removes all MIME headers that match the given name.
abstract void | setBase64Content(InputStream content, String contentType) Sets the content of this attachment part from the Base64 source InputStream and sets the value of the Content-Type header to the value contained in contentType, This method would first decode the base64 input and write the resulting raw bytes to the attachment.
abstract void | setContent(Object object, String contentType) Sets the content of this attachment part to that of the given Object and sets the value of the Content-Type header to the given type.
void | setContentId(String contentId) Sets the MIME header whose name is "Content-ID" with the given value.
void | setContentLocation(String contentLocation) Sets the MIME header whose name is "Content-Location" with the given value.
void | setContentType(String contentType) Sets the MIME header whose name is "Content-Type" with the given value.
abstract void | setDataHandler(DataHandler dataHandler) Sets the given DataHandler object as the data handler for this AttachmentPart object.
abstract void | setMimeHeader(String name, String value) Changes the first header entry that matches the given name to the given value, adding a new header if no existing header matches.
abstract void | setRawContent(InputStream content, String contentType) Sets the content of this attachment part to that contained by the InputStream content and sets the value of the Content-Type header to the value contained in contentType.
abstract void | setRawContentBytes(byte[] content, int offset, int len, String contentType) Sets the content of this attachment part to that contained by the byte[] array content and sets the value of the Content-Type header to the value contained in contentType.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public AttachmentPart()
英文文档：

AttachmentPart

public AttachmentPart()
Method Detail

abstract public int getSize() throws SOAPException
返回此 AttachmentPart 对象中的字节数。
return | 此 AttachmentPart 对象的大小，以字节为单位；如果无法确定其大小，则返回 -1
Throws | SOAPException: 如果此附件的内容已损坏，或者尝试确定其大小时引发异常。
英文文档：

getSize

public abstract int getSize()
                     throws SOAPException
Returns the number of bytes in this AttachmentPart object.

Returns:
the size of this AttachmentPart object in bytes or -1 if the size cannot be determined
Throws:
SOAPException - if the content of this attachment is corrupted of if there was an exception while trying to determine the size.

abstract public void clearContent()
清除此 AttachmentPart 对象的内容。MIME 头部分保持不变。
英文文档：

clearContent

public abstract void clearContent()
Clears out the content of this AttachmentPart object. The MIME header portion is left untouched.

abstract public Object getContent() throws SOAPException
以 Java 对象的形式获取此 AttachmentPart 对象的内容。返回的 Java 对象的类型取决于：(1) 用来解释字节的 DataContentHandler 对象；(2) 头中给定的 Content-Type。

对于 MIME 内容类型 "text/plain"、"text/html" 和 "text/xml"，DataContentHandler 对象执行与对应于 MIME 类型的 Java 类型之间的转换。对于其他 MIME 类型，DataContentHandler 对象可以返回以原始字节形式包含内容的 InputStream 对象。

符合 SAAJ 的实现至少必须返回一个 java.lang.String 对象（与 Content-Type 值为 text/plain 的任何内容流相对应）、一个 javax.xml.transform.stream.StreamSource 对象（与 Content-Type 值为 text/xml 的内容流相对应）、以及一个 java.awt.Image 对象（与 Content-Type 值为 image/gif 或 image/jpeg 的内容流相对应）。对于已安装的 DataContentHandler 对象不理解的内容类型，DataContentHandler 对象要返回带有原始字节的 java.io.InputStream 对象。

return | 带有此 AttachmentPart 对象内容的 Java 对象
Throws | SOAPException: 如果此 AttachmentPart 对象中没有设置任何内容，或者出现数据转换错误
英文文档：

getContent

public abstract Object getContent()
                           throws SOAPException
Gets the content of this AttachmentPart object as a Java object. The type of the returned Java object depends on (1) the DataContentHandler object that is used to interpret the bytes and (2) the Content-Type given in the header.

For the MIME content types "text/plain", "text/html" and "text/xml", the DataContentHandler object does the conversions to and from the Java types corresponding to the MIME types. For other MIME types,the DataContentHandler object can return an InputStream object that contains the content data as raw bytes.

A SAAJ-compliant implementation must, as a minimum, return a java.lang.String object corresponding to any content stream with a Content-Type value of text/plain, a javax.xml.transform.stream.StreamSource object corresponding to a content stream with a Content-Type value of text/xml, a java.awt.Image object corresponding to a content stream with a Content-Type value of image/gif or image/jpeg. For those content types that an installed DataContentHandler object does not understand, the DataContentHandler object is required to return a java.io.InputStream object with the raw bytes.

Returns:
a Java object with the content of this AttachmentPart object
Throws:
SOAPException - if there is no content set into this AttachmentPart object or if there was a data transformation error

abstract public java.io.InputStream getRawContent() throws SOAPException
以 InputStream 的形式获取此 AttachmentPart 对象的内容，等效于调用了 getContent 但没有为此 AttachmentPart 的 content-type 注册 DataContentHandler。

注意，读取返回的 InputStream 可能导致消耗流中的数据。调用者负责在调用 Subsequent API 之前适当地重置 InputStream。如果需要附件原始内容的一个副本，则应改用 #getRawContentBytes API。

return | 一个 InputStream 对象，从中可以访问 AttachmentPart 包含的原始数据。
Throws | SOAPException: 如果此 AttachmentPart 对象中没有设置任何内容，或者出现数据转换错误。
since | SAAJ 1.3
See also | getRawContentBytes
英文文档：

getRawContent

public abstract InputStream getRawContent()
                                   throws SOAPException
Gets the content of this AttachmentPart object as an InputStream as if a call had been made to getContent and no DataContentHandler had been registered for the content-type of this AttachmentPart.

Note that reading from the returned InputStream would result in consuming the data in the stream. It is the responsibility of the caller to reset the InputStream appropriately before calling a Subsequent API. If a copy of the raw attachment content is required then the getRawContentBytes() API should be used instead.

Returns:
an InputStream from which the raw data contained by the AttachmentPart can be accessed.
Throws:
SOAPException - if there is no content set into this AttachmentPart object or if there was a data transformation error.
Since:
SAAJ 1.3
See Also:
getRawContentBytes()

abstract public byte[] getRawContentBytes() throws SOAPException
以 byte[] 数组形式获取此 AttachmentPart 对象的内容，等效于调用了 getContent 但没有为此 AttachmentPart 的 content-type 注册 DataContentHandler。
return | 包含 AttachmentPart 原始数据的 byte[] 数组。
Throws | SOAPException: 如果此 AttachmentPart 对象中没有设置任何内容，或者出现数据转换错误。
since | SAAJ 1.3
英文文档：

getRawContentBytes

public abstract byte[] getRawContentBytes()
                                   throws SOAPException
Gets the content of this AttachmentPart object as a byte[] array as if a call had been made to getContent and no DataContentHandler had been registered for the content-type of this AttachmentPart.

Returns:
a byte[] array containing the raw data of the AttachmentPart.
Throws:
SOAPException - if there is no content set into this AttachmentPart object or if there was a data transformation error.
Since:
SAAJ 1.3

abstract public java.io.InputStream getBase64Content() throws SOAPException
以 Base64 编码字符数据的形式返回可用于获取 AttachmentPart 内容的 InputStream，此方法将对附件的原始字节进行 Base64 编码，然后返回该内容。
return | 一个 InputStream 对象，从中可以读取 Base64 编码的 AttachmentPart。
Throws | SOAPException: 如果此 AttachmentPart 对象中没有设置任何内容，或者出现数据转换错误。
since | SAAJ 1.3
英文文档：

getBase64Content

public abstract InputStream getBase64Content()
                                      throws SOAPException
Returns an InputStream which can be used to obtain the content of AttachmentPart as Base64 encoded character data, this method would base64 encode the raw bytes of the attachment and return.

Returns:
an InputStream from which the Base64 encoded AttachmentPart can be read.
Throws:
SOAPException - if there is no content set into this AttachmentPart object or if there was a data transformation error.
Since:
SAAJ 1.3

abstract public void setContent(Object object, String contentType)
将此附件部分的内容设置为给定 Object 的内容，并将 Content-Type 头的值设置为给定类型。Object 的类型应该对应于指定给 Content-Type 的值。这取决于所使用的特定 DataContentHandler 对象集合。
object | 组成此附件部分内容的 Java 对象
contentType | 指定内容类型的 MIME 字符串
Throws | IllegalArgumentException: 如果 contentType 不匹配内容对象的类型，或者没有针对此内容对象的 DataContentHandler 对象
See also | getContent
英文文档：

setContent

public abstract void setContent(Object object,
                                String contentType)
Sets the content of this attachment part to that of the given Object and sets the value of the Content-Type header to the given type. The type of the Object should correspond to the value given for the Content-Type. This depends on the particular set of DataContentHandler objects in use.

Parameters:
object - the Java object that makes up the content for this attachment part
contentType - the MIME string that specifies the type of the content
Throws:
IllegalArgumentException - may be thrown if the contentType does not match the type of the content object, or if there was no DataContentHandler object for this content object
See Also:
getContent()

abstract public void setRawContent(java.io.InputStream content, String contentType) throws SOAPException
将此附件部分的内容设置为 InputStream content 所包含的内容，并将 Content-Type 头的值设置为 contentType 中包含的值。

后续调用 getSize() 可能无法准确度量内容的大小。

content | 要添加到附件部分的原始数据
contentType | 要在 Content-Type 头中设置的值
Throws | SOAPException: 如果设置内容时发生错误
Throws | NullPointerException: 如果 content 为 null
since | SAAJ 1.3
英文文档：

setRawContent

public abstract void setRawContent(InputStream content,
                                   String contentType)
                            throws SOAPException
Sets the content of this attachment part to that contained by the InputStream content and sets the value of the Content-Type header to the value contained in contentType.

A subsequent call to getSize() may not be an exact measure of the content size.

Parameters:
content - the raw data to add to the attachment part
contentType - the value to set into the Content-Type header
Throws:
SOAPException - if an there is an error in setting the content
NullPointerException - if content is null
Since:
SAAJ 1.3

abstract public void setRawContentBytes(byte[] content, int offset, int len, String contentType) throws SOAPException
将此附件部分的内容设置为 byte[] 数组 content 所包含的内容，并将 Content-Type 头的值设置为 contentType 中包含的值。
content | 要添加到附件部分的原始数据
contentType | 要在 Content-Type 头中设置的值
offset | 内容字节数组中的偏移量
len | 组成内容的字节数
Throws | SOAPException: 如果设置内容时发生错误，或者内容为 null
since | SAAJ 1.3
英文文档：

setRawContentBytes

public abstract void setRawContentBytes(byte[] content,
                                        int offset,
                                        int len,
                                        String contentType)
                                 throws SOAPException
Sets the content of this attachment part to that contained by the byte[] array content and sets the value of the Content-Type header to the value contained in contentType.

Parameters:
content - the raw data to add to the attachment part
contentType - the value to set into the Content-Type header
offset - the offset in the byte array of the content
len - the number of bytes that form the content
Throws:
SOAPException - if an there is an error in setting the content or content is null
Since:
SAAJ 1.3

abstract public void setBase64Content(java.io.InputStream content, String contentType) throws SOAPException
根据 Base64 源 InputStream 设置此附件部分的内容，并将 Content-Type 头的值设置为 contentType 中包含的值，此方法将首先对 base64 输入流进行解码，然后将得到的原始字节写入附件。

后续调用 getSize() 可能无法准确度量内容的大小。

content | 要添加到附件部分的 Base64 解码数据
contentType | 要在 Content-Type 头中设置的值
Throws | SOAPException: 如果设置内容时发生错误
Throws | NullPointerException: 如果 content 为 null
since | SAAJ 1.3
英文文档：

setBase64Content

public abstract void setBase64Content(InputStream content,
                                      String contentType)
                               throws SOAPException
Sets the content of this attachment part from the Base64 source InputStream and sets the value of the Content-Type header to the value contained in contentType, This method would first decode the base64 input and write the resulting raw bytes to the attachment.

A subsequent call to getSize() may not be an exact measure of the content size.

Parameters:
content - the base64 encoded data to add to the attachment part
contentType - the value to set into the Content-Type header
Throws:
SOAPException - if an there is an error in setting the content
NullPointerException - if content is null
Since:
SAAJ 1.3

abstract public DataHandler getDataHandler() throws SOAPException
获取针对此 AttachmentPart 对象的 DataHandler 对象。
return | 与此 AttachmentPart 对象关联的 DataHandler 对象
Throws | SOAPException: 如果此 AttachmentPart 对象中没有数据
英文文档：

getDataHandler

public abstract DataHandler getDataHandler()
                                    throws SOAPException
Gets the DataHandler object for this AttachmentPart object.

Returns:
the DataHandler object associated with this AttachmentPart object
Throws:
SOAPException - if there is no data in this AttachmentPart object

abstract public void setDataHandler(DataHandler dataHandler)
将给定的 DataHandler 对象设置为此 AttachmentPart 对象的数据处理程序。通常，对于传入的消息，数据处理程序是自动设置的。创建消息并填充内容之后，可以使用 setDataHandler 方法从各种数据源获取数据并转入该消息中。
dataHandler | 要设置的 DataHandler 对象
Throws | IllegalArgumentException: 如果指定的 DataHandler 对象存在问题
英文文档：

setDataHandler

public abstract void setDataHandler(DataHandler dataHandler)
Sets the given DataHandler object as the data handler for this AttachmentPart object. Typically, on an incoming message, the data handler is automatically set. When a message is being created and populated with content, the setDataHandler method can be used to get data from various data sources into the message.

Parameters:
dataHandler - the DataHandler object to be set
Throws:
IllegalArgumentException - if there was a problem with the specified DataHandler object

public String getContentId()
获取名为 "Content-ID" 的 MIME 头的值。
return | 给出 "Content-ID" 头值的 String；如果不存在此类字符串，则返回 null
See also | setContentId
英文文档：

getContentId

public String getContentId()
Gets the value of the MIME header whose name is "Content-ID".

Returns:
a String giving the value of the "Content-ID" header or null if there is none
See Also:
setContentId(java.lang.String)

public String getContentLocation()
获取名为 "Content-Location" 的 MIME 头的值。
return 给出 "Content-Location" 头值的 String；如果不存在此类字符串，则返回 null
英文文档：

getContentLocation

public String getContentLocation()
Gets the value of the MIME header whose name is "Content-Location".

Returns:
a String giving the value of the "Content-Location" header or null if there is none

public String getContentType()
获取名为 "Content-Type" 的 MIME 头的值。
return 给出 "Content-Type" 头值的 String；如果不存在此类字符串，则返回 null
英文文档：

getContentType

public String getContentType()
Gets the value of the MIME header whose name is "Content-Type".

Returns:
a String giving the value of the "Content-Type" header or null if there is none

public void setContentId(String contentId)
使用给定值设置名为 "Content-ID" 的 MIME 头。
contentId | 给出 "Content-ID" 头值的 String
Throws | IllegalArgumentException: 如果指定的 contentId 值存在问题
See also | getContentId
英文文档：

setContentId

public void setContentId(String contentId)
Sets the MIME header whose name is "Content-ID" with the given value.

Parameters:
contentId - a String giving the value of the "Content-ID" header
Throws:
IllegalArgumentException - if there was a problem with the specified contentId value
See Also:
getContentId()

public void setContentLocation(String contentLocation)
使用给定值设置名为 "Content-Location" 的 MIME 头。
contentLocation | 给出 "Content-Location" 头值的 String
Throws | IllegalArgumentException: 如果指定的内容位置存在问题
英文文档：

setContentLocation

public void setContentLocation(String contentLocation)
Sets the MIME header whose name is "Content-Location" with the given value.

Parameters:
contentLocation - a String giving the value of the "Content-Location" header
Throws:
IllegalArgumentException - if there was a problem with the specified content location

public void setContentType(String contentType)
使用给定值设置名为 "Content-Type" 的 MIME 头。
contentType | 给出 "Content-Type" 头值的 String
Throws | IllegalArgumentException: 如果指定的内容类型存在问题
英文文档：

setContentType

public void setContentType(String contentType)
Sets the MIME header whose name is "Content-Type" with the given value.

Parameters:
contentType - a String giving the value of the "Content-Type" header
Throws:
IllegalArgumentException - if there was a problem with the specified content type

abstract public void removeMimeHeader(String header)
移除所有与给定名称匹配的 MIME 头。
header 要移除的 MIME 头的字符串名
英文文档：

removeMimeHeader

public abstract void removeMimeHeader(String header)
Removes all MIME headers that match the given name.

Parameters:
header - the string name of the MIME header/s to be removed

abstract public void removeAllMimeHeaders()
移除所有 MIME 头条目。
英文文档：

removeAllMimeHeaders

public abstract void removeAllMimeHeaders()
Removes all the MIME header entries.

abstract public String[] getMimeHeader(String name)
获取给定 String 所标识的头的所有值。
name | 头的名称；示例："Content-Type"
return | 给出指定头值的 String 数组
See also | setMimeHeader
英文文档：

getMimeHeader

public abstract String[] getMimeHeader(String name)
Gets all the values of the header identified by the given String.

Parameters:
name - the name of the header; example: "Content-Type"
Returns:
a String array giving the value for the specified header
See Also:
setMimeHeader(java.lang.String, java.lang.String)

abstract public void setMimeHeader(String name, String value)
将匹配给定名称的第一个头条目的值更改为给定值，如果现有的头都不匹配，则添加一个新的头。此方法还将移除第一个匹配头以外的所有匹配的头。

注意，RFC822 头只能包含 US-ASCII 字符。

name | 一个 String，用于提供要搜索的头的名称
value | 一个 String，用于提供将用来设置名称匹配给定名称的头的值
Throws | IllegalArgumentException: 如果指定的 MIME 头名称或值存在问题
英文文档：

setMimeHeader

public abstract void setMimeHeader(String name,
                                   String value)
Changes the first header entry that matches the given name to the given value, adding a new header if no existing header matches. This method also removes all matching headers but the first.

Note that RFC822 headers can only contain US-ASCII characters.

Parameters:
name - a String giving the name of the header for which to search
value - a String giving the value to be set for the header whose name matches the given name
Throws:
IllegalArgumentException - if there was a problem with the specified mime header name or value

abstract public void addMimeHeader(String name, String value)
将带有指定名称和值的 MIME 头添加到此 AttachmentPart 对象。

注意，RFC822 头只能包含 US-ASCII 字符。

name | 一个 String，用于提供要添加的头的名称
value | 一个 String，用于提供要添加的头的值
Throws | IllegalArgumentException: 如果指定的 MIME 头名称或值存在问题
英文文档：

addMimeHeader

public abstract void addMimeHeader(String name,
                                   String value)
Adds a MIME header with the specified name and value to this AttachmentPart object.

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String giving the name of the header to be added
value - a String giving the value of the header to be added
Throws:
IllegalArgumentException - if there was a problem with the specified mime header name or value

abstract public java.util.Iterator<E> getAllMimeHeaders()
以 MimeHeader 对象上的迭代器形式，检索此 AttachmentPart 对象的所有头。
return 带有此 AttachmentPart 对象所有 MIME 头的 Iterator 对象
英文文档：

getAllMimeHeaders

public abstract Iterator getAllMimeHeaders()
Retrieves all the headers for this AttachmentPart object as an iterator over the MimeHeader objects.

Returns:
an Iterator object with all of the Mime headers for this AttachmentPart object

abstract public java.util.Iterator<E> getMatchingMimeHeaders(String[] names)
检索匹配给定数组中名称的所有 MimeHeader 对象。
names | 一个 String 数组，带有要返回的 Mime 头的名称
return | 所有匹配给定数组中任一名称的 MIME 头（Iterator 对象的形式）
英文文档：

getMatchingMimeHeaders

public abstract Iterator getMatchingMimeHeaders(String[] names)
Retrieves all MimeHeader objects that match a name in the given array.

Parameters:
names - a String array with the name(s) of the MIME headers to be returned
Returns:
all of the MIME headers that match one of the names in the given array as an Iterator object

abstract public java.util.Iterator<E> getNonMatchingMimeHeaders(String[] names)
检索所有名称不匹配给定数组中任一名称的 MimeHeader 对象。
names | 一个 String 数组，带有不要返回的 Mime 头的名称
return | 此 AttachmentPart 对象中的所有 MIME 头，但匹配给定数组中任一名称的 MIME 头除外。以 Iterator 对象的形式返回不匹配的 MIME 头。
英文文档：

getNonMatchingMimeHeaders

public abstract Iterator getNonMatchingMimeHeaders(String[] names)
Retrieves all MimeHeader objects whose name does not match a name in the given array.

Parameters:
names - a String array with the name(s) of the MIME headers not to be returned
Returns:
all of the MIME headers in this AttachmentPart object except those that match one of the names in the given array. The nonmatching MIME headers are returned as an Iterator object.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


MessageFactory (Java EE 5)

javax.xml.soap
Class MessageFactory

java.lang.Object
    extended by  javax.xml.soap.MessageFactory

public abstract class MessageFactory
extends Object

创建 SOAPMessage 对象的工厂。

SAAJ 客户端可以使用方法 newInstance 创建 MessageFactory 对象，如以下代码行所示。

MessageFactory mf = MessageFactory.newInstance();
MessageFactory mf12 = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);

默认情况下，所有 MessageFactory 对象（无论它们是如何创建的）都将生成具有以下元素的 SOAPMessage 对象：

  • 一个 SOAPPart 对象
  • 一个 SOAPEnvelope 对象
  • 一个 SOAPBody 对象
  • 一个 SOAPHeader 对象
在某些情况下，可以获取特殊的 MessageFactory 对象来生成用 SOAPHeader 对象和 SOAPBody 对象中的附加条目预填充的消息。新的 SOAPMessage 对象的内容取决于使用两种 MessageFactory 方法中的哪一种创建该对象。
  • createMessage()
    这是客户端通常用来创建请求消息的方法。
  • createMessage(MimeHeaders, java.io.InputStream) -- 消息的内容取自 InputStream 对象，头取自 MimeHeaders 对象。
    此方法可以供服务实现在内部用来创建响应请求的消息。
英文文档：

A factory for creating SOAPMessage objects.

A SAAJ client can create a MessageFactory object using the method newInstance, as shown in the following lines of code.

       MessageFactory mf = MessageFactory.newInstance();
       MessageFactory mf12 = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);

All MessageFactory objects, regardless of how they are created, will produce SOAPMessage objects that have the following elements by default:

  • A SOAPPart object
  • A SOAPEnvelope object
  • A SOAPBody object
  • A SOAPHeader object
In some cases, specialized MessageFactory objects may be obtained that produce messages prepopulated with additional entries in the SOAPHeader object and the SOAPBody object. The content of a new SOAPMessage object depends on which of the two MessageFactory methods is used to create it.
  • createMessage()
    This is the method clients would normally use to create a request message.
  • createMessage(MimeHeaders, java.io.InputStream) -- message has content from the InputStream object and headers from the MimeHeaders object
    This method can be used internally by a service implementation to create a message that is a response to a request.

Constructor Summary
MessageFactory()
Method Summary
abstract SOAPMessage | createMessage() Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope, SOAPBody, and SOAPHeader objects.
abstract SOAPMessage | createMessage(MimeHeaders headers, InputStream in) Internalizes the contents of the given InputStream object into a new SOAPMessage object and returns the SOAPMessage object.
static MessageFactory | newInstance() Creates a new MessageFactory object that is an instance of the default implementation (SOAP 1.1), This method uses the following ordered lookup procedure to determine the MessageFactory implementation class to load: Use the javax.xml.soap.MessageFactory system property.
static MessageFactory | newInstance(String protocol) Creates a new MessageFactory object that is an instance of the specified implementation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MessageFactory()
英文文档：

MessageFactory

public MessageFactory()
Method Detail

public static MessageFactory newInstance() throws SOAPException
创建新的 MessageFactory 对象，该对象是默认实现 (SOAP 1.1) 的实例。 此方法使用以下查找过程顺序来确定要加载的 MessageFactory 实现类：
  • 使用 javax.xml.soap.MessageFactory 系统属性。
  • 使用 JRE 文件夹中的属性文件 "lib/jaxm.properties"。此配置文件格式是标准的 java.util.Properties 格式且包含实现类的完全限定名，其中实现类的键是上文定义的系统属性。
  • 如果 Services API（在 JAR 规范中进行了详细描述）可用，可以使用它来确定类名称。Services API 将查找在运行时可用的 jar 中 META-INF/services/javax.xml.soap.MessageFactory 文件中的类名称。
  • 使用 SAAJMetaFactory 实例来定位 MessageFactory 实现类。
return | 新的 MessageFactory 实例
Throws | SOAPException: 如果创建默认的 MessageFactory 实现时存在错误。
See also | javax.xml.soap.SAAJMetaFactory
英文文档：

newInstance

public static MessageFactory newInstance()
                                  throws SOAPException
Creates a new MessageFactory object that is an instance of the default implementation (SOAP 1.1), This method uses the following ordered lookup procedure to determine the MessageFactory implementation class to load:
  • Use the javax.xml.soap.MessageFactory system property.
  • Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
  • Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.soap.MessageFactory in jars available to the runtime.
  • Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.

Returns:
a new instance of a MessageFactory
Throws:
SOAPException - if there was an error in creating the default implementation of the MessageFactory.
See Also:
SAAJMetaFactory

public static MessageFactory newInstance(String protocol) throws SOAPException
创建新的 MessageFactory 对象，该对象是指定实现的实例。可以是动态消息工厂、SOAP 1.1 消息工厂或 SOAP 1.2 消息工厂。动态消息工厂根据作为 createMessage 方法参数指定的 MIME 头创建消息。此方法使用 SAAJMetaFactory 来定位实现类并创建 MessageFactory 实例。
return | 新的 MessageFactory 实例
protocol | 字符串常量，表示指定消息工厂实现的类。可以是 DYNAMIC_SOAP_PROTOCOL、DEFAULT_SOAP_PROTOCOL（等同于 SOAP_1_1_PROTOCOL）或 SOAP_1_2_PROTOCOL。
Throws | SOAPException: 如果创建指定的 MessageFactory 实例时存在错误。
since | SAAJ 1.3
See also | javax.xml.soap.SAAJMetaFactory
英文文档：

newInstance

public static MessageFactory newInstance(String protocol)
                                  throws SOAPException
Creates a new MessageFactory object that is an instance of the specified implementation. May be a dynamic message factory, a SOAP 1.1 message factory, or a SOAP 1.2 message factory. A dynamic message factory creates messages based on the MIME headers specified as arguments to the createMessage method. This method uses the SAAJMetaFactory to locate the implementation class and create the MessageFactory instance.

Parameters:
protocol - a string constant representing the class of the specified message factory implementation. May be either DYNAMIC_SOAP_PROTOCOL, DEFAULT_SOAP_PROTOCOL (which is the same as) SOAP_1_1_PROTOCOL, or SOAP_1_2_PROTOCOL.
Returns:
a new instance of a MessageFactory
Throws:
SOAPException - if there was an error in creating the specified implementation of MessageFactory.
Since:
SAAJ 1.3
See Also:
SAAJMetaFactory

abstract public SOAPMessage createMessage() throws SOAPException
使用默认的 SOAPPart、SOAPEnvelope、SOAPBody 和 SOAPHeader 对象创建新的 SOAPMessage 对象。特定于配置文件的消息工厂可以选择用特定于配置文件的头预填充 SOAPMessage 对象。

可以向此消息的 SOAPPart 对象添加内容，如果一个只包含 SOAP 部分的消息便已足够，则可以按“原样”发送消息。否则，SOAPMessage 对象需要创建一个或多个 AttachmentPart 对象并将其添加到自身。任何非 XML 格式的内容必须在 AttachmentPart 对象中。

return | 一个新的 SOAPMessage 对象
Throws | SOAPException: 如果发生 SOAP 错误
Throws | UnsupportedOperationException: 如果此 MessageFactory 实例的协议是 DYNAMIC_SOAP_PROTOCOL
英文文档：

createMessage

public abstract SOAPMessage createMessage()
                                   throws SOAPException
Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope, SOAPBody, and SOAPHeader objects. Profile-specific message factories can choose to prepopulate the SOAPMessage object with profile-specific headers.

Content can be added to this message's SOAPPart object, and the message can be sent "as is" when a message containing only a SOAP part is sufficient. Otherwise, the SOAPMessage object needs to create one or more AttachmentPart objects and add them to itself. Any content that is not in XML format must be in an AttachmentPart object.

Returns:
a new SOAPMessage object
Throws:
SOAPException - if a SOAP error occurs
UnsupportedOperationException - if the protocol of this MessageFactory instance is DYNAMIC_SOAP_PROTOCOL

abstract public SOAPMessage createMessage(MimeHeaders headers, java.io.InputStream in) throws java.io.IOException, SOAPException
将给定 InputStream 对象的内容内部化到新的 SOAPMessage 对象，并返回该 SOAPMessage 对象。
in | 包含消息数据的 InputStream 对象
headers | 用于创建消息的特定于传输的头，使用与传输无关的方式传递给消息
return | 一个新的 SOAPMessage 对象，包含给定 InputStream 对象的数据
Throws | java.io.IOException: 如果读取输入流的数据时存在错误
Throws | SOAPException: 消息无效时抛出
Throws | IllegalArgumentException: 如果 MessageFactory 需要一个或多个 MIME 头存在于 headers 参数中，但是它们丢失了。SOAP_1_1_PROTOCOL 或 SOAP_1_2_PROTOCOL 的 MessageFactory 实现不得因此抛出 IllegalArgumentException。
英文文档：

createMessage

public abstract SOAPMessage createMessage(MimeHeaders headers,
                                          InputStream in)
                                   throws IOException,
                                          SOAPException
Internalizes the contents of the given InputStream object into a new SOAPMessage object and returns the SOAPMessage object.

Parameters:
in - the InputStream object that contains the data for a message
headers - the transport-specific headers passed to the message in a transport-independent fashion for creation of the message
Returns:
a new SOAPMessage object containing the data from the given InputStream object
Throws:
IOException - if there is a problem in reading data from the input stream
SOAPException - may be thrown if the message is invalid
IllegalArgumentException - if the MessageFactory requires one or more MIME headers to be present in the headers parameter and they are missing. MessageFactory implementations for SOAP_1_1_PROTOCOL or SOAP_1_2_PROTOCOL must not throw IllegalArgumentException for this reason.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeHeader (Java EE 5)

javax.xml.soap
Class MimeHeader

java.lang.Object
    extended by  javax.xml.soap.MimeHeader

public class MimeHeader
extends Object

存储 MIME 头名称及其值的对象。一个 MimeHeaders 对象中可以包含一个或多个 MimeHeader 对象。
See also javax.xml.soap.MimeHeaders
英文文档：

An object that stores a MIME header name and its value. One or more MimeHeader objects may be contained in a MimeHeaders object.

See Also:
MimeHeaders

Constructor Summary
MimeHeader(String name, String value)
Constructs a MimeHeader object initialized with the given name and value.
Method Summary
String | getName() Returns the name of this MimeHeader object.
String | getValue() Returns the value of this MimeHeader object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MimeHeader(String name, String value)
构造使用给定的名称和值初始化的 MimeHeader 对象。
name | 给出头名称的 String
value | 给出头值的 String
英文文档：

MimeHeader

public MimeHeader(String name,
                  String value)
Constructs a MimeHeader object initialized with the given name and value.

Parameters:
name - a String giving the name of the header
value - a String giving the value of the header
Method Detail

public String getName()
返回此 MimeHeader 对象的名称。
return String 形式的头名称
英文文档：

getName

public String getName()
Returns the name of this MimeHeader object.

Returns:
the name of the header as a String

public String getValue()
返回此 MimeHeader 对象的值。
return String 形式的头值
英文文档：

getValue

public String getValue()
Returns the value of this MimeHeader object.

Returns:
the value of the header as a String
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MimeHeaders (Java EE 5)

javax.xml.soap
Class MimeHeaders

java.lang.Object
    extended by  javax.xml.soap.MimeHeaders

public class MimeHeaders
extends Object

MimeHeader 对象的容器，这些对象表示出现在消息的 MIME 部分的 MIME 头。

此类主要在应用程序要根据某些 MIME 头和值来检索特定的附件时使用。该类最有可能由 AttachmentPart 的实现和 SAAJ API 的其他与 MIME 有关的部分使用。

See also getAttachments, javax.xml.soap.AttachmentPart
英文文档：

A container for MimeHeader objects, which represent the MIME headers present in a MIME part of a message.

This class is used primarily when an application wants to retrieve specific attachments based on certain MIME headers and values. This class will most likely be used by implementations of AttachmentPart and other MIME dependent parts of the SAAJ API.

See Also:
SOAPMessage.getAttachments(), AttachmentPart

Constructor Summary
MimeHeaders()
Constructs a default MimeHeaders object initialized with an empty Vector object.
Method Summary
void | addHeader(String name, String value) Adds a MimeHeader object with the specified name and value to this MimeHeaders object's list of headers.
Iterator | getAllHeaders() Returns all the MimeHeaders in this MimeHeaders object.
String[] | getHeader(String name) Returns all of the values for the specified header as an array of String objects.
Iterator | getMatchingHeaders(String[] names) Returns all the MimeHeader objects whose name matches a name in the given array of names.
Iterator | getNonMatchingHeaders(String[] names) Returns all of the MimeHeader objects whose name does not match a name in the given array of names.
void | removeAllHeaders() Removes all the header entries from this MimeHeaders object.
void | removeHeader(String name) Remove all MimeHeader objects whose name matches the given name.
void | setHeader(String name, String value) Replaces the current value of the first header entry whose name matches the given name with the given value, adding a new header if no existing header name matches.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public MimeHeaders()
构造一个用空 Vector 对象初始化的默认 MimeHeaders 对象。
英文文档：

MimeHeaders

public MimeHeaders()
Constructs a default MimeHeaders object initialized with an empty Vector object.

Method Detail

public String[] getHeader(String name)
以 String 对象数组的形式返回指定头的所有值。
name | 将返回其值的头的名称
return | 带有指定头的所有值的 String 数组
See also | setHeader
英文文档：

getHeader

public String[] getHeader(String name)
Returns all of the values for the specified header as an array of String objects.

Parameters:
name - the name of the header for which values will be returned
Returns:
a String array with all of the values for the specified header
See Also:
setHeader(java.lang.String, java.lang.String)

public void setHeader(String name, String value)
将其名称与给定名称匹配的第一个头条目的当前值替换为给定值，如果现有的头名称都不匹配，则添加一个新的头。此方法还移第一个匹配头之后的所有匹配的头。

注意，RFC822 头只能包含 US-ASCII 字符。

name | 一个 String，带有要搜索的头名称
value | 一个 String，带有用来替换指定头的当前值的值
Throws | IllegalArgumentException: 如果设置 MIME 头名称或值时存在问题
See also | getHeader
英文文档：

setHeader

public void setHeader(String name,
                      String value)
Replaces the current value of the first header entry whose name matches the given name with the given value, adding a new header if no existing header name matches. This method also removes all matching headers after the first one.

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String with the name of the header for which to search
value - a String with the value that will replace the current value of the specified header
Throws:
IllegalArgumentException - if there was a problem in the mime header name or the value being set
See Also:
getHeader(java.lang.String)

public void addHeader(String name, String value)
将带有指定名称和值的 MimeHeader 对象添加到此 MimeHeaders 对象的头列表。

注意，RFC822 头只能包含 US-ASCII 字符。

name | 一个 String，带有要添加的头的名称
value | 一个 String，带有要添加的头的值
Throws | IllegalArgumentException: 如果添加 MIME 头名称或值时存在问题
英文文档：

addHeader

public void addHeader(String name,
                      String value)
Adds a MimeHeader object with the specified name and value to this MimeHeaders object's list of headers.

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String with the name of the header to be added
value - a String with the value of the header to be added
Throws:
IllegalArgumentException - if there was a problem in the mime header name or value being added

public void removeHeader(String name)
移除其名称与给定名称匹配的所有 MimeHeader 对象。
name 一个 String，带有要搜索的头名称
英文文档：

removeHeader

public void removeHeader(String name)
Remove all MimeHeader objects whose name matches the given name.

Parameters:
name - a String with the name of the header for which to search

public void removeAllHeaders()
从此 MimeHeaders 对象中移除所有头条目。
英文文档：

removeAllHeaders

public void removeAllHeaders()
Removes all the header entries from this MimeHeaders object.

public java.util.Iterator<E> getAllHeaders()
返回此 MimeHeaders 对象中的所有 MimeHeader。
return 一个 Iterator 对象，可在此 MimeHeaders 对象的 MimeHeader 对象列表上进行迭代
英文文档：

getAllHeaders

public Iterator getAllHeaders()
Returns all the MimeHeaders in this MimeHeaders object.

Returns:
an Iterator object over this MimeHeaders object's list of MimeHeader objects

public java.util.Iterator<E> getMatchingHeaders(String[] names)
返回其名称与给定名称数组中的任一名称匹配的所有 MimeHeader 对象。
names | 带有要搜索的名称的 String 对象数组
return | 一个 Iterator 对象，可在其名称与给定列表中的任一名称匹配的 MimeHeader 对象上进行迭代
英文文档：

getMatchingHeaders

public Iterator getMatchingHeaders(String[] names)
Returns all the MimeHeader objects whose name matches a name in the given array of names.

Parameters:
names - an array of String objects with the names for which to search
Returns:
an Iterator object over the MimeHeader objects whose name matches one of the names in the given list

public java.util.Iterator<E> getNonMatchingHeaders(String[] names)
返回其名称与给定名称数组中的任何名称都不匹配的所有 MimeHeader 对象。
names | 带有要搜索的名称的 String 对象数组
return | 一个 Iterator 对象，可在其名称与给定列表中的任何名称都不匹配的 MimeHeader 对象上进行迭代
英文文档：

getNonMatchingHeaders

public Iterator getNonMatchingHeaders(String[] names)
Returns all of the MimeHeader objects whose name does not match a name in the given array of names.

Parameters:
names - an array of String objects with the names for which to search
Returns:
an Iterator object over the MimeHeader objects whose name does not match one of the names in the given list
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SAAJMetaFactory (Java EE 5)

javax.xml.soap
Class SAAJMetaFactory

java.lang.Object
    extended by  javax.xml.soap.SAAJMetaFactory

public abstract class SAAJMetaFactory
extends Object

SAAJ API 中定义的工厂实现类的访问点。SAAJ 1.3 中的工厂上定义的所有 newInstance 方法都要此类实例来创建实际对象。当 SAAJ 1.2 定义的查询无法定位 Factory 实现类名称时，存在于 SAAJ 1.2 中的 newInstance() 方法（SOAPFactory 和 MessageFactory 中）的实现被更新为（并委派给）SAAJMetaFactory。

SAAJMetaFactory 是一个服务提供者接口。在此类上没有 public 方法。

since SAAJ 1.3
英文文档：

The access point for the implementation classes of the factories defined in the SAAJ API. All of the newInstance methods defined on factories in SAAJ 1.3 defer to instances of this class to do the actual object creation. The implementations of newInstance() methods (in SOAPFactory and MessageFactory) that existed in SAAJ 1.2 have been updated to also delegate to the SAAJMetaFactory when the SAAJ 1.2 defined lookup fails to locate the Factory implementation class name.

SAAJMetaFactory is a service provider interface. There are no public methods on this class.

Since:
SAAJ 1.3
Author:
SAAJ RI Development Team

Constructor Summary
protected SAAJMetaFactory()
Method Summary
protected abstract MessageFactory | newMessageFactory(String protocol) Creates a MessageFactory object for the given String protocol.
protected abstract SOAPFactory | newSOAPFactory(String protocol) Creates a SOAPFactory object for the given String protocol.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected SAAJMetaFactory()
英文文档：

SAAJMetaFactory

protected SAAJMetaFactory()
Method Detail

abstract protected MessageFactory newMessageFactory(String protocol) throws SOAPException
创建给定 String 协议的 MessageFactory 对象。
protocol | 指示该协议的 String
Throws | SOAPException: 如果在创建 MessageFactory 时出现错误
See also | SOAP_1_1_PROTOCOL, SOAP_1_2_PROTOCOL, DYNAMIC_SOAP_PROTOCOL
英文文档：

newMessageFactory

protected abstract MessageFactory newMessageFactory(String protocol)
                                             throws SOAPException
Creates a MessageFactory object for the given String protocol.

Parameters:
protocol - a String indicating the protocol
Throws:
SOAPException - if there is an error in creating the MessageFactory
See Also:
SOAPConstants.SOAP_1_1_PROTOCOL, SOAPConstants.SOAP_1_2_PROTOCOL, SOAPConstants.DYNAMIC_SOAP_PROTOCOL

abstract protected SOAPFactory newSOAPFactory(String protocol) throws SOAPException
创建给定 String 协议的 SOAPFactory 对象。
protocol | 指示该协议的 String
Throws | SOAPException: 如果在创建 SOAPFactory 时出现错误
See also | SOAP_1_1_PROTOCOL, SOAP_1_2_PROTOCOL, DYNAMIC_SOAP_PROTOCOL
英文文档：

newSOAPFactory

protected abstract SOAPFactory newSOAPFactory(String protocol)
                                       throws SOAPException
Creates a SOAPFactory object for the given String protocol.

Parameters:
protocol - a String indicating the protocol
Throws:
SOAPException - if there is an error in creating the SOAPFactory
See Also:
SOAPConstants.SOAP_1_1_PROTOCOL, SOAPConstants.SOAP_1_2_PROTOCOL, SOAPConstants.DYNAMIC_SOAP_PROTOCOL
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SAAJResult (Java EE 5)

javax.xml.soap
Class SAAJResult

java.lang.Object
    extended by  javax.xml.transform.dom.DOMResult
        extended by  javax.xml.soap.SAAJResult
All Implemented Interfaces:
Result
public class SAAJResult
extends DOMResult

Extends: javax.xml.transform.dom.DOMResult

以 SAAJ 树的形式，充当 JAXP 转换或 JAXB 编组结果的持有者。这些结果应通过使用 #getResult() 方法访问。几乎在所有情况下，都应避免使用 getNode() 方法。
since SAAJ 1.3
英文文档：

Acts as a holder for the results of a JAXP transformation or a JAXB marshalling, in the form of a SAAJ tree. These results should be accessed by using the getResult() method. The DOMResult.getNode() method should be avoided in almost all cases.

Since:
SAAJ 1.3
Author:
XWS-Security Development Team

Field Summary
Fields inherited from class javax.xml.transform.dom.DOMResult
FEATURE
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
Constructor Summary
SAAJResult()
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the default (SOAP 1.1) protocol.
SAAJResult(SOAPElement rootNode)
Creates a SAAJResult that will write the results as a child node of the SOAPElement specified.
SAAJResult(SOAPMessage message)
Creates a SAAJResult that will write the results into the SOAPPart of the supplied SOAPMessage.
SAAJResult(String protocol)
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the specified protocol.
Method Summary
 Node getResult()
Methods inherited from class javax.xml.transform.dom.DOMResult
getNextSibling, getNode, getSystemId, setNextSibling, setNode, setSystemId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SAAJResult() throws SOAPException
创建一个 SAAJResult，此类将以支持默认 (SOAP 1.1) 协议的 SAAJ 树的形式显示结果。

这种 SAAJResult 用在结果将被用作方法参数的情况下，其中的方法指带有其类型（如 SOAPElement）取自 SAAJ API 的方法。当用于转换时，结果被填充到内部创建的 SOAPMessage 的 SOAPPart 中。由 getNode() 返回的 SOAPPart 不能保证格式良好。

Throws | SOAPException: 如果在创建 SOAPMessage 时出现问题
since | SAAJ 1.3
英文文档：

SAAJResult

public SAAJResult()
           throws SOAPException
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the default (SOAP 1.1) protocol.

This kind of SAAJResult is meant for use in situations where the results will be used as a parameter to a method that takes a parameter whose type, such as SOAPElement, is drawn from the SAAJ API. When used in a transformation, the results are populated into the SOAPPart of a SOAPMessage that is created internally. The SOAPPart returned by DOMResult.getNode() is not guaranteed to be well-formed.

Throws:
SOAPException - if there is a problem creating a SOAPMessage
Since:
SAAJ 1.3

public SAAJResult(String protocol) throws SOAPException
创建一个 SAAJResult，它将以支持指定协议的 SAAJ 树的形式显示结果。DYNAMIC_SOAP_PROTOCOL 在此上下文中不明确，并会导致此构造方法抛出 UnsupportedOperationException。

这种 SAAJResult 用在结果将被用作方法参数的情况下，其中的方法指带有其类型（如 SOAPElement）取自 SAAJ API 的方法。当用于转换时，结果被填充到内部创建的 SOAPMessage 的 SOAPPart 中。由 getNode() 返回的 SOAPPart 不能保证格式良好。

protocol | 所得 SAAJ 树应支持的 SOAP 协议的名称
Throws | SOAPException: 如果无法创建支持指定协议的 SOAPMessage
since | SAAJ 1.3
英文文档：

SAAJResult

public SAAJResult(String protocol)
           throws SOAPException
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the specified protocol. The DYNAMIC_SOAP_PROTOCOL is ambiguous in this context and will cause this constructor to throw an UnsupportedOperationException.

This kind of SAAJResult is meant for use in situations where the results will be used as a parameter to a method that takes a parameter whose type, such as SOAPElement, is drawn from the SAAJ API. When used in a transformation the results are populated into the SOAPPart of a SOAPMessage that is created internally. The SOAPPart returned by DOMResult.getNode() is not guaranteed to be well-formed.

Parameters:
protocol - - the name of the SOAP protocol that the resulting SAAJ tree should support
Throws:
SOAPException - if a SOAPMessage supporting the specified protocol cannot be created
Since:
SAAJ 1.3

public SAAJResult(SOAPMessage message)
创建一个 SAAJResult，它会将结果写入提供的 SOAPMessage 的 SOAPPart 中。在正常情况下，将使用 DOM API 编写这些结果，因此，如果用来创建 SOAPPart 的数据不是格式良好的，则不保证完成的 SOAPPart 格式良好。当在转换中使用时，转换之后 SOAPMessage 的有效性只有通过 SAAJ 规范之外的方式才能得到保证。
message | 消息，该消息的 SOAPPart 将会由于某些转换或编组操作而被填充
since | SAAJ 1.3
英文文档：

SAAJResult

public SAAJResult(SOAPMessage message)
Creates a SAAJResult that will write the results into the SOAPPart of the supplied SOAPMessage. In the normal case these results will be written using DOM APIs and, as a result, the finished SOAPPart will not be guaranteed to be well-formed unless the data used to create it is also well formed. When used in a transformation the validity of the SOAPMessage after the transformation can be guaranteed only by means outside SAAJ specification.

Parameters:
message - - the message whose SOAPPart will be populated as a result of some transformation or marshalling operation
Since:
SAAJ 1.3

public SAAJResult(SOAPElement rootNode)
创建一个 SAAJResult，它会将结果编写为指定 SOAPElement 的子节点。在正常情况下，将使用 DOM API 编写这些结果，因此可能使 SAAJ 树结构无效。只有在传入数据的有效性可以通过 SAAJ 规范之外的方式得到保证的情况下，才使用这种 SAAJResult。
rootNode | 将追加结果的根节点
since | SAAJ 1.3
英文文档：

SAAJResult

public SAAJResult(SOAPElement rootNode)
Creates a SAAJResult that will write the results as a child node of the SOAPElement specified. In the normal case these results will be written using DOM APIs and as a result may invalidate the structure of the SAAJ tree. This kind of SAAJResult should only be used when the validity of the incoming data can be guaranteed by means outside of the SAAJ specification.

Parameters:
rootNode - - the root to which the results will be appended
Since:
SAAJ 1.3
Method Detail

public Node getResult()
return | 在指定根 Node 下创建的结果 Tree。
since | SAAJ 1.3
英文文档：

getResult

public Node getResult()
Returns:
the resulting Tree that was created under the specified root Node.
Since:
SAAJ 1.3
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPConnection (Java EE 5)

javax.xml.soap
Class SOAPConnection

java.lang.Object
    extended by  javax.xml.soap.SOAPConnection

public abstract class SOAPConnection
extends Object

客户端可以用于直接将消息发送到（例如，用 URL 表示的）远程方的点对点连接。

SOAPConnection 类是可选的。某些实现可能无法实现此接口，在这种情况下，调用 SOAPConnectionFactory.newInstance()（参见以下内容）将抛出 UnsupportedOperationException。

客户端可以使用 SOAPConnectionFactory 对象获取 SOAPConnection 对象，如下例所示：

SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();
SOAPConnection con = factory.createConnection();
SOAPConnection 对象可用来将消息直接发送到请求/响应范例后面的 URL。也就是说，使用方法 call 来发送消息，该方法发送消息并等到收到应答为止。
英文文档：

A point-to-point connection that a client can use for sending messages directly to a remote party (represented by a URL, for instance).

The SOAPConnection class is optional. Some implementations may not implement this interface in which case the call to SOAPConnectionFactory.newInstance() (see below) will throw an UnsupportedOperationException.

A client can obtain a SOAPConnection object using a SOAPConnectionFactory object as in the following example:

      SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();
      SOAPConnection con = factory.createConnection();
A SOAPConnection object can be used to send messages directly to a URL following the request/response paradigm. That is, messages are sent using the method call, which sends the message and then waits until it gets a reply.

Constructor Summary
SOAPConnection()
Method Summary
abstract SOAPMessage | call(SOAPMessage request, Object to) Sends the given message to the specified endpoint and blocks until it has returned the response.
abstract void | close() Closes this SOAPConnection object.
SOAPMessage | get(Object to) Gets a message from a specific endpoint and blocks until it receives,
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SOAPConnection()
英文文档：

SOAPConnection

public SOAPConnection()
Method Detail

abstract public SOAPMessage call(SOAPMessage request, Object to) throws SOAPException
将给定消息发送到指定端点，在返回应答前将一直阻塞。
request | 要发送的 SOAPMessage 对象
to | 标识消息发送目的地的 Object。必须支持 java.lang.String、java.net.URL，以及 javax.xml.messaging.URLEndpoint 类型（JAXM 存在时）的 Object。
return | 响应已发送消息的 SOAPMessage 对象
Throws | SOAPException: 如果存在 SOAP 错误
英文文档：

call

public abstract SOAPMessage call(SOAPMessage request,
                                 Object to)
                          throws SOAPException
Sends the given message to the specified endpoint and blocks until it has returned the response.

Parameters:
request - the SOAPMessage object to be sent
to - an Object that identifies where the message should be sent. It is required to support Objects of type java.lang.String, java.net.URL, and when JAXM is present javax.xml.messaging.URLEndpoint
Returns:
the SOAPMessage object that is the response to the message that was sent
Throws:
SOAPException - if there is a SOAP error

public SOAPMessage get(Object to) throws SOAPException
从特定端点获取消息，在收到消息前将一直阻塞。
to | 标识请求发送目的地的 Object。必须支持 java.lang.String 和 java.net.URL 类型的 Object。
return | 响应获取消息请求的 SOAPMessage 对象
Throws | SOAPException: 如果存在 SOAP 错误
since | SAAJ 1.3
英文文档：

get

public SOAPMessage get(Object to)
                throws SOAPException
Gets a message from a specific endpoint and blocks until it receives,

Parameters:
to - an Object that identifies where the request should be sent. Objects of type java.lang.String and java.net.URL must be supported.
Returns:
the SOAPMessage object that is the response to the get message request
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.3

abstract public void close() throws SOAPException
关闭此 SOAPConnection 对象。
Throws SOAPException: 如果存在 SOAP 错误
英文文档：

close

public abstract void close()
                    throws SOAPException
Closes this SOAPConnection object.

Throws:
SOAPException - if there is a SOAP error
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPConnectionFactory (Java EE 5)

javax.xml.soap
Class SOAPConnectionFactory

java.lang.Object
    extended by  javax.xml.soap.SOAPConnectionFactory

public abstract class SOAPConnectionFactory
extends Object

创建 SOAPConnection 对象的工厂。此类的实现是可选的。如果 SOAPConnectionFactory.newInstance() 抛出 UnsupportedOperationException，则该实现不支持 SAAJ 通信基础设施。否则，可以通过在新创建的 SOAPConnectionFactory 对象上调用 createConnection() 来创建 SOAPConnection 对象。
英文文档：

A factory for creating SOAPConnection objects. Implementation of this class is optional. If SOAPConnectionFactory.newInstance() throws an UnsupportedOperationException then the implementation does not support the SAAJ communication infrastructure. Otherwise SOAPConnection objects can be created by calling createConnection() on the newly created SOAPConnectionFactory object.

Constructor Summary
SOAPConnectionFactory()
Method Summary
abstract SOAPConnection | createConnection() Create a new SOAPConnection.
static SOAPConnectionFactory | newInstance() Creates an instance of the default SOAPConnectionFactory object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SOAPConnectionFactory()
英文文档：

SOAPConnectionFactory

public SOAPConnectionFactory()
Method Detail

public static SOAPConnectionFactory newInstance() throws SOAPException, UnsupportedOperationException
创建默认 SOAPConnectionFactory 对象的实例。
return | 默认 SOAPConnectionFactory 对象的新实例
Throws | SOAPException: 如果在创建 SOAPConnectionFactory 时出现问题
Throws | UnsupportedOperationException: 如果不支持新实例。
英文文档：

newInstance

public static SOAPConnectionFactory newInstance()
                                         throws SOAPException,
                                                UnsupportedOperationException
Creates an instance of the default SOAPConnectionFactory object.

Returns:
a new instance of a default SOAPConnectionFactory object
Throws:
SOAPException - if there was an error creating the SOAPConnectionFactory
UnsupportedOperationException - if newInstance is not supported.

abstract public SOAPConnection createConnection() throws SOAPException
创建新的 SOAPConnection。
return | 新的 SOAPConnection 对象。
Throws | SOAPException: 如果在创建 SOAPConnection 时出现异常。
英文文档：

createConnection

public abstract SOAPConnection createConnection()
                                         throws SOAPException
Create a new SOAPConnection.

Returns:
the new SOAPConnection object.
Throws:
SOAPException - if there was an exception creating the SOAPConnection object.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPElementFactory (Java EE 5)

javax.xml.soap
Class SOAPElementFactory

java.lang.Object
    extended by  javax.xml.soap.SOAPElementFactory
Deprecated. - Use javax.xml.soap.SOAPFactory for creating SOAPElements.

SOAPElementFactory 是最终成为 SOAP 部分的 XML 片段的工厂。这些片段可以作为 SOAPHeader 或 SOAPBody 或 SOAPEnvelope 的子元素插入。

使用此工厂创建的元素没有 SOAP 头文档中所含元素的属性。当插入这些元素时，它们被复制到 XML 文档树。

deprecated | - 使用 javax.xml.soap.SOAPFactory 创建 SOAPElements。
See also | javax.xml.soap.SOAPFactory
英文文档：

public class SOAPElementFactory
extends Object

SOAPElementFactory is a factory for XML fragments that will eventually end up in the SOAP part. These fragments can be inserted as children of the SOAPHeader or SOAPBody or SOAPEnvelope.

Elements created using this factory do not have the properties of an element that lives inside a SOAP header document. These elements are copied into the XML document tree when they are inserted.

See Also:
SOAPFactory

Method Summary
 SOAPElement create(Name name)
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(javax.xml.soap.Name) instead
 SOAPElement create(String localName)
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(String localName) instead
 SOAPElement create(String localName, String prefix, String uri)
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(String localName, String prefix, String uri) instead
static SOAPElementFactory newInstance()
Deprecated. Creates a new instance of SOAPElementFactory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

public SOAPElement create(Name name) throws SOAPException
创建使用给定 Name 对象初始化的 SOAPElement 对象。
name | 带有新元素 XML 名称的 Name 对象
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
deprecated | 使用 javax.xml.soap.SOAPFactory.createElement(javax.xml.soap.Name) 替换
See also | createElement(javax.xml.soap.Name), createElement(javax.xml.namespace.QName)
英文文档：

create

public SOAPElement create(Name name)
                   throws SOAPException
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(javax.xml.soap.Name) instead

Create a SOAPElement object initialized with the given Name object.

Parameters:
name - a Name object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
See Also:
SOAPFactory.createElement(javax.xml.soap.Name), SOAPFactory.createElement(javax.xml.namespace.QName)

public SOAPElement create(String localName) throws SOAPException
创建使用给定本地名称初始化的 SOAPElement 对象。
localName | 给出新元素本地名称的 String
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
deprecated | 使用 javax.xml.soap.SOAPFactory.createElement(String localName) 替换
See also | createElement(java.lang.String)
英文文档：

create

public SOAPElement create(String localName)
                   throws SOAPException
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(String localName) instead

Create a SOAPElement object initialized with the given local name.

Parameters:
localName - a String giving the local name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
See Also:
SOAPFactory.createElement(java.lang.String)

public SOAPElement create(String localName, String prefix, String uri) throws SOAPException
使用给定的本地名称、前缀和 URL 创建新的 SOAPElement 对象。
localName | 给出新元素本地名称的 String
prefix | 此 SOAPElement 的前缀
uri | 给出新元素所属命名空间 URI 的 String
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
deprecated | 使用 javax.xml.soap.SOAPFactory.createElement(String localName, String prefix, String uri) 替换
See also | createElement(java.lang.String, java.lang.String, java.lang.String)
英文文档：

create

public SOAPElement create(String localName,
                          String prefix,
                          String uri)
                   throws SOAPException
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(String localName, String prefix, String uri) instead

Create a new SOAPElement object with the given local name, prefix and uri.

Parameters:
localName - a String giving the local name for the new element
prefix - the prefix for this SOAPElement
uri - a String giving the URI of the namespace to which the new element belongs
Throws:
SOAPException - if there is an error in creating the SOAPElement object
See Also:
SOAPFactory.createElement(java.lang.String, java.lang.String, java.lang.String)

public static SOAPElementFactory newInstance() throws SOAPException
创建新的 SOAPElementFactory 实例。
return | 新的 SOAPElementFactory 实例
Throws | SOAPException: 如果在创建默认 SOAPElementFactory 时出现错误
英文文档：

newInstance

public static SOAPElementFactory newInstance()
                                      throws SOAPException
Deprecated.
Creates a new instance of SOAPElementFactory.

Returns:
a new instance of a SOAPElementFactory
Throws:
SOAPException - if there was an error creating the default SOAPElementFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPFactory (Java EE 5)

javax.xml.soap
Class SOAPFactory

java.lang.Object
    extended by  javax.xml.soap.SOAPFactory

public abstract class SOAPFactory
extends Object

SOAPFactory 是用来创建存在于 SOAP XML 树中的各种对象的工厂。SOAPFactory 可以用于创建最终成为 SOAP 部分的 XML 片段。这些片段可以作为 SOAPHeaderElement、SOAPBodyElement、SOAPEnvelope 或其他 SOAPElement 对象的子级插入。SOAPFactory 还具有创建 javax.xml.soap.Detail 对象以及 java.xml.soap.Name 对象的方法。
英文文档：

SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree. SOAPFactory can be used to create XML fragments that will eventually end up in the SOAP part. These fragments can be inserted as children of the SOAPHeaderElement or SOAPBodyElement or SOAPEnvelope or other SOAPElement objects. SOAPFactory also has methods to create javax.xml.soap.Detail objects as well as java.xml.soap.Name objects.

Constructor Summary
SOAPFactory()
Method Summary
abstract Detail | createDetail() Creates a new Detail object which serves as a container for DetailEntry objects.
SOAPElement | createElement(Element domElement) Creates a SOAPElement object from an existing DOM Element.
abstract SOAPElement | createElement(Name name) Creates a SOAPElement object initialized with the given Name object.
SOAPElement | createElement(QName qname) Creates a SOAPElement object initialized with the given QName object.
abstract SOAPElement | createElement(String localName) Creates a SOAPElement object initialized with the given local name.
abstract SOAPElement | createElement(String localName, String prefix, String uri) Creates a new SOAPElement object with the given local name, prefix and uri.
abstract SOAPFault | createFault() Creates a new default SOAPFault object
abstract SOAPFault | createFault(String reasonText, QName faultCode) Creates a new SOAPFault object initialized with the given reasonText and faultCode
abstract Name | createName(String localName) Creates a new Name object initialized with the given local name.
abstract Name | createName(String localName, String prefix, String uri) Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.
static SOAPFactory | newInstance() Creates a new SOAPFactory object that is an instance of the default implementation (SOAP 1.1), This method uses the following ordered lookup procedure to determine the SOAPFactory implementation class to load: Use the javax.xml.soap.SOAPFactory system property.
static SOAPFactory | newInstance(String protocol) Creates a new SOAPFactory object that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public SOAPFactory()
英文文档：

SOAPFactory

public SOAPFactory()
Method Detail

public SOAPElement createElement(org.w3c.dom.Element domElement) throws SOAPException
根据现有的 DOM Element 创建 SOAPElement 对象。如果作为参数传入的 DOM Element 已经是一个 SOAPElement，那么此方法必须不作任何修改地返回该参数。否则，会创建新的 SOAPElement 并进行此 domElement 参数的深层复制。返回值的具体类型将取决于 domElement 参数的名称。如果以 domElement 为根的树的任何部分违背了 SOAP 规则，则会抛出 SOAPException。
domElement | 要复制的 Element。
return | 一个新的 SOAPElement，它是 domElement 的副本。
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
since | SAAJ 1.3
英文文档：

createElement

public SOAPElement createElement(Element domElement)
                          throws SOAPException
Creates a SOAPElement object from an existing DOM Element. If the DOM Element that is passed in as an argument is already a SOAPElement then this method must return it unmodified without any further work. Otherwise, a new SOAPElement is created and a deep copy is made of the domElement argument. The concrete type of the return value will depend on the name of the domElement argument. If any part of the tree rooted in domElement violates SOAP rules, a SOAPException will be thrown.

Parameters:
domElement - - the Element to be copied.
Returns:
a new SOAPElement that is a copy of domElement.
Throws:
SOAPException - if there is an error in creating the SOAPElement object
Since:
SAAJ 1.3

abstract public SOAPElement createElement(Name name) throws SOAPException
创建使用给定 Name 对象初始化的 SOAPElement 对象。返回值的具体类型将取决于提供给新 SOAPElement 的名称。例如，一个带有名称 "{http://www.w3.org/2003/05/soap-envelope}Envelope" 的新 SOAPElement 会导致创建支持 SOAP 1.2 行为的 SOAPEnvelope。
name | 带有新元素 XML 名称的 Name 对象
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
See also | createElement(javax.xml.namespace.QName)
英文文档：

createElement

public abstract SOAPElement createElement(Name name)
                                   throws SOAPException
Creates a SOAPElement object initialized with the given Name object. The concrete type of the return value will depend on the name given to the new SOAPElement. For instance, a new SOAPElement with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a SOAPEnvelope that supports SOAP 1.2 behavior to be created.

Parameters:
name - a Name object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
See Also:
createElement(javax.xml.namespace.QName)

public SOAPElement createElement(javax.xml.namespace.QName qname) throws SOAPException
创建使用给定 QName 对象初始化的 SOAPElement 对象。返回值的具体类型将取决于提供给新 SOAPElement 的名称。例如，一个带有名称 "{http://www.w3.org/2003/05/soap-envelope}Envelope" 的新 SOAPElement 会导致创建支持 SOAP 1.2 行为的 SOAPEnvelope。
qname | 带有新元素 XML 名称的 QName 对象
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
since | SAAJ 1.3
See also | createElement(Name)
英文文档：

createElement

public SOAPElement createElement(QName qname)
                          throws SOAPException
Creates a SOAPElement object initialized with the given QName object. The concrete type of the return value will depend on the name given to the new SOAPElement. For instance, a new SOAPElement with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a SOAPEnvelope that supports SOAP 1.2 behavior to be created.

Parameters:
qname - a QName object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object
Since:
SAAJ 1.3
See Also:
createElement(Name)

abstract public SOAPElement createElement(String localName) throws SOAPException
创建使用给定本地名称初始化的 SOAPElement 对象。
localName | 给出新元素本地名称的 String
return | 创建的新 SOAPElement 对象
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
英文文档：

createElement

public abstract SOAPElement createElement(String localName)
                                   throws SOAPException
Creates a SOAPElement object initialized with the given local name.

Parameters:
localName - a String giving the local name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

abstract public SOAPElement createElement(String localName, String prefix, String uri) throws SOAPException
使用本地名称、前缀和 URI 创建新的 SOAPElement 对象。返回值的具体类型将取决于提供给新 SOAPElement 的名称。例如，一个带有名称 "{http://www.w3.org/2003/05/soap-envelope}Envelope" 的新 SOAPElement 会导致创建支持 SOAP 1.2 行为的 SOAPEnvelope。
localName | 给出新元素本地名称的 String
prefix | 此 SOAPElement 的前缀
uri | 给出新元素所属命名空间 URI 的 String
Throws | SOAPException: 如果在创建 SOAPElement 对象时存在错误
英文文档：

createElement

public abstract SOAPElement createElement(String localName,
                                          String prefix,
                                          String uri)
                                   throws SOAPException
Creates a new SOAPElement object with the given local name, prefix and uri. The concrete type of the return value will depend on the name given to the new SOAPElement. For instance, a new SOAPElement with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a SOAPEnvelope that supports SOAP 1.2 behavior to be created.

Parameters:
localName - a String giving the local name for the new element
prefix - the prefix for this SOAPElement
uri - a String giving the URI of the namespace to which the new element belongs
Throws:
SOAPException - if there is an error in creating the SOAPElement object

abstract public Detail createDetail() throws SOAPException
创建充当 DetailEntry 对象容器的新 Detail 对象。

此工厂方法创建 Detail 对象，用于不可能使用 SOAPFault 抽象的情况。

return | 一个 Detail 对象
Throws | SOAPException: 如果存在 SOAP 错误
Throws | UnsupportedOperationException: 如果为 SOAPFactory 指定的协议是 DYNAMIC_SOAP_PROTOCOL
英文文档：

createDetail

public abstract Detail createDetail()
                             throws SOAPException
Creates a new Detail object which serves as a container for DetailEntry objects.

This factory method creates Detail objects for use in situations where it is not practical to use the SOAPFault abstraction.

Returns:
a Detail object
Throws:
SOAPException - if there is a SOAP error
UnsupportedOperationException - if the protocol specified for the SOAPFactory was DYNAMIC_SOAP_PROTOCOL

abstract public SOAPFault createFault(String reasonText, javax.xml.namespace.QName faultCode) throws SOAPException
创建使用给定 reasonText 和 faultCode 初始化的新 SOAPFault 对象
reasonText | 错误的 ReasonText/FaultString
faultCode | 错误的 FaultCode
return | 一个 SOAPFault 对象
Throws | SOAPException: 如果存在 SOAP 错误
since | SAAJ 1.3
英文文档：

createFault

public abstract SOAPFault createFault(String reasonText,
                                      QName faultCode)
                               throws SOAPException
Creates a new SOAPFault object initialized with the given reasonText and faultCode

Parameters:
reasonText - the ReasonText/FaultString for the fault
faultCode - the FaultCode for the fault
Returns:
a SOAPFault object
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.3

abstract public SOAPFault createFault() throws SOAPException
创建一个新的默认 SOAPFault 对象
return | 一个 SOAPFault 对象
Throws | SOAPException: 如果存在 SOAP 错误
since | SAAJ 1.3
英文文档：

createFault

public abstract SOAPFault createFault()
                               throws SOAPException
Creates a new default SOAPFault object

Returns:
a SOAPFault object
Throws:
SOAPException - if there is a SOAP error
Since:
SAAJ 1.3

abstract public Name createName(String localName, String prefix, String uri) throws SOAPException
创建使用给定本地名称、名称空间前缀和名称空间 URI 初始化的新 Name 对象。

此工厂方法创建 Name 对象，用于不可能使用 SOAPEnvelope 抽象的情况。

localName | 给出本地名称的 String
prefix | 给出名称空间前缀的 String
uri | 给出名称空间 URI 的 String
return | 使用给定本地名称、名称空间前缀和名称空间 URI 初始化的 Name 对象
Throws | SOAPException: 如果存在 SOAP 错误
英文文档：

createName

public abstract Name createName(String localName,
                                String prefix,
                                String uri)
                         throws SOAPException
Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.

This factory method creates Name objects for use in situations where it is not practical to use the SOAPEnvelope abstraction.

Parameters:
localName - a String giving the local name
prefix - a String giving the prefix of the namespace
uri - a String giving the URI of the namespace
Returns:
a Name object initialized with the given local name, namespace prefix, and namespace URI
Throws:
SOAPException - if there is a SOAP error

abstract public Name createName(String localName) throws SOAPException
创建使用给定本地名称初始化的新 Name 对象。

此工厂方法创建 Name 对象，用于不可能使用 SOAPEnvelope 抽象的情况。

localName | 给出本地名称的 String
return | 使用给定本地名称初始化的 Name 对象
Throws | SOAPException: 如果存在 SOAP 错误
英文文档：

createName

public abstract Name createName(String localName)
                         throws SOAPException
Creates a new Name object initialized with the given local name.

This factory method creates Name objects for use in situations where it is not practical to use the SOAPEnvelope abstraction.

Parameters:
localName - a String giving the local name
Returns:
a Name object initialized with the given local name
Throws:
SOAPException - if there is a SOAP error

public static SOAPFactory newInstance() throws SOAPException
创建新的 SOAPFactory 对象，该对象是默认实现 (SOAP 1.1) 的实例。 此方法使用以下查找过程顺序来确定要加载的 SOAPFactory 实现类：
  • 使用 javax.xml.soap.SOAPFactory 系统属性。
  • 使用 JRE 文件夹中的属性文件 "lib/jaxm.properties"。此配置文件格式是标准的 java.util.Properties 格式且包含实现类的完全限定名，其中实现类的键是上文定义的系统属性。
  • 如果 Services API（在 JAR 规范中进行了详细描述）可用，可以使用它来确定类名称。Services API 将查找在运行时可用的 jar 中 META-INF/services/javax.xml.soap.SOAPFactory 文件中的类名称。
  • 使用 SAAJMetaFactory 实例来定位 SOAPFactory 实现类。
return | 新的 SOAPFactory 实例
Throws | SOAPException: 如果在创建默认 SOAPFactory 时出现错误
See also | javax.xml.soap.SAAJMetaFactory
英文文档：

newInstance

public static SOAPFactory newInstance()
                               throws SOAPException
Creates a new SOAPFactory object that is an instance of the default implementation (SOAP 1.1), This method uses the following ordered lookup procedure to determine the SOAPFactory implementation class to load:
  • Use the javax.xml.soap.SOAPFactory system property.
  • Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
  • Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.soap.SOAPFactory in jars available to the runtime.
  • Use the SAAJMetaFactory instance to locate the SOAPFactory implementation class.

Returns:
a new instance of a SOAPFactory
Throws:
SOAPException - if there was an error creating the default SOAPFactory
See Also:
SAAJMetaFactory

public static SOAPFactory newInstance(String protocol) throws SOAPException
创建新的 SOAPFactory 对象，该对象是指定实现的实例，此方法使用 SAAJMetaFactory 来定位实现类并创建 SOAPFactory 实例。
return | 新的 SOAPFactory 实例
protocol | 字符串常量，表示指定 SOAP 工厂实现的协议。可以是 DYNAMIC_SOAP_PROTOCOL、DEFAULT_SOAP_PROTOCOL（等同于 SOAP_1_1_PROTOCOL）或 SOAP_1_2_PROTOCOL。
Throws | SOAPException: 如果在创建指定 SOAPFactory 时出现错误
since | SAAJ 1.3
See also | javax.xml.soap.SAAJMetaFactory
英文文档：

newInstance

public static SOAPFactory newInstance(String protocol)
                               throws SOAPException
Creates a new SOAPFactory object that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.

Parameters:
protocol - a string constant representing the protocol of the specified SOAP factory implementation. May be either DYNAMIC_SOAP_PROTOCOL, DEFAULT_SOAP_PROTOCOL (which is the same as) SOAP_1_1_PROTOCOL, or SOAP_1_2_PROTOCOL.
Returns:
a new instance of a SOAPFactory
Throws:
SOAPException - if there was an error creating the specified SOAPFactory
Since:
SAAJ 1.3
See Also:
SAAJMetaFactory
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPMessage (Java EE 5)

javax.xml.soap
Class SOAPMessage

java.lang.Object
    extended by  javax.xml.soap.SOAPMessage

public abstract class SOAPMessage
extends Object

所有 SOAP 消息的根类。因为 SOAP 消息是通过“导线”传输的，所以它是 XML 文档或第一个正文部分为 XML/SOAP 文档的 MIME 消息。

SOAPMessage 对象由一个 SOAP 部分和一个或多个附件部分（可选）组成。SOAPMessage 对象的 SOAP 部分是一个 SOAPPart 对象，包含了用于消息路由和标识的信息，并可以包含特定于应用程序的内容。消息 SOAP 部分中的所有数据都必须是 XML 格式。

默认情况下，新的 SOAPMessage 对象包含以下对象：

  • 一个 SOAPPart 对象
  • 一个 SOAPEnvelope 对象
  • 一个 SOAPBody 对象
  • 一个 SOAPHeader 对象
可以通过调用方法 SOAPMessage.getSOAPPart() 检索消息的 SOAP 部分。SOAPEnvelope 对象是从 SOAPPart 对象检索的，SOAPEnvelope 对象用于检索 SOAPBody 和 SOAPHeader 对象。
SOAPPart sp = message.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();

除强制性 SOAPPart 对象之外，SOAPMessage 对象还可以包含零个或多个 AttachmentPart 对象，每个 AttachmentPart 对象都包含特定于应用程序的数据。SOAPMessage 接口提供了一些用于创建 AttachmentPart 对象的方法，以及一些将它们添加到 SOAPMessage 对象的方法。收到 SOAPMessage 对象的一方可以通过检索各个附件部分来检查消息内容。

与 SOAP 消息的其余部分不同，附件不需要是 XML 格式，因此可以是简单文本或图像文件等任何形式。因此，任何非 XML 格式的消息内容必须在 AttachmentPart 对象中。

MessageFactory 对象可以创建行为特定于具体 SAAJ 实现或应用程序的 SOAPMessage 对象。例如，MessageFactory 对象可以生成符合特定配置文件（如 ebXML）的 SOAPMessage 对象。在这种情况下，MessageFactory 对象可以生成使用 ebXML 头初始化的 SOAPMessage 对象。

为了确保与后向源的兼容性，在 SAAJ 规范的 1.1 版本之后添加到此类的方法都是具体而非抽象的，它们都具有默认实现。除在 JavaDocs 中有对这些方法的另行说明外，默认实现只是抛出 UnsupportedOperationException，并且 SAAJ 实现代码必须使用提供指定行为的方法重写它们。但是，只要没有声明符合初始版本之后的某些更高版本规范，遗留客户端代码就没有这种限制。可以根据 SAAJ API 的未修改后续版本来编译和/或运行扩展 SOAPMessage 类的遗留类。如果正确实现了这样的类，则对于规范的更高版本（相对于初始版本）来说，该类将继续有效。

See also javax.xml.soap.MessageFactory, javax.xml.soap.AttachmentPart
英文文档：

The root class for all SOAP messages. As transmitted on the "wire", a SOAP message is an XML document or a MIME message whose first body part is an XML/SOAP document.

A SOAPMessage object consists of a SOAP part and optionally one or more attachment parts. The SOAP part for a SOAPMessage object is a SOAPPart object, which contains information used for message routing and identification, and which can contain application-specific content. All data in the SOAP Part of a message must be in XML format.

A new SOAPMessage object contains the following by default:

  • A SOAPPart object
  • A SOAPEnvelope object
  • A SOAPBody object
  • A SOAPHeader object
The SOAP part of a message can be retrieved by calling the method SOAPMessage.getSOAPPart(). The SOAPEnvelope object is retrieved from the SOAPPart object, and the SOAPEnvelope object is used to retrieve the SOAPBody and SOAPHeader objects.
     SOAPPart sp = message.getSOAPPart();
     SOAPEnvelope se = sp.getEnvelope();
     SOAPBody sb = se.getBody();
     SOAPHeader sh = se.getHeader();

In addition to the mandatory SOAPPart object, a SOAPMessage object may contain zero or more AttachmentPart objects, each of which contains application-specific data. The SOAPMessage interface provides methods for creating AttachmentPart objects and also for adding them to a SOAPMessage object. A party that has received a SOAPMessage object can examine its contents by retrieving individual attachment parts.

Unlike the rest of a SOAP message, an attachment is not required to be in XML format and can therefore be anything from simple text to an image file. Consequently, any message content that is not in XML format must be in an AttachmentPart object.

A MessageFactory object may create SOAPMessage objects with behavior that is specialized to a particular implementation or application of SAAJ. For instance, a MessageFactory object may produce SOAPMessage objects that conform to a particular Profile such as ebXML. In this case a MessageFactory object might produce SOAPMessage objects that are initialized with ebXML headers.

In order to ensure backward source compatibility, methods that are added to this class after version 1.1 of the SAAJ specification are all concrete instead of abstract and they all have default implementations. Unless otherwise noted in the JavaDocs for those methods the default implementations simply throw an UnsupportedOperationException and the SAAJ implementation code must override them with methods that provide the specified behavior. Legacy client code does not have this restriction, however, so long as there is no claim made that it conforms to some later version of the specification than it was originally written for. A legacy class that extends the SOAPMessage class can be compiled and/or run against succeeding versions of the SAAJ API without modification. If such a class was correctly implemented then it will continue to behave correctly relative to the version of the specification against which it was written.

See Also:
MessageFactory, AttachmentPart

Field Summary
static String | CHARACTER_SET_ENCODING Specifies the character type encoding for the SOAP Message.
static String | WRITE_XML_DECLARATION Specifies whether the SOAP Message will contain an XML declaration when it is sent.
Constructor Summary
SOAPMessage()
Method Summary
abstract void | addAttachmentPart(AttachmentPart AttachmentPart) Adds the given AttachmentPart object to this SOAPMessage object.
abstract int | countAttachments() Gets a count of the number of attachments in this message.
abstract AttachmentPart | createAttachmentPart() Creates a new empty AttachmentPart object.
AttachmentPart | createAttachmentPart(DataHandler dataHandler) Creates an AttachmentPart object and populates it using the given DataHandler object.
AttachmentPart | createAttachmentPart(Object content, String contentType) Creates an AttachmentPart object and populates it with the specified data of the specified content type.
abstract AttachmentPart | getAttachment(SOAPElement element) Returns an AttachmentPart object that is associated with an attachment that is referenced by this SOAPElement or null if no such attachment exists.
abstract Iterator | getAttachments() Retrieves all the AttachmentPart objects that are part of this SOAPMessage object.
abstract Iterator | getAttachments(MimeHeaders headers) Retrieves all the AttachmentPart objects that have header entries that match the specified headers.
abstract String | getContentDescription() Retrieves a description of this SOAPMessage object's content.
abstract MimeHeaders | getMimeHeaders() Returns all the transport-specific MIME headers for this SOAPMessage object in a transport-independent fashion.
Object | getProperty(String property) Retrieves value of the specified property.
SOAPBody | getSOAPBody() Gets the SOAP Body contained in this SOAPMessage object.
SOAPHeader | getSOAPHeader() Gets the SOAP Header contained in this SOAPMessage object.
abstract SOAPPart | getSOAPPart() Gets the SOAP part of this SOAPMessage object.
abstract void | removeAllAttachments() Removes all AttachmentPart objects that have been added to this SOAPMessage object.
abstract void | removeAttachments(MimeHeaders headers) Removes all the AttachmentPart objects that have header entries that match the specified headers.
abstract void | saveChanges() Updates this SOAPMessage object with all the changes that have been made to it.
abstract boolean | saveRequired() Indicates whether this SOAPMessage object needs to have the method saveChanges called on it.
abstract void | setContentDescription(String description) Sets the description of this SOAPMessage object's content with the given description.
void | setProperty(String property, Object value) Associates the specified value with the specified property.
abstract void | writeTo(OutputStream out) Writes this SOAPMessage object to the given output stream.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

CHARACTER_SET_ENCODING

public static final String CHARACTER_SET_ENCODING
Specifies the character type encoding for the SOAP Message. Valid values include "utf-8" and "utf-16". See vendor documentation for additional supported values. The default is "utf-8".

Since:
SAAJ 1.2
See Also:
SOAPMessage.setProperty, Constant Field Values

英文文档：

WRITE_XML_DECLARATION

public static final String WRITE_XML_DECLARATION
Specifies whether the SOAP Message will contain an XML declaration when it is sent. The only valid values are "true" and "false". The default is "false".

Since:
SAAJ 1.2
See Also:
SOAPMessage.setProperty, Constant Field Values
Constructor Detail

public SOAPMessage()
英文文档：

SOAPMessage

public SOAPMessage()
Method Detail

英文文档：

setContentDescription

public abstract void setContentDescription(String description)
Sets the description of this SOAPMessage object's content with the given description.

Parameters:
description - a String describing the content of this message
See Also:
getContentDescription()

英文文档：

getContentDescription

public abstract String getContentDescription()
Retrieves a description of this SOAPMessage object's content.

Returns:
a String describing the content of this message or null if no description has been set
See Also:
setContentDescription(java.lang.String)

英文文档：

getSOAPPart

public abstract SOAPPart getSOAPPart()
Gets the SOAP part of this SOAPMessage object.

SOAPMessage object contains one or more attachments, the SOAP Part must be the first MIME body part in the message.

Returns:
the SOAPPart object for this SOAPMessage object

英文文档：

getSOAPBody

public SOAPBody getSOAPBody()
                     throws SOAPException
Gets the SOAP Body contained in this SOAPMessage object.

Returns:
the SOAPBody object contained by this SOAPMessage object
Throws:
SOAPException - if the SOAP Body does not exist or cannot be retrieved
Since:
SAAJ 1.2

英文文档：

getSOAPHeader

public SOAPHeader getSOAPHeader()
                         throws SOAPException
Gets the SOAP Header contained in this SOAPMessage object.

Returns:
the SOAPHeader object contained by this SOAPMessage object
Throws:
SOAPException - if the SOAP Header does not exist or cannot be retrieved
Since:
SAAJ 1.2

abstract public void removeAllAttachments()
移除所有已经添加到此 SOAPMessage 对象的 AttachmentPart 对象。

此方法不接触 SOAP 部分。

英文文档：

removeAllAttachments

public abstract void removeAllAttachments()
Removes all AttachmentPart objects that have been added to this SOAPMessage object.

This method does not touch the SOAP part.

abstract public int countAttachments()
获取此消息中附件数量的计数。此计数不包括 SOAP 部分。
return 作为此 SOAPMessage 对象一部分的 AttachmentPart 对象的数量
英文文档：

countAttachments

public abstract int countAttachments()
Gets a count of the number of attachments in this message. This count does not include the SOAP part.

Returns:
the number of AttachmentPart objects that are part of this SOAPMessage object

英文文档：

getAttachments

public abstract Iterator getAttachments()
Retrieves all the AttachmentPart objects that are part of this SOAPMessage object.

Returns:
an iterator over all the attachments in this message

英文文档：

getAttachments

public abstract Iterator getAttachments(MimeHeaders headers)
Retrieves all the AttachmentPart objects that have header entries that match the specified headers. Note that a returned attachment could have headers in addition to those specified.

Parameters:
headers - a MimeHeaders object containing the MIME headers for which to search
Returns:
an iterator over all attachments that have a header that matches one of the given headers

abstract public void removeAttachments(MimeHeaders headers)
移除所有头条目匹配指定头的 AttachmentPart 对象。注意，移除的附件除指定的头之外，还可以有其他头。
headers | 包含要搜索的 MIME 头的 MimeHeaders 对象
since | SAAJ 1.3
英文文档：

removeAttachments

public abstract void removeAttachments(MimeHeaders headers)
Removes all the AttachmentPart objects that have header entries that match the specified headers. Note that the removed attachment could have headers in addition to those specified.

Parameters:
headers - a MimeHeaders object containing the MIME headers for which to search
Since:
SAAJ 1.3

abstract public AttachmentPart getAttachment(SOAPElement element) throws SOAPException
返回与此 SOAPElement 引用的附件关联的 AttachmentPart 对象，如果不存在此类附件，则返回 null。可以通过 java.lang.NullPointerException at com.sun.tools.javadoc.DocEnv.getClassSymbol(DocEnv.java:177) at com.sun.tools.javadoc.DocEnv.lookupClass(DocEnv.java:133) at com.sun.tools.javadoc.ClassDocImpl.searchClass(ClassDocImpl.java:682) at com.sun.tools.javadoc.ClassDocImpl.findClass(ClassDocImpl.java:665) at com.sun.tools.docserver.DocServlet.writeSeeTagDoc(DocServlet.java:900) at com.sun.tools.docserver.DocServlet.writeInlineTagString(DocServlet.java:989) at com.sun.tools.docserver.DocServlet.writeTagPara(DocServlet.java:614) at com.sun.tools.docserver.DocServlet.writeDoc(DocServlet.java:523) at com.sun.tools.docserver.DocServlet.writeMethodTable(DocServlet.java:877) at com.sun.tools.docserver.DocServlet.processRequest(DocServlet.java:229) at com.sun.tools.docserver.DocServlet.doGet(DocServlet.java:744) at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:268) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:631) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:562) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:803) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
About DocWeb · Bundles · Export · Export AllTop 10 · Statistics · Login
About Sun · Contact · Privacy · Terms of Use · Trademarks
Java EE 5 SDK
· Copyright © 1994-2008 Sun Microsystems, Inc.
英文文档：

getAttachment

public abstract AttachmentPart getAttachment(SOAPElement element)
                                      throws SOAPException
Returns an AttachmentPart object that is associated with an attachment that is referenced by this SOAPElement or null if no such attachment exists. References can be made via an href attribute as described in SOAP Messages with Attachments, or via a single Text child node containing a URI as described in the WS-I Attachments Profile 1.0 for elements of schema type ref:swaRef(ref:swaRef). These two mechanisms must be supported. The support for references via href attribute also implies that this method should also be supported on an element that is an xop:Include element ( XOP). other reference mechanisms may be supported by individual implementations of this standard. Contact your vendor for details.

Parameters:
element - The SOAPElement containing the reference to an Attachment
Returns:
the referenced AttachmentPart or null if no such AttachmentPart exists or no reference can be found in this SOAPElement.
Throws:
SOAPException - if there is an error in the attempt to access the attachment
Since:
SAAJ 1.3

abstract public void addAttachmentPart(AttachmentPart AttachmentPart)
将给定的 AttachmentPart 对象添加到此 SOAPMessage 对象。必须先创建 AttachmentPart 对象，然后才能将其添加到消息。
AttachmentPart | 将作为此 SOAPMessage 对象一部分的 AttachmentPart 对象
Throws | IllegalArgumentException:
英文文档：

addAttachmentPart

public abstract void addAttachmentPart(AttachmentPart AttachmentPart)
Adds the given AttachmentPart object to this SOAPMessage object. An AttachmentPart object must be created before it can be added to a message.

Parameters:
AttachmentPart - an AttachmentPart object that is to become part of this SOAPMessage object
Throws:
IllegalArgumentException

abstract public AttachmentPart createAttachmentPart()
创建一个新的空 AttachmentPart 对象。注意，调用方法 addAttachmentPart 时必须将此新 AttachmentPart 对象作为参数，以便该对象成为此 SOAPMessage 对象的附件。
return 可以填充并添加到此 SOAPMessage 对象的新的 AttachmentPart 对象
英文文档：

createAttachmentPart

public abstract AttachmentPart createAttachmentPart()
Creates a new empty AttachmentPart object. Note that the method addAttachmentPart must be called with this new AttachmentPart object as the parameter in order for it to become an attachment to this SOAPMessage object.

Returns:
a new AttachmentPart object that can be populated and added to this SOAPMessage object

public AttachmentPart createAttachmentPart(DataHandler dataHandler)
创建 AttachmentPart 对象并使用给定的 DataHandler 对象填充。
dataHandler | 将生成此 SOAPMessage 对象内容的 javax.activation.DataHandler 对象
return | 包含给定 DataHandler 对象生成数据的新的 AttachmentPart 对象
Throws | IllegalArgumentException: 如果指定的 DataHandler 对象存在问题
See also | javax.activation.DataHandler, javax.activation.DataContentHandler
英文文档：

createAttachmentPart

public AttachmentPart createAttachmentPart(DataHandler dataHandler)
Creates an AttachmentPart object and populates it using the given DataHandler object.

Parameters:
dataHandler - the javax.activation.DataHandler object that will generate the content for this SOAPMessage object
Returns:
a new AttachmentPart object that contains data generated by the given DataHandler object
Throws:
IllegalArgumentException - if there was a problem with the specified DataHandler object
See Also:
DataHandler, DataContentHandler

英文文档：

getMimeHeaders

public abstract MimeHeaders getMimeHeaders()
Returns all the transport-specific MIME headers for this SOAPMessage object in a transport-independent fashion.

Returns:
a MimeHeaders object containing the MimeHeader objects

public AttachmentPart createAttachmentPart(Object content, String contentType)
创建 AttachmentPart 对象并使用指定内容类型的指定数据填充。Object 的类型应该对应于指定给 Content-Type 的值。
content | 包含要创建的 AttachmentPart 对象内容的 Object
contentType | 给出内容类型的 String 对象；例如 "text/xml"、"text/plain" 和 "image/jpeg"
return | 包含给定数据的新的 AttachmentPart 对象
Throws | IllegalArgumentException: 如果 contentType 不匹配内容对象的类型，或者没有给定内容对象的 DataContentHandler 对象时抛出
See also | javax.activation.DataHandler, javax.activation.DataContentHandler
英文文档：

createAttachmentPart

public AttachmentPart createAttachmentPart(Object content,
                                           String contentType)
Creates an AttachmentPart object and populates it with the specified data of the specified content type. The type of the Object should correspond to the value given for the Content-Type.

Parameters:
content - an Object containing the content for the AttachmentPart object to be created
contentType - a String object giving the type of content; examples are "text/xml", "text/plain", and "image/jpeg"
Returns:
a new AttachmentPart object that contains the given data
Throws:
IllegalArgumentException - may be thrown if the contentType does not match the type of the content object, or if there was no DataContentHandler object for the given content object
See Also:
DataHandler, DataContentHandler

abstract public void saveChanges() throws SOAPException
使用对其所作的所有更改更新此 SOAPMessage 对象。调用 writeTo(OutputStream) 时自动调用此方法。但是，如果是对已收到或已发送的消息进行更改，则需要显式调用方法 saveChanges 保存这些更改。方法 saveChanges 还生成任何可以回读的更改（例如，支持消息 id 的配置文件中 MessageId）。只有在调用 saveChanges 之后，才能保证为发送而创建的消息中的所有 MIME 头具有有效值。

此外，此方法标记了位置点，取自所有 AttachmentPart 对象组件的数据在该点处被拉入消息。

Throws SOAPException: 如果在保存此消息的更改时出现问题。
英文文档：

saveChanges

public abstract void saveChanges()
                          throws SOAPException
Updates this SOAPMessage object with all the changes that have been made to it. This method is called automatically when writeTo(OutputStream) is called. However, if changes are made to a message that was received or to one that has already been sent, the method saveChanges needs to be called explicitly in order to save the changes. The method saveChanges also generates any changes that can be read back (for example, a MessageId in profiles that support a message id). All MIME headers in a message that is created for sending purposes are guaranteed to have valid values only after saveChanges has been called.

In addition, this method marks the point at which the data from all constituent AttachmentPart objects are pulled into the message.

Throws:
SOAPException - if there was a problem saving changes to this message.
SOAPException

abstract public boolean saveRequired()
指示是否此 SOAPMessage 对象需要调用方法 saveChanges。
return 如果需要调用 saveChanges，则返回 true；否则返回 false。
英文文档：

saveRequired

public abstract boolean saveRequired()
Indicates whether this SOAPMessage object needs to have the method saveChanges called on it.

Returns:
true if saveChanges needs to be called; false otherwise.

abstract public void writeTo(java.io.OutputStream out) throws SOAPException, java.io.IOException
将此 SOAPMessage 对象写入给定输出流。具体化格式在 SOAP 1.1 with Attachments 规范中定义。

如果没有附件，则只写出 XML 流。对于有附件的消息，writeTo 写出 MIME 编码的字节流。

注意，此方法不写出特定于传输的消息的 MIME Header

out | SOAPMessage 对象将写入的 OutputStream 对象
Throws | java.io.IOException: 如果发生 I/O * 错误
Throws | SOAPException: 在具体化此 SOAP 消息时出现问题
英文文档：

writeTo

public abstract void writeTo(OutputStream out)
                      throws SOAPException,
                             IOException
Writes this SOAPMessage object to the given output stream. The externalization format is as defined by the SOAP 1.1 with Attachments specification.

If there are no attachments, just an XML stream is written out. For those messages that have attachments, writeTo writes a MIME-encoded byte stream.

Note that this method does not write the transport-specific MIME Headers of the Message

Parameters:
out - the OutputStream object to which this SOAPMessage object will be written
Throws:
IOException - if an I/O error occurs
SOAPException - if there was a problem in externalizing this SOAP message

英文文档：

setProperty

public void setProperty(String property,
                        Object value)
                 throws SOAPException
Associates the specified value with the specified property. If there was already a value associated with this property, the old value is replaced.

The valid property names include WRITE_XML_DECLARATION and CHARACTER_SET_ENCODING. All of these standard SAAJ properties are prefixed by "javax.xml.soap". Vendors may also add implementation specific properties. These properties must be prefixed with package names that are unique to the vendor.

Setting the property WRITE_XML_DECLARATION to "true" will cause an XML Declaration to be written out at the start of the SOAP message. The default value of "false" suppresses this declaration.

The property CHARACTER_SET_ENCODING defaults to the value "utf-8" which causes the SOAP message to be encoded using UTF-8. Setting CHARACTER_SET_ENCODING to "utf-16" causes the SOAP message to be encoded using UTF-16.

Some implementations may allow encodings in addition to UTF-8 and UTF-16. Refer to your vendor's documentation for details.

Parameters:
property - the property with which the specified value is to be associated.
value - the value to be associated with the specified property
Throws:
SOAPException - if the property name is not recognized.
Since:
SAAJ 1.2

英文文档：

getProperty

public Object getProperty(String property)
                   throws SOAPException
Retrieves value of the specified property.

Parameters:
property - the name of the property to retrieve
Returns:
the value associated with the named property or null if no such property exists.
Throws:
SOAPException - if the property name is not recognized.
Since:
SAAJ 1.2
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPPart (Java EE 5)

javax.xml.soap
Class SOAPPart

java.lang.Object
    extended by  javax.xml.soap.SOAPPart
All Implemented Interfaces:
Document, Node
public abstract class SOAPPart
extends Object
implements Document, Node

Implements: org.w3c.dom.Document, Node

SOAPMessage 对象中特定于 SOAP 部分的容器。所有消息都必须有一个 SOAP 部分，因此 SOAPMessage 对象在创建之后将自动获得一个 SOAPPart 对象。

SOAPPart 对象是一个 MIME 部分，并具有 MIME 头 Content-Id、Content-Location 和 Content-Type。因为 Content-Type 的值必须为 "text/xml"，所以 SOAPPart 对象自动获得 Content-Type 的 MIME 头，且 Content-Type 值已设置为 "text/xml"。消息 SOAP 部分中的所有数据都必须是 XML 格式，因此值必须为 "text/xml"。不是 "text/xml" 类型的内容不能在 SOAPPart 对象中，而必须在 AttachmentPart 对象中。

发送消息时，其 SOAP 部分必须将 MIME 头 Content-Type 设置为 "text/xml"。或者换个角度来说，已收到消息的 SOAP 部分必须具有值为 "text/xml" 的 MIME 头 Content-Type。

客户端可以通过调用方法 SOAPMessage.getSOAPPart 来访问 SOAPMessage 对象的 SOAPPart 对象。以下代码行（其中 message 是一个 SOAPMessage 对象）检索消息的 SOAP 部分。

SOAPPart soapPart = message.getSOAPPart();

SOAPPart 对象包含一个 SOAPEnvelope 对象，SOAPEnvelope 对象包含一个 SOAPBody 对象和一个 SOAPHeader 对象。SOAPPart 的 getEnvelope 方法可以用于检索 SOAPEnvelope 对象。

英文文档：

The container for the SOAP-specific portion of a SOAPMessage object. All messages are required to have a SOAP part, so when a SOAPMessage object is created, it will automatically have a SOAPPart object.

A SOAPPart object is a MIME part and has the MIME headers Content-Id, Content-Location, and Content-Type. Because the value of Content-Type must be "text/xml", a SOAPPart object automatically has a MIME header of Content-Type with its value set to "text/xml". The value must be "text/xml" because content in the SOAP part of a message must be in XML format. Content that is not of type "text/xml" must be in an AttachmentPart object rather than in the SOAPPart object.

When a message is sent, its SOAP part must have the MIME header Content-Type set to "text/xml". Or, from the other perspective, the SOAP part of any message that is received must have the MIME header Content-Type with a value of "text/xml".

A client can access the SOAPPart object of a SOAPMessage object by calling the method SOAPMessage.getSOAPPart. The following line of code, in which message is a SOAPMessage object, retrieves the SOAP part of a message.

   SOAPPart soapPart = message.getSOAPPart();

A SOAPPart object contains a SOAPEnvelope object, which in turn contains a SOAPBody object and a SOAPHeader object. The SOAPPart method getEnvelope can be used to retrieve the SOAPEnvelope object.

Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor Summary
SOAPPart()
Method Summary
abstract void | addMimeHeader(String name, String value) Creates a MimeHeader object with the specified name and value and adds it to this SOAPPart object.
abstract Iterator | getAllMimeHeaders() Retrieves all the headers for this SOAPPart object as an iterator over the MimeHeader objects.
abstract Source | getContent() Returns the content of the SOAPEnvelope as a JAXP Source object.
String | getContentId() Retrieves the value of the MIME header whose name is "Content-Id".
String | getContentLocation() Retrieves the value of the MIME header whose name is "Content-Location".
abstract SOAPEnvelope | getEnvelope() Gets the SOAPEnvelope object associated with this SOAPPart object.
abstract Iterator | getMatchingMimeHeaders(String[] names) Retrieves all MimeHeader objects that match a name in the given array.
abstract String[] | getMimeHeader(String name) Gets all the values of the MimeHeader object in this SOAPPart object that is identified by the given String.
abstract Iterator | getNonMatchingMimeHeaders(String[] names) Retrieves all MimeHeader objects whose name does not match a name in the given array.
abstract void | removeAllMimeHeaders() Removes all the MimeHeader objects for this SOAPEnvelope object.
abstract void | removeMimeHeader(String header) Removes all MIME headers that match the given name.
abstract void | setContent(Source source) Sets the content of the SOAPEnvelope object with the data from the given Source object.
void | setContentId(String contentId) Sets the value of the MIME header named "Content-Id" to the given String.
void | setContentLocation(String contentLocation) Sets the value of the MIME header "Content-Location" to the given String.
abstract void | setMimeHeader(String name, String value) Changes the first header entry that matches the given header name so that its value is the given value, adding a new header with the given name and value if no existing header is a match.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.w3c.dom.Document
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersion
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData

Constructor Detail

public SOAPPart()
英文文档：

SOAPPart

public SOAPPart()
Method Detail

abstract public SOAPEnvelope getEnvelope() throws SOAPException
获取与此 SOAPPart 对象关联的 SOAPEnvelope 对象。获取 SOAP 信封后，可以用此方法来获取它的内容。
return | 此 SOAPPart 对象的 SOAPEnvelope 对象
Throws | SOAPException: 如果存在 SOAP 错误
英文文档：

getEnvelope

public abstract SOAPEnvelope getEnvelope()
                                  throws SOAPException
Gets the SOAPEnvelope object associated with this SOAPPart object. Once the SOAP envelope is obtained, it can be used to get its contents.

Returns:
the SOAPEnvelope object for this SOAPPart object
Throws:
SOAPException - if there is a SOAP error

public String getContentId()
检索名为 "Content-Id" 的 MIME 头的值。
return | 一个 String，给出名为 "Content-Id" 的 MIME 头的值
See also | setContentId
英文文档：

getContentId

public String getContentId()
Retrieves the value of the MIME header whose name is "Content-Id".

Returns:
a String giving the value of the MIME header named "Content-Id"
See Also:
setContentId(java.lang.String)

public String getContentLocation()
检索名为 "Content-Location" 的 MIME 头的值。
return | 一个 String，给出名为 "Content-Location" 的 MIME 头的值
See also | setContentLocation
英文文档：

getContentLocation

public String getContentLocation()
Retrieves the value of the MIME header whose name is "Content-Location".

Returns:
a String giving the value of the MIME header whose name is "Content-Location"
See Also:
setContentLocation(java.lang.String)

public void setContentId(String contentId)
将名为 "Content-Id" 的 MIME 头的值设置为给定 String。
contentId | 一个 String，给出 MIME 头 "Content-Id" 的值
Throws | IllegalArgumentException: 如果在设置内容 id 时出现问题
See also | getContentId
英文文档：

setContentId

public void setContentId(String contentId)
Sets the value of the MIME header named "Content-Id" to the given String.

Parameters:
contentId - a String giving the value of the MIME header "Content-Id"
Throws:
IllegalArgumentException - if there is a problem in setting the content id
See Also:
getContentId()

public void setContentLocation(String contentLocation)
将 MIME 头 "Content-Location" 的值设置为给定 String。
contentLocation | 一个 String，给出 MIME 头 "Content-Location" 的值
Throws | IllegalArgumentException: 如果在设置内容位置时出现问题。
See also | getContentLocation
英文文档：

setContentLocation

public void setContentLocation(String contentLocation)
Sets the value of the MIME header "Content-Location" to the given String.

Parameters:
contentLocation - a String giving the value of the MIME header "Content-Location"
Throws:
IllegalArgumentException - if there is a problem in setting the content location.
See Also:
getContentLocation()

abstract public void removeMimeHeader(String header)
移除所有与给定名称匹配的 MIME 头。
header 一个 String，给出要移除的 MIME 头的名称
英文文档：

removeMimeHeader

public abstract void removeMimeHeader(String header)
Removes all MIME headers that match the given name.

Parameters:
header - a String giving the name of the MIME header(s) to be removed

abstract public void removeAllMimeHeaders()
移除此 SOAPEnvelope 对象的所有 MimeHeader 对象。
英文文档：

removeAllMimeHeaders

public abstract void removeAllMimeHeaders()
Removes all the MimeHeader objects for this SOAPEnvelope object.

abstract public String[] getMimeHeader(String name)
获取此 SOAPPart 对象中所有由给定 String 标识的 MimeHeader 对象的值。
name | 头的名称；示例："Content-Type"
return | 一个 String 数组，给出所有指定头的值
See also | setMimeHeader
英文文档：

getMimeHeader

public abstract String[] getMimeHeader(String name)
Gets all the values of the MimeHeader object in this SOAPPart object that is identified by the given String.

Parameters:
name - the name of the header; example: "Content-Type"
Returns:
a String array giving all the values for the specified header
See Also:
setMimeHeader(java.lang.String, java.lang.String)

abstract public void setMimeHeader(String name, String value)
将与给定头名称匹配的第一个头条目的值更改为给定值，如果现有头都不匹配，则添加一个带有给定名称和值的新头。如果有匹配的头，则此方法清除第一个匹配头的所有现有值，并设置为给定的值。如果多个头都具有给定名称，则此方法移除第一个匹配头之后的所有匹配头。

注意，RFC822 头只能包含 US-ASCII 字符。

name | 一个 String，给出要搜索的头的名称
value | 一个 String，给出要设置的值。此值将替换第一个匹配头（如果有）的当前值。如果没有匹配的头，则此值将是新 MimeHeader 对象的值。
Throws | IllegalArgumentException: 如果指定的 MIME 头名称或值存在问题
See also | getMimeHeader
英文文档：

setMimeHeader

public abstract void setMimeHeader(String name,
                                   String value)
Changes the first header entry that matches the given header name so that its value is the given value, adding a new header with the given name and value if no existing header is a match. If there is a match, this method clears all existing values for the first header that matches and sets the given value instead. If more than one header has the given name, this method removes all of the matching headers after the first one.

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String giving the header name for which to search
value - a String giving the value to be set. This value will be substituted for the current value(s) of the first header that is a match if there is one. If there is no match, this value will be the value for a new MimeHeader object.
Throws:
IllegalArgumentException - if there was a problem with the specified mime header name or value
See Also:
getMimeHeader(java.lang.String)

abstract public void addMimeHeader(String name, String value)
使用指定名称和值创建 MimeHeader 对象，并将其添加到此 SOAPPart 对象。如果已经存在带有指定名称的 MimeHeader，则此方法将指定值添加到已经存在的值中。

注意，RFC822 头只能包含 US-ASCII 字符。

name | 一个 String，给出头名称
value | 一个 String，给出要设置或要添加的值
Throws | IllegalArgumentException: 如果指定的 MIME 头名称或值存在问题
英文文档：

addMimeHeader

public abstract void addMimeHeader(String name,
                                   String value)
Creates a MimeHeader object with the specified name and value and adds it to this SOAPPart object. If a MimeHeader with the specified name already exists, this method adds the specified value to the already existing value(s).

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String giving the header name
value - a String giving the value to be set or added
Throws:
IllegalArgumentException - if there was a problem with the specified mime header name or value

abstract public java.util.Iterator<E> getAllMimeHeaders()
以可在 MimeHeader 对象上进行迭代的迭代器形式，检索此 SOAPPart 对象的所有头。
return 一个 Iterator 对象，具有此 SOAPPart 对象的所有 Mime 头
英文文档：

getAllMimeHeaders

public abstract Iterator getAllMimeHeaders()
Retrieves all the headers for this SOAPPart object as an iterator over the MimeHeader objects.

Returns:
an Iterator object with all of the Mime headers for this SOAPPart object

abstract public java.util.Iterator<E> getMatchingMimeHeaders(String[] names)
检索匹配给定数组中名称的所有 MimeHeader 对象。
names | 一个 String 数组，带有要返回的 Mime 头的名称
return | 以 Iterator 对象形式返回的与给定数组中任一名称匹配的所有 MIME 头
英文文档：

getMatchingMimeHeaders

public abstract Iterator getMatchingMimeHeaders(String[] names)
Retrieves all MimeHeader objects that match a name in the given array.

Parameters:
names - a String array with the name(s) of the MIME headers to be returned
Returns:
all of the MIME headers that match one of the names in the given array, returned as an Iterator object

abstract public java.util.Iterator<E> getNonMatchingMimeHeaders(String[] names)
检索所有名称不匹配给定数组中任一名称的 MimeHeader 对象。
names | 一个 String 数组，带有不要返回的 Mime 头的名称
return | 此 SOAPPart 对象中与给定数组中任一名称匹配的 MIME 头之外的所有 MIME 头。以 Iterator 对象的形式返回不匹配的 MIME 头。
英文文档：

getNonMatchingMimeHeaders

public abstract Iterator getNonMatchingMimeHeaders(String[] names)
Retrieves all MimeHeader objects whose name does not match a name in the given array.

Parameters:
names - a String array with the name(s) of the MIME headers not to be returned
Returns:
all of the MIME headers in this SOAPPart object except those that match one of the names in the given array. The nonmatching MIME headers are returned as an Iterator object.

abstract public void setContent(javax.xml.transform.Source source) throws SOAPException
使用取自给定 Source 对象的数据设置 SOAPEnvelope 对象的内容。此 Source 必须包含一个有效的 SOAP 文档。
source | javax.xml.transform.Source 对象，带有要发送的数据
Throws | SOAPException: 如果在设置源时出现错误。
See also | getContent
英文文档：

setContent

public abstract void setContent(Source source)
                         throws SOAPException
Sets the content of the SOAPEnvelope object with the data from the given Source object. This Source must contain a valid SOAP document.

Parameters:
source - the javax.xml.transform.Source object with the data to be set
Throws:
SOAPException - if there is a problem in setting the source
See Also:
getContent()

abstract public javax.xml.transform.Source getContent() throws SOAPException
以 JAXP Source 对象的形式返回 SOAPEnvelope 的内容。
return | javax.xml.transform.Source 对象形式的内容
Throws | SOAPException: 如果实现无法转换指定的 Source 对象
See also | setContent
英文文档：

getContent

public abstract Source getContent()
                           throws SOAPException
Returns the content of the SOAPEnvelope as a JAXP Source object.

Returns:
the content as a javax.xml.transform.Source object
Throws:
SOAPException - if the implementation cannot convert the specified Source object
See Also:
setContent(javax.xml.transform.Source)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


SOAPException (Java EE 5)

javax.xml.soap
Class SOAPException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.soap.SOAPException
All Implemented Interfaces:
Serializable
public class SOAPException
extends Exception

Extends: Throwable > Exception

当发生 SOAP 异常时，抛出此异常。SOAPException 对象可以包含给出异常原因的 String 或嵌入的 Throwable 对象，也可以同时包含两者。此类提供检索原因消息的方法和检索嵌入 Throwable 对象的方法。

抛出 SOAPException 对象的通常原因是难以设置头、无法发送消息以及无法获取与提供者的连接之类的问题。嵌入 Throwable 对象的原因包括诸如输入/输出错误之类的问题或解析问题，如解析头时出现错误。

英文文档：

An exception that signals that a SOAP exception has occurred. A SOAPException object may contain a String that gives the reason for the exception, an embedded Throwable object, or both. This class provides methods for retrieving reason messages and for retrieving the embedded Throwable object.

Typical reasons for throwing a SOAPException object are problems such as difficulty setting a header, not being able to send a message, and not being able to get a connection with the provider. Reasons for embedding a Throwable object include problems such as input/output errors or a parsing problem, such as an error in parsing a header.

See Also:
Serialized Form

Constructor Summary
SOAPException()
Constructs a SOAPException object with no reason or embedded Throwable object.
SOAPException(String reason)
Constructs a SOAPException object with the given String as the reason for the exception being thrown.
SOAPException(String reason, Throwable cause)
Constructs a SOAPException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded exception.
SOAPException(Throwable cause)
Constructs a SOAPException object initialized with the given Throwable object.
Method Summary
Throwable | getCause() Returns the Throwable object embedded in this SOAPException if there is one.
String | getMessage() Returns the detail message for this SOAPException object.
Throwable | initCause(Throwable cause) Initializes the cause field of this SOAPException object with the given Throwable object.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

public SOAPException()
构造不带原因或内置 Throwable 对象的 SOAPException 对象。
英文文档：

SOAPException

public SOAPException()
Constructs a SOAPException object with no reason or embedded Throwable object.

public SOAPException(String reason)
构造一个 SOAPException 对象，使用给定 String 作为抛出异常的原因。
reason 对导致异常的原因的描述
英文文档：

SOAPException

public SOAPException(String reason)
Constructs a SOAPException object with the given String as the reason for the exception being thrown.

Parameters:
reason - a description of what caused the exception

public SOAPException(String reason, Throwable cause)
构造一个 SOAPException 对象，使用给定 String 作为抛出异常的原因，使用给定 Throwable 对象作为嵌入的异常。
reason | 对导致异常的原因的描述
cause | 要嵌入此 SOAPException 对象的 Throwable 对象
英文文档：

SOAPException

public SOAPException(String reason,
                     Throwable cause)
Constructs a SOAPException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded exception.

Parameters:
reason - a description of what caused the exception
cause - a Throwable object that is to be embedded in this SOAPException object

public SOAPException(Throwable cause)
构造使用给定 Throwable 对象初始化的 SOAPException 对象。
英文文档：

SOAPException

public SOAPException(Throwable cause)
Constructs a SOAPException object initialized with the given Throwable object.

Method Detail

public String getMessage()
返回此 SOAPException 对象的详细消息。

如果有嵌入的 Throwable 对象，并且 SOAPException 对象没有自己的详细消息，则此方法将返回嵌入的 Throwable 对象的详细消息。

return 此 SOAPException 的错误或警告消息，如果没有此类消息，则返回嵌入的 Throwable 对象（如果有）的消息
英文文档：

getMessage

public String getMessage()
Returns the detail message for this SOAPException object.

If there is an embedded Throwable object, and if the SOAPException object has no detail message of its own, this method will return the detail message from the embedded Throwable object.

Overrides:
getMessage in class Throwable
Returns:
the error or warning message for this SOAPException or, if it has none, the message of the embedded Throwable object, if there is one

public Throwable getCause()
返回此 SOAPException 中嵌入的 Throwable 对象（如果有）。否则，此方法返回 null。
return 嵌入的 Throwable 对象，如果没有此类对象，则返回 null
英文文档：

getCause

public Throwable getCause()
Returns the Throwable object embedded in this SOAPException if there is one. Otherwise, this method returns null.

Overrides:
getCause in class Throwable
Returns:
the embedded Throwable object or null if there is none

public Throwable initCause(Throwable cause)
使用给定的 Throwable 对象初始化此 SOAPException 对象的 cause 字段。

此方法至多可以调用一次。此方法通常从构造方法中调用，或者在构造方法返回新的 SOAPException 对象后立即调用。如果此 SOAPException 对象是使用构造方法 #SOAPException(Throwable) 或 #SOAPException(String,Throwable) 创建的，则意味着它的 cause 字段已经有一个值，此方法一次也不能调用。

cause | 导致抛出此 SOAPException 对象的 Throwable 对象。保存此参数的值，以便以后通过 #getCause() 方法检索它。此参数值可以为 null，指示 cause 不存在或是未知的。
return | 对此 SOAPException 实例的引用
Throws | IllegalArgumentException: 如果 cause 是此 Throwable 对象。（Throwable 对象不能是它自己的 cause。）
Throws | IllegalStateException: 如果此 SOAPException 对象的 cause 已经初始化
英文文档：

initCause

public Throwable initCause(Throwable cause)
Initializes the cause field of this SOAPException object with the given Throwable object.

This method can be called at most once. It is generally called from within the constructor or immediately after the constructor has returned a new SOAPException object. If this SOAPException object was created with the constructor SOAPException(Throwable) or SOAPException(String,Throwable), meaning that its cause field already has a value, this method cannot be called even once.

Overrides:
initCause in class Throwable
Parameters:
cause - the Throwable object that caused this SOAPException object to be thrown. The value of this parameter is saved for later retrieval by the getCause() method. A null value is permitted and indicates that the cause is nonexistent or unknown.
Returns:
a reference to this SOAPException instance
Throws:
IllegalArgumentException - if cause is this Throwable object. (A Throwable object cannot be its own cause.)
IllegalStateException - if the cause for this SOAPException object has already been initialized
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.stream (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.stream

Interface Summary
EventFilter | This interface declares a simple filter interface that one can create to filter XMLEventReaders
Location | Provides information on the location of an event.
StreamFilter | This interface declares a simple filter interface that one can create to filter XMLStreamReaders
XMLEventReader | This is the top level interface for parsing XML Events.
XMLEventWriter | This is the top level interface for writing XML documents.
XMLReporter | This interface is used to report non-fatal errors.
XMLResolver | This interface is used to resolve resources during an XML parse.
XMLStreamConstants | This interface declares the constants used in this API.
XMLStreamReader | The XMLStreamReader interface allows forward, read-only access to XML.
XMLStreamWriter | The XMLStreamWriter interface specifies how to write XML.

Class Summary
XMLEventFactory | This interface defines a utility class for creating instances of XMLEvents
XMLInputFactory | Defines an abstract implementation of a factory for getting streams.
XMLOutputFactory | Defines an abstract implementation of a factory for getting XMLEventWriters and XMLStreamWriters.

Exception Summary
XMLStreamException The base exception for unexpected processing errors.

Error Summary
FactoryConfigurationError An error class for reporting factory configuration errors.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.stream Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.stream

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Error
        • javax.xml.stream.FactoryConfigurationError
      • java.lang.Exception
        • javax.xml.stream.XMLStreamException
    • javax.xml.stream.XMLEventFactory
    • javax.xml.stream.XMLInputFactory
    • javax.xml.stream.XMLOutputFactory

Interface Hierarchy

  • javax.xml.stream.EventFilter
  • java.util.Iterator<E>
    • javax.xml.stream.XMLEventReader
  • javax.xml.stream.Location
  • javax.xml.stream.StreamFilter
  • javax.xml.stream.util.XMLEventConsumer
    • javax.xml.stream.XMLEventWriter
  • javax.xml.stream.XMLReporter
  • javax.xml.stream.XMLResolver
  • javax.xml.stream.XMLStreamConstants
    • javax.xml.stream.XMLStreamReader
  • javax.xml.stream.XMLStreamWriter
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


EventFilter (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.stream
Interface EventFilter

public interface EventFilter

此接口声明了一个简单的过滤器接口，用户可创建它来过滤 XMLEventReader。
version 1.0
英文文档：

This interface declares a simple filter interface that one can create to filter XMLEventReaders

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Method Summary
 boolean accept(XMLEvent event)
Tests whether this event is part of this stream.

Method Detail

public boolean accept(XMLEvent event)
测试此事件是否为此流的一部分。如果此过滤器接受此事件，则此方法返回 true，否则返回 false。
event | 要测试的事件
return | 如果此过滤器接收此事件，则返回 true，否则返回 false
英文文档：

accept

boolean accept(XMLEvent event)
Tests whether this event is part of this stream. This method will return true if this filter accepts this event and false otherwise.

Parameters:
event - the event to test
Returns:
true if this filter accepts this event, false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Location (Java EE 5)

javax.xml.stream
Interface Location

public interface Location

提供有关事件位置的信息。Location 提供的所有信息都是可选的。例如，应用程序可以只报告行号。
version 1.0
英文文档：

Provides information on the location of an event. All the information provided by a Location is optional. For example an application may only report line numbers.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Method Summary
int | getCharacterOffset() Return the byte or character offset into the input source this location is pointing to.
int | getColumnNumber() Return the column number where the current event ends, returns -1 if none is available.
int | getLineNumber() Return the line number where the current event ends, returns -1 if none is available.
String | getPublicId() Returns the public ID of the XML
String | getSystemId() Returns the system ID of the XML

Method Detail

public int getLineNumber()
返回当前事件结束位置的行号，如果没有可用的行号，则返回 -1。
return 当前行号
英文文档：

getLineNumber

int getLineNumber()
Return the line number where the current event ends, returns -1 if none is available.

Returns:
the current line number

public int getColumnNumber()
返回当前事件结束位置的列号，如果没有可用的列号，则返回 -1。
return 当前列号
英文文档：

getColumnNumber

int getColumnNumber()
Return the column number where the current event ends, returns -1 if none is available.

Returns:
the current column number

public int getCharacterOffset()
返回此位置所指向的输入源中的字节或字符偏移量。如果输入源是一个文件或字节流，则偏移量为该流中的字节偏移量；但如果输入源是字符介质，则偏移量为字符偏移量。如果没有可用的偏移量，则返回 -1。
return 当前偏移量
英文文档：

getCharacterOffset

int getCharacterOffset()
Return the byte or character offset into the input source this location is pointing to. If the input source is a file or a byte stream then this is the byte offset into that stream, but if the input source is a character media then the offset is the character offset. Returns -1 if there is no offset available.

Returns:
the current offset

public String getPublicId()
返回 XML 的公共 ID
return 公共 ID，如果不可用，则返回 null
英文文档：

getPublicId

String getPublicId()
Returns the public ID of the XML

Returns:
the public ID, or null if not available

public String getSystemId()
返回 XML 的系统 ID
return 系统 ID，如果不可用，则返回 null
英文文档：

getSystemId

String getSystemId()
Returns the system ID of the XML

Returns:
the system ID, or null if not available
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StreamFilter (Java EE 5)

javax.xml.stream
Interface StreamFilter

public interface StreamFilter

此接口声明了一个简单的过滤器接口，用户可创建它来过滤 XMLStreamReader。
version 1.0
英文文档：

This interface declares a simple filter interface that one can create to filter XMLStreamReaders

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Method Summary
 boolean accept(XMLStreamReader reader)
Tests whether the current state is part of this stream.

Method Detail

public boolean accept(XMLStreamReader reader)
测试当前状态是否为此流的一部分。如果此过滤器接受此事件，则此方法返回 true，否则返回 false。此方法不应在接受状态时更改 reader 的状态。
reader | 要测试的事件
return | 如果此过滤器接收此事件，则返回 true，否则返回 false
英文文档：

accept

boolean accept(XMLStreamReader reader)
Tests whether the current state is part of this stream. This method will return true if this filter accepts this event and false otherwise. The method should not change the state of the reader when accepting a state.

Parameters:
reader - the event to test
Returns:
true if this filter accepts this event, false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLEventReader (Java EE 5)

javax.xml.stream
Interface XMLEventReader

All Superinterfaces:
Iterator
All Known Implementing Classes:
EventReaderDelegate
public interface XMLEventReader
extends Iterator

Implements: java.util.Iterator<E>
Implemented by: EventReaderDelegate

此类是用于解析 XML 事件的顶层接口。它提供查看下一个事件和返回属性接口中的配置信息的功能。
version | 1.0
See also | javax.xml.stream.XMLInputFactory, javax.xml.stream.XMLEventWriter
英文文档：

This is the top level interface for parsing XML Events. It provides the ability to peek at the next event and returns configuration information through the property interface.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLInputFactory, XMLEventWriter

Method Summary
void | close() Frees any resources associated with this Reader.
String | getElementText() Reads the content of a text-only element.
Object | getProperty(String name) Get the value of a feature/property from the underlying implementation
boolean | hasNext() Check if there are more events.
XMLEvent | nextEvent() Get the next XMLEvent
XMLEvent | nextTag() Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached.
XMLEvent | peek() Check the next XMLEvent without reading it from the stream.
Methods inherited from interface java.util.Iterator
next, remove

Method Detail

public XMLEvent nextEvent() throws XMLStreamException
获取下一个 XMLEvent。
Throws | XMLStreamException: 如果底层 XML 存在错误。
Throws | NoSuchElementException: 没有元素可以迭代。
See also | javax.xml.stream.events.XMLEvent
英文文档：

nextEvent

XMLEvent nextEvent()
                   throws XMLStreamException
Get the next XMLEvent

Throws:
XMLStreamException - if there is an error with the underlying XML.
NoSuchElementException - iteration has no more elements.
See Also:
XMLEvent

public boolean hasNext()
检查是否有多个事件。如果有多个事件，则返回 true，否则返回 false。
return 如果事件 reader 具有多个事件，则返回 true，否则返回 false。
英文文档：

hasNext

boolean hasNext()
Check if there are more events. Returns true if there are more events and false otherwise.

Specified by:
hasNext in interface Iterator
Returns:
true if the event reader has more events, false otherwise

public XMLEvent peek() throws XMLStreamException
检查下一个 XMLEvent，但不从流中读取它。如果流位于 EOF 处或者不再有 XMLEvent，则返回 null。调用 peek() 将相当于 next() 的下一个返回。
Throws | XMLStreamException:
See also | javax.xml.stream.events.XMLEvent
英文文档：

peek

XMLEvent peek()
              throws XMLStreamException
Check the next XMLEvent without reading it from the stream. Returns null if the stream is at EOF or has no more XMLEvents. A call to peek() will be equal to the next return of next().

Throws:
XMLStreamException
See Also:
XMLEvent

public String getElementText() throws XMLStreamException
读取纯文本元素的内容。前置条件：当前事件是 START_ELEMENT。后置条件：当前事件是相应的 END_ELEMENT。
Throws XMLStreamException: 如果当前事件不是 START_ELEMENT 或者遇到了非文本元素
英文文档：

getElementText

String getElementText()
                      throws XMLStreamException
Reads the content of a text-only element. Precondition: the current event is START_ELEMENT. Postcondition: The current event is the corresponding END_ELEMENT.

Throws:
XMLStreamException - if the current event is not a START_ELEMENT or if a non text element is encountered

public XMLEvent nextTag() throws XMLStreamException
在到达 START_ELEMENT 或 END_ELEMENT 之前，跳过所有无意义的空格事件。如果遇到空格符之外的其他内容，则抛出异常。在处理纯元素内容时应使用此方法，因为如果缺少 DTD 或未解释它，解析器将无法识别可忽略的空格。
Throws XMLStreamException: 如果遇到空格符之外的其他内容
英文文档：

nextTag

XMLEvent nextTag()
                 throws XMLStreamException
Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached. If anything other than space characters are encountered, an exception is thrown. This method should be used when processing element-only content because the parser is not able to recognize ignorable whitespace if the DTD is missing or not interpreted.

Throws:
XMLStreamException - if anything other than space characters are encountered

public Object getProperty(String name) throws IllegalArgumentException
从底层实现获取功能/属性的值。
name | 属性的名称
return | 属性的值
Throws | IllegalArgumentException: 如果属性不受支持
英文文档：

getProperty

Object getProperty(String name)
                   throws IllegalArgumentException
Get the value of a feature/property from the underlying implementation

Parameters:
name - The name of the property
Returns:
The value of the property
Throws:
IllegalArgumentException - if the property is not supported

public void close() throws XMLStreamException
释放与此 Reader 关联的所有资源。此方法不会关闭底层输入源。
Throws XMLStreamException: 如果释放关联资源时发生错误
英文文档：

close

void close()
           throws XMLStreamException
Frees any resources associated with this Reader. This method does not close the underlying input source.

Throws:
XMLStreamException - if there are errors freeing associated resources
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLEventWriter (Java EE 5)

javax.xml.stream
Interface XMLEventWriter

All Superinterfaces:
XMLEventConsumer
public interface XMLEventWriter
extends XMLEventConsumer

Implements: XMLEventConsumer

此类是用于编写 XML 文档的顶层接口。此接口的实例不需要验证 XML 的格式。
version | 1.0
See also | javax.xml.stream.XMLEventReader, javax.xml.stream.events.XMLEvent, javax.xml.stream.events.Characters, javax.xml.stream.events.ProcessingInstruction, javax.xml.stream.events.StartElement, javax.xml.stream.events.EndElement
英文文档：

This is the top level interface for writing XML documents. Instances of this interface are not required to validate the form of the XML.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLEventReader, XMLEvent, Characters, ProcessingInstruction, StartElement, EndElement

Method Summary
void | add(XMLEvent event) Add an event to the output stream Adding a START_ELEMENT will open a new namespace scope that will be closed when the corresponding END_ELEMENT is written.
void | add(XMLEventReader reader) Adds an entire stream to an output stream, calls next() on the inputStream argument until hasNext() returns false This should be treated as a convenience method that will perform the following loop over all the events in an event reader and call add on each event.
void | close() Frees any resources associated with this stream
void | flush() Writes any cached events to the underlying output mechanism
NamespaceContext | getNamespaceContext() Returns the current namespace context.
String | getPrefix(String uri) Gets the prefix the uri is bound to
void | setDefaultNamespace(String uri) Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair.
void | setNamespaceContext(NamespaceContext context) Sets the current namespace context for prefix and uri bindings.
void | setPrefix(String prefix, String uri) Sets the prefix the uri is bound to.

Method Detail

public void flush() throws XMLStreamException
将所有缓存事件写入到底层输出机制。
Throws XMLStreamException:
英文文档：

flush

void flush()
           throws XMLStreamException
Writes any cached events to the underlying output mechanism

Throws:
XMLStreamException

public void close() throws XMLStreamException
释放所有与此流关联的资源。
Throws XMLStreamException:
英文文档：

close

void close()
           throws XMLStreamException
Frees any resources associated with this stream

Throws:
XMLStreamException

public void add(XMLEvent event) throws XMLStreamException
向输出流添加事件。添加 START_ELEMENT 将打开新的名称空间作用域，它将在写入相应的 END_ELEMENT 时被关闭。
添加到 writer 的事件的必需字段和可选字段
事件类型 | 必需字段 | 可选字段 | 必需行为
START_ELEMENT | QName name | namespace、attribute | 通过用 XML 1.0 中对 START_ELEMENT 有效的语法写入事件的名称、名称空间和属性来编写 START_ELEMENT。名称是通过查找名称空间 URI 的前缀写入的。writer 可以配置为考虑 QName 的前缀。如果 writer 考虑前缀，则它必须使用在 QName 中设置的前缀。默认行为是在 EventWriter 的内部名称空间上下文中查找前缀的值。每个属性（如果有）使用在此表的属性部分所指定的行为写入。每个名称空间（如果有）使用在此表的名称空间部分所指定的行为写入。
END_ELEMENT | Qname name | 无 | 写入一个格式良好的 END_ELEMENT 标记。名称是通过查找名称空间 URI 的前缀写入的。writer 可以配置为考虑 QName 的前缀。如果 writer 考虑前缀，则它必须使用在 QName 中设置的前缀。默认行为是在 EventWriter 的内部名称空间上下文中查找前缀的值。如果 END_ELEMENT 名称和 START_ELEMENT 名称不匹配，则抛出 XMLStreamException。
ATTRIBUTE | QName name、String value | QName type | 使用同样的算法写入属性，以根据 START_ELEMENT 中使用的词法查找词法格式。默认行为是使用双引号将属性值括起来并转义出现在值中的所有双引号。类型值被忽略。
NAMESPACE | String prefix、String namespaceURI、boolean isDefaultNamespaceDeclaration | 无 | 写入一个名称空间声明。如果名称空间是默认名称空间声明（isDefault 为 true），则写入 xmlns="$namespaceURI"，前缀是可选项。如果 isDefault 为 false，则必须声明前缀，writer 必须将 xmlns 附加为前缀并写出一个标准前缀声明。
PROCESSING_INSTRUCTION | 无 | String target、String data | 数据不需要附加前缀，可以为 null。目标是必需的，不可以为 null。writer 将直接在目标之后编写数据部分，并用合适的 XML 1.0 语法封闭起来
COMMENT | 无 | String comment | 如果存在注释（不为 null），则写入该注释，否则写入一个空注释
START_DOCUMENT | 无 | String encoding、boolean standalone、String version | 不需要将 START_DOCUMENT 事件写入流。如果存在，则属性以适当的 XML 声明语法写入
END_DOCUMENT | 无 | 无 | 不向输出写入任何内容
DTD | String DocumentTypeDefinition | 无 | DocumentTypeDefinition 被写入输出
event | 要被添加的事件
Throws | XMLStreamException:
英文文档：

add

void add(XMLEvent event)
         throws XMLStreamException
Add an event to the output stream Adding a START_ELEMENT will open a new namespace scope that will be closed when the corresponding END_ELEMENT is written.
Required and optional fields for events added to the writer
Event Type | Required Fields | Optional Fields | Required Behavior
START_ELEMENT | QName name | namespaces , attributes | A START_ELEMENT will be written by writing the name, namespaces, and attributes of the event in XML 1.0 valid syntax for START_ELEMENTs. The name is written by looking up the prefix for the namespace uri. The writer can be configured to respect prefixes of QNames. If the writer is respecting prefixes it must use the prefix set on the QName. The default behavior is to lookup the value for the prefix on the EventWriter's internal namespace context. Each attribute (if any) is written using the behavior specified in the attribute section of this table. Each namespace (if any) is written using the behavior specified in the namespace section of this table.
END_ELEMENT | Qname name | None | A well formed END_ELEMENT tag is written. The name is written by looking up the prefix for the namespace uri. The writer can be configured to respect prefixes of QNames. If the writer is respecting prefixes it must use the prefix set on the QName. The default behavior is to lookup the value for the prefix on the EventWriter's internal namespace context. If the END_ELEMENT name does not match the START_ELEMENT name an XMLStreamException is thrown.
ATTRIBUTE | QName name , String value | QName type | An attribute is written using the same algorithm to find the lexical form as used in START_ELEMENT. The default is to use double quotes to wrap attribute values and to escape any double quotes found in the value. The type value is ignored.
NAMESPACE | String prefix, String namespaceURI, boolean isDefaultNamespaceDeclaration | None | A namespace declaration is written. If the namespace is a default namespace declaration (isDefault is true) then xmlns="$namespaceURI" is written and the prefix is optional. If isDefault is false, the prefix must be declared and the writer must prepend xmlns to the prefix and write out a standard prefix declaration.
PROCESSING_INSTRUCTION | None | String target, String data | The data does not need to be present and may be null. Target is required and many not be null. The writer will write data section directly after the target, enclosed in appropriate XML 1.0 syntax
COMMENT | None | String comment | If the comment is present (not null) it is written, otherwise an an empty comment is written
START_DOCUMENT | None | String encoding , boolean standalone, String version | A START_DOCUMENT event is not required to be written to the stream. If present the attributes are written inside the appropriate XML declaration syntax
END_DOCUMENT | None | None | Nothing is written to the output
DTD | String DocumentTypeDefinition | None | The DocumentTypeDefinition is written to the output

Specified by:
add in interface XMLEventConsumer
Parameters:
event - the event to be added
Throws:
XMLStreamException

public void add(XMLEventReader reader) throws XMLStreamException
将整个流添加到输出流，在 hasNext() 返回 false 前对 inputStream 参数调用 next()。此方法应被视为一个便捷方法，它将在事件 reader 中的所有事件中执行以下循环，并对每个事件上调用 add。
reader | 要添加到输出的事件流
Throws | XMLStreamException:
英文文档：

add

void add(XMLEventReader reader)
         throws XMLStreamException
Adds an entire stream to an output stream, calls next() on the inputStream argument until hasNext() returns false This should be treated as a convenience method that will perform the following loop over all the events in an event reader and call add on each event.

Parameters:
reader - the event stream to add to the output
Throws:
XMLStreamException

public String getPrefix(String uri) throws XMLStreamException
获取绑定 URI 的前缀
uri | 要查找的 URI
Throws | XMLStreamException:
英文文档：

getPrefix

String getPrefix(String uri)
                 throws XMLStreamException
Gets the prefix the uri is bound to

Parameters:
uri - the uri to look up
Throws:
XMLStreamException

public void setPrefix(String prefix, String uri) throws XMLStreamException
设置绑定 URI 的前缀。前缀在当前 START_ELEMENT / END_ELEMENT 对的范围内绑定。如果在写入 START_ELEMENT 之前调用此方法，则前缀在根范围内绑定。
prefix | 要绑定到 URI 的前缀
uri | 要绑定到前缀的 URI
Throws | XMLStreamException:
英文文档：

setPrefix

void setPrefix(String prefix,
               String uri)
               throws XMLStreamException
Sets the prefix the uri is bound to. This prefix is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the prefix is bound in the root scope.

Parameters:
prefix - the prefix to bind to the uri
uri - the uri to bind to the prefix
Throws:
XMLStreamException

public void setDefaultNamespace(String uri) throws XMLStreamException
将 URI 绑定到默认名称空间。此 URI 在当前 START_ELEMENT / END_ELEMENT 对的范围内绑定。如果在写入 START_ELEMENT 之前调用此方法，则 URI 在根范围内绑定。
uri | 要绑定到默认名称空间的 URI
Throws | XMLStreamException:
英文文档：

setDefaultNamespace

void setDefaultNamespace(String uri)
                         throws XMLStreamException
Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the uri is bound in the root scope.

Parameters:
uri - the uri to bind to the default namespace
Throws:
XMLStreamException

public void setNamespaceContext(javax.xml.namespace.NamespaceContext context) throws XMLStreamException
设置前缀的当前名称空间上下文和 URI 绑定。此上下文成为用于写入的根名称空间上下文，并将替换当前的根名称空间上下文。对 setPrefix 和 setDefaultNamespace 的后续调用将使用作为解析名称空间的根上下文传递到此方法的上下文来绑定名称空间。
context | 要用于此 writer 的名称空间上下文
Throws | XMLStreamException:
英文文档：

setNamespaceContext

void setNamespaceContext(NamespaceContext context)
                         throws XMLStreamException
Sets the current namespace context for prefix and uri bindings. This context becomes the root namespace context for writing and will replace the current root namespace context. Subsequent calls to setPrefix and setDefaultNamespace will bind namespaces using the context passed to the method as the root context for resolving namespaces.

Parameters:
context - the namespace context to use for this writer
Throws:
XMLStreamException

public javax.xml.namespace.NamespaceContext getNamespaceContext()
返回当前名称空间上下文。
return 当前名称空间上下文
英文文档：

getNamespaceContext

NamespaceContext getNamespaceContext()
Returns the current namespace context.

Returns:
the current namespace context
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLReporter (Java EE 5)

javax.xml.stream
Interface XMLReporter

public interface XMLReporter

此接口用于报告非严重错误。只有警告才应该通过此接口再次报告。
version 1.0
英文文档：

This interface is used to report non-fatal errors. Only warnings should be echoed through this interface.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Method Summary
 void report(String message, String errorType, Object relatedInformation, Location location)
Report the desired message in an application specific format.

Method Detail

public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException
以特定于应用程序的格式报告所需消息。只有警告和非严重错误才应该通过此接口报告。严重错误应作为 XMLStreamException 抛出。
message | 错误消息
errorType | 一个定义错误类型的实现
relatedInformation | 与错误相关的信息（如果可用）
location | 错误的位置（如果可用）
Throws | XMLStreamException:
英文文档：

report

void report(String message,
            String errorType,
            Object relatedInformation,
            Location location)
            throws XMLStreamException
Report the desired message in an application specific format. Only warnings and non-fatal errors should be reported through this interface. Fatal errors should be thrown as XMLStreamException.

Parameters:
message - the error message
errorType - an implementation defined error type
relatedInformation - information related to the error, if available
location - the location of the error, if available
Throws:
XMLStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLResolver (Java EE 5)

javax.xml.stream
Interface XMLResolver

public interface XMLResolver

此接口用于在 XML 解析过程中解析资源。如果应用程序希望执行自定义实体解析，那么它必须使用 setXMLResolver 方法向 XMLInputFactory 注册此接口的一个实例。
version 1.0
英文文档：

This interface is used to resolve resources during an XML parse. If an application wishes to perform custom entity resolution it must register an instance of this interface with the XMLInputFactory using the setXMLResolver method.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Method Summary
 Object resolveEntity(String publicID, String systemID, String baseURI, String namespace)
Retrieves a resource.

Method Detail

public Object resolveEntity(String publicID, String systemID, String baseURI, String namespace) throws XMLStreamException
检索资源。此资源可以是下列三种返回类型之一：(1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader。如果此方法返回 null，则处理器将尝试用其默认机制解析实体。
publicID | 被引用的外部实体的公共标识符，如果未提供此类标识符，则该参数为 null。
systemID | 被引用外部实体的系统标识符。
baseURI | 与 systemId 关联的绝对基本 URI。
namespace | 要解析的实体名称空间。
return | 请求的资源或 null。
Throws | XMLStreamException: 如果尝试解析资源时出现错误。
英文文档：

resolveEntity

Object resolveEntity(String publicID,
                     String systemID,
                     String baseURI,
                     String namespace)
                     throws XMLStreamException
Retrieves a resource. This resource can be of the following three return types: (1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader. If this method returns null the processor will attempt to resolve the entity using its default mechanism.

Parameters:
publicID - The public identifier of the external entity being referenced, or null if none was supplied.
systemID - The system identifier of the external entity being referenced.
baseURI - Absolute base URI associated with systemId.
namespace - The namespace of the entity to resolve.
Returns:
The resource requested or null.
Throws:
XMLStreamException - if there was a failure attempting to resolve the resource.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLStreamConstants (Java EE 5)

javax.xml.stream
Interface XMLStreamConstants

All Known Subinterfaces:
Attribute, Characters, Comment, DTD, EndDocument, EndElement, EntityDeclaration, EntityReference, Namespace, NotationDeclaration, ProcessingInstruction, StartDocument, StartElement, XMLEvent, XMLStreamReader
All Known Implementing Classes:
StreamReaderDelegate
public interface XMLStreamConstants

Implemented by: XMLEvent, XMLStreamReader

此接口声明此 API 中所使用的常量。从 0 到 256 之间的数字是为规范所保留的，用户定义事件必须使用此范围之外的事件码。
英文文档：

This interface declares the constants used in this API. Numbers in the range 0 to 256 are reserved for the specification, user defined events must use event codes outside that range.

Field Summary
static int | ATTRIBUTE Indicates an event is an attribute
static int | CDATA Indicates an event is a CDATA section
static int | CHARACTERS Indicates an event is characters
static int | COMMENT Indicates an event is a comment
static int | DTD Indicates an event is a DTD
static int | END_DOCUMENT Indicates an event is an end document
static int | END_ELEMENT Indicates an event is an end element
static int | ENTITY_DECLARATION Indicates a Entity Declaration
static int | ENTITY_REFERENCE Indicates an event is an entity reference
static int | NAMESPACE Indicates the event is a namespace declaration
static int | NOTATION_DECLARATION Indicates a Notation
static int | PROCESSING_INSTRUCTION Indicates an event is a processing instruction
static int | SPACE The characters are white space (see [XML], 2.10 "White Space Handling").
static int | START_DOCUMENT Indicates an event is a start document
static int | START_ELEMENT Indicates an event is a start element

Field Detail

英文文档：

START_ELEMENT

static final int START_ELEMENT
Indicates an event is a start element

See Also:
StartElement, Constant Field Values

英文文档：

END_ELEMENT

static final int END_ELEMENT
Indicates an event is an end element

See Also:
EndElement, Constant Field Values

英文文档：

PROCESSING_INSTRUCTION

static final int PROCESSING_INSTRUCTION
Indicates an event is a processing instruction

See Also:
ProcessingInstruction, Constant Field Values

英文文档：

CHARACTERS

static final int CHARACTERS
Indicates an event is characters

See Also:
Characters, Constant Field Values

英文文档：

COMMENT

static final int COMMENT
Indicates an event is a comment

See Also:
Comment, Constant Field Values

英文文档：

SPACE

static final int SPACE
The characters are white space (see [XML], 2.10 "White Space Handling"). Events are only reported as SPACE if they are ignorable white space. Otherwise they are reported as CHARACTERS.

See Also:
Characters, Constant Field Values

英文文档：

START_DOCUMENT

static final int START_DOCUMENT
Indicates an event is a start document

See Also:
StartDocument, Constant Field Values

英文文档：

END_DOCUMENT

static final int END_DOCUMENT
Indicates an event is an end document

See Also:
EndDocument, Constant Field Values

英文文档：

ENTITY_REFERENCE

static final int ENTITY_REFERENCE
Indicates an event is an entity reference

See Also:
EntityReference, Constant Field Values

英文文档：

ATTRIBUTE

static final int ATTRIBUTE
Indicates an event is an attribute

See Also:
Attribute, Constant Field Values

英文文档：

DTD

static final int DTD
Indicates an event is a DTD

See Also:
DTD, Constant Field Values

英文文档：

CDATA

static final int CDATA
Indicates an event is a CDATA section

See Also:
Characters, Constant Field Values

英文文档：

NAMESPACE

static final int NAMESPACE
Indicates the event is a namespace declaration

See Also:
Namespace, Constant Field Values

英文文档：

NOTATION_DECLARATION

static final int NOTATION_DECLARATION
Indicates a Notation

See Also:
NotationDeclaration, Constant Field Values

英文文档：

ENTITY_DECLARATION

static final int ENTITY_DECLARATION
Indicates a Entity Declaration

See Also:
NotationDeclaration, Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLStreamReader (Java EE 5)

javax.xml.stream
Interface XMLStreamReader

All Superinterfaces:
XMLStreamConstants
All Known Implementing Classes:
StreamReaderDelegate
public interface XMLStreamReader
extends XMLStreamConstants

Implements: XMLStreamConstants
Implemented by: StreamReaderDelegate

XMLStreamReader 接口允许转发 XML 和对 XML 的只读访问。它被设计为读取 XML 数据的最低层且最有效的方法。

XMLStreamReader 被设计为使用 next() 和 hasNext() 在 XML 上进行迭代。可以使用诸如 getEventType()、getNamespaceURI()、getLocalName() 和 getText() 之类的方法访问数据：

next() 方法会使 reader 读取下一个解析事件。next() 方法返回一个整数，指示刚才读取的事件类型。

事件类型可以使用 getEventType() 来确定。

解析事件被定义为 XML 声明、DTD、开始标记、字符数据、空格、结束标记、注释或处理指令。属性或名称空间事件可以作为查询操作的结果在文档的根级别出现。

为了遵守 XML 1.0，XML 处理器必须将已声明的未解析实体的标识符、注释声明及其关联标识符传递给应用程序。此信息通过此接口上的属性 API 提供。以下两个属性允许访问此信息：javax.xml.stream.notations 和 javax.xml.stream.entities。当前事件为 DTD 时，以下调用将返回一个 Notation 列表 List l = (List) getProperty("javax.xml.stream.notations"); 以下调用将返回一个实体声明列表：List l = (List) getProperty("javax.xml.stream.entities"); 这些属性只能在 DTD 事件中访问，并且被定义为如果信息不可用，则返回 null。

下表描述了各种状态所对应的有效方法。如果某种方法是在无效状态中调用的，则该方法将抛出 java.lang.IllegalStateException。

每种状态对应的有效方法
事件类型 | 有效方法
所有状态 | getProperty()、hasNext()、require()、close()、getNamespaceURI()、isStartElement()、isEndElement()、isCharacters()、isWhiteSpace()、getNamespaceContext()、getEventType()、getLocation()、hasText()、hasName()
START_ELEMENT | next()、getName()、getLocalName()、hasName()、getPrefix()、getAttributeXXX()、isAttributeSpecified()、getNamespaceXXX()、getElementText()、nextTag()
ATTRIBUTE | next()、nextTag()、getAttributeXXX()、isAttributeSpecified()
NAMESPACE | next()、nextTag()、getNamespaceXXX()
END_ELEMENT | next()、getName()、getLocalName()、hasName()、getPrefix()、getNamespaceXXX()、nextTag()
CHARACTERS | next()、getTextXXX()、nextTag()
CDATA | next()、getTextXXX()、nextTag()
COMMENT | next()、getTextXXX()、nextTag()
SPACE | next()、getTextXXX()、nextTag()
START_DOCUMENT | next()、getEncoding()、getVersion()、isStandalone()、standaloneSet()、getCharacterEncodingScheme()、nextTag()
END_DOCUMENT | close()
PROCESSING_INSTRUCTION | next()、getPITarget()、getPIData()、nextTag()
ENTITY_REFERENCE | next()、getLocalName()、getText()、nextTag()
DTD | next()、getText()、nextTag()
version | 1.0
See also | javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLInputFactory, javax.xml.stream.XMLStreamWriter
英文文档：

The XMLStreamReader interface allows forward, read-only access to XML. It is designed to be the lowest level and most efficient way to read XML data.

The XMLStreamReader is designed to iterate over XML using next() and hasNext(). The data can be accessed using methods such as getEventType(), getNamespaceURI(), getLocalName() and getText();

The next() method causes the reader to read the next parse event. The next() method returns an integer which identifies the type of event just read.

The event type can be determined using getEventType().

Parsing events are defined as the XML Declaration, a DTD, start tag, character data, white space, end tag, comment, or processing instruction. An attribute or namespace event may be encountered at the root level of a document as the result of a query operation.

For XML 1.0 compliance an XML processor must pass the identifiers of declared unparsed entities, notation declarations and their associated identifiers to the application. This information is provided through the property API on this interface. The following two properties allow access to this information: javax.xml.stream.notations and javax.xml.stream.entities. When the current event is a DTD the following call will return a list of Notations List l = (List) getProperty("javax.xml.stream.notations"); The following call will return a list of entity declarations: List l = (List) getProperty("javax.xml.stream.entities"); These properties can only be accessed during a DTD event and are defined to return null if the information is not available.

The following table describes which methods are valid in what state. If a method is called in an invalid state the method will throw a java.lang.IllegalStateException.

Valid methods for each state
Event Type | Valid Methods
All States | getProperty(), hasNext(), require(), close(), getNamespaceURI(), isStartElement(), isEndElement(), isCharacters(), isWhiteSpace(), getNamespaceContext(), getEventType(),getLocation(), hasText(), hasName()
START_ELEMENT | next(), getName(), getLocalName(), hasName(), getPrefix(), getAttributeXXX(), isAttributeSpecified(), getNamespaceXXX(), getElementText(), nextTag()
ATTRIBUTE | next(), nextTag() getAttributeXXX(), isAttributeSpecified(),
NAMESPACE | next(), nextTag() getNamespaceXXX()
END_ELEMENT | next(), getName(), getLocalName(), hasName(), getPrefix(), getNamespaceXXX(), nextTag()
CHARACTERS | next(), getTextXXX(), nextTag()
CDATA | next(), getTextXXX(), nextTag()
COMMENT | next(), getTextXXX(), nextTag()
SPACE | next(), getTextXXX(), nextTag()
START_DOCUMENT | next(), getEncoding(), getVersion(), isStandalone(), standaloneSet(), getCharacterEncodingScheme(), nextTag()
END_DOCUMENT | close()
PROCESSING_INSTRUCTION | next(), getPITarget(), getPIData(), nextTag()
ENTITY_REFERENCE | next(), getLocalName(), getText(), nextTag()
DTD | next(), getText(), nextTag()

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLEvent, XMLInputFactory, XMLStreamWriter

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
 void close()
Frees any resources associated with this Reader.
 int getAttributeCount()
Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE.
 String getAttributeLocalName(int index)
Returns the localName of the attribute at the provided index
 QName getAttributeName(int index)
Returns the qname of the attribute at the provided index
 String getAttributeNamespace(int index)
Returns the namespace of the attribute at the provided index
 String getAttributePrefix(int index)
Returns the prefix of this attribute at the provided index
 String getAttributeType(int index)
Returns the XML type of the attribute at the provided index
 String getAttributeValue(int index)
Returns the value of the attribute at the index
 String getAttributeValue(String namespaceURI, String localName)
Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality
 String getCharacterEncodingScheme()
Returns the character encoding declared on the xml declaration Returns null if none was declared
 String getElementText()
Reads the content of a text-only element, an exception is thrown if this is not a text-only element.
 String getEncoding()
Return input encoding if known or null if unknown.
 int getEventType()
Returns an integer code that indicates the type of the event the cursor is pointing to.
 String getLocalName()
Returns the (local) name of the current event.
 Location getLocation()
Return the current location of the processor.
 QName getName()
Returns a QName for the current START_ELEMENT or END_ELEMENT event
 NamespaceContext getNamespaceContext()
Returns a read only namespace context for the current position.
 int getNamespaceCount()
Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE.
 String getNamespacePrefix(int index)
Returns the prefix for the namespace declared at the index.
 String getNamespaceURI()
If the current event is a START_ELEMENT or END_ELEMENT this method returns the URI of the prefix or the default namespace.
 String getNamespaceURI(int index)
Returns the uri for the namespace declared at the index.
 String getNamespaceURI(String prefix)
Return the uri for the given prefix.
 String getPIData()
Get the data section of a processing instruction
 String getPITarget()
Get the target of a processing instruction
 String getPrefix()
Returns the prefix of the current event or null if the event does not have a prefix
 Object getProperty(String name)
Get the value of a feature/property from the underlying implementation
 String getText()
Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD.
 char[] getTextCharacters()
Returns an array which contains the characters from this event.
 int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
Gets the the text associated with a CHARACTERS, SPACE or CDATA event.
 int getTextLength()
Returns the length of the sequence of characters for this Text event within the text character array.
 int getTextStart()
Returns the offset into the text character array where the first character (of this text event) is stored.
 String getVersion()
Get the xml version declared on the xml declaration Returns null if none was declared
 boolean hasName()
returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT) returns false otherwise
 boolean hasNext()
Returns true if there are more parsing events and false if there are no more events.
 boolean hasText()
Return true if the current event has text, false otherwise The following events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE
 boolean isAttributeSpecified(int index)
Returns a boolean which indicates if this attribute was created by default
 boolean isCharacters()
Returns true if the cursor points to a character data event
 boolean isEndElement()
Returns true if the cursor points to an end tag (otherwise false)
 boolean isStandalone()
Get the standalone declaration from the xml declaration
 boolean isStartElement()
Returns true if the cursor points to a start tag (otherwise false)
 boolean isWhiteSpace()
Returns true if the cursor points to a character data event that consists of all whitespace
 int next()
Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks.
 int nextTag()
Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING_INSTRUCTION, until a START_ELEMENT or END_ELEMENT is reached.
 void require(int type, String namespaceURI, String localName)
Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event.
 boolean standaloneSet()
Checks if standalone was set in the document

Method Detail

public Object getProperty(String name) throws IllegalArgumentException
从底层实现获取功能/属性的值。
name | 属性的名称，不可以为 null
return | 属性的值
Throws | IllegalArgumentException: 如果 name 为 null
英文文档：

getProperty

Object getProperty(String name)
                   throws IllegalArgumentException
Get the value of a feature/property from the underlying implementation

Parameters:
name - The name of the property, may not be null
Returns:
The value of the property
Throws:
IllegalArgumentException - if name is null

public int next() throws XMLStreamException
获取下一个解析事件——处理器可以用单个存储块返回所有连续的字符数据，它也可以将其分割成几个存储块。如果属性 javax.xml.stream.isCoalescing 设置为 true，则元素内容必须组合，对于连续元素内容或 CDATA 节，只需要返回一个 CHARACTERS 事件。 默认情况下，必须扩展实体引用，并透明地报告给应用程序。如果实体引用不能扩展，则抛出异常。如果元素内容为空（即内容为 ""），则不报告 CHARACTERS 事件。

假设给定以下 XML：
<foo><!--description-->内容文本<![CDATA[<greeting>Hello</greeting>]]>其他内容</foo>
对 foo 调用 next() 的行为将是：
1- 注释 (COMMENT)
2- 然后是字符节 (CHARACTERS)
3- 接下来是 CDATA 节（另一个 CHARACTERS）
4- 再接下来是下一个字符节 （另一个 CHARACTERS）
5- 最后是 END_ELEMENT

注： 空元素（如 <tag/>）将用以下两个单独的事件报告：START_ELEMENT 和 END_ELEMENT——这保证了空元素对 <tag></tag> 解析的等效性。 如果是在 hasNext() 返回 false 之后调用此方法，则此方法将抛出 IllegalStateException。

return | 与当前解析事件相对应的整数码
Throws | NoSuchElementException: 如果在 hasNext() 返回 false 时调用
Throws | XMLStreamException: 如果处理底层 XML 源时发生错误
See also | javax.xml.stream.events.XMLEvent
英文文档：

next

int next()
         throws XMLStreamException
Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks. If the property javax.xml.stream.isCoalescing is set to true element content must be coalesced and only one CHARACTERS event must be returned for contiguous element content or CDATA Sections. By default entity references must be expanded and reported transparently to the application. An exception will be thrown if an entity reference cannot be expanded. If element content is empty (i.e. content is "") then no CHARACTERS event will be reported.

Given the following XML:
<foo><!--description-->content text<![CDATA[<greeting>Hello</greeting>]]>other content</foo>
The behavior of calling next() when being on foo will be:
1- the comment (COMMENT)
2- then the characters section (CHARACTERS)
3- then the CDATA section (another CHARACTERS)
4- then the next characters section (another CHARACTERS)
5- then the END_ELEMENT

NOTE: empty element (such as <tag/>) will be reported with two separate events: START_ELEMENT, END_ELEMENT - This preserves parsing equivalency of empty element to <tag></tag>. This method will throw an IllegalStateException if it is called after hasNext() returns false.

Returns:
the integer code corresponding to the current parse event
Throws:
NoSuchElementException - if this is called when hasNext() returns false
XMLStreamException - if there is an error processing the underlying XML source
See Also:
XMLEvent

public void require(int type, String namespaceURI, String localName) throws XMLStreamException
测试当前事件是否属于给定的类型，以及名称空间和名称是否与当前事件的当前名称空间和名称相匹配。如果 namespaceURI 为 null，则该参数不进行相等性检查；如果 localName 为 null，则该参数不进行相等性检查。
type | 事件类型
namespaceURI | 事件的 URI，可以为 null
localName | 事件的 localName，可以为 null
Throws | XMLStreamException: 如果所需值不匹配。
英文文档：

require

void require(int type,
             String namespaceURI,
             String localName)
             throws XMLStreamException
Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event. If the namespaceURI is null it is not checked for equality, if the localName is null it is not checked for equality.

Parameters:
type - the event type
namespaceURI - the uri of the event, may be null
localName - the localName of the event, may be null
Throws:
XMLStreamException - if the required values are not matched.

public String getElementText() throws XMLStreamException
读取纯文本元素的内容，如果不是纯文本元素，则抛出异常。无论 javax.xml.stream.isCoalescing 的值如何，此方法始终返回组合的内容。
前置条件：当前事件是 START_ELEMENT。
后置条件：当前事件是相应的 END_ELEMENT。
此方法执行下列操作（实现可以随意优化，但必须执行等效处理）：
if(getEventType() != XMLStreamConstants.START_ELEMENT) {
throw new XMLStreamException(
"parser must be on START_ELEMENT to read next text", getLocation());
 }
int eventType = next();
StringBuffer content = new StringBuffer();
while(eventType != XMLStreamConstants.END_ELEMENT ) {
if(eventType == XMLStreamConstants.CHARACTERS
|| eventType == XMLStreamConstants.CDATA
|| eventType == XMLStreamConstants.SPACE
|| eventType == XMLStreamConstants.ENTITY_REFERENCE) {
buf.append(getText());
} else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
|| eventType == XMLStreamConstants.COMMENT) {
// skipping
} else if(eventType == XMLStreamConstants.END_DOCUMENT) {
throw new XMLStreamException(
"unexpected end of document when reading element text content", this);
} else if(eventType == XMLStreamConstants.START_ELEMENT) {
throw new XMLStreamException(
"element text content may not contain START_ELEMENT", getLocation());
} else {
throw new XMLStreamException(
"Unexpected event type "+eventType, getLocation());
 }
eventType = next();
 }
return buf.toString();
Throws XMLStreamException: 如果当前事件不是 START_ELEMENT 或者遇到了非文本元素
英文文档：

getElementText

String getElementText()
                      throws XMLStreamException
Reads the content of a text-only element, an exception is thrown if this is not a text-only element. Regardless of value of javax.xml.stream.isCoalescing this method always returns coalesced content.
Precondition: the current event is START_ELEMENT.
Postcondition: the current event is the corresponding END_ELEMENT.
The method does the following (implementations are free to optimized but must do equivalent processing):
 if(getEventType() != XMLStreamConstants.START_ELEMENT) {
 throw new XMLStreamException(
 "parser must be on START_ELEMENT to read next text", getLocation());
 }
 int eventType = next();
 StringBuffer content = new StringBuffer();
 while(eventType != XMLStreamConstants.END_ELEMENT ) {
 if(eventType == XMLStreamConstants.CHARACTERS
 || eventType == XMLStreamConstants.CDATA
 || eventType == XMLStreamConstants.SPACE
 || eventType == XMLStreamConstants.ENTITY_REFERENCE) {
 buf.append(getText());
 } else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
 || eventType == XMLStreamConstants.COMMENT) {
 // skipping
 } else if(eventType == XMLStreamConstants.END_DOCUMENT) {
 throw new XMLStreamException(
 "unexpected end of document when reading element text content", this);
 } else if(eventType == XMLStreamConstants.START_ELEMENT) {
 throw new XMLStreamException(
 "element text content may not contain START_ELEMENT", getLocation());
 } else {
 throw new XMLStreamException(
 "Unexpected event type "+eventType, getLocation());
 }
 eventType = next();
 }
 return buf.toString();

Throws:
XMLStreamException - if the current event is not a START_ELEMENT or if a non text element is encountered

public int nextTag() throws XMLStreamException
在到达 START_ELEMENT 或 END_ELEMENT 之前，跳过所有空格（isWhiteSpace() 返回 true）、COMMENT 或 PROCESSING_INSTRUCTION。如果遇到空格字符、COMMENT、PROCESSING_INSTRUCTION、START_ELEMENT、END_ELEMENT 以外的其他内容，则抛出异常。在处理以空格分隔的纯元素内容时，应使用此方法。
前置条件：无
后置条件：当前事件为 START_ELEMENT 或 END_ELEMENT，并且光标已经移到任何空格事件上。
它实际上执行下列操作（实现可以随意优化，但必须执行等效处理）：
int eventType = next();
while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
|| (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
// skip whitespace
|| eventType == XMLStreamConstants.SPACE
|| eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
|| eventType == XMLStreamConstants.COMMENT
 ) {
eventType = next();
 }
if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
throw new String XMLStreamException("expected start or end tag", getLocation());
 }
return eventType;

return | 元素读取的事件类型（START_ELEMENT 或 END_ELEMENT）
Throws | XMLStreamException: 如果当前事件不是空格、PROCESSING_INSTRUCTION、START_ELEMENT 或 END_ELEMENT
Throws | NoSuchElementException: 如果在 hasNext() 返回 false 时调用
英文文档：

nextTag

int nextTag()
            throws XMLStreamException
Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING_INSTRUCTION, until a START_ELEMENT or END_ELEMENT is reached. If other than white space characters, COMMENT, PROCESSING_INSTRUCTION, START_ELEMENT, END_ELEMENT are encountered, an exception is thrown. This method should be used when processing element-only content seperated by white space.
Precondition: none
Postcondition: the current event is START_ELEMENT or END_ELEMENT and cursor may have moved over any whitespace event.
Essentially it does the following (implementations are free to optimized but must do equivalent processing):
 int eventType = next();
 while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
 || (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
 // skip whitespace
 || eventType == XMLStreamConstants.SPACE
 || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
 || eventType == XMLStreamConstants.COMMENT
 ) {
 eventType = next();
 }
 if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
 throw new String XMLStreamException("expected start or end tag", getLocation());
 }
 return eventType;

Returns:
the event type of the element read (START_ELEMENT or END_ELEMENT)
Throws:
XMLStreamException - if the current event is not white space, PROCESSING_INSTRUCTION, START_ELEMENT or END_ELEMENT
NoSuchElementException - if this is called when hasNext() returns false

public boolean hasNext() throws XMLStreamException
如果有多个解析事件，则返回 true，如果不再有事件，则返回 false。如果 XMLStreamReader 的当前状态为 END_DOCUMENT，则此方法返回 false
return | 如果有多个事件，则返回 true，否则返回 false
Throws | XMLStreamException: 如果检测下一个状态时发生严重错误
英文文档：

hasNext

boolean hasNext()
                throws XMLStreamException
Returns true if there are more parsing events and false if there are no more events. This method will return false if the current state of the XMLStreamReader is END_DOCUMENT

Returns:
true if there are more events, false otherwise
Throws:
XMLStreamException - if there is a fatal error detecting the next state

public void close() throws XMLStreamException
释放与此 Reader 关联的所有资源。此方法不会关闭底层输入源。
Throws XMLStreamException: 如果释放关联资源时发生错误
英文文档：

close

void close()
           throws XMLStreamException
Frees any resources associated with this Reader. This method does not close the underlying input source.

Throws:
XMLStreamException - if there are errors freeing associated resources

public String getNamespaceURI(String prefix)
返回给定前缀的 URI。返回的 URI 取决于处理器的当前状态。

注：根据 Namespaces in XML 规范中的定义，'xml' 前缀被绑定到 "http://www.w3.org/XML/1998/namespace"。

注：'xmlns' 前缀必须被解析到以下名称空间：http://www.w3.org/2000/xmlns/

prefix | 要查找的前缀，不可以为 null
return | 绑定到给定前缀的 URI，如果未绑定，则返回 null
Throws | IllegalArgumentException: 如果前缀为 null
英文文档：

getNamespaceURI

String getNamespaceURI(String prefix)
Return the uri for the given prefix. The uri returned depends on the current state of the processor.

NOTE:The 'xml' prefix is bound as defined in Namespaces in XML specification to "http://www.w3.org/XML/1998/namespace".

NOTE: The 'xmlns' prefix must be resolved to following namespace http://www.w3.org/2000/xmlns/

Parameters:
prefix - The prefix to lookup, may not be null
Returns:
the uri bound to the given prefix or null if it is not bound
Throws:
IllegalArgumentException - if the prefix is null

public boolean isStartElement()
如果光标指向开始标记，则返回 true（否则返回 false）
return 如果光标指向开始标记，则返回 true，否则返回 false
英文文档：

isStartElement

boolean isStartElement()
Returns true if the cursor points to a start tag (otherwise false)

Returns:
true if the cursor points to a start tag, false otherwise

public boolean isEndElement()
如果光标指向结束标记，则返回 true（否则返回 false）
return 如果光标指向结束标记，则返回 true，否则返回 false
英文文档：

isEndElement

boolean isEndElement()
Returns true if the cursor points to an end tag (otherwise false)

Returns:
true if the cursor points to an end tag, false otherwise

public boolean isCharacters()
如果光标指向字符数据事件，则返回 true
return 如果光标指向字符数据，则返回 true，否则返回 false
英文文档：

isCharacters

boolean isCharacters()
Returns true if the cursor points to a character data event

Returns:
true if the cursor points to character data, false otherwise

public boolean isWhiteSpace()
如果光标指向由所有空格组成的字符数据事件，则返回 true
return 如果光标指向所有空格，则返回 true，否则返回 false
英文文档：

isWhiteSpace

boolean isWhiteSpace()
Returns true if the cursor points to a character data event that consists of all whitespace

Returns:
true if the cursor points to all whitespace, false otherwise

public String getAttributeValue(String namespaceURI, String localName)
返回带有名称空间和 localName 的属性的规范化属性值。如果 namespaceURI 为 null，则名称空间不进行相等性检查
namespaceURI | 属性的名称空间
localName | 属性的本地名称，不可以为 null
return | 返回属性的值，如果未找到，则返回 null
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributeValue

String getAttributeValue(String namespaceURI,
                         String localName)
Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality

Parameters:
namespaceURI - the namespace of the attribute
localName - the local name of the attribute, cannot be null
Returns:
returns the value of the attribute , returns null if not found
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public int getAttributeCount()
返回此 START_ELEMENT 中的属性计数，此方法仅对 START_ELEMENT 或 ATTRIBUTE 有效。此计数不包括名称空间定义。属性索引从零开始。
return | 返回属性数
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributeCount

int getAttributeCount()
Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE. This count excludes namespace definitions. Attribute indices are zero-based.

Returns:
returns the number of attributes
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public javax.xml.namespace.QName getAttributeName(int index)
返回所提供索引处的属性的 qname
index | 属性的位置
return | 属性的 QName
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributeName

QName getAttributeName(int index)
Returns the qname of the attribute at the provided index

Parameters:
index - the position of the attribute
Returns:
the QName of the attribute
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public String getAttributeNamespace(int index)
返回所提供索引处的属性的名称空间
index | 属性的位置
return | 名称空间 URI（可以为 null）
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributeNamespace

String getAttributeNamespace(int index)
Returns the namespace of the attribute at the provided index

Parameters:
index - the position of the attribute
Returns:
the namespace URI (can be null)
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public String getAttributeLocalName(int index)
返回所提供索引处的属性的 localName
index | 属性的位置
return | 属性的 localName
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributeLocalName

String getAttributeLocalName(int index)
Returns the localName of the attribute at the provided index

Parameters:
index - the position of the attribute
Returns:
the localName of the attribute
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public String getAttributePrefix(int index)
返回所提供索引处的属性的前缀
index | 属性的位置
return | 属性的前缀
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributePrefix

String getAttributePrefix(int index)
Returns the prefix of this attribute at the provided index

Parameters:
index - the position of the attribute
Returns:
the prefix of the attribute
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public String getAttributeType(int index)
返回所提供索引处的属性的 XML 类型
index | 属性的位置
return | 属性的 XML 类型
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributeType

String getAttributeType(int index)
Returns the XML type of the attribute at the provided index

Parameters:
index - the position of the attribute
Returns:
the XML type of the attribute
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public String getAttributeValue(int index)
返回 index 处的属性值
index | 属性的位置
return | 属性值
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

getAttributeValue

String getAttributeValue(int index)
Returns the value of the attribute at the index

Parameters:
index - the position of the attribute
Returns:
the attribute value
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public boolean isAttributeSpecified(int index)
返回一个 boolean 值，它指示此属性是否为默认创建的
index | 属性的位置
return | 如果这是一个默认属性，则返回 true
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 ATTRIBUTE
英文文档：

isAttributeSpecified

boolean isAttributeSpecified(int index)
Returns a boolean which indicates if this attribute was created by default

Parameters:
index - the position of the attribute
Returns:
true if this is a default attribute
Throws:
IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE

public int getNamespaceCount()
返回在 START_ELEMENT 或 END_ELEMENT 中声明的名称空间的计数，此方法仅对 START_ELEMENT、END_ELEMENT 或 NAMESPACE 有效。对于 END_ELEMENT，计数是最大的名称空间范围。它等同于 SAX 回调所报告的有关结束元素事件的信息。
return | 返回此特定元素中的名称空间声明数
Throws | IllegalStateException: 如果不是 START_ELEMENT、END_ELEMENT 或 NAMESPACE
英文文档：

getNamespaceCount

int getNamespaceCount()
Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. On an END_ELEMENT the count is of the namespaces that are about to go out of scope. This is the equivalent of the information reported by SAX callback for an end element event.

Returns:
returns the number of namespace declarations on this specific element
Throws:
IllegalStateException - if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE

public String getNamespacePrefix(int index)
返回在 index 处声明的名称空间前缀。如果是默认名称空间声明，则返回 null
index | 名称空间声明的位置
return | 返回名称空间前缀
Throws | IllegalStateException: 如果不是 START_ELEMENT、END_ELEMENT 或 NAMESPACE
英文文档：

getNamespacePrefix

String getNamespacePrefix(int index)
Returns the prefix for the namespace declared at the index. Returns null if this is the default namespace declaration

Parameters:
index - the position of the namespace declaration
Returns:
returns the namespace prefix
Throws:
IllegalStateException - if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE

public String getNamespaceURI(int index)
返回在 index 处声明的名称空间 URI。
index | 名称空间声明的位置
return | 返回名称空间 URI
Throws | IllegalStateException: 如果不是 START_ELEMENT、END_ELEMENT 或 NAMESPACE
英文文档：

getNamespaceURI

String getNamespaceURI(int index)
Returns the uri for the namespace declared at the index.

Parameters:
index - the position of the namespace declaration
Returns:
returns the namespace uri
Throws:
IllegalStateException - if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE

public javax.xml.namespace.NamespaceContext getNamespaceContext()
返回当前位置的只读名称空间上下文。上下文为 transient，只在调用 next() 更改 reader 的状态之前才有效。
return 返回名称空间上下文
英文文档：

getNamespaceContext

NamespaceContext getNamespaceContext()
Returns a read only namespace context for the current position. The context is transient and only valid until a call to next() changes the state of the reader.

Returns:
return a namespace context

public int getEventType()
返回一个整数码，指示光标所指向的事件的类型。
英文文档：

getEventType

int getEventType()
Returns an integer code that indicates the type of the event the cursor is pointing to.

public String getText()
以字符串的形式返回解析事件的当前值，此方法返回 CHARACTERS 事件的字符串值，返回 COMMENT 的值、ENTITY_REFERENCE 的替代值、CDATA 节的字符串值、SPACE 事件的字符串值、DTD 内部子集的字符串值。如果已经解析了 ENTITY_REFERENCE，则所有字符数据都将被报告为 CHARACTERS 事件。
return | 当前文本或 null
Throws | IllegalStateException: 如果此状态不是有效的文本状态。
英文文档：

getText

String getText()
Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. If an ENTITY_REFERENCE has been resolved, any character data will be reported as CHARACTERS events.

Returns:
the current text or null
Throws:
IllegalStateException - if this state is not a valid text state.

public char[] getTextCharacters()
返回一个包含此事件中字符的数组。此数组应被视为只读的和 transient，即在 XMLStreamReader 移动到下一个事件之前，数组将包含文本字符。试图在超出该时间范围后保存到字符数组，或者试图修改数组的内容，这些都是违背此接口约定的行为。
return | 当前文本或空数组
Throws | IllegalStateException: 如果此状态不是有效的文本状态。
英文文档：

getTextCharacters

char[] getTextCharacters()
Returns an array which contains the characters from this event. This array should be treated as read-only and transient. I.e. the array will contain the text characters until the XMLStreamReader moves on to the next event. Attempts to hold onto the character array beyond that time or modify the contents of the array are breaches of the contract for this interface.

Returns:
the current text or an empty array
Throws:
IllegalStateException - if this state is not a valid text state.

public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException
获取与 CHARACTERS、SPACE 或 CDATA 事件关联的文本。以 "sourceStart" 开始的文本被复制到以 "targetStart" 开始的 "target" 中。最多复制 "length" 个字符。返回实际复制的字符数。 "sourceStart" 参数必须大于等于 0 且小于等于与事件关联的字符数。通常，一个请求文本以 "sourceStart" 为 0 开始。如果实际复制的字符数小于 "length"，则表示没有更多的文本。否则，在检索完所有文本之前，需要进行后续的调用。例如：
int length = 1024; char[] myBuffer = new char[ length ];

for ( int sourceStart = 0 ; ; sourceStart += length ) { int nCopied = stream.getTextCharacters( sourceStart, myBuffer, 0, length );

if (nCopied < length) break; }
 如果在底层源中存在任何 XML 错误，则抛出 XMLStreamException。"targetStart" 参数必须大于等于 0 且小于 "target" 的长度，Length 必须大于 0，而 "targetStart + length" 必须小于等于 "target" 的长度。
sourceStart | 要复制的源数组中第一个字符的索引
target | 目标数组
targetStart | 目标数组中的起始偏移量
length | 要复制的字符数
return | 实际复制的字符数
Throws | XMLStreamException: 如果底层 XML 源不是格式良好的
Throws | IndexOutOfBoundsException: 如果 targetStart < 0 或 > 目标长度
Throws | IndexOutOfBoundsException: 如果 length < 0 或 targetStart + length > 目标长度
Throws | UnsupportedOperationException: 如果此方法不受支持
Throws | NullPointerException: 如果目标为 null
英文文档：

getTextCharacters

int getTextCharacters(int sourceStart,
                      char[] target,
                      int targetStart,
                      int length)
                      throws XMLStreamException
Gets the the text associated with a CHARACTERS, SPACE or CDATA event. Text starting a "sourceStart" is copied into "target" starting at "targetStart". Up to "length" characters are copied. The number of characters actually copied is returned. The "sourceStart" argument must be greater or equal to 0 and less than or equal to the number of characters associated with the event. Usually, one requests text starting at a "sourceStart" of 0. If the number of characters actually copied is less than the "length", then there is no more text. Otherwise, subsequent calls need to be made until all text has been retrieved. For example:
int length = 1024;
char[] myBuffer = new char[ length ];

for ( int sourceStart = 0 ; ; sourceStart += length )
{
   int nCopied = stream.getTextCharacters( sourceStart, myBuffer, 0, length );

  if (nCopied < length)
      break;
}
 XMLStreamException may be thrown if there are any XML errors in the underlying source. The "targetStart" argument must be greater than or equal to 0 and less than the length of "target", Length must be greater than 0 and "targetStart + length" must be less than or equal to length of "target".

Parameters:
sourceStart - the index of the first character in the source array to copy
target - the destination array
targetStart - the start offset in the target array
length - the number of characters to copy
Returns:
the number of characters actually copied
Throws:
XMLStreamException - if the underlying XML source is not well-formed
IndexOutOfBoundsException - if targetStart < 0 or > than the length of target
IndexOutOfBoundsException - if length < 0 or targetStart + length > length of target
UnsupportedOperationException - if this method is not supported
NullPointerException - is if target is null

public int getTextStart()
返回存储（此文本事件的）第一个字符位置处的文本字符数组的偏移量。
Throws IllegalStateException: 如果此状态不是有效的文本状态。
英文文档：

getTextStart

int getTextStart()
Returns the offset into the text character array where the first character (of this text event) is stored.

Throws:
IllegalStateException - if this state is not a valid text state.

public int getTextLength()
返回文本字符数组中此文本事件的字符序列长度。
Throws IllegalStateException: 如果此状态不是有效的文本状态。
英文文档：

getTextLength

int getTextLength()
Returns the length of the sequence of characters for this Text event within the text character array.

Throws:
IllegalStateException - if this state is not a valid text state.

public String getEncoding()
如果输入编码已知，则返回输入编码；如果未知，则返回 null。
return 此实例的编码或 null
英文文档：

getEncoding

String getEncoding()
Return input encoding if known or null if unknown.

Returns:
the encoding of this instance or null

public boolean hasText()
如果当前事件具有文本，则返回 true，否则返回 false。以下事件具有文本：CHARACTERS、DTD、ENTITY_REFERENCE、COMMENT、SPACE
英文文档：

hasText

boolean hasText()
Return true if the current event has text, false otherwise The following events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE

public Location getLocation()
返回处理器的当前位置。如果 Location 未知，则处理器应返回 Location 的实现，该实现对位置返回 -1，对 publicId 和 systemId 返回 null。位置信息仅在调用 next() 之前有效。
英文文档：

getLocation

Location getLocation()
Return the current location of the processor. If the Location is unknown the processor should return an implementation of Location that returns -1 for the location and null for the publicId and systemId. The location information is only valid until next() is called.

public javax.xml.namespace.QName getName()
返回当前 START_ELEMENT 或 END_ELEMENT 事件的 QName
return | 当前 START_ELEMENT 或 END_ELEMENT 事件的 QName
Throws | IllegalStateException: 如果不是 START_ELEMENT 或 END_ELEMENT
英文文档：

getName

QName getName()
Returns a QName for the current START_ELEMENT or END_ELEMENT event

Returns:
the QName for the current START_ELEMENT or END_ELEMENT event
Throws:
IllegalStateException - if this is not a START_ELEMENT or END_ELEMENT

public String getLocalName()
返回当前事件的（本地）名称。对于 START_ELEMENT 或 END_ELEMENT，返回当前元素的（本地）名称。对于 ENTITY_REFERENCE，返回实体名称。当前事件必须是 START_ELEMENT、END_ELEMENT 或 ENTITY_REFERENCE
return | localName
Throws | IllegalStateException: 如果不是 START_ELEMENT、END_ELEMENT 或 ENTITY_REFERENCE
英文文档：

getLocalName

String getLocalName()
Returns the (local) name of the current event. For START_ELEMENT or END_ELEMENT returns the (local) name of the current element. For ENTITY_REFERENCE it returns entity name. The current event must be START_ELEMENT or END_ELEMENT, or ENTITY_REFERENCE

Returns:
the localName
Throws:
IllegalStateException - if this not a START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE

public boolean hasName()
如果当前事件有名称（是 START_ELEMENT 或 END_ELEMENT），则返回 ture，否则返回 false
英文文档：

hasName

boolean hasName()
returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT) returns false otherwise

public String getNamespaceURI()
如果当前事件是 START_ELEMENT 或 END_ELEMENT，则此方法返回前缀的 URI 或默认名称空间。如果事件没有前缀，则返回 null。
return 绑定到此元素前缀的 URI、默认名称空间或 null
英文文档：

getNamespaceURI

String getNamespaceURI()
If the current event is a START_ELEMENT or END_ELEMENT this method returns the URI of the prefix or the default namespace. Returns null if the event does not have a prefix.

Returns:
the URI bound to this elements prefix, the default namespace, or null

public String getPrefix()
返回当前事件的前缀，如果事件没有前缀，则返回 null
return 前缀或 null
英文文档：

getPrefix

String getPrefix()
Returns the prefix of the current event or null if the event does not have a prefix

Returns:
the prefix or null

public String getVersion()
获取在 xml 声明中声明的 xml 版本，如果没有声明版本，则返回 null
return XML 版本或 null
英文文档：

getVersion

String getVersion()
Get the xml version declared on the xml declaration Returns null if none was declared

Returns:
the XML version or null

public boolean isStandalone()
获取 xml 声明中的独立声明
return 如果是独立的，则返回 true，否则返回 false
英文文档：

isStandalone

boolean isStandalone()
Get the standalone declaration from the xml declaration

Returns:
true if this is standalone, or false otherwise

public boolean standaloneSet()
检查文档中是否设置了独立
return 如果文档中设置了独立，则返回 true，否则返回 false
英文文档：

standaloneSet

boolean standaloneSet()
Checks if standalone was set in the document

Returns:
true if standalone was set in the document, or false otherwise

public String getCharacterEncodingScheme()
返回 xml 声明中声明的字符编码。如果没有声明字符编码，则返回 null
return 在文档中声明的编码或 null
英文文档：

getCharacterEncodingScheme

String getCharacterEncodingScheme()
Returns the character encoding declared on the xml declaration Returns null if none was declared

Returns:
the encoding declared in the document or null

public String getPITarget()
获取处理指令的目标
return 目标或 null
英文文档：

getPITarget

String getPITarget()
Get the target of a processing instruction

Returns:
the target or null

public String getPIData()
获取处理指令的数据节
return 数据或 null
英文文档：

getPIData

String getPIData()
Get the data section of a processing instruction

Returns:
the data or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLStreamWriter (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.stream
Interface XMLStreamWriter

public interface XMLStreamWriter

XMLStreamWriter 接口指定如何编写 XML。XMLStreamWriter 不在其输入中检查格式是否良好。但是，writeCharacters 方法需要转义属性值的 &、< 和 >。writeAttribute 方法将转义上述字符以及 "，以确保所有字符内容和属性值都是格式良好的。 必须单独编写每个 NAMESPACE 和 ATTRIBUTE。 如果 javax.xml.stream.isPrefixDefaulting 设置为 false，则在使用没有绑定到前缀的名称空间 URI 写入元素时将出现致命错误。 如果 javax.xml.stream.isPrefixDefaulting 设置为 true，则 XMLStreamWriter 实现必须为当前范围内遇到的每个未绑定 URI 写入前缀。
version | 1.0
See also | javax.xml.stream.XMLOutputFactory, javax.xml.stream.XMLStreamReader
英文文档：

The XMLStreamWriter interface specifies how to write XML. The XMLStreamWriter does not perform well formedness checking on its input. However the writeCharacters method is required to escape & , < and > For attribute values the writeAttribute method will escape the above characters plus " to ensure that all character content and attribute values are well formed. Each NAMESPACE and ATTRIBUTE must be individually written. If javax.xml.stream.isPrefixDefaulting is set to false it is a fatal error if an element is written with namespace URI that has not been bound to a prefix. If javax.xml.stream.isPrefixDefaulting is set to true the XMLStreamWriter implementation must write a prefix for each unbound URI that it encounters in the current scope.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLOutputFactory, XMLStreamReader

Method Summary
void | close() Close this writer and free any resources associated with the writer.
void | flush() Write any cached data to the underlying output mechanism.
NamespaceContext | getNamespaceContext() Returns the current namespace context.
String | getPrefix(String uri) Gets the prefix the uri is bound to
Object | getProperty(String name) Get the value of a feature/property from the underlying implementation
void | setDefaultNamespace(String uri) Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair.
void | setNamespaceContext(NamespaceContext context) Sets the current namespace context for prefix and uri bindings.
void | setPrefix(String prefix, String uri) Sets the prefix the uri is bound to.
void | writeAttribute(String localName, String value) Writes an attribute to the output stream without a prefix.
void | writeAttribute(String namespaceURI, String localName, String value) Writes an attribute to the output stream
void | writeAttribute(String prefix, String namespaceURI, String localName, String value) Writes an attribute to the output stream
void | writeCData(String data) Writes a CData section
void | writeCharacters(char[] text, int start, int len) Write text to the output
void | writeCharacters(String text) Write text to the output
void | writeComment(String data) Writes an xml comment with the data enclosed
void | writeDefaultNamespace(String namespaceURI) Writes the default namespace to the stream
void | writeDTD(String dtd) Write a DTD section.
void | writeEmptyElement(String localName) Writes an empty element tag to the output
void | writeEmptyElement(String namespaceURI, String localName) Writes an empty element tag to the output
void | writeEmptyElement(String prefix, String localName, String namespaceURI) Writes an empty element tag to the output
void | writeEndDocument() Closes any start tags and writes corresponding end tags.
void | writeEndElement() Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.
void | writeEntityRef(String name) Writes an entity reference
void | writeNamespace(String prefix, String namespaceURI) Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace
void | writeProcessingInstruction(String target) Writes a processing instruction
void | writeProcessingInstruction(String target, String data) Writes a processing instruction
void | writeStartDocument() Write the XML Declaration.
void | writeStartDocument(String version) Write the XML Declaration.
void | writeStartDocument(String encoding, String version) Write the XML Declaration.
void | writeStartElement(String localName) Writes a start tag to the output.
void | writeStartElement(String namespaceURI, String localName) Writes a start tag to the output
void | writeStartElement(String prefix, String localName, String namespaceURI) Writes a start tag to the output

Method Detail

public void writeStartElement(String localName) throws XMLStreamException
向输出写入一个开始标记。所有 writeStartElement 方法都在内部名称空间上下文中打开一个新的作用域。编写相应的 EndElement 导致作用域被关闭。
localName | 标记的本地名称，不可以为 null
Throws | XMLStreamException:
英文文档：

writeStartElement

void writeStartElement(String localName)
                       throws XMLStreamException
Writes a start tag to the output. All writeStartElement methods open a new scope in the internal namespace context. Writing the corresponding EndElement causes the scope to be closed.

Parameters:
localName - local name of the tag, may not be null
Throws:
XMLStreamException

public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException
向输出写入一个开始标记
namespaceURI | 要使用的前缀的 namespaceURI ，不可以为 null
localName | 标记的本地名称，不可以为 null
Throws | XMLStreamException: 如果名称空间 URI 未绑定到前缀并且 javax.xml.stream.isPrefixDefaulting 未设置为 true
英文文档：

writeStartElement

void writeStartElement(String namespaceURI,
                       String localName)
                       throws XMLStreamException
Writes a start tag to the output

Parameters:
namespaceURI - the namespaceURI of the prefix to use, may not be null
localName - local name of the tag, may not be null
Throws:
XMLStreamException - if the namespace URI has not been bound to a prefix and javax.xml.stream.isPrefixDefaulting has not been set to true

public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
向输出写入一个开始标记
localName | 标记的本地名称，不可以为 null
prefix | 标记的前缀，不可以为 null
namespaceURI | 要绑定前缀的 URI，不可以为 null
Throws | XMLStreamException:
英文文档：

writeStartElement

void writeStartElement(String prefix,
                       String localName,
                       String namespaceURI)
                       throws XMLStreamException
Writes a start tag to the output

Parameters:
localName - local name of the tag, may not be null
prefix - the prefix of the tag, may not be null
namespaceURI - the uri to bind the prefix to, may not be null
Throws:
XMLStreamException

public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException
向输出写入一个空元素标记
namespaceURI | 要绑定标记的 URI，不可以为 null
localName | 标记的本地名称，不可以为 null
Throws | XMLStreamException: 如果名称空间 URI 未绑定到前缀并且 javax.xml.stream.isPrefixDefaulting 未设置为 true
英文文档：

writeEmptyElement

void writeEmptyElement(String namespaceURI,
                       String localName)
                       throws XMLStreamException
Writes an empty element tag to the output

Parameters:
namespaceURI - the uri to bind the tag to, may not be null
localName - local name of the tag, may not be null
Throws:
XMLStreamException - if the namespace URI has not been bound to a prefix and javax.xml.stream.isPrefixDefaulting has not been set to true

public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
向输出写入一个空元素标记
prefix | 标记的前缀，不可以为 null
localName | 标记的本地名称，不可以为 null
namespaceURI | 要绑定标记的 URI，不可以为 null
Throws | XMLStreamException:
英文文档：

writeEmptyElement

void writeEmptyElement(String prefix,
                       String localName,
                       String namespaceURI)
                       throws XMLStreamException
Writes an empty element tag to the output

Parameters:
prefix - the prefix of the tag, may not be null
localName - local name of the tag, may not be null
namespaceURI - the uri to bind the tag to, may not be null
Throws:
XMLStreamException

public void writeEmptyElement(String localName) throws XMLStreamException
向输出写入一个空元素标记
localName | 标记的本地名称，不可以为 null
Throws | XMLStreamException:
英文文档：

writeEmptyElement

void writeEmptyElement(String localName)
                       throws XMLStreamException
Writes an empty element tag to the output

Parameters:
localName - local name of the tag, may not be null
Throws:
XMLStreamException

public void writeEndElement() throws XMLStreamException
向依赖于 writer 内部状态的输出写入一个结束标记，以此确定事件的前缀和本地名称。
Throws XMLStreamException:
英文文档：

writeEndElement

void writeEndElement()
                     throws XMLStreamException
Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.

Throws:
XMLStreamException

public void writeEndDocument() throws XMLStreamException
关闭所有开始标记并写入相应的结束标记。
Throws XMLStreamException:
英文文档：

writeEndDocument

void writeEndDocument()
                      throws XMLStreamException
Closes any start tags and writes corresponding end tags.

Throws:
XMLStreamException

public void close() throws XMLStreamException
关闭此 writer 并释放与 writer 关联的所有资源。此方法不得关闭底层输出流。
Throws XMLStreamException:
英文文档：

close

void close()
           throws XMLStreamException
Close this writer and free any resources associated with the writer. This must not close the underlying output stream.

Throws:
XMLStreamException

public void flush() throws XMLStreamException
将所有缓存数据写入底层输出机制。
Throws XMLStreamException:
英文文档：

flush

void flush()
           throws XMLStreamException
Write any cached data to the underlying output mechanism.

Throws:
XMLStreamException

public void writeAttribute(String localName, String value) throws XMLStreamException
向输出流写入一个不带前缀的属性。
localName | 属性的本地名称
value | 属性的值
Throws | IllegalStateException: 如果当前状态不允许 Attribute 写入
Throws | XMLStreamException:
英文文档：

writeAttribute

void writeAttribute(String localName,
                    String value)
                    throws XMLStreamException
Writes an attribute to the output stream without a prefix.

Parameters:
localName - the local name of the attribute
value - the value of the attribute
Throws:
IllegalStateException - if the current state does not allow Attribute writing
XMLStreamException

public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException
向输出流写入一个属性
prefix | 此属性的前缀
namespaceURI | 此属性前缀的 URI
localName | 属性的本地名称
value | 属性的值
Throws | IllegalStateException: 如果当前状态不允许 Attribute 写入
Throws | XMLStreamException: 如果名称空间 URI 未绑定到前缀并且 javax.xml.stream.isPrefixDefaulting 未设置为 true
英文文档：

writeAttribute

void writeAttribute(String prefix,
                    String namespaceURI,
                    String localName,
                    String value)
                    throws XMLStreamException
Writes an attribute to the output stream

Parameters:
prefix - the prefix for this attribute
namespaceURI - the uri of the prefix for this attribute
localName - the local name of the attribute
value - the value of the attribute
Throws:
IllegalStateException - if the current state does not allow Attribute writing
XMLStreamException - if the namespace URI has not been bound to a prefix and javax.xml.stream.isPrefixDefaulting has not been set to true

public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException
向输出流写入一个属性
namespaceURI | 此属性前缀的 URI
localName | 属性的本地名称
value | 属性的值
Throws | IllegalStateException: 如果当前状态不允许 Attribute 写入
Throws | XMLStreamException: 如果名称空间 URI 未绑定到前缀并且 javax.xml.stream.isPrefixDefaulting 未设置为 true
英文文档：

writeAttribute

void writeAttribute(String namespaceURI,
                    String localName,
                    String value)
                    throws XMLStreamException
Writes an attribute to the output stream

Parameters:
namespaceURI - the uri of the prefix for this attribute
localName - the local name of the attribute
value - the value of the attribute
Throws:
IllegalStateException - if the current state does not allow Attribute writing
XMLStreamException - if the namespace URI has not been bound to a prefix and javax.xml.stream.isPrefixDefaulting has not been set to true

public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException
向输出流写入一个名称空间。如果此方法的 prefix 参数为空字符串、"xmlns" 或 null，则此方法将委托给 writeDefaultNamespace。
prefix | 要绑定名称空间的前缀
namespaceURI | 要绑定前缀的 URI
Throws | IllegalStateException: 如果当前状态不允许 Namespace 写入
Throws | XMLStreamException:
英文文档：

writeNamespace

void writeNamespace(String prefix,
                    String namespaceURI)
                    throws XMLStreamException
Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace

Parameters:
prefix - the prefix to bind this namespace to
namespaceURI - the uri to bind the prefix to
Throws:
IllegalStateException - if the current state does not allow Namespace writing
XMLStreamException

public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException
向流写入默认名称空间
namespaceURI | 要绑定默认名称空间的 URI
Throws | IllegalStateException: 如果当前状态不允许 Namespace 写入
Throws | XMLStreamException:
英文文档：

writeDefaultNamespace

void writeDefaultNamespace(String namespaceURI)
                           throws XMLStreamException
Writes the default namespace to the stream

Parameters:
namespaceURI - the uri to bind the default namespace to
Throws:
IllegalStateException - if the current state does not allow Namespace writing
XMLStreamException

public void writeComment(String data) throws XMLStreamException
编写一个包含数据的 XML 注释
data | 包含在注释中的数据，可以为 null
Throws | XMLStreamException:
英文文档：

writeComment

void writeComment(String data)
                  throws XMLStreamException
Writes an xml comment with the data enclosed

Parameters:
data - the data contained in the comment, may be null
Throws:
XMLStreamException

public void writeProcessingInstruction(String target) throws XMLStreamException
编写一条处理指令
target | 处理指令的目标，不可以为 null
Throws | XMLStreamException:
英文文档：

writeProcessingInstruction

void writeProcessingInstruction(String target)
                                throws XMLStreamException
Writes a processing instruction

Parameters:
target - the target of the processing instruction, may not be null
Throws:
XMLStreamException

public void writeProcessingInstruction(String target, String data) throws XMLStreamException
编写一条处理指令
target | 处理指令的目标，不可以为 null
data | 处理指令中包含的数据，不可以为 null
Throws | XMLStreamException:
英文文档：

writeProcessingInstruction

void writeProcessingInstruction(String target,
                                String data)
                                throws XMLStreamException
Writes a processing instruction

Parameters:
target - the target of the processing instruction, may not be null
data - the data contained in the processing instruction, may not be null
Throws:
XMLStreamException

public void writeCData(String data) throws XMLStreamException
编写 CData 节
data | CData 节中包含的数据，不可以为 null
Throws | XMLStreamException:
英文文档：

writeCData

void writeCData(String data)
                throws XMLStreamException
Writes a CData section

Parameters:
data - the data contained in the CData Section, may not be null
Throws:
XMLStreamException

public void writeDTD(String dtd) throws XMLStreamException
编写 DTD 节。此字符串代表 XML 1.0 规范的整个 doctypedecl 产品。
dtd | 要编写的 DTD
Throws | XMLStreamException:
英文文档：

writeDTD

void writeDTD(String dtd)
              throws XMLStreamException
Write a DTD section. This string represents the entire doctypedecl production from the XML 1.0 specification.

Parameters:
dtd - the DTD to be written
Throws:
XMLStreamException

public void writeEntityRef(String name) throws XMLStreamException
编写一个实体引用
name | 实体的名称
Throws | XMLStreamException:
英文文档：

writeEntityRef

void writeEntityRef(String name)
                    throws XMLStreamException
Writes an entity reference

Parameters:
name - the name of the entity
Throws:
XMLStreamException

public void writeStartDocument() throws XMLStreamException
编写 XML 声明。默认 XML 版本为 1.0，默认编码为 utf-8
Throws XMLStreamException:
英文文档：

writeStartDocument

void writeStartDocument()
                        throws XMLStreamException
Write the XML Declaration. Defaults the XML version to 1.0, and the encoding to utf-8

Throws:
XMLStreamException

public void writeStartDocument(String version) throws XMLStreamException
编写 XML 声明。默认 XML 版本为 1.0
version | XML 文档的版本
Throws | XMLStreamException:
英文文档：

writeStartDocument

void writeStartDocument(String version)
                        throws XMLStreamException
Write the XML Declaration. Defaults the XML version to 1.0

Parameters:
version - version of the xml document
Throws:
XMLStreamException

public void writeStartDocument(String encoding, String version) throws XMLStreamException
编写 XML 声明。注意，编码参数不能设置底层输出的实际编码。它必须在使用 XMLOutputFactory 创建 XMLStreamWriter 实例时进行设置
encoding | XML 声明的编码
version | XML 文档的版本
Throws | XMLStreamException:
英文文档：

writeStartDocument

void writeStartDocument(String encoding,
                        String version)
                        throws XMLStreamException
Write the XML Declaration. Note that the encoding parameter does not set the actual encoding of the underlying output. That must be set when the instance of the XMLStreamWriter is created using the XMLOutputFactory

Parameters:
encoding - encoding of the xml declaration
version - version of the xml document
Throws:
XMLStreamException

public void writeCharacters(String text) throws XMLStreamException
向输出写入文本
text | 要写入的值
Throws | XMLStreamException:
英文文档：

writeCharacters

void writeCharacters(String text)
                     throws XMLStreamException
Write text to the output

Parameters:
text - the value to write
Throws:
XMLStreamException

public void writeCharacters(char[] text, int start, int len) throws XMLStreamException
向输出写入文本
text | 要写入的值
start | 数组中的起始位置
len | 要写入的字符数
Throws | XMLStreamException:
英文文档：

writeCharacters

void writeCharacters(char[] text,
                     int start,
                     int len)
                     throws XMLStreamException
Write text to the output

Parameters:
text - the value to write
start - the starting position in the array
len - the number of characters to write
Throws:
XMLStreamException

public String getPrefix(String uri) throws XMLStreamException
获取绑定 URI 的前缀
return | 前缀或 null
Throws | XMLStreamException:
英文文档：

getPrefix

String getPrefix(String uri)
                 throws XMLStreamException
Gets the prefix the uri is bound to

Returns:
the prefix or null
Throws:
XMLStreamException

public void setPrefix(String prefix, String uri) throws XMLStreamException
设置绑定 URI 的前缀。前缀在当前 START_ELEMENT / END_ELEMENT 对的范围内绑定。如果在写入 START_ELEMENT 之前调用此方法，则前缀在根范围内绑定。
prefix | 要绑定到 URI 的前缀，不可以为 null
uri | 要绑定到前缀的 URI，不可以为 null
Throws | XMLStreamException:
英文文档：

setPrefix

void setPrefix(String prefix,
               String uri)
               throws XMLStreamException
Sets the prefix the uri is bound to. This prefix is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the prefix is bound in the root scope.

Parameters:
prefix - the prefix to bind to the uri, may not be null
uri - the uri to bind to the prefix, may be null
Throws:
XMLStreamException

public void setDefaultNamespace(String uri) throws XMLStreamException
将 URI 绑定到默认名称空间。此 URI 在当前 START_ELEMENT / END_ELEMENT 对的范围内绑定。如果在写入 START_ELEMENT 之前调用此方法，则 URI 在根范围内绑定。
uri | 要绑定到默认名称空间的 URI，不可以为 null
Throws | XMLStreamException:
英文文档：

setDefaultNamespace

void setDefaultNamespace(String uri)
                         throws XMLStreamException
Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the uri is bound in the root scope.

Parameters:
uri - the uri to bind to the default namespace, may be null
Throws:
XMLStreamException

public void setNamespaceContext(javax.xml.namespace.NamespaceContext context) throws XMLStreamException
设置前缀和 URI 绑定的当前名称空间上下文。此上下文成为用于写入的根名称空间上下文，并将替换当前的根名称空间上下文。通过将传递到此方法的上下文用作解析名称空间的根上下文，对 setPrefix 和 setDefaultNamespace 的后续调用将绑定名称空间。此方法只能在文档开始处调用一次。这不会导致名称空间被声明。如果在名称空间上下文中存在前缀映射关系的名称空间 URI，则它将被视为已经声明，并且该前缀可以被 StreamWriter 使用。
context | 将用于此 writer 的名称空间上下文，不可以为 null
Throws | XMLStreamException:
英文文档：

setNamespaceContext

void setNamespaceContext(NamespaceContext context)
                         throws XMLStreamException
Sets the current namespace context for prefix and uri bindings. This context becomes the root namespace context for writing and will replace the current root namespace context. Subsequent calls to setPrefix and setDefaultNamespace will bind namespaces using the context passed to the method as the root context for resolving namespaces. This method may only be called once at the start of the document. It does not cause the namespaces to be declared. If a namespace URI to prefix mapping is found in the namespace context it is treated as declared and the prefix may be used by the StreamWriter.

Parameters:
context - the namespace context to use for this writer, may not be null
Throws:
XMLStreamException

public javax.xml.namespace.NamespaceContext getNamespaceContext()
返回当前名称空间上下文。
return 当前 NamespaceContext
英文文档：

getNamespaceContext

NamespaceContext getNamespaceContext()
Returns the current namespace context.

Returns:
the current NamespaceContext

public Object getProperty(String name) throws IllegalArgumentException
从底层实现获取功能/属性的值。
name | 属性的名称，不可以为 null
return | 属性的值
Throws | IllegalArgumentException: 如果属性不受支持
Throws | NullPointerException: 如果名称为 null。
英文文档：

getProperty

Object getProperty(String name)
                   throws IllegalArgumentException
Get the value of a feature/property from the underlying implementation

Parameters:
name - The name of the property, may not be null
Returns:
The value of the property
Throws:
IllegalArgumentException - if the property is not supported
NullPointerException - if the name is null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


XMLEventFactory (Java EE 5)

javax.xml.stream
Class XMLEventFactory

java.lang.Object
    extended by  javax.xml.stream.XMLEventFactory

public abstract class XMLEventFactory
extends Object

此接口定义一个创建 XMLEvent 实例的实用工具类。
version | 1.0
See also | javax.xml.stream.events.StartElement, javax.xml.stream.events.EndElement, javax.xml.stream.events.ProcessingInstruction, javax.xml.stream.events.Comment, javax.xml.stream.events.Characters, javax.xml.stream.events.StartDocument, javax.xml.stream.events.EndDocument, javax.xml.stream.events.DTD
英文文档：

This interface defines a utility class for creating instances of XMLEvents

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
StartElement, EndElement, ProcessingInstruction, Comment, Characters, StartDocument, EndDocument, DTD

Constructor Summary
protected XMLEventFactory()
Method Summary
abstract Attribute | createAttribute(QName name, String value) Create a new Attribute
abstract Attribute | createAttribute(String localName, String value) Create a new Attribute
abstract Attribute | createAttribute(String prefix, String namespaceURI, String localName, String value) Create a new Attribute
abstract Characters | createCData(String content) Create a Characters event with the CData flag set to true
abstract Characters | createCharacters(String content) Create a Characters event, this method does not check if the content is all whitespace.
abstract Comment | createComment(String text) Create a comment
abstract DTD | createDTD(String dtd) Create a document type definition event This string contains the entire document type declaration that matches the doctypedecl in the XML 1.0 specification
abstract EndDocument | createEndDocument() Creates a new instance of an EndDocument event
abstract EndElement | createEndElement(QName name, Iterator namespaces) Create a new EndElement
abstract EndElement | createEndElement(String prefix, String namespaceUri, String localName) Create a new EndElement
abstract EndElement | createEndElement(String prefix, String namespaceUri, String localName, Iterator namespaces) Create a new EndElement
abstract EntityReference | createEntityReference(String name, EntityDeclaration declaration) Creates a new instance of a EntityReference event
abstract Characters | createIgnorableSpace(String content) Create an ignorable space
abstract Namespace | createNamespace(String namespaceURI) Create a new default Namespace
abstract Namespace | createNamespace(String prefix, String namespaceUri) Create a new Namespace
abstract ProcessingInstruction | createProcessingInstruction(String target, String data) Create a processing instruction
abstract Characters | createSpace(String content) Create a Characters event with the isSpace flag set to true
abstract StartDocument | createStartDocument() Creates a new instance of a StartDocument event
abstract StartDocument | createStartDocument(String encoding) Creates a new instance of a StartDocument event
abstract StartDocument | createStartDocument(String encoding, String version) Creates a new instance of a StartDocument event
abstract StartDocument | createStartDocument(String encoding, String version, boolean standalone) Creates a new instance of a StartDocument event
abstract StartElement | createStartElement(QName name, Iterator attributes, Iterator namespaces) Create a new StartElement.
abstract StartElement | createStartElement(String prefix, String namespaceUri, String localName) Create a new StartElement.
abstract StartElement | createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces) Create a new StartElement.
abstract StartElement | createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context) Create a new StartElement.
static XMLEventFactory | newInstance() Create a new instance of the factory
static XMLEventFactory | newInstance(String factoryId, ClassLoader classLoader) Create a new instance of the factory
abstract void | setLocation(Location location) This method allows setting of the Location on each event that is created by this factory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected XMLEventFactory()
英文文档：

XMLEventFactory

protected XMLEventFactory()
Method Detail

public static XMLEventFactory newInstance() throws FactoryConfigurationError
创建一个的新工厂实例。
Throws FactoryConfigurationError: 如果无法加载此工厂的实例
英文文档：

newInstance

public static XMLEventFactory newInstance()
                                   throws FactoryConfigurationError
Create a new instance of the factory

Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

public static XMLEventFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError
创建一个的新工厂实例。
factoryId | 要查找的工厂的名称，与属性名称相同
classLoader | 要使用的类加载器
return | 工厂实现
Throws | FactoryConfigurationError: 如果无法加载此工厂的实例
英文文档：

newInstance

public static XMLEventFactory newInstance(String factoryId,
                                          ClassLoader classLoader)
                                   throws FactoryConfigurationError
Create a new instance of the factory

Parameters:
factoryId - Name of the factory to find, same as a property name
classLoader - classLoader to use
Returns:
the factory implementation
Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

abstract public void setLocation(Location location)
此方法允许对此工厂创建的每个事件设置 Location。这些值被复制到此工厂创建的事件中。若要重置位置信息，可将 location 设置为 null。
location 要对每个创建的事件设置的位置
英文文档：

setLocation

public abstract void setLocation(Location location)
This method allows setting of the Location on each event that is created by this factory. The values are copied by value into the events created by this factory. To reset the location information set the location to null.

Parameters:
location - the location to set on each event created

abstract public Attribute createAttribute(String prefix, String namespaceURI, String localName, String value)
创建一个新 Attribute。
prefix | 此属性的前缀，不可以为 null
namespaceURI | 被设置为此值的属性值，不可以为 null
localName | 属性 XML 名称的本地名称，localName 不可以为 null
value | 要设置的属性值，不可以为 unll
return | 带有指定值的 Attribute
英文文档：

createAttribute

public abstract Attribute createAttribute(String prefix,
                                          String namespaceURI,
                                          String localName,
                                          String value)
Create a new Attribute

Parameters:
prefix - the prefix of this attribute, may not be null
namespaceURI - the attribute value is set to this value, may not be null
localName - the local name of the XML name of the attribute, localName cannot be null
value - the attribute value to set, may not be null
Returns:
the Attribute with specified values

abstract public Attribute createAttribute(String localName, String value)
创建一个新 Attribute。
localName | 属性 XML 名称的本地名称，localName 不可以为 null
value | 要设置的属性值，不可以为 unll
return | 带有指定值的 Attribute
英文文档：

createAttribute

public abstract Attribute createAttribute(String localName,
                                          String value)
Create a new Attribute

Parameters:
localName - the local name of the XML name of the attribute, localName cannot be null
value - the attribute value to set, may not be null
Returns:
the Attribute with specified values

abstract public Attribute createAttribute(javax.xml.namespace.QName name, String value)
创建一个新 Attribute。
name | 属性的限定名，不可以为 null
value | 要设置的属性值，不可以为 unll
return | 带有指定值的 Attribute
英文文档：

createAttribute

public abstract Attribute createAttribute(QName name,
                                          String value)
Create a new Attribute

Parameters:
name - the qualified name of the attribute, may not be null
value - the attribute value to set, may not be null
Returns:
the Attribute with specified values

abstract public Namespace createNamespace(String namespaceURI)
创建一个新的默认 Namespace。
namespaceURI | 默认名称空间 URI
return | 带有指定值的 Namespace
英文文档：

createNamespace

public abstract Namespace createNamespace(String namespaceURI)
Create a new default Namespace

Parameters:
namespaceURI - the default namespace uri
Returns:
the Namespace with the specified value

abstract public Namespace createNamespace(String prefix, String namespaceUri)
创建一个新的 Namespace。
prefix | 此名称空间的前缀，不可以为 null
namespaceUri | 被设置为此值的属性值，不可以为 null
return | 带有指定值的 Namespace
英文文档：

createNamespace

public abstract Namespace createNamespace(String prefix,
                                          String namespaceUri)
Create a new Namespace

Parameters:
prefix - the prefix of this namespace, may not be null
namespaceUri - the attribute value is set to this value, may not be null
Returns:
the Namespace with the specified values

abstract public StartElement createStartElement(javax.xml.namespace.QName name, java.util.Iterator<E> attributes, java.util.Iterator<E> namespaces)
创建一个新 StartElement。通过传入一个迭代 Namespace 接口集合的 Iterator，可以将名称空间添加到此 StartElement。通过传入一个迭代 Attribute 接口集合的 Iterator，可以将属性添加到此 StartElement。
name | 属性的限定名，不可以为 null
attributes | 要添加到新 StartElement 的可选无序对象集合，这些对象均实现 Attribute，该参数可以为 null
namespaces | 要添加到新 StartElement 的可选无序对象集合，这些对象均实现 Namespace，该参数可以为 null
return | 请求的 StartElement 的实例
英文文档：

createStartElement

public abstract StartElement createStartElement(QName name,
                                                Iterator attributes,
                                                Iterator namespaces)
Create a new StartElement. Namespaces can be added to this StartElement by passing in an Iterator that walks over a set of Namespace interfaces. Attributes can be added to this StartElement by passing an iterator that walks over a set of Attribute interfaces.

Parameters:
name - the qualified name of the attribute, may not be null
attributes - an optional unordered set of objects that implement Attribute to add to the new StartElement, may be null
namespaces - an optional unordered set of objects that implement Namespace to add to the new StartElement, may be null
Returns:
an instance of the requested StartElement

abstract public StartElement createStartElement(String prefix, String namespaceUri, String localName)
创建一个新 StartElement。此方法默认 NamespaceContext 为空 NamespaceContext。查询此事件的名称空间或属性将导致返回空的迭代器。
namespaceUri | 新 StartElement QName 的 URI
localName | 新 StartElement QName 的本地名称
prefix | 新 StartElemente QName 的前缀
return | 请求的 StartElement 的实例
英文文档：

createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName)
Create a new StartElement. This defaults the NamespaceContext to an empty NamespaceContext. Querying this event for its namespaces or attributes will result in an empty iterator being returned.

Parameters:
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
Returns:
an instance of the requested StartElement

abstract public StartElement createStartElement(String prefix, String namespaceUri, String localName, java.util.Iterator<E> attributes, java.util.Iterator<E> namespaces)
创建一个新 StartElement。通过传入一个迭代 Namespace 接口集合的 Iterator，可以将名称空间添加到此 StartElement。通过传入一个迭代 Attribute 接口集合的 Iterator，可以将属性添加到此 StartElement。
namespaceUri | 新 StartElement QName 的 URI
localName | 新 StartElement QName 的本地名称
prefix | 新 StartElemente QName 的前缀
attributes | 要添加到新 StartElement 的无序对象集合，这些对象均实现 Attribute
namespaces | 要添加到新 StartElement 的无序对象集合，这些对象均实现 Namespace
return | 请求的 StartElement 的实例
英文文档：

createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName,
                                                Iterator attributes,
                                                Iterator namespaces)
Create a new StartElement. Namespaces can be added to this StartElement by passing in an Iterator that walks over a set of Namespace interfaces. Attributes can be added to this StartElement by passing an iterator that walks over a set of Attribute interfaces.

Parameters:
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
attributes - an unordered set of objects that implement Attribute to add to the new StartElement
namespaces - an unordered set of objects that implement Namespace to add to the new StartElement
Returns:
an instance of the requested StartElement

abstract public StartElement createStartElement(String prefix, String namespaceUri, String localName, java.util.Iterator<E> attributes, java.util.Iterator<E> namespaces, javax.xml.namespace.NamespaceContext context)
创建一个新 StartElement。通过传入一个迭代 Namespace 接口集合的 Iterator，可以将名称空间添加到此 StartElement。通过传入一个迭代 Attribute 接口集合的 Iterator，可以将属性添加到此 StartElement。
namespaceUri | 新 StartElement QName 的 URI
localName | 新 StartElement QName 的本地名称
prefix | 新 StartElemente QName 的前缀
attributes | 要添加到新 StartElement 的无序对象集合，这些对象均实现 Attribute，可以为 null
namespaces | 要添加到新 StartElement 的无序对象集合，这些对象均实现 Namespace，可以为 null
context | 此元素的名称空间上下文
return | 请求的 StartElement 的实例
英文文档：

createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName,
                                                Iterator attributes,
                                                Iterator namespaces,
                                                NamespaceContext context)
Create a new StartElement. Namespaces can be added to this StartElement by passing in an Iterator that walks over a set of Namespace interfaces. Attributes can be added to this StartElement by passing an iterator that walks over a set of Attribute interfaces.

Parameters:
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
attributes - an unordered set of objects that implement Attribute to add to the new StartElement, may be null
namespaces - an unordered set of objects that implement Namespace to add to the new StartElement, may be null
context - the namespace context of this element
Returns:
an instance of the requested StartElement

abstract public EndElement createEndElement(javax.xml.namespace.QName name, java.util.Iterator<E> namespaces)
创建一个新 EndElement。
name | EndElement 的限定名
namespaces | 超出范围的无序对象集合，这些对象均实现 Namespace，该参数可以为 null
return | 请求的 EndElement 的实例
英文文档：

createEndElement

public abstract EndElement createEndElement(QName name,
                                            Iterator namespaces)
Create a new EndElement

Parameters:
name - the qualified name of the EndElement
namespaces - an optional unordered set of objects that implement Namespace that have gone out of scope, may be null
Returns:
an instance of the requested EndElement

abstract public EndElement createEndElement(String prefix, String namespaceUri, String localName)
创建一个新 EndElement。
namespaceUri | 新 StartElement QName 的 URI
localName | 新 StartElement QName 的本地名称
prefix | 新 StartElemente QName 的前缀
return | 请求的 EndElement 的实例
英文文档：

createEndElement

public abstract EndElement createEndElement(String prefix,
                                            String namespaceUri,
                                            String localName)
Create a new EndElement

Parameters:
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
Returns:
an instance of the requested EndElement

abstract public EndElement createEndElement(String prefix, String namespaceUri, String localName, java.util.Iterator<E> namespaces)
创建一个新 EndElement。
namespaceUri | 新 StartElement QName 的 URI
localName | 新 StartElement QName 的本地名称
prefix | 新 StartElemente QName 的前缀
namespaces | 超出范围的无序对象集合，这些对象均实现 Namespace，该参数可以为 null
return | 请求的 EndElement 的实例
英文文档：

createEndElement

public abstract EndElement createEndElement(String prefix,
                                            String namespaceUri,
                                            String localName,
                                            Iterator namespaces)
Create a new EndElement

Parameters:
namespaceUri - the uri of the QName of the new StartElement
localName - the local name of the QName of the new StartElement
prefix - the prefix of the QName of the new StartElement
namespaces - an unordered set of objects that implement Namespace that have gone out of scope, may be null
Returns:
an instance of the requested EndElement

abstract public Characters createCharacters(String content)
创建一个 Character 事件，此方法不检查内容是否全部为空白。使用 #createSpace(String) 创建一个空间事件。
content | 要创建的字符串
return | 一个 Character 事件
英文文档：

createCharacters

public abstract Characters createCharacters(String content)
Create a Characters event, this method does not check if the content is all whitespace. To create a space event use #createSpace(String)

Parameters:
content - the string to create
Returns:
a Characters event

abstract public Characters createCData(String content)
创建一个 CData 标记设置为 true 的 Character 事件。
content | 要创建的字符串
return | 一个 Character 事件
英文文档：

createCData

public abstract Characters createCData(String content)
Create a Characters event with the CData flag set to true

Parameters:
content - the string to create
Returns:
a Characters event

abstract public Characters createSpace(String content)
创建一个 isSpace 标记设置为 true 的 Character 事件。
content | 要创建的空间的内容
return | 一个 Character 事件
英文文档：

createSpace

public abstract Characters createSpace(String content)
Create a Characters event with the isSpace flag set to true

Parameters:
content - the content of the space to create
Returns:
a Characters event

abstract public Characters createIgnorableSpace(String content)
创建一个可忽略的空间。
content | 要创建的空间
return | 一个 Character 事件
英文文档：

createIgnorableSpace

public abstract Characters createIgnorableSpace(String content)
Create an ignorable space

Parameters:
content - the space to create
Returns:
a Characters event

abstract public StartDocument createStartDocument()
创建一个 StartDocument 事件的新实例。
return 一个 StartDocument 事件
英文文档：

createStartDocument

public abstract StartDocument createStartDocument()
Creates a new instance of a StartDocument event

Returns:
a StartDocument event

abstract public StartDocument createStartDocument(String encoding, String version, boolean standalone)
创建一个 StartDocument 事件的新实例。
encoding | 编码样式
version | 的版本
standalone | 独立的状态，可以设置为 "true" 或 "false"
return | 一个 StartDocument 事件
英文文档：

createStartDocument

public abstract StartDocument createStartDocument(String encoding,
                                                  String version,
                                                  boolean standalone)
Creates a new instance of a StartDocument event

Parameters:
encoding - the encoding style
version - the XML version
standalone - the status of standalone may be set to "true" or "false"
Returns:
a StartDocument event

abstract public StartDocument createStartDocument(String encoding, String version)
创建一个 StartDocument 事件的新实例。
encoding | 编码样式
version | 的版本
return | 一个 StartDocument 事件
英文文档：

createStartDocument

public abstract StartDocument createStartDocument(String encoding,
                                                  String version)
Creates a new instance of a StartDocument event

Parameters:
encoding - the encoding style
version - the XML version
Returns:
a StartDocument event

abstract public StartDocument createStartDocument(String encoding)
创建一个 StartDocument 事件的新实例。
encoding | 编码样式
return | 一个 StartDocument 事件
英文文档：

createStartDocument

public abstract StartDocument createStartDocument(String encoding)
Creates a new instance of a StartDocument event

Parameters:
encoding - the encoding style
Returns:
a StartDocument event

abstract public EndDocument createEndDocument()
创建一个 EndDocument 事件的新实例。
return 一个 EndDocument 事件
英文文档：

createEndDocument

public abstract EndDocument createEndDocument()
Creates a new instance of an EndDocument event

Returns:
an EndDocument event

abstract public EntityReference createEntityReference(String name, EntityDeclaration declaration)
创建一个 EntityReference 事件的新实例。
name | 引用的名称
declaration | 事件的声明
return | 一个 EntityReference 事件
英文文档：

createEntityReference

public abstract EntityReference createEntityReference(String name,
                                                      EntityDeclaration declaration)
Creates a new instance of a EntityReference event

Parameters:
name - The name of the reference
declaration - the declaration for the event
Returns:
an EntityReference event

abstract public Comment createComment(String text)
创建一个注释。
text Comment 事件的注释文本
英文文档：

createComment

public abstract Comment createComment(String text)
Create a comment

Parameters:
text - The text of the comment a Comment event

abstract public ProcessingInstruction createProcessingInstruction(String target, String data)
创建一个处理指令。
target | 处理指令的目标
data | 处理指令的文本
return | 一个 ProcessingInstruction 事件
英文文档：

createProcessingInstruction

public abstract ProcessingInstruction createProcessingInstruction(String target,
                                                                  String data)
Create a processing instruction

Parameters:
target - The target of the processing instruction
data - The text of the processing instruction
Returns:
a ProcessingInstruction event

abstract public DTD createDTD(String dtd)
创建一个文档类型定义事件。此字符串包含与 XML 1.0 规范中的 doctypedecl 相匹配的整个文档类型声明。
dtd | 文档类型定义的文本
return | 一个 DTD 事件
英文文档：

createDTD

public abstract DTD createDTD(String dtd)
Create a document type definition event This string contains the entire document type declaration that matches the doctypedecl in the XML 1.0 specification

Parameters:
dtd - the text of the document type definition
Returns:
a DTD event
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLInputFactory (Java EE 5)

javax.xml.stream
Class XMLInputFactory

java.lang.Object
    extended by  javax.xml.stream.XMLInputFactory

public abstract class XMLInputFactory
extends Object

定义用于获取流的工厂的抽象实现。下表定义此规范的标准属性。每个属性随每个实现所要求的支持级别的不同而不同。所要求的支持级别在“必需”栏中做了描述。
配置参数
属性名 | 行为 | 返回类型 | 默认值 | 必需
javax.xml.stream.isValidating | 开启/关闭特定于实现的 DTD 验证 | Boolean | False | 否
javax.xml.stream.isNamespaceAware | 开启/关闭用于支持 XML 1.0 的名称空间处理 | Boolean | True | True（必需）/ False （可选）
javax.xml.stream.isCoalescing | 要求处理器组合相临的字符数据 | Boolean | False | 是
javax.xml.stream.isReplacingEntityReferences | 用它们的替换文本替换内部实体引用并将它们作为字符报告 | Boolean | True | 是
javax.xml.stream.isSupportingExternalEntities | 解析外部解析的实体 | Boolean | 未指定 | 是
javax.xml.stream.supportDTD | 使用此属性请求不支持 DTD 的处理器 | Boolean | True | 是
javax.xml.stream.reporter | 设置/获取 XMLReporter 的 impl | javax.xml.stream.XMLReporter | Null | 是
javax.xml.stream.resolver | 设置/获取 XMLResolver 接口的 impl | javax.xml.stream.XMLResolver | Null | 是
javax.xml.stream.allocator | 设置/获取 XMLEventAllocator 接口的 impl | javax.xml.stream.util.XMLEventAllocator | Null | 是
version | 1.0
See also | javax.xml.stream.XMLOutputFactory, javax.xml.stream.XMLEventReader, javax.xml.stream.XMLStreamReader, javax.xml.stream.EventFilter, javax.xml.stream.XMLReporter, javax.xml.stream.XMLResolver, javax.xml.stream.util.XMLEventAllocator
英文文档：

Defines an abstract implementation of a factory for getting streams. The following table defines the standard properties of this specification. Each property varies in the level of support required by each implementation. The level of support required is described in the 'Required' column.

Configuration parameters
Property Name | Behavior | Return type | Default Value | Required
javax.xml.stream.isValidating | Turns on/off implementation specific DTD validation | Boolean | False | No
javax.xml.stream.isNamespaceAware | Turns on/off namespace processing for XML 1.0 support | Boolean | True | True (required) / False (optional)
javax.xml.stream.isCoalescing | Requires the processor to coalesce adjacent character data | Boolean | False | Yes
javax.xml.stream.isReplacingEntityReferences | replace internal entity references with their replacement text and report them as characters | Boolean | True | Yes
javax.xml.stream.isSupportingExternalEntities | Resolve external parsed entities | Boolean | Unspecified | Yes
javax.xml.stream.supportDTD | Use this property to request processors that do not support DTDs | Boolean | True | Yes
javax.xml.stream.reporter | sets/gets the impl of the XMLReporter | javax.xml.stream.XMLReporter | Null | Yes
javax.xml.stream.resolver | sets/gets the impl of the XMLResolver interface | javax.xml.stream.XMLResolver | Null | Yes
javax.xml.stream.allocator | sets/gets the impl of the XMLEventAllocator interface | javax.xml.stream.util.XMLEventAllocator | Null | Yes

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLOutputFactory, XMLEventReader, XMLStreamReader, EventFilter, XMLReporter, XMLResolver, XMLEventAllocator

Field Summary
static String | ALLOCATOR The property used to set/get the implementation of the allocator
static String | IS_COALESCING The property that requires the parser to coalesce adjacent character data sections
static String | IS_NAMESPACE_AWARE The property used to turn on/off namespace support, this is to support XML 1.0 documents, only the true setting must be supported
static String | IS_REPLACING_ENTITY_REFERENCES Requires the parser to replace internal entity references with their replacement text and report them as characters
static String | IS_SUPPORTING_EXTERNAL_ENTITIES The property that requires the parser to resolve external parsed entities
static String | IS_VALIDATING The property used to turn on/off implementation specific validation
static String | REPORTER The property used to set/get the implementation of the XMLReporter interface
static String | RESOLVER The property used to set/get the implementation of the XMLResolver
static String | SUPPORT_DTD The property that requires the parser to support DTDs
Constructor Summary
protected XMLInputFactory()
Method Summary
abstract XMLEventReader | createFilteredReader(XMLEventReader reader, EventFilter filter) Create a filtered event reader that wraps the filter around the event reader
abstract XMLStreamReader | createFilteredReader(XMLStreamReader reader, StreamFilter filter) Create a filtered reader that wraps the filter around the reader
abstract XMLEventReader | createXMLEventReader(InputStream stream) Create a new XMLEventReader from a java.io.InputStream
abstract XMLEventReader | createXMLEventReader(InputStream stream, String encoding) Create a new XMLEventReader from a java.io.InputStream
abstract XMLEventReader | createXMLEventReader(Reader reader) Create a new XMLEventReader from a reader
abstract XMLEventReader | createXMLEventReader(Source source) Create a new XMLEventReader from a JAXP source.
abstract XMLEventReader | createXMLEventReader(String systemId, InputStream stream) Create a new XMLEventReader from a java.io.InputStream
abstract XMLEventReader | createXMLEventReader(String systemId, Reader reader) Create a new XMLEventReader from a reader
abstract XMLEventReader | createXMLEventReader(XMLStreamReader reader) Create a new XMLEventReader from an XMLStreamReader.
abstract XMLStreamReader | createXMLStreamReader(InputStream stream) Create a new XMLStreamReader from a java.io.InputStream
abstract XMLStreamReader | createXMLStreamReader(InputStream stream, String encoding) Create a new XMLStreamReader from a java.io.InputStream
abstract XMLStreamReader | createXMLStreamReader(Reader reader) Create a new XMLStreamReader from a reader
abstract XMLStreamReader | createXMLStreamReader(Source source) Create a new XMLStreamReader from a JAXP source.
abstract XMLStreamReader | createXMLStreamReader(String systemId, InputStream stream) Create a new XMLStreamReader from a java.io.InputStream
abstract XMLStreamReader | createXMLStreamReader(String systemId, Reader reader) Create a new XMLStreamReader from a java.io.InputStream
abstract XMLEventAllocator | getEventAllocator() Gets the allocator used by streams created with this factory
abstract Object | getProperty(String name) Get the value of a feature/property from the underlying implementation
abstract XMLReporter | getXMLReporter() The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
abstract XMLResolver | getXMLResolver() The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
abstract boolean | isPropertySupported(String name) Query the set of properties that this factory supports.
static XMLInputFactory | newInstance() Create a new instance of the factory.
static XMLInputFactory | newInstance(String factoryId, ClassLoader classLoader) Create a new instance of the factory
abstract void | setEventAllocator(XMLEventAllocator allocator) Set a user defined event allocator for events
abstract void | setProperty(String name, Object value) Allows the user to set specific feature/property on the underlying implementation.
abstract void | setXMLReporter(XMLReporter reporter) The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
abstract void | setXMLResolver(XMLResolver resolver) The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

IS_NAMESPACE_AWARE

public static final String IS_NAMESPACE_AWARE
The property used to turn on/off namespace support, this is to support XML 1.0 documents, only the true setting must be supported

See Also:
Constant Field Values

英文文档：

IS_VALIDATING

public static final String IS_VALIDATING
The property used to turn on/off implementation specific validation

See Also:
Constant Field Values

英文文档：

IS_COALESCING

public static final String IS_COALESCING
The property that requires the parser to coalesce adjacent character data sections

See Also:
Constant Field Values

英文文档：

IS_REPLACING_ENTITY_REFERENCES

public static final String IS_REPLACING_ENTITY_REFERENCES
Requires the parser to replace internal entity references with their replacement text and report them as characters

See Also:
Constant Field Values

英文文档：

IS_SUPPORTING_EXTERNAL_ENTITIES

public static final String IS_SUPPORTING_EXTERNAL_ENTITIES
The property that requires the parser to resolve external parsed entities

See Also:
Constant Field Values

英文文档：

SUPPORT_DTD

public static final String SUPPORT_DTD
The property that requires the parser to support DTDs

See Also:
Constant Field Values

英文文档：

REPORTER

public static final String REPORTER
The property used to set/get the implementation of the XMLReporter interface

See Also:
Constant Field Values

英文文档：

RESOLVER

public static final String RESOLVER
The property used to set/get the implementation of the XMLResolver

See Also:
Constant Field Values

英文文档：

ALLOCATOR

public static final String ALLOCATOR
The property used to set/get the implementation of the allocator

See Also:
Constant Field Values
Constructor Detail

protected XMLInputFactory()
英文文档：

XMLInputFactory

protected XMLInputFactory()
Method Detail

public static XMLInputFactory newInstance() throws FactoryConfigurationError
创建一个新的工厂实例。此 static 方法创建一个新的工厂实例。此方法按照以下查找过程顺序来确定要加载的 XMLInputFactory 实现类：使用 javax.xml.stream.XMLInputFactory 系统属性。使用 JRE 目录中的属性文件 "lib/stax.properties"。此配置文件是标准的 java.util.Properties 格式，且包含实现类的完全限定名，其中实现类的键是上文定义的系统属性。如果 Services API（在 JAR 规范中进行了详细描述）可用，可以使用它来确定类名称。Services API 将在运行时可用的 jar 文件 META-INF/services/javax.xml.stream.XMLInputFactory 中查找类名称。平台默认的 XMLInputFactory 实例。应用程序获取对 XMLInputFactory 的引用后，它可以使用工厂来配置和获取流实例。
Throws FactoryConfigurationError: 如果无法加载此工厂的实例
英文文档：

newInstance

public static XMLInputFactory newInstance()
                                   throws FactoryConfigurationError
Create a new instance of the factory. This static method creates a new factory instance. This method uses the following ordered lookup procedure to determine the XMLInputFactory implementation class to load: Use the javax.xml.stream.XMLInputFactory system property. Use the properties file "lib/stax.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.stream.XMLInputFactory in jars available to the runtime. Platform default XMLInputFactory instance. Once an application has obtained a reference to a XMLInputFactory it can use the factory to configure and obtain stream instances.

Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError
创建一个的新工厂实例。
factoryId | 要查找的工厂的名称，与属性名称相同
classLoader | 要使用的类加载器
return | 工厂实现
Throws | FactoryConfigurationError: 如果无法加载此工厂的实例
英文文档：

newInstance

public static XMLInputFactory newInstance(String factoryId,
                                          ClassLoader classLoader)
                                   throws FactoryConfigurationError
Create a new instance of the factory

Parameters:
factoryId - Name of the factory to find, same as a property name
classLoader - classLoader to use
Returns:
the factory implementation
Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

abstract public XMLStreamReader createXMLStreamReader(java.io.Reader reader) throws XMLStreamException
根据 reader 创建一个新 XMLStreamReader。
reader | 要从中读取 XMLEventReader 的 XML 数据
Throws | XMLStreamException:
英文文档：

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(Reader reader)
                                               throws XMLStreamException
Create a new XMLStreamReader from a reader

Parameters:
reader - the XML data to read from
Throws:
XMLStreamException

abstract public XMLStreamReader createXMLStreamReader(javax.xml.transform.Source source) throws XMLStreamException
根据 JAXP 源创建一个新 XMLStreamReader。此方法是可选的。
source | 要从中读取 XMLEventReader 的源
Throws | UnsupportedOperationException: 如果 XMLInputFactory 不支持此方法
Throws | XMLStreamException:
英文文档：

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(Source source)
                                               throws XMLStreamException
Create a new XMLStreamReader from a JAXP source. This method is optional.

Parameters:
source - the source to read from
Throws:
UnsupportedOperationException - if this method is not supported by this XMLInputFactory
XMLStreamException

abstract public XMLStreamReader createXMLStreamReader(java.io.InputStream stream) throws XMLStreamException
根据 java.io.InputStream 创建一个新 XMLStreamReader。
stream | 要从中读取 XMLEventReader 的 InputStream
Throws | XMLStreamException:
英文文档：

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(InputStream stream)
                                               throws XMLStreamException
Create a new XMLStreamReader from a java.io.InputStream

Parameters:
stream - the InputStream to read from
Throws:
XMLStreamException

abstract public XMLStreamReader createXMLStreamReader(java.io.InputStream stream, String encoding) throws XMLStreamException
根据 java.io.InputStream 创建一个新 XMLStreamReader。
stream | 要从中读取 XMLEventReader 的 InputStream
encoding | 流的字符编码
Throws | XMLStreamException:
英文文档：

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(InputStream stream,
                                                      String encoding)
                                               throws XMLStreamException
Create a new XMLStreamReader from a java.io.InputStream

Parameters:
stream - the InputStream to read from
encoding - the character encoding of the stream
Throws:
XMLStreamException

abstract public XMLStreamReader createXMLStreamReader(String systemId, java.io.InputStream stream) throws XMLStreamException
根据 java.io.InputStream 创建一个新 XMLStreamReader。
systemId | 流的系统 ID
stream | 要从中读取 XMLEventReader 的 InputStream
英文文档：

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(String systemId,
                                                      InputStream stream)
                                               throws XMLStreamException
Create a new XMLStreamReader from a java.io.InputStream

Parameters:
systemId - the system ID of the stream
stream - the InputStream to read from
Throws:
XMLStreamException

abstract public XMLStreamReader createXMLStreamReader(String systemId, java.io.Reader reader) throws XMLStreamException
根据 java.io.InputStream 创建一个新 XMLStreamReader。
systemId | 流的系统 ID
reader | 要从中读取 XMLEventReader 的 InputStream
英文文档：

createXMLStreamReader

public abstract XMLStreamReader createXMLStreamReader(String systemId,
                                                      Reader reader)
                                               throws XMLStreamException
Create a new XMLStreamReader from a java.io.InputStream

Parameters:
systemId - the system ID of the stream
reader - the InputStream to read from
Throws:
XMLStreamException

abstract public XMLEventReader createXMLEventReader(java.io.Reader reader) throws XMLStreamException
根据 reader 创建一个新 XMLEventReader。
reader | 要从中读取 XMLEventReader 的 XML 数据
Throws | XMLStreamException:
英文文档：

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(Reader reader)
                                             throws XMLStreamException
Create a new XMLEventReader from a reader

Parameters:
reader - the XML data to read from
Throws:
XMLStreamException

abstract public XMLEventReader createXMLEventReader(String systemId, java.io.Reader reader) throws XMLStreamException
根据 reader 创建一个新 XMLEventReader。
systemId | 输入的系统 ID
reader | 要从中读取 XMLEventReader 的 XML 数据
Throws | XMLStreamException:
英文文档：

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(String systemId,
                                                    Reader reader)
                                             throws XMLStreamException
Create a new XMLEventReader from a reader

Parameters:
systemId - the system ID of the input
reader - the XML data to read from
Throws:
XMLStreamException

abstract public XMLEventReader createXMLEventReader(XMLStreamReader reader) throws XMLStreamException
根据 XMLStreamReader 创建一个新 XMLEventReader。在被用来构造此方法返回的 XMLEventReader 实例后，MLStreamReader 不得再次使用。
reader | 要从中读取数据的 XMLStreamReader （不能修改）
return | 新 XMLEventReader
Throws | XMLStreamException:
英文文档：

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
                                             throws XMLStreamException
Create a new XMLEventReader from an XMLStreamReader. After being used to construct the XMLEventReader instance returned from this method the XMLStreamReader must not be used.

Parameters:
reader - the XMLStreamReader to read from (may not be modified)
Returns:
a new XMLEventReader
Throws:
XMLStreamException

abstract public XMLEventReader createXMLEventReader(javax.xml.transform.Source source) throws XMLStreamException
根据 JAXP 源创建一个新 XMLEventReader。对此方法的支持是可选的。
source | 要从中读取 XMLEventReader 的源
Throws | UnsupportedOperationException: 如果 XMLInputFactory 不支持此方法
英文文档：

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(Source source)
                                             throws XMLStreamException
Create a new XMLEventReader from a JAXP source. Support of this method is optional.

Parameters:
source - the source to read from
Throws:
UnsupportedOperationException - if this method is not supported by this XMLInputFactory
XMLStreamException

abstract public XMLEventReader createXMLEventReader(java.io.InputStream stream) throws XMLStreamException
根据 java.io.InputStream 创建一个新 XMLEventReader。
stream | 要从中读取 XMLEventReader 的 InputStream
Throws | XMLStreamException:
英文文档：

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(InputStream stream)
                                             throws XMLStreamException
Create a new XMLEventReader from a java.io.InputStream

Parameters:
stream - the InputStream to read from
Throws:
XMLStreamException

abstract public XMLEventReader createXMLEventReader(java.io.InputStream stream, String encoding) throws XMLStreamException
根据 java.io.InputStream 创建一个新 XMLEventReader。
stream | 要从中读取 XMLEventReader 的 InputStream
encoding | 流的字符编码
Throws | XMLStreamException:
英文文档：

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(InputStream stream,
                                                    String encoding)
                                             throws XMLStreamException
Create a new XMLEventReader from a java.io.InputStream

Parameters:
stream - the InputStream to read from
encoding - the character encoding of the stream
Throws:
XMLStreamException

abstract public XMLEventReader createXMLEventReader(String systemId, java.io.InputStream stream) throws XMLStreamException
根据 java.io.InputStream 创建一个新 XMLEventReader。
systemId | 流的系统 ID
stream | 要从中读取 XMLEventReader 的 InputStream
Throws | XMLStreamException:
英文文档：

createXMLEventReader

public abstract XMLEventReader createXMLEventReader(String systemId,
                                                    InputStream stream)
                                             throws XMLStreamException
Create a new XMLEventReader from a java.io.InputStream

Parameters:
systemId - the system ID of the stream
stream - the InputStream to read from
Throws:
XMLStreamException

abstract public XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException
创建过滤的 reader，它用过滤器包装 reader。
reader | 要过滤的 reader
filter | 要应用到 reader 的过滤器
Throws | XMLStreamException:
英文文档：

createFilteredReader

public abstract XMLStreamReader createFilteredReader(XMLStreamReader reader,
                                                     StreamFilter filter)
                                              throws XMLStreamException
Create a filtered reader that wraps the filter around the reader

Parameters:
reader - the reader to filter
filter - the filter to apply to the reader
Throws:
XMLStreamException

abstract public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException
创建过滤的事件 reader，它用过滤器包装事件 reader。
reader | 要包装的事件 reader
filter | 要应用到事件 reader 的过滤器
Throws | XMLStreamException:
英文文档：

createFilteredReader

public abstract XMLEventReader createFilteredReader(XMLEventReader reader,
                                                    EventFilter filter)
                                             throws XMLStreamException
Create a filtered event reader that wraps the filter around the event reader

Parameters:
reader - the event reader to wrap
filter - the filter to apply to the event reader
Throws:
XMLStreamException

abstract public XMLResolver getXMLResolver()
要在此工厂实例创建的任何 XMLStreamReader 或 XMLEventReader 上进行设置的解析器。
英文文档：

getXMLResolver

public abstract XMLResolver getXMLResolver()
The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.

abstract public void setXMLResolver(XMLResolver resolver)
要在此工厂实例创建的任何 XMLStreamReader 或 XMLEventReader 上进行设置的解析器。
resolver 要用于解析引用的解析器
英文文档：

setXMLResolver

public abstract void setXMLResolver(XMLResolver resolver)
The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.

Parameters:
resolver - the resolver to use to resolve references

abstract public XMLReporter getXMLReporter()
要在此工厂实例创建的任何 XMLStreamReader 或 XMLEventReader 上进行设置的报告器。
英文文档：

getXMLReporter

public abstract XMLReporter getXMLReporter()
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.

abstract public void setXMLReporter(XMLReporter reporter)
要在此工厂实例创建的任何 XMLStreamReader 或 XMLEventReader 上进行设置的报告器。
reporter 要用来报告非严重错误的解析器
英文文档：

setXMLReporter

public abstract void setXMLReporter(XMLReporter reporter)
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.

Parameters:
reporter - the resolver to use to report non fatal errors

abstract public void setProperty(String name, Object value) throws IllegalArgumentException
允许用户在底层实现上设置特定功能/属性。底层实现不需要支持规范中每个属性的每个设置，可以使用 IllegalArgumentException 来表示一个不受支持的属性不能用指定的值进行设置。
name | 属性的名称（不可以为 null）
value | 属性的值
Throws | IllegalArgumentException: 如果属性不受支持
英文文档：

setProperty

public abstract void setProperty(String name,
                                 Object value)
                          throws IllegalArgumentException
Allows the user to set specific feature/property on the underlying implementation. The underlying implementation is not required to support every setting of every property in the specification and may use IllegalArgumentException to signal that an unsupported property may not be set with the specified value.

Parameters:
name - The name of the property (may not be null)
value - The value of the property
Throws:
IllegalArgumentException - if the property is not supported

abstract public Object getProperty(String name) throws IllegalArgumentException
从底层实现获取功能/属性的值。
name | 属性的名称（不可以为 null）
return | 属性的值
Throws | IllegalArgumentException: 如果属性不受支持
英文文档：

getProperty

public abstract Object getProperty(String name)
                            throws IllegalArgumentException
Get the value of a feature/property from the underlying implementation

Parameters:
name - The name of the property (may not be null)
Returns:
The value of the property
Throws:
IllegalArgumentException - if the property is not supported

abstract public boolean isPropertySupported(String name)
查询此工厂支持的属性集合。
name | 属性的名称（不可以为 null）
return | 如果此属性受支持，则返回 true，否则返回 false
英文文档：

isPropertySupported

public abstract boolean isPropertySupported(String name)
Query the set of properties that this factory supports.

Parameters:
name - The name of the property (may not be null)
Returns:
true if the property is supported and false otherwise

abstract public void setEventAllocator(XMLEventAllocator allocator)
为事件设置一个用户定义的事件分配器。
allocator 用户定义的分配器
英文文档：

setEventAllocator

public abstract void setEventAllocator(XMLEventAllocator allocator)
Set a user defined event allocator for events

Parameters:
allocator - the user defined allocator

abstract public XMLEventAllocator getEventAllocator()
获取用此工厂创建的流所使用的分配器。
英文文档：

getEventAllocator

public abstract XMLEventAllocator getEventAllocator()
Gets the allocator used by streams created with this factory

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLOutputFactory (Java EE 5)

javax.xml.stream
Class XMLOutputFactory

java.lang.Object
    extended by  javax.xml.stream.XMLOutputFactory

public abstract class XMLOutputFactory
extends Object

定义用于获取 XMLEventWriter 和 XMLStreamWriter 的工厂抽象实现。下表定义此规范的标准属性。每个属性随每个实现所要求的支持级别的不同而不同。所要求的支持级别在“必需”栏中做了描述。
配置参数
属性名 | 行为 | 返回类型 | 默认值 | 必需
javax.xml.stream.isRepairingNamespaces | 默认输出端前缀 | Boolean | False | 是

以下段落描述了名称空间和前缀修复算法：

属性可以使用以下代码行进行设置：setProperty("javax.xml.stream.isRepairingNamespaces",new Boolean(true|false));

此属性指定 writer 默认名称空间前缀声明。默认值为 false。

如果 writer 是 RepairingNamespaces，则对于任何当前在范围内不具有名称空间声明的属性，它都将在当前的 StartElement 上创建名称空间声明。如果 StartElement 具有 URI，但没有指定前缀，则为其分配一个前缀；如果前缀未在当前 StartElement 的父级中声明，则它将在当前的 StartElement 上声明。如果 defaultNamespace 被绑定，而且在范围内默认名称空间与属性的 URI 或 StartElement QName 相匹配，则不分配任何前缀。

如果元素或属性名称具有前缀，但没有绑定到任何名称空间 URI，则前缀将在序列化时被删除。

如果同一个开始或空元素标记中的元素和/或属性名称被绑定到不同的名称空间 URI，而且使用相同的前缀，则元素或第一个出现的属性将保留原始前缀，而在它之后的属性将用绑定到这些属性名称空间 URI 的新前缀替换它们的前缀。

如果元素或属性名称使用一个绑定到 URI 的前缀，而该 URI 不是从该元素父级的名称空间上下文中继承的，并且在当前元素的上下文中没有名称空间声明，那么将添加一个这样的名称空间声明。

如果元素或属性名称被绑定到一个前缀，而且有一个将此前缀绑定到不同 RUI 的名称空间声明，那么该名称空间声明将被删除（如果从该元素的父上下文中继承了正确的映射），或者被更改为使用该前缀的元素或属性的名称空间 URI。

version | 1.0
See also | javax.xml.stream.XMLInputFactory, javax.xml.stream.XMLEventWriter, javax.xml.stream.XMLStreamWriter
英文文档：

Defines an abstract implementation of a factory for getting XMLEventWriters and XMLStreamWriters. The following table defines the standard properties of this specification. Each property varies in the level of support required by each implementation. The level of support required is described in the 'Required' column.

Configuration parameters
Property Name | Behavior | Return type | Default Value | Required
javax.xml.stream.isRepairingNamespaces | defaults prefixes on the output side | Boolean | False | Yes

The following paragraphs describe the namespace and prefix repair algorithm:

The property can be set with the following code line: setProperty("javax.xml.stream.isRepairingNamespaces",new Boolean(true|false));

This property specifies that the writer default namespace prefix declarations. The default value is false.

If a writer isRepairingNamespaces it will create a namespace declaration on the current StartElement for any attribute that does not currently have a namespace declaration in scope. If the StartElement has a uri but no prefix specified a prefix will be assigned, if the prefix has not been declared in a parent of the current StartElement it will be declared on the current StartElement. If the defaultNamespace is bound and in scope and the default namespace matches the URI of the attribute or StartElement QName no prefix will be assigned.

If an element or attribute name has a prefix, but is not bound to any namespace URI, then the prefix will be removed during serialization.

If element and/or attribute names in the same start or empty-element tag are bound to different namespace URIs and are using the same prefix then the element or the first occurring attribute retains the original prefix and the following attributes have their prefixes replaced with a new prefix that is bound to the namespace URIs of those attributes.

If an element or attribute name uses a prefix that is bound to a different URI than that inherited from the namespace context of the parent of that element and there is no namespace declaration in the context of the current element then such a namespace declaration is added.

If an element or attribute name is bound to a prefix and there is a namespace declaration that binds that prefix to a different URI then that namespace declaration is either removed if the correct mapping is inherited from the parent context of that element, or changed to the namespace URI of the element or attribute using that prefix.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLInputFactory, XMLEventWriter, XMLStreamWriter

Field Summary
static String IS_REPAIRING_NAMESPACES
Property used to set prefix defaulting on the output side
Constructor Summary
protected XMLOutputFactory()
Method Summary
abstract XMLEventWriter | createXMLEventWriter(OutputStream stream) Create a new XMLEventWriter that writes to a stream
abstract XMLEventWriter | createXMLEventWriter(OutputStream stream, String encoding) Create a new XMLEventWriter that writes to a stream
abstract XMLEventWriter | createXMLEventWriter(Result result) Create a new XMLEventWriter that writes to a JAXP result.
abstract XMLEventWriter | createXMLEventWriter(Writer stream) Create a new XMLEventWriter that writes to a writer
abstract XMLStreamWriter | createXMLStreamWriter(OutputStream stream) Create a new XMLStreamWriter that writes to a stream
abstract XMLStreamWriter | createXMLStreamWriter(OutputStream stream, String encoding) Create a new XMLStreamWriter that writes to a stream
abstract XMLStreamWriter | createXMLStreamWriter(Result result) Create a new XMLStreamWriter that writes to a JAXP result.
abstract XMLStreamWriter | createXMLStreamWriter(Writer stream) Create a new XMLStreamWriter that writes to a writer
abstract Object | getProperty(String name) Get a feature/property on the underlying implementation
abstract boolean | isPropertySupported(String name) Query the set of properties that this factory supports.
static XMLOutputFactory | newInstance() Create a new instance of the factory.
static XMLInputFactory | newInstance(String factoryId, ClassLoader classLoader) Create a new instance of the factory
abstract void | setProperty(String name, Object value) Allows the user to set specific features/properties on the underlying implementation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

IS_REPAIRING_NAMESPACES

public static final String IS_REPAIRING_NAMESPACES
Property used to set prefix defaulting on the output side

See Also:
Constant Field Values
Constructor Detail

protected XMLOutputFactory()
英文文档：

XMLOutputFactory

protected XMLOutputFactory()
Method Detail

public static XMLOutputFactory newInstance() throws FactoryConfigurationError
创建一个新的工厂实例。
Throws FactoryConfigurationError: 如果无法加载此工厂的实例
英文文档：

newInstance

public static XMLOutputFactory newInstance()
                                    throws FactoryConfigurationError
Create a new instance of the factory.

Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError
创建一个的新工厂实例。
factoryId | 要查找的工厂的名称，与属性名称相同
classLoader | 要使用的类加载器
return | 工厂实现
Throws | FactoryConfigurationError: 如果无法加载此工厂的实例
英文文档：

newInstance

public static XMLInputFactory newInstance(String factoryId,
                                          ClassLoader classLoader)
                                   throws FactoryConfigurationError
Create a new instance of the factory

Parameters:
factoryId - Name of the factory to find, same as a property name
classLoader - classLoader to use
Returns:
the factory implementation
Throws:
FactoryConfigurationError - if an instance of this factory cannot be loaded

abstract public XMLStreamWriter createXMLStreamWriter(java.io.Writer stream) throws XMLStreamException
创建一个写入到 writer 的新 XMLStreamWriter。
stream | 要向其写入 XMLStreamWriter 的 writer
Throws | XMLStreamException:
英文文档：

createXMLStreamWriter

public abstract XMLStreamWriter createXMLStreamWriter(Writer stream)
                                               throws XMLStreamException
Create a new XMLStreamWriter that writes to a writer

Parameters:
stream - the writer to write to
Throws:
XMLStreamException

abstract public XMLStreamWriter createXMLStreamWriter(java.io.OutputStream stream) throws XMLStreamException
创建一个写入到流的新 XMLStreamWriter。
stream | 要写入的流
Throws | XMLStreamException:
英文文档：

createXMLStreamWriter

public abstract XMLStreamWriter createXMLStreamWriter(OutputStream stream)
                                               throws XMLStreamException
Create a new XMLStreamWriter that writes to a stream

Parameters:
stream - the stream to write to
Throws:
XMLStreamException

abstract public XMLStreamWriter createXMLStreamWriter(java.io.OutputStream stream, String encoding) throws XMLStreamException
创建一个写入到流的新 XMLStreamWriter。
stream | 要写入的流
encoding | 要使用的编码
Throws | XMLStreamException:
英文文档：

createXMLStreamWriter

public abstract XMLStreamWriter createXMLStreamWriter(OutputStream stream,
                                                      String encoding)
                                               throws XMLStreamException
Create a new XMLStreamWriter that writes to a stream

Parameters:
stream - the stream to write to
encoding - the encoding to use
Throws:
XMLStreamException

abstract public XMLStreamWriter createXMLStreamWriter(javax.xml.transform.Result result) throws XMLStreamException
创建一个写入到 JAXP 结果的新 XMLStreamWriter。此方法是可选的。
result | 要向其写入 XMLStreamWriter 的结果
Throws | UnsupportedOperationException: 如果此 XMLOutputFactory 不支持此方法
Throws | XMLStreamException:
英文文档：

createXMLStreamWriter

public abstract XMLStreamWriter createXMLStreamWriter(Result result)
                                               throws XMLStreamException
Create a new XMLStreamWriter that writes to a JAXP result. This method is optional.

Parameters:
result - the result to write to
Throws:
UnsupportedOperationException - if this method is not supported by this XMLOutputFactory
XMLStreamException

abstract public XMLEventWriter createXMLEventWriter(javax.xml.transform.Result result) throws XMLStreamException
创建一个写入到 JAXP 结果的新 XMLEventWriter。此方法是可选的。
result | 要向其写入 XMLStreamWriter 的结果
Throws | UnsupportedOperationException: 如果此 XMLOutputFactory 不支持此方法
Throws | XMLStreamException:
英文文档：

createXMLEventWriter

public abstract XMLEventWriter createXMLEventWriter(Result result)
                                             throws XMLStreamException
Create a new XMLEventWriter that writes to a JAXP result. This method is optional.

Parameters:
result - the result to write to
Throws:
UnsupportedOperationException - if this method is not supported by this XMLOutputFactory
XMLStreamException

abstract public XMLEventWriter createXMLEventWriter(java.io.OutputStream stream) throws XMLStreamException
创建一个写入到流的新 XMLEventWriter。
stream | 要写入的流
Throws | XMLStreamException:
英文文档：

createXMLEventWriter

public abstract XMLEventWriter createXMLEventWriter(OutputStream stream)
                                             throws XMLStreamException
Create a new XMLEventWriter that writes to a stream

Parameters:
stream - the stream to write to
Throws:
XMLStreamException

abstract public XMLEventWriter createXMLEventWriter(java.io.OutputStream stream, String encoding) throws XMLStreamException
创建一个写入到流的新 XMLEventWriter。
stream | 要写入的流
encoding | 要使用的编码
Throws | XMLStreamException:
英文文档：

createXMLEventWriter

public abstract XMLEventWriter createXMLEventWriter(OutputStream stream,
                                                    String encoding)
                                             throws XMLStreamException
Create a new XMLEventWriter that writes to a stream

Parameters:
stream - the stream to write to
encoding - the encoding to use
Throws:
XMLStreamException

abstract public XMLEventWriter createXMLEventWriter(java.io.Writer stream) throws XMLStreamException
创建一个写入到 writer 的新 XMLEventWriter。
stream | 要写入的流
Throws | XMLStreamException:
英文文档：

createXMLEventWriter

public abstract XMLEventWriter createXMLEventWriter(Writer stream)
                                             throws XMLStreamException
Create a new XMLEventWriter that writes to a writer

Parameters:
stream - the stream to write to
Throws:
XMLStreamException

abstract public void setProperty(String name, Object value) throws IllegalArgumentException
允许用户在底层实现上设置特定功能/属性。
name | 属性的名称
value | 属性的值
Throws | IllegalArgumentException: 如果属性不受支持
英文文档：

setProperty

public abstract void setProperty(String name,
                                 Object value)
                          throws IllegalArgumentException
Allows the user to set specific features/properties on the underlying implementation.

Parameters:
name - The name of the property
value - The value of the property
Throws:
IllegalArgumentException - if the property is not supported

abstract public Object getProperty(String name) throws IllegalArgumentException
获取底层实现上的功能/属性
name | 属性的名称
return | 属性的值
Throws | IllegalArgumentException: 如果属性不受支持
英文文档：

getProperty

public abstract Object getProperty(String name)
                            throws IllegalArgumentException
Get a feature/property on the underlying implementation

Parameters:
name - The name of the property
Returns:
The value of the property
Throws:
IllegalArgumentException - if the property is not supported

abstract public boolean isPropertySupported(String name)
查询此工厂支持的属性集合。
name | 属性的名称（不可以为 null）
return | 如果此属性受支持，则返回 true，否则返回 false
英文文档：

isPropertySupported

public abstract boolean isPropertySupported(String name)
Query the set of properties that this factory supports.

Parameters:
name - The name of the property (may not be null)
Returns:
true if the property is supported and false otherwise
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLStreamException (Java EE 5)

javax.xml.stream
Class XMLStreamException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  javax.xml.stream.XMLStreamException
All Implemented Interfaces:
Serializable
public class XMLStreamException
extends Exception

Extends: Throwable > Exception

用于不可预料处理错误的基本异常。此异常类用于报告格式良好的错误以及不可预料的处理条件。
version 1.0
英文文档：

The base exception for unexpected processing errors. This Exception class is used to report well-formedness errors as well as unexpected processing conditions.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
Serialized Form

Field Summary
protected Location | location
protected Throwable | nested
Constructor Summary
XMLStreamException()
Default constructor
XMLStreamException(String msg)
Construct an exception with the assocated message.
XMLStreamException(String msg, Location location)
Construct an exception with the assocated message, exception and location.
XMLStreamException(String msg, Location location, Throwable th)
Construct an exception with the assocated message, exception and location.
XMLStreamException(String msg, Throwable th)
Construct an exception with the assocated message and exception
XMLStreamException(Throwable th)
Construct an exception with the assocated exception
Method Summary
Location | getLocation() Gets the location of the exception
Throwable | getNestedException() Gets the nested exception.
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

Field Detail

英文文档：

nested

protected Throwable nested

英文文档：

location

protected Location location
Constructor Detail

public XMLStreamException()
默认构造方法。
英文文档：

XMLStreamException

public XMLStreamException()
Default constructor

public XMLStreamException(String msg)
构造具有关联消息的异常。
msg 要报告的消息
英文文档：

XMLStreamException

public XMLStreamException(String msg)
Construct an exception with the assocated message.

Parameters:
msg - the message to report

public XMLStreamException(Throwable th)
构造具有关联异常的异常
th 嵌套的异常
英文文档：

XMLStreamException

public XMLStreamException(Throwable th)
Construct an exception with the assocated exception

Parameters:
th - a nested exception

public XMLStreamException(String msg, Throwable th)
构造具有关联消息和异常的异常
th | 嵌套的异常
msg | 要报告的消息
英文文档：

XMLStreamException

public XMLStreamException(String msg,
                          Throwable th)
Construct an exception with the assocated message and exception

Parameters:
th - a nested exception
msg - the message to report

public XMLStreamException(String msg, Location location, Throwable th)
构造具有关联消息、异常和位置的异常。
th | 嵌套的异常
msg | 要报告的消息
location | 错误的位置
英文文档：

XMLStreamException

public XMLStreamException(String msg,
                          Location location,
                          Throwable th)
Construct an exception with the assocated message, exception and location.

Parameters:
th - a nested exception
msg - the message to report
location - the location of the error

public XMLStreamException(String msg, Location location)
构造具有关联消息、异常和位置的异常。
msg | 要报告的消息
location | 错误的位置
英文文档：

XMLStreamException

public XMLStreamException(String msg,
                          Location location)
Construct an exception with the assocated message, exception and location.

Parameters:
msg - the message to report
location - the location of the error
Method Detail

public Throwable getNestedException()
获取嵌套异常。
return 嵌套异常
英文文档：

getNestedException

public Throwable getNestedException()
Gets the nested exception.

Returns:
Nested exception

public Location getLocation()
获取异常的位置
return 异常的位置；如果没有可用位置，则返回 null
英文文档：

getLocation

public Location getLocation()
Gets the location of the exception

Returns:
the location of the exception, may be null if none is available
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


FactoryConfigurationError (Java EE 5)

javax.xml.stream
Class FactoryConfigurationError

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Error
            extended by  javax.xml.stream.FactoryConfigurationError
All Implemented Interfaces:
Serializable
public class FactoryConfigurationError
extends Error

Extends: Throwable > Error

一个用于报告工厂配置错误的错误类。
version 1.0
英文文档：

An error class for reporting factory configuration errors.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
Serialized Form

Constructor Summary
FactoryConfigurationError()
Default constructor
FactoryConfigurationError(Exception e)
Construct an exception with a nested inner exception
FactoryConfigurationError(Exception e, String msg)
Construct an exception with a nested inner exception and a message
FactoryConfigurationError(String msg)
Construct an exception with associated message
FactoryConfigurationError(String msg, Exception e)
Construct an exception with a nested inner exception and a message
Method Summary
Exception | getException() Return the nested exception (if any)
String | getMessage() Report the message associated with this error
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

public FactoryConfigurationError()
默认构造方法。
英文文档：

FactoryConfigurationError

public FactoryConfigurationError()
Default constructor

public FactoryConfigurationError(Exception e)
构造具有嵌套内部异常的异常。
e 要嵌套的异常
英文文档：

FactoryConfigurationError

public FactoryConfigurationError(Exception e)
Construct an exception with a nested inner exception

Parameters:
e - the exception to nest

public FactoryConfigurationError(Exception e, String msg)
构造具有嵌套内部异常和消息的异常。
e | 要嵌套的异常
msg | 要报告的消息
英文文档：

FactoryConfigurationError

public FactoryConfigurationError(Exception e,
                                 String msg)
Construct an exception with a nested inner exception and a message

Parameters:
e - the exception to nest
msg - the message to report

public FactoryConfigurationError(String msg, Exception e)
构造具有嵌套内部异常和消息的异常。
msg | 要报告的消息
e | 要嵌套的异常
英文文档：

FactoryConfigurationError

public FactoryConfigurationError(String msg,
                                 Exception e)
Construct an exception with a nested inner exception and a message

Parameters:
msg - the message to report
e - the exception to nest

public FactoryConfigurationError(String msg)
构造具有关联消息的异常。
e | 要嵌套的异常
msg | 要报告的消息
英文文档：

FactoryConfigurationError

public FactoryConfigurationError(String msg)
Construct an exception with associated message

Parameters:
e - the exception to nest
msg - the message to report
Method Detail

public Exception getException()
返回嵌套异常（如果有）。
return 嵌套异常或 null
英文文档：

getException

public Exception getException()
Return the nested exception (if any)

Returns:
the nested exception or null

public String getMessage()
报告与此错误关联的消息。
return 消息的字符串值
英文文档：

getMessage

public String getMessage()
Report the message associated with this error

Overrides:
getMessage in class Throwable
Returns:
the string value of the message
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.stream.events (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.stream.events

Interface Summary
Attribute | An interface that contains information about an attribute.
Characters | This describes the interface to Characters events.
Comment | An interface for comment events
DTD | This is the top level interface for events dealing with DTDs
EndDocument | A marker interface for the end of the document
EndElement | An interface for the end element event.
EntityDeclaration | An interface for handling Entity Declarations This interface is used to record and report unparsed entity declarations.
EntityReference | An interface for handling Entity events.
Namespace | An interface that contains information about a namespace.
NotationDeclaration | An interface for handling Notation Declarations Receive notification of a notation declaration event.
ProcessingInstruction | An interface that describes the data found in processing instructions
StartDocument | An interface for the start document event
StartElement | The StartElement interface provides access to information about start elements.
XMLEvent | This is the base event interface for handling markup events.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.stream.events Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.stream.events

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.xml.stream.XMLStreamConstants
    • javax.xml.stream.events.XMLEvent
      • javax.xml.stream.events.Attribute
        • javax.xml.stream.events.Namespace
      • javax.xml.stream.events.Characters
      • javax.xml.stream.events.Comment
      • javax.xml.stream.events.DTD
      • javax.xml.stream.events.EndDocument
      • javax.xml.stream.events.EndElement
      • javax.xml.stream.events.EntityDeclaration
      • javax.xml.stream.events.EntityReference
      • javax.xml.stream.events.NotationDeclaration
      • javax.xml.stream.events.ProcessingInstruction
      • javax.xml.stream.events.StartDocument
      • javax.xml.stream.events.StartElement
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Attribute (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.stream.events
Interface Attribute

All Superinterfaces:
XMLEvent, XMLStreamConstants
All Known Subinterfaces:
Namespace
public interface Attribute
extends XMLEvent

Implements: XMLEvent
Implemented by: Namespace

包含关于属性信息的接口。这些属性被报告为可从 StartElement 访问的事件的集合。其他应用程序可能将属性报告为一阶事件，例如作为 XPath 表达式的结果。
version | 1.0
See also | javax.xml.stream.events.StartElement
英文文档：

An interface that contains information about an attribute. Attributes are reported as a set of events accessible from a StartElement. Other applications may report Attributes as first-order events, for example as the results of an XPath expression.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
StartElement

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
String | getDTDType() Gets the type of this attribute, default is the String "CDATA"
QName | getName() Returns the QName for this attribute
String | getValue() Gets the normalized value of this attribute
boolean | isSpecified() A flag indicating whether this attribute was actually specified in the start-tag of its element, or was defaulted from the schema.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public javax.xml.namespace.QName getName()
返回此属性的 QName。
英文文档：

getName

QName getName()
Returns the QName for this attribute

public String getValue()
获取此属性的标准化值。
英文文档：

getValue

String getValue()
Gets the normalized value of this attribute

public String getDTDType()
获取此属性的类型，默认值是字符串 "CDATA"，
return 字符串形式的类型，默认值为 "CDATA"
英文文档：

getDTDType

String getDTDType()
Gets the type of this attribute, default is the String "CDATA"

Returns:
the type as a String, default is "CDATA"

public boolean isSpecified()
一个标志，用于指示此属性实际上是在其元素的开始标记中指定的，还是在模式中默认指定的。
return 如果该属性是在开始元素中指定的，则返回 true
英文文档：

isSpecified

boolean isSpecified()
A flag indicating whether this attribute was actually specified in the start-tag of its element, or was defaulted from the schema.

Returns:
returns true if this was specified in the start element
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Characters (Java EE 5)

javax.xml.stream.events
Interface Characters

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface Characters
extends XMLEvent

Implements: XMLEvent

此方法将描述 Characters 事件的接口。所有文本事件都被报告为 Characters 事件。内容、CData 和空格都被报告为 Characters 事件。在大多数情况下，IgnorableWhitespace 被设置为 false，除非元素内容的声明是用于当前元素的。
version 1.0
英文文档：

This describes the interface to Characters events. All text events get reported as Characters events. Content, CData and whitespace are all reported as Characters events. IgnorableWhitespace, in most cases, will be set to false unless an element declaration of element content is present for the current element.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
String | getData() Get the character data of this event
boolean | isCData() Returns true if this is a CData section.
boolean | isIgnorableWhiteSpace() Return true if this is ignorableWhiteSpace.
boolean | isWhiteSpace() Returns true if this set of Characters is all whitespace.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getData()
获取此事件的字符数据。
英文文档：

getData

String getData()
Get the character data of this event

public boolean isWhiteSpace()
如果此 Characters 集合中都是空格，则返回 true。文档内的空格报告为 CHARACTERS。此方法允许查看 CHARACTERS 事件是否只由空格组成。
英文文档：

isWhiteSpace

boolean isWhiteSpace()
Returns true if this set of Characters is all whitespace. Whitespace inside a document is reported as CHARACTERS. This method allows checking of CHARACTERS events to see if they are composed of only whitespace characters

public boolean isCData()
如果它是一个 CData 节，则返回 true。如果此事件是 CData，则其事件类型为 CDATA。 如果将 javax.xml.stream.isCoalescing 设置为 true，则由非 CDATA 字符包围的 CDATA 节将被报告为单个字符事件。这种情况下，此方法将返回 false。
英文文档：

isCData

boolean isCData()
Returns true if this is a CData section. If this event is CData its event type will be CDATA If javax.xml.stream.isCoalescing is set to true CDATA Sections that are surrounded by non CDATA characters will be reported as a single Characters event. This method will return false in this case.

public boolean isIgnorableWhiteSpace()
如果它是 ignorableWhiteSpace，则返回 ture。如果此事件是 ignorableWhiteSpace，则其事件类型为 SPACE。
英文文档：

isIgnorableWhiteSpace

boolean isIgnorableWhiteSpace()
Return true if this is ignorableWhiteSpace. If this event is ignorableWhiteSpace its event type will be SPACE.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Comment (Java EE 5)

javax.xml.stream.events
Interface Comment

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface Comment
extends XMLEvent

Implements: XMLEvent

注释事件的接口。
version 1.0
英文文档：

An interface for comment events

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
 String getText()
Return the string data of the comment, returns empty string if it does not exist
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getText()
返回注释的字符串数据，如果不存在这样的数据，则返回空字符串。
英文文档：

getText

String getText()
Return the string data of the comment, returns empty string if it does not exist

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


DTD (Java EE 5)

javax.xml.stream.events
Interface DTD

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface DTD
extends XMLEvent

Implements: XMLEvent

它是处理 DTD 的事件的顶层接口。
version 1.0
英文文档：

This is the top level interface for events dealing with DTDs

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
String | getDocumentTypeDeclaration() Returns the entire Document Type Declaration as a string, including the internal DTD subset.
List | getEntities() Return a List containing the general entities, both external and internal, declared in the DTD.
List | getNotations() Return a List containing the notations declared in the DTD.
Object | getProcessedDTD() Returns an implementation defined representation of the DTD.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getDocumentTypeDeclaration()
以字符串形式返回完整文档类型声明，其中包括内部 DTD 子集。如果没有内部子集，则返回 null。如果该字符串不为 null，则它必须返回与 XML 1.0 规范中的 doctypedecl 产品匹配的完整文档类型声明。
英文文档：

getDocumentTypeDeclaration

String getDocumentTypeDeclaration()
Returns the entire Document Type Declaration as a string, including the internal DTD subset. This may be null if there is not an internal subset. If it is not null it must return the entire Document Type Declaration which matches the doctypedecl production in the XML 1.0 specification

public Object getProcessedDTD()
返回定义 DTD 表示形式的实现。如果没有可用的表示形式，则此方法返回 null。
英文文档：

getProcessedDTD

Object getProcessedDTD()
Returns an implementation defined representation of the DTD. This method may return null if no representation is available.

public java.util.List<E> getNotations()
返回一个 List，其中包含在 DTD 中声明的注释。此列表必须包含 NotationDeclaration 事件。
return | NotationDeclaration 事件的无序列表
See also | javax.xml.stream.events.NotationDeclaration
英文文档：

getNotations

List getNotations()
Return a List containing the notations declared in the DTD. This list must contain NotationDeclaration events.

Returns:
an unordered list of NotationDeclaration events
See Also:
NotationDeclaration

public java.util.List<E> getEntities()
返回一个列表，其中包含在 DTD 中声明的外部和内部常规实体。此列表必须包含 EntityDeclaration 事件。
return | EntityDeclaration 事件的无序列表
See also | javax.xml.stream.events.EntityDeclaration
英文文档：

getEntities

List getEntities()
Return a List containing the general entities, both external and internal, declared in the DTD. This list must contain EntityDeclaration events.

Returns:
an unordered list of EntityDeclaration events
See Also:
EntityDeclaration
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EndDocument (Java EE 5)

javax.xml.stream.events
Interface EndDocument

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface EndDocument
extends XMLEvent

Implements: XMLEvent

文档结尾的标记接口。
version 1.0
英文文档：

A marker interface for the end of the document

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EndElement (Java EE 5)

javax.xml.stream.events
Interface EndElement

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface EndElement
extends XMLEvent

Implements: XMLEvent

结束元素事件的接口。EndElement 报告文档中的每个结束标记。
version | 1.0
See also | javax.xml.stream.events.XMLEvent
英文文档：

An interface for the end element event. An EndElement is reported for each End Tag in the document.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLEvent

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
QName | getName() Get the name of this event
Iterator | getNamespaces() Returns an Iterator of namespaces that have gone out of scope.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public javax.xml.namespace.QName getName()
获取此事件的名称
return 此事件的限定名
英文文档：

getName

QName getName()
Get the name of this event

Returns:
the qualified name of this event

public java.util.Iterator<E> getNamespaces()
返回超出范围名称空间的 Iterator。如果没有超出范围的名称空间，则返回一个空迭代器。
return 在 Namespace 接口上进行迭代的 Iterator，或者空迭代器
英文文档：

getNamespaces

Iterator getNamespaces()
Returns an Iterator of namespaces that have gone out of scope. Returns an empty iterator if no namespaces have gone out of scope.

Returns:
an Iterator over Namespace interfaces, or an empty iterator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityDeclaration (Java EE 5)

javax.xml.stream.events
Interface EntityDeclaration

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface EntityDeclaration
extends XMLEvent

Implements: XMLEvent

处理实体声明的接口。 此接口用于记录和报告未解析的实体声明。
version 1.0
英文文档：

An interface for handling Entity Declarations This interface is used to record and report unparsed entity declarations.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
String | getBaseURI() Get the base URI for this reference or null if this information is not available
String | getName() The entity's name
String | getNotationName() The name of the associated notation.
String | getPublicId() The entity's public identifier, or null if none was given
String | getReplacementText() The replacement text of the entity.
String | getSystemId() The entity's system identifier.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getPublicId()
实体的公共标识符，如果未给定该标识符，则为 null
return 此声明的公共 ID 或 null
英文文档：

getPublicId

String getPublicId()
The entity's public identifier, or null if none was given

Returns:
the public ID for this declaration or null

public String getSystemId()
实体的系统标识符。
return 此声明的系统 ID 或 null
英文文档：

getSystemId

String getSystemId()
The entity's system identifier.

Returns:
the system ID for this declaration or null

public String getName()
实体的名称
return 名称，不可以为 null
英文文档：

getName

String getName()
The entity's name

Returns:
the name, may not be null

public String getNotationName()
相关注释的名称。
return 注释的名称
英文文档：

getNotationName

String getNotationName()
The name of the associated notation.

Returns:
the notation name

public String getReplacementText()
实体的替换文本。如果该实体是一个内部实体，则此方法只返回非 null 结果。
return null 或替换文本
英文文档：

getReplacementText

String getReplacementText()
The replacement text of the entity. This method will only return non-null if this is an internal entity.

Returns:
null or the replacment text

public String getBaseURI()
获取此引用的基准 URI，如果此信息不可用，则获得 null
return 基准 URI 或 null
英文文档：

getBaseURI

String getBaseURI()
Get the base URI for this reference or null if this information is not available

Returns:
the base URI or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


EntityReference (Java EE 5)

javax.xml.stream.events
Interface EntityReference

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface EntityReference
extends XMLEvent

Implements: XMLEvent

处理实体事件的接口。 此事件报告尚未解析的实体并报告它们未处理的替换文本（如果可用）。如果将 javax.xml.stream.isReplacingEntityReferences 设置为 false，则报告此事件。如果将 javax.xml.stream.isReplacingEntityReferences 设置为 true，则将以透明的方式解析实体引用。 处理实体的方法有两种： (1)如果将 javax.xml.stream.isReplacingEntityReferences 设置为 true，则以透明的方式解析所有实体引用并将它们作为报告标记。(2)如果将 javax.xml.stream.isReplacingEntityReferences 设置为 false，则将实体引用作为 EntityReference 事件报告。
version 1.0
英文文档：

An interface for handling Entity events. This event reports entities that have not been resolved and reports their replacement text unprocessed (if available). This event will be reported if javax.xml.stream.isReplacingEntityReferences is set to false. If javax.xml.stream.isReplacingEntityReferences is set to true entity references will be resolved transparently. Entities are handled in two possible ways: (1) If javax.xml.stream.isReplacingEntityReferences is set to true all entity references are resolved and reported as markup transparently. (2) If javax.xml.stream.isReplacingEntityReferences is set to false Entity references are reported as an EntityReference Event.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
EntityDeclaration | getDeclaration() Return the declaration of this entity.
String | getName() The name of the entity
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public EntityDeclaration getDeclaration()
返回此实体的声明。
英文文档：

getDeclaration

EntityDeclaration getDeclaration()
Return the declaration of this entity.

public String getName()
实体的名称
return 实体的名称，不可以为 null
英文文档：

getName

String getName()
The name of the entity

Returns:
the entity's name, may not be null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Namespace (Java EE 5)

javax.xml.stream.events
Interface Namespace

All Superinterfaces:
Attribute, XMLEvent, XMLStreamConstants
public interface Namespace
extends Attribute

Implements: Attribute

包含有关名称空间的信息的接口。 可以从 StartElement 访问名称空间。
version | 1.0
See also | javax.xml.stream.events.StartElement
英文文档：

An interface that contains information about a namespace. Namespaces are accessed from a StartElement.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
StartElement

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
String | getNamespaceURI() Gets the uri bound to the prefix of this namespace
String | getPrefix() Gets the prefix, returns "" if this is a default namespace declaration.
boolean | isDefaultNamespaceDeclaration() returns true if this attribute declares the default namespace
Methods inherited from interface javax.xml.stream.events.Attribute
getDTDType, getName, getValue, isSpecified
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getPrefix()
获取前缀，如果它是默认名称空间声明，则返回 ""。
英文文档：

getPrefix

String getPrefix()
Gets the prefix, returns "" if this is a default namespace declaration.

public String getNamespaceURI()
获取绑定到此名称空间的前缀的 URI。
英文文档：

getNamespaceURI

String getNamespaceURI()
Gets the uri bound to the prefix of this namespace

public boolean isDefaultNamespaceDeclaration()
如果此属性声明的是默认名称空间，则返回 true。
英文文档：

isDefaultNamespaceDeclaration

boolean isDefaultNamespaceDeclaration()
returns true if this attribute declares the default namespace

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


NotationDeclaration (Java EE 5)

javax.xml.stream.events
Interface NotationDeclaration

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface NotationDeclaration
extends XMLEvent

Implements: XMLEvent

处理注释声明的接口。 接收注释声明事件的通知。这取决于用来记录以后参考的注释的应用程序，publicId 和 systemId 中至少有一个必须为非 null。不能保证任何未解析实体在使用注释声明之前都报告它。
version 1.0
英文文档：

An interface for handling Notation Declarations Receive notification of a notation declaration event. It is up to the application to record the notation for later reference, At least one of publicId and systemId must be non-null. There is no guarantee that the notation declaration will be reported before any unparsed entities that use it.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
String | getName() The notation name.
String | getPublicId() The notation's public identifier, or null if none was given.
String | getSystemId() The notation's system identifier, or null if none was given.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getName()
注释名称。
英文文档：

getName

String getName()
The notation name.

public String getPublicId()
注释的公共标识符，如果未提供该标识符，则为 null。
英文文档：

getPublicId

String getPublicId()
The notation's public identifier, or null if none was given.

public String getSystemId()
注释的系统标识符，如果未提供该标识符，则为 null。
英文文档：

getSystemId

String getSystemId()
The notation's system identifier, or null if none was given.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProcessingInstruction (Java EE 5)

javax.xml.stream.events
Interface ProcessingInstruction

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface ProcessingInstruction
extends XMLEvent

Implements: XMLEvent

描述处理指令中的数据的接口。
version 1.0
英文文档：

An interface that describes the data found in processing instructions

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
String | getData() The data section of the processing instruction
String | getTarget() The target section of the processing instruction
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getTarget()
处理指令的目标部分。
return PI 的字符串值或 null
英文文档：

getTarget

String getTarget()
The target section of the processing instruction

Returns:
the String value of the PI or null

public String getData()
处理指令的数据部分。
return PI 数据的字符串值或 null
英文文档：

getData

String getData()
The data section of the processing instruction

Returns:
the String value of the PI's data or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StartDocument (Java EE 5)

javax.xml.stream.events
Interface StartDocument

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface StartDocument
extends XMLEvent

Implements: XMLEvent

开始文档事件的接口。
version 1.0
英文文档：

An interface for the start document event

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
boolean | encodingSet() Returns true if CharacterEncodingScheme was set in the encoding declaration of the document
String | getCharacterEncodingScheme() Returns the encoding style of the XML data
String | getSystemId() Returns the system ID of the XML data
String | getVersion() Returns the version of XML of this XML stream
boolean | isStandalone() Returns if this XML is standalone
boolean | standaloneSet() Returns true if the standalone attribute was set in the encoding declaration of the document.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public String getSystemId()
返回 XML 数据的系统 ID
return 系统ID，默认值为 ""
英文文档：

getSystemId

String getSystemId()
Returns the system ID of the XML data

Returns:
the system ID, defaults to ""

public String getCharacterEncodingScheme()
返回 XML 数据的编码样式
return 字符编码，默认值为 "UTF-8"
英文文档：

getCharacterEncodingScheme

String getCharacterEncodingScheme()
Returns the encoding style of the XML data

Returns:
the character encoding, defaults to "UTF-8"

public boolean encodingSet()
如果在文档的编码声明中设置了 CharacterEncodingScheme，则返回 true。
英文文档：

encodingSet

boolean encodingSet()
Returns true if CharacterEncodingScheme was set in the encoding declaration of the document

public boolean isStandalone()
如果此 XML 是独立的，则返回 true。
return XML 的独立状态，默认值为 "no"
英文文档：

isStandalone

boolean isStandalone()
Returns if this XML is standalone

Returns:
the standalone state of XML, defaults to "no"

public boolean standaloneSet()
如果在文档的编码声明中设置了单独属性，则返回 ture。
英文文档：

standaloneSet

boolean standaloneSet()
Returns true if the standalone attribute was set in the encoding declaration of the document.

public String getVersion()
返回此 XML 流的 XML 版本
return XML 的版本，默认值为 "1.0"
英文文档：

getVersion

String getVersion()
Returns the version of XML of this XML stream

Returns:
the version of XML, defaults to "1.0"
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


StartElement (Java EE 5)

javax.xml.stream.events
Interface StartElement

All Superinterfaces:
XMLEvent, XMLStreamConstants
public interface StartElement
extends XMLEvent

Implements: XMLEvent

StartElement 接口提供对有关开始元素的信息的访问。StartElement 报告文档中的每个开始标记。
version 1.0
英文文档：

The StartElement interface provides access to information about start elements. A StartElement is reported for each Start Tag in the document.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
Attribute | getAttributeByName(QName name) Returns the attribute referred to by this name
Iterator | getAttributes() Returns an Iterator of non-namespace declared attributes declared on this START_ELEMENT, returns an empty iterator if there are no attributes.
QName | getName() Get the name of this event
NamespaceContext | getNamespaceContext() Gets a read-only namespace context.
Iterator | getNamespaces() Returns an Iterator of namespaces declared on this element.
String | getNamespaceURI(String prefix) Gets the value that the prefix is bound to in the context of this element.
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode

Method Detail

public javax.xml.namespace.QName getName()
获取此事件的名称
return 此事件的限定名
英文文档：

getName

QName getName()
Get the name of this event

Returns:
the qualified name of this event

public java.util.Iterator<E> getAttributes()
返回在此 START_ELEMENT 上声明的已声明非名称空间属性的 Iterator；如果没有这样的属性，则返回空迭代器。迭代器必须只包含 javax.xml.stream.Attribute 接口的实现。属性是完全无序的，且不能以任意顺序报告。
return 可在 Attribute 接口上进行迭代的只读 Iterator，或者返回空迭代器
英文文档：

getAttributes

Iterator getAttributes()
Returns an Iterator of non-namespace declared attributes declared on this START_ELEMENT, returns an empty iterator if there are no attributes. The iterator must contain only implementations of the javax.xml.stream.Attribute interface. Attributes are fundamentally unordered and may not be reported in any order.

Returns:
a readonly Iterator over Attribute interfaces, or an empty iterator

public java.util.Iterator<E> getNamespaces()
返回在此元素上声明的名称空间的 Iterator。此 Iterator 不包含以前声明的名称空间，除非它们出现在当前 START_ELEMENT 中。因此该列表可能包含重新声明的名称空间和重复的名称空间声明。使用 getNamespaceContext() 方法获取名称空间声明的当前上下文。

迭代器只能包含 javax.xml.stream.Namespace 接口的实现。

名称空间是一个属性。可以以属性列表的方式在名称空间列表上进行迭代。但是，此方法只返回在此 START_ELEMENT 中声明的名称空间的列表，不包含在此 START_ELEMENT 中声明的属性。 如果没有名称空间，则返回空迭代器。

return 可在名称空间接口上进行迭代的只读 Iterator，或者返回空迭代器
英文文档：

getNamespaces

Iterator getNamespaces()
Returns an Iterator of namespaces declared on this element. This Iterator does not contain previously declared namespaces unless they appear on the current START_ELEMENT. Therefore this list may contain redeclared namespaces and duplicate namespace declarations. Use the getNamespaceContext() method to get the current context of namespace declarations.

The iterator must contain only implementations of the javax.xml.stream.Namespace interface.

A Namespace isA Attribute. One can iterate over a list of namespaces as a list of attributes. However this method returns only the list of namespaces declared on this START_ELEMENT and does not include the attributes declared on this START_ELEMENT. Returns an empty iterator if there are no namespaces.

Returns:
a readonly Iterator over Namespace interfaces, or an empty iterator

public Attribute getAttributeByName(javax.xml.namespace.QName name)
返回此名称引用的属性
name | 所需名称的 qname
return | 与名称值相对应的属性或 null
英文文档：

getAttributeByName

Attribute getAttributeByName(QName name)
Returns the attribute referred to by this name

Parameters:
name - the qname of the desired name
Returns:
the attribute corresponding to the name value or null

public javax.xml.namespace.NamespaceContext getNamespaceContext()
获取只读名称空间上下文。如果没有可用的上下文，此方法将返回空名称空间上下文。NamespaceContext 包含有关此 StartElement 的作用域中所有名称空间的信息。
return 当前名称空间上下文
英文文档：

getNamespaceContext

NamespaceContext getNamespaceContext()
Gets a read-only namespace context. If no context is available this method will return an empty namespace context. The NamespaceContext contains information about all namespaces in scope for this StartElement.

Returns:
the current namespace context

public String getNamespaceURI(String prefix)
获取绑定在此元素上下文中的前缀的值。如果前缀未绑定在此上下文中，则返回 null
prefix | 要查找的前缀
return | 绑定到前缀的 URI 或 null
英文文档：

getNamespaceURI

String getNamespaceURI(String prefix)
Gets the value that the prefix is bound to in the context of this element. Returns null if the prefix is not bound in this context

Parameters:
prefix - the prefix to lookup
Returns:
the uri bound to the prefix or null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLEvent (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.stream.events
Interface XMLEvent

All Superinterfaces:
XMLStreamConstants
All Known Subinterfaces:
Attribute, Characters, Comment, DTD, EndDocument, EndElement, EntityDeclaration, EntityReference, Namespace, NotationDeclaration, ProcessingInstruction, StartDocument, StartElement
public interface XMLEvent
extends XMLStreamConstants

Implements: XMLStreamConstants
Implemented by: Attribute, Characters, Comment, DTD, EndDocument, EndElement, EntityDeclaration, EntityReference, NotationDeclaration, ProcessingInstruction, StartDocument, StartElement

处理标记事件的基础事件接口。事件是用来与应用程序交流 XML 1.0 InfoSet 的 value 对象。可以在解析完事件之后缓存和引用事件。
version | 1.0
See also | javax.xml.stream.XMLEventReader, javax.xml.stream.events.Characters, javax.xml.stream.events.ProcessingInstruction, javax.xml.stream.events.StartElement, javax.xml.stream.events.EndElement, javax.xml.stream.events.StartDocument, javax.xml.stream.events.EndDocument, javax.xml.stream.events.EntityReference, javax.xml.stream.events.EntityDeclaration, javax.xml.stream.events.NotationDeclaration
英文文档：

This is the base event interface for handling markup events. Events are value objects that are used to communicate the XML 1.0 InfoSet to the Application. Events may be cached and referenced after the parse has completed.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLEventReader, Characters, ProcessingInstruction, StartElement, EndElement, StartDocument, EndDocument, EntityReference, EntityDeclaration, NotationDeclaration

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Method Summary
Characters | asCharacters() Returns this event as Characters, may result in a class cast exception if this event is not Characters.
EndElement | asEndElement() Returns this event as an end element event, may result in a class cast exception if this event is not a end element.
StartElement | asStartElement() Returns this event as a start element event, may result in a class cast exception if this event is not a start element.
int | getEventType() Returns an integer code for this event.
Location | getLocation() Return the location of this event.
QName | getSchemaType() This method is provided for implementations to provide optional type information about the associated event.
boolean | isAttribute() A utility function to check if this event is an Attribute.
boolean | isCharacters() A utility function to check if this event is Characters.
boolean | isEndDocument() A utility function to check if this event is an EndDocument.
boolean | isEndElement() A utility function to check if this event is a EndElement.
boolean | isEntityReference() A utility function to check if this event is an EntityReference.
boolean | isNamespace() A utility function to check if this event is a Namespace.
boolean | isProcessingInstruction() A utility function to check if this event is a ProcessingInstruction.
boolean | isStartDocument() A utility function to check if this event is a StartDocument.
boolean | isStartElement() A utility function to check if this event is a StartElement.
void | writeAsEncodedUnicode(Writer writer) This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.

Method Detail

public int getEventType()
返回此事件的整数码。
See also START_ELEMENT, END_ELEMENT, CHARACTERS, ATTRIBUTE, NAMESPACE, PROCESSING_INSTRUCTION, COMMENT, START_DOCUMENT, END_DOCUMENT, DTD
英文文档：

getEventType

int getEventType()
Returns an integer code for this event.

See Also:
XMLStreamConstants.START_ELEMENT, XMLStreamConstants.END_ELEMENT, XMLStreamConstants.CHARACTERS, XMLStreamConstants.ATTRIBUTE, XMLStreamConstants.NAMESPACE, XMLStreamConstants.PROCESSING_INSTRUCTION, XMLStreamConstants.COMMENT, XMLStreamConstants.START_DOCUMENT, XMLStreamConstants.END_DOCUMENT, XMLStreamConstants.DTD

public Location getLocation()
返回此事件的位置。此方法返回的 Location 是不易改变的，将保留其信息。
See also javax.xml.stream.Location
英文文档：

getLocation

Location getLocation()
Return the location of this event. The Location returned from this method is non-volatile and will retain its information.

See Also:
Location

public boolean isStartElement()
检查此事件是否为 StartElement 的实用工具函数。
See also javax.xml.stream.events.StartElement
英文文档：

isStartElement

boolean isStartElement()
A utility function to check if this event is a StartElement.

See Also:
StartElement

public boolean isAttribute()
检查此事件是否为 Attribute 的实用工具函数。
See also javax.xml.stream.events.Attribute
英文文档：

isAttribute

boolean isAttribute()
A utility function to check if this event is an Attribute.

See Also:
Attribute

public boolean isNamespace()
检查此事件是否为 Namespace 的实用工具函数。
See also javax.xml.stream.events.Namespace
英文文档：

isNamespace

boolean isNamespace()
A utility function to check if this event is a Namespace.

See Also:
Namespace

public boolean isEndElement()
检查此事件是否为 EndElement 的实用工具函数。
See also javax.xml.stream.events.EndElement
英文文档：

isEndElement

boolean isEndElement()
A utility function to check if this event is a EndElement.

See Also:
EndElement

public boolean isEntityReference()
检查此事件是否为 EntityReference 的实用工具函数。
See also javax.xml.stream.events.EntityReference
英文文档：

isEntityReference

boolean isEntityReference()
A utility function to check if this event is an EntityReference.

See Also:
EntityReference

public boolean isProcessingInstruction()
检查此事件是否为 ProcessingInstruction 的实用工具函数。
See also javax.xml.stream.events.ProcessingInstruction
英文文档：

isProcessingInstruction

boolean isProcessingInstruction()
A utility function to check if this event is a ProcessingInstruction.

See Also:
ProcessingInstruction

public boolean isCharacters()
检查此事件是否为 Characters 的实用工具函数。
See also javax.xml.stream.events.Characters
英文文档：

isCharacters

boolean isCharacters()
A utility function to check if this event is Characters.

See Also:
Characters

public boolean isStartDocument()
检查此事件是否为 StartDocument 的实用工具函数。
See also javax.xml.stream.events.StartDocument
英文文档：

isStartDocument

boolean isStartDocument()
A utility function to check if this event is a StartDocument.

See Also:
StartDocument

public boolean isEndDocument()
检查此事件是否为 EndDocument 的实用工具函数。
See also javax.xml.stream.events.EndDocument
英文文档：

isEndDocument

boolean isEndDocument()
A utility function to check if this event is an EndDocument.

See Also:
EndDocument

public StartElement asStartElement()
将此事件作为开始元素事件返回，如果此事件不是开始元素，则可能导致类强制转换异常。
英文文档：

asStartElement

StartElement asStartElement()
Returns this event as a start element event, may result in a class cast exception if this event is not a start element.

public EndElement asEndElement()
将此事件作为结束元素事件返回，如果此事件不是结束元素，则可能导致类强制转换异常。
英文文档：

asEndElement

EndElement asEndElement()
Returns this event as an end element event, may result in a class cast exception if this event is not a end element.

public Characters asCharacters()
将此事件作为 Characters 返回，如果此事件不是字符，则可能导致类强制转化异常。
英文文档：

asCharacters

Characters asCharacters()
Returns this event as Characters, may result in a class cast exception if this event is not Characters.

public javax.xml.namespace.QName getSchemaType()
提供此方法是为了提供有关关联事件的可选类型信息。信息是可选的，如果没有可用信息，则返回 null。
英文文档：

getSchemaType

QName getSchemaType()
This method is provided for implementations to provide optional type information about the associated event. It is optional and will return null if no information is available.

public void writeAsEncodedUnicode(java.io.Writer writer) throws XMLStreamException
此方法根据 XML 1.0 规范将 XMLEvent 编写为 Unicode 字符。不应输出缩排或空格。 在将任何用户定义的事件类型写入输出流时，都应当调用此方法。内置 Event 类型必须实现此方法，但是在将内置 Event 写出到输出流时，为了优化目的，可以选择而不调用这些方法。生成的输出必须与所表示的信息集等效。
writer | 将输出数据的编写器
Throws | XMLStreamException: 如果在写入事件时发生严重错误
英文文档：

writeAsEncodedUnicode

void writeAsEncodedUnicode(Writer writer)
                           throws XMLStreamException
This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.

Parameters:
writer - The writer that will output the data
Throws:
XMLStreamException - if there is a fatal error writing the event
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.stream.util (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.stream.util

Interface Summary
XMLEventAllocator | This interface defines a class that allows a user to register a way to allocate events given an XMLStreamReader.
XMLEventConsumer | This interface defines an event consumer interface.

Class Summary
EventReaderDelegate | This is the base class for deriving an XMLEventReader filter.
StreamReaderDelegate | This is the base class for deriving an XMLStreamReader filter This class is designed to sit between an XMLStreamReader and an application's XMLStreamReader.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.stream.util Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.stream.util

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.stream.util.EventReaderDelegate (implements javax.xml.stream.XMLEventReader)
    • javax.xml.stream.util.StreamReaderDelegate (implements javax.xml.stream.XMLStreamReader)

Interface Hierarchy

  • javax.xml.stream.util.XMLEventAllocator
  • javax.xml.stream.util.XMLEventConsumer
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


XMLEventAllocator (Java EE 5)

javax.xml.stream.util
Interface XMLEventAllocator

public interface XMLEventAllocator

此接口定义了一个类，该类允许用户注册给定 XMLStreamReader 的情况下分配事件的方式。实现不需要使用 XMLEventFactory 实现，但推荐这样做。可以使用属性 "javax.xml.stream.allocator" 在 XMLInputFactory 上设置 XMLEventAllocator。
version | 1.0
See also | javax.xml.stream.XMLInputFactory, javax.xml.stream.XMLEventFactory
英文文档：

This interface defines a class that allows a user to register a way to allocate events given an XMLStreamReader. An implementation is not required to use the XMLEventFactory implementation but this is recommended. The XMLEventAllocator can be set on an XMLInputFactory using the property "javax.xml.stream.allocator"

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLInputFactory, XMLEventFactory

Method Summary
XMLEvent | allocate(XMLStreamReader reader) This method allocates an event given the current state of the XMLStreamReader.
void | allocate(XMLStreamReader reader, XMLEventConsumer consumer) This method allocates an event or set of events given the current state of the XMLStreamReader and adds the event or set of events to the consumer that was passed in.
XMLEventAllocator | newInstance() This method creates an instance of the XMLEventAllocator.

Method Detail

public XMLEventAllocator newInstance()
此方法创建一个 XMLEventAllocator 实例。它允许 XMLInputFactory 为每个 reader 分配一个新实例。
英文文档：

newInstance

XMLEventAllocator newInstance()
This method creates an instance of the XMLEventAllocator. This allows the XMLInputFactory to allocate a new instance per reader.

public XMLEvent allocate(XMLStreamReader reader) throws XMLStreamException
此方法在给定 XMLStreamReader 当前状态的情况下分配事件。如果此 XMLEventAllocator 在 reader 状态和事件之间不存在一对一的映射关系，则此方法将返回 null。此方法不能修改 XMLStreamReader 的状态。
reader | 作为分配根据的 XMLStreamReader
return | 对应于当前 reader 状态的事件
英文文档：

allocate

XMLEvent allocate(XMLStreamReader reader)
                  throws XMLStreamException
This method allocates an event given the current state of the XMLStreamReader. If this XMLEventAllocator does not have a one-to-one mapping between reader states and events this method will return null. This method must not modify the state of the XMLStreamReader.

Parameters:
reader - The XMLStreamReader to allocate from
Returns:
the event corresponding to the current reader state
Throws:
XMLStreamException

public void allocate(XMLStreamReader reader, XMLEventConsumer consumer) throws XMLStreamException
此方法在给定 XMLStreamReader 当前状态的情况下分配一个事件或一个事件组，并将该事件或事件组添加给传入的使用者。此方法可将 reader 状态展开或联系到事件状态中。此方法可修改 XMLStreamReader 的状态。
reader | 作为分配根据的 XMLStreamReader
consumer | 要添加事件的 XMLEventConsumer。
英文文档：

allocate

void allocate(XMLStreamReader reader,
              XMLEventConsumer consumer)
              throws XMLStreamException
This method allocates an event or set of events given the current state of the XMLStreamReader and adds the event or set of events to the consumer that was passed in. This method can be used to expand or contract reader states into event states. This method may modify the state of the XMLStreamReader.

Parameters:
reader - The XMLStreamReader to allocate from
consumer - The XMLEventConsumer to add to.
Throws:
XMLStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XMLEventConsumer (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.stream.util
Interface XMLEventConsumer

All Known Subinterfaces:
XMLEventWriter
public interface XMLEventConsumer

Implemented by: XMLEventWriter

此接口定义了一个事件使用者接口。使用者接口的协定将用于接受事件。此接口可用于将对象标记为可以接收事件。add 方法可能被连续调用几次，因此，使用者必须能够缓存尚未处理的事件。
version 1.0
英文文档：

This interface defines an event consumer interface. The contract of the of a consumer is to accept the event. This interface can be used to mark an object as able to receive events. Add may be called several times in immediate succession so a consumer must be able to cache events it hasn't processed yet.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Method Summary
 void add(XMLEvent event)
This method adds an event to the consumer.

Method Detail

public void add(XMLEvent event) throws XMLStreamException
此方法为使用者添加一个事件。调用此方法会使 event 参数失效。客户端应用程序应该在调用 add 方法时放弃对此事件的所有引用。应用程序继续使用这些引用的行为是未定义的。
event 要添加的事件，不可以为 null
英文文档：

add

void add(XMLEvent event)
         throws XMLStreamException
This method adds an event to the consumer. Calling this method invalidates the event parameter. The client application should discard all references to this event upon calling add. The behavior of an application that continues to use such references is undefined.

Parameters:
event - the event to add, may not be null
Throws:
XMLStreamException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


EventReaderDelegate (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.stream.util
Class EventReaderDelegate

java.lang.Object
    extended by  javax.xml.stream.util.EventReaderDelegate
All Implemented Interfaces:
Iterator, XMLEventReader
public class EventReaderDelegate
extends Object
implements XMLEventReader

Implements: XMLEventReader

该类是用于派生 XMLEventReader 过滤器的基类。 此类设计用于 XMLEventReader 和应用程序的 XMLEventReader 之间。默认情况下，每种方法除了调用父接口中的相应方法之外，不执行任何操作。
version | 1.0
See also | javax.xml.stream.XMLEventReader, javax.xml.stream.util.StreamReaderDelegate
英文文档：

This is the base class for deriving an XMLEventReader filter. This class is designed to sit between an XMLEventReader and an application's XMLEventReader. By default each method does nothing but call the corresponding method on the parent interface.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLEventReader, StreamReaderDelegate

Constructor Summary
EventReaderDelegate()
Construct an empty filter with no parent.
EventReaderDelegate(XMLEventReader reader)
Construct an filter with the specified parent.
Method Summary
void | close() Frees any resources associated with this Reader.
String | getElementText() Reads the content of a text-only element.
XMLEventReader | getParent() Get the parent of this instance.
Object | getProperty(String name) Get the value of a feature/property from the underlying implementation
boolean | hasNext() Check if there are more events.
Object | next()
XMLEvent | nextEvent() Get the next XMLEvent
XMLEvent | nextTag() Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached.
XMLEvent | peek() Check the next XMLEvent without reading it from the stream.
void | remove()
void | setParent(XMLEventReader reader) Set the parent of this instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public EventReaderDelegate()
构造没有父过滤器的空过滤器。
英文文档：

EventReaderDelegate

public EventReaderDelegate()
Construct an empty filter with no parent.

public EventReaderDelegate(XMLEventReader reader)
用指定的父过滤器来构造一个过滤器。
reader 父级
英文文档：

EventReaderDelegate

public EventReaderDelegate(XMLEventReader reader)
Construct an filter with the specified parent.

Parameters:
reader - the parent
Method Detail

public void setParent(XMLEventReader reader)
设置此实例的父实例。
reader 新的父实例
英文文档：

setParent

public void setParent(XMLEventReader reader)
Set the parent of this instance.

Parameters:
reader - the new parent

public XMLEventReader getParent()
获取此实例的父实例。
return 父实例；如果没有设置父实例，则返回 null
英文文档：

getParent

public XMLEventReader getParent()
Get the parent of this instance.

Returns:
the parent or null if none is set

public XMLEvent nextEvent() throws XMLStreamException
英文文档：

nextEvent

public XMLEvent nextEvent()
                   throws XMLStreamException
Description copied from interface: XMLEventReader
Get the next XMLEvent

Specified by:
nextEvent in interface XMLEventReader
Throws:
XMLStreamException - if there is an error with the underlying XML.
See Also:
XMLEvent

public Object next()
英文文档：

next

public Object next()
Specified by:
next in interface Iterator

public boolean hasNext()
英文文档：

hasNext

public boolean hasNext()
Description copied from interface: XMLEventReader
Check if there are more events. Returns true if there are more events and false otherwise.

Specified by:
hasNext in interface Iterator
Specified by:
hasNext in interface XMLEventReader
Returns:
true if the event reader has more events, false otherwise

public XMLEvent peek() throws XMLStreamException
英文文档：

peek

public XMLEvent peek()
              throws XMLStreamException
Description copied from interface: XMLEventReader
Check the next XMLEvent without reading it from the stream. Returns null if the stream is at EOF or has no more XMLEvents. A call to peek() will be equal to the next return of next().

Specified by:
peek in interface XMLEventReader
Throws:
XMLStreamException
See Also:
XMLEvent

public void close() throws XMLStreamException
英文文档：

close

public void close()
           throws XMLStreamException
Description copied from interface: XMLEventReader
Frees any resources associated with this Reader. This method does not close the underlying input source.

Specified by:
close in interface XMLEventReader
Throws:
XMLStreamException - if there are errors freeing associated resources

public String getElementText() throws XMLStreamException
英文文档：

getElementText

public String getElementText()
                      throws XMLStreamException
Description copied from interface: XMLEventReader
Reads the content of a text-only element. Precondition: the current event is START_ELEMENT. Postcondition: The current event is the corresponding END_ELEMENT.

Specified by:
getElementText in interface XMLEventReader
Throws:
XMLStreamException - if the current event is not a START_ELEMENT or if a non text element is encountered

public XMLEvent nextTag() throws XMLStreamException
英文文档：

nextTag

public XMLEvent nextTag()
                 throws XMLStreamException
Description copied from interface: XMLEventReader
Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached. If anything other than space characters are encountered, an exception is thrown. This method should be used when processing element-only content because the parser is not able to recognize ignorable whitespace if the DTD is missing or not interpreted.

Specified by:
nextTag in interface XMLEventReader
Throws:
XMLStreamException - if anything other than space characters are encountered

public Object getProperty(String name) throws IllegalArgumentException
英文文档：

getProperty

public Object getProperty(String name)
                   throws IllegalArgumentException
Description copied from interface: XMLEventReader
Get the value of a feature/property from the underlying implementation

Specified by:
getProperty in interface XMLEventReader
Parameters:
name - The name of the property
Returns:
The value of the property
Throws:
IllegalArgumentException - if the property is not supported

public void remove()
英文文档：

remove

public void remove()
Specified by:
remove in interface Iterator
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


StreamReaderDelegate (Java EE 5)

javax.xml.stream.util
Class StreamReaderDelegate

java.lang.Object
    extended by  javax.xml.stream.util.StreamReaderDelegate
All Implemented Interfaces:
XMLStreamConstants, XMLStreamReader
public class StreamReaderDelegate
extends Object
implements XMLStreamReader

Implements: XMLStreamReader

该类是用于派生 XMLStreamReader 过滤器的基类。 此类设计用于 XMLStreamReader 和应用程序的 XMLStreamReader 之间。默认情况下，每种方法除了调用父接口中的相应方法之外，不执行任何操作。
version | 1.0
See also | javax.xml.stream.XMLStreamReader, javax.xml.stream.util.EventReaderDelegate
英文文档：

This is the base class for deriving an XMLStreamReader filter This class is designed to sit between an XMLStreamReader and an application's XMLStreamReader. By default each method does nothing but call the corresponding method on the parent interface.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.
See Also:
XMLStreamReader, EventReaderDelegate

Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Constructor Summary
StreamReaderDelegate()
Construct an empty filter with no parent.
StreamReaderDelegate(XMLStreamReader reader)
Construct an filter with the specified parent.
Method Summary
 void close()
Frees any resources associated with this Reader.
 int getAttributeCount()
Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE.
 String getAttributeLocalName(int index)
Returns the localName of the attribute at the provided index
 QName getAttributeName(int index)
Returns the qname of the attribute at the provided index
 String getAttributeNamespace(int index)
Returns the namespace of the attribute at the provided index
 String getAttributePrefix(int index)
Returns the prefix of this attribute at the provided index
 String getAttributeType(int index)
Returns the XML type of the attribute at the provided index
 String getAttributeValue(int index)
Returns the value of the attribute at the index
 String getAttributeValue(String namespaceUri, String localName)
Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality
 String getCharacterEncodingScheme()
Returns the character encoding declared on the xml declaration Returns null if none was declared
 String getElementText()
Reads the content of a text-only element, an exception is thrown if this is not a text-only element.
 String getEncoding()
Return input encoding if known or null if unknown.
 int getEventType()
Returns an integer code that indicates the type of the event the cursor is pointing to.
 String getLocalName()
Returns the (local) name of the current event.
 Location getLocation()
Return the current location of the processor.
 QName getName()
Returns a QName for the current START_ELEMENT or END_ELEMENT event
 NamespaceContext getNamespaceContext()
Returns a read only namespace context for the current position.
 int getNamespaceCount()
Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE.
 String getNamespacePrefix(int index)
Returns the prefix for the namespace declared at the index.
 String getNamespaceURI()
If the current event is a START_ELEMENT or END_ELEMENT this method returns the URI of the prefix or the default namespace.
 String getNamespaceURI(int index)
Returns the uri for the namespace declared at the index.
 String getNamespaceURI(String prefix)
Return the uri for the given prefix.
 XMLStreamReader getParent()
Get the parent of this instance.
 String getPIData()
Get the data section of a processing instruction
 String getPITarget()
Get the target of a processing instruction
 String getPrefix()
Returns the prefix of the current event or null if the event does not have a prefix
 Object getProperty(String name)
Get the value of a feature/property from the underlying implementation
 String getText()
Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD.
 char[] getTextCharacters()
Returns an array which contains the characters from this event.
 int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
Gets the the text associated with a CHARACTERS, SPACE or CDATA event.
 int getTextLength()
Returns the length of the sequence of characters for this Text event within the text character array.
 int getTextStart()
Returns the offset into the text character array where the first character (of this text event) is stored.
 String getVersion()
Get the xml version declared on the xml declaration Returns null if none was declared
 boolean hasName()
returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT) returns false otherwise
 boolean hasNext()
Returns true if there are more parsing events and false if there are no more events.
 boolean hasText()
Return true if the current event has text, false otherwise The following events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE
 boolean isAttributeSpecified(int index)
Returns a boolean which indicates if this attribute was created by default
 boolean isCharacters()
Returns true if the cursor points to a character data event
 boolean isEndElement()
Returns true if the cursor points to an end tag (otherwise false)
 boolean isStandalone()
Get the standalone declaration from the xml declaration
 boolean isStartElement()
Returns true if the cursor points to a start tag (otherwise false)
 boolean isWhiteSpace()
Returns true if the cursor points to a character data event that consists of all whitespace
 int next()
Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks.
 int nextTag()
Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING_INSTRUCTION, until a START_ELEMENT or END_ELEMENT is reached.
 void require(int type, String namespaceURI, String localName)
Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event.
 void setParent(XMLStreamReader reader)
Set the parent of this instance.
 boolean standaloneSet()
Checks if standalone was set in the document
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public StreamReaderDelegate()
构造没有父过滤器的空过滤器。
英文文档：

StreamReaderDelegate

public StreamReaderDelegate()
Construct an empty filter with no parent.

public StreamReaderDelegate(XMLStreamReader reader)
用指定的父过滤器来构造一个过滤器。
reader 父级
英文文档：

StreamReaderDelegate

public StreamReaderDelegate(XMLStreamReader reader)
Construct an filter with the specified parent.

Parameters:
reader - the parent
Method Detail

public void setParent(XMLStreamReader reader)
设置此实例的父实例。
reader 新的父实例
英文文档：

setParent

public void setParent(XMLStreamReader reader)
Set the parent of this instance.

Parameters:
reader - the new parent

public XMLStreamReader getParent()
获取此实例的父实例。
return 父实例；如果没有设置父实例，则返回 null
英文文档：

getParent

public XMLStreamReader getParent()
Get the parent of this instance.

Returns:
the parent or null if none is set

public int next() throws XMLStreamException
英文文档：

next

public int next()
         throws XMLStreamException
Description copied from interface: XMLStreamReader
Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks. If the property javax.xml.stream.isCoalescing is set to true element content must be coalesced and only one CHARACTERS event must be returned for contiguous element content or CDATA Sections. By default entity references must be expanded and reported transparently to the application. An exception will be thrown if an entity reference cannot be expanded. If element content is empty (i.e. content is "") then no CHARACTERS event will be reported.

Given the following XML:
<foo><!--description-->content text<![CDATA[<greeting>Hello</greeting>]]>other content</foo>
The behavior of calling next() when being on foo will be:
1- the comment (COMMENT)
2- then the characters section (CHARACTERS)
3- then the CDATA section (another CHARACTERS)
4- then the next characters section (another CHARACTERS)
5- then the END_ELEMENT

NOTE: empty element (such as <tag/>) will be reported with two separate events: START_ELEMENT, END_ELEMENT - This preserves parsing equivalency of empty element to <tag></tag>. This method will throw an IllegalStateException if it is called after hasNext() returns false.

Specified by:
next in interface XMLStreamReader
Returns:
the integer code corresponding to the current parse event
Throws:
XMLStreamException - if there is an error processing the underlying XML source
See Also:
XMLEvent

public int nextTag() throws XMLStreamException
英文文档：

nextTag

public int nextTag()
            throws XMLStreamException
Description copied from interface: XMLStreamReader
Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING_INSTRUCTION, until a START_ELEMENT or END_ELEMENT is reached. If other than white space characters, COMMENT, PROCESSING_INSTRUCTION, START_ELEMENT, END_ELEMENT are encountered, an exception is thrown. This method should be used when processing element-only content seperated by white space.
Precondition: none
Postcondition: the current event is START_ELEMENT or END_ELEMENT and cursor may have moved over any whitespace event.
Essentially it does the following (implementations are free to optimized but must do equivalent processing):
 int eventType = next();
 while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
 || (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
 // skip whitespace
 || eventType == XMLStreamConstants.SPACE
 || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
 || eventType == XMLStreamConstants.COMMENT
 ) {
 eventType = next();
 }
 if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
 throw new String XMLStreamException("expected start or end tag", getLocation());
 }
 return eventType;

Specified by:
nextTag in interface XMLStreamReader
Returns:
the event type of the element read (START_ELEMENT or END_ELEMENT)
Throws:
XMLStreamException - if the current event is not white space, PROCESSING_INSTRUCTION, START_ELEMENT or END_ELEMENT

public String getElementText() throws XMLStreamException
英文文档：

getElementText

public String getElementText()
                      throws XMLStreamException
Description copied from interface: XMLStreamReader
Reads the content of a text-only element, an exception is thrown if this is not a text-only element. Regardless of value of javax.xml.stream.isCoalescing this method always returns coalesced content.
Precondition: the current event is START_ELEMENT.
Postcondition: the current event is the corresponding END_ELEMENT.
The method does the following (implementations are free to optimized but must do equivalent processing):
 if(getEventType() != XMLStreamConstants.START_ELEMENT) {
 throw new XMLStreamException(
 "parser must be on START_ELEMENT to read next text", getLocation());
 }
 int eventType = next();
 StringBuffer content = new StringBuffer();
 while(eventType != XMLStreamConstants.END_ELEMENT ) {
 if(eventType == XMLStreamConstants.CHARACTERS
 || eventType == XMLStreamConstants.CDATA
 || eventType == XMLStreamConstants.SPACE
 || eventType == XMLStreamConstants.ENTITY_REFERENCE) {
 buf.append(getText());
 } else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
 || eventType == XMLStreamConstants.COMMENT) {
 // skipping
 } else if(eventType == XMLStreamConstants.END_DOCUMENT) {
 throw new XMLStreamException(
 "unexpected end of document when reading element text content", this);
 } else if(eventType == XMLStreamConstants.START_ELEMENT) {
 throw new XMLStreamException(
 "element text content may not contain START_ELEMENT", getLocation());
 } else {
 throw new XMLStreamException(
 "Unexpected event type "+eventType, getLocation());
 }
 eventType = next();
 }
 return buf.toString();

Specified by:
getElementText in interface XMLStreamReader
Throws:
XMLStreamException - if the current event is not a START_ELEMENT or if a non text element is encountered

public void require(int type, String namespaceURI, String localName) throws XMLStreamException
英文文档：

require

public void require(int type,
                    String namespaceURI,
                    String localName)
             throws XMLStreamException
Description copied from interface: XMLStreamReader
Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event. If the namespaceURI is null it is not checked for equality, if the localName is null it is not checked for equality.

Specified by:
require in interface XMLStreamReader
Parameters:
type - the event type
namespaceURI - the uri of the event, may be null
localName - the localName of the event, may be null
Throws:
XMLStreamException - if the required values are not matched.

public boolean hasNext() throws XMLStreamException
英文文档：

hasNext

public boolean hasNext()
                throws XMLStreamException
Description copied from interface: XMLStreamReader
Returns true if there are more parsing events and false if there are no more events. This method will return false if the current state of the XMLStreamReader is END_DOCUMENT

Specified by:
hasNext in interface XMLStreamReader
Returns:
true if there are more events, false otherwise
Throws:
XMLStreamException - if there is a fatal error detecting the next state

public void close() throws XMLStreamException
英文文档：

close

public void close()
           throws XMLStreamException
Description copied from interface: XMLStreamReader
Frees any resources associated with this Reader. This method does not close the underlying input source.

Specified by:
close in interface XMLStreamReader
Throws:
XMLStreamException - if there are errors freeing associated resources

public String getNamespaceURI(String prefix)
英文文档：

getNamespaceURI

public String getNamespaceURI(String prefix)
Description copied from interface: XMLStreamReader
Return the uri for the given prefix. The uri returned depends on the current state of the processor.

NOTE:The 'xml' prefix is bound as defined in Namespaces in XML specification to "http://www.w3.org/XML/1998/namespace".

NOTE: The 'xmlns' prefix must be resolved to following namespace http://www.w3.org/2000/xmlns/

Specified by:
getNamespaceURI in interface XMLStreamReader
Parameters:
prefix - The prefix to lookup, may not be null
Returns:
the uri bound to the given prefix or null if it is not bound

public javax.xml.namespace.NamespaceContext getNamespaceContext()
英文文档：

getNamespaceContext

public NamespaceContext getNamespaceContext()
Description copied from interface: XMLStreamReader
Returns a read only namespace context for the current position. The context is transient and only valid until a call to next() changes the state of the reader.

Specified by:
getNamespaceContext in interface XMLStreamReader
Returns:
return a namespace context

public boolean isStartElement()
英文文档：

isStartElement

public boolean isStartElement()
Description copied from interface: XMLStreamReader
Returns true if the cursor points to a start tag (otherwise false)

Specified by:
isStartElement in interface XMLStreamReader
Returns:
true if the cursor points to a start tag, false otherwise

public boolean isEndElement()
英文文档：

isEndElement

public boolean isEndElement()
Description copied from interface: XMLStreamReader
Returns true if the cursor points to an end tag (otherwise false)

Specified by:
isEndElement in interface XMLStreamReader
Returns:
true if the cursor points to an end tag, false otherwise

public boolean isCharacters()
英文文档：

isCharacters

public boolean isCharacters()
Description copied from interface: XMLStreamReader
Returns true if the cursor points to a character data event

Specified by:
isCharacters in interface XMLStreamReader
Returns:
true if the cursor points to character data, false otherwise

public boolean isWhiteSpace()
英文文档：

isWhiteSpace

public boolean isWhiteSpace()
Description copied from interface: XMLStreamReader
Returns true if the cursor points to a character data event that consists of all whitespace

Specified by:
isWhiteSpace in interface XMLStreamReader
Returns:
true if the cursor points to all whitespace, false otherwise

public String getAttributeValue(String namespaceUri, String localName)
英文文档：

getAttributeValue

public String getAttributeValue(String namespaceUri,
                                String localName)
Description copied from interface: XMLStreamReader
Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality

Specified by:
getAttributeValue in interface XMLStreamReader
Parameters:
namespaceUri - the namespace of the attribute
localName - the local name of the attribute, cannot be null
Returns:
returns the value of the attribute , returns null if not found

public int getAttributeCount()
英文文档：

getAttributeCount

public int getAttributeCount()
Description copied from interface: XMLStreamReader
Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE. This count excludes namespace definitions. Attribute indices are zero-based.

Specified by:
getAttributeCount in interface XMLStreamReader
Returns:
returns the number of attributes

public javax.xml.namespace.QName getAttributeName(int index)
英文文档：

getAttributeName

public QName getAttributeName(int index)
Description copied from interface: XMLStreamReader
Returns the qname of the attribute at the provided index

Specified by:
getAttributeName in interface XMLStreamReader
Parameters:
index - the position of the attribute
Returns:
the QName of the attribute

public String getAttributePrefix(int index)
英文文档：

getAttributePrefix

public String getAttributePrefix(int index)
Description copied from interface: XMLStreamReader
Returns the prefix of this attribute at the provided index

Specified by:
getAttributePrefix in interface XMLStreamReader
Parameters:
index - the position of the attribute
Returns:
the prefix of the attribute

public String getAttributeNamespace(int index)
英文文档：

getAttributeNamespace

public String getAttributeNamespace(int index)
Description copied from interface: XMLStreamReader
Returns the namespace of the attribute at the provided index

Specified by:
getAttributeNamespace in interface XMLStreamReader
Parameters:
index - the position of the attribute
Returns:
the namespace URI (can be null)

public String getAttributeLocalName(int index)
英文文档：

getAttributeLocalName

public String getAttributeLocalName(int index)
Description copied from interface: XMLStreamReader
Returns the localName of the attribute at the provided index

Specified by:
getAttributeLocalName in interface XMLStreamReader
Parameters:
index - the position of the attribute
Returns:
the localName of the attribute

public String getAttributeType(int index)
英文文档：

getAttributeType

public String getAttributeType(int index)
Description copied from interface: XMLStreamReader
Returns the XML type of the attribute at the provided index

Specified by:
getAttributeType in interface XMLStreamReader
Parameters:
index - the position of the attribute
Returns:
the XML type of the attribute

public String getAttributeValue(int index)
英文文档：

getAttributeValue

public String getAttributeValue(int index)
Description copied from interface: XMLStreamReader
Returns the value of the attribute at the index

Specified by:
getAttributeValue in interface XMLStreamReader
Parameters:
index - the position of the attribute
Returns:
the attribute value

public boolean isAttributeSpecified(int index)
英文文档：

isAttributeSpecified

public boolean isAttributeSpecified(int index)
Description copied from interface: XMLStreamReader
Returns a boolean which indicates if this attribute was created by default

Specified by:
isAttributeSpecified in interface XMLStreamReader
Parameters:
index - the position of the attribute
Returns:
true if this is a default attribute

public int getNamespaceCount()
英文文档：

getNamespaceCount

public int getNamespaceCount()
Description copied from interface: XMLStreamReader
Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. On an END_ELEMENT the count is of the namespaces that are about to go out of scope. This is the equivalent of the information reported by SAX callback for an end element event.

Specified by:
getNamespaceCount in interface XMLStreamReader
Returns:
returns the number of namespace declarations on this specific element

public String getNamespacePrefix(int index)
英文文档：

getNamespacePrefix

public String getNamespacePrefix(int index)
Description copied from interface: XMLStreamReader
Returns the prefix for the namespace declared at the index. Returns null if this is the default namespace declaration

Specified by:
getNamespacePrefix in interface XMLStreamReader
Parameters:
index - the position of the namespace declaration
Returns:
returns the namespace prefix

public String getNamespaceURI(int index)
英文文档：

getNamespaceURI

public String getNamespaceURI(int index)
Description copied from interface: XMLStreamReader
Returns the uri for the namespace declared at the index.

Specified by:
getNamespaceURI in interface XMLStreamReader
Parameters:
index - the position of the namespace declaration
Returns:
returns the namespace uri

public int getEventType()
英文文档：

getEventType

public int getEventType()
Description copied from interface: XMLStreamReader
Returns an integer code that indicates the type of the event the cursor is pointing to.

Specified by:
getEventType in interface XMLStreamReader

public String getText()
英文文档：

getText

public String getText()
Description copied from interface: XMLStreamReader
Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. If an ENTITY_REFERENCE has been resolved, any character data will be reported as CHARACTERS events.

Specified by:
getText in interface XMLStreamReader
Returns:
the current text or null

public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException
英文文档：

getTextCharacters

public int getTextCharacters(int sourceStart,
                             char[] target,
                             int targetStart,
                             int length)
                      throws XMLStreamException
Description copied from interface: XMLStreamReader
Gets the the text associated with a CHARACTERS, SPACE or CDATA event. Text starting a "sourceStart" is copied into "target" starting at "targetStart". Up to "length" characters are copied. The number of characters actually copied is returned. The "sourceStart" argument must be greater or equal to 0 and less than or equal to the number of characters associated with the event. Usually, one requests text starting at a "sourceStart" of 0. If the number of characters actually copied is less than the "length", then there is no more text. Otherwise, subsequent calls need to be made until all text has been retrieved. For example:
int length = 1024;
char[] myBuffer = new char[ length ];

for ( int sourceStart = 0 ; ; sourceStart += length )
{
   int nCopied = stream.getTextCharacters( sourceStart, myBuffer, 0, length );

  if (nCopied < length)
      break;
}
 XMLStreamException may be thrown if there are any XML errors in the underlying source. The "targetStart" argument must be greater than or equal to 0 and less than the length of "target", Length must be greater than 0 and "targetStart + length" must be less than or equal to length of "target".

Specified by:
getTextCharacters in interface XMLStreamReader
Parameters:
sourceStart - the index of the first character in the source array to copy
target - the destination array
targetStart - the start offset in the target array
length - the number of characters to copy
Returns:
the number of characters actually copied
Throws:
XMLStreamException - if the underlying XML source is not well-formed

public char[] getTextCharacters()
英文文档：

getTextCharacters

public char[] getTextCharacters()
Description copied from interface: XMLStreamReader
Returns an array which contains the characters from this event. This array should be treated as read-only and transient. I.e. the array will contain the text characters until the XMLStreamReader moves on to the next event. Attempts to hold onto the character array beyond that time or modify the contents of the array are breaches of the contract for this interface.

Specified by:
getTextCharacters in interface XMLStreamReader
Returns:
the current text or an empty array

public int getTextStart()
英文文档：

getTextStart

public int getTextStart()
Description copied from interface: XMLStreamReader
Returns the offset into the text character array where the first character (of this text event) is stored.

Specified by:
getTextStart in interface XMLStreamReader

public int getTextLength()
英文文档：

getTextLength

public int getTextLength()
Description copied from interface: XMLStreamReader
Returns the length of the sequence of characters for this Text event within the text character array.

Specified by:
getTextLength in interface XMLStreamReader

public String getEncoding()
英文文档：

getEncoding

public String getEncoding()
Description copied from interface: XMLStreamReader
Return input encoding if known or null if unknown.

Specified by:
getEncoding in interface XMLStreamReader
Returns:
the encoding of this instance or null

public boolean hasText()
英文文档：

hasText

public boolean hasText()
Description copied from interface: XMLStreamReader
Return true if the current event has text, false otherwise The following events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE

Specified by:
hasText in interface XMLStreamReader

public Location getLocation()
英文文档：

getLocation

public Location getLocation()
Description copied from interface: XMLStreamReader
Return the current location of the processor. If the Location is unknown the processor should return an implementation of Location that returns -1 for the location and null for the publicId and systemId. The location information is only valid until next() is called.

Specified by:
getLocation in interface XMLStreamReader

public javax.xml.namespace.QName getName()
英文文档：

getName

public QName getName()
Description copied from interface: XMLStreamReader
Returns a QName for the current START_ELEMENT or END_ELEMENT event

Specified by:
getName in interface XMLStreamReader
Returns:
the QName for the current START_ELEMENT or END_ELEMENT event

public String getLocalName()
英文文档：

getLocalName

public String getLocalName()
Description copied from interface: XMLStreamReader
Returns the (local) name of the current event. For START_ELEMENT or END_ELEMENT returns the (local) name of the current element. For ENTITY_REFERENCE it returns entity name. The current event must be START_ELEMENT or END_ELEMENT, or ENTITY_REFERENCE

Specified by:
getLocalName in interface XMLStreamReader
Returns:
the localName

public boolean hasName()
英文文档：

hasName

public boolean hasName()
Description copied from interface: XMLStreamReader
returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT) returns false otherwise

Specified by:
hasName in interface XMLStreamReader

public String getNamespaceURI()
英文文档：

getNamespaceURI

public String getNamespaceURI()
Description copied from interface: XMLStreamReader
If the current event is a START_ELEMENT or END_ELEMENT this method returns the URI of the prefix or the default namespace. Returns null if the event does not have a prefix.

Specified by:
getNamespaceURI in interface XMLStreamReader
Returns:
the URI bound to this elements prefix, the default namespace, or null

public String getPrefix()
英文文档：

getPrefix

public String getPrefix()
Description copied from interface: XMLStreamReader
Returns the prefix of the current event or null if the event does not have a prefix

Specified by:
getPrefix in interface XMLStreamReader
Returns:
the prefix or null

public String getVersion()
英文文档：

getVersion

public String getVersion()
Description copied from interface: XMLStreamReader
Get the xml version declared on the xml declaration Returns null if none was declared

Specified by:
getVersion in interface XMLStreamReader
Returns:
the XML version or null

public boolean isStandalone()
英文文档：

isStandalone

public boolean isStandalone()
Description copied from interface: XMLStreamReader
Get the standalone declaration from the xml declaration

Specified by:
isStandalone in interface XMLStreamReader
Returns:
true if this is standalone, or false otherwise

public boolean standaloneSet()
英文文档：

standaloneSet

public boolean standaloneSet()
Description copied from interface: XMLStreamReader
Checks if standalone was set in the document

Specified by:
standaloneSet in interface XMLStreamReader
Returns:
true if standalone was set in the document, or false otherwise

public String getCharacterEncodingScheme()
英文文档：

getCharacterEncodingScheme

public String getCharacterEncodingScheme()
Description copied from interface: XMLStreamReader
Returns the character encoding declared on the xml declaration Returns null if none was declared

Specified by:
getCharacterEncodingScheme in interface XMLStreamReader
Returns:
the encoding declared in the document or null

public String getPITarget()
英文文档：

getPITarget

public String getPITarget()
Description copied from interface: XMLStreamReader
Get the target of a processing instruction

Specified by:
getPITarget in interface XMLStreamReader
Returns:
the target or null

public String getPIData()
英文文档：

getPIData

public String getPIData()
Description copied from interface: XMLStreamReader
Get the data section of a processing instruction

Specified by:
getPIData in interface XMLStreamReader
Returns:
the data or null

public Object getProperty(String name)
英文文档：

getProperty

public Object getProperty(String name)
Description copied from interface: XMLStreamReader
Get the value of a feature/property from the underlying implementation

Specified by:
getProperty in interface XMLStreamReader
Parameters:
name - The name of the property, may not be null
Returns:
The value of the property
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.ws (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.ws

This package contains the core JAX-WS APIs.

See:
Description

Interface Summary
AsyncHandler<T> | The AsyncHandler interface is implemented by clients that wish to receive callback notification of the completion of service endpoint operations invoked asynchronously.
Binding | The Binding interface is the base interface for JAX-WS protocol bindings.
BindingProvider | The BindingProvider interface provides access to the protocol binding and associated context objects for request and response message processing.
Dispatch<T> | The Dispatch interface provides support for the dynamic invocation of a service endpoint operations.
LogicalMessage | The LogicalMessage interface represents a protocol agnostic XML message and contains methods that provide access to the payload of the message.
Provider<T> | Service endpoints may implement the Provider interface as a dynamic alternative to an SEI.
Response<T> | The Response interface provides methods used to obtain the payload and context of a message sent in response to an operation invocation.
WebServiceContext | A WebServiceContext makes it possible for a web service endpoint implementation class to access message context and security information relative to a request being served.

Class Summary
Endpoint | A Web service endpoint.
Holder<T> | Holds a value of type T.
Service | Service objects provide the client view of a Web service.
WebServicePermission | This class defines web service permissions.

Enum Summary
Service.Mode The orientation of a dynamic client or service.

Exception Summary
ProtocolException | The ProtocolException class is a base class for exceptions related to a specific protocol binding.
WebServiceException | The WebServiceException class is the base exception class for all JAX-WS API runtime exceptions.

Annotation Types Summary
BindingType | The BindingType annotation is used to specify the binding to use for a web service endpoint implementation class.
RequestWrapper | Used to annotate methods in the Service Endpoint Interface with the request wrapper bean to be used at runtime.
ResponseWrapper | Used to annotate methods in the Service Endpoint Interface with the response wrapper bean to be used at runtime.
ServiceMode | Used to indicate whether a Provider implementation wishes to work with entire protocol messages or just with protocol message payloads.
WebEndpoint | Used to annotate the getPortName() methods of a generated service interface.
WebFault | Used to annotate service specific exception classes to customize to the local and namespace name of the fault element and the name of the fault bean.
WebServiceClient | Used to annotate a generated service interface.
WebServiceProvider | Used to annotate a Provider implementation class.
WebServiceRef | The WebServiceRef annotation is used to define a reference to a web service and (optionally) an injection target for it.
WebServiceRefs | The WebServiceRefs annotation allows multiple web service references to be declared at the class level.

Package javax.xml.ws Description

This package contains the core JAX-WS APIs.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.ws Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.ws

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.ws.Endpoint
    • javax.xml.ws.Holder<T>
    • java.security.Permission (implements java.security.Guard, java.io.Serializable)
      • java.security.BasicPermission (implements java.io.Serializable)
        • javax.xml.ws.WebServicePermission
    • javax.xml.ws.Service
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.xml.ws.WebServiceException
            • javax.xml.ws.ProtocolException

Interface Hierarchy

  • javax.xml.ws.AsyncHandler<T>
  • javax.xml.ws.Binding
  • javax.xml.ws.BindingProvider
    • javax.xml.ws.Dispatch<T>
  • java.util.concurrent.Future<V>
    • javax.xml.ws.Response<T>
  • javax.xml.ws.LogicalMessage
  • javax.xml.ws.Provider<T>
  • javax.xml.ws.WebServiceContext

Annotation Type Hierarchy

  • javax.xml.ws.BindingType (implements java.lang.annotation.Annotation)
  • javax.xml.ws.RequestWrapper (implements java.lang.annotation.Annotation)
  • javax.xml.ws.ResponseWrapper (implements java.lang.annotation.Annotation)
  • javax.xml.ws.ServiceMode (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebEndpoint (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebFault (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceClient (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceProvider (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceRef (implements java.lang.annotation.Annotation)
  • javax.xml.ws.WebServiceRefs (implements java.lang.annotation.Annotation)

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.xml.ws.Service.Mode
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


AsyncHandler (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws
Interface AsyncHandler<T>

public interface AsyncHandler<T>

AsyncHandler 接口由希望接收关于完成了异步调用服务端点操作的回调通知的客户端实现。
since JAX-WS 2.0
英文文档：

The AsyncHandler interface is implemented by clients that wish to receive callback notification of the completion of service endpoint operations invoked asynchronously.

Since:
JAX-WS 2.0

Method Summary
 void handleResponse(Response<T> res)
Called when the response to an asynchronous operation is available.

Method Detail

英文文档：

handleResponse

void handleResponse(Response<T> res)
Called when the response to an asynchronous operation is available.

Parameters:
res - The response to the operation invocation.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


Binding (Java EE 5)

javax.xml.ws
Interface Binding

All Known Subinterfaces:
HTTPBinding, SOAPBinding
public interface Binding

Implemented by: HTTPBinding, SOAPBinding

Binding 接口是 JAX-WS 协议绑定的基本接口。
since JAX-WS 2.0
英文文档：

The Binding interface is the base interface for JAX-WS protocol bindings.

Since:
JAX-WS 2.0

Method Summary
List<Handler> | getHandlerChain() Gets a copy of the handler chain for a protocol binding instance.
void | setHandlerChain(List<Handler> chain) Sets the handler chain for the protocol binding instance.

Method Detail

public java.util.List<E> getHandlerChain()
获取协议绑定实例处理程序链的副本。如果返回的链已修改，则需要调用 setHandlerChain 以使用新链配置绑定实例。
return java.util.List Handler 链
英文文档：

getHandlerChain

List<Handler> getHandlerChain()
Gets a copy of the handler chain for a protocol binding instance. If the returned chain is modified a call to setHandlerChain is required to configure the binding instance with the new chain.

Returns:
java.util.List Handler chain

英文文档：

setHandlerChain

void setHandlerChain(List<Handler> chain)
Sets the handler chain for the protocol binding instance.

Parameters:
chain - A List of handler configuration entries
Throws:
WebServiceException - On an error in the configuration of the handler chain
UnsupportedOperationException - If this operation is not supported. This may be done to avoid any overriding of a pre-configured handler chain.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BindingProvider (Java EE 5)

javax.xml.ws
Interface BindingProvider

All Known Subinterfaces:
Dispatch<T>
public interface BindingProvider

Implemented by: Dispatch

BindingProvider 接口提供对用于请求和响应消息处理的协议绑定及关联上下文对象的访问。
since | JAX-WS 2.0
See also | javax.xml.ws.Binding
英文文档：

The BindingProvider interface provides access to the protocol binding and associated context objects for request and response message processing.

Since:
JAX-WS 2.0
See Also:
Binding

Field Summary
static String | ENDPOINT_ADDRESS_PROPERTY Standard property: Target service endpoint address.
static String | PASSWORD_PROPERTY Standard property: Password for authentication.
static String | SESSION_MAINTAIN_PROPERTY Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint.
static String | SOAPACTION_URI_PROPERTY Standard property for SOAPAction.
static String | SOAPACTION_USE_PROPERTY Standard property for SOAPAction.
static String | USERNAME_PROPERTY Standard property: User name for authentication.
Method Summary
Binding | getBinding() Get the Binding for this binding provider.
Map<String,Object> | getRequestContext() Get the context that is used to initialize the message context for request messages.
Map<String,Object> | getResponseContext() Get the context that resulted from processing a response message.

Field Detail

英文文档：

USERNAME_PROPERTY

static final String USERNAME_PROPERTY
Standard property: User name for authentication.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

PASSWORD_PROPERTY

static final String PASSWORD_PROPERTY
Standard property: Password for authentication.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

ENDPOINT_ADDRESS_PROPERTY

static final String ENDPOINT_ADDRESS_PROPERTY
Standard property: Target service endpoint address. The URI scheme for the endpoint address specification must correspond to the protocol/transport binding for the binding in use.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

SESSION_MAINTAIN_PROPERTY

static final String SESSION_MAINTAIN_PROPERTY
Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint. If this property is set to true, the service client indicates that it wants the session to be maintained. If set to false, the session is not maintained. The default value for this property is false.

Type: java.lang.Boolean

See Also:
Constant Field Values

英文文档：

SOAPACTION_USE_PROPERTY

static final String SOAPACTION_USE_PROPERTY
Standard property for SOAPAction. This boolean property indicates whether or not SOAPAction is to be used. The default value of this property is false indicating that the SOAPAction is not used.

Type: java.lang.Boolean

See Also:
Constant Field Values

英文文档：

SOAPACTION_URI_PROPERTY

static final String SOAPACTION_URI_PROPERTY
Standard property for SOAPAction. Indicates the SOAPAction URI if the javax.xml.ws.soap.http.soapaction.use property is set to true.

Type: java.lang.String

See Also:
Constant Field Values
Method Detail

public java.util.Map<K, V> getRequestContext()
获取用于初始化请求消息的消息上下文的上下文。 对请求上下文进行的修改并不影响已经启动的同步或异步操作的消息上下文。
return 在处理请求消息的过程中使用的上下文。
英文文档：

getRequestContext

Map<String,Object> getRequestContext()
Get the context that is used to initialize the message context for request messages. Modifications to the request context do not affect the message context of either synchronous or asynchronous operations that have already been started.

Returns:
The context that is used in processing request messages.

public java.util.Map<K, V> getResponseContext()
获取处理响应消息所得的上下文。 返回的上下文用于最新完成的同步操作。随后的同步操作调用重写响应上下文。异步操作通过 Response 接口返回它们的响应上下文。
return 处理最新响应消息所得的上下文。
英文文档：

getResponseContext

Map<String,Object> getResponseContext()
Get the context that resulted from processing a response message. The returned context is for the most recently completed synchronous operation. Subsequent synchronous operation invocations overwrite the response context. Asynchronous operations return their response context via the Response interface.

Returns:
The context that resulted from processing the latest response messages.

public Binding getBinding()
获取此绑定提供者的 Binding。
return 此绑定提供者的 Binding。
英文文档：

getBinding

Binding getBinding()
Get the Binding for this binding provider.

Returns:
The Binding for this binding provider.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Dispatch (Java EE 5)

javax.xml.ws
Interface Dispatch<T>

All Superinterfaces:
BindingProvider
public interface Dispatch<T>
extends BindingProvider

Implements: BindingProvider

Dispatch 接口提供对动态调用服务端点操作的支持。javax.xml.ws.Service 接口作为创建 Dispatch 实例的工厂。
since JAX-WS 2.0
英文文档：

The Dispatch interface provides support for the dynamic invocation of a service endpoint operations. The javax.xml.ws.Service interface acts as a factory for the creation of Dispatch instances.

Since:
JAX-WS 2.0

Field Summary
Fields inherited from interface javax.xml.ws.BindingProvider
ENDPOINT_ADDRESS_PROPERTY, PASSWORD_PROPERTY, SESSION_MAINTAIN_PROPERTY, SOAPACTION_URI_PROPERTY, SOAPACTION_USE_PROPERTY, USERNAME_PROPERTY
Method Summary
T | invoke(T msg) Invoke a service operation synchronously.
Response<T> | invokeAsync(T msg) Invoke a service operation asynchronously.
Future<?> | invokeAsync(T msg, AsyncHandler<T> handler) Invoke a service operation asynchronously.
void | invokeOneWay(T msg) Invokes a service operation using the one-way interaction mode.
Methods inherited from interface javax.xml.ws.BindingProvider
getBinding, getRequestContext, getResponseContext

Method Detail

英文文档：

invoke

T invoke(T msg)
Invoke a service operation synchronously. The client is responsible for ensuring that the msg object when marshalled is formed according to the requirements of the protocol binding in use.

Parameters:
msg - An object that will form the message or payload of the message used to invoke the operation.
Returns:
The response message or message payload to the operation invocation.
Throws:
WebServiceException - If a fault occurs during communication with the service
WebServiceException - If there is any error in the configuration of the Dispatch instance

英文文档：

invokeAsync

Response<T> invokeAsync(T msg)
Invoke a service operation asynchronously. The method returns without waiting for the response to the operation invocation, the results of the operation are obtained by polling the returned Response. The client is responsible for ensuring that the msg object when marshalled is formed according to the requirements of the protocol binding in use.

Parameters:
msg - An object that will form the message or payload of the message used to invoke the operation.
Returns:
The response message or message payload to the operation invocation.
Throws:
WebServiceException - If there is any error in the configuration of the Dispatch instance

英文文档：

invokeAsync

Future<?> invokeAsync(T msg,
                      AsyncHandler<T> handler)
Invoke a service operation asynchronously. The method returns without waiting for the response to the operation invocation, the results of the operation are communicated to the client via the passed in handler. The client is responsible for ensuring that the msg object when marshalled is formed according to the requirements of the protocol binding in use.

Parameters:
msg - An object that will form the message or payload of the message used to invoke the operation.
handler - The handler object that will receive the response to the operation invocation.
Returns:
A Future object that may be used to check the status of the operation invocation. This object must not be used to try to obtain the results of the operation - the object returned from Future.get() is implementation dependent and any use of it will result in non-portable behaviour.
Throws:
WebServiceException - If there is any error in the configuration of the Dispatch instance

英文文档：

invokeOneWay

void invokeOneWay(T msg)
Invokes a service operation using the one-way interaction mode. The operation invocation is logically non-blocking, subject to the capabilities of the underlying protocol, no results are returned. When the protocol in use is SOAP/HTTP, this method must block until an HTTP response code has been received or an error occurs. The client is responsible for ensuring that the msg object when marshalled is formed according to the requirements of the protocol binding in use.

Parameters:
msg - An object that will form the message or payload of the message used to invoke the operation.
Throws:
WebServiceException - If there is any error in the configuration of the Dispatch instance or if an error occurs during the invocation.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LogicalMessage (Java EE 5)

javax.xml.ws
Interface LogicalMessage

public interface LogicalMessage

LogicalMessage 接口表示协议无关的 (protocol agnostic) XML 消息，并包含一些方法提供对消息负载的访问。
since JAX-WS 2.0
英文文档：

The LogicalMessage interface represents a protocol agnostic XML message and contains methods that provide access to the payload of the message.

Since:
JAX-WS 2.0

Method Summary
Source | getPayload() Gets the message payload as an XML source, may be called multiple times on the same LogicalMessage instance, always returns a new Source that may be used to retrieve the entire message payload.
Object | getPayload(JAXBContext context) Gets the message payload as a JAXB object.
void | setPayload(Object payload, JAXBContext context) Sets the message payload
void | setPayload(Source payload) Sets the message payload

Method Detail

public javax.xml.transform.Source getPayload()
以 XML 源的形式获取消息负载，可以在相同的 LogicalMessage 实例上多次调用，总是返回可以用来检索整个消息负载的新的 Source。

如果返回的 Source 是 DOMSource 的实例，则对封装的 DOM 树的修改现场更改消息负载，不需要随后调用 setPayload。其他类型的 Source 只提供对消息负载的读取访问。

return 所含的消息负载；如果此消息中没有净荷，则返回 null。
英文文档：

getPayload

Source getPayload()
Gets the message payload as an XML source, may be called multiple times on the same LogicalMessage instance, always returns a new Source that may be used to retrieve the entire message payload.

If the returned Source is an instance of DOMSource, then modifications to the encapsulated DOM tree change the message payload in-place, there is no need to susequently call setPayload. Other types of Source provide only read access to the message payload.

Returns:
The contained message payload; returns null if no payload is present in this message.

public void setPayload(javax.xml.transform.Source payload)
设置消息负载
payload | 消息负载
Throws | WebServiceException: 如果在此消息中设置净荷过程中发生任何错误
Throws | UnsupportedOperationException: 如果此操作不受支持
英文文档：

setPayload

void setPayload(Source payload)
Sets the message payload

Parameters:
payload - message payload
Throws:
WebServiceException - If any error during the setting of the payload in this message
UnsupportedOperationException - If this operation is not supported

public Object getPayload(JAXBContext context)
以 JAXB 对象的形式获取消息负载。注意，返回的对象和消息负载之间没有任何连接，更改净荷需要调用 setPayload。
context | 应该用来解组消息负载的 JAXBContext
return | 所含的消息负载；如果此消息中没有净荷，则返回 null
Throws | WebServiceException: 如果使用提供的 JAXBContext 解组净荷时发生错误。WebServiceException 的 cause 是初始 JAXBException。
英文文档：

getPayload

Object getPayload(JAXBContext context)
Gets the message payload as a JAXB object. Note that there is no connection between the returned object and the message payload, changes to the payload require calling setPayload.

Parameters:
context - The JAXBContext that should be used to unmarshall the message payload
Returns:
The contained message payload; returns null if no payload is present in this message
Throws:
WebServiceException - If an error occurs when using a supplied JAXBContext to unmarshall the payload. The cause of the WebServiceException is the original JAXBException.

public void setPayload(Object payload, JAXBContext context)
设置消息负载
payload | 消息负载
context | 应该用来对净荷进行编组的 JAXBContext
Throws | UnsupportedOperationException: 如果此操作不受支持
Throws | WebServiceException: 如果在使用提供的 JAXBContext 对净荷进行编组时发生错误。WebServiceException 的 cause 是初始 JAXBException。
英文文档：

setPayload

void setPayload(Object payload,
                JAXBContext context)
Sets the message payload

Parameters:
payload - message payload
context - The JAXBContext that should be used to marshall the payload
Throws:
UnsupportedOperationException - If this operation is not supported
WebServiceException - If an error occurs when using the supplied JAXBContext to marshall the payload. The cause of the WebServiceException is the original JAXBException.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Provider (Java EE 5)

javax.xml.ws
Interface Provider<T>

public interface Provider<T>

服务端点可以将 Provider 接口作为 SEI 的动态替代方法实现。要求实现支持 Provider<Source> 和 Provider<SOAPMessage>。 ServiceMode 注释可以用来控制 Provider 实例是收到整个协议消息还是只收到消息有效载荷。
since | JAX-WS 2.0
See also | javax.xml.transform.Source, javax.xml.soap.SOAPMessage, javax.xml.ws.ServiceMode
英文文档：

Service endpoints may implement the Provider interface as a dynamic alternative to an SEI. Implementations are required to support Provider<Source> and Provider<SOAPMessage>. The ServiceMode annotation can be used to control whether the Provider instance will receive entire protocol messages or just message payloads.

Since:
JAX-WS 2.0
See Also:
Source, SOAPMessage, ServiceMode

Method Summary
 T invoke(T request)
Invokes an operation occording to the contents of the request message.

Method Detail

英文文档：

invoke

T invoke(T request)
Invokes an operation occording to the contents of the request message.

Parameters:
request - The request message or message payload.
Returns:
The response message or message payload. May be null if there is no response.
Throws:
WebServiceException - if there is an error processing request. The cause of the WebServiceException may be set to a subclass of ProtocolException to control the protocol level representation of the exception.
See Also:
MessageContext, ProtocolException
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Response (Java EE 5)

javax.xml.ws
Interface Response<T>

All Superinterfaces:
Future<T>
public interface Response<T>
extends Future<T>

Implements: java.util.concurrent.Future<V>

Response 接口提供一些方法，用来获得为响应操作调用而发送的消息的净荷和上下文。

针对异步操作调用，它还提供了其他一些方法来检查请求状态。get(...) 方法可能抛出一组标准异常，这些异常的 cause 可能是 RemoteException 或 WebServiceException，表示在异步方法调用的过程中发生错误。

since JAX-WS 2.0
英文文档：

The Response interface provides methods used to obtain the payload and context of a message sent in response to an operation invocation.

For asynchronous operation invocations it provides additional methods to check the status of the request. The get(...) methods may throw the standard set of exceptions and their cause may be a RemoteException or a WebServiceException that represents the error that occured during the asynchronous method invocation.

Since:
JAX-WS 2.0

Method Summary
 Map<String,Object> getContext()
Gets the contained response context.
Methods inherited from interface java.util.concurrent.Future
cancel, get, get, isCancelled, isDone

Method Detail

public java.util.Map<K, V> getContext()
获取所含的响应上下文。
return 所含的响应上下文。如果响应尚不可用，则返回 null。
英文文档：

getContext

Map<String,Object> getContext()
Gets the contained response context.

Returns:
The contained response context. May be null if a response is not yet available.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebServiceContext (Java EE 5)

javax.xml.ws
Interface WebServiceContext

public interface WebServiceContext

WebServiceContext 能使 Web 服务端点实现类访问与服务的请求有关的消息上下文和安全信息。 通常，使用 Resource 注释将 WebServiceContext 注入到端点实现类中。
since | JAX-WS 2.0
See also | javax.annotation.Resource
英文文档：

A WebServiceContext makes it possible for a web service endpoint implementation class to access message context and security information relative to a request being served. Typically a WebServiceContext is injected into an endpoint implementation class using the Resource annotation.

Since:
JAX-WS 2.0
See Also:
Resource

Method Summary
MessageContext | getMessageContext() Returns the MessageContext for the request being served at the time this method is called.
Principal | getUserPrincipal() Returns the Principal that identifies the sender of the request currently being serviced.
boolean | isUserInRole(String role) Returns a boolean indicating whether the authenticated user is included in the specified logical role.

Method Detail

public MessageContext getMessageContext()
调用此方法时，返回正在服务的请求的 MessageContext。应用程序只能看到具有 APPLICATION 作用域的属性。
return | MessageContext 消息上下文。
Throws | IllegalStateException: 如果调用该方法但不存在任何正被服务的请求，则抛出该异常。
See also | javax.xml.ws.handler.MessageContext, javax.xml.ws.handler.MessageContext.Scope, java.lang.IllegalStateException
英文文档：

getMessageContext

MessageContext getMessageContext()
Returns the MessageContext for the request being served at the time this method is called. Only properties with APPLICATION scope will be visible to the application.

Returns:
MessageContext The message context.
Throws:
IllegalStateException - This exception is thrown if the method is called while no request is being serviced.
See Also:
MessageContext, MessageContext.Scope, IllegalStateException

public java.security.Principal getUserPrincipal()
返回标识当前正服务请求发送方的 Principal。如果发送方没有经过验证，则该方法返回 null。
return | Principal 主体对象。
Throws | IllegalStateException: 如果调用该方法但不存在任何正被服务的请求，则抛出该异常。
See also | java.security.Principal, java.lang.IllegalStateException
英文文档：

getUserPrincipal

Principal getUserPrincipal()
Returns the Principal that identifies the sender of the request currently being serviced. If the sender has not been authenticated, the method returns null.

Returns:
Principal The principal object.
Throws:
IllegalStateException - This exception is thrown if the method is called while no request is being serviced.
See Also:
Principal, IllegalStateException

public boolean isUserInRole(String role)
返回一个布尔值，指示指定的逻辑角色中是否包含经过验证的用户。如果用户没有经过验证，则该方法返回 false。
role | 指定角色名称的 String
return | 一个 boolean 值，指示请求的发送方是否属于给定角色
Throws | IllegalStateException: 如果调用该方法但不存在任何正被服务的请求，则抛出该异常。
英文文档：

isUserInRole

boolean isUserInRole(String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical role. If the user has not been authenticated, the method returns false.

Parameters:
role - A String specifying the name of the role
Returns:
a boolean indicating whether the sender of the request belongs to a given role
Throws:
IllegalStateException - This exception is thrown if the method is called while no request is being serviced.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Endpoint (Java EE 5)

javax.xml.ws
Class Endpoint

java.lang.Object
    extended by  javax.xml.ws.Endpoint

public abstract class Endpoint
extends Object

Web 服务端点。

使用在此类中定义的静态方法创建端点。一个端点总是绑定到一个 Binding 和一个实现者，这两项都是在创建端点时设置的。

端点要么处于已发布状态，要么处于未发布状态。可以使用 publish 方法开始发布端点，此时端点开始接受传入请求。相反，可以使用 stop 方法停止接受传入请求并取消端点。一旦停止，就不能再次发布该端点。

可以在端点上设置 Executor 以便更好地控制用来指派传入请求的线程。例如，通过创建 ThreadPoolExecutor 并向端点注册可以启用带有特定参数的线程池。

处理程序链可以使用所含的 Binding 来设置。

端点可以使一个元数据文档（如 WSDL 和 XMLSchema 文档）列表与之绑定。发布时，JAX-WS 实现将根据实现者上存在的注释，尽可能多地重用这些元数据，而不是生成新的元数据。

since | JAX-WS 2.0
See also | javax.xml.ws.Binding, javax.xml.ws.BindingType, javax.xml.ws.soap.SOAPBinding, java.util.concurrent.Executor
英文文档：

A Web service endpoint.

Endpoints are created using the static methods defined in this class. An endpoint is always tied to one Binding and one implementor, both set at endpoint creation time.

An endpoint is either in a published or an unpublished state. The publish methods can be used to start publishing an endpoint, at which point it starts accepting incoming requests. Conversely, the stop method can be used to stop accepting incoming requests and take the endpoint down. Once stopped, an endpoint cannot be published again.

An Executor may be set on the endpoint in order to gain better control over the threads used to dispatch incoming requests. For instance, thread pooling with certain parameters can be enabled by creating a ThreadPoolExecutor and registering it with the endpoint.

Handler chains can be set using the contained Binding.

An endpoint may have a list of metadata documents, such as WSDL and XMLSchema documents, bound to it. At publishing time, the JAX-WS implementation will try to reuse as much of that metadata as possible instead of generating new one based on the annotations present on the implementor.

Since:
JAX-WS 2.0
See Also:
Binding, BindingType, SOAPBinding, Executor

Field Summary
static String | WSDL_PORT Standard property: name of WSDL port.
static String | WSDL_SERVICE Standard property: name of WSDL service.
Constructor Summary
Endpoint()
Method Summary
static Endpoint | create(Object implementor) Creates an endpoint with the specified implementor object.
static Endpoint | create(String bindingId, Object implementor) Creates an endpoint with the specified binding type and implementor object.
abstract Binding | getBinding() Returns the binding for this endpoint.
abstract Executor | getExecutor() Returns the executor for this Endpointinstance.
abstract Object | getImplementor() Returns the implementation object for this endpoint.
abstract List<Source> | getMetadata() Returns a list of metadata documents for the service.
abstract Map<String,Object> | getProperties() Returns the property bag for this Endpoint instance.
abstract boolean | isPublished() Returns true if the endpoint is in the published state.
abstract void | publish(Object serverContext) Publishes this endpoint at the provided server context.
abstract void | publish(String address) Publishes this endpoint at the given address.
static Endpoint | publish(String address, Object implementor) Creates and publishes an endpoint for the specified implementor object at the given address.
abstract void | setExecutor(Executor executor) Sets the executor for this Endpoint instance.
abstract void | setMetadata(List<Source> metadata) Sets the metadata for this endpoint.
abstract void | setProperties(Map<String,Object> properties) Sets the property bag for this Endpoint instance.
abstract void | stop() Stops publishing this endpoint.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

WSDL_SERVICE

public static final String WSDL_SERVICE
Standard property: name of WSDL service.

Type: javax.xml.namespace.QName

See Also:
Constant Field Values

英文文档：

WSDL_PORT

public static final String WSDL_PORT
Standard property: name of WSDL port.

Type: javax.xml.namespace.QName

See Also:
Constant Field Values
Constructor Detail

public Endpoint()
英文文档：

Endpoint

public Endpoint()
Method Detail

public static Endpoint create(Object implementor)
创建具有指定实现者对象的端点。如果存在通过 BindingType 注释指定的绑定，则必须使用该绑定，否则必须使用默认的 SOAP 1.1 / HTTP 绑定。

可以通过调用 javax.xml.ws.Endpoint#publish(String) 和 javax.xml.ws.Endpoint#publish(Object) 方法之一来发布新创建的端点。

implementor | 端点实现者。
return | 新创建的端点。
英文文档：

create

public static Endpoint create(Object implementor)
Creates an endpoint with the specified implementor object. If there is a binding specified via a BindingType annotation then it MUST be used else a default of SOAP 1.1 / HTTP binding MUST be used.

The newly created endpoint may be published by calling one of the javax.xml.ws.Endpoint#publish(String) and javax.xml.ws.Endpoint#publish(Object) methods.

Parameters:
implementor - The endpoint implementor.
Returns:
The newly created endpoint.

public static Endpoint create(String bindingId, Object implementor)
创建具有指定绑定类型和实现者对象的端点。

可以通过调用 javax.xml.ws.Endpoint#publish(String) 和 javax.xml.ws.Endpoint#publish(Object) 方法之一来发布新创建的端点。

bindingId | 一个 URI，指定要使用的绑定。如果 bindingID 为 null 并且没有通过 BindingType 注释指定任何绑定，则必须使用默认的 SOAP 1.1 / HTTP 绑定。
implementor | 端点实现者。
return | 新创建的端点。
英文文档：

create

public static Endpoint create(String bindingId,
                              Object implementor)
Creates an endpoint with the specified binding type and implementor object.

The newly created endpoint may be published by calling one of the javax.xml.ws.Endpoint#publish(String) and javax.xml.ws.Endpoint#publish(Object) methods.

Parameters:
bindingId - A URI specifying the binding to use. If the bindingID is null and no binding is specified via a BindingType annotation then a default SOAP 1.1 / HTTP binding MUST be used.
implementor - The endpoint implementor.
Returns:
The newly created endpoint.

abstract public Binding getBinding()
返回此端点的绑定。
return 此端点的绑定
英文文档：

getBinding

public abstract Binding getBinding()
Returns the binding for this endpoint.

Returns:
The binding for this endpoint

abstract public Object getImplementor()
返回此端点的实现对象。
return 此端点的实现者
英文文档：

getImplementor

public abstract Object getImplementor()
Returns the implementation object for this endpoint.

Returns:
The implementor for this endpoint

abstract public void publish(String address)
在给定地址处发布此端点。JAX-WS 实现将使用一些默认的配置创建和配置所需的服务器基础设施。若要更多地控制服务器配置，请使用 javax.xml.ws.Endpoint#publish(Object) 方法。
address | 一个 URI，指定要使用的地址。地址必须与创建端点时指定的绑定兼容。
Throws | IllegalArgumentException: 如果提供的地址 URI 不能与端点的绑定结合使用。
Throws | IllegalStateException: 如果已发布端点或者已停止端点。
英文文档：

publish

public abstract void publish(String address)
Publishes this endpoint at the given address. The necessary server infrastructure will be created and configured by the JAX-WS implementation using some default configuration. In order to get more control over the server configuration, please use the javax.xml.ws.Endpoint#publish(Object) method instead.

Parameters:
address - A URI specifying the address to use. The address must be compatible with the binding specified at the time the endpoint was created.
Throws:
IllegalArgumentException - If the provided address URI is not usable in conjunction with the endpoint's binding.
IllegalStateException - If the endpoint has been published already or it has been stopped.

public static Endpoint publish(String address, Object implementor)
在给定地址处针对指定的实现者对象创建并发布端点。

JAX-WS 实现将使用一些默认的配置创建和配置所需的服务器基础设施。 若要更多地控制服务器配置，请使用 javax.xml.ws.Endpoint#create(String,Object) 和 javax.xml.ws.Endpoint#publish(Object) 方法。

address | 指定要使用的地址和传输/协议的 URI。一个 http 地址：URI 必须指向正使用的 SOAP 1.1/HTTP。实现可以支持其他 URI 方案。
implementor | 端点实现者。
return | 新创建的端点。
英文文档：

publish

public static Endpoint publish(String address,
                               Object implementor)
Creates and publishes an endpoint for the specified implementor object at the given address.

The necessary server infrastructure will be created and configured by the JAX-WS implementation using some default configuration. In order to get more control over the server configuration, please use the javax.xml.ws.Endpoint#create(String,Object) and javax.xml.ws.Endpoint#publish(Object) method instead.

Parameters:
address - A URI specifying the address and transport/protocol to use. A http: URI must result in the SOAP 1.1/HTTP binding being used. Implementations may support other URI schemes.
implementor - The endpoint implementor.
Returns:
The newly created endpoint.

abstract public void publish(Object serverContext)
在提供的服务器上下文中发布此端点。服务器上下文封装了用于特定传输的服务器基础设施和寻址信息。要成功调用该方法，作为参数传递给它的服务器上下文必须与端点的绑定兼容。
serverContext | 表示发布端点所用服务器上下文的对象。
Throws | IllegalArgumentException: 如果实现不支持提供的服务器上下文，或者被证明无法与端点的绑定结合使用。
Throws | IllegalStateException: 如果已发布端点或者已停止端点。
英文文档：

publish

public abstract void publish(Object serverContext)
Publishes this endpoint at the provided server context. A server context encapsulates the server infrastructure and addressing information for a particular transport. For a call to this method to succeed, the server context passed as an argument to it must be compatible with the endpoint's binding.

Parameters:
serverContext - An object representing a server context to be used for publishing the endpoint.
Throws:
IllegalArgumentException - If the provided server context is not supported by the implementation or turns out to be unusable in conjunction with the endpoint's binding.
IllegalStateException - If the endpoint has been published already or it has been stopped.

abstract public void stop()
停止发布此端点。 如果端点未处于已发布状态，则此方法无效。
英文文档：

stop

public abstract void stop()
Stops publishing this endpoint. If the endpoint is not in a published state, this method has not effect.

abstract public boolean isPublished()
如果端点已处于发布状态，则返回 true。
return 如果端点已处于发布状态，则返回 true
英文文档：

isPublished

public abstract boolean isPublished()
Returns true if the endpoint is in the published state.

Returns:
true if the endpoint is in the published state.

abstract public java.util.List<E> getMetadata()
返回服务的元数据文档列表。
return List<javax.xml.transform.Source> 服务的元数据文档列表
英文文档：

getMetadata

public abstract List<Source> getMetadata()
Returns a list of metadata documents for the service.

Returns:
List<javax.xml.transform.Source> A list of metadata documents for the service

英文文档：

setMetadata

public abstract void setMetadata(List<Source> metadata)
Sets the metadata for this endpoint.

Parameters:
metadata - A list of XML document sources containing metadata information for the endpoint (e.g. WSDL or XML Schema documents)
Throws:
IllegalStateException - If the endpoint has already been published.

abstract public java.util.concurrent.Executor getExecutor()
返回此 Endpoint 实例的执行程序。 执行程序用于向实现者对象指派传入请求。
return | 将用来指派请求的 java.util.concurrent.Executor。
See also | java.util.concurrent.Executor
英文文档：

getExecutor

public abstract Executor getExecutor()
Returns the executor for this Endpointinstance. The executor is used to dispatch an incoming request to the implementor object.

Returns:
The java.util.concurrent.Executor to be used to dispatch a request.
See Also:
Executor

abstract public void setExecutor(java.util.concurrent.Executor executor)
设置此 Endpoint 实例的执行程序。 执行程序用于向实现者对象指派传入请求。 如果此 Endpoint 使用 publish(Object) 方法发布，并且指定的服务器上下文定义它自己的线程行为，则可以忽略执行程序。
executor | 将用来指派请求的 java.util.concurrent.Executor。
Throws | SecurityException: 如果出于安全的原因（例如，缺少必要的权限），实例不支持设置执行程序。
See also | java.util.concurrent.Executor
英文文档：

setExecutor

public abstract void setExecutor(Executor executor)
Sets the executor for this Endpoint instance. The executor is used to dispatch an incoming request to the implementor object. If this Endpoint is published using the publish(Object) method and the specified server context defines its own threading behavior, the executor may be ignored.

Parameters:
executor - The java.util.concurrent.Executor to be used to dispatch a request.
Throws:
SecurityException - If the instance does not support setting an executor for security reasons (e.g. the necessary permissions are missing).
See Also:
Executor

abstract public java.util.Map<K, V> getProperties()
返回此 Endpoint 实例的属性包。
return Map<String,Object>，与此实例关联的属性包。
英文文档：

getProperties

public abstract Map<String,Object> getProperties()
Returns the property bag for this Endpoint instance.

Returns:
Map<String,Object> The property bag associated with this instance.

英文文档：

setProperties

public abstract void setProperties(Map<String,Object> properties)
Sets the property bag for this Endpoint instance.

Parameters:
properties - The property bag associated with this instance.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Holder (Java EE 5)

javax.xml.ws
Class Holder<T>

java.lang.Object
    extended by  javax.xml.ws.Holder<T>

public final class Holder<T>
extends Object

Implemented by: BigDecimalHolder, BigIntegerHolder, BooleanHolder, BooleanWrapperHolder, ByteArrayHolder, ByteHolder, ByteWrapperHolder, CalendarHolder, DoubleHolder, DoubleWrapperHolder, FloatHolder, FloatWrapperHolder, IntegerWrapperHolder, IntHolder, LongHolder, LongWrapperHolder, ObjectHolder, QNameHolder, ShortHolder, ShortWrapperHolder, StringHolder

java.xml.rpc.holders.Holder 接口表示用于标准 Holder 类和生成的 Holder 类的基本接口。生成的 Holder 类需要实现此 Holder 接口。
version 1.0
英文文档：

Holds a value of type T.

Since:
JAX-WS 2.0

Field Summary
 T value
The value contained in the holder.
Constructor Summary
Holder()
Creates a new holder with a null value.
Holder(T value)
Create a new holder with the specified value.
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

value

public T value
The value contained in the holder.

Constructor Detail

英文文档：

Holder

public Holder()
Creates a new holder with a null value.

英文文档：

Holder

public Holder(T value)
Create a new holder with the specified value.

Parameters:
value - The value to be stored in the holder.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


Service (Java EE 5)

javax.xml.ws
Class Service

java.lang.Object
    extended by  javax.xml.ws.Service

public class Service
extends Object

Implements: RegistryEntry

Service 实例是提供关于 Organization 所提供服务（例如，Web 服务）的信息的 RegistryObject。一个 Service 可以包含一组 ServiceBinding 实例。映射到 UDDI 中的 BusinessService。
See also javax.xml.registry.infomodel.ServiceBinding
英文文档：

Service objects provide the client view of a Web service.

Service acts as a factory of the following:

  • Proxies for a target service endpoint.
  • Instances of javax.xml.ws.Dispatch for dynamic message-oriented invocation of a remote operation.

    • The ports available on a service can be enumerated using the getPorts method. Alternatively, you can pass a service endpoint interface to the unary getPort method and let the runtime select a compatible port.

    Handler chains for all the objects created by a Service can be set by means of a HandlerResolver.

    An Executor may be set on the service in order to gain better control over the threads used to dispatch asynchronous callbacks. For instance, thread pooling with certain parameters can be enabled by creating a ThreadPoolExecutor and registering it with the service.

    Since:
    JAX-WS 2.0
    See Also:
    Provider, HandlerResolver, Executor

    Nested Class Summary
    static class Service.Mode
    The orientation of a dynamic client or service.
    Constructor Summary
    protected Service(URL wsdlDocumentLocation, QName serviceName)
    Method Summary
     void addPort(QName portName, String bindingId, String endpointAddress)
    Creates a new port for the service.
    static Service create(QName serviceName)
    Create a Service instance.
    static Service create(URL wsdlDocumentLocation, QName serviceName)
    Create a Service instance.
    <T> Dispatch<T>
            createDispatch(QName portName, Class<T> type, Service.Mode mode)
    Creates a Dispatch instance for use with objects of the users choosing.
     Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode)
    Creates a Dispatch instance for use with JAXB generated objects.
     Executor getExecutor()
    Returns the executor for this Serviceinstance.
     HandlerResolver getHandlerResolver()
    Returns the configured handler resolver.
    <T> T
            getPort(Class<T> serviceEndpointInterface)
    The getPort method returns a stub.
    <T> T
            getPort(QName portName, Class<T> serviceEndpointInterface)
    The getPort method returns a stub.
     Iterator<QName> getPorts()
    Returns an Iterator for the list of QNames of service endpoints grouped by this service
     QName getServiceName()
    Gets the name of this service.
     URL getWSDLDocumentLocation()
    Gets the location of the WSDL document for this Service.
     void setExecutor(Executor executor)
    Sets the executor for this Service instance.
     void setHandlerResolver(HandlerResolver handlerResolver)
    Sets the HandlerResolver for this Service instance.
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Constructor Detail

    英文文档：

    Service

    protected Service(URL wsdlDocumentLocation,
                  QName serviceName)
    Method Detail

    英文文档：

    getPort

    public <T> T getPort(QName portName,
                     Class<T> serviceEndpointInterface)
    The getPort method returns a stub. A service client uses this stub to invoke operations on the target service endpoint. The serviceEndpointInterface specifies the service endpoint interface that is supported by the created dynamic proxy or stub instance.

    Parameters:
    portName - Qualified name of the service endpoint in the WSDL service description
    serviceEndpointInterface - Service endpoint interface supported by the dynamic proxy or stub instance
    Returns:
    Object Proxy instance that supports the specified service endpoint interface
    Throws:
    WebServiceException - This exception is thrown in the following cases:
    • If there is an error in creation of the proxy
    • If there is any missing WSDL metadata as required by this method
    • Optionally, if an illegal serviceEndpointInterface or portName is specified
    See Also:
    Proxy, InvocationHandler

    英文文档：

    getPort

    public <T> T getPort(Class<T> serviceEndpointInterface)
    The getPort method returns a stub. The parameter serviceEndpointInterface specifies the service endpoint interface that is supported by the returned proxy. In the implementation of this method, the JAX-WS runtime system takes the responsibility of selecting a protocol binding (and a port) and configuring the proxy accordingly. The returned proxy should not be reconfigured by the client.

    Parameters:
    serviceEndpointInterface - Service endpoint interface
    Returns:
    Object instance that supports the specified service endpoint interface
    Throws:
    WebServiceException -
    • If there is an error during creation of the proxy
    • If there is any missing WSDL metadata as required by this method
    • Optionally, if an illegal serviceEndpointInterface is specified

    英文文档：

    addPort

    public void addPort(QName portName,
                    String bindingId,
                    String endpointAddress)
    Creates a new port for the service. Ports created in this way contain no WSDL port type information and can only be used for creating Dispatchinstances.

    Parameters:
    portName - Qualified name for the target service endpoint
    bindingId - A String identifier of a binding.
    endpointAddress - Address of the target service endpoint as a URI
    Throws:
    WebServiceException - If any error in the creation of the port
    See Also:
    SOAPBinding.SOAP11HTTP_BINDING, SOAPBinding.SOAP12HTTP_BINDING, HTTPBinding.HTTP_BINDING

    英文文档：

    createDispatch

    public <T> Dispatch<T> createDispatch(QName portName,
                                      Class<T> type,
                                      Service.Mode mode)
    Creates a Dispatch instance for use with objects of the users choosing.

    Parameters:
    portName - Qualified name for the target service endpoint
    type - The class of object used to messages or message payloads. Implementations are required to support javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
    mode - Controls whether the created dispatch instance is message or payload oriented, i.e. whether the user will work with complete protocol messages or message payloads. E.g. when using the SOAP protocol, this parameter controls whether the user will work with SOAP messages or the contents of a SOAP body. Mode must be MESSAGE when type is SOAPMessage.
    Returns:
    Dispatch instance
    Throws:
    WebServiceException - If any error in the creation of the Dispatch object
    See Also:
    Source, SOAPMessage

    英文文档：

    createDispatch

    public Dispatch<Object> createDispatch(QName portName,
                                       JAXBContext context,
                                       Service.Mode mode)
    Creates a Dispatch instance for use with JAXB generated objects.

    Parameters:
    portName - Qualified name for the target service endpoint
    context - The JAXB context used to marshall and unmarshall messages or message payloads.
    mode - Controls whether the created dispatch instance is message or payload oriented, i.e. whether the user will work with complete protocol messages or message payloads. E.g. when using the SOAP protocol, this parameter controls whether the user will work with SOAP messages or the contents of a SOAP body.
    Returns:
    Dispatch instance
    Throws:
    ServiceException - If any error in the creation of the Dispatch object
    See Also:
    JAXBContext

    英文文档：

    getServiceName

    public QName getServiceName()
    Gets the name of this service.

    Returns:
    Qualified name of this service

    英文文档：

    getPorts

    public Iterator<QName> getPorts()
    Returns an Iterator for the list of QNames of service endpoints grouped by this service

    Returns:
    Returns java.util.Iterator with elements of type javax.xml.namespace.QName
    Throws:
    WebServiceException - If this Service class does not have access to the required WSDL metadata

    英文文档：

    getWSDLDocumentLocation

    public URL getWSDLDocumentLocation()
    Gets the location of the WSDL document for this Service.

    Returns:
    URL for the location of the WSDL document for this service

    英文文档：

    getHandlerResolver

    public HandlerResolver getHandlerResolver()
    Returns the configured handler resolver.

    Returns:
    HandlerResolver The HandlerResolver being used by this Service instance, or null if there isn't one.

    英文文档：

    setHandlerResolver

    public void setHandlerResolver(HandlerResolver handlerResolver)
    Sets the HandlerResolver for this Service instance.

    The handler resolver, if present, will be called once for each proxy or dispatch instance that is created, and the handler chain returned by the resolver will be set on the instance.

    Parameters:
    handlerResolver - The HandlerResolver to use for all subsequently created proxy/dispatch objects.
    See Also:
    HandlerResolver

    英文文档：

    getExecutor

    public Executor getExecutor()
    Returns the executor for this Serviceinstance. The executor is used for all asynchronous invocations that require callbacks.

    Returns:
    The java.util.concurrent.Executor to be used to invoke a callback.
    See Also:
    Executor

    英文文档：

    setExecutor

    public void setExecutor(Executor executor)
    Sets the executor for this Service instance. The executor is used for all asynchronous invocations that require callbacks.

    Parameters:
    executor - The java.util.concurrent.Executor to be used to invoke a callback.
    Throws:
    SecurityException - If the instance does not support setting an executor for security reasons (e.g. the necessary permissions are missing).
    See Also:
    Executor

    英文文档：

    create

    public static Service create(URL wsdlDocumentLocation,
                             QName serviceName)
    Create a Service instance. The specified WSDL document location and service qualified name must uniquely identify a wsdl:service element.

    Parameters:
    wsdlDocumentLocation - URL for the WSDL document location for the service
    serviceName - QName for the service
    Throws:
    WebServiceException - If any error in creation of the specified service

    英文文档：

    create

    public static Service create(QName serviceName)
    Create a Service instance.

    Parameters:
    serviceName - QName for the service
    Throws:
    WebServiceException - If any error in creation of the specified service
    Overview Package Class Tree Deprecated Index Help
    PREV CLASS NEXT CLASS FRAMES NO FRAMES


Service.Mode (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.xml.ws
Enum Service.Mode

java.lang.Object
    extended by  java.lang.Enum<Service.Mode>
        extended by  javax.xml.ws.Service.Mode
All Implemented Interfaces:
Serializable, Comparable<Service.Mode>
Enclosing class:
Service
public static enum Service.Mode
extends Enum<Service.Mode>

Extends: Enum<E>
Contained within: Service

动态客户端或服务的方向。MESSAGE 提供对整个协议消息的访问，而 PAYLOAD 只提供对协议消息负载的访问。
英文文档：

The orientation of a dynamic client or service. MESSAGE provides access to entire protocol message, PAYLOAD to protocol message payload only.

Enum Constant Summary
MESSAGE
PAYLOAD
Method Summary
static Service.Mode | valueOf(String name) Returns the enum constant of this type with the specified name.
static Service.Mode[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

MESSAGE

public static final Service.Mode MESSAGE

英文文档：

PAYLOAD

public static final Service.Mode PAYLOAD
Method Detail

final public static Service.Mode[] values()
英文文档：

values

public static final Service.Mode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Service.Mode c : Service.Mode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static Service.Mode valueOf(String name)
英文文档：

valueOf

public static Service.Mode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


WebServicePermission (Java EE 5)

javax.xml.ws
Class WebServicePermission

java.lang.Object
    extended by  java.security.Permission
        extended by  java.security.BasicPermission
            extended by  javax.xml.ws.WebServicePermission
All Implemented Interfaces:
Serializable, Guard
public final class WebServicePermission
extends BasicPermission

Extends: java.security.Permission > java.security.BasicPermission

此类定义 Web 服务权限。

Web 服务权限由名称（也称为“目标名称”）单独标识。没有与它们关联的操作。

定义以下权限目标名称：

publishEndpoint

publishEndpoint 权限允许使用 javax.xml.ws.Endpoint 类定义的 publish 方法发布 Web 服务端点。

See also javax.xml.ws.Endpoint, java.security.BasicPermission, java.security.Permission, java.security.Permissions, java.lang.SecurityManager
英文文档：

This class defines web service permissions.

Web service Permissions are identified by name (also referred to as a "target name") alone. There are no actions associated with them.

The following permission target name is defined:

publishEndpoint

The publishEndpoint permission allows publishing a web service endpoint using the publish methods defined by the javax.xml.ws.Endpoint class.

See Also:
Endpoint, BasicPermission, Permission, Permissions, SecurityManager, Serialized Form

Constructor Summary
WebServicePermission(String name)
Creates a new permission with the specified name.
WebServicePermission(String name, String actions)
Creates a new permission with the specified name and actions.
Method Summary
Methods inherited from class java.security.BasicPermission
equals, getActions, hashCode, implies, newPermissionCollection
Methods inherited from class java.security.Permission
checkGuard, getName, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

public WebServicePermission(String name)
创建具有指定名称的新权限。
name WebServicePermission 的名称
英文文档：

WebServicePermission

public WebServicePermission(String name)
Creates a new permission with the specified name.

Parameters:
name - the name of the WebServicePermission

public WebServicePermission(String name, String actions)
创建具有指定名称和操作的新权限。 当前不使用 actions 参数，它应该为 null。
name | WebServicePermission 的名称
actions | 应该为 null
英文文档：

WebServicePermission

public WebServicePermission(String name,
                            String actions)
Creates a new permission with the specified name and actions. The actions parameter is currently unused and it should be null.

Parameters:
name - the name of the WebServicePermission
actions - should be null
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


ProtocolException (Java EE 5)

javax.xml.ws
Class ProtocolException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.xml.ws.WebServiceException
                    extended by  javax.xml.ws.ProtocolException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HTTPException, SOAPFaultException
public class ProtocolException
extends WebServiceException

Extends: Throwable > Exception > RuntimeException > WebServiceException
Extended by: HTTPException, SOAPFaultException

ProtocolException 类是与特定协议绑定有关的异常的基类。子类用来与客户端交流协议级别故障的信息，也可以在服务器上使用，以控制特定于协议的故障表示形式。
since JAX-WS 2.0
英文文档：

The ProtocolException class is a base class for exceptions related to a specific protocol binding. Subclasses are used to communicate protocol level fault information to clients and may be used on the server to control the protocol specific fault representation.

Since:
JAX-WS 2.0
See Also:
Serialized Form

Constructor Summary
ProtocolException()
Constructs a new protocol exception with null as its detail message.
ProtocolException(String message)
Constructs a new protocol exception with the specified detail message.
ProtocolException(String message, Throwable cause)
Constructs a new runtime exception with the specified detail message and cause.
ProtocolException(Throwable cause)
Constructs a new runtime exception with the specified cause and a detail message of (cause==null ?
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

public ProtocolException()
构造一个新的协议异常，将 null 作为它的详细消息。cause 没有初始化，随后可以通过调用 Throwable.initCause(java.lang.Throwable) 进行初始化。
英文文档：

ProtocolException

public ProtocolException()
Constructs a new protocol exception with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).

public ProtocolException(String message)
构造一个具有指定详细消息的新协议异常。cause 没有初始化，随后可以通过调用 Throwable.initCause(java.lang.Throwable) 进行初始化。
message 详细消息。保存该详细消息，以便以后通过 Throwable.getMessage() 方法进行检索。
英文文档：

ProtocolException

public ProtocolException(String message)
Constructs a new protocol exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).

Parameters:
message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.

public ProtocolException(String message, Throwable cause)
构造一个具有指定详细消息和 cause 的新运行时异常。 注意，与 cause 相关的详细消息不会自动地合并到此运行时异常的详细消息中。
message | 详细消息（保存此消息，以便以后通过 Throwable.getMessage() 方法检索它）。
cause | cause （保存此 cause，以便以后通过 Throwable.getCause() 方法检索它）。（允许 null 值，指示 cause 是不存在的或是未知的。）
英文文档：

ProtocolException

public ProtocolException(String message,
                         Throwable cause)
Constructs a new runtime exception with the specified detail message and cause. Note that the detail message associated with cause is not automatically incorporated in this runtime exception's detail message.

Parameters:
message - the detail message (which is saved for later retrieval by the Throwable.getMessage() method).
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

public ProtocolException(Throwable cause)
构造具有指定 cause 和详细消息 (cause==null ? null :cause.toString())（它通常包含 cause 的类和详细消息）的新运行时异常。该构造方法对于那些与其他可抛出异常的包装器一样的运行时异常来说是很有用的。
cause cause （保存此 cause，以便以后通过 Throwable.getCause() 方法检索它）。（允许 null 值，指示 cause 是不存在的或是未知的。）
英文文档：

ProtocolException

public ProtocolException(Throwable cause)
Constructs a new runtime exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.

Parameters:
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


WebServiceException (Java EE 5)

javax.xml.ws
Class WebServiceException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.xml.ws.WebServiceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ProtocolException
public class WebServiceException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException
Extended by: ProtocolException

WebServiceException 类是所有 JAX-WS API 运行时异常的基本异常类。
since JAX-WS 2.0
英文文档：

The WebServiceException class is the base exception class for all JAX-WS API runtime exceptions.

Since:
JAX-WS 2.0
See Also:
Serialized Form

Constructor Summary
WebServiceException()
Constructs a new exception with null as its detail message.
WebServiceException(String message)
Constructs a new exception with the specified detail message.
WebServiceException(String message, Throwable cause)
Constructs a new exception with the specified detail message and cause.
WebServiceException(Throwable cause)
Constructs a new WebServiceException with the specified cause and a detail message of (cause==null ?
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

public WebServiceException()
构造一个新异常，它的详细消息为 null。cause 没有初始化。
英文文档：

WebServiceException

public WebServiceException()
Constructs a new exception with null as its detail message. The cause is not initialized.

public WebServiceException(String message)
构造具有指定详细消息的新异常。cause 没有初始化。
message 详细消息，以后可使用 getMessage 方法检索
英文文档：

WebServiceException

public WebServiceException(String message)
Constructs a new exception with the specified detail message. The cause is not initialized.

Parameters:
message - The detail message which is later retrieved using the getMessage method

public WebServiceException(String message, Throwable cause)
构造一个具有指定详细消息和 cause 的新异常。
message | 详细消息，以后可使用 getMessage 方法检索
cause | 保存此 cause，以便以后通过 getCause 方法检索
英文文档：

WebServiceException

public WebServiceException(String message,
                           Throwable cause)
Constructs a new exception with the specified detail message and cause.

Parameters:
message - The detail message which is later retrieved using the getMessage method
cause - The cause which is saved for the later retrieval throw by the getCause method

public WebServiceException(Throwable cause)
构造具有指定 cause 和详细信息 (cause==null ? null :cause.toString())（它通常包含 cause 的类和详细消息）的新 WebServiceException。
cause 保存此 cause，以便以后通过 getCause 方法检索。（允许 null 值，指示 cause 是不存在的或是未知的。）
英文文档：

WebServiceException

public WebServiceException(Throwable cause)
Constructs a new WebServiceException with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Parameters:
cause - The cause which is saved for the later retrieval throw by the getCause method. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


BindingType (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type BindingType

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface BindingType

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented

BindingType 注释用于指定 Web 服务端点实现类所使用的绑定。

根据所使用的平台，可以以编程方式或通过部署描述符重写此注释。

since JAX-WS 2.0
英文文档：

The BindingType annotation is used to specify the binding to use for a web service endpoint implementation class.

This annotation may be overriden programmatically or via deployment descriptors, depending on the platform in use.

Since:
JAX-WS 2.0

Optional Element Summary
 String value
A binding identifier (a URI).

abstract public String value()
绑定标识符 (URI)。如果未指定，则默认值为 SOAP 1.1 / HTTP 绑定。

有关标准绑定标识符的定义，请参阅 SOAPBinding 和 HTTPBinding。

See also javax.xml.ws.Binding, SOAP11HTTP_BINDING, SOAP12HTTP_BINDING, HTTP_BINDING
英文文档：

value

public abstract String value
A binding identifier (a URI). If not specified, the default is the SOAP 1.1 / HTTP binding.

See the SOAPBinding and HTTPBinding for the definition of the standard binding identifiers.

See Also:
Binding, SOAPBinding.SOAP11HTTP_BINDING, SOAPBinding.SOAP12HTTP_BINDING, HTTPBinding.HTTP_BINDING
Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


RequestWrapper (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type RequestWrapper

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface RequestWrapper

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented

此类通过将在运行时使用的请求包装器 bean 注释服务端点接口中的方法。正如 WebMethod 注释中所定义的，localName 的默认值是 operationName；targetNamespace 是 SEI 的目标名称空间。

当从 Java 中启动时，此注释用来解决文档字面值模式中的重载冲突。在此情况下只需要 className。

since | JAX-WS 2.0
See also | javax.jws.WebMethod
英文文档：

Used to annotate methods in the Service Endpoint Interface with the request wrapper bean to be used at runtime. The default value of the localName is the operationName, as defined in WebMethod annotation and the targetNamespace is the target namespace of the SEI.

When starting from Java this annotation is used resolve overloading conflicts in document literal mode. Only the className is required in this case.

Since:
JAX-WS 2.0
See Also:
WebMethod

Optional Element Summary
String | className Request wrapper bean name.
String | localName Elements local name.
String | targetNamespace Elements namespace name.

abstract public String localName()
元素本地名称。
英文文档：

localName

public abstract String localName
Elements local name.

Default:
""

abstract public String targetNamespace()
元素名称空间名称。
英文文档：

targetNamespace

public abstract String targetNamespace
Elements namespace name.

Default:
""

abstract public String className()
请求包装器 bean 名称。
英文文档：

className

public abstract String className
Request wrapper bean name.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ResponseWrapper (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type ResponseWrapper

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface ResponseWrapper

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented

此类通过将在运行时使用的响应包装器 bean 注释服务端点接口中的方法。正如附加了 Response 的 WebMethod 注释中所定义的，localName 的默认值是 operationName；targetNamespace 是 SEI 的目标名称空间。

当从 Java 中启动时，此注释用来解决文档字面值模式中的重载冲突。在此情况下只需要 className。

since | JAX-WS 2.0
See also | javax.jws.WebMethod
英文文档：

Used to annotate methods in the Service Endpoint Interface with the response wrapper bean to be used at runtime. The default value of the localName is the operationName as defined in WebMethod annotation appended with Response and the targetNamespace is the target namespace of the SEI.

When starting from Java this annotation is used resolve overloading conflicts in document literal mode. Only the className is required in this case.

Since:
JAX-WS 2.0
See Also:
WebMethod

Optional Element Summary
String | className Response wrapper bean name.
String | localName Elements local name.
String | targetNamespace Elements namespace name.

abstract public String localName()
元素本地名称。
英文文档：

localName

public abstract String localName
Elements local name.

Default:
""

abstract public String targetNamespace()
元素名称空间名称。
英文文档：

targetNamespace

public abstract String targetNamespace
Elements namespace name.

Default:
""

abstract public String className()
响应包装器 bean 名称。
英文文档：

className

public abstract String className
Response wrapper bean name.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


ServiceMode (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type ServiceMode

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface ServiceMode

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
@Documented

用于指示 Provider 实现是希望使用整个协议消息还是只使用协议消息负载。
since JAX-WS 2.0
英文文档：

Used to indicate whether a Provider implementation wishes to work with entire protocol messages or just with protocol message payloads.

Since:
JAX-WS 2.0

Optional Element Summary
 Service.Mode value
Service mode.

abstract public Service.Mode value()
服务模式。PAYLOAD 指示 Provider 实现只希望使用协议消息负载。MESSAGE 指示 Provider 实现希望使用整个协议消息。
英文文档：

value

public abstract Service.Mode value
Service mode. PAYLOAD indicates that the Provider implementation wishes to work with protocol message payloads only. MESSAGE indicates that the Provider implementation wishes to work with entire protocol messages.

Default:
PAYLOAD
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebEndpoint (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type WebEndpoint

@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface WebEndpoint

Implements: Annotation
@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented

此类用来注释所生成服务接口的 getPortName() 方法。

此注释中指定的信息足以唯一标识 wsdl:service 中的 wsdl:port 元素。前者根据所生成服务接口自身的 WebServiceClient 注释值来确定。

since | JAX-WS 2.0
See also | javax.xml.ws.WebServiceClient
英文文档：

Used to annotate the getPortName() methods of a generated service interface.

The information specified in this annotation is sufficient to uniquely identify a wsdl:port element inside a wsdl:service. The latter is determined based on the value of the WebServiceClient annotation on the generated service interface itself.

Since:
JAX-WS 2.0
See Also:
WebServiceClient

Optional Element Summary
 String name
The local name of the endpoint.

abstract public String name()
端点的本地名称。
英文文档：

name

public abstract String name
The local name of the endpoint.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebFault (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type WebFault

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface WebFault

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented

此类用来注释特定于服务的异常类，以自定义故障元素的本地名称和名称空间名称以及故障 bean 的名称。
since JAX-WS 2.0
英文文档：

Used to annotate service specific exception classes to customize to the local and namespace name of the fault element and the name of the fault bean.

Since:
JAX-WS 2.0

Optional Element Summary
String | faultBean Fault bean name.
String | name Elements local name.
String | targetNamespace Elements namespace name.

abstract public String name()
元素本地名称。
英文文档：

name

public abstract String name
Elements local name.

Default:
""

abstract public String targetNamespace()
元素名称空间名称。
英文文档：

targetNamespace

public abstract String targetNamespace
Elements namespace name.

Default:
""

abstract public String faultBean()
故障 bean 名称。
英文文档：

faultBean

public abstract String faultBean
Fault bean name.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebServiceClient (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type WebServiceClient

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface WebServiceClient

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented

此类用来注释生成的服务接口。

此注释中指定的信息足以唯一标识 WSDL 文档中的 wsdl:service 元素。此 wsdl:service 元素表示生成的服务接口为之提供客户端视图的 Web 服务。

since JAX-WS 2.0
英文文档：

Used to annotate a generated service interface.

The information specified in this annotation is sufficient to uniquely identify a wsdl:service element inside a WSDL document. This wsdl:service element represents the Web service for which the generated service interface provides a client view.

Since:
JAX-WS 2.0

Optional Element Summary
String | name The local name of the Web service.
String | targetNamespace The namespace for the Web service.
String | wsdlLocation The location of the WSDL document for the service (a URL).

abstract public String name()
Web 服务的本地名称。
英文文档：

name

public abstract String name
The local name of the Web service.

Default:
""

abstract public String targetNamespace()
Web 服务的名称空间。
英文文档：

targetNamespace

public abstract String targetNamespace
The namespace for the Web service.

Default:
""

abstract public String wsdlLocation()
服务 WSDL 文档的位置 (URL)。
英文文档：

wsdlLocation

public abstract String wsdlLocation
The location of the WSDL document for the service (a URL).

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebServiceProvider (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type WebServiceProvider

@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface WebServiceProvider

Implements: Annotation
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented

此类用来注释 Provider 实现类。
since | JAX-WS 2.0
See also | javax.xml.ws.Provider
英文文档：

Used to annotate a Provider implementation class.

Since:
JAX-WS 2.0
See Also:
Provider

Optional Element Summary
String | portName Port name.
String | serviceName Service name.
String | targetNamespace Target namespace for the service
String | wsdlLocation Location of the WSDL description for the service.

abstract public String wsdlLocation()
服务 WSDL 描述的位置。
英文文档：

wsdlLocation

public abstract String wsdlLocation
Location of the WSDL description for the service.

Default:
""

abstract public String serviceName()
服务名称。
英文文档：

serviceName

public abstract String serviceName
Service name.

Default:
""

abstract public String targetNamespace()
服务的目标名称空间
英文文档：

targetNamespace

public abstract String targetNamespace
Target namespace for the service

Default:
""

abstract public String portName()
端口名称。
英文文档：

portName

public abstract String portName
Port name.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebServiceRef (Java EE 5)

SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT

javax.xml.ws
Annotation Type WebServiceRef

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface WebServiceRef

Implements: Annotation
@Target(value={TYPE, METHOD, FIELD})
@Retention(value=RUNTIME)
@Documented

WebServiceRef 注释用于定义 Web 服务及其（可选）注入目标的引用。 对于 Java EE 5 来说 Web 服务引用属于资源。
since | JAX-WS 2.0
See also | javax.annotation.Resource
英文文档：

The WebServiceRef annotation is used to define a reference to a web service and (optionally) an injection target for it. Web service references are resources in the Java EE 5 sense.

Since:
JAX-WS 2.0
See Also:
Resource

Optional Element Summary
String | mappedName A product specific name that this resource should be mapped to.
String | name The JNDI name of the resource.
Class | type The Java type of the resource.
Class | value The service class, always a type extending javax.xml.ws.Service.
String | wsdlLocation A URL pointing to the WSDL document for the web service.

abstract public String name()
资源的 JNDI 名称。对于字段注释，默认值为字段名称。对于方法注释，默认值为与该方法对应的 JavaBean 属性名称。对于类注释，没有默认值，必须指定此项。
英文文档：

name

public abstract String name
The JNDI name of the resource. For field annotations, the default is the field name. For method annotations, the default is the JavaBeans property name corresponding to the method. For class annotations, there is no default and this must be specified.

Default:
""

abstract public Class<T> type()
资源的 Java 类型。对于字段注释，默认值为字段的类型。对于方法注释，默认值为 JavaBean 属性的类型。对于类注释，没有默认值，必须指定此项。
英文文档：

type

public abstract Class type
The Java type of the resource. For field annotations, the default is the type of the field. For method annotations, the default is the type of the JavaBeans property. For class annotations, there is no default and this must be specified.

Default:
java.lang.Object.class

abstract public String mappedName()
此资源应该映射到的特定于产品的名称。此资源的名称（由 name 元素定义或为默认值）是使用该资源的应用程序组件的本地名称。（它的名称位于 JNDI java:comp/env 名称空间中。）许多应用程序服务器都提供一种方式将这些本地名称映射到应用程序服务器已知的资源名称。此映射的名称通常是全局 JNDI 名称，但也可以是任何形式的名称。

应用程序服务器不需要支持任何特殊形式或类型的映射名称，也不需要具有使用映射名称的能力。映射的名称与产品有关，并且通常与安装有关。任何对映射名称的使用都不可移植。

英文文档：

mappedName

public abstract String mappedName
A product specific name that this resource should be mapped to. The name of this resource, as defined by the name element or defaulted, is a name that is local to the application component using the resource. (It's a name in the JNDI java:comp/env namespace.) Many application servers provide a way to map these local names to names of resources known to the application server. This mapped name is often a global JNDI name, but may be a name of any form.

Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.

Default:
""

abstract public Class<T> value()
服务类，总是扩展 javax.xml.ws.Service 的类型。只要引用的类型是服务端点接口，就必须指定此元素。
英文文档：

value

public abstract Class value
The service class, always a type extending javax.xml.ws.Service. This element must be specified whenever the type of the reference is a service endpoint interface.

Default:
java.lang.Object.class

abstract public String wsdlLocation()
指向 Web 服务 WSDL 文档的 URL。如果没有指定，则使用在资源类型上由注释指定的 WSDL 位置。
英文文档：

wsdlLocation

public abstract String wsdlLocation
A URL pointing to the WSDL document for the web service. If not specified, the WSDL location specified by annotations on the resource type is used instead.

Default:
""
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL DETAIL: ELEMENT


WebServiceRefs (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

javax.xml.ws
Annotation Type WebServiceRefs

@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface WebServiceRefs

Implements: Annotation
@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)

WebServiceRefs 注释允许在类级别声明多个 web 服务引用。
since | 2.0
See also | javax.xml.ws.WebServiceRef
英文文档：

The WebServiceRefs annotation allows multiple web service references to be declared at the class level.

Since:
2.0
See Also:
WebServiceRef

Required Element Summary
 WebServiceRef[] value
Array used for multiple web service reference declarations.

Element Detail

abstract public WebServiceRef[] value()
用于多个 web 服务引用声明的数组。
英文文档：

value

public abstract WebServiceRef[] value
Array used for multiple web service reference declarations.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT


javax.xml.ws.handler (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.ws.handler

This package defines APIs for message handlers.

See:
Description

Interface Summary
Handler<C extends MessageContext> | The Handler interface is the base interface for JAX-WS handlers.
HandlerResolver | HandlerResolver is an interface implemented by an application to get control over the handler chain set on proxy/dispatch objects at the time of their creation.
LogicalHandler<C extends LogicalMessageContext> | The LogicalHandler extends Handler to provide typesafety for the message context parameter.
LogicalMessageContext | The LogicalMessageContext interface extends MessageContext to provide access to a the contained message as a protocol neutral LogicalMessage
MessageContext | The interface MessageContext abstracts the message context that is processed by a handler in the handle method.
PortInfo | The PortInfo interface is used by a HandlerResolver to query information about the port it is being asked to create a handler chain for.

Enum Summary
MessageContext.Scope Property scope.

Package javax.xml.ws.handler Description

This package defines APIs for message handlers.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.ws.handler Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.ws.handler

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.xml.ws.handler.Handler<C>
    • javax.xml.ws.handler.LogicalHandler<C>
  • javax.xml.ws.handler.HandlerResolver
  • java.util.Map<K,V>
    • javax.xml.ws.handler.MessageContext
      • javax.xml.ws.handler.LogicalMessageContext
  • javax.xml.ws.handler.PortInfo

Enum Hierarchy

  • java.lang.Object
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
      • javax.xml.ws.handler.MessageContext.Scope
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Handler (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.handler
Interface Handler<C extends MessageContext>

All Known Subinterfaces:
LogicalHandler<C>, SOAPHandler<T>
public interface Handler<C extends MessageContext>

Implemented by: GenericHandler

javax.xml.rpc.handler.Handler 接口需要由 SOAP 消息处理程序实现。用于 SOAP 消息处理程序的 handleRequest、handleResponse 和 handleFault 方法将能够访问 SOAPMessageContext 的 SOAPMessage。这些方法的实现可以修改 SOAPMessage，包括头和正文元素。
version 1.0
英文文档：

The Handler interface is the base interface for JAX-WS handlers.

Since:
JAX-WS 2.0

Method Summary
void | close(MessageContext context) Called at the conclusion of a message exchange pattern just prior to the JAX-WS runtime disptaching a message, fault or exception.
boolean | handleFault(C context) The handleFault method is invoked for fault message processing.
boolean | handleMessage(C context) The handleMessage method is invoked for normal processing of inbound and outbound messages.

Method Detail

英文文档：

handleMessage

boolean handleMessage(C context)
The handleMessage method is invoked for normal processing of inbound and outbound messages. Refer to the description of the handler framework in the JAX-WS specification for full details.

Parameters:
context - the message context.
Returns:
An indication of whether handler processing should continue for the current message
  • Return true to continue processing.
  • Return false to block processing.
Throws:
RuntimeException - Causes the JAX-WS runtime to cease handler processing and generate a fault.
ProtocolException - Causes the JAX-WS runtime to switch to fault message processing.

英文文档：

handleFault

boolean handleFault(C context)
The handleFault method is invoked for fault message processing. Refer to the description of the handler framework in the JAX-WS specification for full details.

Parameters:
context - the message context
Returns:
An indication of whether handler fault processing should continue for the current message
  • Return true to continue processing.
  • Return false to block processing.
Throws:
RuntimeException - Causes the JAX-WS runtime to cease handler fault processing and dispatch the fault.
ProtocolException - Causes the JAX-WS runtime to cease handler fault processing and dispatch the fault.

英文文档：

close

void close(MessageContext context)
Called at the conclusion of a message exchange pattern just prior to the JAX-WS runtime disptaching a message, fault or exception. Refer to the description of the handler framework in the JAX-WS specification for full details.

Parameters:
context - the message context
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HandlerResolver (Java EE 5)

javax.xml.ws.handler
Interface HandlerResolver

public interface HandlerResolver

HandlerResolver 是由应用程序实现的接口，用于控制创建 proxy/dispatch 对象时设置在这些对象上的处理程序链。

可以使用 setHandlerResolver 方法在 Service 上设置 HandlerResolver。

当运行时调用 HandlerResolver 时，将向它传递一个 PortInfo 对象，该对象中包含 proxy/dispatch 对象将访问的端口的信息。

since | JAX-WS 2.0
See also | setHandlerResolver
英文文档：

HandlerResolver is an interface implemented by an application to get control over the handler chain set on proxy/dispatch objects at the time of their creation.

A HandlerResolver may be set on a Service using the setHandlerResolver method.

When the runtime invokes a HandlerResolver, it will pass it a PortInfo object containing information about the port that the proxy/dispatch object will be accessing.

Since:
JAX-WS 2.0
See Also:
Service.setHandlerResolver(javax.xml.ws.handler.HandlerResolver)

Method Summary
 List<Handler> getHandlerChain(PortInfo portInfo)
Gets the handler chain for the specified port.

Method Detail

public java.util.List<E> getHandlerChain(PortInfo portInfo)
获取指定端口的处理程序链。
portInfo | 包含正被访问的端口的信息。
return | java.util.List 处理程序链
英文文档：

getHandlerChain

List<Handler> getHandlerChain(PortInfo portInfo)
Gets the handler chain for the specified port.

Parameters:
portInfo - Contains information about the port being accessed.
Returns:
java.util.List Handler chain
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LogicalHandler (Java EE 5)

javax.xml.ws.handler
Interface LogicalHandler<C extends LogicalMessageContext>

All Superinterfaces:
Handler<C>
public interface LogicalHandler<C extends LogicalMessageContext>
extends Handler<C>

Implements: Handler

LogicalHandler 扩展了 Handler，以便为消息上下文参数提供输入安全性。
since JAX-WS 2.0
英文文档：

The LogicalHandler extends Handler to provide typesafety for the message context parameter.

Since:
JAX-WS 2.0

Method Summary
Methods inherited from interface javax.xml.ws.handler.Handler
close, handleFault, handleMessage

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


LogicalMessageContext (Java EE 5)

javax.xml.ws.handler
Interface LogicalMessageContext

All Superinterfaces:
Map<String,Object>, MessageContext
public interface LogicalMessageContext
extends MessageContext

Implements: MessageContext

LogicalMessageContext 接口扩展了 MessageContext，以访问以与协议无关的 LogicalMessage 形式包含的消息。
since JAX-WS 2.0
英文文档：

The LogicalMessageContext interface extends MessageContext to provide access to a the contained message as a protocol neutral LogicalMessage

Since:
JAX-WS 2.0

Nested Class Summary
Nested classes/interfaces inherited from interface javax.xml.ws.handler.MessageContext
MessageContext.Scope
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Field Summary
Fields inherited from interface javax.xml.ws.handler.MessageContext
HTTP_REQUEST_HEADERS, HTTP_REQUEST_METHOD, HTTP_RESPONSE_CODE, HTTP_RESPONSE_HEADERS, INBOUND_MESSAGE_ATTACHMENTS, MESSAGE_OUTBOUND_PROPERTY, OUTBOUND_MESSAGE_ATTACHMENTS, PATH_INFO, QUERY_STRING, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSE, WSDL_DESCRIPTION, WSDL_INTERFACE, WSDL_OPERATION, WSDL_PORT, WSDL_SERVICE
Method Summary
 LogicalMessage getMessage()
Gets the message from this message context
Methods inherited from interface javax.xml.ws.handler.MessageContext
getScope, setScope
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Method Detail

public LogicalMessage getMessage()
从此消息上下文中获得消息。
return 包含的消息；如果此消息上下文中没有消息，则返回 null
英文文档：

getMessage

LogicalMessage getMessage()
Gets the message from this message context

Returns:
The contained message; returns null if no message is present in this message context
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageContext (Java EE 5)

javax.xml.ws.handler
Interface MessageContext

All Superinterfaces:
Map<String,Object>
All Known Subinterfaces:
LogicalMessageContext, SOAPMessageContext
public interface MessageContext
extends Map<String,Object>

Implemented by: SOAPMessageContext

接口 MessageContext 抽象化由 handle 方法中的处理程序处理的消息上下文。

MessageContext 接口提供管理属性集的方法。MessageContext 属性使处理程序链中的处理程序能够共享相关处理状态。

version | 1.1
See also | javax.xml.rpc.handler.Handler
英文文档：

The interface MessageContext abstracts the message context that is processed by a handler in the handle method.

The MessageContext interface provides methods to manage a property set. MessageContext properties enable handlers in a handler chain to share processing related state.

Since:
JAX-WS 2.0

Nested Class Summary
static class MessageContext.Scope
Property scope.
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Field Summary
static String | HTTP_REQUEST_HEADERS Standard property: HTTP request headers.
static String | HTTP_REQUEST_METHOD Standard property: HTTP request method.
static String | HTTP_RESPONSE_CODE Standard property: HTTP response status code.
static String | HTTP_RESPONSE_HEADERS Standard property: HTTP response headers.
static String | INBOUND_MESSAGE_ATTACHMENTS Standard property: Map of attachments to a message for the inbound message, key is the MIME Content-ID, value is a DataHandler.
static String | MESSAGE_OUTBOUND_PROPERTY Standard property: message direction, true for outbound messages, false for inbound.
static String | OUTBOUND_MESSAGE_ATTACHMENTS Standard property: Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler.
static String | PATH_INFO Standard property: Request Path Info Type: String
static String | QUERY_STRING Standard property: Query string for request.
static String | SERVLET_CONTEXT Standard property: servlet context object.
static String | SERVLET_REQUEST Standard property: servlet request object.
static String | SERVLET_RESPONSE Standard property: servlet response object.
static String | WSDL_DESCRIPTION Standard property: input source for WSDL document.
static String | WSDL_INTERFACE Standard property: name of wsdl interface (2.0) or port type (1.1).
static String | WSDL_OPERATION Standard property: name of WSDL operation.
static String | WSDL_PORT Standard property: name of WSDL port.
static String | WSDL_SERVICE Standard property: name of WSDL service.
Method Summary
MessageContext.Scope | getScope(String name) Gets the scope of a property.
void | setScope(String name, MessageContext.Scope scope) Sets the scope of a property.
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Field Detail

英文文档：

MESSAGE_OUTBOUND_PROPERTY

static final String MESSAGE_OUTBOUND_PROPERTY
Standard property: message direction, true for outbound messages, false for inbound.

Type: boolean

See Also:
Constant Field Values

英文文档：

INBOUND_MESSAGE_ATTACHMENTS

static final String INBOUND_MESSAGE_ATTACHMENTS
Standard property: Map of attachments to a message for the inbound message, key is the MIME Content-ID, value is a DataHandler.

Type: java.util.Map

See Also:
Constant Field Values

英文文档：

OUTBOUND_MESSAGE_ATTACHMENTS

static final String OUTBOUND_MESSAGE_ATTACHMENTS
Standard property: Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler.

Type: java.util.Map

See Also:
Constant Field Values

英文文档：

WSDL_DESCRIPTION

static final String WSDL_DESCRIPTION
Standard property: input source for WSDL document.

Type: org.xml.sax.InputSource

See Also:
Constant Field Values

英文文档：

WSDL_SERVICE

static final String WSDL_SERVICE
Standard property: name of WSDL service.

Type: javax.xml.namespace.QName

See Also:
Constant Field Values

英文文档：

WSDL_PORT

static final String WSDL_PORT
Standard property: name of WSDL port.

Type: javax.xml.namespace.QName

See Also:
Constant Field Values

英文文档：

WSDL_INTERFACE

static final String WSDL_INTERFACE
Standard property: name of wsdl interface (2.0) or port type (1.1).

Type: javax.xml.namespace.QName

See Also:
Constant Field Values

英文文档：

WSDL_OPERATION

static final String WSDL_OPERATION
Standard property: name of WSDL operation.

Type: javax.xml.namespace.QName

See Also:
Constant Field Values

英文文档：

HTTP_RESPONSE_CODE

static final String HTTP_RESPONSE_CODE
Standard property: HTTP response status code.

Type: java.lang.Integer

See Also:
Constant Field Values

英文文档：

HTTP_REQUEST_HEADERS

static final String HTTP_REQUEST_HEADERS
Standard property: HTTP request headers.

Type: java.util.Map>

See Also:
Constant Field Values

英文文档：

HTTP_RESPONSE_HEADERS

static final String HTTP_RESPONSE_HEADERS
Standard property: HTTP response headers.

Type: java.util.Map>

See Also:
Constant Field Values

英文文档：

HTTP_REQUEST_METHOD

static final String HTTP_REQUEST_METHOD
Standard property: HTTP request method.

Type: java.lang.String

See Also:
Constant Field Values

英文文档：

SERVLET_REQUEST

static final String SERVLET_REQUEST
Standard property: servlet request object.

Type: javax.servlet.http.HttpServletRequest

See Also:
Constant Field Values

英文文档：

SERVLET_RESPONSE

static final String SERVLET_RESPONSE
Standard property: servlet response object.

Type: javax.servlet.http.HttpServletResponse

See Also:
Constant Field Values

英文文档：

SERVLET_CONTEXT

static final String SERVLET_CONTEXT
Standard property: servlet context object.

Type: javax.servlet.ServletContext

See Also:
Constant Field Values

英文文档：

QUERY_STRING

static final String QUERY_STRING
Standard property: Query string for request.

Type: String

See Also:
Constant Field Values

英文文档：

PATH_INFO

static final String PATH_INFO
Standard property: Request Path Info

Type: String

See Also:
Constant Field Values
Method Detail

英文文档：

setScope

void setScope(String name,
              MessageContext.Scope scope)
Sets the scope of a property.

Parameters:
name - Name of the property associated with the MessageContext
scope - Desired scope of the property
Throws:
IllegalArgumentException - if an illegal property name is specified

英文文档：

getScope

MessageContext.Scope getScope(String name)
Gets the scope of a property.

Parameters:
name - Name of the property
Returns:
Scope of the property
Throws:
IllegalArgumentException - if a non-existant property name is specified
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


MessageContext.Scope (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.xml.ws.handler
Enum MessageContext.Scope

java.lang.Object
    extended by  java.lang.Enum<MessageContext.Scope>
        extended by  javax.xml.ws.handler.MessageContext.Scope
All Implemented Interfaces:
Serializable, Comparable<MessageContext.Scope>
Enclosing interface:
MessageContext
public static enum MessageContext.Scope
extends Enum<MessageContext.Scope>

Extends: Enum<E>
Contained within: MessageContext

属性作用域。作用域为 APPLICATION 的属性对于处理程序、客户端应用程序和服务端点是可看的；作用域为 HANDLER 的属性通常只对于处理程序是可见的。
英文文档：

Property scope. Properties scoped as APPLICATION are visible to handlers, client applications and service endpoints; properties scoped as HANDLER are only normally visible to handlers.

Enum Constant Summary
APPLICATION
HANDLER
Method Summary
static MessageContext.Scope | valueOf(String name) Returns the enum constant of this type with the specified name.
static MessageContext.Scope[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

APPLICATION

public static final MessageContext.Scope APPLICATION

英文文档：

HANDLER

public static final MessageContext.Scope HANDLER
Method Detail

final public static MessageContext.Scope[] values()
英文文档：

values

public static final MessageContext.Scope[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(MessageContext.Scope c : MessageContext.Scope.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static MessageContext.Scope valueOf(String name)
英文文档：

valueOf

public static MessageContext.Scope valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


PortInfo (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.handler
Interface PortInfo

public interface PortInfo

HandlerResolver 使用 PortInfo 接口查询有关要用来创建处理程序链的端口的信息。

此接口不能由应用程序实现，只能由 JAX-WS 实现实现。

since JAX-WS 2.0
英文文档：

The PortInfo interface is used by a HandlerResolver to query information about the port it is being asked to create a handler chain for.

This interface is never implemented by an application, only by a JAX-WS implementation.

Since:
JAX-WS 2.0

Method Summary
String | getBindingID() Gets the URI identifying the binding used by the port being accessed.
QName | getPortName() Gets the qualified name of the WSDL port being accessed.
QName | getServiceName() Gets the qualified name of the WSDL service name containing the port being accessed.

Method Detail

public javax.xml.namespace.QName getServiceName()
获取包含正被访问端口的 WSDL 服务名称的限定名。
return javax.xml.namespace.QName WSDL 服务的限定名。
英文文档：

getServiceName

QName getServiceName()
Gets the qualified name of the WSDL service name containing the port being accessed.

Returns:
javax.xml.namespace.QName The qualified name of the WSDL service.

public javax.xml.namespace.QName getPortName()
获取正被访问的 WSDL 端口的限定名。
return javax.xml.namespace.QName WSDL 端口的限定名。
英文文档：

getPortName

QName getPortName()
Gets the qualified name of the WSDL port being accessed.

Returns:
javax.xml.namespace.QName The qualified name of the WSDL port.

public String getBindingID()
获取标识正由被访问的端口所用绑定的 URI。
return | String 端口的绑定标识符。
See also | javax.xml.ws.Binding
英文文档：

getBindingID

String getBindingID()
Gets the URI identifying the binding used by the port being accessed.

Returns:
String The binding identifier for the port.
See Also:
Binding
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.ws.handler.soap (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.ws.handler.soap

This package defines APIs for SOAP message handlers.

See:
Description

Interface Summary
SOAPHandler<T extends SOAPMessageContext> | The SOAPHandler class extends Handler to provide typesafety for the message context parameter and add a method to obtain access to the headers that may be processed by the handler.
SOAPMessageContext | The interface SOAPMessageContext provides access to the SOAP message for either RPC request or response.

Package javax.xml.ws.handler.soap Description

This package defines APIs for SOAP message handlers.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.ws.handler.soap Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.ws.handler.soap

Package Hierarchies:
All Packages

Interface Hierarchy

  • javax.xml.ws.handler.Handler<C>
    • javax.xml.ws.handler.soap.SOAPHandler<T>
  • java.util.Map<K,V>
    • javax.xml.ws.handler.MessageContext
      • javax.xml.ws.handler.soap.SOAPMessageContext
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


SOAPHandler (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.handler.soap
Interface SOAPHandler<T extends SOAPMessageContext>

All Superinterfaces:
Handler<T>
public interface SOAPHandler<T extends SOAPMessageContext>
extends Handler<T>

Implements: Handler

SOAPHandler 类扩展了 Handler，以便为消息上下文参数提供输入安全性，并添加了一个方法，以访问可能由该处理程序处理的头。
since JAX-WS 2.0
英文文档：

The SOAPHandler class extends Handler to provide typesafety for the message context parameter and add a method to obtain access to the headers that may be processed by the handler.

Since:
JAX-WS 2.0

Method Summary
 Set<QName> getHeaders()
Gets the header blocks that can be processed by this Handler instance.
Methods inherited from interface javax.xml.ws.handler.Handler
close, handleFault, handleMessage

Method Detail

public java.util.Set<E> getHeaders()
获取可以由此处理程序实例处理的头块。
return 由此处理程序实例处理的头块的 QName 集合。QName 是头块最外部元素的限定名。
英文文档：

getHeaders

Set<QName> getHeaders()
Gets the header blocks that can be processed by this Handler instance.

Returns:
Set of QNames of header blocks processed by this handler instance. QName is the qualified name of the outermost element of the Header block.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SOAPMessageContext (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.handler.soap
Interface SOAPMessageContext

All Superinterfaces:
Map<String,Object>, MessageContext
public interface SOAPMessageContext
extends MessageContext

Implements: MessageContext

接口 javax.xml.rpc.soap.SOAPMessageContext 提供对 RPC 请求或响应的 SOAP 消息的访问。javax.xml.soap.SOAPMessage 为带有附件的 SOAP 1.1 消息表示形式指定标准的 Java API。
version | 1.0
See also | javax.xml.soap.SOAPMessage
英文文档：

The interface SOAPMessageContext provides access to the SOAP message for either RPC request or response. The javax.xml.soap.SOAPMessage specifies the standard Java API for the representation of a SOAP 1.1 message with attachments.

Since:
JAX-WS 2.0
See Also:
SOAPMessage

Nested Class Summary
Nested classes/interfaces inherited from interface javax.xml.ws.handler.MessageContext
MessageContext.Scope
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
Field Summary
Fields inherited from interface javax.xml.ws.handler.MessageContext
HTTP_REQUEST_HEADERS, HTTP_REQUEST_METHOD, HTTP_RESPONSE_CODE, HTTP_RESPONSE_HEADERS, INBOUND_MESSAGE_ATTACHMENTS, MESSAGE_OUTBOUND_PROPERTY, OUTBOUND_MESSAGE_ATTACHMENTS, PATH_INFO, QUERY_STRING, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSE, WSDL_DESCRIPTION, WSDL_INTERFACE, WSDL_OPERATION, WSDL_PORT, WSDL_SERVICE
Method Summary
Object[] | getHeaders(QName header, JAXBContext context, boolean allRoles) Gets headers that have a particular qualified name from the message in the message context.
SOAPMessage | getMessage() Gets the SOAPMessage from this message context.
Set<String> | getRoles() Gets the SOAP actor roles associated with an execution of the handler chain.
void | setMessage(SOAPMessage message) Sets the SOAPMessage in this message context
Methods inherited from interface javax.xml.ws.handler.MessageContext
getScope, setScope
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Method Detail

public SOAPMessage getMessage()
从此消息上下文中获取 SOAPMessage。
return 返回 SOAPMessage；如果此消息上下文中没有 SOAPMessage，则返回 null。
英文文档：

getMessage

SOAPMessage getMessage()
Gets the SOAPMessage from this message context. Modifications to the returned SOAPMessage change the message in-place, there is no need to susequently call setMessage.

Returns:
Returns the SOAPMessage; returns null if no SOAPMessage is present in this message context

public void setMessage(SOAPMessage message)
在此消息上下文中设置 SOAPMessage。
message | SOAP 消息
Throws | JAXRPCException: 如果在此消息上下文中设置 SOAPMessage 时发生任何错误
Throws | UnsupportedOperationException: 如果此操作不受支持
英文文档：

setMessage

void setMessage(SOAPMessage message)
Sets the SOAPMessage in this message context

Parameters:
message - SOAP message
Throws:
WebServiceException - If any error during the setting of the SOAPMessage in this message context
UnsupportedOperationException - If this operation is not supported

英文文档：

getHeaders

Object[] getHeaders(QName header,
                    JAXBContext context,
                    boolean allRoles)
Gets headers that have a particular qualified name from the message in the message context. Note that a SOAP message can contain multiple headers with the same qualified name.

Parameters:
header - The XML qualified name of the SOAP header(s).
context - The JAXBContext that should be used to unmarshall the header
allRoles - If true then returns headers for all SOAP roles, if false then only returns headers targetted at the roles currently being played by this SOAP node, see getRoles.
Returns:
An array of unmarshalled headers; returns an empty array if no message is present in this message context or no headers match the supplied qualified name.
Throws:
WebServiceException - If an error occurs when using the supplied JAXBContext to unmarshall. The cause of the WebServiceException is the original JAXBException.

public String[] getRoles()
获取与执行 HandlerChain 及其包含的 Handler 实例关联的 SOAP 参与者角色。注意，SOAP 参与者角色适用于 SOAP 节点，并使用 HandlerChain.setRoles 和 HandlerChain.getRoles 进行管理。HandlerChain 中的 Handler 实例使用有关 SOAP 参与者角色的信息来处理 SOAP 头块。注意，在通过 HandlerChain 处理 SOAP 消息的过程中，SOAP 参与者角色不变。
return | SOAP 参与者角色的 URI 所组成的数组
See also | setRoles, getRoles
英文文档：

getRoles

Set<String> getRoles()
Gets the SOAP actor roles associated with an execution of the handler chain. Note that SOAP actor roles apply to the SOAP node and are managed using SOAPBinding.setRoles and SOAPBinding.getRoles. Handler instances in the handler chain use this information about the SOAP actor roles to process the SOAP header blocks. Note that the SOAP actor roles are invariant during the processing of SOAP message through the handler chain.

Returns:
Array of String for SOAP actor roles
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.ws.http (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.ws.http

This package defines APIs specific to the HTTP binding.

See:
Description

Interface Summary
HTTPBinding The HTTPBinding interface is an abstraction for the XML/HTTP binding.

Exception Summary
HTTPException The HTTPException exception represents a XML/HTTP fault.

Package javax.xml.ws.http Description

This package defines APIs specific to the HTTP binding.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.ws.http Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.ws.http

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.xml.ws.WebServiceException
            • javax.xml.ws.ProtocolException
              • javax.xml.ws.http.HTTPException

Interface Hierarchy

  • javax.xml.ws.Binding
    • javax.xml.ws.http.HTTPBinding
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


HTTPBinding (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.http
Interface HTTPBinding

All Superinterfaces:
Binding
public interface HTTPBinding
extends Binding

Implements: Binding

HTTPBinding 接口是 XML/HTTP 绑定的抽象。
since JAX-WS 2.0
英文文档：

The HTTPBinding interface is an abstraction for the XML/HTTP binding.

Since:
JAX-WS 2.0

Field Summary
static String HTTP_BINDING
A constant representing the identity of the XML/HTTP binding.
Method Summary
Methods inherited from interface javax.xml.ws.Binding
getHandlerChain, setHandlerChain

Field Detail

英文文档：

HTTP_BINDING

static final String HTTP_BINDING
A constant representing the identity of the XML/HTTP binding.

See Also:
Constant Field Values
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


HTTPException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.http
Class HTTPException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.xml.ws.WebServiceException
                    extended by  javax.xml.ws.ProtocolException
                        extended by  javax.xml.ws.http.HTTPException
All Implemented Interfaces:
Serializable
public class HTTPException
extends ProtocolException

Extends: Throwable > Exception > RuntimeException > WebServiceException > ProtocolException

HTTPException 异常表示一个 XML/HTTP 故障。

由于在 XML/HTTP 消息传递中没有故障或异常的标准格式，因此只捕获 HTTP 状态代码。

since JAX-WS 2.0
英文文档：

The HTTPException exception represents a XML/HTTP fault.

Since there is no standard format for faults or exceptions in XML/HTTP messaging, only the HTTP status code is captured.

Since:
JAX-WS 2.0
See Also:
Serialized Form

Constructor Summary
HTTPException(int statusCode)
Constructor for the HTTPException
Method Summary
 int getStatusCode()
Gets the HTTP status code.
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

public HTTPException(int statusCode)
HTTPException 的构造方法
statusCode HTTP 状态代码的 int 值
英文文档：

HTTPException

public HTTPException(int statusCode)
Constructor for the HTTPException

Parameters:
statusCode - int for the HTTP status code
Method Detail

public int getStatusCode()
获取 HTTP 状态代码。
return HTTP 状态代码
英文文档：

getStatusCode

public int getStatusCode()
Gets the HTTP status code.

Returns:
HTTP status code
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.ws.soap (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.ws.soap

This package defines APIs specific to the SOAP binding.

See:
Description

Interface Summary
SOAPBinding The SOAPBinding interface is an abstraction for the SOAP binding.

Exception Summary
SOAPFaultException The SOAPFaultException exception represents a SOAP 1.1 or 1.2 fault.

Package javax.xml.ws.soap Description

This package defines APIs specific to the SOAP binding.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.ws.soap Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.ws.soap

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • java.lang.Throwable (implements java.io.Serializable)
      • java.lang.Exception
        • java.lang.RuntimeException
          • javax.xml.ws.WebServiceException
            • javax.xml.ws.ProtocolException
              • javax.xml.ws.soap.SOAPFaultException

Interface Hierarchy

  • javax.xml.ws.Binding
    • javax.xml.ws.soap.SOAPBinding
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


SOAPBinding (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.soap
Interface SOAPBinding

All Superinterfaces:
Binding
public interface SOAPBinding
extends Binding

Implements: Binding

SOAPBinding 接口是 SOAP 绑定的抽象。
since JAX-WS 2.0
英文文档：

The SOAPBinding interface is an abstraction for the SOAP binding.

Since:
JAX-WS 2.0

Field Summary
static String | SOAP11HTTP_BINDING A constant representing the identity of the SOAP 1.1 over HTTP binding.
static String | SOAP11HTTP_MTOM_BINDING A constant representing the identity of the SOAP 1.1 over HTTP binding with MTOM enabled by default.
static String | SOAP12HTTP_BINDING A constant representing the identity of the SOAP 1.2 over HTTP binding.
static String | SOAP12HTTP_MTOM_BINDING A constant representing the identity of the SOAP 1.2 over HTTP binding with MTOM enabled by default.
Method Summary
MessageFactory | getMessageFactory() Gets the SAAJ MessageFactory instance used by this SOAP binding.
Set<String> | getRoles() Gets the roles played by the SOAP binding instance.
SOAPFactory | getSOAPFactory() Gets the SAAJ SOAPFactory instance used by this SOAP binding.
boolean | isMTOMEnabled() Returns true if the use of MTOM is enabled.
void | setMTOMEnabled(boolean flag) Enables or disables use of MTOM.
void | setRoles(Set<String> roles) Sets the roles played by the SOAP binding instance.
Methods inherited from interface javax.xml.ws.Binding
getHandlerChain, setHandlerChain

Field Detail

英文文档：

SOAP11HTTP_BINDING

static final String SOAP11HTTP_BINDING
A constant representing the identity of the SOAP 1.1 over HTTP binding.

See Also:
Constant Field Values

英文文档：

SOAP12HTTP_BINDING

static final String SOAP12HTTP_BINDING
A constant representing the identity of the SOAP 1.2 over HTTP binding.

See Also:
Constant Field Values

英文文档：

SOAP11HTTP_MTOM_BINDING

static final String SOAP11HTTP_MTOM_BINDING
A constant representing the identity of the SOAP 1.1 over HTTP binding with MTOM enabled by default.

See Also:
Constant Field Values

英文文档：

SOAP12HTTP_MTOM_BINDING

static final String SOAP12HTTP_MTOM_BINDING
A constant representing the identity of the SOAP 1.2 over HTTP binding with MTOM enabled by default.

See Also:
Constant Field Values
Method Detail

public java.util.Set<E> getRoles()
获取 SOAP 绑定实例所扮演的角色。
return Set 绑定实例所扮演的角色的集合。
英文文档：

getRoles

Set<String> getRoles()
Gets the roles played by the SOAP binding instance.

Returns:
Set The set of roles played by the binding instance.

英文文档：

setRoles

void setRoles(Set<String> roles)
Sets the roles played by the SOAP binding instance.

Parameters:
roles - The set of roles played by the binding instance.
Throws:
WebServiceException - On an error in the configuration of the list of roles.

public boolean isMTOMEnabled()
如果启用了 MTOM，则返回 true。
return 当且仅当启用 MTOM 时，返回 true。
英文文档：

isMTOMEnabled

boolean isMTOMEnabled()
Returns true if the use of MTOM is enabled.

Returns:
true if and only if the use of MTOM is enabled.

public void setMTOMEnabled(boolean flag)
启用或禁用 MTOM。
flag | 指定是应该启用 MTOM 还是应该禁用 MTOM 的 boolean。
Throws | WebServiceException: 如果此绑定实例不支持指定的设置。
英文文档：

setMTOMEnabled

void setMTOMEnabled(boolean flag)
Enables or disables use of MTOM.

Parameters:
flag - A boolean specifying whether the use of MTOM should be enabled or disabled.
Throws:
WebServiceException - If the specified setting is not supported by this binding instance.

public SOAPFactory getSOAPFactory()
获取此 SOAP 绑定使用的 SAAJ SOAPFactory 实例。
return 此 SOAP 绑定使用的 SOAPFactory 实例。
英文文档：

getSOAPFactory

SOAPFactory getSOAPFactory()
Gets the SAAJ SOAPFactory instance used by this SOAP binding.

Returns:
SOAPFactory instance used by this SOAP binding.

public MessageFactory getMessageFactory()
获取此 SOAP 绑定使用的 SAAJ MessageFactory 实例。
return 此 SOAP 绑定使用的 MessageFactory 实例。
英文文档：

getMessageFactory

MessageFactory getMessageFactory()
Gets the SAAJ MessageFactory instance used by this SOAP binding.

Returns:
MessageFactory instance used by this SOAP binding.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


SOAPFaultException (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.soap
Class SOAPFaultException

java.lang.Object
    extended by  java.lang.Throwable
        extended by  java.lang.Exception
            extended by  java.lang.RuntimeException
                extended by  javax.xml.ws.WebServiceException
                    extended by  javax.xml.ws.ProtocolException
                        extended by  javax.xml.ws.soap.SOAPFaultException
All Implemented Interfaces:
Serializable
public class SOAPFaultException
extends ProtocolException

Extends: Throwable > Exception > RuntimeException

SOAPFaultException 异常表示 SOAP 错误。

SOAP 错误中的消息部分映射到 faultdetail 元素的内容，该元素可通过对 SOAPFaultException 调用 getDetail 方法进行访问。javax.xml.soap.SOAPFactory 上的 createDetail 方法可以创建一个 javax.xml.soap.Detail 实例。

faultstring 提供人类可读的 SOAP 错误描述。faultcode 元素提供 SOAP 错误的算法映射。

有关 SOAP 错误的更多细节，请参见 SOAP 1.1 和 WSDL 1.1 规范。

version | 1.0
See also | javax.xml.soap.Detail, createDetail
英文文档：

The SOAPFaultException exception represents a SOAP 1.1 or 1.2 fault.

A SOAPFaultException wraps a SAAJ SOAPFault that manages the SOAP-specific representation of faults. The createFault method of javax.xml.soap.SOAPFactory may be used to create an instance of javax.xml.soap.SOAPFault for use with the constructor. SOAPBinding contains an accessor for the SOAPFactory used by the binding instance.

Note that the value of getFault is the only part of the exception used when searializing a SOAP fault.

Refer to the SOAP specification for a complete description of SOAP faults.

Since:
JAX-WS 2.0
See Also:
SOAPFault, SOAPBinding.getSOAPFactory(), ProtocolException, Serialized Form

Constructor Summary
SOAPFaultException(SOAPFault fault)
Constructor for SOAPFaultException
Method Summary
 SOAPFault getFault()
Gets the embedded SOAPFault instance.
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

英文文档：

SOAPFaultException

public SOAPFaultException(SOAPFault fault)
Constructor for SOAPFaultException

Parameters:
fault - SOAPFault representing the fault
See Also:
SOAPFactory.createFault(java.lang.String, javax.xml.namespace.QName)
Method Detail

英文文档：

getFault

public SOAPFault getFault()
Gets the embedded SOAPFault instance.

Returns:
javax.xml.soap.SOAPFault SOAP fault element
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


javax.xml.ws.spi (Java EE 5)

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES

Package javax.xml.ws.spi

This package defines SPIs for JAX-WS 2.0.

See:
Description

Class Summary
Provider | Service provider for ServiceDelegate and Endpoint objects.
ServiceDelegate | Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.

Package javax.xml.ws.spi Description

This package defines SPIs for JAX-WS 2.0.

Overview Package Class Tree Deprecated Index Help
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES
Submit a bug or feature

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


javax.xml.ws.spi Class Hierarchy (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Hierarchy For Package javax.xml.ws.spi

Package Hierarchies:
All Packages

Class Hierarchy

  • java.lang.Object
    • javax.xml.ws.spi.Provider
    • javax.xml.ws.spi.ServiceDelegate
Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Provider (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.spi
Class Provider

java.lang.Object
    extended by  javax.xml.ws.spi.Provider

public abstract class Provider
extends Object

服务端点可以将 Provider 接口作为 SEI 的动态替代方法实现。要求实现支持 Provider<Source> 和 Provider<SOAPMessage>。 ServiceMode 注释可以用来控制 Provider 实例是收到整个协议消息还是只收到消息有效载荷。
since | JAX-WS 2.0
See also | javax.xml.transform.Source, javax.xml.soap.SOAPMessage, javax.xml.ws.ServiceMode
英文文档：

Service provider for ServiceDelegate and Endpoint objects.

Since:
JAX-WS 2.0

Field Summary
static String JAXWSPROVIDER_PROPERTY
A constant representing the property used to lookup the name of a Provider implementation class.
Constructor Summary
protected Provider()
Creates a new instance of Provider
Method Summary
abstract Endpoint | createAndPublishEndpoint(String address, Object implementor) Creates and publishes an endpoint object with the specified address and implementation object.
abstract Endpoint | createEndpoint(String bindingId, Object implementor) Creates an endpoint object with the provided binding and implementation object.
abstract ServiceDelegate | createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass) Creates a service delegate object.
static Provider | provider() Creates a new provider object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

英文文档：

JAXWSPROVIDER_PROPERTY

public static final String JAXWSPROVIDER_PROPERTY
A constant representing the property used to lookup the name of a Provider implementation class.

See Also:
Constant Field Values
Constructor Detail

英文文档：

Provider

protected Provider()
Creates a new instance of Provider

Method Detail

英文文档：

provider

public static Provider provider()
Creates a new provider object.

The algorithm used to locate the provider subclass to use consists of the following steps:

  • If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class.
  • If the $java.home/lib/jaxws.properties file exists and it is readable by the java.util.Properties.load(InputStream) method and it contains an entry whose key is javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class.
  • If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used as the name of the implementation class.
  • Finally, a default implementation class name is used.

英文文档：

createServiceDelegate

public abstract ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation,
                                                      QName serviceName,
                                                      Class serviceClass)
Creates a service delegate object.

Parameters:
wsdlDocumentLocation - A URL pointing to the WSDL document for the service, or null if there isn't one.
serviceName - The qualified name of the service.
serviceClass - The service class, which must be either javax.xml.ws.Service or a subclass thereof.
Returns:
The newly created service delegate.

英文文档：

createEndpoint

public abstract Endpoint createEndpoint(String bindingId,
                                        Object implementor)
Creates an endpoint object with the provided binding and implementation object.

Parameters:
bindingId - A URI specifying the desired binding (e.g. SOAP/HTTP)
implementor - A service implementation object to which incoming requests will be dispatched. The corresponding class must be annotated with all the necessary Web service annotations.
Returns:
The newly created endpoint.

英文文档：

createAndPublishEndpoint

public abstract Endpoint createAndPublishEndpoint(String address,
                                                  Object implementor)
Creates and publishes an endpoint object with the specified address and implementation object.

Parameters:
address - A URI specifying the address and transport/protocol to use. A http: URI must result in the SOAP 1.1/HTTP binding being used. Implementations may support other URI schemes.
implementor - A service implementation object to which incoming requests will be dispatched. The corresponding class must be annotated with all the necessary Web service annotations.
Returns:
The newly created endpoint.
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


ServiceDelegate (Java EE 5)

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

javax.xml.ws.spi
Class ServiceDelegate

java.lang.Object
    extended by  javax.xml.ws.spi.ServiceDelegate

public abstract class ServiceDelegate
extends Object

服务委托由 Service 对象内部使用，以允许插入 JAX-WS 实现。

每个 Service 对象都有自己的代理，这些代理是使用 javax.xml.ws.Provider#createServiceDelegate 方法创建的。Service 对象将其所有实例方法都委托给它的代理。

since | JAX-WS 2.0
See also | javax.xml.ws.Service, javax.xml.ws.spi.Provider
英文文档：

Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.

Every Service object has its own delegate, created using the javax.xml.ws.Provider#createServiceDelegate method. A Service object delegates all of its instance methods to its delegate.

Since:
JAX-WS 2.0
See Also:
Service, Provider

Constructor Summary
protected ServiceDelegate()
Method Summary
abstract  void addPort(QName portName, String bindingId, String endpointAddress)
Creates a new port for the service.
abstract
<T> Dispatch<T>
createDispatch(QName portName, Class<T> type, Service.Mode mode)
Creates a Dispatch instance for use with objects of the users choosing.
abstract  Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode)
Creates a Dispatch instance for use with JAXB generated objects.
abstract  Executor getExecutor()
Returns the executor for this Serviceinstance.
abstract  HandlerResolver getHandlerResolver()
Returns the configured handler resolver.
abstract
<T> T
getPort(Class<T> serviceEndpointInterface)
The getPort method returns a stub.
abstract
<T> T
getPort(QName portName, Class<T> serviceEndpointInterface)
The getPort method returns a stub.
abstract  Iterator<QName> getPorts()
Returns an Iterator for the list of QNames of service endpoints grouped by this service
abstract  QName getServiceName()
Gets the name of this service.
abstract  URL getWSDLDocumentLocation()
Gets the location of the WSDL document for this Service.
abstract  void setExecutor(Executor executor)
Sets the executor for this Service instance.
abstract  void setHandlerResolver(HandlerResolver handlerResolver)
Sets the HandlerResolver for this Service instance.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

protected ServiceDelegate()
英文文档：

ServiceDelegate

protected ServiceDelegate()
Method Detail

英文文档：

getPort

public abstract <T> T getPort(QName portName,
                              Class<T> serviceEndpointInterface)
The getPort method returns a stub. A service client uses this stub to invoke operations on the target service endpoint. The serviceEndpointInterface specifies the service endpoint interface that is supported by the created dynamic proxy or stub instance.

Parameters:
portName - Qualified name of the service endpoint in the WSDL service description
serviceEndpointInterface - Service endpoint interface supported by the dynamic proxy or stub instance
Returns:
Object Proxy instance that supports the specified service endpoint interface
Throws:
WebServiceException - This exception is thrown in the following cases:
  • If there is an error in creation of the proxy
  • If there is any missing WSDL metadata as required by this method
  • Optionally, if an illegal serviceEndpointInterface or portName is specified
See Also:
Proxy, InvocationHandler

英文文档：

getPort

public abstract <T> T getPort(Class<T> serviceEndpointInterface)
The getPort method returns a stub. The parameter serviceEndpointInterface specifies the service endpoint interface that is supported by the returned proxy. In the implementation of this method, the JAX-WS runtime system takes the responsibility of selecting a protocol binding (and a port) and configuring the proxy accordingly. The returned proxy should not be reconfigured by the client.

Parameters:
serviceEndpointInterface - Service endpoint interface
Returns:
Object instance that supports the specified service endpoint interface
Throws:
WebServiceException -
  • If there is an error during creation of the proxy
  • If there is any missing WSDL metadata as required by this method
  • Optionally, if an illegal serviceEndpointInterface is specified

abstract public void addPort(javax.xml.namespace.QName portName, String bindingId, String endpointAddress)
为服务创建新的端口。以这种方法创建的端口不包含 WSDL 端口类型信息，并且只能用于创建 Dispatch 实例。
portName | 目标服务端点的限定名称
bindingId | 绑定的 URI 标识符。
endpointAddress | URI 形式的目标服务端点地址
Throws | WebServiceException: 如果创建端口的过程中发生错误
See also | SOAP11HTTP_BINDING, SOAP12HTTP_BINDING, HTTP_BINDING
英文文档：

addPort

public abstract void addPort(QName portName,
                             String bindingId,
                             String endpointAddress)
Creates a new port for the service. Ports created in this way contain no WSDL port type information and can only be used for creating Dispatchinstances.

Parameters:
portName - Qualified name for the target service endpoint
bindingId - A URI identifier of a binding.
endpointAddress - Address of the target service endpoint as a URI
Throws:
WebServiceException - If any error in the creation of the port
See Also:
SOAPBinding.SOAP11HTTP_BINDING, SOAPBinding.SOAP12HTTP_BINDING, HTTPBinding.HTTP_BINDING

英文文档：

createDispatch

public abstract <T> Dispatch<T> createDispatch(QName portName,
                                               Class<T> type,
                                               Service.Mode mode)
Creates a Dispatch instance for use with objects of the users choosing.

Parameters:
portName - Qualified name for the target service endpoint
type - The class of object used to messages or message payloads. Implementations are required to support javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
mode - Controls whether the created dispatch instance is message or payload oriented, i.e. whether the user will work with complete protocol messages or message payloads. E.g. when using the SOAP protocol, this parameter controls whether the user will work with SOAP messages or the contents of a SOAP body. Mode must be MESSAGE when type is SOAPMessage.
Returns:
Dispatch instance
Throws:
WebServiceException - If any error in the creation of the Dispatch object
See Also:
Source, SOAPMessage

abstract public Dispatch createDispatch(javax.xml.namespace.QName portName, JAXBContext context, Service.Mode mode)
创建与 JAXB 生成的对象一起使用的 Dispatch 实例。
portName | 目标服务端点的限定名称
context | 用来对消息或消息负载进行编组和解组的 JAXB 上下文。
mode | 控制创建的 Dispatch 实例是消息还是所面向的净荷，即用户使用完整的协议消息还是消息负载。例如，当使用 SOAP 协议时，此参数控制用户将使用 SOAP 消息还是使用 SOAP 正文的内容。
return | dispatch 实例
Throws | ServiceException: 如果创建 Dispatch 对象的过程中发生错误
See also | javax.xml.bind.JAXBContext
英文文档：

createDispatch

public abstract Dispatch<Object> createDispatch(QName portName,
                                                JAXBContext context,
                                                Service.Mode mode)
Creates a Dispatch instance for use with JAXB generated objects.

Parameters:
portName - Qualified name for the target service endpoint
context - The JAXB context used to marshall and unmarshall messages or message payloads.
mode - Controls whether the created dispatch instance is message or payload oriented, i.e. whether the user will work with complete protocol messages or message payloads. E.g. when using the SOAP protocol, this parameter controls whether the user will work with SOAP messages or the contents of a SOAP body.
Returns:
Dispatch instance
Throws:
ServiceException - If any error in the creation of the Dispatch object
See Also:
JAXBContext

abstract public javax.xml.namespace.QName getServiceName()
获取此服务的名称。
return 此服务的限定名称
英文文档：

getServiceName

public abstract QName getServiceName()
Gets the name of this service.

Returns:
Qualified name of this service

abstract public java.util.Iterator<E> getPorts()
返回一个 Iterator，它用于此服务所组合的服务端点的 QName 列表。
return | 返回元素类型为 javax.xml.namespace.QName 的 java.util.Iterator
Throws | WebServiceException: 如果此 Service 类没有对所需 WSDL 元数据的访问权限
英文文档：

getPorts

public abstract Iterator<QName> getPorts()
Returns an Iterator for the list of QNames of service endpoints grouped by this service

Returns:
Returns java.util.Iterator with elements of type javax.xml.namespace.QName
Throws:
WebServiceException - If this Service class does not have access to the required WSDL metadata

abstract public java.net.URL getWSDLDocumentLocation()
获取此服务的 WSDL 文档的位置。
return 此服务 WSDL 文档位置的 URL
英文文档：

getWSDLDocumentLocation

public abstract URL getWSDLDocumentLocation()
Gets the location of the WSDL document for this Service.

Returns:
URL for the location of the WSDL document for this service

abstract public HandlerResolver getHandlerResolver()
返回已配置的处理程序解析器。
return HandlerResolver，此 Service 实例所使用的 HandlerResolver，如果不存在，则返回 null。
英文文档：

getHandlerResolver

public abstract HandlerResolver getHandlerResolver()
Returns the configured handler resolver.

Returns:
HandlerResolver The HandlerResolver being used by this Service instance, or null if there isn't one.

abstract public void setHandlerResolver(HandlerResolver handlerResolver)
设置此 Service 实例的 HandlerResolver。

如果存在处理程序解析器，则创建每个代理或 Dispatch 实例时将调用一次该解析器，并且将在实例上设置解析器所返回的处理程序链。

handlerResolver | 用于随后创建的代理/指派对象的 HandlerResolver。
See also | javax.xml.ws.handler.HandlerResolver
英文文档：

setHandlerResolver

public abstract void setHandlerResolver(HandlerResolver handlerResolver)
Sets the HandlerResolver for this Service instance.

The handler resolver, if present, will be called once for each proxy or dispatch instance that is created, and the handler chain returned by the resolver will be set on the instance.

Parameters:
handlerResolver - The HandlerResolver to use for all subsequently created proxy/dispatch objects.
See Also:
HandlerResolver

abstract public java.util.concurrent.Executor getExecutor()
返回此 Service 实例的执行程序。 该执行程序将用于所有需要回调的异步调用。
return | 将用来调用回调的 java.util.concurrent.Executor。
See also | java.util.concurrent.Executor
英文文档：

getExecutor

public abstract Executor getExecutor()
Returns the executor for this Serviceinstance. The executor is used for all asynchronous invocations that require callbacks.

Returns:
The java.util.concurrent.Executor to be used to invoke a callback.
See Also:
Executor

abstract public void setExecutor(java.util.concurrent.Executor executor)
设置此 Service 实例的执行程序。 该执行程序将用于所有需要回调的异步调用。
executor | 将用来调用回调的 java.util.concurrent.Executor。
Throws | SecurityException: 如果出于安全的原因（例如，缺少必要的权限），实例不支持设置执行程序。
See also | java.util.concurrent.Executor
英文文档：

setExecutor

public abstract void setExecutor(Executor executor)
Sets the executor for this Service instance. The executor is used for all asynchronous invocations that require callbacks.

Parameters:
executor - The java.util.concurrent.Executor to be used to invoke a callback.
Throws:
SecurityException - If the instance does not support setting an executor for security reasons (e.g. the necessary permissions are missing).
See Also:
Executor
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD


All Classes (Java EE 5)

 All Classes
AbortProcessingException
AbstractMarshallerImpl
AbstractUnmarshallerImpl
AccessLocalException
ActionEvent
ActionListener
ActionSource
ActionSource2
ActionType
ActivationConfigProperty
ActivationDataFlavor
ActivationSpec
Address
AddressException
AddressStringTerm
AddressTerm
AndTerm
Application
ApplicationException
ApplicationFactory
ApplicationServerInternalException
AroundInvoke
ArrayDataModel
ArrayELResolver
Association
AssociationOverride
AssociationOverrides
AsyncHandler
AttachmentMarshaller
AttachmentPart
AttachmentUnmarshaller
Attribute
AttributeOverride
AttributeOverrides
AttributeTag
AuditableEvent
AuthenticationFailedException
Authenticator
Basic
BeanELResolver
BeanELResolver.BeanProperties
BeanELResolver.BeanProperty
BeanNotFoundException
BigDecimalConverter
BigDecimalHolder
BigIntegerConverter
BigIntegerHolder
Binder
Binding
BindingProvider
BindingType
BodyContent
BodyPart
BodyTag
BodyTagSupport
BodyTerm
BooleanConverter
BooleanHolder
BooleanWrapperHolder
BootstrapContext
BoundaryStatistic
BoundedRangeStatistic
BulkResponse
BusinessLifeCycleManager
BusinessQueryManager
ByteArrayDataSource
ByteArrayHolder
ByteConverter
ByteHolder
BytesMessage
ByteWrapperHolder
CalendarHolder
Call
CapabilityProfile
CascadeType
CharacterConverter
Characters
Classification
ClassificationScheme
ClassTransformer
ClientConfiguration
ClientExecuteException
CollapsedStringAdapter
Column
ColumnResult
CommandInfo
CommandMap
CommandObject
CommandType
Comment
CommException
ComparisonTerm
CompositeELResolver
Concept
ConcurrentAccessException
ConfigurationException
Connection
Connection
Connection
ConnectionAdapter
ConnectionConsumer
ConnectionEvent
ConnectionEvent
ConnectionEventListener
ConnectionFactory
ConnectionFactory
ConnectionFactory
ConnectionListener
ConnectionManager
ConnectionMetaData
ConnectionMetaData
ConnectionRequestInfo
ConnectionSpec
ContentDisposition
ContentType
ContextCallback
Converter
ConverterELTag
ConverterException
ConverterTag
Cookie
CountStatistic
CreateException
DataContentHandler
DataContentHandlerFactory
DataHandler
DataModel
DataModelEvent
DataModelListener
DataSource
DatatypeConverter
DatatypeConverterInterface
DateTerm
DateTimeConverter
DConfigBean
DConfigBeanRoot
DConfigBeanVersionType
DConfigBeanVersionUnsupportedException
DDBean
DDBeanCreateException
DDBeanRoot
DeclarativeQueryManager
DeclareRoles
DefaultValidationEventHandler
DeleteException
DeliveryMode
DenyAll
DeployableObject
DeploymentConfiguration
DeploymentFactory
DeploymentFactoryManager
DeploymentManager
DeploymentManagerCreationException
DeploymentStatus
DeserializationContext
Deserializer
DeserializerFactory
Destination
Detail
DetailEntry
DiscriminatorColumn
DiscriminatorType
DiscriminatorValue
Dispatch
DissociatableManagedConnection
DomHandler
DoubleConverter
DoubleHolder
DoubleRangeValidator
DoubleWrapperHolder
DTD
DuplicateKeyException
DynamicAttributes
EditableValueHolder
EISSystemException
EJB
EJBAccessException
EJBContext
EJBException
EJBHome
EJBLocalHome
EJBLocalObject
EJBMetaData
EJBMethodPermission
EJBObject
EJBRoleRefPermission
EJBs
EJBStats
EJBTransactionRequiredException
EJBTransactionRolledbackException
ELContext
ELContextEvent
ELContextListener
Element
ELException
ELException
ELParseException
ELResolver
EmailAddress
Embeddable
Embedded
EmbeddedId
EndDocument
EndElement
Endpoint
EnterpriseBean
Entity
EntityBean
EntityBeanStats
EntityContext
EntityDeclaration
EntityExistsException
EntityListeners
EntityManager
EntityManagerFactory
EntityNotFoundException
EntityReference
EntityResult
EntityTransaction
EnumConverter
Enumerated
EnumType
ErrorData
EvaluationException
EventFilter
EventReaderDelegate
ExceptionListener
ExcludeClassInterceptors
ExcludeDefaultInterceptors
ExcludeDefaultListeners
ExcludeSuperclassListeners
ExecutionContext
Expression
Expression
ExpressionEvaluator
ExpressionFactory
ExtensibleObject
ExternalContext
ExternalIdentifier
ExternalLink
ExtrinsicObject
FacesContext
FacesContextFactory
FacesEvent
FacesException
FacesListener
FacesMessage
FacesMessage.Severity
FacesServlet
FacetTag
FactoryConfigurationError
FactoryFinder
FederatedConnection
FetchProfile
FetchProfile.Item
FetchType
FieldResult
FileDataSource
FileTypeMap
Filter
FilterChain
FilterConfig
FinderException
FindException
FindQualifier
Flags
Flags.Flag
FlagTerm
FloatConverter
FloatHolder
FloatWrapperHolder
FlushModeType
Folder
FolderAdapter
FolderClosedException
FolderEvent
FolderListener
FolderNotFoundException
FromStringTerm
FromTerm
FunctionInfo
FunctionMapper
FunctionMapper
Generated
GeneratedValue
GenerationType
GenericCredential
GenericHandler
GenericServlet
Handle
HandleDelegate
Handler
Handler
HandlerChain
HandlerChain
HandlerInfo
HandlerRegistry
HandlerResolver
Header
HeaderTerm
HeaderTokenizer
HeaderTokenizer.Token
HeuristicCommitException
HeuristicMixedException
HeuristicRollbackException
HexBinaryAdapter
Holder
Holder
HomeHandle
HtmlColumn
HtmlCommandButton
HtmlCommandLink
HtmlDataTable
HtmlForm
HtmlGraphicImage
HtmlInputHidden
HtmlInputSecret
HtmlInputText
HtmlInputTextarea
HtmlMessage
HtmlMessages
HtmlOutputFormat
HtmlOutputLabel
HtmlOutputLink
HtmlOutputText
HtmlPanelGrid
HtmlPanelGroup
HtmlSelectBooleanCheckbox
HtmlSelectManyCheckbox
HtmlSelectManyListbox
HtmlSelectManyMenu
HtmlSelectOneListbox
HtmlSelectOneMenu
HtmlSelectOneRadio
HTTPBinding
HTTPException
HttpJspPage
HttpServlet
HttpServletRequest
HttpServletRequestWrapper
HttpServletResponse
HttpServletResponseWrapper
HttpSession
HttpSessionActivationListener
HttpSessionAttributeListener
HttpSessionBindingEvent
HttpSessionBindingListener
HttpSessionContext
HttpSessionEvent
HttpSessionListener
HttpUtils
Id
IdClass
IllegalStateException
IllegalStateException
IllegalWriteException
ImplicitObjectELResolver
IndexedRecord
Inheritance
InheritanceType
Init
InitParam
IntegerComparisonTerm
IntegerConverter
IntegerWrapperHolder
Interaction
InteractionSpec
Interceptors
InternationalString
InternetAddress
InternetHeaders
InternetHeaders.InternetHeader
IntHolder
InvalidClientIDException
InvalidDestinationException
InvalidModuleException
InvalidPropertyException
InvalidRequestException
InvalidSelectorException
InvalidTransactionException
InvocationContext
IterationTag
J2eeApplicationObject
JavaMailStats
JAXBContext
JAXBElement
JAXBElement.GlobalScope
JAXBException
JAXBIntrospector
JAXBResult
JAXBSource
JAXRException
JAXRPCException
JAXRResponse
JCAConnectionPoolStats
JCAConnectionStats
JCAStats
JDBCConnectionPoolStats
JDBCConnectionStats
JDBCStats
JMSConnectionStats
JMSConsumerStats
JMSEndpointStats
JMSException
JMSProducerStats
JMSSecurityException
JMSSessionStats
JMSStats
JoinColumn
JoinColumns
JoinTable
JspApplicationContext
JspContext
JspEngineInfo
JspException
JspFactory
JspFragment
JspIdConsumer
JspPage
JspTag
JspTagException
JspWriter
JTAStats
JVMStats
Key
LazyAssociatableConnectionManager
LazyEnlistableConnectionManager
LazyEnlistableManagedConnection
LengthValidator
Lifecycle
LifecycleFactory
LifeCycleManager
ListDataModel
ListELResolver
ListenerRegistration
Lob
Local
LocalHome
LocalizedString
LocalTransaction
LocalTransaction
LocalTransactionException
Location
LockModeType
LogicalHandler
LogicalMessage
LogicalMessageContext
LongConverter
LongHolder
LongRangeValidator
LongWrapperHolder
MailcapCommandMap
MailDateFormat
MailEvent
ManagedConnection
ManagedConnectionFactory
ManagedConnectionMetaData
Management
ManagementHome
ManyToMany
ManyToOne
MapELResolver
MapKey
MapMessage
MappedRecord
MappedSuperclass
MarshalException
Marshaller
Marshaller.Listener
Message
Message
Message.RecipientType
MessageAware
MessageChangedEvent
MessageChangedListener
MessageConsumer
MessageContext
MessageContext
MessageContext
MessageContext.Scope
MessageCountAdapter
MessageCountEvent
MessageCountListener
MessageDriven
MessageDrivenBean
MessageDrivenBeanStats
MessageDrivenContext
MessageEndpoint
MessageEndpointFactory
MessageEOFException
MessageFactory
MessageFormatException
MessageIDTerm
MessageListener
MessageListener
MessageNotReadableException
MessageNotWriteableException
MessageNumberTerm
MessageProducer
MessageRemovedException
MessagingException
MethodBinding
MethodExpression
MethodExpressionActionListener
MethodExpressionValidator
MethodExpressionValueChangeListener
MethodInfo
MethodNotFoundException
MethodNotFoundException
MethodNotSupportedException
MimeBodyPart
MimeHeader
MimeHeaders
MimeMessage
MimeMessage.RecipientType
MimeMultipart
MimePart
MimePartDataSource
MimeType
MimeTypeParameterList
MimeTypeParseException
MimetypesFileTypeMap
MimeUtility
ModuleType
Multipart
MultipartDataSource
Name
NamedNativeQueries
NamedNativeQuery
NamedQueries
NamedQuery
Namespace
NamespaceConstants
NamingContainer
NavigationHandler
NewsAddress
Node
NonUniqueResultException
NoResultException
NormalizedStringAdapter
NoSuchEJBException
NoSuchEntityException
NoSuchObjectLocalException
NoSuchProviderException
NotationDeclaration
NotIdentifiableEvent
NotIdentifiableEventImpl
NotSupportedException
NotSupportedException
NotTerm
NumberConverter
ObjectHolder
ObjectMessage
ObjectNotFoundException
OneToMany
OneToOne
Oneway
OperationUnsupportedException
OptimisticLockException
OrderBy
Organization
OrTerm
PageContext
PageData
ParameterList
ParameterMode
ParseConversionEvent
ParseConversionEventImpl
ParseException
Part
PasswordAuthentication
PasswordCredential
PermitAll
Persistence
PersistenceContext
PersistenceContexts
PersistenceContextType
PersistenceException
PersistenceProperty
PersistenceProvider
PersistenceUnit
PersistenceUnitInfo
PersistenceUnits
PersistenceUnitTransactionType
PersonName
PhaseEvent
PhaseId
PhaseListener
PolicyConfiguration
PolicyConfigurationFactory
PolicyContext
PolicyContextException
PolicyContextHandler
PortInfo
PostActivate
PostalAddress
PostConstruct
PostLoad
PostPersist
PostRemove
PostUpdate
PreDestroy
PreencodedMimeBodyPart
PrePassivate
PrePersist
PreRemove
PreUpdate
PrimaryKeyJoinColumn
PrimaryKeyJoinColumns
PrintConversionEvent
PrintConversionEventImpl
ProcessingInstruction
ProgressEvent
ProgressListener
ProgressObject
PropertyException
PropertyNotFoundException
PropertyNotFoundException
PropertyNotWritableException
PropertyResolver
ProtocolException
Provider
Provider
Provider
Provider.Type
QNameHolder
Query
Query
QueryHint
QueryManager
Queue
QueueBrowser
QueueConnection
QueueConnectionFactory
QueueReceiver
QueueRequestor
QueueSender
QueueSession
Quota
Quota.Resource
QuotaAwareStore
RangeStatistic
ReadOnlyFolderException
ReceivedDateTerm
RecipientStringTerm
RecipientTerm
Record
RecordFactory
Referenceable
ReferenceSyntaxException
RegistryEntry
RegistryException
RegistryObject
RegistryPackage
RegistryService
Remote
RemoteHome
Remove
RemoveException
Renderer
RenderKit
RenderKitFactory
RequestDispatcher
RequestWrapper
Resource
Resource.AuthenticationType
ResourceAdapter
ResourceAdapterAssociation
ResourceAdapterInternalException
ResourceAdapterMetaData
ResourceAllocationException
ResourceAllocationException
ResourceBundleELResolver
ResourceException
Resources
ResourceWarning
Response
ResponseStateManager
ResponseStream
ResponseWrapper
ResponseWriter
ResponseWriterWrapper
ResultDataModel
ResultSet
ResultSetDataModel
ResultSetInfo
RolesAllowed
RollbackException
RollbackException
RunAs
SAAJMetaFactory
SAAJResult
SaveException
ScalarDataModel
SchemaOutputResolver
ScopedAttributeELResolver
SearchException
SearchTerm
SecondaryTable
SecondaryTables
SecurityException
SelectItem
SelectItemGroup
SendFailedException
SentDateTerm
SequenceGenerator
SerializationContext
Serializer
SerializerFactory
ServerSession
ServerSessionPool
Service
Service
Service
Service
Service.Mode
ServiceBinding
ServiceDelegate
ServiceException
ServiceFactory
ServiceLifecycle
ServiceMode
Servlet
ServletConfig
ServletContext
ServletContextAttributeEvent
ServletContextAttributeListener
ServletContextEvent
ServletContextListener
ServletEndpointContext
ServletException
ServletInputStream
ServletOutputStream
ServletRequest
ServletRequestAttributeEvent
ServletRequestAttributeListener
ServletRequestEvent
ServletRequestListener
ServletRequestWrapper
ServletResponse
ServletResponseWrapper
ServletStats
Session
Session
SessionBean
SessionBeanStats
SessionContext
SessionSynchronization
SharedByteArrayInputStream
SharedFileInputStream
SharedInputStream
SharingViolationException
ShortConverter
ShortHolder
ShortWrapperHolder
SimpleTag
SimpleTagSupport
SingleThreadModel
SizeTerm
SkipPageException
Slot
SOAPBinding
SOAPBinding
SOAPBinding.ParameterStyle
SOAPBinding.Style
SOAPBinding.Use
SOAPBody
SOAPBodyElement
SOAPConnection
SOAPConnectionFactory
SOAPConstants
SOAPElement
SOAPElementFactory
SOAPEnvelope
SOAPException
SOAPFactory
SOAPFault
SOAPFaultElement
SOAPFaultException
SOAPFaultException
SOAPHandler
SOAPHeader
SOAPHeaderElement
SOAPMessage
SOAPMessageContext
SOAPMessageContext
SOAPMessageHandler
SOAPMessageHandlers
SOAPPart
SpecificationLink
SqlResultSetMapping
SqlResultSetMappings
StartDocument
StartElement
Stateful
StatefulSessionBeanStats
StateHolder
Stateless
StatelessSessionBeanStats
StateManager
StateManagerWrapper
StateType
Statistic
Stats
Status
Store
StoreClosedException
StoreEvent
StoreListener
Streamable
StreamFilter
StreamMessage
StreamReaderDelegate
StringHolder
StringTerm
Stub
SubjectTerm
Synchronization
SystemException
Table
TableGenerator
Tag
TagAdapter
TagAttributeInfo
TagData
TagExtraInfo
TagFileInfo
TagInfo
TagLibraryInfo
TagLibraryValidator
TagSupport
TagVariableInfo
Target
TargetException
TargetModuleID
TelephoneNumber
Temporal
TemporalType
TemporaryQueue
TemporaryTopic
Text
TextMessage
TimedObject
Timeout
Timer
TimerHandle
TimerService
TimeStatistic
Topic
TopicConnection
TopicConnectionFactory
TopicPublisher
TopicRequestor
TopicSession
TopicSubscriber
Transaction
TransactionAttribute
TransactionAttributeType
TransactionInProgressException
TransactionManagement
TransactionManagementType
TransactionManager
TransactionRequiredException
TransactionRequiredException
TransactionRequiredLocalException
TransactionRolledBackException
TransactionRolledbackException
TransactionRolledbackLocalException
TransactionSynchronizationRegistry
Transient
Transport
TransportAdapter
TransportEvent
TransportListener
TryCatchFinally
TypeConstraintException
TypeMapping
TypeMappingRegistry
UIColumn
UICommand
UIComponent
UIComponentBase
UIComponentBodyTag
UIComponentClassicTagBase
UIComponentELTag
UIComponentTag
UIComponentTagBase
UIData
UIDFolder
UIDFolder.FetchProfileItem
UIForm
UIGraphic
UIInput
UIMessage
UIMessages
UINamingContainer
UIOutput
UIPanel
UIParameter
UISelectBoolean
UISelectItem
UISelectItems
UISelectMany
UISelectOne
UIViewRoot
UnavailableException
UnavailableException
UnexpectedObjectException
UniqueConstraint
UnmarshalException
Unmarshaller
Unmarshaller.Listener
UnmarshallerHandler
UnsupportedCapabilityException
UnsupportedDataTypeException
URIValidator
URLDataSource
URLName
URLStats
User
UserTransaction
ValidatingManagedConnectionFactory
ValidationEvent
ValidationEventCollector
ValidationEventHandler
ValidationEventImpl
ValidationEventLocator
ValidationEventLocatorImpl
ValidationException
ValidationMessage
Validator
Validator
ValidatorELTag
ValidatorException
ValidatorTag
ValueBinding
ValueChangeEvent
ValueChangeListener
ValueExpression
ValueHolder
VariableInfo
VariableMapper
VariableResolver
VariableResolver
Version
Versionable
ViewExpiredException
ViewHandler
ViewHandlerWrapper
W3CDomHandler
WebEndpoint
WebFault
WebMethod
WebParam
WebParam.Mode
WebResourcePermission
WebResult
WebRoleRefPermission
WebService
WebServiceClient
WebServiceContext
WebServiceException
WebServicePermission
WebServiceProvider
WebServiceRef
WebServiceRefs
WebUserDataPermission
Work
WorkAdapter
WorkCompletedException
WorkEvent
WorkException
WorkListener
WorkManager
WorkRejectedException
XAConnection
XAConnectionFactory
XAException
XAQueueConnection
XAQueueConnectionFactory
XAQueueSession
XAResource
XASession
XATerminator
XATopicConnection
XATopicConnectionFactory
XATopicSession
Xid
XmlAccessOrder
XmlAccessorOrder
XmlAccessorType
XmlAccessType
XmlAdapter
XmlAnyAttribute
XmlAnyElement
XmlAttachmentRef
XmlAttribute
XmlElement
XmlElement.DEFAULT
XmlElementDecl
XmlElementDecl.GLOBAL
XmlElementRef
XmlElementRef.DEFAULT
XmlElementRefs
XmlElements
XmlElementWrapper
XmlEnum
XmlEnumValue
XMLEvent
XMLEventAllocator
XMLEventConsumer
XMLEventFactory
XMLEventReader
XMLEventWriter
XmlID
XmlIDREF
XmlInlineBinaryData
XMLInputFactory
XmlJavaTypeAdapter
XmlJavaTypeAdapter.DEFAULT
XmlJavaTypeAdapters
XmlList
XmlMimeType
XmlMixed
XmlNs
XmlNsForm
XMLOutputFactory
XmlRegistry
XMLReporter
XMLResolver
XmlRootElement
XmlSchema
XmlSchemaType
XmlSchemaType.DEFAULT
XmlSchemaTypes
XMLStreamConstants
XMLStreamException
XMLStreamReader
XMLStreamWriter
XmlTransient
XmlType
XMLType
XmlType.DEFAULT
XmlValue
XpathEvent
XpathListener


Constant Field Values (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Constant Field Values

Contents
  • javax.el.*
  • javax.faces.*
  • javax.jms.*
  • javax.mail.*
  • javax.persistence.*
  • javax.resource.*
  • javax.servlet.*
  • javax.transaction.*
  • javax.xml.*
javax.el.*

javax.el.ELResolver
public static final String | RESOLVABLE_AT_DESIGN_TIME | "resolvableAtDesignTime"
public static final String | TYPE | "type"

javax.faces.*

javax.faces.FactoryFinder
public static final String | APPLICATION_FACTORY | "javax.faces.application.ApplicationFactory"
public static final String | FACES_CONTEXT_FACTORY | "javax.faces.context.FacesContextFactory"
public static final String | LIFECYCLE_FACTORY | "javax.faces.lifecycle.LifecycleFactory"
public static final String | RENDER_KIT_FACTORY | "javax.faces.render.RenderKitFactory"

javax.faces.application.FacesMessage
public static final String FACES_MESSAGES "javax.faces.Messages"

javax.faces.application.StateManager
public static final String | STATE_SAVING_METHOD_CLIENT | "client"
public static final String | STATE_SAVING_METHOD_PARAM_NAME | "javax.faces.STATE_SAVING_METHOD"
public static final String | STATE_SAVING_METHOD_SERVER | "server"

javax.faces.application.ViewHandler
public static final String | CHARACTER_ENCODING_KEY | "javax.faces.request.charset"
public static final String | DEFAULT_SUFFIX | ".jsp"
public static final String | DEFAULT_SUFFIX_PARAM_NAME | "javax.faces.DEFAULT_SUFFIX"

javax.faces.component.NamingContainer
public static final char SEPARATOR_CHAR 58

javax.faces.component.UIColumn
public static final String | COMPONENT_FAMILY | "javax.faces.Column"
public static final String | COMPONENT_TYPE | "javax.faces.Column"

javax.faces.component.UICommand
public static final String | COMPONENT_FAMILY | "javax.faces.Command"
public static final String | COMPONENT_TYPE | "javax.faces.Command"

javax.faces.component.UIData
public static final String | COMPONENT_FAMILY | "javax.faces.Data"
public static final String | COMPONENT_TYPE | "javax.faces.Data"

javax.faces.component.UIForm
public static final String | COMPONENT_FAMILY | "javax.faces.Form"
public static final String | COMPONENT_TYPE | "javax.faces.Form"

javax.faces.component.UIGraphic
public static final String | COMPONENT_FAMILY | "javax.faces.Graphic"
public static final String | COMPONENT_TYPE | "javax.faces.Graphic"

javax.faces.component.UIInput
public static final String | COMPONENT_FAMILY | "javax.faces.Input"
public static final String | COMPONENT_TYPE | "javax.faces.Input"
public static final String | CONVERSION_MESSAGE_ID | "javax.faces.component.UIInput.CONVERSION"
public static final String | REQUIRED_MESSAGE_ID | "javax.faces.component.UIInput.REQUIRED"
public static final String | UPDATE_MESSAGE_ID | "javax.faces.component.UIInput.UPDATE"

javax.faces.component.UIMessage
public static final String | COMPONENT_FAMILY | "javax.faces.Message"
public static final String | COMPONENT_TYPE | "javax.faces.Message"

javax.faces.component.UIMessages
public static final String | COMPONENT_FAMILY | "javax.faces.Messages"
public static final String | COMPONENT_TYPE | "javax.faces.Messages"

javax.faces.component.UINamingContainer
public static final String | COMPONENT_FAMILY | "javax.faces.NamingContainer"
public static final String | COMPONENT_TYPE | "javax.faces.NamingContainer"

javax.faces.component.UIOutput
public static final String | COMPONENT_FAMILY | "javax.faces.Output"
public static final String | COMPONENT_TYPE | "javax.faces.Output"

javax.faces.component.UIPanel
public static final String | COMPONENT_FAMILY | "javax.faces.Panel"
public static final String | COMPONENT_TYPE | "javax.faces.Panel"

javax.faces.component.UIParameter
public static final String | COMPONENT_FAMILY | "javax.faces.Parameter"
public static final String | COMPONENT_TYPE | "javax.faces.Parameter"

javax.faces.component.UISelectBoolean
public static final String | COMPONENT_FAMILY | "javax.faces.SelectBoolean"
public static final String | COMPONENT_TYPE | "javax.faces.SelectBoolean"

javax.faces.component.UISelectItem
public static final String | COMPONENT_FAMILY | "javax.faces.SelectItem"
public static final String | COMPONENT_TYPE | "javax.faces.SelectItem"

javax.faces.component.UISelectItems
public static final String | COMPONENT_FAMILY | "javax.faces.SelectItems"
public static final String | COMPONENT_TYPE | "javax.faces.SelectItems"

javax.faces.component.UISelectMany
public static final String | COMPONENT_FAMILY | "javax.faces.SelectMany"
public static final String | COMPONENT_TYPE | "javax.faces.SelectMany"
public static final String | INVALID_MESSAGE_ID | "javax.faces.component.UISelectMany.INVALID"

javax.faces.component.UISelectOne
public static final String | COMPONENT_FAMILY | "javax.faces.SelectOne"
public static final String | COMPONENT_TYPE | "javax.faces.SelectOne"
public static final String | INVALID_MESSAGE_ID | "javax.faces.component.UISelectOne.INVALID"

javax.faces.component.UIViewRoot
public static final String | COMPONENT_FAMILY | "javax.faces.ViewRoot"
public static final String | COMPONENT_TYPE | "javax.faces.ViewRoot"
public static final String | UNIQUE_ID_PREFIX | "j_id"

javax.faces.component.html.HtmlColumn
public static final String COMPONENT_TYPE "javax.faces.HtmlColumn"

javax.faces.component.html.HtmlCommandButton
public static final String COMPONENT_TYPE "javax.faces.HtmlCommandButton"

javax.faces.component.html.HtmlCommandLink
public static final String COMPONENT_TYPE "javax.faces.HtmlCommandLink"

javax.faces.component.html.HtmlDataTable
public static final String COMPONENT_TYPE "javax.faces.HtmlDataTable"

javax.faces.component.html.HtmlForm
public static final String COMPONENT_TYPE "javax.faces.HtmlForm"

javax.faces.component.html.HtmlGraphicImage
public static final String COMPONENT_TYPE "javax.faces.HtmlGraphicImage"

javax.faces.component.html.HtmlInputHidden
public static final String COMPONENT_TYPE "javax.faces.HtmlInputHidden"

javax.faces.component.html.HtmlInputSecret
public static final String COMPONENT_TYPE "javax.faces.HtmlInputSecret"

javax.faces.component.html.HtmlInputText
public static final String COMPONENT_TYPE "javax.faces.HtmlInputText"

javax.faces.component.html.HtmlInputTextarea
public static final String COMPONENT_TYPE "javax.faces.HtmlInputTextarea"

javax.faces.component.html.HtmlMessage
public static final String COMPONENT_TYPE "javax.faces.HtmlMessage"

javax.faces.component.html.HtmlMessages
public static final String COMPONENT_TYPE "javax.faces.HtmlMessages"

javax.faces.component.html.HtmlOutputFormat
public static final String COMPONENT_TYPE "javax.faces.HtmlOutputFormat"

javax.faces.component.html.HtmlOutputLabel
public static final String COMPONENT_TYPE "javax.faces.HtmlOutputLabel"

javax.faces.component.html.HtmlOutputLink
public static final String COMPONENT_TYPE "javax.faces.HtmlOutputLink"

javax.faces.component.html.HtmlOutputText
public static final String COMPONENT_TYPE "javax.faces.HtmlOutputText"

javax.faces.component.html.HtmlPanelGrid
public static final String COMPONENT_TYPE "javax.faces.HtmlPanelGrid"

javax.faces.component.html.HtmlPanelGroup
public static final String COMPONENT_TYPE "javax.faces.HtmlPanelGroup"

javax.faces.component.html.HtmlSelectBooleanCheckbox
public static final String COMPONENT_TYPE "javax.faces.HtmlSelectBooleanCheckbox"

javax.faces.component.html.HtmlSelectManyCheckbox
public static final String COMPONENT_TYPE "javax.faces.HtmlSelectManyCheckbox"

javax.faces.component.html.HtmlSelectManyListbox
public static final String COMPONENT_TYPE "javax.faces.HtmlSelectManyListbox"

javax.faces.component.html.HtmlSelectManyMenu
public static final String COMPONENT_TYPE "javax.faces.HtmlSelectManyMenu"

javax.faces.component.html.HtmlSelectOneListbox
public static final String COMPONENT_TYPE "javax.faces.HtmlSelectOneListbox"

javax.faces.component.html.HtmlSelectOneMenu
public static final String COMPONENT_TYPE "javax.faces.HtmlSelectOneMenu"

javax.faces.component.html.HtmlSelectOneRadio
public static final String COMPONENT_TYPE "javax.faces.HtmlSelectOneRadio"

javax.faces.context.ExternalContext
public static final String | BASIC_AUTH | "BASIC"
public static final String | CLIENT_CERT_AUTH | "CLIENT_CERT"
public static final String | DIGEST_AUTH | "DIGEST"
public static final String | FORM_AUTH | "FORM"

javax.faces.convert.BigDecimalConverter
public static final String | CONVERTER_ID | "javax.faces.BigDecimal"
public static final String | DECIMAL_ID | "javax.faces.converter.BigDecimalConverter.DECIMAL"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.BigIntegerConverter
public static final String | BIGINTEGER_ID | "javax.faces.converter.BigIntegerConverter.BIGINTEGER"
public static final String | CONVERTER_ID | "javax.faces.BigInteger"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.BooleanConverter
public static final String | BOOLEAN_ID | "javax.faces.converter.BooleanConverter.BOOLEAN"
public static final String | CONVERTER_ID | "javax.faces.Boolean"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.ByteConverter
public static final String | BYTE_ID | "javax.faces.converter.ByteConverter.BYTE"
public static final String | CONVERTER_ID | "javax.faces.Byte"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.CharacterConverter
public static final String | CHARACTER_ID | "javax.faces.converter.CharacterConverter.CHARACTER"
public static final String | CONVERTER_ID | "javax.faces.Character"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.DateTimeConverter
public static final String | CONVERTER_ID | "javax.faces.DateTime"
public static final String | DATE_ID | "javax.faces.converter.DateTimeConverter.DATE"
public static final String | DATETIME_ID | "javax.faces.converter.DateTimeConverter.DATETIME"
public static final String | STRING_ID | "javax.faces.converter.STRING"
public static final String | TIME_ID | "javax.faces.converter.DateTimeConverter.TIME"

javax.faces.convert.DoubleConverter
public static final String | CONVERTER_ID | "javax.faces.Double"
public static final String | DOUBLE_ID | "javax.faces.converter.DoubleConverter.DOUBLE"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.EnumConverter
public static final String | CONVERTER_ID | "javax.faces.Enum"
public static final String | ENUM_ID | "javax.faces.converter.EnumConverter.ENUM"
public static final String | ENUM_NO_CLASS_ID | "javax.faces.converter.EnumConverter.ENUM_NO_CLASS"

javax.faces.convert.FloatConverter
public static final String | CONVERTER_ID | "javax.faces.Float"
public static final String | FLOAT_ID | "javax.faces.converter.FloatConverter.FLOAT"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.IntegerConverter
public static final String | CONVERTER_ID | "javax.faces.Integer"
public static final String | INTEGER_ID | "javax.faces.converter.IntegerConverter.INTEGER"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.LongConverter
public static final String | CONVERTER_ID | "javax.faces.Long"
public static final String | LONG_ID | "javax.faces.converter.LongConverter.LONG"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.NumberConverter
public static final String | CONVERTER_ID | "javax.faces.Number"
public static final String | CURRENCY_ID | "javax.faces.converter.NumberConverter.CURRENCY"
public static final String | NUMBER_ID | "javax.faces.converter.NumberConverter.NUMBER"
public static final String | PATTERN_ID | "javax.faces.converter.NumberConverter.PATTERN"
public static final String | PERCENT_ID | "javax.faces.converter.NumberConverter.PERCENT"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.convert.ShortConverter
public static final String | CONVERTER_ID | "javax.faces.Short"
public static final String | SHORT_ID | "javax.faces.converter.ShortConverter.SHORT"
public static final String | STRING_ID | "javax.faces.converter.STRING"

javax.faces.lifecycle.LifecycleFactory
public static final String DEFAULT_LIFECYCLE "DEFAULT"

javax.faces.render.RenderKitFactory
public static final String HTML_BASIC_RENDER_KIT "HTML_BASIC"

javax.faces.render.ResponseStateManager
public static final String | RENDER_KIT_ID_PARAM | "javax.faces.RenderKitId"
public static final String | VIEW_STATE_PARAM | "javax.faces.ViewState"

javax.faces.validator.DoubleRangeValidator
public static final String | MAXIMUM_MESSAGE_ID | "javax.faces.validator.DoubleRangeValidator.MAXIMUM"
public static final String | MINIMUM_MESSAGE_ID | "javax.faces.validator.DoubleRangeValidator.MINIMUM"
public static final String | NOT_IN_RANGE_MESSAGE_ID | "javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE"
public static final String | TYPE_MESSAGE_ID | "javax.faces.validator.DoubleRangeValidator.TYPE"
public static final String | VALIDATOR_ID | "javax.faces.DoubleRange"

javax.faces.validator.LengthValidator
public static final String | MAXIMUM_MESSAGE_ID | "javax.faces.validator.LengthValidator.MAXIMUM"
public static final String | MINIMUM_MESSAGE_ID | "javax.faces.validator.LengthValidator.MINIMUM"
public static final String | VALIDATOR_ID | "javax.faces.Length"

javax.faces.validator.LongRangeValidator
public static final String | MAXIMUM_MESSAGE_ID | "javax.faces.validator.LongRangeValidator.MAXIMUM"
public static final String | MINIMUM_MESSAGE_ID | "javax.faces.validator.LongRangeValidator.MINIMUM"
public static final String | NOT_IN_RANGE_MESSAGE_ID | "javax.faces.validator.LongRangeValidator.NOT_IN_RANGE"
public static final String | TYPE_MESSAGE_ID | "javax.faces.validator.LongRangeValidator.TYPE"
public static final String | VALIDATOR_ID | "javax.faces.LongRange"

javax.faces.validator.Validator
public static final String NOT_IN_RANGE_MESSAGE_ID "javax.faces.validator.NOT_IN_RANGE"

javax.faces.webapp.FacesServlet
public static final String | CONFIG_FILES_ATTR | "javax.faces.CONFIG_FILES"
public static final String | LIFECYCLE_ID_ATTR | "javax.faces.LIFECYCLE_ID"

javax.faces.webapp.UIComponentClassicTagBase
protected static final String UNIQUE_ID_PREFIX "j_id_"

javax.jms.*

javax.jms.DeliveryMode
public static final int | NON_PERSISTENT | 1
public static final int | PERSISTENT | 2

javax.jms.Message
public static final int | DEFAULT_DELIVERY_MODE | 2
public static final int | DEFAULT_PRIORITY | 4
public static final long | DEFAULT_TIME_TO_LIVE | 0L

javax.jms.Session
public static final int | AUTO_ACKNOWLEDGE | 1
public static final int | CLIENT_ACKNOWLEDGE | 2
public static final int | DUPS_OK_ACKNOWLEDGE | 3
public static final int | SESSION_TRANSACTED | 0

javax.mail.*

javax.mail.Folder
public static final int | HOLDS_FOLDERS | 2
public static final int | HOLDS_MESSAGES | 1
public static final int | READ_ONLY | 1
public static final int | READ_WRITE | 2

javax.mail.Part
public static final String | ATTACHMENT | "attachment"
public static final String | INLINE | "inline"

javax.mail.UIDFolder
public static final long LASTUID -1L

javax.mail.event.ConnectionEvent
public static final int | CLOSED | 3
public static final int | DISCONNECTED | 2
public static final int | OPENED | 1

javax.mail.event.FolderEvent
public static final int | CREATED | 1
public static final int | DELETED | 2
public static final int | RENAMED | 3

javax.mail.event.MessageChangedEvent
public static final int | ENVELOPE_CHANGED | 2
public static final int | FLAGS_CHANGED | 1

javax.mail.event.MessageCountEvent
public static final int | ADDED | 1
public static final int | REMOVED | 2

javax.mail.event.StoreEvent
public static final int | ALERT | 1
public static final int | NOTICE | 2

javax.mail.event.TransportEvent
public static final int | MESSAGE_DELIVERED | 1
public static final int | MESSAGE_NOT_DELIVERED | 2
public static final int | MESSAGE_PARTIALLY_DELIVERED | 3

javax.mail.internet.HeaderTokenizer
public static final String | MIME | "()<>@,;:\\\"\t []/?="
public static final String | RFC822 | "()<>@,;:\\\"\t .[]"

javax.mail.internet.HeaderTokenizer.Token
public static final int | ATOM | -1
public static final int | COMMENT | -3
public static final int | EOF | -4
public static final int | QUOTEDSTRING | -2

javax.mail.internet.MimeUtility
public static final int ALL -1

javax.mail.search.ComparisonTerm
public static final int | EQ | 3
public static final int | GE | 6
public static final int | GT | 5
public static final int | LE | 1
public static final int | LT | 2
public static final int | NE | 4

javax.persistence.*

javax.persistence.Persistence
public static final String PERSISTENCE_PROVIDER "javax.persistence.spi.PeristenceProvider"

javax.resource.*

javax.resource.cci.InteractionSpec
public static final int | SYNC_RECEIVE | 2
public static final int | SYNC_SEND | 0
public static final int | SYNC_SEND_RECEIVE | 1

javax.resource.spi.ConnectionEvent
public static final int | CONNECTION_CLOSED | 1
public static final int | CONNECTION_ERROR_OCCURRED | 5
public static final int | LOCAL_TRANSACTION_COMMITTED | 3
public static final int | LOCAL_TRANSACTION_ROLLEDBACK | 4
public static final int | LOCAL_TRANSACTION_STARTED | 2

javax.resource.spi.work.WorkEvent
public static final int | WORK_ACCEPTED | 1
public static final int | WORK_COMPLETED | 4
public static final int | WORK_REJECTED | 2
public static final int | WORK_STARTED | 3

javax.resource.spi.work.WorkException
public static final String | INTERNAL | "-1"
public static final String | START_TIMED_OUT | "1"
public static final String | TX_CONCURRENT_WORK_DISALLOWED | "2"
public static final String | TX_RECREATE_FAILED | "3"
public static final String | UNDEFINED | "0"

javax.resource.spi.work.WorkManager
public static final long | IMMEDIATE | 0L
public static final long | INDEFINITE | 9223372036854775807L
public static final long | UNKNOWN | -1L

javax.servlet.*

javax.servlet.http.HttpServletRequest
public static final String | BASIC_AUTH | "BASIC"
public static final String | CLIENT_CERT_AUTH | "CLIENT_CERT"
public static final String | DIGEST_AUTH | "DIGEST"
public static final String | FORM_AUTH | "FORM"

javax.servlet.http.HttpServletResponse
public static final int | SC_ACCEPTED | 202
public static final int | SC_BAD_GATEWAY | 502
public static final int | SC_BAD_REQUEST | 400
public static final int | SC_CONFLICT | 409
public static final int | SC_CONTINUE | 100
public static final int | SC_CREATED | 201
public static final int | SC_EXPECTATION_FAILED | 417
public static final int | SC_FORBIDDEN | 403
public static final int | SC_FOUND | 302
public static final int | SC_GATEWAY_TIMEOUT | 504
public static final int | SC_GONE | 410
public static final int | SC_HTTP_VERSION_NOT_SUPPORTED | 505
public static final int | SC_INTERNAL_SERVER_ERROR | 500
public static final int | SC_LENGTH_REQUIRED | 411
public static final int | SC_METHOD_NOT_ALLOWED | 405
public static final int | SC_MOVED_PERMANENTLY | 301
public static final int | SC_MOVED_TEMPORARILY | 302
public static final int | SC_MULTIPLE_CHOICES | 300
public static final int | SC_NO_CONTENT | 204
public static final int | SC_NON_AUTHORITATIVE_INFORMATION | 203
public static final int | SC_NOT_ACCEPTABLE | 406
public static final int | SC_NOT_FOUND | 404
public static final int | SC_NOT_IMPLEMENTED | 501
public static final int | SC_NOT_MODIFIED | 304
public static final int | SC_OK | 200
public static final int | SC_PARTIAL_CONTENT | 206
public static final int | SC_PAYMENT_REQUIRED | 402
public static final int | SC_PRECONDITION_FAILED | 412
public static final int | SC_PROXY_AUTHENTICATION_REQUIRED | 407
public static final int | SC_REQUEST_ENTITY_TOO_LARGE | 413
public static final int | SC_REQUEST_TIMEOUT | 408
public static final int | SC_REQUEST_URI_TOO_LONG | 414
public static final int | SC_REQUESTED_RANGE_NOT_SATISFIABLE | 416
public static final int | SC_RESET_CONTENT | 205
public static final int | SC_SEE_OTHER | 303
public static final int | SC_SERVICE_UNAVAILABLE | 503
public static final int | SC_SWITCHING_PROTOCOLS | 101
public static final int | SC_TEMPORARY_REDIRECT | 307
public static final int | SC_UNAUTHORIZED | 401
public static final int | SC_UNSUPPORTED_MEDIA_TYPE | 415
public static final int | SC_USE_PROXY | 305

javax.servlet.jsp.JspWriter
public static final int | DEFAULT_BUFFER | -1
public static final int | NO_BUFFER | 0
public static final int | UNBOUNDED_BUFFER | -2

javax.servlet.jsp.PageContext
public static final String | APPLICATION | "javax.servlet.jsp.jspApplication"
public static final int | APPLICATION_SCOPE | 4
public static final String | CONFIG | "javax.servlet.jsp.jspConfig"
public static final String | EXCEPTION | "javax.servlet.jsp.jspException"
public static final String | OUT | "javax.servlet.jsp.jspOut"
public static final String | PAGE | "javax.servlet.jsp.jspPage"
public static final int | PAGE_SCOPE | 1
public static final String | PAGECONTEXT | "javax.servlet.jsp.jspPageContext"
public static final String | REQUEST | "javax.servlet.jsp.jspRequest"
public static final int | REQUEST_SCOPE | 2
public static final String | RESPONSE | "javax.servlet.jsp.jspResponse"
public static final String | SESSION | "javax.servlet.jsp.jspSession"
public static final int | SESSION_SCOPE | 3

javax.servlet.jsp.tagext.BodyTag
public static final int | EVAL_BODY_BUFFERED | 2
public static final int | EVAL_BODY_TAG | 2

javax.servlet.jsp.tagext.IterationTag
public static final int EVAL_BODY_AGAIN 2

javax.servlet.jsp.tagext.Tag
public static final int | EVAL_BODY_INCLUDE | 1
public static final int | EVAL_PAGE | 6
public static final int | SKIP_BODY | 0
public static final int | SKIP_PAGE | 5

javax.servlet.jsp.tagext.TagAttributeInfo
public static final String ID "id"

javax.servlet.jsp.tagext.TagInfo
public static final String | BODY_CONTENT_EMPTY | "empty"
public static final String | BODY_CONTENT_JSP | "JSP"
public static final String | BODY_CONTENT_SCRIPTLESS | "scriptless"
public static final String | BODY_CONTENT_TAG_DEPENDENT | "tagdependent"

javax.servlet.jsp.tagext.VariableInfo
public static final int | AT_BEGIN | 1
public static final int | AT_END | 2
public static final int | NESTED | 0

javax.transaction.*

javax.transaction.Status
public static final int | STATUS_ACTIVE | 0
public static final int | STATUS_COMMITTED | 3
public static final int | STATUS_COMMITTING | 8
public static final int | STATUS_MARKED_ROLLBACK | 1
public static final int | STATUS_NO_TRANSACTION | 6
public static final int | STATUS_PREPARED | 2
public static final int | STATUS_PREPARING | 7
public static final int | STATUS_ROLLEDBACK | 4
public static final int | STATUS_ROLLING_BACK | 9
public static final int | STATUS_UNKNOWN | 5

javax.transaction.xa.XAException
public static final int | XA_HEURCOM | 7
public static final int | XA_HEURHAZ | 8
public static final int | XA_HEURMIX | 5
public static final int | XA_HEURRB | 6
public static final int | XA_NOMIGRATE | 9
public static final int | XA_RBBASE | 100
public static final int | XA_RBCOMMFAIL | 101
public static final int | XA_RBDEADLOCK | 102
public static final int | XA_RBEND | 107
public static final int | XA_RBINTEGRITY | 103
public static final int | XA_RBOTHER | 104
public static final int | XA_RBPROTO | 105
public static final int | XA_RBROLLBACK | 100
public static final int | XA_RBTIMEOUT | 106
public static final int | XA_RBTRANSIENT | 107
public static final int | XA_RDONLY | 3
public static final int | XA_RETRY | 4
public static final int | XAER_ASYNC | -2
public static final int | XAER_DUPID | -8
public static final int | XAER_INVAL | -5
public static final int | XAER_NOTA | -4
public static final int | XAER_OUTSIDE | -9
public static final int | XAER_PROTO | -6
public static final int | XAER_RMERR | -3
public static final int | XAER_RMFAIL | -7

javax.transaction.xa.XAResource
public static final int | TMENDRSCAN | 8388608
public static final int | TMFAIL | 536870912
public static final int | TMJOIN | 2097152
public static final int | TMNOFLAGS | 0
public static final int | TMONEPHASE | 1073741824
public static final int | TMRESUME | 134217728
public static final int | TMSTARTRSCAN | 16777216
public static final int | TMSUCCESS | 67108864
public static final int | TMSUSPEND | 33554432
public static final int | XA_OK | 0
public static final int | XA_RDONLY | 3

javax.transaction.xa.Xid
public static final int | MAXBQUALSIZE | 64
public static final int | MAXGTRIDSIZE | 64

javax.xml.*

javax.xml.bind.JAXBContext
public static final String JAXB_CONTEXT_FACTORY "javax.xml.bind.context.factory"

javax.xml.bind.Marshaller
public static final String | JAXB_ENCODING | "jaxb.encoding"
public static final String | JAXB_FORMATTED_OUTPUT | "jaxb.formatted.output"
public static final String | JAXB_FRAGMENT | "jaxb.fragment"
public static final String | JAXB_NO_NAMESPACE_SCHEMA_LOCATION | "jaxb.noNamespaceSchemaLocation"
public static final String | JAXB_SCHEMA_LOCATION | "jaxb.schemaLocation"

javax.xml.bind.ValidationEvent
public static final int | ERROR | 1
public static final int | FATAL_ERROR | 2
public static final int | WARNING | 0

javax.xml.registry.FindQualifier
public static final String | AND_ALL_KEYS | "andAllKeys"
public static final String | CASE_SENSITIVE_MATCH | "caseSensitiveMatch"
public static final String | COMBINE_CLASSIFICATIONS | "combineClassifications"
public static final String | EXACT_NAME_MATCH | "exactNameMatch"
public static final String | OR_ALL_KEYS | "orAllKeys"
public static final String | OR_LIKE_KEYS | "orLikeKeys"
public static final String | SERVICE_SUBSET | "serviceSubset"
public static final String | SORT_BY_DATE_ASC | "sortByDateAsc"
public static final String | SORT_BY_DATE_DESC | "sortByDateDesc"
public static final String | SORT_BY_NAME_ASC | "sortByNameAsc"
public static final String | SORT_BY_NAME_DESC | "sortByNameDesc"
public static final String | SOUNDEX | "soundex"

javax.xml.registry.JAXRResponse
public static final int | STATUS_FAILURE | 2
public static final int | STATUS_SUCCESS | 0
public static final int | STATUS_UNAVAILABLE | 3
public static final int | STATUS_WARNING | 1

javax.xml.registry.LifeCycleManager
public static final String | ASSOCIATION | "Association"
public static final String | AUDITABLE_EVENT | "AuditableEvent"
public static final String | CLASSIFICATION | "Classification"
public static final String | CLASSIFICATION_SCHEME | "ClassificationScheme"
public static final String | CONCEPT | "Concept"
public static final String | EMAIL_ADDRESS | "EmailAddress"
public static final String | EXTERNAL_IDENTIFIER | "ExternalIdentifier"
public static final String | EXTERNAL_LINK | "ExternalLink"
public static final String | EXTRINSIC_OBJECT | "ExtrinsicObject"
public static final String | INTERNATIONAL_STRING | "InternationalString"
public static final String | KEY | "Key"
public static final String | LOCALIZED_STRING | "LocalizedString"
public static final String | ORGANIZATION | "Organization"
public static final String | PERSON_NAME | "PersonName"
public static final String | POSTAL_ADDRESS | "PostalAddress"
public static final String | REGISTRY_ENTRY | "RegistryEntry"
public static final String | REGISTRY_PACKAGE | "RegistryPackage"
public static final String | SERVICE | "Service"
public static final String | SERVICE_BINDING | "ServiceBinding"
public static final String | SLOT | "Slot"
public static final String | SPECIFICATION_LINK | "SpecificationLink"
public static final String | TELEPHONE_NUMBER | "TelephoneNumber"
public static final String | USER | "User"
public static final String | VERSIONABLE | "Versionable"

javax.xml.registry.Query
public static final int | QUERY_TYPE_EBXML_FILTER_QUERY | 2
public static final int | QUERY_TYPE_SQL | 0
public static final int | QUERY_TYPE_XQUERY | 1

javax.xml.registry.infomodel.AuditableEvent
public static final int | EVENT_TYPE_CREATED | 0
public static final int | EVENT_TYPE_DELETED | 1
public static final int | EVENT_TYPE_DEPRECATED | 2
public static final int | EVENT_TYPE_UNDEPRECATED | 5
public static final int | EVENT_TYPE_UPDATED | 3
public static final int | EVENT_TYPE_VERSIONED | 4

javax.xml.registry.infomodel.ClassificationScheme
public static final int | VALUE_TYPE_EMBEDDED_PATH | 1
public static final int | VALUE_TYPE_NON_UNIQUE | 2
public static final int | VALUE_TYPE_UNIQUE | 0

javax.xml.registry.infomodel.LocalizedString
public static final String DEFAULT_CHARSET_NAME "UTF-8"

javax.xml.registry.infomodel.RegistryEntry
public static final int | STABILITY_DYNAMIC | 0
public static final int | STABILITY_DYNAMIC_COMPATIBLE | 1
public static final int | STABILITY_STATIC | 2
public static final int | STATUS_APPROVED | 1
public static final int | STATUS_DEPRECATED | 2
public static final int | STATUS_SUBMITTED | 0
public static final int | STATUS_WITHDRAWN | 3

javax.xml.registry.infomodel.Slot
public static final String | ADDRESS_LINES_SLOT | "addressLines"
public static final String | AUTHORIZED_NAME_SLOT | "authorizedName"
public static final String | OPERATOR_SLOT | "operator"
public static final String | SORT_CODE_SLOT | "sortCode"

javax.xml.rpc.Call
public static final String | ENCODINGSTYLE_URI_PROPERTY | "javax.xml.rpc.encodingstyle.namespace.uri"
public static final String | OPERATION_STYLE_PROPERTY | "javax.xml.rpc.soap.operation.style"
public static final String | PASSWORD_PROPERTY | "javax.xml.rpc.security.auth.password"
public static final String | SESSION_MAINTAIN_PROPERTY | "javax.xml.rpc.session.maintain"
public static final String | SOAPACTION_URI_PROPERTY | "javax.xml.rpc.soap.http.soapaction.uri"
public static final String | SOAPACTION_USE_PROPERTY | "javax.xml.rpc.soap.http.soapaction.use"
public static final String | USERNAME_PROPERTY | "javax.xml.rpc.security.auth.username"

javax.xml.rpc.NamespaceConstants
public static final String | NSPREFIX_SCHEMA_XSD | "xsd"
public static final String | NSPREFIX_SCHEMA_XSI | "xsi"
public static final String | NSPREFIX_SOAP_ENCODING | "soapenc"
public static final String | NSPREFIX_SOAP_ENVELOPE | "soapenv"
public static final String | NSURI_SCHEMA_XSD | "http://www.w3.org/2001/XMLSchema"
public static final String | NSURI_SCHEMA_XSI | "http://www.w3.org/2001/XMLSchema-instance"
public static final String | NSURI_SOAP_ENCODING | "http://schemas.xmlsoap.org/soap/encoding/"
public static final String | NSURI_SOAP_ENVELOPE | "http://schemas.xmlsoap.org/soap/envelope/"
public static final String | NSURI_SOAP_NEXT_ACTOR | "http://schemas.xmlsoap.org/soap/actor/next"

javax.xml.rpc.ServiceFactory
public static final String SERVICEFACTORY_PROPERTY "javax.xml.rpc.ServiceFactory"

javax.xml.rpc.Stub
public static final String | ENDPOINT_ADDRESS_PROPERTY | "javax.xml.rpc.service.endpoint.address"
public static final String | PASSWORD_PROPERTY | "javax.xml.rpc.security.auth.password"
public static final String | SESSION_MAINTAIN_PROPERTY | "javax.xml.rpc.session.maintain"
public static final String | USERNAME_PROPERTY | "javax.xml.rpc.security.auth.username"

javax.xml.soap.SOAPConstants
public static final String | DEFAULT_SOAP_PROTOCOL | "SOAP 1.1 Protocol"
public static final String | DYNAMIC_SOAP_PROTOCOL | "Dynamic Protocol"
public static final String | SOAP_1_1_CONTENT_TYPE | "text/xml"
public static final String | SOAP_1_1_PROTOCOL | "SOAP 1.1 Protocol"
public static final String | SOAP_1_2_CONTENT_TYPE | "application/soap+xml"
public static final String | SOAP_1_2_PROTOCOL | "SOAP 1.2 Protocol"
public static final String | SOAP_ENV_PREFIX | "env"
public static final String | URI_NS_SOAP_1_1_ENVELOPE | "http://schemas.xmlsoap.org/soap/envelope/"
public static final String | URI_NS_SOAP_1_2_ENCODING | "http://www.w3.org/2003/05/soap-encoding"
public static final String | URI_NS_SOAP_1_2_ENVELOPE | "http://www.w3.org/2003/05/soap-envelope"
public static final String | URI_NS_SOAP_ENCODING | "http://schemas.xmlsoap.org/soap/encoding/"
public static final String | URI_NS_SOAP_ENVELOPE | "http://schemas.xmlsoap.org/soap/envelope/"
public static final String | URI_SOAP_1_2_ROLE_NEXT | "http://www.w3.org/2003/05/soap-envelope/role/next"
public static final String | URI_SOAP_1_2_ROLE_NONE | "http://www.w3.org/2003/05/soap-envelope/role/none"
public static final String | URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER | "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
public static final String | URI_SOAP_ACTOR_NEXT | "http://schemas.xmlsoap.org/soap/actor/next"

javax.xml.soap.SOAPMessage
public static final String | CHARACTER_SET_ENCODING | "javax.xml.soap.character-set-encoding"
public static final String | WRITE_XML_DECLARATION | "javax.xml.soap.write-xml-declaration"

javax.xml.stream.XMLInputFactory
public static final String | ALLOCATOR | "javax.xml.stream.allocator"
public static final String | IS_COALESCING | "javax.xml.stream.isCoalescing"
public static final String | IS_NAMESPACE_AWARE | "javax.xml.stream.isNamespaceAware"
public static final String | IS_REPLACING_ENTITY_REFERENCES | "javax.xml.stream.isReplacingEntityReferences"
public static final String | IS_SUPPORTING_EXTERNAL_ENTITIES | "javax.xml.stream.isSupportingExternalEntities"
public static final String | IS_VALIDATING | "javax.xml.stream.isValidating"
public static final String | REPORTER | "javax.xml.stream.reporter"
public static final String | RESOLVER | "javax.xml.stream.resolver"
public static final String | SUPPORT_DTD | "javax.xml.stream.supportDTD"

javax.xml.stream.XMLOutputFactory
public static final String IS_REPAIRING_NAMESPACES "javax.xml.stream.isRepairingNamespaces"

javax.xml.stream.XMLStreamConstants
public static final int | ATTRIBUTE | 10
public static final int | CDATA | 12
public static final int | CHARACTERS | 4
public static final int | COMMENT | 5
public static final int | DTD | 11
public static final int | END_DOCUMENT | 8
public static final int | END_ELEMENT | 2
public static final int | ENTITY_DECLARATION | 15
public static final int | ENTITY_REFERENCE | 9
public static final int | NAMESPACE | 13
public static final int | NOTATION_DECLARATION | 14
public static final int | PROCESSING_INSTRUCTION | 3
public static final int | SPACE | 6
public static final int | START_DOCUMENT | 7
public static final int | START_ELEMENT | 1

javax.xml.ws.BindingProvider
public static final String | ENDPOINT_ADDRESS_PROPERTY | "javax.xml.ws.service.endpoint.address"
public static final String | PASSWORD_PROPERTY | "javax.xml.ws.security.auth.password"
public static final String | SESSION_MAINTAIN_PROPERTY | "javax.xml.ws.session.maintain"
public static final String | SOAPACTION_URI_PROPERTY | "javax.xml.ws.soap.http.soapaction.uri"
public static final String | SOAPACTION_USE_PROPERTY | "javax.xml.ws.soap.http.soapaction.use"
public static final String | USERNAME_PROPERTY | "javax.xml.ws.security.auth.username"

javax.xml.ws.Endpoint
public static final String | WSDL_PORT | "javax.xml.ws.wsdl.port"
public static final String | WSDL_SERVICE | "javax.xml.ws.wsdl.service"

javax.xml.ws.handler.MessageContext
public static final String | HTTP_REQUEST_HEADERS | "javax.xml.ws.http.request.headers"
public static final String | HTTP_REQUEST_METHOD | "javax.xml.ws.http.request.method"
public static final String | HTTP_RESPONSE_CODE | "javax.xml.ws.http.response.code"
public static final String | HTTP_RESPONSE_HEADERS | "javax.xml.ws.http.response.headers"
public static final String | INBOUND_MESSAGE_ATTACHMENTS | "javax.xml.ws.binding.attachments.inbound"
public static final String | MESSAGE_OUTBOUND_PROPERTY | "javax.xml.ws.handler.message.outbound"
public static final String | OUTBOUND_MESSAGE_ATTACHMENTS | "javax.xml.ws.binding.attachments.outbound"
public static final String | PATH_INFO | "javax.xml.ws.http.request.pathinfo"
public static final String | QUERY_STRING | "javax.xml.ws.http.request.querystring"
public static final String | SERVLET_CONTEXT | "javax.xml.ws.servlet.context"
public static final String | SERVLET_REQUEST | "javax.xml.ws.servlet.request"
public static final String | SERVLET_RESPONSE | "javax.xml.ws.servlet.response"
public static final String | WSDL_DESCRIPTION | "javax.xml.ws.wsdl.description"
public static final String | WSDL_INTERFACE | "javax.xml.ws.wsdl.interface"
public static final String | WSDL_OPERATION | "javax.xml.ws.wsdl.operation"
public static final String | WSDL_PORT | "javax.xml.ws.wsdl.port"
public static final String | WSDL_SERVICE | "javax.xml.ws.wsdl.service"

javax.xml.ws.http.HTTPBinding
public static final String HTTP_BINDING "http://www.w3.org/2004/08/wsdl/http"

javax.xml.ws.soap.SOAPBinding
public static final String | SOAP11HTTP_BINDING | "http://schemas.xmlsoap.org/wsdl/soap/http"
public static final String | SOAP11HTTP_MTOM_BINDING | "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
public static final String | SOAP12HTTP_BINDING | "http://www.w3.org/2003/05/soap/bindings/HTTP/"
public static final String | SOAP12HTTP_MTOM_BINDING | "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"

javax.xml.ws.spi.Provider
public static final String JAXWSPROVIDER_PROPERTY "javax.xml.ws.spi.Provider"

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Deprecated List (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Deprecated API

Contents
  • Deprecated Interfaces
  • Deprecated Classes
  • Deprecated Exceptions
  • Deprecated Annotation Types
  • Deprecated Fields
  • Deprecated Methods
  • Deprecated Constructors
  • Deprecated Annotation Type Elements
Deprecated Interfaces
javax.servlet.jsp.el.FunctionMapper
As of JSP 2.1, replaced by FunctionMapper
javax.resource.spi.security.GenericCredential
The preferred way to represent generic credential information is via the org.ietf.jgss.GSSCredential interface in J2SE Version 1.4, which provides similar functionality.
javax.servlet.http.HttpSessionContext
As of Java(tm) Servlet API 2.1 for security reasons, with no replacement. This interface will be removed in a future version of this API.
javax.servlet.SingleThreadModel
As of Java Servlet API 2.4, with no direct replacement.
javax.xml.bind.Validator
since JAXB 2.0
javax.servlet.jsp.el.VariableResolver
As of JSP 2.1, replaced by ELResolver

Deprecated Classes
javax.faces.webapp.AttributeTag
The Faces implementation must now provide the implementation for this class.
javax.faces.webapp.ConverterTag
This has been partially replaced by ConverterELTag. The remainder of the functionality, namely, the binding facility and the implementation of the ConverterTag.createConverter() method, is now an implementation detail.
javax.servlet.jsp.el.Expression
As of JSP 2.1, replaced by ValueExpression
javax.servlet.jsp.el.ExpressionEvaluator
As of JSP 2.1, replaced by ExpressionFactory
javax.servlet.http.HttpUtils
As of Java(tm) Servlet API 2.3. These methods were only useful with the default encoding and have been moved to the request interfaces.
javax.faces.el.MethodBinding
This has been replaced by MethodExpression.
javax.faces.el.PropertyResolver
This has been replaced by ELResolver.
javax.xml.soap.SOAPElementFactory
- Use javax.xml.soap.SOAPFactory for creating SOAPElements.
javax.faces.application.StateManager.SerializedView
This class was not marked Serializable in the 1.0 version of the spec. It was also not a static inner class, so it can't be made to be Serializable. Therefore, it is being deprecated in version 1.2 of the spec. The replacement is to use an implementation dependent Object.
javax.faces.webapp.UIComponentBodyTag
All component tags now implement BodyTag. This class has been replaced by UIComponentELTag.
javax.faces.webapp.UIComponentTag
Use of this class has been replaced with UIComponentELTag, which extends UIComponentClassicTagBase to add properties that use the EL API introduced as part of JSP 2.1.
javax.faces.webapp.ValidatorTag
This has been partially replaced by ValidatorELTag. The remainder of the functionality, namely, the binding facility and the implementation of the ValidatorTag.createValidator() method, is now an implementation detail.
javax.faces.el.ValueBinding
This has been replaced by ValueExpression.
javax.faces.el.VariableResolver
This has been replaced by ELResolver when operating with a null base argument.

Deprecated Exceptions
javax.servlet.jsp.el.ELException
As of JSP 2.1, replaced by ELException
javax.servlet.jsp.el.ELParseException
As of JSP 2.1, replaced by ELException
javax.faces.el.EvaluationException
This has been replaced by ELException.
javax.faces.el.MethodNotFoundException
This has been replaced by MethodNotFoundException.
javax.faces.el.PropertyNotFoundException
This has been replaced by PropertyNotFoundException.
javax.faces.el.ReferenceSyntaxException
This has been replaced by ELException.

Deprecated Annotation Types
javax.jws.soap.InitParam
As of JSR-181 2.0 with no replacement.
javax.jws.soap.SOAPMessageHandler
As of JSR-181 2.0 with no replacement.
javax.jws.soap.SOAPMessageHandlers
As of JSR-181 2.0 with no replacement.

Deprecated Fields
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_TAG
As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED or IterationTag.EVAL_BODY_AGAIN.
javax.faces.validator.Validator.NOT_IN_RANGE_MESSAGE_ID
Use DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID or LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID instead.

Deprecated Methods
javax.xml.soap.SOAPElementFactory.create(Name)
Use javax.xml.soap.SOAPFactory.createElement(javax.xml.soap.Name) instead
javax.xml.soap.SOAPElementFactory.create(String)
Use javax.xml.soap.SOAPFactory.createElement(String localName) instead
javax.xml.soap.SOAPElementFactory.create(String, String, String)
Use javax.xml.soap.SOAPFactory.createElement(String localName, String prefix, String uri) instead
javax.faces.application.Application.createComponent(ValueBinding, FacesContext, String)
This has been replaced by Application.createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String).
javax.faces.application.Application.createMethodBinding(String, Class[])
This has been replaced by calling Application.getExpressionFactory() then ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]).
javax.xml.bind.JAXBContext.createValidator()
since JAXB2.0
javax.faces.application.Application.createValueBinding(String)
This has been replaced by calling Application.getExpressionFactory() then ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class).
javax.enterprise.deploy.spi.DeploymentManager.distribute(Target[], InputStream, InputStream)
as of Java EE 5, replaced with DeploymentManager.distribute(Target[], ModuleType, InputStream, InputStream)
javax.faces.webapp.UIComponentClassicTagBase.encodeBegin()
No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
javax.faces.webapp.UIComponentClassicTagBase.encodeChildren()
No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
javax.faces.webapp.UIComponentClassicTagBase.encodeEnd()
No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
javax.servlet.http.HttpServletResponse.encodeRedirectUrl(String)
As of version 2.1, use encodeRedirectURL(String url) instead
javax.servlet.http.HttpServletResponse.encodeUrl(String)
As of version 2.1, use encodeURL(String url) instead
javax.faces.component.ActionSource.getAction()
This has been replaced by ActionSource2.getActionExpression().
javax.faces.component.UICommand.getAction()
This has been replaced by UICommand.getActionExpression().
javax.faces.component.ActionSource.getActionListener()
Use ActionSource.getActionListeners() instead.
javax.faces.component.UICommand.getActionListener()
Use UICommand.getActionListeners() instead.
javax.ejb.EJBContext.getCallerIdentity()
Use Principal getCallerPrincipal() instead.
javax.faces.render.ResponseStateManager.getComponentStateToRestore(FacesContext)
This method has been replaced by ResponseStateManager.getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.
javax.faces.application.StateManager.getComponentStateToSave(FacesContext)
the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
javax.ejb.EJBContext.getEnvironment()
Use the JNDI naming context java:comp/env to access enterprise bean's environment.
javax.xml.bind.Validator.getEventHandler()
since JAXB2.0
javax.servlet.jsp.JspContext.getExpressionEvaluator()
As of JSP 2.1, replaced by JspApplicationContext.getExpressionFactory()
javax.servlet.http.HttpSessionContext.getIds()
As of Java Servlet API 2.1 with no replacement. This method must return an empty Enumeration and will be removed in a future version of this API.
javax.resource.ResourceException.getLinkedException()
J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class..
javax.resource.cci.ResourceWarning.getLinkedWarning()
J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
javax.enterprise.deploy.model.DDBeanRoot.getModuleDTDVersion()
As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()
javax.enterprise.deploy.model.DeployableObject.getModuleDTDVersion()
As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()
javax.xml.bind.Validator.getProperty(String)
since JAXB2.0
javax.faces.application.Application.getPropertyResolver()
This has been replaced by Application.getELResolver().
javax.servlet.ServletRequest.getRealPath(String)
As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String) instead.
javax.servlet.jsp.JspException.getRootCause()
As of JSP 2.1, replaced by Throwable.getCause()
javax.servlet.UnavailableException.getServlet()
As of Java Servlet API 2.2, with no replacement. Returns the servlet that is reporting its unavailability.
javax.servlet.ServletContext.getServlet(String)
As of Java Servlet API 2.1, with no direct replacement.

This method was originally defined to retrieve a servlet from a ServletContext. In this version, this method always returns null and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

In lieu of this method, servlets can share information using the ServletContext class and can perform shared business logic by invoking methods on common non-servlet classes.

javax.servlet.ServletContext.getServletNames()
As of Java Servlet API 2.1, with no replacement.

This method was originally defined to return an Enumeration of all the servlet names known to this context. In this version, this method always returns an empty Enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

javax.servlet.ServletContext.getServlets()
As of Java Servlet API 2.0, with no replacement.

This method was originally defined to return an Enumeration of all the servlets known to this servlet context. In this version, this method always returns an empty enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.

javax.servlet.http.HttpSessionContext.getSession(String)
As of Java Servlet API 2.1 with no replacement. This method must return null and will be removed in a future version of this API.
javax.servlet.http.HttpSession.getSessionContext()
As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API.
javax.faces.render.ResponseStateManager.getTreeStructureToRestore(FacesContext, String)
This method has been replaced by ResponseStateManager.getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.
javax.faces.application.StateManager.getTreeStructureToSave(FacesContext)
the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
javax.faces.component.EditableValueHolder.getValidator()
EditableValueHolder.getValidators() should be used instead.
javax.faces.component.UIInput.getValidator()
UIInput.getValidators() should be used instead.
javax.servlet.http.HttpSession.getValue(String)
As of Version 2.2, this method is replaced by HttpSession.getAttribute(java.lang.String).
javax.faces.component.UIComponent.getValueBinding(String)
This has been replaced by UIComponent.getValueExpression(java.lang.String).
javax.faces.component.UIComponentBase.getValueBinding(String)
This has been replaced by UIComponent.getValueExpression(java.lang.String).
javax.faces.component.UIGraphic.getValueBinding(String)
This has been replaced by UIGraphic.getValueExpression(java.lang.String).
javax.faces.component.UISelectBoolean.getValueBinding(String)
This has been replaced by UISelectBoolean.getValueExpression(java.lang.String).
javax.faces.component.UISelectMany.getValueBinding(String)
this has been replaced by UISelectMany.getValueExpression(java.lang.String).
javax.faces.component.EditableValueHolder.getValueChangeListener()
Use EditableValueHolder.getValueChangeListeners() instead.
javax.servlet.http.HttpSession.getValueNames()
As of Version 2.2, this method is replaced by HttpSession.getAttributeNames()
javax.faces.application.Application.getVariableResolver()
This has been replaced by Application.getELResolver().
javax.servlet.jsp.JspContext.getVariableResolver()
As of JSP 2.1, replaced by ELContext.getELResolver(), which can be obtained by jspContext.getELContext().getELResolver().
javax.ejb.EJBContext.isCallerInRole(Identity)
Use boolean isCallerInRole(String roleName) instead.
javax.servlet.http.HttpServletRequest.isRequestedSessionIdFromUrl()
As of Version 2.1 of the Java Servlet API, use HttpServletRequest.isRequestedSessionIdFromURL() instead.
javax.xml.bind.Unmarshaller.isValidating()
since JAXB2.0, please see Unmarshaller.getSchema()
javax.servlet.ServletContext.log(Exception, String)
As of Java Servlet API 2.1, use ServletContext.log(String message, Throwable throwable) instead.

This method was originally defined to write an exception's stack trace and an explanatory error message to the servlet log file.

javax.activation.ActivationDataFlavor.normalizeMimeType(String)
javax.activation.ActivationDataFlavor.normalizeMimeTypeParameter(String, String)
javax.servlet.http.HttpSession.putValue(String, Object)
As of Version 2.2, this method is replaced by HttpSession.setAttribute(java.lang.String, java.lang.Object)
javax.servlet.http.HttpSession.removeValue(String)
As of Version 2.2, this method is replaced by HttpSession.removeAttribute(java.lang.String)
javax.faces.application.StateManager.restoreComponentState(FacesContext, UIViewRoot, String)
the distinction between tree structure and component state is now an implementation detail. The default implementation does nothing.
javax.faces.application.StateManager.restoreTreeStructure(FacesContext, String, String)
the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
javax.faces.application.StateManager.saveSerializedView(FacesContext)
this has been replaced by StateManager.saveView(javax.faces.context.FacesContext). The default implementation returns null.
javax.faces.component.ActionSource.setAction(MethodBinding)
This has been replaced by ActionSource2.setActionExpression(javax.el.MethodExpression).
javax.faces.component.UICommand.setAction(MethodBinding)
This has been replaced by UICommand.setActionExpression(javax.el.MethodExpression).
javax.faces.component.ActionSource.setActionListener(MethodBinding)
This has been replaced by ActionSource.addActionListener(javax.faces.event.ActionListener).
javax.faces.component.UICommand.setActionListener(MethodBinding)
This has been replaced by UICommand.addActionListener(javax.faces.event.ActionListener).
javax.xml.bind.Validator.setEventHandler(ValidationEventHandler)
since JAXB2.0
javax.resource.ResourceException.setLinkedException(Exception)
J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
javax.resource.cci.ResourceWarning.setLinkedWarning(ResourceWarning)
J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
javax.xml.bind.Validator.setProperty(String, Object)
since JAXB2.0
javax.faces.application.Application.setPropertyResolver(PropertyResolver)
The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called Application.addELResolver(javax.el.ELResolver).
javax.servlet.http.HttpServletResponse.setStatus(int, String)
As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use setStatus(int), to send an error with a description use sendError(int, String). Sets the status code and message for this response.
javax.xml.bind.Unmarshaller.setValidating(boolean)
since JAXB2.0, please see Unmarshaller.setSchema(javax.xml.validation.Schema)
javax.faces.component.EditableValueHolder.setValidator(MethodBinding)
Use EditableValueHolder.addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.
javax.faces.component.UIInput.setValidator(MethodBinding)
Use UIInput.addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.
javax.faces.component.UIComponent.setValueBinding(String, ValueBinding)
This has been replaced by UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression).
javax.faces.component.UIComponentBase.setValueBinding(String, ValueBinding)
This has been replaced by UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression).
javax.faces.component.UIData.setValueBinding(String, ValueBinding)
This has been replaced by UIData.setValueExpression(java.lang.String, javax.el.ValueExpression).
javax.faces.component.UIGraphic.setValueBinding(String, ValueBinding)
This has been replaced by UIGraphic.setValueExpression(java.lang.String, javax.el.ValueExpression).
javax.faces.component.UISelectBoolean.setValueBinding(String, ValueBinding)
This has been replaced by UISelectBoolean.setValueExpression(java.lang.String, javax.el.ValueExpression).
javax.faces.component.UISelectMany.setValueBinding(String, ValueBinding)
This has been replaced by UISelectMany.setValueExpression(java.lang.String, javax.el.ValueExpression).
javax.faces.component.EditableValueHolder.setValueChangeListener(MethodBinding)
Use EditableValueHolder.addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.
javax.faces.component.UIInput.setValueChangeListener(MethodBinding)
Use UIInput.addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.
javax.faces.application.Application.setVariableResolver(VariableResolver)
The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called Application.addELResolver(javax.el.ELResolver).
javax.xml.bind.Validator.validate(Object)
since JAXB2.0
javax.xml.bind.Validator.validateRoot(Object)
since JAXB2.0
javax.faces.application.StateManager.writeState(FacesContext, StateManager.SerializedView)
This method has been replaced by StateManager.writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.
javax.faces.render.ResponseStateManager.writeState(FacesContext, StateManager.SerializedView)
This method has been replaced by ResponseStateManager.writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.

Deprecated Constructors
javax.servlet.UnavailableException(int, Servlet, String)
As of Java Servlet API 2.2, use UnavailableException.UnavailableException(String, int) instead.
javax.servlet.UnavailableException(Servlet, String)
As of Java Servlet API 2.2, use UnavailableException.UnavailableException(String) instead.

Deprecated Annotation Type Elements
javax.jws.HandlerChain.name
As of JSR-181 2.0 with no replacement.

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


API Help (Java EE 5)

PREV NEXT FRAMES NO FRAMES

How This API Document Is Organized

This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

Overview

The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

Package

Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types

Class/Interface

Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary

  • Field Detail
  • Constructor Detail
  • Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

Annotation Type

Each annotation type has its own separate page with the following sections:

  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail

Enum

Each enum has its own separate page with the following sections:

  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail

Tree (Class Hierarchy)

There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.

Deprecated API

The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

Index

The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

Prev/Next

These links take you to the next or previous class, interface, package, or related page.

Frames/No Frames

These links show and hide the HTML frames. All pages are available with or without frames.

Serialized Form

Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

Constant Field Values

The Constant Field Values page lists the static final fields and their values.

This help file applies to API documentation generated using the standard doclet.

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


Java EE 5

Frame Alert

This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
Link toNon-frame version.


Index (Java EE 5)

Overview

Package

Class

Tree

Deprecated

Index

Help

PREV NEXT

FRAMES NO FRAMES

A B C D E F G H I J K L M N O P Q R S T U V W X _

A

AbortProcessingException - Exception in javax.faces.event
An exception that may be thrown by event listeners to terminate the processing of the current event.
AbortProcessingException() - Constructor for exception javax.faces.event.AbortProcessingException
Construct a new exception with no detail message or root cause.
AbortProcessingException(String) - Constructor for exception javax.faces.event.AbortProcessingException
Construct a new exception with the specified detail message and no root cause.
AbortProcessingException(Throwable) - Constructor for exception javax.faces.event.AbortProcessingException
Construct a new exception with the specified root cause.
AbortProcessingException(String, Throwable) - Constructor for exception javax.faces.event.AbortProcessingException
Construct a new exception with the specified detail message and root cause.
AbstractMarshallerImpl - Class in javax.xml.bind.helpers
Partial default Marshaller implementation.
AbstractMarshallerImpl() - Constructor for class javax.xml.bind.helpers.AbstractMarshallerImpl

AbstractUnmarshallerImpl - Class in javax.xml.bind.helpers
Partial default Unmarshaller implementation.
AbstractUnmarshallerImpl() - Constructor for class javax.xml.bind.helpers.AbstractUnmarshallerImpl

accept(XMLEvent) - Method in interface javax.xml.stream.EventFilter
Tests whether this event is part of this stream.
accept(XMLStreamReader) - Method in interface javax.xml.stream.StreamFilter
Tests whether the current state is part of this stream.
AccessLocalException - Exception in javax.ejb
An AccessLocalException is thrown to indicate that the caller does not have permission to call the method.
AccessLocalException() - Constructor for exception javax.ejb.AccessLocalException
Constructs an AccessLocalException with no detail message.
AccessLocalException(String) - Constructor for exception javax.ejb.AccessLocalException
Constructs an AccessLocalException with the specified detail message.
AccessLocalException(String, Exception) - Constructor for exception javax.ejb.AccessLocalException
Constructs an AccessLocalException with the specified detail message and a nested exception.
acknowledge() - Method in interface javax.jms.Message
Acknowledges all consumed messages of the session of this consumed message.
ActionEvent - Class in javax.faces.event
An ActionEvent represents the activation of a user interface component (such as a UICommand).
ActionEvent(UIComponent) - Constructor for class javax.faces.event.ActionEvent
Construct a new event object from the specified source component and action command.
ActionListener - Interface in javax.faces.event
A listener interface for receiving ActionEvents.
ActionSource - Interface in javax.faces.component
ActionSource is an interface that may be implemented by any concrete UIComponent that wishes to be a source of ActionEvents, including the ability to invoke application actions via the default ActionListener mechanism.
ActionSource2 - Interface in javax.faces.component
ActionSource2 extends ActionSource and provides a JavaBeans property analogous to the "action" property on ActionSource.
ActionType - Class in javax.enterprise.deploy.shared
Class ActionTypes defines enumeration values for the J2EE DeploymentStatus actions.
ActionType(int) - Constructor for class javax.enterprise.deploy.shared.ActionType
Construct a new enumeration value with the given integer value.
ActivationConfigProperty - Annotation Type in javax.ejb

ActivationDataFlavor - Class in javax.activation
The ActivationDataFlavor class is a special subclass of java.awt.datatransfer.DataFlavor.
ActivationDataFlavor(Class, String, String) - Constructor for class javax.activation.ActivationDataFlavor
Construct a DataFlavor that represents an arbitrary Java object.
ActivationDataFlavor(Class, String) - Constructor for class javax.activation.ActivationDataFlavor
Construct a DataFlavor that represents a MimeType.
ActivationDataFlavor(String, String) - Constructor for class javax.activation.ActivationDataFlavor
Construct a DataFlavor that represents a MimeType.
ActivationSpec - Interface in javax.resource.spi
This interface serves as a marker.
add(ELResolver) - Method in class javax.el.CompositeELResolver
Adds the given resolver to the list of component resolvers.
add(FetchProfile.Item) - Method in class javax.mail.FetchProfile
Add the given special item as one of the attributes to be prefetched.
add(String) - Method in class javax.mail.FetchProfile
Add the specified header-field to the list of attributes to be prefetched.
add(Flags.Flag) - Method in class javax.mail.Flags
Add the specified system flag to this Flags object.
add(String) - Method in class javax.mail.Flags
Add the specified user flag to this Flags object.
add(Flags) - Method in class javax.mail.Flags
Add all the flags in the given Flags object to this Flags object.
add(XMLEvent) - Method in interface javax.xml.stream.util.XMLEventConsumer
This method adds an event to the consumer.
add(XMLEvent) - Method in interface javax.xml.stream.XMLEventWriter
Add an event to the output stream Adding a START_ELEMENT will open a new namespace scope that will be closed when the corresponding END_ELEMENT is written.
add(XMLEventReader) - Method in interface javax.xml.stream.XMLEventWriter
Adds an entire stream to an output stream, calls next() on the inputStream argument until hasNext() returns false This should be treated as a convenience method that will perform the following loop over all the events in an event reader and call add on each event.
addActionListener(ActionListener) - Method in interface javax.faces.component.ActionSource
Add a new ActionListener to the set of listeners interested in being notified when ActionEvents occur.
addActionListener(ActionListener) - Method in class javax.faces.component.UICommand

addAssociation(Association) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified Association to use this object as source.
addAssociations(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified Associations to use this object as source.
addAttachmentPart(AttachmentPart) - Method in class javax.xml.soap.SOAPMessage
Adds the given AttachmentPart object to this SOAPMessage object.
addAttribute(Name, String) - Method in interface javax.xml.soap.SOAPElement
Adds an attribute with the specified name and value to this SOAPElement object.
addAttribute(QName, String) - Method in interface javax.xml.soap.SOAPElement
Adds an attribute with the specified name and value to this SOAPElement object.
addBody() - Method in interface javax.xml.soap.SOAPEnvelope
Creates a SOAPBody object and sets it as the SOAPBody object for this SOAPEnvelope object.
addBodyElement(Name) - Method in interface javax.xml.soap.SOAPBody
Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.
addBodyElement(QName) - Method in interface javax.xml.soap.SOAPBody
Creates a new SOAPBodyElement object with the specified QName and adds it to this SOAPBody object.
addBodyPart(BodyPart) - Method in class javax.mail.internet.MimeMultipart
Adds a Part to the multipart.
addBodyPart(BodyPart, int) - Method in class javax.mail.internet.MimeMultipart
Adds a BodyPart at position index.
addBodyPart(BodyPart) - Method in class javax.mail.Multipart
Adds a Part to the multipart.
addBodyPart(BodyPart, int) - Method in class javax.mail.Multipart
Adds a BodyPart at position index.
addChild(UIComponent) - Method in class javax.faces.webapp.UIComponentClassicTagBase

addChild(UIComponent) - Method in class javax.faces.webapp.UIComponentTagBase
Add the component identifier of the specified UIComponent to the list of component identifiers created or located by nested UIComponentTags processing this request.
addChildConcept(Concept) - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Adds a child Concept.
addChildConcept(Concept) - Method in interface javax.xml.registry.infomodel.Concept
Adds a child Concept.
addChildConcepts(Collection) - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Adds a Collection of Concept children.
addChildConcepts(Collection) - Method in interface javax.xml.registry.infomodel.Concept
Adds a Collection of Concept children.
addChildElement(Name) - Method in interface javax.xml.soap.SOAPElement
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
addChildElement(QName) - Method in interface javax.xml.soap.SOAPElement
Creates a new SOAPElement object initialized with the given QName object and adds the new element to this SOAPElement object.
addChildElement(String) - Method in interface javax.xml.soap.SOAPElement
Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object.
addChildElement(String, String) - Method in interface javax.xml.soap.SOAPElement
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
addChildElement(String, String, String) - Method in interface javax.xml.soap.SOAPElement
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
addChildElement(SOAPElement) - Method in interface javax.xml.soap.SOAPElement
Add a SOAPElement as a child of this SOAPElement instance.
addChildOrganization(Organization) - Method in interface javax.xml.registry.infomodel.Organization
Adds a child Organization.
addChildOrganizations(Collection) - Method in interface javax.xml.registry.infomodel.Organization
Adds a Collection of Organization children.
addClassification(Classification) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified Classification to this object.
addClassifications(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified Classifications to this object.
addComponent(String, String) - Method in class javax.faces.application.Application
Register a new mapping of component type to the name of the corresponding UIComponent class.
addConnectionEventListener(ConnectionEventListener) - Method in interface javax.resource.spi.ManagedConnection
Adds a connection event listener to the ManagedConnection instance.
addConnectionListener(ConnectionListener) - Method in class javax.mail.Folder
Add a listener for Connection events on this Folder.
addConnectionListener(ConnectionListener) - Method in class javax.mail.Service
Add a listener for Connection events on this service.
addConverter(String, String) - Method in class javax.faces.application.Application
Register a new mapping of converter id to the name of the corresponding Converter class.
addConverter(Class, String) - Method in class javax.faces.application.Application
Register a new converter class that is capable of performing conversions for the specified target class.
addCookie(Cookie) - Method in interface javax.servlet.http.HttpServletResponse
Adds the specified cookie to the response.
addCookie(Cookie) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call addCookie(Cookie cookie) on the wrapped response object.
addDataModelListener(DataModelListener) - Method in class javax.faces.model.DataModel
Add a new DataModelListener to the set interested in notifications from this DataModel.
addDateHeader(String, long) - Method in interface javax.servlet.http.HttpServletResponse
Adds a response header with the given name and date-value.
addDateHeader(String, long) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call addDateHeader(String name, long date) on the wrapped response object.
addDetail() - Method in interface javax.xml.soap.SOAPFault
Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.
addDetailEntry(Name) - Method in interface javax.xml.soap.Detail
Creates a new DetailEntry object with the given name and adds it to this Detail object.
addDetailEntry(QName) - Method in interface javax.xml.soap.Detail
Creates a new DetailEntry object with the given QName and adds it to this Detail object.
addDocument(Document) - Method in interface javax.xml.soap.SOAPBody
Adds the root node of the DOM Document to this SOAPBody object.
ADDED - Static variable in class javax.mail.event.MessageCountEvent
The messages were added to their folder
addELContextListener(ELContextListener) - Method in class javax.faces.application.Application
Provide a way for Faces applications to register an ELContextListener that will be notified on creation of ELContext instances.
addELContextListener(ELContextListener) - Method in interface javax.servlet.jsp.JspApplicationContext
Registers a ELContextListeners so that context objects can be added whenever a new ELContext is created.
addELResolver(ELResolver) - Method in class javax.faces.application.Application
Cause an the argument resolver to be added to the resolver chain as specified in section 5.5.1 of the JavaServer Faces Specification.
addELResolver(ELResolver) - Method in interface javax.servlet.jsp.JspApplicationContext
Adds an ELResolver to affect the way EL variables and properties are resolved for EL expressions appearing in JSP pages and tag files.
addExternalIdentifier(ExternalIdentifier) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified ExternalIdentifier as an external identifier to this object.
addExternalIdentifiers(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified ExternalIdentifiers as an external identifiers to this object.
addExternalLink(ExternalLink) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified ExternalLink to this object.
addExternalLinks(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Adds specified ExternalLinks to this object.
addFacesListener(FacesListener) - Method in class javax.faces.component.UIComponent
Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent.
addFacesListener(FacesListener) - Method in class javax.faces.component.UIComponentBase
Add the specified FacesListener to the set of listeners registered to receive event notifications from this UIComponent.
addFacet(String) - Method in class javax.faces.webapp.UIComponentClassicTagBase

addFacet(String) - Method in class javax.faces.webapp.UIComponentTagBase
Add the facet name of the specified facet to the list of facet names created or located by nested UIComponentTags processing this request.
addFault() - Method in interface javax.xml.soap.SOAPBody
Creates a new SOAPFault object and adds it to this SOAPBody object.
addFault(Name, String, Locale) - Method in interface javax.xml.soap.SOAPBody
Creates a new SOAPFault object and adds it to this SOAPBody object.
addFault(QName, String, Locale) - Method in interface javax.xml.soap.SOAPBody
Creates a new SOAPFault object and adds it to this SOAPBody object.
addFault(Name, String) - Method in interface javax.xml.soap.SOAPBody
Creates a new SOAPFault object and adds it to this SOAPBody object.
addFault(QName, String) - Method in interface javax.xml.soap.SOAPBody
Creates a new SOAPFault object and adds it to this SOAPBody object.
addFaultReasonText(String, Locale) - Method in interface javax.xml.soap.SOAPFault
Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale.
addFolderListener(FolderListener) - Method in class javax.mail.Folder
Add a listener for Folder events on this Folder.
addFolderListener(FolderListener) - Method in class javax.mail.Store
Add a listener for Folder events on any Folder object obtained from this Store.
addFrom(Address[]) - Method in class javax.mail.internet.MimeMessage
Add the specified addresses to the existing "From" field.
addFrom(Address[]) - Method in class javax.mail.Message
Add these addresses to the existing "From" attribute
addHeader(String, String) - Method in class javax.mail.internet.InternetHeaders
Add a header with the specified name and value to the header list.
addHeader(String, String) - Method in class javax.mail.internet.MimeBodyPart
Add this value to the existing values for this header_name.
addHeader(String, String) - Method in class javax.mail.internet.MimeMessage
Add this value to the existing values for this header_name.
addHeader(String, String) - Method in interface javax.mail.Part
Add this value to the existing values for this header_name.
addHeader(String, String) - Method in interface javax.servlet.http.HttpServletResponse
Adds a response header with the given name and value.
addHeader(String, String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.
addHeader(String, String) - Method in class javax.xml.soap.MimeHeaders
Adds a MimeHeader object with the specified name and value to this MimeHeaders object's list of headers.
addHeader() - Method in interface javax.xml.soap.SOAPEnvelope
Creates a SOAPHeader object and sets it as the SOAPHeader object for this SOAPEnvelope object.
addHeaderElement(Name) - Method in interface javax.xml.soap.SOAPHeader
Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
addHeaderElement(QName) - Method in interface javax.xml.soap.SOAPHeader
Creates a new SOAPHeaderElement object initialized with the specified qname and adds it to this SOAPHeader object.
addHeaderLine(String) - Method in class javax.mail.internet.InternetHeaders
Add an RFC822 header line to the header store.
addHeaderLine(String) - Method in class javax.mail.internet.MimeBodyPart
Add a header line to this body part
addHeaderLine(String) - Method in class javax.mail.internet.MimeMessage
Add a raw RFC 822 header-line.
addHeaderLine(String) - Method in interface javax.mail.internet.MimePart
Add a raw RFC822 header-line.
addIntHeader(String, int) - Method in interface javax.servlet.http.HttpServletResponse
Adds a response header with the given name and integer value.
addIntHeader(String, int) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.
addLifecycle(String, Lifecycle) - Method in class javax.faces.lifecycle.LifecycleFactory
Register a new Lifecycle instance, associated with the specified lifecycleId, to be supported by this LifecycleFactory.
addLocalizedString(LocalizedString) - Method in interface javax.xml.registry.infomodel.InternationalString
Adds a LocalizedString to this object.
addLocalizedStrings(Collection) - Method in interface javax.xml.registry.infomodel.InternationalString
Adds many LocalizedStrings to this object.
addMailcap(String) - Method in class javax.activation.MailcapCommandMap
Add entries to the registry.
addMessage(String, FacesMessage) - Method in class javax.faces.context.FacesContext
Append a FacesMessage to the set of messages associated with the specified client identifier, if clientId is not null.
addMessageChangedListener(MessageChangedListener) - Method in class javax.mail.Folder
Add a listener for MessageChanged events on this Folder.
addMessageCountListener(MessageCountListener) - Method in class javax.mail.Folder
Add a listener for MessageCount events on this Folder.
addMimeHeader(String, String) - Method in class javax.xml.soap.AttachmentPart
Adds a MIME header with the specified name and value to this AttachmentPart object.
addMimeHeader(String, String) - Method in class javax.xml.soap.SOAPPart
Creates a MimeHeader object with the specified name and value and adds it to this SOAPPart object.
addMimeTypes(String) - Method in class javax.activation.MimetypesFileTypeMap
Prepend the MIME type values to the registry.
addMtomAttachment(DataHandler, String, String) - Method in class javax.xml.bind.attachment.AttachmentMarshaller
Consider MIME content data for optimized binary storage as an attachment.
addMtomAttachment(byte[], int, int, String, String, String) - Method in class javax.xml.bind.attachment.AttachmentMarshaller
Consider binary data for optimized binary storage as an attachment.
addNamespaceDeclaration(String, String) - Method in interface javax.xml.soap.SOAPElement
Adds a namespace declaration with the specified prefix and URI to this SOAPElement object.
addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object) - Method in interface javax.management.j2ee.ListenerRegistration
Add a listener to a registered managed object.
addNotUnderstoodHeaderElement(QName) - Method in interface javax.xml.soap.SOAPHeader
Creates a new NotUnderstood SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
addParameter(String, QName, ParameterMode) - Method in interface javax.xml.rpc.Call
Adds a parameter type and mode for a specific operation.
addParameter(String, QName, Class, ParameterMode) - Method in interface javax.xml.rpc.Call
Adds a parameter type and mode for a specific operation.
addPhaseListener(PhaseListener) - Method in class javax.faces.component.UIViewRoot

addPhaseListener(PhaseListener) - Method in class javax.faces.lifecycle.Lifecycle
Register a new PhaseListener instance that is interested in being notified before and after the processing for standard phases of the request processing lifecycle.
addPort(QName, String, String) - Method in class javax.xml.ws.Service
Creates a new port for the service.
addPort(QName, String, String) - Method in class javax.xml.ws.spi.ServiceDelegate
Creates a new port for the service.
addProgressListener(ProgressListener) - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
Add a listener to receive Progress events on deployment actions.
addPropertyChangeListener(PropertyChangeListener) - Method in interface javax.enterprise.deploy.spi.DConfigBean
Register a property listener for this bean.
addProvider(Provider) - Method in class javax.mail.Session
Add a provider to the session.
addRecipient(Message.RecipientType, Address) - Method in class javax.mail.Message
Add this recipient address to the existing ones of the given type.
addRecipients(Message.RecipientType, Address[]) - Method in class javax.mail.internet.MimeMessage
Add the given addresses to the specified recipient type.
addRecipients(Message.RecipientType, String) - Method in class javax.mail.internet.MimeMessage
Add the given addresses to the specified recipient type.
addRecipients(Message.RecipientType, Address[]) - Method in class javax.mail.Message
Add these recipient addresses to the existing ones of the given type.
addRegistryObject(RegistryObject) - Method in interface javax.xml.registry.infomodel.RegistryPackage
Adds a child RegistryObject as member.
addRegistryObjects(Collection) - Method in interface javax.xml.registry.infomodel.RegistryPackage
Adds a Collection of RegistryObject children as members.
addRenderer(String, String, Renderer) - Method in class javax.faces.render.RenderKit
Register the specified Renderer instance, associated with the specified component family and rendererType, to the set of Renderers registered with this RenderKit, replacing any previously registered Renderer for this combination of identifiers.
addRenderKit(String, RenderKit) - Method in class javax.faces.render.RenderKitFactory
Register the specified RenderKit instance, associated with the specified renderKitId, to be supported by this RenderKitFactory, replacing any previously registered RenderKit for this identifier.
Address - Class in javax.mail
This abstract class models the addresses in a message.
Address() - Constructor for class javax.mail.Address

address - Variable in class javax.mail.internet.InternetAddress

address - Variable in class javax.mail.search.AddressTerm
The address.
ADDRESS_LINES_SLOT - Static variable in interface javax.xml.registry.infomodel.Slot
Name for pre-defined Slot used in PostalAddress by JAXR UDDI provider.
AddressException - Exception in javax.mail.internet
The exception thrown when a wrongly formatted address is encountered.
AddressException() - Constructor for exception javax.mail.internet.AddressException
Constructs an AddressException with no detail message.
AddressException(String) - Constructor for exception javax.mail.internet.AddressException
Constructs an AddressException with the specified detail message.
AddressException(String, String) - Constructor for exception javax.mail.internet.AddressException
Constructs an AddressException with the specified detail message and reference info.
AddressException(String, String, int) - Constructor for exception javax.mail.internet.AddressException
Constructs an AddressException with the specified detail message and reference info.
AddressStringTerm - Class in javax.mail.search
This abstract class implements string comparisons for Message addresses.
AddressStringTerm(String) - Constructor for class javax.mail.search.AddressStringTerm
Constructor.
AddressTerm - Class in javax.mail.search
This class implements Message Address comparisons.
AddressTerm(Address) - Constructor for class javax.mail.search.AddressTerm

addService(Service) - Method in interface javax.xml.registry.infomodel.Organization
Adds a child Service.
addServiceBinding(ServiceBinding) - Method in interface javax.xml.registry.infomodel.Service
Adds a child ServiceBinding.
addServiceBindings(Collection) - Method in interface javax.xml.registry.infomodel.Service
Adds a Collection of ServiceBinding children.
addServices(Collection) - Method in interface javax.xml.registry.infomodel.Organization
Adds a Collection of Service children.
addSlot(Slot) - Method in interface javax.xml.registry.infomodel.ExtensibleObject
Adds a Slot to this object.
addSlots(Collection) - Method in interface javax.xml.registry.infomodel.ExtensibleObject
Adds more Slots to this object.
addSpecificationLink(SpecificationLink) - Method in interface javax.xml.registry.infomodel.ServiceBinding
Adds a child SpecificationLink.
addSpecificationLinks(Collection) - Method in interface javax.xml.registry.infomodel.ServiceBinding
Adds a Collection of SpecificationLink children.
addStoreListener(StoreListener) - Method in class javax.mail.Store
Add a listener for StoreEvents on this Store.
addSwaRefAttachment(DataHandler) - Method in class javax.xml.bind.attachment.AttachmentMarshaller
Add MIME data as an attachment and return attachment's content-id, cid.
addTextNode(String) - Method in interface javax.xml.soap.SOAPElement
Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
addToExcludedPolicy(PermissionCollection) - Method in interface javax.security.jacc.PolicyConfiguration
Used to add excluded policy statements to this PolicyConfiguration.
addToExcludedPolicy(Permission) - Method in interface javax.security.jacc.PolicyConfiguration
Used to add a single excluded policy statement to this PolicyConfiguration.
addToRole(String, PermissionCollection) - Method in interface javax.security.jacc.PolicyConfiguration
Used to add permissions to a named role in this PolicyConfiguration.
addToRole(String, Permission) - Method in interface javax.security.jacc.PolicyConfiguration
Used to add a single permission to a named role in this PolicyConfiguration.
addToUncheckedPolicy(PermissionCollection) - Method in interface javax.security.jacc.PolicyConfiguration
Used to add unchecked policy statements to this PolicyConfiguration.
addToUncheckedPolicy(Permission) - Method in interface javax.security.jacc.PolicyConfiguration
Used to add a single unchecked policy statement to this PolicyConfiguration.
addTransformer(ClassTransformer) - Method in interface javax.persistence.spi.PersistenceUnitInfo
Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the PersistenceUnitInfo.getClassLoader() method.
addTransportListener(TransportListener) - Method in class javax.mail.Transport
Add a listener for Transport events.
addUpgradeHeaderElement(Iterator) - Method in interface javax.xml.soap.SOAPHeader
Creates a new Upgrade SOAPHeaderElement object initialized with the specified List of supported SOAP URIs and adds it to this SOAPHeader object.
addUpgradeHeaderElement(String[]) - Method in interface javax.xml.soap.SOAPHeader
Creates a new Upgrade SOAPHeaderElement object initialized with the specified array of supported SOAP URIs and adds it to this SOAPHeader object.
addUpgradeHeaderElement(String) - Method in interface javax.xml.soap.SOAPHeader
Creates a new Upgrade SOAPHeaderElement object initialized with the specified supported SOAP URI and adds it to this SOAPHeader object.
addUser(User) - Method in interface javax.xml.registry.infomodel.Organization
Adds a User.
addUsers(Collection) - Method in interface javax.xml.registry.infomodel.Organization
Adds a Collection of Users.
addValidator(String, String) - Method in class javax.faces.application.Application
Register a new mapping of validator id to the name of the corresponding Validator class.
addValidator(Validator) - Method in interface javax.faces.component.EditableValueHolder
Add a Validator instance to the set associated with this component.
addValidator(Validator) - Method in class javax.faces.component.UIInput
Add a Validator instance to the set associated with this UIInput.
addValueChangeListener(ValueChangeListener) - Method in interface javax.faces.component.EditableValueHolder
Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.
addValueChangeListener(ValueChangeListener) - Method in class javax.faces.component.UIInput
Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.
addVerbatimAfterComponent(UIComponentClassicTagBase, UIComponent, UIComponent) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Add verbatim as a sibling of component in component in the parent's child list.
addVerbatimBeforeComponent(UIComponentClassicTagBase, UIComponent, UIComponent) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Add verbatim as a sibling of component in component in the parent's child list.
addXpathListener(String, XpathListener) - Method in interface javax.enterprise.deploy.model.DDBean
Register a listener for a specific XPath.
addXpathListener(ModuleType, String, XpathListener) - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Register a listener for changes in XPath that are related to this deployableObject.
afterBegin() - Method in interface javax.ejb.SessionSynchronization
The afterBegin method notifies a session Bean instance that a new transaction has started, and that the subsequent business methods on the instance will be invoked in the context of the transaction.
afterCompletion(boolean) - Method in interface javax.ejb.SessionSynchronization
The afterCompletion method notifies a session Bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back.
afterCompletion(int) - Method in interface javax.transaction.Synchronization
This method is called by the transaction manager after the transaction is committed or rolled back.
afterDelivery() - Method in interface javax.resource.spi.endpoint.MessageEndpoint
This is called by a resource adapter after a message is delivered.
afterMarshal(Object) - Method in class javax.xml.bind.Marshaller.Listener

Callback method invoked after marshalling source to XML.
afterPhase(PhaseEvent) - Method in interface javax.faces.event.PhaseListener
Handle a notification that the processing for a particular phase has just been completed.
afterUnmarshal(Object, Object) - Method in class javax.xml.bind.Unmarshaller.Listener

Callback method invoked after unmarshalling XML data into target.
ALERT - Static variable in class javax.mail.event.StoreEvent
Indicates that this message is an ALERT.
ALL - Static variable in class javax.mail.internet.MimeUtility

allocate(XMLStreamReader) - Method in interface javax.xml.stream.util.XMLEventAllocator
This method allocates an event given the current state of the XMLStreamReader.
allocate(XMLStreamReader, XMLEventConsumer) - Method in interface javax.xml.stream.util.XMLEventAllocator
This method allocates an event or set of events given the current state of the XMLStreamReader and adds the event or set of events to the consumer that was passed in.
allocateConnection(ManagedConnectionFactory, ConnectionRequestInfo) - Method in interface javax.resource.spi.ConnectionManager
The method allocateConnection gets called by the resource adapter's connection factory instance.
ALLOCATOR - Static variable in class javax.xml.stream.XMLInputFactory
The property used to set/get the implementation of the allocator
AND_ALL_KEYS - Static variable in interface javax.xml.registry.FindQualifier

AndTerm - Class in javax.mail.search
This class implements the logical AND operator on individual SearchTerms.
AndTerm(SearchTerm, SearchTerm) - Constructor for class javax.mail.search.AndTerm
Constructor that takes two terms.
AndTerm(SearchTerm[]) - Constructor for class javax.mail.search.AndTerm
Constructor that takes an array of SearchTerms.
ANSWERED - Static variable in class javax.mail.Flags.Flag
This message has been answered.
ANY_PHASE - Static variable in class javax.faces.event.PhaseId
Identifier that indicates an interest in events, no matter which request processing phase is being performed.
appendFaultSubcode(QName) - Method in interface javax.xml.soap.SOAPFault
Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault.
appendMessages(Message[]) - Method in class javax.mail.Folder
Append given Messages to this folder.
Application - Class in javax.faces.application
Application represents a per-web-application singleton object where applications based on JavaServer Faces (or implementations wishing to provide extended functionality) can register application-wide singletons that provide functionality required by JavaServer Faces.
Application() - Constructor for class javax.faces.application.Application

APPLICATION - Static variable in class javax.servlet.jsp.PageContext
Name used to store ServletContext in PageContext name table.
APPLICATION_FACTORY - Static variable in class javax.faces.FactoryFinder
The property name for the ApplicationFactory class name.
APPLICATION_SCOPE - Static variable in class javax.servlet.jsp.PageContext
Application scope: named reference remains available in the ServletContext until it is reclaimed.
ApplicationException - Annotation Type in javax.ejb
Applied to an exception to denote that it is an application exception and should be reported to the client directly(i.e., unwrapped).
ApplicationFactory - Class in javax.faces.application
ApplicationFactory is a factory object that creates (if needed) and returns Application instances.
ApplicationFactory() - Constructor for class javax.faces.application.ApplicationFactory

ApplicationServerInternalException - Exception in javax.resource.spi
An ApplicationServerInternalException is thrown by an application server to indicate error conditions specific to an application server.
ApplicationServerInternalException() - Constructor for exception javax.resource.spi.ApplicationServerInternalException
Constructs a new instance with null as its detail message.
ApplicationServerInternalException(String) - Constructor for exception javax.resource.spi.ApplicationServerInternalException
Constructs a new instance with the specified detail message.
ApplicationServerInternalException(Throwable) - Constructor for exception javax.resource.spi.ApplicationServerInternalException
Constructs a new throwable with the specified cause.
ApplicationServerInternalException(String, Throwable) - Constructor for exception javax.resource.spi.ApplicationServerInternalException
Constructs a new throwable with the specified detail message and cause.
ApplicationServerInternalException(String, String) - Constructor for exception javax.resource.spi.ApplicationServerInternalException
Constructs a new throwable with the specified detail message and an error code.
APPLY_REQUEST_VALUES - Static variable in class javax.faces.event.PhaseId
Identifier that indicates an interest in events queued for the Apply Request Values phase of the request processing lifecycle.
AroundInvoke - Annotation Type in javax.interceptor

ArrayDataModel - Class in javax.faces.model
ArrayDataModel is a convenience implementation of DataModel that wraps an array of Java objects.
ArrayDataModel() - Constructor for class javax.faces.model.ArrayDataModel
Construct a new ArrayDataModel with no specified wrapped data.
ArrayDataModel(Object[]) - Constructor for class javax.faces.model.ArrayDataModel
Construct a new ArrayDataModel wrapping the specified array.
ArrayELResolver - Class in javax.el
Defines property resolution behavior on arrays.
ArrayELResolver() - Constructor for class javax.el.ArrayELResolver
Creates a new read/write ArrayELResolver.
ArrayELResolver(boolean) - Constructor for class javax.el.ArrayELResolver
Creates a new ArrayELResolver whose read-only status is determined by the given parameter.
asCharacters() - Method in interface javax.xml.stream.events.XMLEvent
Returns this event as Characters, may result in a class cast exception if this event is not Characters.
asEndElement() - Method in interface javax.xml.stream.events.XMLEvent
Returns this event as an end element event, may result in a class cast exception if this event is not a end element.
associateConnection(Object, ManagedConnectionFactory, ConnectionRequestInfo) - Method in interface javax.resource.spi.LazyAssociatableConnectionManager
This method is called by a resource adapter (that is capable of lazy connection association optimization) in order to lazily associate a connection object with a ManagedConnection instance.
associateConnection(Object) - Method in interface javax.resource.spi.ManagedConnection
Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance.
Association - Interface in javax.xml.registry.infomodel
A RegistryObject instance may be associated with zero or more RegistryObject instances.
ASSOCIATION - Static variable in interface javax.xml.registry.LifeCycleManager

AssociationOverride - Annotation Type in javax.persistence
This annotation is used to override a many-to-one or one-to-one mapping of property or field for an entity relationship.
AssociationOverrides - Annotation Type in javax.persistence
This annotation is used to override mappings of multiple many-to-one or one-to-one relationship properties or fields.
asStartElement() - Method in interface javax.xml.stream.events.XMLEvent
Returns this event as a start element event, may result in a class cast exception if this event is not a start element.
AsyncHandler<T> - Interface in javax.xml.ws
The AsyncHandler interface is implemented by clients that wish to receive callback notification of the completion of service endpoint operations invoked asynchronously.
AT_BEGIN - Static variable in class javax.servlet.jsp.tagext.VariableInfo
Scope information that scripting variable is visible after start tag.
AT_END - Static variable in class javax.servlet.jsp.tagext.VariableInfo
Scope information that scripting variable is visible after end tag.
ATOM - Static variable in class javax.mail.internet.HeaderTokenizer.Token
Token type indicating an ATOM.
attachFile(File) - Method in class javax.mail.internet.MimeBodyPart
Use the specified file to provide the data for this part.
attachFile(String) - Method in class javax.mail.internet.MimeBodyPart
Use the specified file to provide the data for this part.
ATTACHMENT - Static variable in interface javax.mail.Part
This part should be presented as an attachment.
AttachmentMarshaller - Class in javax.xml.bind.attachment
Enable JAXB marshalling to optimize storage of binary data.
AttachmentMarshaller() - Constructor for class javax.xml.bind.attachment.AttachmentMarshaller

AttachmentPart - Class in javax.xml.soap
A single attachment to a SOAPMessage object.
AttachmentPart() - Constructor for class javax.xml.soap.AttachmentPart

AttachmentUnmarshaller - Class in javax.xml.bind.attachment
Enables JAXB unmarshalling of a root document containing optimized binary data formats.
AttachmentUnmarshaller() - Constructor for class javax.xml.bind.attachment.AttachmentUnmarshaller

Attribute - Interface in javax.xml.stream.events
An interface that contains information about an attribute.
ATTRIBUTE - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is an attribute
attributeAdded(HttpSessionBindingEvent) - Method in interface javax.servlet.http.HttpSessionAttributeListener
Notification that an attribute has been added to a session.
attributeAdded(ServletContextAttributeEvent) - Method in interface javax.servlet.ServletContextAttributeListener
Notification that a new attribute was added to the servlet context.
attributeAdded(ServletRequestAttributeEvent) - Method in interface javax.servlet.ServletRequestAttributeListener
Notification that a new attribute was added to the servlet request.
AttributeOverride - Annotation Type in javax.persistence
The AttributeOverride annotation is used to override the mapping of a Basic (whether explicit or default) property or field or Id property or field.
AttributeOverrides - Annotation Type in javax.persistence
Is used to override mappings of multiple properties or fields.
attributeRemoved(HttpSessionBindingEvent) - Method in interface javax.servlet.http.HttpSessionAttributeListener
Notification that an attribute has been removed from a session.
attributeRemoved(ServletContextAttributeEvent) - Method in interface javax.servlet.ServletContextAttributeListener
Notification that an existing attribute has been removed from the servlet context.
attributeRemoved(ServletRequestAttributeEvent) - Method in interface javax.servlet.ServletRequestAttributeListener
Notification that an existing attribute has been removed from the servlet request.
attributeReplaced(HttpSessionBindingEvent) - Method in interface javax.servlet.http.HttpSessionAttributeListener
Notification that an attribute has been replaced in a session.
attributeReplaced(ServletContextAttributeEvent) - Method in interface javax.servlet.ServletContextAttributeListener
Notification that an attribute on the servlet context has been replaced.
attributeReplaced(ServletRequestAttributeEvent) - Method in interface javax.servlet.ServletRequestAttributeListener
Notification that an attribute was replaced on the servlet request.
AttributeTag - Class in javax.faces.webapp
Deprecated. The Faces implementation must now provide the implementation for this class.
AttributeTag() - Constructor for class javax.faces.webapp.AttributeTag
Deprecated.
AUDITABLE_EVENT - Static variable in interface javax.xml.registry.LifeCycleManager

AuditableEvent - Interface in javax.xml.registry.infomodel
AuditableEvent instances provide a long term record of events that effect a change of state in a RegistryObject.
AuthenticationFailedException - Exception in javax.mail
This exception is thrown when the connect method on a Store or Transport object fails due to an authentication failure (e.g., bad user name or password).
AuthenticationFailedException() - Constructor for exception javax.mail.AuthenticationFailedException
Constructor
AuthenticationFailedException(String) - Constructor for exception javax.mail.AuthenticationFailedException
Constructor
Authenticator - Class in javax.mail
The class Authenticator represents an object that knows how to obtain authentication for a network connection.
Authenticator() - Constructor for class javax.mail.Authenticator

AUTHORIZED_NAME_SLOT - Static variable in interface javax.xml.registry.infomodel.Slot
Name for pre-defined Slot used in Organization and ClassificationScheme by JAXR UDDI provider.
AUTO_ACKNOWLEDGE - Static variable in interface javax.jms.Session
With this acknowledgment mode, the session automatically acknowledges a client's receipt of a message either when the session has successfully returned from a call to receive or when the message listener the session has called to process the message successfully returns.
autoFlush - Variable in class javax.servlet.jsp.JspWriter
Whether the JspWriter is autoflushing.
available() - Method in class javax.mail.util.SharedFileInputStream
Returns the number of bytes that can be read from this input stream without blocking.

B

Basic - Annotation Type in javax.persistence
The Basic annotation is the simplest type of mapping to a database column.
BASIC_AUTH - Static variable in class javax.faces.context.ExternalContext
String identifier for BASIC authentication.
BASIC_AUTH - Static variable in interface javax.servlet.http.HttpServletRequest
String identifier for Basic authentication.
BCC - Static variable in class javax.mail.Message.RecipientType
The "Bcc" (blind carbon copy) recipients.
BEAN_ADDED - Static variable in class javax.enterprise.deploy.model.XpathEvent
Adding a DDBean
BEAN_CHANGED - Static variable in class javax.enterprise.deploy.model.XpathEvent
Changing a DDBean
BEAN_REMOVED - Static variable in class javax.enterprise.deploy.model.XpathEvent
Removing a DDBean
BeanELResolver - Class in javax.el
Defines property resolution behavior on objects using the JavaBeans component architecture.
BeanELResolver() - Constructor for class javax.el.BeanELResolver
Creates a new read/write BeanELResolver.
BeanELResolver(boolean) - Constructor for class javax.el.BeanELResolver
Creates a new BeanELResolver whose read-only status is determined by the given parameter.
BeanELResolver.BeanProperties - Class in javax.el

BeanELResolver.BeanProperties(Class<?>) - Constructor for class javax.el.BeanELResolver.BeanProperties

BeanELResolver.BeanProperty - Class in javax.el

BeanELResolver.BeanProperty(Class<?>, PropertyDescriptor) - Constructor for class javax.el.BeanELResolver.BeanProperty

BeanNotFoundException - Exception in javax.enterprise.deploy.spi.exceptions
This exception is to report that the bean is not a child of the parent bean.
BeanNotFoundException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.BeanNotFoundException
Creates an new BeanNotFoundException object.
beforeCompletion() - Method in interface javax.ejb.SessionSynchronization
The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed.
beforeCompletion() - Method in interface javax.transaction.Synchronization
The beforeCompletion method is called by the transaction manager prior to the start of the two-phase transaction commit process.
beforeDelivery(Method) - Method in interface javax.resource.spi.endpoint.MessageEndpoint
This is called by a resource adapter before a message is delivered.
beforeMarshal(Object) - Method in class javax.xml.bind.Marshaller.Listener

Callback method invoked before marshalling from source to XML.
beforePhase(PhaseEvent) - Method in interface javax.faces.event.PhaseListener
Handle a notification that the processing for a particular phase of the request processing lifecycle is about to begin.
beforeUnmarshal(Object, Object) - Method in class javax.xml.bind.Unmarshaller.Listener

Callback method invoked before unmarshalling into target.
begin() - Method in interface javax.persistence.EntityTransaction
Start the resource transaction.
begin() - Method in interface javax.resource.cci.LocalTransaction
Begins a local transaction on an EIS instance.
begin() - Method in interface javax.resource.spi.LocalTransaction
Begin a local transaction
begin() - Method in interface javax.transaction.TransactionManager
Create a new transaction and associate it with the current thread.
begin() - Method in interface javax.transaction.UserTransaction
Create a new transaction and associate it with the current thread.
BigDecimalConverter - Class in javax.faces.convert
Converter implementation for java.math.BigDecimal values.
BigDecimalConverter() - Constructor for class javax.faces.convert.BigDecimalConverter

BigDecimalHolder - Class in javax.xml.rpc.holders

BigDecimalHolder() - Constructor for class javax.xml.rpc.holders.BigDecimalHolder

BigDecimalHolder(BigDecimal) - Constructor for class javax.xml.rpc.holders.BigDecimalHolder

BIGINTEGER_ID - Static variable in class javax.faces.convert.BigIntegerConverter
The message identifier of the FacesMessage to be created if the conversion to BigInteger fails.
BigIntegerConverter - Class in javax.faces.convert
Converter implementation for java.math.BigInteger values.
BigIntegerConverter() - Constructor for class javax.faces.convert.BigIntegerConverter

BigIntegerHolder - Class in javax.xml.rpc.holders

BigIntegerHolder() - Constructor for class javax.xml.rpc.holders.BigIntegerHolder

BigIntegerHolder(BigInteger) - Constructor for class javax.xml.rpc.holders.BigIntegerHolder

Binder<XmlNode> - Class in javax.xml.bind
Enable synchronization between XML infoset nodes and JAXB objects representing same XML document.
Binder() - Constructor for class javax.xml.bind.Binder

Binding - Interface in javax.xml.ws
The Binding interface is the base interface for JAX-WS protocol bindings.
BindingProvider - Interface in javax.xml.ws
The BindingProvider interface provides access to the protocol binding and associated context objects for request and response message processing.
bindings - Variable in class javax.faces.component.UIComponent

BindingType - Annotation Type in javax.xml.ws
The BindingType annotation is used to specify the binding to use for a web service endpoint implementation class.
BODY_CONTENT_EMPTY - Static variable in class javax.servlet.jsp.tagext.TagInfo
Static constant for getBodyContent() when it is empty.
BODY_CONTENT_JSP - Static variable in class javax.servlet.jsp.tagext.TagInfo
Static constant for getBodyContent() when it is JSP.
BODY_CONTENT_SCRIPTLESS - Static variable in class javax.servlet.jsp.tagext.TagInfo
Static constant for getBodyContent() when it is scriptless.
BODY_CONTENT_TAG_DEPENDENT - Static variable in class javax.servlet.jsp.tagext.TagInfo
Static constant for getBodyContent() when it is Tag dependent.
bodyContent - Variable in class javax.faces.webapp.UIComponentClassicTagBase
The bodyContent for this tag handler.
BodyContent - Class in javax.servlet.jsp.tagext
An encapsulation of the evaluation of the body of an action so it is available to a tag handler.
BodyContent(JspWriter) - Constructor for class javax.servlet.jsp.tagext.BodyContent
Protected constructor.
bodyContent - Variable in class javax.servlet.jsp.tagext.BodyTagSupport
The current BodyContent for this BodyTag.
BodyPart - Class in javax.mail
This class models a Part that is contained within a Multipart.
BodyPart() - Constructor for class javax.mail.BodyPart

BodyTag - Interface in javax.servlet.jsp.tagext
The BodyTag interface extends IterationTag by defining additional methods that let a tag handler manipulate the content of evaluating its body.
BodyTagSupport - Class in javax.servlet.jsp.tagext
A base class for defining tag handlers implementing BodyTag.
BodyTagSupport() - Constructor for class javax.servlet.jsp.tagext.BodyTagSupport
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.
BodyTerm - Class in javax.mail.search
This class implements searches on a Message Body.
BodyTerm(String) - Constructor for class javax.mail.search.BodyTerm
Constructor
BOOLEAN_ID - Static variable in class javax.faces.convert.BooleanConverter
The message identifier of the FacesMessage to be created if the conversion to Boolean fails.
BooleanConverter - Class in javax.faces.convert
Converter implementation for java.lang.Boolean (and boolean primitive) values.
BooleanConverter() - Constructor for class javax.faces.convert.BooleanConverter

BooleanHolder - Class in javax.xml.rpc.holders

BooleanHolder() - Constructor for class javax.xml.rpc.holders.BooleanHolder

BooleanHolder(boolean) - Constructor for class javax.xml.rpc.holders.BooleanHolder

BooleanWrapperHolder - Class in javax.xml.rpc.holders

BooleanWrapperHolder() - Constructor for class javax.xml.rpc.holders.BooleanWrapperHolder

BooleanWrapperHolder(Boolean) - Constructor for class javax.xml.rpc.holders.BooleanWrapperHolder

BootstrapContext - Interface in javax.resource.spi
This provides a mechanism to pass a bootstrap context to a resource adapter instance when it is bootstrapped.
BoundaryStatistic - Interface in javax.management.j2ee.statistics
Specifies standard measurements of the upper and lower limits of the value of an attribute.
BoundedRangeStatistic - Interface in javax.management.j2ee.statistics
The BoundedRangeStatistic model aggregates the attributes of RangeStatistic and BoundaryStatistic and provides standard measurements of a range that has fixed limits.
broadcast(FacesEvent) - Method in class javax.faces.component.UICommand
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent) processing, pass the ActionEvent being broadcast to the method referenced by actionListener (if any), and to the default ActionListener registered on the Application.
broadcast(FacesEvent) - Method in class javax.faces.component.UIComponent
Broadcast the specified FacesEvent to all registered event listeners who have expressed an interest in events of this type.
broadcast(FacesEvent) - Method in class javax.faces.component.UIComponentBase

broadcast(FacesEvent) - Method in class javax.faces.component.UIData
Override the default UIComponentBase.broadcast(javax.faces.event.FacesEvent) processing to unwrap any wrapped FacesEvent and reset the current row index, before the event is actually broadcast.
bufferSize - Variable in class javax.servlet.jsp.JspWriter
The size of the buffer used by the JspWriter.
bufpos - Variable in class javax.mail.util.SharedFileInputStream
The file offset that corresponds to the first byte in the read buffer.
bufsize - Variable in class javax.mail.util.SharedFileInputStream
The normal size of the read buffer.
BulkResponse - Interface in javax.xml.registry
Contains the response of a method in the API that performs a bulk operation and returns a bulk response.
BusinessLifeCycleManager - Interface in javax.xml.registry
The BusinessLifeCycleManager interface, which is exposed by the Registry Service, implements the life cycle management functionality of the Registry as part of a business level API.
BusinessQueryManager - Interface in javax.xml.registry
The BusinessQueryManager interface, which is exposed by the Registry Service, implements the business style query interface.
BYTE_ID - Static variable in class javax.faces.convert.ByteConverter
The message identifier of the FacesMessage to be created if the conversion to Byte fails.
ByteArrayDataSource - Class in javax.mail.util
A DataSource backed by a byte array.
ByteArrayDataSource(InputStream, String) - Constructor for class javax.mail.util.ByteArrayDataSource
Create a ByteArrayDataSource with data from the specified InputStream and with the specified MIME type.
ByteArrayDataSource(byte[], String) - Constructor for class javax.mail.util.ByteArrayDataSource
Create a ByteArrayDataSource with data from the specified byte array and with the specified MIME type.
ByteArrayDataSource(String, String) - Constructor for class javax.mail.util.ByteArrayDataSource
Create a ByteArrayDataSource with data from the specified String and with the specified MIME type.
ByteArrayHolder - Class in javax.xml.rpc.holders

ByteArrayHolder() - Constructor for class javax.xml.rpc.holders.ByteArrayHolder

ByteArrayHolder(byte[]) - Constructor for class javax.xml.rpc.holders.ByteArrayHolder

ByteConverter - Class in javax.faces.convert
Converter implementation for java.lang.Byte (and byte primitive) values.
ByteConverter() - Constructor for class javax.faces.convert.ByteConverter

ByteHolder - Class in javax.xml.rpc.holders

ByteHolder() - Constructor for class javax.xml.rpc.holders.ByteHolder

ByteHolder(byte) - Constructor for class javax.xml.rpc.holders.ByteHolder

BytesMessage - Interface in javax.jms
A BytesMessage object is used to send a message containing a stream of uninterpreted bytes.
ByteWrapperHolder - Class in javax.xml.rpc.holders

ByteWrapperHolder() - Constructor for class javax.xml.rpc.holders.ByteWrapperHolder

ByteWrapperHolder(Byte) - Constructor for class javax.xml.rpc.holders.ByteWrapperHolder

C

calculateCharacterEncoding(FacesContext) - Method in class javax.faces.application.ViewHandler
Returns the correct character encoding to be used for this request.
calculateCharacterEncoding(FacesContext) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.calculateCharacterEncoding(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
calculateLocale(FacesContext) - Method in class javax.faces.application.ViewHandler
Returns an appropriate Locale to use for this and subsequent requests for the current client.
calculateLocale(FacesContext) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.calculateLocale(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
calculateRenderKitId(FacesContext) - Method in class javax.faces.application.ViewHandler
Return an appropriate renderKitId for this and subsequent requests from the current client.
calculateRenderKitId(FacesContext) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
CalendarHolder - Class in javax.xml.rpc.holders

CalendarHolder() - Constructor for class javax.xml.rpc.holders.CalendarHolder

CalendarHolder(Calendar) - Constructor for class javax.xml.rpc.holders.CalendarHolder

Call - Interface in javax.xml.rpc
The javax.xml.rpc.Call interface provides support for the dynamic invocation of a service endpoint.
call(SOAPMessage, Object) - Method in class javax.xml.soap.SOAPConnection
Sends the given message to the specified endpoint and blocks until it has returned the response.
canBeRequestTime() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Whether this attribute has been specified in the TLD as rtexprvalue.
cancel() - Method in interface javax.ejb.Timer
Cause the timer and all its associated expiration notifications to be cancelled.
CANCEL - Static variable in class javax.enterprise.deploy.shared.ActionType
A cancel operation is being preformed on the DeploymentManager action command.
cancel() - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
(optional) A cancel request on an in-process operation stops all further processing of the operation and returns the environment to it original state before the operation was executed.
CapabilityProfile - Interface in javax.xml.registry
Provides information about the capabilities of a JAXR provider.
CAR - Static variable in class javax.enterprise.deploy.shared.ModuleType
The module is an Client Application archive.
CascadeType - Enum in javax.persistence
Defines the set of cascadable operations that are propagated to the associated entity.
CASE_SENSITIVE_MATCH - Static variable in interface javax.xml.registry.FindQualifier

cause - Variable in exception javax.xml.registry.JAXRException

CC - Static variable in class javax.mail.Message.RecipientType
The "Cc" (carbon copy) recipients.
CDATA - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is a CDATA section
CHARACTER_ENCODING_KEY - Static variable in class javax.faces.application.ViewHandler
The key, in the session's attribute set, under which the response character encoding may be stored and retrieved.
CHARACTER_ID - Static variable in class javax.faces.convert.CharacterConverter
The message identifier of the FacesMessage to be created if the conversion to Character fails.
CHARACTER_SET_ENCODING - Static variable in class javax.xml.soap.SOAPMessage
Specifies the character type encoding for the SOAP Message.
CharacterConverter - Class in javax.faces.convert
Converter implementation for java.lang.Character (and char primitive) values.
CharacterConverter() - Constructor for class javax.faces.convert.CharacterConverter

Characters - Interface in javax.xml.stream.events
This describes the interface to Characters events.
CHARACTERS - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is characters
Classification - Interface in javax.xml.registry.infomodel
The Classification interface is used to classify RegistryObject instances.
CLASSIFICATION - Static variable in interface javax.xml.registry.LifeCycleManager

CLASSIFICATION_SCHEME - Static variable in interface javax.xml.registry.LifeCycleManager

ClassificationScheme - Interface in javax.xml.registry.infomodel
A ClassificationScheme instance represents a taxonomy that may be used to classify or categorize RegistryObject instances.
ClassTransformer - Interface in javax.persistence.spi
A persistence provider supplies an instance of this interface to the PersistenceUnitInfo.addTransformer method.
cleanup() - Method in interface javax.resource.spi.ManagedConnection
Application server calls this method to force any cleanup on the ManagedConnection instance.
clear() - Method in interface javax.persistence.EntityManager
Clear the persistence context, causing all managed entities to become detached.
clear() - Method in class javax.servlet.jsp.JspWriter
Clear the contents of the buffer.
clear() - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.
clearBody() - Method in interface javax.jms.Message
Clears out the message body.
clearBody() - Method in class javax.servlet.jsp.tagext.BodyContent
Clear the body without throwing any exceptions.
clearBuffer() - Method in class javax.servlet.jsp.JspWriter
Clears the current contents of the buffer.
clearContent() - Method in class javax.xml.soap.AttachmentPart
Clears out the content of this AttachmentPart object.
clearProperties() - Method in interface javax.jms.Message
Clears a message's properties.
clearWarnings() - Method in interface javax.resource.cci.Interaction
Clears all the warning reported by this Interaction instance.
CLIENT_ACKNOWLEDGE - Static variable in interface javax.jms.Session
With this acknowledgment mode, the client acknowledges a consumed message by calling the message's acknowledge method.
CLIENT_CERT_AUTH - Static variable in class javax.faces.context.ExternalContext
String identifier for CLIENT_CERT authentication.
CLIENT_CERT_AUTH - Static variable in interface javax.servlet.http.HttpServletRequest
String identifier for Client Certificate authentication.
ClientConfiguration - Interface in javax.enterprise.deploy.spi.status
The ClientConfiguration object installs, configures and executes an Application Client.
ClientExecuteException - Exception in javax.enterprise.deploy.spi.exceptions
This exception reports errors in setting up an application client for execution.
ClientExecuteException() - Constructor for exception javax.enterprise.deploy.spi.exceptions.ClientExecuteException
Creates new ClientExecuteException without detail message.
ClientExecuteException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.ClientExecuteException
Constructs an ClientExecuteException with the specified detail message.
clone() - Method in class javax.mail.Flags
Returns a clone of this Flags object.
clone() - Method in class javax.mail.internet.InternetAddress
Return a copy of this InternetAddress object.
clone() - Method in interface javax.resource.cci.Record
Creates and returns a copy of this object.
clone() - Method in class javax.servlet.http.Cookie
Overrides the standard java.lang.Object.clone method to return a copy of this cookie.
cloneWithWriter(Writer) - Method in class javax.faces.context.ResponseWriter
Create and return a new instance of this ResponseWriter, using the specified Writer as the output destination.
cloneWithWriter(Writer) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.cloneWithWriter(java.io.Writer) on the wrapped ResponseWriter object.
close() - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call Writer.close() on the wrapped ResponseWriter object.
close() - Method in interface javax.jms.Connection
Closes the connection.
close() - Method in interface javax.jms.ConnectionConsumer
Closes the connection consumer.
close() - Method in interface javax.jms.MessageConsumer
Closes the message consumer.
close() - Method in interface javax.jms.MessageProducer
Closes the message producer.
close() - Method in interface javax.jms.QueueBrowser
Closes the QueueBrowser.
close() - Method in class javax.jms.QueueRequestor
Closes the QueueRequestor and its session.
close() - Method in interface javax.jms.Session
Closes the session.
close() - Method in class javax.jms.TopicRequestor
Closes the TopicRequestor and its session.
close(boolean) - Method in class javax.mail.Folder
Close this Folder.
close() - Method in class javax.mail.Service
Close this service and terminate its connection.
close() - Method in class javax.mail.util.SharedFileInputStream
Closes this input stream and releases any system resources associated with the stream.
close() - Method in interface javax.persistence.EntityManager
Close an application-managed EntityManager.
close() - Method in interface javax.persistence.EntityManagerFactory
Close the factory, releasing any resources that it holds.
close() - Method in interface javax.resource.cci.Connection
Initiates close of the connection handle at the application level.
close() - Method in interface javax.resource.cci.Interaction
Closes the current Interaction and release all the resources held for this instance by the resource adapter.
close() - Method in class javax.servlet.jsp.JspWriter
Close the stream, flushing it first.
close() - Method in interface javax.xml.registry.Connection
Closes a Connection when it is no longer needed.
close() - Method in class javax.xml.soap.SOAPConnection
Closes this SOAPConnection object.
close() - Method in class javax.xml.stream.util.EventReaderDelegate

close() - Method in class javax.xml.stream.util.StreamReaderDelegate

close() - Method in interface javax.xml.stream.XMLEventReader
Frees any resources associated with this Reader.
close() - Method in interface javax.xml.stream.XMLEventWriter
Frees any resources associated with this stream
close() - Method in interface javax.xml.stream.XMLStreamReader
Frees any resources associated with this Reader.
close() - Method in interface javax.xml.stream.XMLStreamWriter
Close this writer and free any resources associated with the writer.
close(MessageContext) - Method in interface javax.xml.ws.handler.Handler
Called at the conclusion of a message exchange pattern just prior to the JAX-WS runtime disptaching a message, fault or exception.
closed(ConnectionEvent) - Method in class javax.mail.event.ConnectionAdapter

CLOSED - Static variable in class javax.mail.event.ConnectionEvent
A connection was closed.
closed(ConnectionEvent) - Method in interface javax.mail.event.ConnectionListener
Invoked when a Store/Folder/Transport is closed.
coerceToType(Object, Class<?>) - Method in class javax.el.ExpressionFactory
Coerces an object to a specific type according to the EL type conversion rules.
CollapsedStringAdapter - Class in javax.xml.bind.annotation.adapters
Built-in XmlAdapter to handle xs:token and its derived types.
CollapsedStringAdapter() - Constructor for class javax.xml.bind.annotation.adapters.CollapsedStringAdapter

Column - Annotation Type in javax.persistence
Is used to specify a mapped column for a persistent property or field.
ColumnResult - Annotation Type in javax.persistence
References name of a column in the SELECT clause of a SQL query - i.e., column alias, if applicable.
COMBINE_CLASSIFICATIONS - Static variable in interface javax.xml.registry.FindQualifier
Maps to UDDI combineCategoryBags.
CommandInfo - Class in javax.activation
The CommandInfo class is used by CommandMap implementations to describe the results of command requests.
CommandInfo(String, String) - Constructor for class javax.activation.CommandInfo
The Constructor for CommandInfo.
CommandMap - Class in javax.activation
The CommandMap class provides an interface to a registry of command objects available in the system.
CommandMap() - Constructor for class javax.activation.CommandMap

CommandObject - Interface in javax.activation
JavaBeans components that are Activation Framework aware implement this interface to find out which command verb they're being asked to perform, and to obtain the DataHandler representing the data they should operate on.
CommandType - Class in javax.enterprise.deploy.shared
Class CommandTypes defines enumeration values for the DeploymentStatus object.
CommandType(int) - Constructor for class javax.enterprise.deploy.shared.CommandType
Construct a new enumeration value with the given integer value.
COMMENT - Static variable in class javax.mail.internet.HeaderTokenizer.Token
Token type indicating a comment.
Comment - Interface in javax.xml.stream.events
An interface for comment events
COMMENT - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is a comment
CommException - Exception in javax.resource.spi
This indicates errors related to failed or interrupted communication with an EIS instance.
CommException() - Constructor for exception javax.resource.spi.CommException
Constructs a new instance with null as its detail message.
CommException(String) - Constructor for exception javax.resource.spi.CommException
Constructs a new instance with the specified detail message.
CommException(Throwable) - Constructor for exception javax.resource.spi.CommException
Constructs a new throwable with the specified cause.
CommException(String, Throwable) - Constructor for exception javax.resource.spi.CommException
Constructs a new throwable with the specified detail message and cause.
CommException(String, String) - Constructor for exception javax.resource.spi.CommException
Constructs a new throwable with the specified detail message and an error code.
commit() - Method in interface javax.jms.Session
Commits all messages done in this transaction and releases any locks currently held.
commit() - Method in interface javax.jms.XASession
Throws a TransactionInProgressException, since it should not be called for an XASession object.
commit() - Method in interface javax.persistence.EntityTransaction
Commit the current transaction, writing any unflushed changes to the database.
commit() - Method in interface javax.resource.cci.LocalTransaction
Commits the current local transaction and release all locks held by the underlying EIS instance.
commit() - Method in interface javax.resource.spi.LocalTransaction
Commit a local transaction
commit(Xid, boolean) - Method in interface javax.resource.spi.XATerminator
Commits the global transaction specified by xid.
commit() - Method in interface javax.security.jacc.PolicyConfiguration
This method is used to set to "inService" the state of the policy context whose interface is this PolicyConfiguration Object.
commit() - Method in interface javax.transaction.Transaction
Complete the transaction represented by this Transaction object.
commit() - Method in interface javax.transaction.TransactionManager
Complete the transaction associated with the current thread.
commit() - Method in interface javax.transaction.UserTransaction
Complete the transaction associated with the current thread.
commit(Xid, boolean) - Method in interface javax.transaction.xa.XAResource
Commits the global transaction specified by xid.
compareTo(Object) - Method in class javax.faces.application.FacesMessage.Severity
Compare this FacesMessage.Severity instance to the specified one.
compareTo(Object) - Method in class javax.faces.event.PhaseId
Compare this PhaseId instance to the specified one.
compareValues(Object, Object) - Method in class javax.faces.component.UIInput
Return true if the new value is different from the previous value.
compareValues(Object, Object) - Method in class javax.faces.component.UISelectMany
Return true if the new value is different from the previous value.
comparison - Variable in class javax.mail.search.ComparisonTerm
The comparison.
ComparisonTerm - Class in javax.mail.search
This class models the comparison operator.
ComparisonTerm() - Constructor for class javax.mail.search.ComparisonTerm

COMPLETED - Static variable in class javax.enterprise.deploy.shared.StateType
The action operation has completed normally.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIColumn
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UICommand
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIData
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIForm
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIGraphic
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIInput
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIMessage
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIMessages
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UINamingContainer
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIOutput
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIPanel
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIParameter
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UISelectBoolean
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UISelectItem
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UISelectItems
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UISelectMany
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UISelectOne
The standard component family for this component.
COMPONENT_FAMILY - Static variable in class javax.faces.component.UIViewRoot
The standard component family for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlColumn
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlCommandButton
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlCommandLink
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlDataTable
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlForm
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlGraphicImage
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlInputHidden
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlInputSecret
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlInputText
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlInputTextarea
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlMessage
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlMessages
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlOutputFormat
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlOutputLabel
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlOutputLink
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlOutputText
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlPanelGrid
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlPanelGroup
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlSelectBooleanCheckbox
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlSelectManyCheckbox
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlSelectManyListbox
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlSelectManyMenu
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlSelectOneListbox
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlSelectOneMenu
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.html.HtmlSelectOneRadio
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIColumn
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UICommand
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIData
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIForm
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIGraphic
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIInput
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIMessage
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIMessages
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UINamingContainer
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIOutput
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIPanel
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIParameter
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UISelectBoolean
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UISelectItem
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UISelectItems
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UISelectMany
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UISelectOne
The standard component type for this component.
COMPONENT_TYPE - Static variable in class javax.faces.component.UIViewRoot
The standard component type for this component.
CompositeELResolver - Class in javax.el
Maintains an ordered composite list of child ELResolvers.
CompositeELResolver() - Constructor for class javax.el.CompositeELResolver

Concept - Interface in javax.xml.registry.infomodel
The Concept interface is used to represent taxonomy elements and their structural relationship with each other in order to describe an internal taxonomy.
CONCEPT - Static variable in interface javax.xml.registry.LifeCycleManager

ConcurrentAccessException - Exception in javax.ejb
A ConcurrentAccessException indicates that the client has attempted an invocation on a stateful session bean while another invocation is in progress.
ConcurrentAccessException() - Constructor for exception javax.ejb.ConcurrentAccessException
Constructs an ConcurrentAccessException with no detail message.
ConcurrentAccessException(String) - Constructor for exception javax.ejb.ConcurrentAccessException
Constructs an ConcurrentAccessException with the specified detailed message.
ConcurrentAccessException(String, Exception) - Constructor for exception javax.ejb.ConcurrentAccessException
Constructs an ConcurrentAccessException with the specified detail message and a nested exception.
CONFIG - Static variable in class javax.servlet.jsp.PageContext
Name used to store ServletConfig in PageContext name table.
CONFIG_FILES_ATTR - Static variable in class javax.faces.webapp.FacesServlet
Context initialization parameter name for a comma delimited list of context-relative resource paths (in addition to /WEB-INF/faces-config.xml which is loaded automatically if it exists) containing JavaServer Faces configuration information.
ConfigurationException - Exception in javax.enterprise.deploy.spi.exceptions
This exception reports errors in generating a configuration bean.
ConfigurationException() - Constructor for exception javax.enterprise.deploy.spi.exceptions.ConfigurationException
Creates new ConfigurationException without detail message.
ConfigurationException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.ConfigurationException
Constructs an ConfigurationException with the specified detail message.
confirmAssociation(Association) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Confirms this Association by the User associated with the caller.
connect() - Method in class javax.mail.Service
A generic connect method that takes no parameters.
connect(String, String, String) - Method in class javax.mail.Service
Connect to the specified address.
connect(String, String) - Method in class javax.mail.Service
Connect to the current host using the specified username and password.
connect(String, int, String, String) - Method in class javax.mail.Service
Similar to connect(host, user, password) except a specific port can be specified.
Connection - Interface in javax.jms
A Connection object is a client's active connection to its JMS provider.
Connection - Interface in javax.resource.cci
A Connection represents an application-level handle that is used by a client to access the underlying physical connection.
Connection - Interface in javax.xml.registry
This class represents a connection between a JAXR client and a JAXR provider.
CONNECTION_CLOSED - Static variable in class javax.resource.spi.ConnectionEvent
Event notification that an application component has closed the connection
CONNECTION_ERROR_OCCURRED - Static variable in class javax.resource.spi.ConnectionEvent
Event notification that an error occurred on the connection.
ConnectionAdapter - Class in javax.mail.event
The adapter which receives connection events.
ConnectionAdapter() - Constructor for class javax.mail.event.ConnectionAdapter

connectionClosed(ConnectionEvent) - Method in interface javax.resource.spi.ConnectionEventListener
Notifies that an application component has closed the connection.
ConnectionConsumer - Interface in javax.jms
For application servers, Connection objects provide a special facility for creating a ConnectionConsumer (optional).
connectionErrorOccurred(ConnectionEvent) - Method in interface javax.resource.spi.ConnectionEventListener
Notifies a connection related error.
ConnectionEvent - Class in javax.mail.event
This class models Connection events.
ConnectionEvent(Object, int) - Constructor for class javax.mail.event.ConnectionEvent
Constructor
ConnectionEvent - Class in javax.resource.spi
The ConnectionEvent class provides information about the source of a connection related event.A ConnectionEvent instance contains the following information: Type of the connection event ManagedConnection instance that generated the connection event.
ConnectionEvent(ManagedConnection, int) - Constructor for class javax.resource.spi.ConnectionEvent
Construct a ConnectionEvent object.
ConnectionEvent(ManagedConnection, int, Exception) - Constructor for class javax.resource.spi.ConnectionEvent
Construct a ConnectionEvent object.
ConnectionEventListener - Interface in javax.resource.spi
The ConnectionEventListener interface provides an event callback mechanism to enable an application server to receive notifications from a ManagedConnection instance.
ConnectionFactory - Interface in javax.jms
A ConnectionFactory object encapsulates a set of connection configuration parameters that has been defined by an administrator.
ConnectionFactory - Interface in javax.resource.cci
ConnectionFactory provides an interface for getting connection to an EIS instance.
ConnectionFactory - Class in javax.xml.registry
This is the abstract base class for factory classes for creating a JAXR connection.
ConnectionFactory() - Constructor for class javax.xml.registry.ConnectionFactory

ConnectionListener - Interface in javax.mail.event
This is the Listener interface for Connection events.
ConnectionManager - Interface in javax.resource.spi
ConnectionManager interface provides a hook for the resource adapter to pass a connection request to the application server.
ConnectionMetaData - Interface in javax.jms
A ConnectionMetaData object provides information describing the Connection object.
ConnectionMetaData - Interface in javax.resource.cci
The interface ConnectionMetaData provides information about an EIS instance connected through a Connection instance.
ConnectionRequestInfo - Interface in javax.resource.spi
The ConnectionRequestInfo interface enables a resource adapter to pass its own request specific data structure across the connection request flow.
ConnectionSpec - Interface in javax.resource.cci
ConnectionSpec is used by an application component to pass connection request-specific properties to the ConnectionFactory.
contains(FetchProfile.Item) - Method in class javax.mail.FetchProfile
Returns true if the fetch profile contains given special item.
contains(String) - Method in class javax.mail.FetchProfile
Returns true if the fetch profile contains given header name.
contains(Flags.Flag) - Method in class javax.mail.Flags
Check whether the specified system flag is present in this Flags object.
contains(String) - Method in class javax.mail.Flags
Check whether the specified user flag is present in this Flags object.
contains(Flags) - Method in class javax.mail.Flags
Check whether all the flags in the specified Flags object are present in this Flags object.
contains(Object) - Method in interface javax.persistence.EntityManager
Check if the instance belongs to the current persistence context.
containsHeader(String) - Method in interface javax.servlet.http.HttpServletResponse
Returns a boolean indicating whether the named response header has already been set.
containsHeader(String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call containsHeader(String name) on the wrapped response object.
containsProperty(String) - Method in interface javax.xml.rpc.handler.MessageContext
Returns true if the MessageContext contains a property with the specified name.
content - Variable in class javax.mail.internet.MimeBodyPart
Byte array that holds the bytes of the content of this Part.
content - Variable in class javax.mail.internet.MimeMessage
Byte array that holds the bytes of this Message's content.
CONTENT_INFO - Static variable in class javax.mail.FetchProfile.Item
This item is for fetching information about the content of the message.
ContentDisposition - Class in javax.mail.internet
This class represents a MIME ContentDisposition value.
ContentDisposition() - Constructor for class javax.mail.internet.ContentDisposition
No-arg Constructor.
ContentDisposition(String, ParameterList) - Constructor for class javax.mail.internet.ContentDisposition
Constructor.
ContentDisposition(String) - Constructor for class javax.mail.internet.ContentDisposition
Constructor that takes a ContentDisposition string.
contentStream - Variable in class javax.mail.internet.MimeBodyPart
If the data for this body part was supplied by an InputStream that implements the SharedInputStream interface, contentStream is another such stream representing the content of this body part.
contentStream - Variable in class javax.mail.internet.MimeMessage
If the data for this message was supplied by an InputStream that implements the SharedInputStream interface, contentStream is another such stream representing the content of this message.
ContentType - Class in javax.mail.internet
This class represents a MIME ContentType value.
ContentType() - Constructor for class javax.mail.internet.ContentType
No-arg Constructor.
ContentType(String, String, ParameterList) - Constructor for class javax.mail.internet.ContentType
Constructor.
ContentType(String) - Constructor for class javax.mail.internet.ContentType
Constructor that takes a Content-Type string.
contentType - Variable in class javax.mail.Multipart
This field specifies the content-type of this multipart object.
ContextCallback - Interface in javax.faces.component
A simple callback interace that enables taking action on a specific UIComponent (either facet or child) in the view while preserving any contextual state for that component instance in the view.
contextCreated(ELContextEvent) - Method in interface javax.el.ELContextListener
Invoked when a new ELContext has been created.
contextDestroyed(ServletContextEvent) - Method in interface javax.servlet.ServletContextListener
Notification that the servlet context is about to be shut down.
contextInitialized(ServletContextEvent) - Method in interface javax.servlet.ServletContextListener
Notification that the web application initialization process is starting.
CONVERSION_MESSAGE_ID - Static variable in class javax.faces.component.UIInput
The message identifier of the FacesMessage to be created if a conversion error occurs, and neither the page author nor the ConverterException provides a message.
convertClientId(FacesContext, String) - Method in class javax.faces.render.Renderer
Convert the component generated client id to a form suitable for transmission to the client.
Converter - Interface in javax.faces.convert
Converter is an interface describing a Java class that can perform Object-to-String and String-to-Object conversions between model data objects and a String representation of those objects that is suitable for rendering.
CONVERTER_ID - Static variable in class javax.faces.convert.BigDecimalConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.BigIntegerConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.BooleanConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.ByteConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.CharacterConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.DateTimeConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.DoubleConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.EnumConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.FloatConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.IntegerConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.LongConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.NumberConverter
The standard converter id for this converter.
CONVERTER_ID - Static variable in class javax.faces.convert.ShortConverter
The standard converter id for this converter.
ConverterELTag - Class in javax.faces.webapp
ConverterELTag is a base class for all JSP custom actions that create and register a Converter instance on the ValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentClassicTagBase.
ConverterELTag() - Constructor for class javax.faces.webapp.ConverterELTag

ConverterException - Exception in javax.faces.convert
ConverterException is an exception thrown by the getAsObject() or getAsText() method of a Converter, to indicate that the requested conversion cannot be performed.
ConverterException() - Constructor for exception javax.faces.convert.ConverterException
Construct a new exception with no detail message or root cause.
ConverterException(String) - Constructor for exception javax.faces.convert.ConverterException
Construct a new exception with the specified detail message and no root cause.
ConverterException(Throwable) - Constructor for exception javax.faces.convert.ConverterException
Construct a new exception with the specified root cause.
ConverterException(String, Throwable) - Constructor for exception javax.faces.convert.ConverterException
Construct a new exception with the specified detail message and root cause.
ConverterException(FacesMessage) - Constructor for exception javax.faces.convert.ConverterException
Construct a new exception with the specified detail message and no root cause.
ConverterException(FacesMessage, Throwable) - Constructor for exception javax.faces.convert.ConverterException
Construct a new exception with the specified detail message and root cause.
ConverterTag - Class in javax.faces.webapp
Deprecated. This has been partially replaced by ConverterELTag. The remainder of the functionality, namely, the binding facility and the implementation of the ConverterTag.createConverter() method, is now an implementation detail.
ConverterTag() - Constructor for class javax.faces.webapp.ConverterTag
Deprecated.
Cookie - Class in javax.servlet.http
Creates a cookie, a small amount of information sent by a servlet to a Web browser, saved by the browser, and later sent back to the server.
Cookie(String, String) - Constructor for class javax.servlet.http.Cookie
Constructs a cookie with a specified name and value.
copyMessages(Message[], Folder) - Method in class javax.mail.Folder
Copy the specified Messages from this Folder into another Folder.
countAttachments() - Method in class javax.xml.soap.SOAPMessage
Gets a count of the number of attachments in this message.
CountStatistic - Interface in javax.management.j2ee.statistics
Specifies standard count measurements.
create(int) - Method in class javax.mail.Folder
Create this folder on the Store.
create() - Method in interface javax.management.j2ee.ManagementHome
Creates an MEJB session object which provides access to the J2EE Management Model
create(Name) - Method in class javax.xml.soap.SOAPElementFactory
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(javax.xml.soap.Name) instead
create(String) - Method in class javax.xml.soap.SOAPElementFactory
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(String localName) instead
create(String, String, String) - Method in class javax.xml.soap.SOAPElementFactory
Deprecated. Use javax.xml.soap.SOAPFactory.createElement(String localName, String prefix, String uri) instead
create(Object) - Static method in class javax.xml.ws.Endpoint
Creates an endpoint with the specified implementor object.
create(String, Object) - Static method in class javax.xml.ws.Endpoint
Creates an endpoint with the specified binding type and implementor object.
create(URL, QName) - Static method in class javax.xml.ws.Service
Create a Service instance.
create(QName) - Static method in class javax.xml.ws.Service
Create a Service instance.
createAndPublishEndpoint(String, Object) - Method in class javax.xml.ws.spi.Provider
Creates and publishes an endpoint object with the specified address and implementation object.
createAssociation(RegistryObject, Concept) - Method in interface javax.xml.registry.LifeCycleManager
Creates an Association instance using the specified parameters.
createAttachmentPart() - Method in class javax.xml.soap.SOAPMessage
Creates a new empty AttachmentPart object.
createAttachmentPart(DataHandler) - Method in class javax.xml.soap.SOAPMessage
Creates an AttachmentPart object and populates it using the given DataHandler object.
createAttachmentPart(Object, String) - Method in class javax.xml.soap.SOAPMessage
Creates an AttachmentPart object and populates it with the specified data of the specified content type.
createAttribute(String, String, String, String) - Method in class javax.xml.stream.XMLEventFactory
Create a new Attribute
createAttribute(String, String) - Method in class javax.xml.stream.XMLEventFactory
Create a new Attribute
createAttribute(QName, String) - Method in class javax.xml.stream.XMLEventFactory
Create a new Attribute
createBinder(Class<T>) - Method in class javax.xml.bind.JAXBContext
Creates a Binder object that can be used for associative/in-place unmarshalling/marshalling.
createBinder() - Method in class javax.xml.bind.JAXBContext
Creates a Binder for W3C DOM.
createBrowser(Queue) - Method in interface javax.jms.QueueSession
Creates a QueueBrowser object to peek at the messages on the specified queue.
createBrowser(Queue, String) - Method in interface javax.jms.QueueSession
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
createBrowser(Queue) - Method in interface javax.jms.Session
Creates a QueueBrowser object to peek at the messages on the specified queue.
createBrowser(Queue, String) - Method in interface javax.jms.Session
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
createBytesMessage() - Method in interface javax.jms.Session
Creates a BytesMessage object.
createCall(QName) - Method in interface javax.xml.rpc.Service
Creates a Call instance.
createCall(QName, QName) - Method in interface javax.xml.rpc.Service
Creates a Call instance.
createCall(QName, String) - Method in interface javax.xml.rpc.Service
Creates a Call instance.
createCall() - Method in interface javax.xml.rpc.Service
Creates a Call object not associated with specific operation or target service endpoint.
createCData(String) - Method in class javax.xml.stream.XMLEventFactory
Create a Characters event with the CData flag set to true
createCharacters(String) - Method in class javax.xml.stream.XMLEventFactory
Create a Characters event, this method does not check if the content is all whitespace.
createClassification(ClassificationScheme, String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Classification instance for an external Classification using the specified String name and String value that identify a taxonomy element within the specified ClassificationScheme.
createClassification(ClassificationScheme, InternationalString, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Classification instance for an external Classification using the specified InternationalString name and String value that identify a taxonomy element within the specified ClassificationScheme.
createClassification(Concept) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Classification instance for an internal Classification using the specified Concept that identifies a taxonomy element within an internal ClassificationScheme.
createClassificationScheme(String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a ClassificationScheme given the specified String parameters.
createClassificationScheme(InternationalString, InternationalString) - Method in interface javax.xml.registry.LifeCycleManager
Creates a ClassificationScheme given the specified InternationalString parameters.
createClassificationScheme(Concept) - Method in interface javax.xml.registry.LifeCycleManager
Creates a ClassificationScheme from a Concept that has no ClassificationScheme or parent Concept.
createComment(String) - Method in class javax.xml.stream.XMLEventFactory
Create a comment
createComponent(String) - Method in class javax.faces.application.Application
Instantiate and return a new UIComponent instance of the class specified by a previous call to addComponent() for the specified component type.
createComponent(ValueBinding, FacesContext, String) - Method in class javax.faces.application.Application
Deprecated. This has been replaced by Application.createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String).
createComponent(ValueExpression, FacesContext, String) - Method in class javax.faces.application.Application
Call the getValue() method on the specified ValueExpression.
createComponent(FacesContext, String) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Create and return a new child component of the type returned by calling getComponentType().
createComponent(FacesContext, String) - Method in class javax.faces.webapp.UIComponentELTag
Create and return a new child component of the type returned by calling getComponentType().
createComponent(FacesContext, String) - Method in class javax.faces.webapp.UIComponentTag
Deprecated. Implement createComponent using Faces 1.1 EL API.
createConcept(RegistryObject, String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Concept instance using the specified parameters, where the name is a String.
createConcept(RegistryObject, InternationalString, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Concept instance using the specified parameters, where the name is an InternationalString.
createConfiguration(DeployableObject) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Retrieve the object that provides server-specific deployment configuration information for the J2EE deployable component.
createConnection() - Method in interface javax.jms.ConnectionFactory
Creates a connection with the default user identity.
createConnection(String, String) - Method in interface javax.jms.ConnectionFactory
Creates a connection with the specified user identity.
createConnection() - Method in class javax.xml.registry.ConnectionFactory
Create a named connection.
createConnection() - Method in class javax.xml.soap.SOAPConnectionFactory
Create a new SOAPConnection.
createConnectionConsumer(Destination, String, ServerSessionPool, int) - Method in interface javax.jms.Connection
Creates a connection consumer for this connection (optional operation).
createConnectionConsumer(Queue, String, ServerSessionPool, int) - Method in interface javax.jms.QueueConnection
Creates a connection consumer for this connection (optional operation).
createConnectionConsumer(Topic, String, ServerSessionPool, int) - Method in interface javax.jms.TopicConnection
Creates a connection consumer for this connection (optional operation).
createConnectionFactory(ConnectionManager) - Method in interface javax.resource.spi.ManagedConnectionFactory
Creates a Connection Factory instance.
createConnectionFactory() - Method in interface javax.resource.spi.ManagedConnectionFactory
Creates a Connection Factory instance.
createConsumer(Destination) - Method in interface javax.jms.Session
Creates a MessageConsumer for the specified destination.
createConsumer(Destination, String) - Method in interface javax.jms.Session
Creates a MessageConsumer for the specified destination, using a message selector.
createConsumer(Destination, String, boolean) - Method in interface javax.jms.Session
Creates MessageConsumer for the specified destination, using a message selector.
createContainerEntityManagerFactory(PersistenceUnitInfo, Map) - Method in interface javax.persistence.spi.PersistenceProvider
Called by the container when an EntityManagerFactory is to be created.
createConverter(String) - Method in class javax.faces.application.Application
Instantiate and return a new Converter instance of the class specified by a previous call to addConverter() for the specified converter id.
createConverter(Class) - Method in class javax.faces.application.Application
Instantiate and return a new Converter instance of the class that has registered itself as capable of performing conversions for objects of the specified type.
createConverter() - Method in class javax.faces.webapp.ConverterELTag
Create and return a new Converter to be registered on our surrounding UIComponent.
createConverter() - Method in class javax.faces.webapp.ConverterTag
Deprecated. Create and return a new Converter to be registered on our surrounding UIComponent.
CREATED - Static variable in class javax.mail.event.FolderEvent
The folder was created.
createDataContentHandler(String) - Method in class javax.activation.CommandMap
Locate a DataContentHandler that corresponds to the MIME type.
createDataContentHandler(String, DataSource) - Method in class javax.activation.CommandMap
Locate a DataContentHandler that corresponds to the MIME type.
createDataContentHandler(String) - Method in interface javax.activation.DataContentHandlerFactory
Creates a new DataContentHandler object for the MIME type.
createDataContentHandler(String) - Method in class javax.activation.MailcapCommandMap
Return the DataContentHandler for the specified MIME type.
createDetail() - Method in class javax.xml.soap.SOAPFactory
Creates a new Detail object which serves as a container for DetailEntry objects.
createDispatch(QName, Class<T>, Service.Mode) - Method in class javax.xml.ws.Service
Creates a Dispatch instance for use with objects of the users choosing.
createDispatch(QName, JAXBContext, Service.Mode) - Method in class javax.xml.ws.Service
Creates a Dispatch instance for use with JAXB generated objects.
createDispatch(QName, Class<T>, Service.Mode) - Method in class javax.xml.ws.spi.ServiceDelegate
Creates a Dispatch instance for use with objects of the users choosing.
createDispatch(QName, JAXBContext, Service.Mode) - Method in class javax.xml.ws.spi.ServiceDelegate
Creates a Dispatch instance for use with JAXB generated objects.
createDTD(String) - Method in class javax.xml.stream.XMLEventFactory
Create a document type definition event This string contains the entire document type declaration that matches the doctypedecl in the XML 1.0 specification
createDurableConnectionConsumer(Topic, String, String, ServerSessionPool, int) - Method in interface javax.jms.Connection
Create a durable connection consumer for this connection (optional operation).
createDurableConnectionConsumer(Topic, String, String, ServerSessionPool, int) - Method in interface javax.jms.TopicConnection
Create a durable connection consumer for this connection (optional operation).
createDurableSubscriber(Topic, String) - Method in interface javax.jms.Session
Creates a durable subscriber to the specified topic.
createDurableSubscriber(Topic, String, String, boolean) - Method in interface javax.jms.Session
Creates a durable subscriber to the specified topic, using a message selector and specifying whether messages published by its own connection should be delivered to it.
createDurableSubscriber(Topic, String) - Method in interface javax.jms.TopicSession
Creates a durable subscriber to the specified topic.
createDurableSubscriber(Topic, String, String, boolean) - Method in interface javax.jms.TopicSession
Creates a durable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.
createElement(Element) - Method in class javax.xml.soap.SOAPFactory
Creates a SOAPElement object from an existing DOM Element.
createElement(Name) - Method in class javax.xml.soap.SOAPFactory
Creates a SOAPElement object initialized with the given Name object.
createElement(QName) - Method in class javax.xml.soap.SOAPFactory
Creates a SOAPElement object initialized with the given QName object.
createElement(String) - Method in class javax.xml.soap.SOAPFactory
Creates a SOAPElement object initialized with the given local name.
createElement(String, String, String) - Method in class javax.xml.soap.SOAPFactory
Creates a new SOAPElement object with the given local name, prefix and uri.
createEmailAddress(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an EmailAddress instance using an address as the parameter.
createEmailAddress(String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an EmailAddress instance using both an address and a type as parameters.
createEndDocument() - Method in class javax.xml.stream.XMLEventFactory
Creates a new instance of an EndDocument event
createEndElement(QName, Iterator) - Method in class javax.xml.stream.XMLEventFactory
Create a new EndElement
createEndElement(String, String, String) - Method in class javax.xml.stream.XMLEventFactory
Create a new EndElement
createEndElement(String, String, String, Iterator) - Method in class javax.xml.stream.XMLEventFactory
Create a new EndElement
createEndpoint(XAResource) - Method in interface javax.resource.spi.endpoint.MessageEndpointFactory
This is used to create a message endpoint.
createEndpoint(String, Object) - Method in class javax.xml.ws.spi.Provider
Creates an endpoint object with the provided binding and implementation object.
createEntityManager() - Method in interface javax.persistence.EntityManagerFactory
Create a new EntityManager.
createEntityManager(Map) - Method in interface javax.persistence.EntityManagerFactory
Create a new EntityManager with the specified Map of properties.
createEntityManagerFactory(String) - Static method in class javax.persistence.Persistence
Create and return an EntityManagerFactory for the named persistence unit.
createEntityManagerFactory(String, Map) - Static method in class javax.persistence.Persistence
Create and return an EntityManagerFactory for the named persistence unit using the given properties.
createEntityManagerFactory(String, Map) - Method in interface javax.persistence.spi.PersistenceProvider
Called by Persistence class when an EntityManagerFactory is to be created.
createEntityReference(String, EntityDeclaration) - Method in class javax.xml.stream.XMLEventFactory
Creates a new instance of a EntityReference event
CreateException - Exception in javax.ejb
The CreateException exception must be included in the throws clauses of all create methods defined in an enterprise Bean's home interface.
CreateException() - Constructor for exception javax.ejb.CreateException
Constructs a CreateException with no detail message.
CreateException(String) - Constructor for exception javax.ejb.CreateException
Constructs a CreateException with the specified detail message.
createExternalIdentifier(ClassificationScheme, String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an ExternalIdentifier instance using the specified parameters, where the name is a String.
createExternalIdentifier(ClassificationScheme, InternationalString, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an ExternalIdentifier instance using the specified parameters, where the name is an InternationalString.
createExternalLink(String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an ExternalLink instance using the specified parameters, where the description is a String.
createExternalLink(String, InternationalString) - Method in interface javax.xml.registry.LifeCycleManager
Creates an ExternalLink instance using the specified parameters, where the description is an InternationalString.
createExtrinsicObject(DataHandler) - Method in interface javax.xml.registry.LifeCycleManager
Creates an ExtrinsicObject instance using the specified parameters.
createFault(String, QName) - Method in class javax.xml.soap.SOAPFactory
Creates a new SOAPFault object initialized with the given reasonText and faultCode
createFault() - Method in class javax.xml.soap.SOAPFactory
Creates a new default SOAPFault object
createFederatedConnection(Collection) - Method in class javax.xml.registry.ConnectionFactory
Create a FederatedConnection.
createFilteredReader(XMLStreamReader, StreamFilter) - Method in class javax.xml.stream.XMLInputFactory
Create a filtered reader that wraps the filter around the reader
createFilteredReader(XMLEventReader, EventFilter) - Method in class javax.xml.stream.XMLInputFactory
Create a filtered event reader that wraps the filter around the event reader
createIgnorableSpace(String) - Method in class javax.xml.stream.XMLEventFactory
Create an ignorable space
createIndexedRecord(String) - Method in interface javax.resource.cci.RecordFactory
Creates a IndexedRecord.
createInteraction() - Method in interface javax.resource.cci.Connection
Creates an Interaction associated with this Connection.
createInternationalString() - Method in interface javax.xml.registry.LifeCycleManager
Creates an empty InternationalString instance.
createInternationalString(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an InternationalString instance using a String parameter and the default Locale.
createInternationalString(Locale, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an InternationalString instance using the specified Locale and String parameters.
createInternetHeaders(InputStream) - Method in class javax.mail.internet.MimeMessage
Create and return an InternetHeaders object that loads the headers from the given InputStream.
createInternetHeaders(InputStream) - Method in class javax.mail.internet.MimeMultipart
Create and return an InternetHeaders object that loads the headers from the given InputStream.
createJAXBIntrospector() - Method in class javax.xml.bind.JAXBContext
Creates a JAXBIntrospector object that can be used to introspect JAXB objects.
createKey(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Key instance from an ID.
createLocalizedString(Locale, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a LocalizedString instance using the specified Locale and String parameters.
createLocalizedString(Locale, String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a LocalizedString instance using the specified Locale, String, and character set parameters.
createManagedConnection(Subject, ConnectionRequestInfo) - Method in interface javax.resource.spi.ManagedConnectionFactory
Creates a new physical connection to the underlying EIS resource manager.
createMapMessage() - Method in interface javax.jms.Session
Creates a MapMessage object.
createMappedRecord(String) - Method in interface javax.resource.cci.RecordFactory
Creates a MappedRecord.
createMarshaller() - Method in class javax.xml.bind.JAXBContext
Create a Marshaller object that can be used to convert a java content tree into XML data.
createMessage() - Method in interface javax.jms.Session
Creates a Message object.
createMessage() - Method in class javax.xml.soap.MessageFactory
Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope, SOAPBody, and SOAPHeader objects.
createMessage(MimeHeaders, InputStream) - Method in class javax.xml.soap.MessageFactory
Internalizes the contents of the given InputStream object into a new SOAPMessage object and returns the SOAPMessage object.
createMethodBinding(String, Class[]) - Method in class javax.faces.application.Application
Deprecated. This has been replaced by calling Application.getExpressionFactory() then ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]).
createMethodExpression(ELContext, String, Class<?>, Class<?>[]) - Method in class javax.el.ExpressionFactory
Parses an expression into a MethodExpression for later evaluation.
createMimeBodyPart(InternetHeaders, byte[]) - Method in class javax.mail.internet.MimeMultipart
Create and return a MimeBodyPart object to represent a body part parsed from the InputStream.
createMimeBodyPart(InputStream) - Method in class javax.mail.internet.MimeMultipart
Create and return a MimeBodyPart object to represent a body part parsed from the InputStream.
createMimeMessage(Session) - Method in class javax.mail.internet.MimeMessage
Create and return a MimeMessage object.
createName(String, String, String) - Method in interface javax.xml.soap.SOAPEnvelope
Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.
createName(String) - Method in interface javax.xml.soap.SOAPEnvelope
Creates a new Name object initialized with the given local name.
createName(String, String, String) - Method in class javax.xml.soap.SOAPFactory
Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.
createName(String) - Method in class javax.xml.soap.SOAPFactory
Creates a new Name object initialized with the given local name.
createNamedQuery(String) - Method in interface javax.persistence.EntityManager
Create an instance of Query for executing a named query (in the Java Persistence query language or in native SQL).
createNamespace(String) - Method in class javax.xml.stream.XMLEventFactory
Create a new default Namespace
createNamespace(String, String) - Method in class javax.xml.stream.XMLEventFactory
Create a new Namespace
createNativeQuery(String) - Method in interface javax.persistence.EntityManager
Create an instance of Query for executing a native SQL statement, e.g., for update or delete.
createNativeQuery(String, Class) - Method in interface javax.persistence.EntityManager
Create an instance of Query for executing a native SQL query.
createNativeQuery(String, String) - Method in interface javax.persistence.EntityManager
Create an instance of Query for executing a native SQL query.
createObject(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates instances of information model interfaces (factory method).
createObjectMessage() - Method in interface javax.jms.Session
Creates an ObjectMessage object.
createObjectMessage(Serializable) - Method in interface javax.jms.Session
Creates an initialized ObjectMessage object.
createOrganization(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates an Organization instance using the specified name, where the name is a String.
createOrganization(InternationalString) - Method in interface javax.xml.registry.LifeCycleManager
Creates an Organization instance using the specified name, where the name is an InternationalString.
createOutput(String, String) - Method in class javax.xml.bind.SchemaOutputResolver
Decides where the schema file (of the given namespace URI) will be written, and return it as a Result object.
createPersonName(String, String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a PersonName instance using the specified first, middle, and last names.
createPersonName(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a PersonName instance using the specified full name.
createPostalAddress(String, String, String, String, String, String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a PostalAddress instance using the specified parameters.
createProcessingInstruction(String, String) - Method in class javax.xml.stream.XMLEventFactory
Create a processing instruction
createProducer(Destination) - Method in interface javax.jms.Session
Creates a MessageProducer to send messages to the specified destination.
createPublisher(Topic) - Method in interface javax.jms.TopicSession
Creates a publisher for the specified topic.
createQName(String, String) - Method in interface javax.xml.soap.SOAPElement
Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.
createQuery(String) - Method in interface javax.persistence.EntityManager
Create an instance of Query for executing a Java Persistence query language statement.
createQuery(int, String) - Method in interface javax.xml.registry.DeclarativeQueryManager
Creates a Query object given a queryType (for example, QUERY_TYPE_SQL) and a String that represents a query in the syntax appropriate for queryType.
createQueue(String) - Method in interface javax.jms.QueueSession
Creates a queue identity given a Queue name.
createQueue(String) - Method in interface javax.jms.Session
Creates a queue identity given a Queue name.
createQueueConnection() - Method in interface javax.jms.QueueConnectionFactory
Creates a queue connection with the default user identity.
createQueueConnection(String, String) - Method in interface javax.jms.QueueConnectionFactory
Creates a queue connection with the specified user identity.
createQueueSession(boolean, int) - Method in interface javax.jms.QueueConnection
Creates a QueueSession object.
createQueueSession(boolean, int) - Method in interface javax.jms.XAQueueConnection
Creates an XAQueueSession object.
createReceiver(Queue) - Method in interface javax.jms.QueueSession
Creates a QueueReceiver object to receive messages from the specified queue.
createReceiver(Queue, String) - Method in interface javax.jms.QueueSession
Creates a QueueReceiver object to receive messages from the specified queue using a message selector.
createRegistryPackage(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a RegistryPackage instance using the specified name, where the name is a String.
createRegistryPackage(InternationalString) - Method in interface javax.xml.registry.LifeCycleManager
Creates a RegistryPackage instance using the specified name, where the name is an InternationalString.
createResponseStream(OutputStream) - Method in class javax.faces.render.RenderKit
Use the provided OutputStream to create a new ResponseStream instance.
createResponseWriter(Writer, String, String) - Method in class javax.faces.render.RenderKit
Use the provided Writer to create a new ResponseWriter instance for the specified (optional) content type, and character encoding.
createSender(Queue) - Method in interface javax.jms.QueueSession
Creates a QueueSender object to send messages to the specified queue.
createService(String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Service instance using the specified name, where the name is a String.
createService(InternationalString) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Service instance using the specified name, where the name is an InternationalString.
createService(URL, QName) - Method in class javax.xml.rpc.ServiceFactory
Create a Service instance.
createService(QName) - Method in class javax.xml.rpc.ServiceFactory
Create a Service instance.
createServiceBinding() - Method in interface javax.xml.registry.LifeCycleManager
Creates an empty ServiceBinding instance.
createServiceDelegate(URL, QName, Class) - Method in class javax.xml.ws.spi.Provider
Creates a service delegate object.
createSession(boolean, int) - Method in interface javax.jms.Connection
Creates a Session object.
createSession(boolean, int) - Method in interface javax.jms.XAConnection
Creates an Session object.
createSlot(String, String, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Slot instance using the specified parameters, where the value is a String.
createSlot(String, Collection, String) - Method in interface javax.xml.registry.LifeCycleManager
Creates a Slot instance using the specified parameters, where the value is a Collection of Strings.
createSpace(String) - Method in class javax.xml.stream.XMLEventFactory
Create a Characters event with the isSpace flag set to true
createSpecificationLink() - Method in interface javax.xml.registry.LifeCycleManager
Creates an empty SpecificationLink instance.
createStartDocument() - Method in class javax.xml.stream.XMLEventFactory
Creates a new instance of a StartDocument event
createStartDocument(String, String, boolean) - Method in class javax.xml.stream.XMLEventFactory
Creates a new instance of a StartDocument event
createStartDocument(String, String) - Method in class javax.xml.stream.XMLEventFactory
Creates a new instance of a StartDocument event
createStartDocument(String) - Method in class javax.xml.stream.XMLEventFactory
Creates a new instance of a StartDocument event
createStartElement(QName, Iterator, Iterator) - Method in class javax.xml.stream.XMLEventFactory
Create a new StartElement.
createStartElement(String, String, String) - Method in class javax.xml.stream.XMLEventFactory
Create a new StartElement.
createStartElement(String, String, String, Iterator, Iterator) - Method in class javax.xml.stream.XMLEventFactory
Create a new StartElement.
createStartElement(String, String, String, Iterator, Iterator, NamespaceContext) - Method in class javax.xml.stream.XMLEventFactory
Create a new StartElement.
createStreamMessage() - Method in interface javax.jms.Session
Creates a StreamMessage object.
createSubscriber(Topic) - Method in interface javax.jms.TopicSession
Creates a nondurable subscriber to the specified topic.
createSubscriber(Topic, String, boolean) - Method in interface javax.jms.TopicSession
Creates a nondurable subscriber to the specified topic, using a message selector or specifying whether messages published by its own connection should be delivered to it.
createTelephoneNumber() - Method in interface javax.xml.registry.LifeCycleManager
Creates an empty TelephoneNumber instance.
createTemporaryQueue() - Method in interface javax.jms.QueueSession
Creates a TemporaryQueue object.
createTemporaryQueue() - Method in interface javax.jms.Session
Creates a TemporaryQueue object.
createTemporaryTopic() - Method in interface javax.jms.Session
Creates a TemporaryTopic object.
createTemporaryTopic() - Method in interface javax.jms.TopicSession
Creates a TemporaryTopic object.
createTextMessage() - Method in interface javax.jms.Session
Creates a TextMessage object.
createTextMessage(String) - Method in interface javax.jms.Session
Creates an initialized TextMessage object.
createTimer(long, Serializable) - Method in interface javax.ejb.TimerService
Create a single-action timer that expires after a specified duration.
createTimer(long, long, Serializable) - Method in interface javax.ejb.TimerService
Create an interval timer whose first expiration occurs after a specified duration, and whose subsequent expirations occur after a specified interval.
createTimer(Date, Serializable) - Method in interface javax.ejb.TimerService
Create a single-action timer that expires at a given point in time.
createTimer(Date, long, Serializable) - Method in interface javax.ejb.TimerService
Create an interval timer whose first expiration occurs at a given point in time and whose subsequent expirations occur after a specified interval.
createTimer() - Method in interface javax.resource.spi.BootstrapContext
Creates a new java.util.Timer instance.
createTopic(String) - Method in interface javax.jms.Session
Creates a topic identity given a Topic name.
createTopic(String) - Method in interface javax.jms.TopicSession
Creates a topic identity given a Topic name.
createTopicConnection() - Method in interface javax.jms.TopicConnectionFactory
Creates a topic connection with the default user identity.
createTopicConnection(String, String) - Method in interface javax.jms.TopicConnectionFactory
Creates a topic connection with the specified user identity.
createTopicSession(boolean, int) - Method in interface javax.jms.TopicConnection
Creates a TopicSession object.
createTopicSession(boolean, int) - Method in interface javax.jms.XATopicConnection
Creates an XATopicSession object.
createTypeMapping() - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Creates a new empty TypeMapping object.
createUniqueId() - Method in class javax.faces.component.UIViewRoot
Generate an identifier for a component.
createUnmarshalException(SAXException) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Creates an UnmarshalException from a SAXException.
createUnmarshaller(ValidationEventHandler) - Method in interface javax.xml.bind.annotation.DomHandler
When a JAXB provider needs to unmarshal a part of a document into an infoset representation, it first calls this method to create a Result object.
createUnmarshaller(ValidationEventHandler) - Method in class javax.xml.bind.annotation.W3CDomHandler

createUnmarshaller() - Method in class javax.xml.bind.JAXBContext
Create an Unmarshaller object that can be used to convert XML data into a java content tree.
createUser() - Method in interface javax.xml.registry.LifeCycleManager
Creates an empty User instance.
createValidator(String) - Method in class javax.faces.application.Application
Instantiate and return a new Validator instance of the class specified by a previous call to addValidator() for the specified validator id.
createValidator() - Method in class javax.faces.webapp.ValidatorELTag
Create and return a new Validator to be registered on our surrounding UIComponent.
createValidator() - Method in class javax.faces.webapp.ValidatorTag
Deprecated. Create and return a new Validator to be registered on our surrounding UIComponent.
createValidator() - Method in class javax.xml.bind.JAXBContext
Deprecated. since JAXB2.0
createValueBinding(String) - Method in class javax.faces.application.Application
Deprecated. This has been replaced by calling Application.getExpressionFactory() then ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class).
createValueExpression(ELContext, String, Class<?>) - Method in class javax.el.ExpressionFactory
Parses an expression into a ValueExpression for later evaluation.
createValueExpression(Object, Class<?>) - Method in class javax.el.ExpressionFactory
Creates a ValueExpression that wraps an object instance.
createVerbatimComponent() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Use the Application instance to create a new component with the following characteristics.
createVerbatimComponentFromBodyContent() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Create a transient UIOutput component from the body content, of this tag instance or return null if there is no body content, the body content is whitespace, or the body content is a comment.
createView(FacesContext, String) - Method in class javax.faces.application.ViewHandler
Create and return a new UIViewRoot instance initialized with information from the argument FacesContext and viewId.
createView(FacesContext, String) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.createView(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
createXAConnection() - Method in interface javax.jms.XAConnectionFactory
Creates an XAConnection with the default user identity.
createXAConnection(String, String) - Method in interface javax.jms.XAConnectionFactory
Creates an XA connection with the specified user identity.
createXAQueueConnection() - Method in interface javax.jms.XAQueueConnectionFactory
Creates an XA queue connection with the default user identity.
createXAQueueConnection(String, String) - Method in interface javax.jms.XAQueueConnectionFactory
Creates an XA queue connection with the specified user identity.
createXAQueueSession() - Method in interface javax.jms.XAQueueConnection
Creates an XAQueueSession object.
createXASession() - Method in interface javax.jms.XAConnection
Creates an XASession object.
createXATopicConnection() - Method in interface javax.jms.XATopicConnectionFactory
Creates an XA topic connection with the default user identity.
createXATopicConnection(String, String) - Method in interface javax.jms.XATopicConnectionFactory
Creates an XA topic connection with the specified user identity.
createXATopicSession() - Method in interface javax.jms.XATopicConnection
Creates an XATopicSession object.
createXMLEventReader(Reader) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLEventReader from a reader
createXMLEventReader(String, Reader) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLEventReader from a reader
createXMLEventReader(XMLStreamReader) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLEventReader from an XMLStreamReader.
createXMLEventReader(Source) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLEventReader from a JAXP source.
createXMLEventReader(InputStream) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLEventReader from a java.io.InputStream
createXMLEventReader(InputStream, String) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLEventReader from a java.io.InputStream
createXMLEventReader(String, InputStream) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLEventReader from a java.io.InputStream
createXMLEventWriter(Result) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLEventWriter that writes to a JAXP result.
createXMLEventWriter(OutputStream) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLEventWriter that writes to a stream
createXMLEventWriter(OutputStream, String) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLEventWriter that writes to a stream
createXMLEventWriter(Writer) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLEventWriter that writes to a writer
createXMLStreamReader(Reader) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLStreamReader from a reader
createXMLStreamReader(Source) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLStreamReader from a JAXP source.
createXMLStreamReader(InputStream) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLStreamReader from a java.io.InputStream
createXMLStreamReader(InputStream, String) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLStreamReader from a java.io.InputStream
createXMLStreamReader(String, InputStream) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLStreamReader from a java.io.InputStream
createXMLStreamReader(String, Reader) - Method in class javax.xml.stream.XMLInputFactory
Create a new XMLStreamReader from a java.io.InputStream
createXMLStreamWriter(Writer) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLStreamWriter that writes to a writer
createXMLStreamWriter(OutputStream) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLStreamWriter that writes to a stream
createXMLStreamWriter(OutputStream, String) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLStreamWriter that writes to a stream
createXMLStreamWriter(Result) - Method in class javax.xml.stream.XMLOutputFactory
Create a new XMLStreamWriter that writes to a JAXP result.
CURRENCY_ID - Static variable in class javax.faces.convert.NumberConverter
The message identifier of the FacesMessage to be created if the conversion to Number fails.

D

DataContentHandler - Interface in javax.activation
The DataContentHandler interface is implemented by objects that can be used to extend the capabilities of the DataHandler's implementation of the Transferable interface.
DataContentHandlerFactory - Interface in javax.activation
This interface defines a factory for DataContentHandlers.
DataHandler - Class in javax.activation
The DataHandler class provides a consistent interface to data available in many different sources and formats.
DataHandler(DataSource) - Constructor for class javax.activation.DataHandler
Create a DataHandler instance referencing the specified DataSource.
DataHandler(Object, String) - Constructor for class javax.activation.DataHandler
Create a DataHandler instance representing an object of this MIME type.
DataHandler(URL) - Constructor for class javax.activation.DataHandler
Create a DataHandler instance referencing a URL.
datalen - Variable in class javax.mail.util.SharedFileInputStream
The amount of data in this subset of the file.
DataModel - Class in javax.faces.model
DataModel is an abstraction around arbitrary data binding technologies that can be used to adapt a variety of data sources for use by JavaServer Faces components that support per-row processing for their child components (such as UIData.
DataModel() - Constructor for class javax.faces.model.DataModel

DataModelEvent - Class in javax.faces.model
DataModelEvent represents an event of interest to registered listeners that occurred on the specified DataModel.
DataModelEvent(DataModel, int, Object) - Constructor for class javax.faces.model.DataModelEvent
Construct an event object that is associated with the specified row index and associated data.
DataModelListener - Interface in javax.faces.model
DataModelListener represents an event listener that wishes to be notified of DataModelEvents occurring on a particular DataModel instance.
DataSource - Interface in javax.activation
The DataSource interface provides the JavaBeans Activation Framework with an abstraction of an arbitrary collection of data.
DatatypeConverter - Class in javax.xml.bind
The javaType binding declaration can be used to customize the binding of an XML schema datatype to a Java datatype.
DatatypeConverterInterface - Interface in javax.xml.bind
The DatatypeConverterInterface is for JAXB provider use only.
date - Variable in class javax.mail.search.DateTerm
The date.
DATE_ID - Static variable in class javax.faces.convert.DateTimeConverter
The message identifier of the FacesMessage to be created if the conversion to Date fails.
DateTerm - Class in javax.mail.search
This class implements comparisons for Dates
DateTerm(int, Date) - Constructor for class javax.mail.search.DateTerm
Constructor.
DATETIME_ID - Static variable in class javax.faces.convert.DateTimeConverter
The message identifier of the FacesMessage to be created if the conversion to DateTime fails.
DateTimeConverter - Class in javax.faces.convert
Converter implementation for java.util.Date values.
DateTimeConverter() - Constructor for class javax.faces.convert.DateTimeConverter

DConfigBean - Interface in javax.enterprise.deploy.spi
The DConfigBean is a deployment configuration bean (DConfigBean) that is associated with one or more deployment descriptor beans, (DDBean).
DConfigBeanRoot - Interface in javax.enterprise.deploy.spi
A J2EE component module consists of one or more deployment descriptor files and zero or more non-deployment descriptor XML instance documents.
DConfigBeanVersionType - Class in javax.enterprise.deploy.shared
Class DConfigBeanVersionTypes defines enumeration values for the J2EE Platform verion number.
DConfigBeanVersionType(int) - Constructor for class javax.enterprise.deploy.shared.DConfigBeanVersionType
Construct a new enumeration value with the given integer value.
DConfigBeanVersionUnsupportedException - Exception in javax.enterprise.deploy.spi.exceptions
This exception is to report that there is no support for the DConfigBean version requested.
DConfigBeanVersionUnsupportedException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException
Creates an new DConfigBeanVersionUnsupportedException object.
DDBean - Interface in javax.enterprise.deploy.model
An interface for beans that represent a fragment of a standard deployment descriptor.
DDBeanCreateException - Exception in javax.enterprise.deploy.model.exceptions
This exception reports errors in generating a DDBean.
DDBeanCreateException() - Constructor for exception javax.enterprise.deploy.model.exceptions.DDBeanCreateException
Creates new DDBeanCreateException without detail message.
DDBeanCreateException(String) - Constructor for exception javax.enterprise.deploy.model.exceptions.DDBeanCreateException
Constructs an DDBeanCreateException with the specified detail message.
DDBeanRoot - Interface in javax.enterprise.deploy.model
An interface that represents the root of a standard deployment descriptor.
debug - Variable in class javax.mail.Service
Debug flag for this service.
DECIMAL_ID - Static variable in class javax.faces.convert.BigDecimalConverter
The message identifier of the FacesMessage to be created if the conversion to BigDecimal fails.
DeclarativeQueryManager - Interface in javax.xml.registry
This interface provides the ability to execute declarative queries (e.g.
declaredType - Variable in class javax.xml.bind.JAXBElement
Java datatype binding for xml element declaration's type.
DeclareRoles - Annotation Type in javax.annotation.security
Used by application to declare roles.
decode(FacesContext) - Method in class javax.faces.component.UIComponent
Decode any new state of this UIComponent from the request contained in the specified FacesContext, and store this state as needed.
decode(FacesContext) - Method in class javax.faces.component.UIComponentBase

decode(FacesContext) - Method in class javax.faces.component.UIInput

decode(FacesContext, UIComponent) - Method in class javax.faces.render.Renderer
Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.
decode(InputStream, String) - Static method in class javax.mail.internet.MimeUtility
Decode the given input stream.
decodeText(String) - Static method in class javax.mail.internet.MimeUtility
Decode "unstructured" headers, that is, headers that are defined as '*text' as per RFC 822.
decodeWord(String) - Static method in class javax.mail.internet.MimeUtility
The string is parsed using the rules in RFC 2047 for parsing an "encoded-word".
DEFAULT_BUFFER - Static variable in class javax.servlet.jsp.JspWriter
Constant indicating that the Writer is buffered and is using the implementation default buffer size.
DEFAULT_CHARSET_NAME - Static variable in interface javax.xml.registry.infomodel.LocalizedString
The default name returned by getCharsetName if no other name has explicitly been set.
DEFAULT_DELIVERY_MODE - Static variable in interface javax.jms.Message
The message producer's default delivery mode is PERSISTENT.
DEFAULT_LIFECYCLE - Static variable in class javax.faces.lifecycle.LifecycleFactory
The lifecycle identifier for the default Lifecycle instance for this JavaServer Faces implementation.
DEFAULT_PRIORITY - Static variable in interface javax.jms.Message
The message producer's default priority is 4.
DEFAULT_SOAP_PROTOCOL - Static variable in interface javax.xml.soap.SOAPConstants
The default protocol: SOAP 1.1 for backwards compatibility.
DEFAULT_SUFFIX - Static variable in class javax.faces.application.ViewHandler
The value to use for the default extension if the webapp is using url extension mapping.
DEFAULT_SUFFIX_PARAM_NAME - Static variable in class javax.faces.application.ViewHandler
Allow the web application to define an alternate suffix for pages containing JSF content.
DEFAULT_TIME_TO_LIVE - Static variable in interface javax.jms.Message
The message producer's default time to live is unlimited; the message never expires.
DefaultValidationEventHandler - Class in javax.xml.bind.helpers
JAXB 1.0 only default validation event handler.
DefaultValidationEventHandler() - Constructor for class javax.xml.bind.helpers.DefaultValidationEventHandler

delete() - Method in interface javax.jms.TemporaryQueue
Deletes this temporary queue.
delete() - Method in interface javax.jms.TemporaryTopic
Deletes this temporary topic.
delete(boolean) - Method in class javax.mail.Folder
Delete this Folder.
delete() - Method in interface javax.security.jacc.PolicyConfiguration
Causes all policy statements to be deleted from this PolicyConfiguration and sets its internal state such that calling any method, other than delete, getContextID, or inService on the PolicyConfiguration will be rejected and cause an UnsupportedOperationException to be thrown.
deleteAssociations(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Deletes the Associations corresponding to the specified Keys.
deleteClassificationSchemes(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Deletes the ClassificationSchemes corresponding to the specified Keys.
deleteConcepts(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Deletes the Concepts corresponding to the specified Keys.
DELETED - Static variable in class javax.mail.event.FolderEvent
The folder was deleted.
DELETED - Static variable in class javax.mail.Flags.Flag
This message is marked deleted.
DeleteException - Exception in javax.xml.registry
A RegistryException that occurs during a delete action.
DeleteException() - Constructor for exception javax.xml.registry.DeleteException
Constructs a JAXRException object with no reason or embedded Throwable.
DeleteException(String) - Constructor for exception javax.xml.registry.DeleteException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
DeleteException(String, Throwable) - Constructor for exception javax.xml.registry.DeleteException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
DeleteException(Throwable) - Constructor for exception javax.xml.registry.DeleteException
Constructs a JAXRException object initialized with the given Throwable object.
deleteObjects(Collection) - Method in interface javax.xml.registry.LifeCycleManager
Deletes one or more previously submitted objects from the registry using the object keys.
deleteObjects(Collection, String) - Method in interface javax.xml.registry.LifeCycleManager
Deletes one or more previously submitted objects from the registry using the object keys and a specified objectType attribute.
deleteOrganizations(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Deletes the organizations corresponding to the specified Keys.
deletesAreDetected(int) - Method in interface javax.resource.cci.ResultSetInfo

deleteServiceBindings(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Deletes the ServiceBindings corresponding to the specified Keys.
deleteServices(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Deletes the services corresponding to the specified Keys.
delistResource(XAResource, int) - Method in interface javax.transaction.Transaction
Disassociate the resource specified from the transaction associated with the target Transaction object.
DeliveryMode - Interface in javax.jms
The delivery modes supported by the JMS API are PERSISTENT and NON_PERSISTENT.
DenyAll - Annotation Type in javax.annotation.security
Specifies that no security roles are allowed to invoke the specified method(s) - i.e that the methods are to be excluded from execution in the J2EE container.
DeployableObject - Interface in javax.enterprise.deploy.model
The DeployableObject interface is an abstract representation of a J2EE deployable module (JAR, WAR, RAR, EAR).
DeploymentConfiguration - Interface in javax.enterprise.deploy.spi
An interface that defines a container for all the server-specific configuration information for a single top-level J2EE module.
DeploymentFactory - Interface in javax.enterprise.deploy.spi.factories
The DeploymentFactory interface is a deployment driver for a J2EE plaform product.
DeploymentFactoryManager - Class in javax.enterprise.deploy.shared.factories
The DeploymentFactoryManager class is a central registry for J2EE DeploymentFactory objects.
DeploymentManager - Interface in javax.enterprise.deploy.spi
The DeploymentManager object provides the core set of functions a J2EE platform must provide for J2EE application deployment.
DeploymentManagerCreationException - Exception in javax.enterprise.deploy.spi.exceptions
This exception is to report problems in returning a DeploymentManager object cause by such things as server down, unable to authenticate and the like.
DeploymentManagerCreationException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
Creates an new DeploymentManagerCreationException object.
DeploymentStatus - Interface in javax.enterprise.deploy.spi.status
The DeploymentStatus interface provides information about the progress status of a deployment action.
deprecateObjects(Collection) - Method in interface javax.xml.registry.LifeCycleManager
Deprecates one or more previously submitted objects.
DeserializationContext - Interface in javax.xml.rpc.encoding
The javax.xml.rpc.encoding.DeserializationContext interface is implemented by the JAX-RPC runtime system in an XML processing mechanism specific manner.
Deserializer - Interface in javax.xml.rpc.encoding
The javax.xml.rpc.encoding.Deserializer interface defines a base interface for deserializers.
DeserializerFactory - Interface in javax.xml.rpc.encoding
The javax.xml.rpc.encoding.DeserializerFactory is a factory of deserializers.
Destination - Interface in javax.jms
A Destination object encapsulates a provider-specific address.
destroy() - Method in class javax.faces.webapp.FacesServlet
Release all resources acquired at startup time.
destroy() - Method in interface javax.resource.spi.ManagedConnection
Destroys the physical connection to the underlying resource manager.
destroy() - Method in interface javax.servlet.Filter
Called by the web container to indicate to a filter that it is being taken out of service.
destroy() - Method in class javax.servlet.GenericServlet
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
destroy() - Method in interface javax.servlet.Servlet
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
destroy() - Method in class javax.xml.rpc.handler.GenericHandler
The destroy method indicates the end of lifecycle for a Handler instance.
destroy() - Method in interface javax.xml.rpc.handler.Handler
The destroy method indicates the end of lifecycle for a Handler instance.
destroy() - Method in interface javax.xml.rpc.handler.HandlerChain
Indicates the end of lifecycle for a HandlerChain.
destroy() - Method in interface javax.xml.rpc.server.ServiceLifecycle
JAX-RPC runtime system ends the lifecycle of a service endpoint instance by invoking the destroy method.
detachNode() - Method in interface javax.xml.soap.Node
Removes this Node object from the tree.
Detail - Interface in javax.xml.soap
A container for DetailEntry objects.
DetailEntry - Interface in javax.xml.soap
The content for a Detail object, giving details for a SOAPFault object.
dh - Variable in class javax.mail.internet.MimeBodyPart
The DataHandler object representing this Part's content.
dh - Variable in class javax.mail.internet.MimeMessage
The DataHandler object representing this Message's content.
DIGEST_AUTH - Static variable in class javax.faces.context.ExternalContext
String identifier for DIGEST authentication.
DIGEST_AUTH - Static variable in interface javax.servlet.http.HttpServletRequest
String identifier for Digest authentication.
disconnected(ConnectionEvent) - Method in class javax.mail.event.ConnectionAdapter

DISCONNECTED - Static variable in class javax.mail.event.ConnectionEvent
A connection was disconnected (not currently used).
disconnected(ConnectionEvent) - Method in interface javax.mail.event.ConnectionListener
Invoked when a Store is disconnected.
DiscriminatorColumn - Annotation Type in javax.persistence
Is used to define the discriminator column for the SINGLE_TABLE and JOINED inheritance mapping strategies.
DiscriminatorType - Enum in javax.persistence
Defines supported types of the discriminator column.
DiscriminatorValue - Annotation Type in javax.persistence
Is used to specify the value of the discriminator column for entities of the given type.
dispatch(String) - Method in class javax.faces.context.ExternalContext
Dispatch a request to the specified resource to create output for this response.
dispatch(Object) - Method in class javax.mail.event.ConnectionEvent
Invokes the appropriate ConnectionListener method
dispatch(Object) - Method in class javax.mail.event.FolderEvent
Invokes the appropriate FolderListener method
dispatch(Object) - Method in class javax.mail.event.MailEvent
This method invokes the appropriate method on a listener for this event.
dispatch(Object) - Method in class javax.mail.event.MessageChangedEvent
Invokes the appropriate MessageChangedListener method.
dispatch(Object) - Method in class javax.mail.event.MessageCountEvent
Invokes the appropriate MessageCountListener method.
dispatch(Object) - Method in class javax.mail.event.StoreEvent
Invokes the appropriate StoreListener method.
dispatch(Object) - Method in class javax.mail.event.TransportEvent
Invokes the appropriate TransportListener method.
Dispatch<T> - Interface in javax.xml.ws
The Dispatch interface provides support for the dynamic invocation of a service endpoint operations.
DissociatableManagedConnection - Interface in javax.resource.spi
This is a mix-in interface that may be optionally implemented by a ManagedConnection implementation.
dissociateConnections() - Method in interface javax.resource.spi.DissociatableManagedConnection
This method is called by an application server (that is capable of lazy connection association optimization) in order to dissociate a ManagedConnection instance from all of its connection handles.
DISTRIBUTE - Static variable in class javax.enterprise.deploy.shared.CommandType
The DeploymentManger action operation being processed is distribute.
distribute(Target[], File, File) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.
distribute(Target[], InputStream, InputStream) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Deprecated. as of Java EE 5, replaced with DeploymentManager.distribute(Target[], ModuleType, InputStream, InputStream)
distribute(Target[], ModuleType, InputStream, InputStream) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
The distribute method performs three tasks; it validates the deployment configuration data, generates all container specific classes and interfaces, and moves the fully baked archive to the designated deployment targets.
doAfterBody() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Perform any processing necessary to handle the content implications of CASE 4 in the class description.
doAfterBody() - Method in class javax.servlet.jsp.tagext.BodyTagSupport
After the body evaluation: do not reevaluate and continue with the page.
doAfterBody() - Method in interface javax.servlet.jsp.tagext.IterationTag
Process body (re)evaluation.
doAfterBody() - Method in class javax.servlet.jsp.tagext.TagSupport
Default processing for a body.
doCatch(Throwable) - Method in interface javax.servlet.jsp.tagext.TryCatchFinally
Invoked if a Throwable occurs while evaluating the BODY inside a tag or in any of the following methods: Tag.doStartTag(), Tag.doEndTag(), IterationTag.doAfterBody() and BodyTag.doInitBody().
doDelete(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Called by the server (via the service method) to allow a servlet to handle a DELETE request.
doEndTag() - Method in class javax.faces.webapp.AttributeTag
Deprecated.
doEndTag() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Perform any processing necessary to handle the content implications of CASE 3 in the class description.
doEndTag() - Method in class javax.servlet.jsp.tagext.BodyTagSupport
Default processing of the end tag returning EVAL_PAGE.
doEndTag() - Method in interface javax.servlet.jsp.tagext.Tag
Process the end tag for this instance.
doEndTag() - Method in class javax.servlet.jsp.tagext.TagAdapter
Must not be called.
doEndTag() - Method in class javax.servlet.jsp.tagext.TagSupport
Default processing of the end tag returning EVAL_PAGE.
doFilter(ServletRequest, ServletResponse, FilterChain) - Method in interface javax.servlet.Filter
The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain.
doFilter(ServletRequest, ServletResponse) - Method in interface javax.servlet.FilterChain
Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked.
doFinally() - Method in interface javax.servlet.jsp.tagext.TryCatchFinally
Invoked in all cases after doEndTag() for any class implementing Tag, IterationTag or BodyTag.
doGet(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Called by the server (via the service method) to allow a servlet to handle a GET request.
doHead(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Receives an HTTP HEAD request from the protected service method and handles the request.
doInitBody() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Prepare for evaluation of the body.
doInitBody() - Method in interface javax.servlet.jsp.tagext.BodyTag
Prepare for evaluation of the body.
doInitBody() - Method in class javax.servlet.jsp.tagext.BodyTagSupport
Prepare for evaluation of the body just before the first body evaluation: no action.
DomHandler<ElementT,ResultT extends Result> - Interface in javax.xml.bind.annotation
Converts an element (and its descendants) from/to DOM (or similar) representation.
doOptions(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Called by the server (via the service method) to allow a servlet to handle a OPTIONS request.
doPost(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Called by the server (via the service method) to allow a servlet to handle a POST request.
doPut(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Called by the server (via the service method) to allow a servlet to handle a PUT request.
doStartTag() - Method in class javax.faces.webapp.AttributeTag
Deprecated. Register the specified attribute name and value with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if this UIComponent does not already have a value for the specified attribute name.
doStartTag() - Method in class javax.faces.webapp.ConverterELTag
Create a new instance of the specified Converter class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentClassicTagBase instance, if the UIComponent instance was created by this execution of the containing JSP page.
doStartTag() - Method in class javax.faces.webapp.ConverterTag
Deprecated. Create a new instance of the specified Converter class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if the UIComponent instance was created by this execution of the containing JSP page.
doStartTag() - Method in class javax.faces.webapp.FacetTag
Return EVAL_BODY_INCLUDE to cause nested body content to be evaluated.
doStartTag() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Perform any processing necessary to find (or create) the UIComponent instance in the view corresponding to this tag instance in the page and, if and only if a component was created, insert it into the tree at the proper location as expected by the page author.
doStartTag() - Method in class javax.faces.webapp.ValidatorELTag
Create a new instance of the specified Validator class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTagBase instance, if the UIComponent instance was created by this execution of the containing JSP page.
doStartTag() - Method in class javax.faces.webapp.ValidatorTag
Deprecated. Create a new instance of the specified Validator class, and register it with the UIComponent instance associated with our most immediately surrounding UIComponentTag instance, if the UIComponent instance was created by this execution of the containing JSP page.
doStartTag() - Method in class javax.servlet.jsp.tagext.BodyTagSupport
Default processing of the start tag returning EVAL_BODY_BUFFERED.
doStartTag() - Method in interface javax.servlet.jsp.tagext.Tag
Process the start tag for this instance.
doStartTag() - Method in class javax.servlet.jsp.tagext.TagAdapter
Must not be called.
doStartTag() - Method in class javax.servlet.jsp.tagext.TagSupport
Default processing of the start tag, returning SKIP_BODY.
doTag() - Method in interface javax.servlet.jsp.tagext.SimpleTag
Called by the container to invoke this tag.
doTag() - Method in class javax.servlet.jsp.tagext.SimpleTagSupport
Default processing of the tag does nothing.
doTrace(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Called by the server (via the service method) to allow a servlet to handle a TRACE request.
DOUBLE_ID - Static variable in class javax.faces.convert.DoubleConverter
The message identifier of the FacesMessage to be created if the conversion to Double fails.
DoubleConverter - Class in javax.faces.convert
Converter implementation for java.lang.Double (and double primitive) values.
DoubleConverter() - Constructor for class javax.faces.convert.DoubleConverter

DoubleHolder - Class in javax.xml.rpc.holders

DoubleHolder() - Constructor for class javax.xml.rpc.holders.DoubleHolder

DoubleHolder(double) - Constructor for class javax.xml.rpc.holders.DoubleHolder

DoubleRangeValidator - Class in javax.faces.validator
DoubleRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum values.
DoubleRangeValidator() - Constructor for class javax.faces.validator.DoubleRangeValidator
Construct a Validator with no preconfigured limits.
DoubleRangeValidator(double) - Constructor for class javax.faces.validator.DoubleRangeValidator
Construct a Validator with the specified preconfigured limit.
DoubleRangeValidator(double, double) - Constructor for class javax.faces.validator.DoubleRangeValidator
Construct a Validator with the specified preconfigured limits.
DoubleWrapperHolder - Class in javax.xml.rpc.holders

DoubleWrapperHolder() - Constructor for class javax.xml.rpc.holders.DoubleWrapperHolder

DoubleWrapperHolder(Double) - Constructor for class javax.xml.rpc.holders.DoubleWrapperHolder

doWork(Work) - Method in interface javax.resource.spi.work.WorkManager
Accepts a Work instance for processing.
doWork(Work, long, ExecutionContext, WorkListener) - Method in interface javax.resource.spi.work.WorkManager
Accepts a Work instance for processing.
DRAFT - Static variable in class javax.mail.Flags.Flag
This message is a draft.
ds - Variable in class javax.mail.internet.MimeMultipart
The DataSource supplying our InputStream.
DTD - Interface in javax.xml.stream.events
This is the top level interface for events dealing with DTDs
DTD - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is a DTD
DuplicateKeyException - Exception in javax.ejb
The DuplicateKeyException exception is thrown if an entity EJB object cannot be created because an object with the same key already exists.
DuplicateKeyException() - Constructor for exception javax.ejb.DuplicateKeyException
Constructs a DuplicateKeyException with no detail message.
DuplicateKeyException(String) - Constructor for exception javax.ejb.DuplicateKeyException
Constructs a DuplicateKeyException with the specified detail message.
DUPS_OK_ACKNOWLEDGE - Static variable in interface javax.jms.Session
This acknowledgment mode instructs the session to lazily acknowledge the delivery of messages.
DYNAMIC_SOAP_PROTOCOL - Static variable in interface javax.xml.soap.SOAPConstants
Used to create MessageFactory instances that create SOAPMessages whose concrete type is based on the Content-Type MIME header passed to the createMessage method.
DynamicAttributes - Interface in javax.servlet.jsp.tagext
For a tag to declare that it accepts dynamic attributes, it must implement this interface.

E

EAR - Static variable in class javax.enterprise.deploy.shared.ModuleType
The module is an EAR archive.
EditableValueHolder - Interface in javax.faces.component
EditableValueHolder is an extension of ValueHolder that describes additional features supported by editable components, including ValueChangeEvents and Validators.
EISSystemException - Exception in javax.resource.spi
An EISSystemException is used to indicate any EIS specific system-level error conditions.
EISSystemException() - Constructor for exception javax.resource.spi.EISSystemException
Constructs a new instance with null as its detail message.
EISSystemException(String) - Constructor for exception javax.resource.spi.EISSystemException
Constructs a new instance with the specified detail message.
EISSystemException(Throwable) - Constructor for exception javax.resource.spi.EISSystemException
Constructs a new throwable with the specified cause.
EISSystemException(String, Throwable) - Constructor for exception javax.resource.spi.EISSystemException
Constructs a new throwable with the specified detail message and cause.
EISSystemException(String, String) - Constructor for exception javax.resource.spi.EISSystemException
Constructs a new throwable with the specified detail message and an error code.
EJB - Annotation Type in javax.ejb
Indicates a dependency on the local or remote view of an Enterprise Java Bean.
EJB - Static variable in class javax.enterprise.deploy.shared.ModuleType
The module is an Enterprise Java Bean archive.
EJBAccessException - Exception in javax.ejb
This exception indicates that client access to a business method was denied.
EJBAccessException() - Constructor for exception javax.ejb.EJBAccessException
Constructs an EJBAccessException with no detail message.
EJBAccessException(String) - Constructor for exception javax.ejb.EJBAccessException
Constructs an EJBAccessException with the specified detailed message.
ejbActivate() - Method in interface javax.ejb.EntityBean
A container invokes this method when the instance is taken out of the pool of available instances to become associated with a specific EJB object.
ejbActivate() - Method in interface javax.ejb.SessionBean
The activate method is called when the instance is activated from its "passive" state.
EJBContext - Interface in javax.ejb
The EJBContext interface provides an instance with access to the container-provided runtime context of an enterprise Bean instance.
EJBException - Exception in javax.ejb
The EJBException exception is thrown by an enterprise Bean instance to its container to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a database connection).
EJBException() - Constructor for exception javax.ejb.EJBException
Constructs an EJBException with no detail message.
EJBException(String) - Constructor for exception javax.ejb.EJBException
Constructs an EJBException with the specified detailed message.
EJBException(Exception) - Constructor for exception javax.ejb.EJBException
Constructs an EJBException that embeds the originally thrown exception.
EJBException(String, Exception) - Constructor for exception javax.ejb.EJBException
Constructs an EJBException that embeds the originally thrown exception with the specified detail message.
EJBHome - Interface in javax.ejb
The EJBHome interface must be extended by all enterprise Beans' remote home interfaces.
ejbLoad() - Method in interface javax.ejb.EntityBean
A container invokes this method to instruct the instance to synchronize its state by loading it state from the underlying database.
EJBLocalHome - Interface in javax.ejb
The EJBLocalHome interface must be extended by all enterprise Beans' local home interfaces.
EJBLocalObject - Interface in javax.ejb
The EJBLocalObject interface must be extended by all enterprise Beans' local interfaces.
EJBMetaData - Interface in javax.ejb
The EJBMetaData interface allows a client to obtain the enterprise Bean's meta-data information.
EJBMethodPermission - Class in javax.security.jacc
Class for EJB method permissions.
EJBMethodPermission(String, String) - Constructor for class javax.security.jacc.EJBMethodPermission
Creates a new EJBMethodPermission with the specified name and actions.
EJBMethodPermission(String, String, String, String[]) - Constructor for class javax.security.jacc.EJBMethodPermission
Creates a new EJBMethodPermission with name corresponding to the EJBName and actions composed from methodName, methodInterface, and methodParams.
EJBMethodPermission(String, String, Method) - Constructor for class javax.security.jacc.EJBMethodPermission
Creates a new EJBMethodPermission with name corresponding to the EJBName and actions composed from methodInterface, and the Method object.
EJBObject - Interface in javax.ejb
The EJBObject interface is extended by all enterprise Beans' remote interfaces.
ejbPassivate() - Method in interface javax.ejb.EntityBean
A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object.
ejbPassivate() - Method in interface javax.ejb.SessionBean
The passivate method is called before the instance enters the "passive" state.
ejbRemove() - Method in interface javax.ejb.EntityBean
A container invokes this method before it removes the EJB object that is currently associated with the instance.
ejbRemove() - Method in interface javax.ejb.MessageDrivenBean
A container invokes this method before it ends the life of the message-driven object.
ejbRemove() - Method in interface javax.ejb.SessionBean
A container invokes this method before it ends the life of the session object.
EJBRoleRefPermission - Class in javax.security.jacc
Class for EJB isCallerInRole (String reference) permissions.
EJBRoleRefPermission(String, String) - Constructor for class javax.security.jacc.EJBRoleRefPermission
Creates a new EJBRoleRefPermission with the specified name and actions.
EJBs - Annotation Type in javax.ejb
Declares multiple TYPE-level @EJB annotations.
EJBStats - Interface in javax.management.j2ee.statistics
Specifies statistics provided by all EJB component types.
ejbStore() - Method in interface javax.ejb.EntityBean
A container invokes this method to instruct the instance to synchronize its state by storing it to the underlying database.
ejbTimeout(Timer) - Method in interface javax.ejb.TimedObject
Invoked by the EJB container upon timer expiration.
EJBTransactionRequiredException - Exception in javax.ejb
This exception indicates that a request carried a null transaction context, but the target object requires an active transaction.
EJBTransactionRequiredException() - Constructor for exception javax.ejb.EJBTransactionRequiredException
Constructs an EJBTransactionRequiredException with no detail message.
EJBTransactionRequiredException(String) - Constructor for exception javax.ejb.EJBTransactionRequiredException
Constructs an EJBTransactionRequiredException with the specified detailed message.
EJBTransactionRolledbackException - Exception in javax.ejb
This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back.
EJBTransactionRolledbackException() - Constructor for exception javax.ejb.EJBTransactionRolledbackException
Constructs an EJBTransactionRolledbackException with no detail message.
EJBTransactionRolledbackException(String) - Constructor for exception javax.ejb.EJBTransactionRolledbackException
Constructs an EJBTransactionRolledbackException with the specified detailed message.
EJBTransactionRolledbackException(String, Exception) - Constructor for exception javax.ejb.EJBTransactionRolledbackException
Constructs an EJBTransactionRolledbackException with the specified detail message and a nested exception.
ELContext - Class in javax.el
Context information for expression evaluation.
ELContext() - Constructor for class javax.el.ELContext

ELContextEvent - Class in javax.el
An event which indicates that an ELContext has been created.
ELContextEvent(ELContext) - Constructor for class javax.el.ELContextEvent
Constructs an ELContextEvent object to indicate that an ELContext has been created.
ELContextListener - Interface in javax.el
The listener interface for receiving notification when an ELContext is created.
Element - Interface in javax.xml.bind
This is an element marker interface.
ELException - Exception in javax.el
Represents any of the exception conditions that can arise during expression evaluation.
ELException() - Constructor for exception javax.el.ELException
Creates an ELException with no detail message.
ELException(String) - Constructor for exception javax.el.ELException
Creates an ELException with the provided detail message.
ELException(Throwable) - Constructor for exception javax.el.ELException
Creates an ELException with the given cause.
ELException(String, Throwable) - Constructor for exception javax.el.ELException
Creates an ELException with the given detail message and root cause.
ELException - Exception in javax.servlet.jsp.el
Deprecated. As of JSP 2.1, replaced by ELException
ELException() - Constructor for exception javax.servlet.jsp.el.ELException
Deprecated. Creates an ELException with no detail message.
ELException(String) - Constructor for exception javax.servlet.jsp.el.ELException
Deprecated. Creates an ELException with the provided detail message.
ELException(Throwable) - Constructor for exception javax.servlet.jsp.el.ELException
Deprecated. Creates an ELException with the given root cause.
ELException(String, Throwable) - Constructor for exception javax.servlet.jsp.el.ELException
Deprecated. Creates an ELException with the given detail message and root cause.
ELParseException - Exception in javax.servlet.jsp.el
Deprecated. As of JSP 2.1, replaced by ELException
ELParseException() - Constructor for exception javax.servlet.jsp.el.ELParseException
Deprecated. Creates an ELParseException with no detail message.
ELParseException(String) - Constructor for exception javax.servlet.jsp.el.ELParseException
Deprecated. Creates an ELParseException with the provided detail message.
ELResolver - Class in javax.el
Enables customization of variable and property resolution behavior for EL expression evaluation.
ELResolver() - Constructor for class javax.el.ELResolver

EMAIL_ADDRESS - Static variable in interface javax.xml.registry.LifeCycleManager

EmailAddress - Interface in javax.xml.registry.infomodel
Represents an email address.
Embeddable - Annotation Type in javax.persistence
Defines a class whose instances are stored as an intrinsic part of an owning entity and share the identity of the entity.
Embedded - Annotation Type in javax.persistence
Defines a persistent field or property of an entity whose value is an instance of an embeddable class.
EmbeddedId - Annotation Type in javax.persistence
Is applied to a persistent field or property of an entity class or mapped superclass to denote a composite primary key that is an embeddable class.
encode(OutputStream, String) - Static method in class javax.mail.internet.MimeUtility
Wrap an encoder around the given output stream.
encode(OutputStream, String, String) - Static method in class javax.mail.internet.MimeUtility
Wrap an encoder around the given output stream.
encodeActionURL(String) - Method in class javax.faces.context.ExternalContext
Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable action in the current application.
encodeAll(FacesContext) - Method in class javax.faces.component.UIComponent
If this component returns true from UIComponent.isRendered(), render this component and all its children that return true from isRendered(), regardless of the value of the UIComponent.getRendersChildren() flag.
encodeBegin(FacesContext) - Method in class javax.faces.component.UIComponent
If our rendered property is true, render the beginning of the current state of this UIComponent to the response contained in the specified FacesContext.
encodeBegin(FacesContext) - Method in class javax.faces.component.UIComponentBase

encodeBegin(FacesContext) - Method in class javax.faces.component.UIData
In addition to the default behavior, ensure that any saved per-row state for our child input components is discarded unless it is needed to rerender the current page with errors.
encodeBegin(FacesContext) - Method in class javax.faces.component.UIViewRoot
Override the default UIComponentBase.encodeBegin(javax.faces.context.FacesContext) behavior.
encodeBegin(FacesContext, UIComponent) - Method in class javax.faces.render.Renderer
Render the beginning specified UIComponent to the output stream or writer associated with the response we are creating.
encodeBegin() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
encodeChildren(FacesContext) - Method in class javax.faces.component.UIComponent
If our rendered property is true, render the child UIComponents of this UIComponent.
encodeChildren(FacesContext) - Method in class javax.faces.component.UIComponentBase

encodeChildren(FacesContext, UIComponent) - Method in class javax.faces.render.Renderer
Render the child components of this UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.
encodeChildren() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
encodedPersonal - Variable in class javax.mail.internet.InternetAddress
The RFC 2047 encoded version of the personal name.
encodeEnd(FacesContext) - Method in class javax.faces.component.UIComponent
If our rendered property is true, render the ending of the current state of this UIComponent.
encodeEnd(FacesContext) - Method in class javax.faces.component.UIComponentBase

encodeEnd(FacesContext) - Method in class javax.faces.component.UIViewRoot
Override the default UIComponentBase.encodeEnd(javax.faces.context.FacesContext) behavior.
encodeEnd(FacesContext, UIComponent) - Method in class javax.faces.render.Renderer
Render the ending of the current state of the specified UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.
encodeEnd() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Deprecated. No encoding is done during JSP page execution. Encoding is deferred until the page has completed executing to allow the entire tree to be built before any encoding occurs.
encodeNamespace(String) - Method in class javax.faces.context.ExternalContext
Return the specified name, after prefixing it with a namespace that ensures that it will be unique within the context of a particular page.
encodeRedirectURL(String) - Method in interface javax.servlet.http.HttpServletResponse
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged.
encodeRedirectUrl(String) - Method in interface javax.servlet.http.HttpServletResponse
Deprecated. As of version 2.1, use encodeRedirectURL(String url) instead
encodeRedirectURL(String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to return encodeRedirectURL(String url) on the wrapped response object.
encodeRedirectUrl(String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to return encodeRedirectUrl(String url) on the wrapped response object.
encodeResourceURL(String) - Method in class javax.faces.context.ExternalContext
Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable resource in the current application.
encodeText(String) - Static method in class javax.mail.internet.MimeUtility
Encode a RFC 822 "text" token into mail-safe form as per RFC 2047.
encodeText(String, String, String) - Static method in class javax.mail.internet.MimeUtility
Encode a RFC 822 "text" token into mail-safe form as per RFC 2047.
encodeURL(String) - Method in interface javax.servlet.http.HttpServletResponse
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
encodeUrl(String) - Method in interface javax.servlet.http.HttpServletResponse
Deprecated. As of version 2.1, use encodeURL(String url) instead
encodeURL(String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call encodeURL(String url) on the wrapped response object.
encodeUrl(String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call encodeUrl(String url) on the wrapped response object.
encodeWord(String) - Static method in class javax.mail.internet.MimeUtility
Encode a RFC 822 "word" token into mail-safe form as per RFC 2047.
encodeWord(String, String, String) - Static method in class javax.mail.internet.MimeUtility
Encode a RFC 822 "word" token into mail-safe form as per RFC 2047.
encodingSet() - Method in interface javax.xml.stream.events.StartDocument
Returns true if CharacterEncodingScheme was set in the encoding declaration of the document
ENCODINGSTYLE_URI_PROPERTY - Static variable in interface javax.xml.rpc.Call
Standard property for encoding Style: Encoding style specified as a namespace URI.
end(Xid, int) - Method in interface javax.transaction.xa.XAResource
Ends the work performed on behalf of a transaction branch.
END_DOCUMENT - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is an end document
END_ELEMENT - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is an end element
endDocument() - Method in class javax.faces.context.ResponseWriter
Write whatever text should end a response.
endDocument() - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.endDocument() on the wrapped ResponseWriter object.
EndDocument - Interface in javax.xml.stream.events
A marker interface for the end of the document
endElement(String) - Method in class javax.faces.context.ResponseWriter
Write the end of an element, after closing any open element created by a call to startElement().
endElement(String) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.endElement(String) on the wrapped ResponseWriter object.
EndElement - Interface in javax.xml.stream.events
An interface for the end element event.
Endpoint - Class in javax.xml.ws
A Web service endpoint.
Endpoint() - Constructor for class javax.xml.ws.Endpoint

ENDPOINT_ADDRESS_PROPERTY - Static variable in interface javax.xml.rpc.Stub
Standard property: Target service endpoint address.
ENDPOINT_ADDRESS_PROPERTY - Static variable in interface javax.xml.ws.BindingProvider
Standard property: Target service endpoint address.
endpointActivation(MessageEndpointFactory, ActivationSpec) - Method in interface javax.resource.spi.ResourceAdapter
This is called during the activation of a message endpoint.
endpointDeactivation(MessageEndpointFactory, ActivationSpec) - Method in interface javax.resource.spi.ResourceAdapter
This is called when a message endpoint is deactivated.
enlistResource(XAResource) - Method in interface javax.transaction.Transaction
Enlist the resource specified with the transaction associated with the target Transaction object.
EnterpriseBean - Interface in javax.ejb
The EnterpriseBean interface must be implemented by every enterprise Bean class.
Entity - Annotation Type in javax.persistence
Specifies that the class is an entity.
ENTITY_DECLARATION - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates a Entity Declaration
ENTITY_REFERENCE - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is an entity reference
EntityBean - Interface in javax.ejb
The EntityBean interface is implemented by every entity enterprise Bean class.
EntityBeanStats - Interface in javax.management.j2ee.statistics
Specifies statistics provided by entity beans.
EntityContext - Interface in javax.ejb
The EntityContext interface provides an instance with access to the container-provided runtime context of an entity enterprise Bean instance.
EntityDeclaration - Interface in javax.xml.stream.events
An interface for handling Entity Declarations This interface is used to record and report unparsed entity declarations.
EntityExistsException - Exception in javax.persistence
Thrown by the persistence provider when EntityManager.persist(Object) is called and the entity already exists.
EntityExistsException() - Constructor for exception javax.persistence.EntityExistsException
Constructs a new EntityExistsException exception with null as its detail message.
EntityExistsException(String) - Constructor for exception javax.persistence.EntityExistsException
Constructs a new EntityExistsException exception with the specified detail message.
EntityExistsException(String, Throwable) - Constructor for exception javax.persistence.EntityExistsException
Constructs a new EntityExistsException exception with the specified detail message and cause.
EntityExistsException(Throwable) - Constructor for exception javax.persistence.EntityExistsException
Constructs a new EntityExistsException exception with the specified cause.
EntityListeners - Annotation Type in javax.persistence
Specifies the callback listener classes to be used for an entity or mapped superclass.
EntityManager - Interface in javax.persistence
Interface used to interact with the persistence context.
EntityManagerFactory - Interface in javax.persistence
The EntityManagerFactory interface is used by the application to obtain an application-managed entity manager.
EntityNotFoundException - Exception in javax.persistence
Thrown by the persistence provider when an entity reference obtained by EntityManager.getReference(Class,Object) is accessed but the entity does not exist.
EntityNotFoundException() - Constructor for exception javax.persistence.EntityNotFoundException
Constructs a new EntityNotFoundException exception with null as its detail message.
EntityNotFoundException(String) - Constructor for exception javax.persistence.EntityNotFoundException
Constructs a new EntityNotFoundException exception with the specified detail message.
EntityReference - Interface in javax.xml.stream.events
An interface for handling Entity events.
EntityResult - Annotation Type in javax.persistence
References an entity in the SELECT clause of a SQL query.
EntityTransaction - Interface in javax.persistence
The EntityTransaction interface is used to control resource transactions on resource-local entity managers.
entries() - Method in interface javax.enterprise.deploy.model.DeployableObject
Returns an enumeration of the module file entries.
ENUM_ID - Static variable in class javax.faces.convert.EnumConverter
The message identifier of the FacesMessage to be created if the conversion to Enum fails.
ENUM_NO_CLASS_ID - Static variable in class javax.faces.convert.EnumConverter
The message identifier of the FacesMessage to be created if the conversion to Enum fails and no target class has been provided.
EnumConverter - Class in javax.faces.convert
Converter implementation for java.lang.Enum (and enum primitive) values.
EnumConverter() - Constructor for class javax.faces.convert.EnumConverter

EnumConverter(Class) - Constructor for class javax.faces.convert.EnumConverter

Enumerated - Annotation Type in javax.persistence
Specifies that a persistent property or field should be persisted as a enumerated type.
EnumType - Enum in javax.persistence
Defines mapping for the enumerated types.
ENVELOPE - Static variable in class javax.mail.FetchProfile.Item
This is the Envelope item.
ENVELOPE_CHANGED - Static variable in class javax.mail.event.MessageChangedEvent
The message's envelope (headers, but not body) changed.
EOF - Static variable in class javax.mail.internet.HeaderTokenizer.Token
Token type indicating end of input.
EQ - Static variable in class javax.mail.search.ComparisonTerm

equals(DataFlavor) - Method in class javax.activation.ActivationDataFlavor
Compares the DataFlavor passed in with this DataFlavor; calls the isMimeTypeEqual method.
equals(Object) - Method in class javax.el.Expression
Determines whether the specified object is equal to this Expression.
equals(Object) - Method in class javax.faces.validator.DoubleRangeValidator

equals(Object) - Method in class javax.faces.validator.LengthValidator

equals(Object) - Method in class javax.faces.validator.LongRangeValidator

equals(Object) - Method in class javax.mail.Address
The equality operator.
equals(Object) - Method in class javax.mail.Flags
Check whether the two Flags objects are equal.
equals(Object) - Method in class javax.mail.internet.InternetAddress
The equality operator.
equals(Object) - Method in class javax.mail.internet.NewsAddress
The equality operator.
equals(Object) - Method in class javax.mail.search.AddressStringTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.AddressTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.AndTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.BodyTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.ComparisonTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.DateTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.FlagTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.FromStringTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.FromTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.HeaderTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.IntegerComparisonTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.MessageIDTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.MessageNumberTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.NotTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.OrTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.ReceivedDateTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.RecipientStringTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.RecipientTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.SentDateTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.SizeTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.StringTerm
Equality comparison.
equals(Object) - Method in class javax.mail.search.SubjectTerm
Equality comparison.
equals(Object) - Method in class javax.mail.URLName
Compares two URLNames.
equals(Object) - Method in interface javax.resource.cci.Record
Check if this instance is equal to another Record.
equals(Object) - Method in interface javax.resource.spi.ConnectionRequestInfo
Checks whether this instance is equal to another.
equals(Object) - Method in interface javax.resource.spi.ManagedConnectionFactory
Check if this ManagedConnectionFactory is equal to another ManagedConnectionFactory.
equals(Object) - Method in interface javax.resource.spi.security.GenericCredential
Deprecated. Tests if this GenericCredential instance refers to the same entity as the supplied object.
equals(Object) - Method in class javax.resource.spi.security.PasswordCredential
Compares this PasswordCredential with the specified object for equality.
equals(Object) - Method in class javax.security.jacc.EJBMethodPermission
Checks two EJBMethodPermission objects for equality.
equals(Object) - Method in class javax.security.jacc.EJBRoleRefPermission
Checks two EJBRoleRefPermission objects for equality.
equals(Object) - Method in class javax.security.jacc.WebResourcePermission
Checks two WebResourcePermission objects for equality.
equals(Object) - Method in class javax.security.jacc.WebRoleRefPermission
Checks two WebRoleRefPermission objects for equality.
equals(Object) - Method in class javax.security.jacc.WebUserDataPermission
Checks two WebUserDataPermission objects for equality.
ERROR - Static variable in interface javax.xml.bind.ValidationEvent
Conditions that correspond to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation
errorCode - Variable in exception javax.transaction.SystemException
The error code with which to create the SystemException.
errorCode - Variable in exception javax.transaction.xa.XAException
The error code with which to create the SystemException.
ErrorData - Class in javax.servlet.jsp
Contains information about an error, for error pages.
ErrorData(Throwable, int, String, String) - Constructor for class javax.servlet.jsp.ErrorData
Creates a new ErrorData object.
EVAL_BODY_AGAIN - Static variable in interface javax.servlet.jsp.tagext.IterationTag
Request the reevaluation of some body.
EVAL_BODY_BUFFERED - Static variable in interface javax.servlet.jsp.tagext.BodyTag
Request the creation of new buffer, a BodyContent on which to evaluate the body of this tag.
EVAL_BODY_INCLUDE - Static variable in interface javax.servlet.jsp.tagext.Tag
Evaluate body into existing out stream.
EVAL_BODY_TAG - Static variable in interface javax.servlet.jsp.tagext.BodyTag
Deprecated. As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED or IterationTag.EVAL_BODY_AGAIN.
EVAL_PAGE - Static variable in interface javax.servlet.jsp.tagext.Tag
Continue evaluating the page.
evaluate(VariableResolver) - Method in class javax.servlet.jsp.el.Expression
Deprecated. Evaluates an expression that was previously prepared.
evaluate(String, Class, VariableResolver, FunctionMapper) - Method in class javax.servlet.jsp.el.ExpressionEvaluator
Deprecated. Evaluates an expression.
evaluateExpressionGet(FacesContext, String, Class) - Method in class javax.faces.application.Application
Get a value by evaluating an expression.
EvaluationException - Exception in javax.faces.el
Deprecated. This has been replaced by ELException.
EvaluationException() - Constructor for exception javax.faces.el.EvaluationException
Deprecated. Construct a new exception with no detail message or root cause.
EvaluationException(String) - Constructor for exception javax.faces.el.EvaluationException
Deprecated. Construct a new exception with the specified detail message and no root cause.
EvaluationException(Throwable) - Constructor for exception javax.faces.el.EvaluationException
Deprecated. Construct a new exception with the specified root cause.
EvaluationException(String, Throwable) - Constructor for exception javax.faces.el.EvaluationException
Deprecated. Construct a new exception with the specified detail message and root cause.
EVENT_TYPE_CREATED - Static variable in interface javax.xml.registry.infomodel.AuditableEvent
An event where a RegistryObject is created.
EVENT_TYPE_DELETED - Static variable in interface javax.xml.registry.infomodel.AuditableEvent
An event where a RegistryObject is deleted.
EVENT_TYPE_DEPRECATED - Static variable in interface javax.xml.registry.infomodel.AuditableEvent
An event where a RegistryObject is deprecated.
EVENT_TYPE_UNDEPRECATED - Static variable in interface javax.xml.registry.infomodel.AuditableEvent
An event where a RegistryObject is undeprecated.
EVENT_TYPE_UPDATED - Static variable in interface javax.xml.registry.infomodel.AuditableEvent
An event where a RegistryObject is updated.
EVENT_TYPE_VERSIONED - Static variable in interface javax.xml.registry.infomodel.AuditableEvent
An event where a RegistryObject is versioned.
EventFilter - Interface in javax.xml.stream
This interface declares a simple filter interface that one can create to filter XMLEventReaders
EventReaderDelegate - Class in javax.xml.stream.util
This is the base class for deriving an XMLEventReader filter.
EventReaderDelegate() - Constructor for class javax.xml.stream.util.EventReaderDelegate
Construct an empty filter with no parent.
EventReaderDelegate(XMLEventReader) - Constructor for class javax.xml.stream.util.EventReaderDelegate
Construct an filter with the specified parent.
EXACT_NAME_MATCH - Static variable in interface javax.xml.registry.FindQualifier

examineAllHeaderElements() - Method in interface javax.xml.soap.SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.
examineHeaderElements(String) - Method in interface javax.xml.soap.SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor.
examineMustUnderstandHeaderElements(String) - Method in interface javax.xml.soap.SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.
EXCEPTION - Static variable in class javax.servlet.jsp.PageContext
Name used to store uncaught exception in ServletRequest attribute list and PageContext name table.
ExceptionListener - Interface in javax.jms
If a JMS provider detects a serious problem with a Connection object, it informs the Connection object's ExceptionListener, if one has been registered.
ExcludeClassInterceptors - Annotation Type in javax.interceptor
Used to exclude class-level interceptors for a business method.
ExcludeDefaultInterceptors - Annotation Type in javax.interceptor
Used to exclude default interceptors for a bean or a business method.
ExcludeDefaultListeners - Annotation Type in javax.persistence
Specifies that the invocation of default listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
ExcludeSuperclassListeners - Annotation Type in javax.persistence
Specifies that the invocation of superclass listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
excludeUnlistedClasses() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes.
EXECUTE - Static variable in class javax.enterprise.deploy.shared.ActionType
The DeploymentManager action command is executing.
execute() - Method in interface javax.enterprise.deploy.spi.status.ClientConfiguration
This method performs an exec and starts the application client running in another process.
execute(FacesContext) - Method in class javax.faces.lifecycle.Lifecycle
Execute all of the phases of the request processing lifecycle, up to but not including the Render Response phase, as described in the JavaServer Faces Specification, in the specified order.
execute(InteractionSpec, Record, Record) - Method in interface javax.resource.cci.Interaction
Executes an interaction represented by the InteractionSpec.
execute(InteractionSpec, Record) - Method in interface javax.resource.cci.Interaction
Executes an interaction represented by the InteractionSpec.
executeQuery(Query) - Method in interface javax.xml.registry.DeclarativeQueryManager
Executes a query as specified by query parameter.
executeUpdate() - Method in interface javax.persistence.Query
Execute an update or delete statement.
ExecutionContext - Class in javax.resource.spi.work
This class models an execution context (transaction, security, etc) with which the Work instance must be executed.
ExecutionContext() - Constructor for class javax.resource.spi.work.ExecutionContext

exists() - Method in class javax.mail.Folder
Tests if this folder physically exists on the Store.
Expression - Class in javax.el
Base class for the expression subclasses ValueExpression and MethodExpression, implementing characterstics common to both.
Expression() - Constructor for class javax.el.Expression

Expression - Class in javax.servlet.jsp.el
Deprecated. As of JSP 2.1, replaced by ValueExpression
Expression() - Constructor for class javax.servlet.jsp.el.Expression
Deprecated.
ExpressionEvaluator - Class in javax.servlet.jsp.el
Deprecated. As of JSP 2.1, replaced by ExpressionFactory
ExpressionEvaluator() - Constructor for class javax.servlet.jsp.el.ExpressionEvaluator
Deprecated.
ExpressionFactory - Class in javax.el

ExpressionFactory() - Constructor for class javax.el.ExpressionFactory

expunge() - Method in class javax.mail.Folder
Expunge (permanently remove) messages marked DELETED.
expunged - Variable in class javax.mail.Message
True if this message has been expunged.
ExtensibleObject - Interface in javax.xml.registry.infomodel
An ExtensibleObject is one that allows itself to be extended by utilizing dynamically added Slots that add arbitrary attributes to the object on a per instance basis.
EXTERNAL_IDENTIFIER - Static variable in interface javax.xml.registry.LifeCycleManager

EXTERNAL_LINK - Static variable in interface javax.xml.registry.LifeCycleManager

ExternalContext - Class in javax.faces.context
This class allows the Faces API to be unaware of the nature of its containing application environment.
ExternalContext() - Constructor for class javax.faces.context.ExternalContext

ExternalIdentifier - Interface in javax.xml.registry.infomodel
ExternalIdentifier instances provide the additional identifier information to RegistryObjects such as DUNS number, Social Security Number, or an alias name of the organization.
ExternalLink - Interface in javax.xml.registry.infomodel
ExternalLink instances model a named URI to content that may reside outside the registry.
extractAllHeaderElements() - Method in interface javax.xml.soap.SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object and detaches them from this SOAPHeader object.
extractContentAsDocument() - Method in interface javax.xml.soap.SOAPBody
Creates a new DOM Document and sets the first child of this SOAPBody as it's document element.
extractHeaderElements(String) - Method in interface javax.xml.soap.SOAPHeader
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and detaches them from this SOAPHeader object.
EXTRINSIC_OBJECT - Static variable in interface javax.xml.registry.LifeCycleManager

ExtrinsicObject - Interface in javax.xml.registry.infomodel
ExtrinsicObjects provide metadata that describes submitted content whose type is not intrinsically known to the registry and therefore must be described by means of additional attributes (e.g., mime type).

F

FACES_CONTEXT_FACTORY - Static variable in class javax.faces.FactoryFinder
The property name for the FacesContextFactory class name.
FACES_MESSAGES - Static variable in class javax.faces.application.FacesMessage
ResourceBundle identifier for messages whose message identifiers are defined in the JavaServer Faces specification.
FacesContext - Class in javax.faces.context
FacesContext contains all of the per-request state information related to the processing of a single JavaServer Faces request, and the rendering of the corresponding response.
FacesContext() - Constructor for class javax.faces.context.FacesContext

FacesContextFactory - Class in javax.faces.context
FacesContextFactory is a factory object that creates (if needed) and returns new FacesContext instances, initialized for the processing of the specified request and response objects.
FacesContextFactory() - Constructor for class javax.faces.context.FacesContextFactory

FacesEvent - Class in javax.faces.event
FacesEvent is the base class for user interface and application events that can be fired by UIComponents.
FacesEvent(UIComponent) - Constructor for class javax.faces.event.FacesEvent
Construct a new event object from the specified source component.
FacesException - Exception in javax.faces
This class encapsulates general JavaServer Faces exceptions.
FacesException() - Constructor for exception javax.faces.FacesException
Construct a new exception with no detail message or root cause.
FacesException(String) - Constructor for exception javax.faces.FacesException
Construct a new exception with the specified detail message and no root cause.
FacesException(Throwable) - Constructor for exception javax.faces.FacesException
Construct a new exception with the specified root cause.
FacesException(String, Throwable) - Constructor for exception javax.faces.FacesException
Construct a new exception with the specified detail message and root cause.
FacesListener - Interface in javax.faces.event
A generic base interface for event listeners for various types of FacesEvents.
FacesMessage - Class in javax.faces.application
FacesMessage represents a single validation (or other) message, which is typically associated with a particular component in the view.
FacesMessage() - Constructor for class javax.faces.application.FacesMessage
Construct a new FacesMessage with no initial values.
FacesMessage(String) - Constructor for class javax.faces.application.FacesMessage
Construct a new FacesMessage with just a summary.
FacesMessage(String, String) - Constructor for class javax.faces.application.FacesMessage
Construct a new FacesMessage with the specified initial values.
FacesMessage(FacesMessage.Severity, String, String) - Constructor for class javax.faces.application.FacesMessage
Construct a new FacesMessage with the specified initial values.
FacesMessage.Severity - Class in javax.faces.application
Class used to represent message severity levels in a typesafe enumeration.
FacesServlet - Class in javax.faces.webapp
FacesServlet is a servlet that manages the request processing lifecycle for web applications that are utilizing JavaServer Faces to construct the user interface.
FacesServlet() - Constructor for class javax.faces.webapp.FacesServlet

FacetTag - Class in javax.faces.webapp
FacetTag is the JSP mechanism for denoting a UIComponent is to be added as a facet to the component associated with its parent.
FacetTag() - Constructor for class javax.faces.webapp.FacetTag

FactoryConfigurationError - Error in javax.xml.stream
An error class for reporting factory configuration errors.
FactoryConfigurationError() - Constructor for error javax.xml.stream.FactoryConfigurationError
Default constructor
FactoryConfigurationError(Exception) - Constructor for error javax.xml.stream.FactoryConfigurationError
Construct an exception with a nested inner exception
FactoryConfigurationError(Exception, String) - Constructor for error javax.xml.stream.FactoryConfigurationError
Construct an exception with a nested inner exception and a message
FactoryConfigurationError(String, Exception) - Constructor for error javax.xml.stream.FactoryConfigurationError
Construct an exception with a nested inner exception and a message
FactoryConfigurationError(String) - Constructor for error javax.xml.stream.FactoryConfigurationError
Construct an exception with associated message
FactoryFinder - Class in javax.faces
FactoryFinder implements the standard discovery algorithm for all factory objects specified in the JavaServer Faces APIs.
FAILED - Static variable in class javax.enterprise.deploy.shared.StateType
The action operation has failed.
FATAL_ERROR - Static variable in interface javax.xml.bind.ValidationEvent
Conditions that correspond to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation
FederatedConnection - Interface in javax.xml.registry
Represents a single logical connection to a federation or group of registry providers.
fetch(Message[], FetchProfile) - Method in class javax.mail.Folder
Prefetch the items specified in the FetchProfile for the given Messages.
FetchProfile - Class in javax.mail
Clients use a FetchProfile to list the Message attributes that it wishes to prefetch from the server for a range of messages.
FetchProfile() - Constructor for class javax.mail.FetchProfile
Create an empty FetchProfile.
FetchProfile.Item - Class in javax.mail
This inner class is the base class of all items that can be requested in a FetchProfile.
FetchProfile.Item(String) - Constructor for class javax.mail.FetchProfile.Item
Constructor for an item.
FetchType - Enum in javax.persistence
Defines strategies for fetching data from the database.
FieldResult - Annotation Type in javax.persistence
Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class.
FileDataSource - Class in javax.activation
The FileDataSource class implements a simple DataSource object that encapsulates a file.
FileDataSource(File) - Constructor for class javax.activation.FileDataSource
Creates a FileDataSource from a File object.
FileDataSource(String) - Constructor for class javax.activation.FileDataSource
Creates a FileDataSource from the specified path name.
FileTypeMap - Class in javax.activation
The FileTypeMap is an abstract class that provides a data typing interface for files.
FileTypeMap() - Constructor for class javax.activation.FileTypeMap
The default constructor.
Filter - Interface in javax.servlet
A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both.
FilterChain - Interface in javax.servlet
A FilterChain is an object provided by the servlet container to the developer giving a view into the invocation chain of a filtered request for a resource.
FilterConfig - Interface in javax.servlet
A filter configuration object used by a servlet container to pass information to a filter during initialization.
finalize() - Method in class javax.mail.Folder

finalize() - Method in class javax.mail.Service
Stop the event dispatcher thread so the queue can be garbage collected.
finalize() - Method in class javax.mail.util.SharedFileInputStream
Force this stream to close.
find(Class<T>, Object) - Method in interface javax.persistence.EntityManager
Find by primary key.
findAncestorWithClass(JspTag, Class<?>) - Static method in class javax.servlet.jsp.tagext.SimpleTagSupport
Find the instance of a given class type that is closest to a given instance.
findAncestorWithClass(Tag, Class) - Static method in class javax.servlet.jsp.tagext.TagSupport
Find the instance of a given class type that is closest to a given instance.
findAssociations(Collection, String, String, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all Association objects that match all of the criteria specified by the parameters of this call.
findAttribute(String) - Method in class javax.servlet.jsp.JspContext
Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.
findCallerAssociations(Collection, Boolean, Boolean, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all Association objects owned by the caller that match all of the criteria specified by the parameters of this call.
findClassificationSchemeByName(Collection, String) - Method in interface javax.xml.registry.BusinessQueryManager
Finds a ClassificationScheme by name based on the specified find qualifiers and name pattern.
findClassificationSchemes(Collection, Collection, Collection, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all ClassificationScheme objects that match all of the criteria specified by the parameters of this call.
findComponent(String) - Method in class javax.faces.component.UIComponent
Search for and return the UIComponent with an id that matches the specified search expression (if any), according to the algorithm described below.
findComponent(String) - Method in class javax.faces.component.UIComponentBase

findComponent(FacesContext) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Find and return the UIComponent, from the component tree, that corresponds to this tag handler instance.
findConceptByPath(String) - Method in interface javax.xml.registry.BusinessQueryManager
Finds a Concept based on the path specified.
findConcepts(Collection, Collection, Collection, Collection, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all Concept objects that match all of the criteria specified by the parameters of this call.
FinderException - Exception in javax.ejb
The FinderException exception must be included in the throws clause of every findMETHOD(...) method of an entity Bean's home interface.
FinderException() - Constructor for exception javax.ejb.FinderException
Constructs an FinderException with no detail message.
FinderException(String) - Constructor for exception javax.ejb.FinderException
Constructs an FinderException with the specified detail message.
FindException - Exception in javax.xml.registry
A RegistryException that occurs during a find action.
FindException() - Constructor for exception javax.xml.registry.FindException
Constructs a JAXRException object with no reason or embedded Throwable.
FindException(String) - Constructor for exception javax.xml.registry.FindException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
FindException(String, Throwable) - Constructor for exception javax.xml.registry.FindException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
FindException(Throwable) - Constructor for exception javax.xml.registry.FindException
Constructs a JAXRException object initialized with the given Throwable object.
findOrganizations(Collection, Collection, Collection, Collection, Collection, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all Organization objects that match all of the criteria specified by the parameters of this call.
FindQualifier - Interface in javax.xml.registry
FindQualifier provides various constants that identify options that effect find method behavior.
findRegistryPackages(Collection, Collection, Collection, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all RegistryPackage objects that match all of the criteria specified by the parameters of this call.
findServiceBindings(Key, Collection, Collection, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all ServiceBinding objects that match all of the criteria specified by the parameters of this call.
findServices(Key, Collection, Collection, Collection, Collection) - Method in interface javax.xml.registry.BusinessQueryManager
Finds all Service objects that match all of the criteria specified by the parameters of this call.
fireXpathEvent(XpathEvent) - Method in interface javax.enterprise.deploy.model.XpathListener

FLAGGED - Static variable in class javax.mail.Flags.Flag
This message is flagged.
FLAGS - Static variable in class javax.mail.FetchProfile.Item
This is the Flags item.
Flags - Class in javax.mail
The Flags class represents the set of flags on a Message.
Flags() - Constructor for class javax.mail.Flags
Construct an empty Flags object.
Flags(Flags) - Constructor for class javax.mail.Flags
Construct a Flags object initialized with the given flags.
Flags(Flags.Flag) - Constructor for class javax.mail.Flags
Construct a Flags object initialized with the given system flag.
Flags(String) - Constructor for class javax.mail.Flags
Construct a Flags object initialized with the given user flag.
flags - Variable in class javax.mail.internet.MimeMessage
The Flags for this message.
flags - Variable in class javax.mail.search.FlagTerm
Flags object containing the flags to test.
Flags.Flag - Class in javax.mail
This inner class represents an individual system flag.
FLAGS_CHANGED - Static variable in class javax.mail.event.MessageChangedEvent
The message's flags changed.
FlagTerm - Class in javax.mail.search
This class implements comparisons for Message Flags.
FlagTerm(Flags, boolean) - Constructor for class javax.mail.search.FlagTerm
Constructor.
FLOAT_ID - Static variable in class javax.faces.convert.FloatConverter
The message identifier of the FacesMessage to be created if the conversion to Float fails.
FloatConverter - Class in javax.faces.convert
Converter implementation for java.lang.Float (and float primitive) values.
FloatConverter() - Constructor for class javax.faces.convert.FloatConverter

FloatHolder - Class in javax.xml.rpc.holders

FloatHolder() - Constructor for class javax.xml.rpc.holders.FloatHolder

FloatHolder(float) - Constructor for class javax.xml.rpc.holders.FloatHolder

FloatWrapperHolder - Class in javax.xml.rpc.holders

FloatWrapperHolder() - Constructor for class javax.xml.rpc.holders.FloatWrapperHolder

FloatWrapperHolder(Float) - Constructor for class javax.xml.rpc.holders.FloatWrapperHolder

flush() - Method in class javax.faces.context.ResponseWriter
Flush any ouput buffered by the output method to the underlying Writer or OutputStream.
flush() - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.flush() on the wrapped ResponseWriter object.
flush() - Method in interface javax.persistence.EntityManager
Synchronize the persistence context to the underlying database.
flush() - Method in class javax.servlet.jsp.JspWriter
Flush the stream.
flush() - Method in class javax.servlet.jsp.tagext.BodyContent
Redefined flush() so it is not legal.
flush() - Method in interface javax.xml.stream.XMLEventWriter
Writes any cached events to the underlying output mechanism
flush() - Method in interface javax.xml.stream.XMLStreamWriter
Write any cached data to the underlying output mechanism.
flushBuffer() - Method in interface javax.servlet.ServletResponse
Forces any content in the buffer to be written to the client.
flushBuffer() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call flushBuffer() on the wrapped response object.
FlushModeType - Enum in javax.persistence
Flush mode setting.
fold(int, String) - Static method in class javax.mail.internet.MimeUtility
Fold a string at linear whitespace so that each line is no longer than 76 characters, if possible.
folder - Variable in class javax.mail.event.FolderEvent
The folder the event occurred on.
Folder - Class in javax.mail
Folder is an abstract class that represents a folder for mail messages.
Folder(Store) - Constructor for class javax.mail.Folder
Constructor that takes a Store object.
folder - Variable in class javax.mail.Message
The containing folder, if this message is obtained from a folder
FolderAdapter - Class in javax.mail.event
The adapter which receives Folder events.
FolderAdapter() - Constructor for class javax.mail.event.FolderAdapter

FolderClosedException - Exception in javax.mail
This exception is thrown when a method is invoked on a Messaging object and the Folder that owns that object has died due to some reason.
FolderClosedException(Folder) - Constructor for exception javax.mail.FolderClosedException
Constructor
FolderClosedException(Folder, String) - Constructor for exception javax.mail.FolderClosedException
Constructor
folderCreated(FolderEvent) - Method in class javax.mail.event.FolderAdapter

folderCreated(FolderEvent) - Method in interface javax.mail.event.FolderListener
Invoked when a Folder is created.
folderDeleted(FolderEvent) - Method in class javax.mail.event.FolderAdapter

folderDeleted(FolderEvent) - Method in interface javax.mail.event.FolderListener
Invoked when a folder is deleted.
FolderEvent - Class in javax.mail.event
This class models Folder existence events.
FolderEvent(Object, Folder, int) - Constructor for class javax.mail.event.FolderEvent
Constructor.
FolderEvent(Object, Folder, Folder, int) - Constructor for class javax.mail.event.FolderEvent
Constructor.
FolderListener - Interface in javax.mail.event
This is the Listener interface for Folder events.
FolderNotFoundException - Exception in javax.mail
This exception is thrown by Folder methods, when those methods are invoked on a non existent folder.
FolderNotFoundException() - Constructor for exception javax.mail.FolderNotFoundException
Constructs a MessagingException with no detail message.
FolderNotFoundException(Folder) - Constructor for exception javax.mail.FolderNotFoundException
Constructs a MessagingException with the specified folder.
FolderNotFoundException(Folder, String) - Constructor for exception javax.mail.FolderNotFoundException
Constructs a MessagingException with the specified folder and the specified detail message.
FolderNotFoundException(String, Folder) - Constructor for exception javax.mail.FolderNotFoundException
Constructs a MessagingException with the specified detail message and the specified folder.
folderRenamed(FolderEvent) - Method in class javax.mail.event.FolderAdapter

folderRenamed(FolderEvent) - Method in interface javax.mail.event.FolderListener
Invoked when a folder is renamed.
forget(Xid) - Method in interface javax.resource.spi.XATerminator
Tells the resource manager to forget about a heuristically completed transaction branch.
forget(Xid) - Method in interface javax.transaction.xa.XAResource
Tells the resource manager to forget about a heuristically completed transaction branch.
FORM_AUTH - Static variable in class javax.faces.context.ExternalContext
String identifier for FORM authentication.
FORM_AUTH - Static variable in interface javax.servlet.http.HttpServletRequest
String identifier for Form authentication.
format(Date, StringBuffer, FieldPosition) - Method in class javax.mail.internet.MailDateFormat
Formats the given date in the format specified by draft-ietf-drums-msg-fmt-08 in the current TimeZone.
forward(String) - Method in class javax.servlet.jsp.PageContext
This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.
forward(ServletRequest, ServletResponse) - Method in interface javax.servlet.RequestDispatcher
Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.
FromStringTerm - Class in javax.mail.search
This class implements string comparisons for the From Address header.
FromStringTerm(String) - Constructor for class javax.mail.search.FromStringTerm
Constructor.
FromTerm - Class in javax.mail.search
This class implements comparisons for the From Address header.
FromTerm(Address) - Constructor for class javax.mail.search.FromTerm
Constructor
fullURL - Variable in class javax.mail.URLName
The full version of the URL
FunctionInfo - Class in javax.servlet.jsp.tagext
Information for a function in a Tag Library.
FunctionInfo(String, String, String) - Constructor for class javax.servlet.jsp.tagext.FunctionInfo
Constructor for FunctionInfo.
FunctionMapper - Class in javax.el
The interface to a map between EL function names and methods.
FunctionMapper() - Constructor for class javax.el.FunctionMapper

FunctionMapper - Interface in javax.servlet.jsp.el
Deprecated. As of JSP 2.1, replaced by FunctionMapper
functions - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
An array describing the functions that are defined in this tag library.

G

GE - Static variable in class javax.mail.search.ComparisonTerm

Generated - Annotation Type in javax.annotation
The Generated annoation is used to mark source code that has been generated.
GeneratedValue - Annotation Type in javax.persistence
Provides for the specification of generation strategies for the values of primary keys.
generateSchema(SchemaOutputResolver) - Method in class javax.xml.bind.JAXBContext
Generates the schema documents for this context.
GenerationType - Enum in javax.persistence
Defines the types of primary key generation.
GenericCredential - Interface in javax.resource.spi.security
Deprecated. The preferred way to represent generic credential information is via the org.ietf.jgss.GSSCredential interface in J2SE Version 1.4, which provides similar functionality.
GenericHandler - Class in javax.xml.rpc.handler
The javax.xml.rpc.handler.GenericHandler class implements the Handler interface.
GenericHandler() - Constructor for class javax.xml.rpc.handler.GenericHandler
Default constructor
GenericServlet - Class in javax.servlet
Defines a generic, protocol-independent servlet.
GenericServlet() - Constructor for class javax.servlet.GenericServlet
Does nothing.
get(String) - Method in class javax.activation.MimeTypeParameterList
Retrieve the value associated with the given name, or null if there is no current association.
get(String) - Method in class javax.mail.internet.ParameterList
Returns the value of the specified parameter.
get(Object) - Method in class javax.xml.soap.SOAPConnection
Gets a message from a specific endpoint and blocks until it receives,
getAccept() - Method in class javax.faces.component.html.HtmlForm
Return the value of the accept property.
getAcceptcharset() - Method in class javax.faces.component.html.HtmlForm
Return the value of the acceptcharset property.
getAccesskey() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the accesskey property.
getAccesskey() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the accesskey property.
getAccessURI() - Method in interface javax.xml.registry.infomodel.ServiceBinding
Gets the URI that gives access to the service via this binding.
getAcknowledgeMode() - Method in interface javax.jms.Session
Returns the acknowledgement mode of the session.
getAction() - Method in interface javax.enterprise.deploy.spi.status.DeploymentStatus
Retrieve the deployment ActionType for this event.
getAction() - Method in interface javax.faces.component.ActionSource
Deprecated. This has been replaced by ActionSource2.getActionExpression().
getAction() - Method in class javax.faces.component.UICommand
Deprecated. This has been replaced by UICommand.getActionExpression().
getActionExpression() - Method in interface javax.faces.component.ActionSource2
Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.
getActionExpression() - Method in class javax.faces.component.UICommand

getActionListener() - Method in class javax.faces.application.Application
Return the default ActionListener to be registered for all ActionSource components in this appication.
getActionListener() - Method in interface javax.faces.component.ActionSource
Deprecated. Use ActionSource.getActionListeners() instead.
getActionListener() - Method in class javax.faces.component.UICommand
Deprecated. Use UICommand.getActionListeners() instead.
getActionListeners() - Method in interface javax.faces.component.ActionSource
Return the set of registered ActionListeners for this ActionSource instance.
getActionListeners() - Method in class javax.faces.component.UICommand

getActions() - Method in class javax.security.jacc.EJBMethodPermission
Returns a String containing a canonical representation of the actions of this EJBMethodPermission.
getActions() - Method in class javax.security.jacc.EJBRoleRefPermission
Returns a canonical String representation of the actions of this EJBRoleRefPermission.
getActions() - Method in class javax.security.jacc.WebResourcePermission
Returns a canonical String representation of the actions of this WebResourcePermission.
getActions() - Method in class javax.security.jacc.WebRoleRefPermission
Returns a canonical String representation of the actions of this WebRoleRefPermission.
getActions() - Method in class javax.security.jacc.WebUserDataPermission
Returns a canonical String representation of the actions of this WebUserDataPermission.
getActionType(int) - Static method in class javax.enterprise.deploy.shared.ActionType
Return an object of the specified value.
getActionURL(FacesContext, String) - Method in class javax.faces.application.ViewHandler
Return a URL suitable for rendering (after optional encoding performed by the encodeActionURL() method of ExternalContext) that selects the specified view identifier.
getActionURL(FacesContext, String) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.getActionURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
getActiveCount() - Method in interface javax.management.j2ee.statistics.JTAStats
Number of active transactions.
getActor() - Method in interface javax.xml.soap.SOAPHeaderElement
Returns the uri of the actor attribute of this SOAPHeaderElement.
getAdaptee() - Method in class javax.servlet.jsp.tagext.TagAdapter
Gets the tag that is being adapted to the Tag interface.
getAdapter(Class<A>) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

getAdapter(Class<A>) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

getAdapter(Class<A>) - Method in interface javax.xml.bind.Marshaller
Gets the adapter associated with the specified type.
getAdapter(Class<A>) - Method in interface javax.xml.bind.Unmarshaller
Gets the adapter associated with the specified type.
getAdapterName() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Gets a tool displayable name of the resource adapter.
getAdapterShortDescription() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Gets a tool displayable short desription of the resource adapter.
getAdapterVendorName() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Gets the name of the vendor that has provided the resource adapter.
getAdapterVersion() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Gets the version of the resource adapter.
getAddress() - Method in class javax.mail.internet.InternetAddress
Get the email address.
getAddress() - Method in class javax.mail.search.AddressTerm
Return the address to match with.
getAddress() - Method in interface javax.xml.registry.infomodel.EmailAddress
Returns the email address for this object.
getAfterPhaseListener() - Method in class javax.faces.component.UIViewRoot

getAllAttributes() - Method in interface javax.xml.soap.SOAPElement
Returns an Iterator over all of the attribute Name objects in this SOAPElement object.
getAllAttributesAsQNames() - Method in interface javax.xml.soap.SOAPElement
Returns an Iterator over all of the attributes in this SOAPElement as QName objects.
getAllCommands(String) - Method in class javax.activation.CommandMap
Get all the available commands for this type.
getAllCommands(String, DataSource) - Method in class javax.activation.CommandMap
Get all the available commands for this type.
getAllCommands() - Method in class javax.activation.DataHandler
Return all the commands for this type of data.
getAllCommands(String) - Method in class javax.activation.MailcapCommandMap
Get all the available commands in all mailcap files known to this instance of MailcapCommandMap for this MIME type.
getAllHeaderLines() - Method in class javax.mail.internet.InternetHeaders
Return all the header lines as an Enumeration of Strings.
getAllHeaderLines() - Method in class javax.mail.internet.MimeBodyPart
Get all header lines as an Enumeration of Strings.
getAllHeaderLines() - Method in class javax.mail.internet.MimeMessage
Get all header lines as an Enumeration of Strings.
getAllHeaderLines() - Method in interface javax.mail.internet.MimePart
Get all header lines as an Enumeration of Strings.
getAllHeaders() - Method in class javax.mail.internet.InternetHeaders
Return all the headers as an Enumeration of Header objects.
getAllHeaders() - Method in class javax.mail.internet.MimeBodyPart
Return all the headers from this Message as an Enumeration of Header objects.
getAllHeaders() - Method in class javax.mail.internet.MimeMessage
Return all the headers from this Message as an enumeration of Header objects.
getAllHeaders() - Method in interface javax.mail.Part
Return all the headers from this part as an Enumeration of Header objects.
getAllHeaders() - Method in class javax.xml.soap.MimeHeaders
Returns all the MimeHeaders in this MimeHeaders object.
getAllMimeHeaders() - Method in class javax.xml.soap.AttachmentPart
Retrieves all the headers for this AttachmentPart object as an iterator over the MimeHeader objects.
getAllMimeHeaders() - Method in class javax.xml.soap.SOAPPart
Retrieves all the headers for this SOAPPart object as an iterator over the MimeHeader objects.
getAllRecipients() - Method in class javax.mail.internet.MimeMessage
Get all the recipient addresses for the message.
getAllRecipients() - Method in class javax.mail.Message
Get all the recipient addresses for the message.
getAlt() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the alt property.
getAlt() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the alt property.
getAlt() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the alt property.
getAlt() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the alt property.
getApplication() - Method in class javax.faces.application.ApplicationFactory
Create (if needed) and return an Application instance for this web application.
getApplication() - Method in class javax.faces.context.FacesContext
Return the Application instance associated with this web application.
getApplicationMap() - Method in class javax.faces.context.ExternalContext
Return a mutable Map representing the application scope attributes for the current application.
getAreaCode() - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Gets the area code.
getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.BigDecimalConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.BigIntegerConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.BooleanConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.ByteConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.CharacterConverter

getAsObject(FacesContext, UIComponent, String) - Method in interface javax.faces.convert.Converter
Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Apply Request Values phase of the request processing lifecycle.
getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.DateTimeConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.DoubleConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.EnumConverter
Convert the value argument to one of the enum constants of the class provided in our constructor.
getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.FloatConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.IntegerConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.LongConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.NumberConverter

getAsObject(FacesContext, UIComponent, String) - Method in class javax.faces.convert.ShortConverter

getAssociatedObjects() - Method in interface javax.xml.registry.infomodel.RegistryObject
Returns the collection of RegistryObject instances associated with this object.
getAssociations() - Method in interface javax.xml.registry.infomodel.RegistryObject
Gets all Associations where this object is source.
getAssociationType() - Method in interface javax.xml.registry.infomodel.Association
Gets the association type for this Association.
getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.BigDecimalConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.BigIntegerConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.BooleanConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.ByteConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.CharacterConverter

getAsString(FacesContext, UIComponent, Object) - Method in interface javax.faces.convert.Converter
Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.DateTimeConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.DoubleConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.EnumConverter
Convert the enum constant given by the value argument into a String.
getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.FloatConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.IntegerConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.LongConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.NumberConverter

getAsString(FacesContext, UIComponent, Object) - Method in class javax.faces.convert.ShortConverter

getAttachment(SOAPElement) - Method in class javax.xml.soap.SOAPMessage
Returns an AttachmentPart object that is associated with an attachment that is referenced by this SOAPElement or null if no such attachment exists.
getAttachmentAsByteArray(String) - Method in class javax.xml.bind.attachment.AttachmentUnmarshaller
Retrieve the attachment identified by content-id, cid, as a byte[].
getAttachmentAsDataHandler(String) - Method in class javax.xml.bind.attachment.AttachmentUnmarshaller
Lookup MIME content by content-id, cid, and return as a DataHandler.
getAttachmentMarshaller() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

getAttachmentMarshaller() - Method in interface javax.xml.bind.Marshaller

getAttachments() - Method in class javax.xml.soap.SOAPMessage
Retrieves all the AttachmentPart objects that are part of this SOAPMessage object.
getAttachments(MimeHeaders) - Method in class javax.xml.soap.SOAPMessage
Retrieves all the AttachmentPart objects that have header entries that match the specified headers.
getAttachmentUnmarshaller() - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

getAttachmentUnmarshaller() - Method in interface javax.xml.bind.Unmarshaller

getAttribute(ObjectName, String) - Method in interface javax.management.j2ee.Management
Gets the value of a specific attribute of a named managed object.
getAttribute(String) - Method in interface javax.servlet.http.HttpSession
Returns the object bound with the specified name in this session, or null if no object is bound under the name.
getAttribute(String) - Method in class javax.servlet.jsp.JspContext
Returns the object associated with the name in the page scope or null if not found.
getAttribute(String, int) - Method in class javax.servlet.jsp.JspContext
Return the object associated with the name in the specified scope or null if not found.
getAttribute(String) - Method in class javax.servlet.jsp.tagext.TagData
The value of the attribute.
getAttribute(String) - Method in interface javax.servlet.ServletContext
Returns the servlet container attribute with the given name, or null if there is no attribute by that name.
getAttribute(String) - Method in interface javax.servlet.ServletRequest
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
getAttribute(String) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to call getAttribute(String name) on the wrapped request object.
getAttributeByName(QName) - Method in interface javax.xml.stream.events.StartElement
Returns the attribute referred to by this name
getAttributeCount() - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributeCount() - Method in interface javax.xml.stream.XMLStreamReader
Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE.
getAttributeLocalName(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributeLocalName(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the localName of the attribute at the provided index
getAttributeName(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributeName(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the qname of the attribute at the provided index
getAttributeNames() - Method in interface javax.enterprise.deploy.model.DDBean
Returns the list of attribute names associated with the XML element.
getAttributeNames() - Method in interface javax.servlet.http.HttpSession
Returns an Enumeration of String objects containing the names of all the objects bound to this session.
getAttributeNames() - Method in interface javax.servlet.ServletContext
Returns an Enumeration containing the attribute names available within this servlet context.
getAttributeNames() - Method in interface javax.servlet.ServletRequest
Returns an Enumeration containing the names of the attributes available to this request.
getAttributeNames() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getAttributeNames() on the wrapped request object.
getAttributeNamesInScope(int) - Method in class javax.servlet.jsp.JspContext
Enumerate all the attributes in a given scope.
getAttributeNamespace(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributeNamespace(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the namespace of the attribute at the provided index
getAttributePrefix(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributePrefix(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the prefix of this attribute at the provided index
getAttributes() - Method in class javax.faces.component.UIComponent
Return a mutable Map representing the attributes (and properties, see below) associated wth this UIComponent, keyed by attribute name (which must be a String).
getAttributes() - Method in class javax.faces.component.UIComponentBase

getAttributes(ObjectName, String[]) - Method in interface javax.management.j2ee.Management
Enables the values of several attributes of a named managed object.
getAttributes() - Method in class javax.servlet.jsp.tagext.TagData
Enumerates the attributes.
getAttributes() - Method in class javax.servlet.jsp.tagext.TagInfo
Attribute information (in the TLD) on this tag.
getAttributes() - Method in interface javax.xml.stream.events.StartElement
Returns an Iterator of non-namespace declared attributes declared on this START_ELEMENT, returns an empty iterator if there are no attributes.
getAttributesScope(String) - Method in class javax.servlet.jsp.JspContext
Get the scope where a given attribute is defined.
getAttributeString(String) - Method in class javax.servlet.jsp.tagext.TagData
Get the value for a given attribute.
getAttributeType(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributeType(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the XML type of the attribute at the provided index
getAttributeValue(String) - Method in interface javax.enterprise.deploy.model.DDBean
Returns the string value of the named attribute.
getAttributeValue(Name) - Method in interface javax.xml.soap.SOAPElement
Returns the value of the attribute with the specified name.
getAttributeValue(QName) - Method in interface javax.xml.soap.SOAPElement
Returns the value of the attribute with the specified qname.
getAttributeValue(String, String) - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributeValue(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getAttributeValue(String, String) - Method in interface javax.xml.stream.XMLStreamReader
Returns the normalized attribute value of the attribute with the namespace and localName If the namespaceURI is null the namespace is not checked for equality
getAttributeValue(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the value of the attribute at the index
getAuditTrail() - Method in interface javax.xml.registry.infomodel.RegistryObject
Returns the complete audit trail of all requests that effected a state change in this object as an ordered Collection of AuditableEvent objects.
getAuthType() - Method in class javax.faces.context.ExternalContext
Return the name of the authentication scheme used to authenticate the current user, if any; otherwise, return null.
getAuthType() - Method in interface javax.servlet.http.HttpServletRequest
Returns the name of the authentication scheme used to protect the servlet.
getAuthType() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getAuthType() on the wrapped request object.
getAutocomplete() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the autocomplete property.
getAutocomplete() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the autocomplete property.
getAvailableModules(ModuleType, Target[]) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Retrieve the list of all J2EE application modules running or not running on the identified targets.
getBase64Content() - Method in class javax.xml.soap.AttachmentPart
Returns an InputStream which can be used to obtain the content of AttachmentPart as Base64 encoded character data, this method would base64 encode the raw bytes of the attachment and return.
getBaseType() - Method in class javax.activation.MimeType
Return a String representation of this object without the parameter list.
getBaseType() - Method in class javax.mail.internet.ContentType
Return the MIME type string, without the parameters.
getBaseURI() - Method in interface javax.xml.stream.events.EntityDeclaration
Get the base URI for this reference or null if this information is not available
getBean(CommandInfo) - Method in class javax.activation.DataHandler
A convenience method that takes a CommandInfo object and instantiates the corresponding command, usually a JavaBean component.
getBean() - Method in class javax.enterprise.deploy.model.XpathEvent
The bean being added/removed/changed.
getBeanProperty(String) - Method in class javax.el.BeanELResolver.BeanProperties

getBeforePhaseListener() - Method in class javax.faces.component.UIViewRoot

getBgcolor() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the bgcolor property.
getBgcolor() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the bgcolor property.
getBinding() - Method in interface javax.xml.ws.BindingProvider
Get the Binding for this binding provider.
getBinding() - Method in class javax.xml.ws.Endpoint
Returns the binding for this endpoint.
getBindingID() - Method in interface javax.xml.ws.handler.PortInfo
Gets the URI identifying the binding used by the port being accessed.
getBody() - Method in interface javax.xml.soap.SOAPEnvelope
Returns the SOAPBody object associated with this SOAPEnvelope object.
getBodyContent() - Method in class javax.faces.webapp.UIComponentClassicTagBase

getBodyContent() - Method in class javax.servlet.jsp.tagext.BodyTagSupport
Get current bodyContent.
getBodyContent() - Method in class javax.servlet.jsp.tagext.TagInfo
The bodycontent information for this tag.
getBodyLength() - Method in interface javax.jms.BytesMessage
Gets the number of bytes of the message body when the message is in read-only mode.
getBodyPart(int) - Method in class javax.mail.internet.MimeMultipart
Get the specified BodyPart.
getBodyPart(String) - Method in class javax.mail.internet.MimeMultipart
Get the MimeBodyPart referred to by the given ContentID (CID).
getBodyPart(int) - Method in class javax.mail.Multipart
Get the specified Part.
getBodyPart(int) - Method in interface javax.mail.MultipartDataSource
Get the specified Part.
getBoolean(String) - Method in interface javax.jms.MapMessage
Returns the boolean value with the specified name.
getBooleanProperty(String) - Method in interface javax.jms.Message
Returns the value of the boolean property with the specified name.
getBorder() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the border property.
getBorder() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the border property.
getBorder() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the border property.
getBorder() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the border property.
getBranchQualifier() - Method in interface javax.transaction.xa.Xid
Obtain the transaction branch identifier part of XID as an array of bytes.
getBufferSize() - Method in class javax.servlet.jsp.JspWriter
This method returns the size of the buffer used by the JspWriter.
getBufferSize() - Method in interface javax.servlet.ServletResponse
Returns the actual buffer size used for the response.
getBufferSize() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to return getBufferSize() on the wrapped response object.
getBuilder() - Method in class javax.xml.bind.annotation.W3CDomHandler

getBulkResponse(String) - Method in interface javax.xml.registry.RegistryService
Returns the BulkResponse associated with specified requestId.
getBusinessLifeCycleManager() - Method in interface javax.xml.registry.RegistryService
Returns the BusinessLifeCycleManager object implemented by the JAXR provider.
getBusinessObject(Class<T>) - Method in interface javax.ejb.SessionContext
Obtain an object that can be used to invoke the current bean through the given business interface.
getBusinessQueryManager() - Method in interface javax.xml.registry.RegistryService
Returns the BusinessQueryManager object implemented by the JAXR provider.
getByte(String) - Method in interface javax.jms.MapMessage
Returns the byte value with the specified name.
getByteProperty(String) - Method in interface javax.jms.Message
Returns the value of the byte property with the specified name.
getBytes(String) - Method in interface javax.jms.MapMessage
Returns the byte array value with the specified name.
getCallerIdentity() - Method in interface javax.ejb.EJBContext
Deprecated. Use Principal getCallerPrincipal() instead.
getCallerPrincipal() - Method in interface javax.ejb.EJBContext
Obtain the java.security.Principal that identifies the caller.
getCalls(QName) - Method in interface javax.xml.rpc.Service
Gets an array of preconfigured Call objects for invoking operations on the specified port.
getCapabilityLevel() - Method in interface javax.xml.registry.CapabilityProfile
Gets the capability level supported by the JAXR provider.
getCapabilityProfile() - Method in interface javax.xml.registry.RegistryService
Returns the CapabilityProfile for the JAXR provider.
getCaptionClass() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the captionClass property.
getCaptionClass() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the captionClass property.
getCaptionStyle() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the captionStyle property.
getCaptionStyle() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the captionStyle property.
getCause() - Method in exception javax.faces.FacesException
Return the cause of this exception, or null if the cause is nonexistent or unknown.
getCause() - Method in exception javax.mail.MessagingException
Overrides the getCause method of Throwable to return the next exception in the chain of nested exceptions.
getCause() - Method in exception javax.xml.bind.JAXBException

getCause() - Method in exception javax.xml.registry.JAXRException
Returns the Throwable embedded in this JAXRException if there is one.
getCause() - Method in exception javax.xml.soap.SOAPException
Returns the Throwable object embedded in this SOAPException if there is one.
getCausedByException() - Method in exception javax.ejb.EJBException
Obtain the exception that caused the EJBException being thrown.
getCellpadding() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the cellpadding property.
getCellpadding() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the cellpadding property.
getCellspacing() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the cellspacing property.
getCellspacing() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the cellspacing property.
getChangeEvent() - Method in class javax.enterprise.deploy.model.XpathEvent

getChar(String) - Method in interface javax.jms.MapMessage
Returns the Unicode character value with the specified name.
getCharacterEncoding() - Method in class javax.faces.context.ResponseWriter
Return the character encoding (such as "ISO-8859-1") for this ResponseWriter.
getCharacterEncoding() - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.getCharacterEncoding() on the wrapped ResponseWriter object.
getCharacterEncoding() - Method in interface javax.servlet.ServletRequest
Returns the name of the character encoding used in the body of this request.
getCharacterEncoding() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.
getCharacterEncoding() - Method in interface javax.servlet.ServletResponse
Returns the name of the character encoding (MIME charset) used for the body sent in this response.
getCharacterEncoding() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object.
getCharacterEncodingScheme() - Method in interface javax.xml.stream.events.StartDocument
Returns the encoding style of the XML data
getCharacterEncodingScheme() - Method in class javax.xml.stream.util.StreamReaderDelegate

getCharacterEncodingScheme() - Method in interface javax.xml.stream.XMLStreamReader
Returns the character encoding declared on the xml declaration Returns null if none was declared
getCharacterOffset() - Method in interface javax.xml.stream.Location
Return the byte or character offset into the input source this location is pointing to.
getCharset() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the charset property.
getCharset() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the charset property.
getCharsetName() - Method in interface javax.xml.registry.infomodel.LocalizedString
Gets the canonical name for the charset for this object.
getChildBean(String) - Method in interface javax.enterprise.deploy.model.DDBean
Return a list of DDBeans based upon the XPath.
getChildBean(String) - Method in interface javax.enterprise.deploy.model.DeployableObject
Return an array of standard beans representing the XML content returned based upon the XPath.
getChildBean(ModuleType, String) - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Return a list of DDBean based upon an XPath; all deployment descriptors of the specified type are searched.
getChildConceptCount() - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Gets number of children.
getChildConceptCount() - Method in interface javax.xml.registry.infomodel.Concept
Gets number of children.
getChildCount() - Method in class javax.faces.component.UIComponent
Return the number of child UIComponents that are associated with this UIComponent.
getChildCount() - Method in class javax.faces.component.UIComponentBase

getChildElements() - Method in interface javax.xml.soap.SOAPElement
Returns an Iterator over all the immediate child Nodes of this element.
getChildElements(Name) - Method in interface javax.xml.soap.SOAPElement
Returns an Iterator over all the immediate child Nodes of this element with the specified name.
getChildElements(QName) - Method in interface javax.xml.soap.SOAPElement
Returns an Iterator over all the immediate child Nodes of this element with the specified qname.
getChildOrganizationCount() - Method in interface javax.xml.registry.infomodel.Organization
Gets number of children.
getChildOrganizations() - Method in interface javax.xml.registry.infomodel.Organization
Gets all immediate children Organizations.
getChildren() - Method in class javax.faces.component.UIComponent
Return a mutable List representing the child UIComponents associated with this component.
getChildren() - Method in class javax.faces.component.UIComponentBase

getChildrenConcepts() - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Gets all immediate children Concepts.
getChildrenConcepts() - Method in interface javax.xml.registry.infomodel.Concept
Gets all immediate children Concepts.
getChildTargetModuleID() - Method in interface javax.enterprise.deploy.spi.TargetModuleID
Retrieve a list of identifiers of the children of this deployed module.
getCity() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns the city.
getClassFromScope(String) - Method in interface javax.enterprise.deploy.model.DeployableObject
Retrieve the specified class from this deployable module.
getClassifications() - Method in interface javax.xml.registry.infomodel.RegistryObject
Gets the Classification instances that classify this object.
getClassificationScheme() - Method in interface javax.xml.registry.infomodel.Classification
Gets the ClassificationScheme that is used in classifying the object.
getClassificationScheme() - Method in interface javax.xml.registry.infomodel.Concept
Gets the ClassificationScheme that this Concept is a descendent of.
getClassifiedObject() - Method in interface javax.xml.registry.infomodel.Classification
Gets the Object that is being classified.
getClassLoader() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns ClassLoader that the provider may use to load any classes, resources, or open URLs.
getClassName() - Method in class javax.mail.Provider
Returns name of the class that implements the protocol
getClassName() - Method in class javax.servlet.jsp.tagext.TagVariableInfo
The body of the <variable-class> element.
getClassName() - Method in class javax.servlet.jsp.tagext.VariableInfo
Returns the type of this variable.
getClientConfiguration(TargetModuleID) - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
Return the ClientConfiguration object associated with the TargetModuleID.
getClientId(FacesContext) - Method in class javax.faces.component.UIComponent
Return a client-side identifier for this component, generating one if necessary.
getClientId(FacesContext) - Method in class javax.faces.component.UIComponentBase

getClientId(FacesContext) - Method in class javax.faces.component.UIData
Return a client identifier for this component that includes the current value of the rowIndex property, if it is not set to -1.
getClientID() - Method in interface javax.jms.Connection
Gets the client identifier for this connection.
getClientIdsWithMessages() - Method in class javax.faces.context.FacesContext
Return an Iterator over the client identifiers for which at least one FacesMessage has been queued.
getCloseCount() - Method in interface javax.management.j2ee.statistics.JCAConnectionPoolStats
The number of connections closed
getCloseCount() - Method in interface javax.management.j2ee.statistics.JDBCConnectionPoolStats
Number of connections closed.
getCollection() - Method in interface javax.xml.registry.BulkResponse
Get the Collection of objects returned as a response of a bulk operation.
getCols() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the cols property.
getColumnClasses() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the columnClasses property.
getColumnClasses() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the columnClasses property.
getColumnNumber() - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl

getColumnNumber() - Method in interface javax.xml.bind.ValidationEventLocator
Return the column number if available
getColumnNumber() - Method in interface javax.xml.stream.Location
Return the column number where the current event ends, returns -1 if none is available.
getColumns() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the columns property.
getCommand(String, String) - Method in class javax.activation.CommandMap
Get the default command corresponding to the MIME type.
getCommand(String, String, DataSource) - Method in class javax.activation.CommandMap
Get the default command corresponding to the MIME type.
getCommand(String) - Method in class javax.activation.DataHandler
Get the command cmdName.
getCommand(String, String) - Method in class javax.activation.MailcapCommandMap
Get the command corresponding to cmdName for the MIME type.
getCommand() - Method in interface javax.enterprise.deploy.spi.status.DeploymentStatus
Retrieve the deployment CommandType of this event.
getCommandClass() - Method in class javax.activation.CommandInfo
Return the command's class name.
getCommandName() - Method in class javax.activation.CommandInfo
Return the command verb.
getCommandObject(DataHandler, ClassLoader) - Method in class javax.activation.CommandInfo
Return the instantiated JavaBean component.
getCommandType(int) - Static method in class javax.enterprise.deploy.shared.CommandType
Return an object of the specified value.
getComment() - Method in class javax.servlet.http.Cookie
Returns the comment describing the purpose of this cookie, or null if the cookie has no comment.
getCommittedCount() - Method in interface javax.management.j2ee.statistics.JTAStats
Number of committed transactions.
getCommonPropertyType(ELContext, Object) - Method in class javax.el.ArrayELResolver
If the base object is a Java language array, returns the most general type that this resolver accepts for the property argument.
getCommonPropertyType(ELContext, Object) - Method in class javax.el.BeanELResolver
If the base object is not null, returns the most general type that this resolver accepts for the property argument.
getCommonPropertyType(ELContext, Object) - Method in class javax.el.CompositeELResolver
Returns the most general type that this resolver accepts for the property argument, given a base object.
getCommonPropertyType(ELContext, Object) - Method in class javax.el.ELResolver
Returns the most general type that this resolver accepts for the property argument, given a base object.
getCommonPropertyType(ELContext, Object) - Method in class javax.el.ListELResolver
If the base object is a list, returns the most general type that this resolver accepts for the property argument.
getCommonPropertyType(ELContext, Object) - Method in class javax.el.MapELResolver
If the base object is a map, returns the most general type that this resolver accepts for the property argument.
getCommonPropertyType(ELContext, Object) - Method in class javax.el.ResourceBundleELResolver
If the base object is a ResourceBundle, returns the most general type that this resolver accepts for the property argument.
getCommonPropertyType(ELContext, Object) - Method in class javax.servlet.jsp.el.ImplicitObjectELResolver
If the base object is null, returns String.class.
getCommonPropertyType(ELContext, Object) - Method in class javax.servlet.jsp.el.ScopedAttributeELResolver
If the base object is null, returns String.class.
getComparison() - Method in class javax.mail.search.DateTerm
Return the type of comparison.
getComparison() - Method in class javax.mail.search.IntegerComparisonTerm
Return the type of comparison.
getComponent() - Method in class javax.faces.event.FacesEvent
Return the source UIComponent that sent this event.
getComponentInstance() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return the UIComponent instance that is associated with this tag instance.
getComponentInstance() - Method in class javax.faces.webapp.UIComponentTagBase
Return the UIComponent instance that is associated with this tag instance.
getComponentStateToRestore(FacesContext) - Method in class javax.faces.render.ResponseStateManager
Deprecated. This method has been replaced by ResponseStateManager.getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.
getComponentStateToSave(FacesContext) - Method in class javax.faces.application.StateManager
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
getComponentStateToSave(FacesContext) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.getComponentStateToSave(javax.faces.context.FacesContext) on the wrapped StateManager object.
getComponentType() - Method in class javax.faces.webapp.UIComponentTagBase
Return the component type for the component that is or will be bound to this tag.
getComponentTypes() - Method in class javax.faces.application.Application
Return an Iterator over the set of currently defined component types for this Application.
getConcept() - Method in interface javax.xml.registry.infomodel.Classification
Gets the Concept that is classifying the object.
getConnection() - Method in interface javax.resource.cci.ConnectionFactory
Gets a connection to an EIS instance.
getConnection(ConnectionSpec) - Method in interface javax.resource.cci.ConnectionFactory
Gets a connection to an EIS instance.
getConnection() - Method in interface javax.resource.cci.Interaction
Gets the Connection associated with the Interaction.
getConnection(Subject, ConnectionRequestInfo) - Method in interface javax.resource.spi.ManagedConnection
Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance.
getConnectionFactory() - Method in interface javax.management.j2ee.statistics.JCAConnectionStats
Returns the associated JCAConnectionFactory OBJECT_NAME
getConnectionHandle() - Method in class javax.resource.spi.ConnectionEvent
Get the connection handle associated with the Managed Connection instance.
getConnectionPools() - Method in interface javax.management.j2ee.statistics.JCAStats
Returns an array of JCAConnectionPool Stats that provide statistics about the connection pools associated with the referencing JCA resource statistics
getConnectionPools() - Method in interface javax.management.j2ee.statistics.JDBCStats

getConnections() - Method in interface javax.management.j2ee.statistics.JCAStats
Returns an array of JCAConnectionStats that provide statistics about the non-pooled connections associated with the referencing JCA resource statistics
getConnections() - Method in interface javax.management.j2ee.statistics.JDBCStats

getConnections() - Method in interface javax.management.j2ee.statistics.JMSStats
Returns an array of JMSConnectionStats that provide statistics about the connections associated with the referencing JMS resource.
getConsumers() - Method in interface javax.management.j2ee.statistics.JMSSessionStats
Returns an array of JMSConsumerStats that provide statistics about the message consumers associated with the referencing JMS session statistics.
getContainerClientId(FacesContext) - Method in class javax.faces.component.UIComponent
Allow components that implement NamingContainer to selectively disable prepending their clientId to their descendent's clientIds by breaking the prepending logic into a seperately callable method.
getContainerClientId(FacesContext) - Method in class javax.faces.component.UIForm
Override the UIComponent.getContainerClientId(javax.faces.context.FacesContext) to allow users to disable this form from prepending its clientId to its descendent's clientIds depending on the value of this form's UIForm.isPrependId() property.
getContent(DataSource) - Method in interface javax.activation.DataContentHandler
Return an object representing the data in its most preferred form.
getContent() - Method in class javax.activation.DataHandler
Return the data in its preferred Object form.
getContent() - Method in class javax.mail.internet.MimeBodyPart
Return the content as a Java object.
getContent() - Method in class javax.mail.internet.MimeMessage
Return the content as a Java object.
getContent() - Method in interface javax.mail.Part
Return the content as a Java object.
getContent() - Method in class javax.xml.soap.AttachmentPart
Gets the content of this AttachmentPart object as a Java object.
getContent() - Method in class javax.xml.soap.SOAPPart
Returns the content of the SOAPEnvelope as a JAXP Source object.
getContentDescription() - Method in class javax.xml.soap.SOAPMessage
Retrieves a description of this SOAPMessage object's content.
getContentID() - Method in class javax.mail.internet.MimeBodyPart
Returns the value of the "Content-ID" header field.
getContentID() - Method in class javax.mail.internet.MimeMessage
Returns the value of the "Content-ID" header field.
getContentID() - Method in interface javax.mail.internet.MimePart
Get the Content-ID of this part.
getContentId() - Method in class javax.xml.soap.AttachmentPart
Gets the value of the MIME header whose name is "Content-ID".
getContentId() - Method in class javax.xml.soap.SOAPPart
Retrieves the value of the MIME header whose name is "Content-Id".
getContentLanguage() - Method in class javax.mail.internet.MimeBodyPart
Get the languages specified in the Content-Language header of this MimePart.
getContentLanguage() - Method in class javax.mail.internet.MimeMessage
Get the languages specified in the "Content-Language" header field of this message.
getContentLanguage() - Method in interface javax.mail.internet.MimePart
Get the language tags specified in the Content-Language header of this MimePart.
getContentLength() - Method in interface javax.servlet.ServletRequest
Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.
getContentLength() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getContentLength() on the wrapped request object.
getContentLocation() - Method in class javax.xml.soap.AttachmentPart
Gets the value of the MIME header whose name is "Content-Location".
getContentLocation() - Method in class javax.xml.soap.SOAPPart
Retrieves the value of the MIME header whose name is "Content-Location".
getContentMD5() - Method in class javax.mail.internet.MimeBodyPart
Return the value of the "Content-MD5" header field.
getContentMD5() - Method in class javax.mail.internet.MimeMessage
Return the value of the "Content-MD5" header field.
getContentMD5() - Method in interface javax.mail.internet.MimePart
Get the Content-MD5 digest of this part.
getContentStream() - Method in class javax.mail.internet.MimeBodyPart
Produce the raw bytes of the content.
getContentStream() - Method in class javax.mail.internet.MimeMessage
Produce the raw bytes of the content.
getContentType() - Method in class javax.activation.DataHandler
Return the MIME type of this object as retrieved from the source object.
getContentType() - Method in interface javax.activation.DataSource
This method returns the MIME type of the data in the form of a string.
getContentType() - Method in class javax.activation.FileDataSource
This method returns the MIME type of the data in the form of a string.
getContentType(File) - Method in class javax.activation.FileTypeMap
Return the type of the file object.
getContentType(String) - Method in class javax.activation.FileTypeMap
Return the type of the file passed in.
getContentType(File) - Method in class javax.activation.MimetypesFileTypeMap
Return the MIME type of the file object.
getContentType(String) - Method in class javax.activation.MimetypesFileTypeMap
Return the MIME type based on the specified file name.
getContentType() - Method in class javax.activation.URLDataSource
Returns the value of the URL content-type header field.
getContentType() - Method in class javax.faces.context.ResponseWriter
Return the content type (such as "text/html") for this ResponseWriter.
getContentType() - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.getContentType() on the wrapped ResponseWriter object.
getContentType() - Method in class javax.mail.internet.MimeBodyPart
Returns the value of the RFC 822 "Content-Type" header field.
getContentType() - Method in class javax.mail.internet.MimeMessage
Returns the value of the RFC 822 "Content-Type" header field.
getContentType() - Method in class javax.mail.internet.MimePartDataSource
Returns the content-type of this DataSource.
getContentType() - Method in class javax.mail.Multipart
Return the content-type of this Multipart.
getContentType() - Method in interface javax.mail.Part
Returns the Content-Type of the content of this part.
getContentType() - Method in class javax.mail.util.ByteArrayDataSource
Get the MIME content type of the data.
getContentType() - Method in interface javax.servlet.ServletRequest
Returns the MIME type of the body of the request, or null if the type is not known.
getContentType() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getContentType() on the wrapped request object.
getContentType() - Method in interface javax.servlet.ServletResponse
Returns the content type used for the MIME body sent in this response.
getContentType() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to return getContentType() on the wrapped response object.
getContentType() - Method in class javax.xml.soap.AttachmentPart
Gets the value of the MIME header whose name is "Content-Type".
getContext(Class) - Method in class javax.el.ELContext
Returns the context object associated with the given key.
getContext() - Method in class javax.faces.context.ExternalContext
Return the application environment object instance for the current appication.
getContext(String) - Static method in class javax.security.jacc.PolicyContext
This method may be used by a Policy provider to activate the PolicyContextHandler registered to the context object key and cause it to return the corresponding policy context object from the container.
getContext(String, Object) - Method in interface javax.security.jacc.PolicyContextHandler
This public method is used by the PolicyContext class to activate the handler and obtain from it the context object identified by the (case-sensitive) key.
getContext(String) - Method in interface javax.servlet.ServletContext
Returns a ServletContext object that corresponds to a specified URL on the server.
getContext() - Method in interface javax.xml.ws.Response
Gets the contained response context.
getContextData() - Method in interface javax.interceptor.InvocationContext
Returns the context data associated with this invocation or lifecycle callback.
getContextID() - Method in interface javax.security.jacc.PolicyConfiguration
This method returns this object's policy context identifier.
getContextID() - Static method in class javax.security.jacc.PolicyContext
This static method returns the value of the policy context identifier associated with the thread on which the accessor is called.
getContextPath() - Method in interface javax.servlet.http.HttpServletRequest
Returns the portion of the request URI that indicates the context of the request.
getContextPath() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getContextPath() on the wrapped request object.
getContextPath() - Method in interface javax.servlet.ServletContext
Returns the context path of the web application.
getConvertedValue(FacesContext, Object) - Method in class javax.faces.component.UIInput
Convert the submitted value into a "local value" of the appropriate data type, if necessary.
getConvertedValue(FacesContext, UIComponent, Object) - Method in class javax.faces.render.Renderer
Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered Converter for this component, if there is one).
getConverter() - Method in class javax.faces.component.UIOutput

getConverter() - Method in interface javax.faces.component.ValueHolder
Return the Converter (if any) that is registered for this UIComponent.
getConverterIds() - Method in class javax.faces.application.Application
Return an Iterator over the set of currently registered converter ids for this Application.
getConverterMessage() - Method in class javax.faces.component.UIInput
If there has been a call to UIInput.setConverterMessage(java.lang.String) on this instance, return the message.
getConverterTypes() - Method in class javax.faces.application.Application
Return an Iterator over the set of Class instances for which Converter classes have been explicitly registered.
getCookies() - Method in interface javax.servlet.http.HttpServletRequest
Returns an array containing all of the Cookie objects the client sent with this request.
getCookies() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getCookies() on the wrapped request object.
getCoords() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the coords property.
getCoords() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the coords property.
getCount() - Method in class javax.mail.internet.MimeMultipart
Return the number of enclosed BodyPart objects.
getCount() - Method in class javax.mail.Multipart
Return the number of enclosed BodyPart objects.
getCount() - Method in interface javax.mail.MultipartDataSource
Return the number of enclosed BodyPart objects.
getCount() - Method in interface javax.management.j2ee.statistics.CountStatistic
The count since the last reset.
getCount() - Method in interface javax.management.j2ee.statistics.TimeStatistic
Number of times the operation was invoked since the beginning of this measurement.
getCountry() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns the country.
getCountryCode() - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Gets the country code.
getCreateCount() - Method in interface javax.management.j2ee.statistics.EJBStats
Number of times create was called.
getCreateCount() - Method in interface javax.management.j2ee.statistics.JCAConnectionPoolStats
The number of connections created
getCreateCount() - Method in interface javax.management.j2ee.statistics.JDBCConnectionPoolStats
Number of connections created.
getCreated() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return true if we dynamically created a new component instance during execution of this tag.
getCreated() - Method in class javax.faces.webapp.UIComponentTagBase
Return true if we dynamically created a new component instance during execution of this tag.
getCreatedComponents() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Returns the List of UIComponent ids created or located by nested UIComponentTags while processing the current request.
getCreationTime() - Method in interface javax.servlet.http.HttpSession
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
getCredentialData() - Method in interface javax.resource.spi.security.GenericCredential
Deprecated. Gets security data for a specific security mechanism represented by the GenericCredential.
getCredentials() - Method in interface javax.xml.registry.Connection
Gets the credentials associated with this client.
getCurrencyCode() - Method in class javax.faces.convert.NumberConverter
Return the ISO 4217 currency code used by getAsString() with a type of currency.
getCurrencySymbol() - Method in class javax.faces.convert.NumberConverter
Return the currency symbol used by getAsString() with a type of currency.
getCurrent() - Method in interface javax.management.j2ee.statistics.RangeStatistic
The current value of this attribute.
getCurrentInstance() - Static method in class javax.faces.context.FacesContext
Return the FacesContext instance for the request that is being processed by the current thread, if any.
getCurrentLocale() - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Returns the active locale this implementation of javax.enterprise.deploy.spi subpackages is running.
getData() - Method in interface javax.xml.stream.events.Characters
Get the character data of this event
getData() - Method in interface javax.xml.stream.events.ProcessingInstruction
The data section of the processing instruction
getDataHandler() - Method in class javax.mail.internet.MimeBodyPart
Return a DataHandler for this body part's content.
getDataHandler() - Method in class javax.mail.internet.MimeMessage
Return a DataHandler for this Message's content.
getDataHandler() - Method in interface javax.mail.Part
Return a DataHandler for the content within this part.
getDataHandler() - Method in class javax.xml.soap.AttachmentPart
Gets the DataHandler object for this AttachmentPart object.
getDataModel() - Method in class javax.faces.component.UIData
Return the internal DataModel object representing the data objects that we will iterate over in this component's rendering.
getDataModel() - Method in class javax.faces.model.DataModelEvent
Return the DataModel that fired this event.
getDataModelListeners() - Method in class javax.faces.model.DataModel
Return the set of DataModelListeners interested in notifications from this DataModel.
getDataSource() - Method in class javax.activation.DataHandler
Return the DataSource associated with this instance of DataHandler.
getDate() - Method in class javax.mail.search.DateTerm
Return the Date to compare with.
getDateHeader(String) - Method in interface javax.servlet.http.HttpServletRequest
Returns the value of the specified request header as a long value that represents a Date object.
getDateHeader(String) - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.
getDateStyle() - Method in class javax.faces.convert.DateTimeConverter
Return the style to be used to format or parse dates.
getDConfigBean(DDBean) - Method in interface javax.enterprise.deploy.spi.DConfigBean
Return the JavaBean containing the server-specific deployment configuration information based upon the XML data provided by the DDBean.
getDConfigBean(DDBeanRoot) - Method in interface javax.enterprise.deploy.spi.DConfigBeanRoot
Return a DConfigBean for a deployment descriptor that is not the module's primary deployment descriptor.
getDConfigBeanRoot(DDBeanRoot) - Method in interface javax.enterprise.deploy.spi.DeploymentConfiguration
Returns the top level configuration bean, DConfigBeanRoot, associated with the deployment descriptor represented by the designated DDBeanRoot bean.
getDConfigBeanVersion() - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Returns the J2EE platform version number for which the configuration beans are provided.
getDConfigBeanVersionType(int) - Static method in class javax.enterprise.deploy.shared.DConfigBeanVersionType
Return an object of the specified value.
getDDBean() - Method in interface javax.enterprise.deploy.spi.DConfigBean
Return the JavaBean containing the deployment descriptor XML text associated with this DConfigBean.
getDDBeanRoot() - Method in interface javax.enterprise.deploy.model.DeployableObject
Return the top level standard bean representing the root of the deployment descriptor.
getDDBeanRoot(String) - Method in interface javax.enterprise.deploy.model.DeployableObject
Returns a DDBeanRoot object for the XML instance document named.
getDDBeanRootVersion() - Method in interface javax.enterprise.deploy.model.DDBeanRoot
Returns the version number of an XML instance document.
getDebug() - Method in class javax.mail.Session
Get the debug setting for this Session.
getDebugOut() - Method in class javax.mail.Session
Returns the stream to be used for debugging output.
getDeclaration() - Method in interface javax.xml.stream.events.EntityReference
Return the declaration of this entity.
getDeclarativeQueryManager() - Method in interface javax.xml.registry.RegistryService
Returns the DeclarativeQueryManager object implemented by the JAXR provider.
getDeclare() - Method in class javax.servlet.jsp.tagext.TagVariableInfo
The body of the <declare> element.
getDeclare() - Method in class javax.servlet.jsp.tagext.VariableInfo
Returns whether this is a new variable.
getDeclaredType() - Method in class javax.xml.bind.JAXBElement
Returns the Java binding of the xml element declaration's type attribute.
getDefaultCommandMap() - Static method in class javax.activation.CommandMap
Get the default CommandMap.
getDefaultDomain() - Method in interface javax.management.j2ee.Management
Returns the default domain name of this MEJB.
getDefaultFactory() - Static method in class javax.servlet.jsp.JspFactory
Returns the default factory for this implementation.
getDefaultFileTypeMap() - Static method in class javax.activation.FileTypeMap
Return the default FileTypeMap for the system.
getDefaultFolder() - Method in class javax.mail.Store
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.
getDefaultInstance(Properties, Authenticator) - Static method in class javax.mail.Session
Get the default Session object.
getDefaultInstance(Properties) - Static method in class javax.mail.Session
Get the default Session object.
getDefaultJavaCharset() - Static method in class javax.mail.internet.MimeUtility
Get the default charset corresponding to the system's current default locale.
getDefaultLocale() - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Returns the default locale supported by this implementation of javax.enterprise.deploy.spi subpackages.
getDefaultLocale() - Method in class javax.faces.application.Application
Return the default Locale for this application.
getDefaultPostalScheme() - Method in interface javax.xml.registry.RegistryService
Gets the default user-defined postal scheme for codifying the attributes of PostalAddress.
getDefaultRenderKitId() - Method in class javax.faces.application.Application
Return the renderKitId to be used for rendering this application.
getDefaultTypeMapping() - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Gets the registered default TypeMapping instance.
getDefaultUserName() - Method in class javax.mail.Authenticator

getDelegate() - Method in interface javax.persistence.EntityManager
Return the underlying provider object for the EntityManager, if available.
getDeletedMessageCount() - Method in class javax.mail.Folder
Get the number of deleted messages in this Folder.
getDeliveryMode() - Method in interface javax.jms.MessageProducer
Gets the producer's default delivery mode.
getDeployableObject() - Method in interface javax.enterprise.deploy.model.DDBeanRoot
Return the containing DeployableObject
getDeployableObject(String) - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Return the DeployableObject of the specified URI designator.
getDeployableObject() - Method in interface javax.enterprise.deploy.spi.DeploymentConfiguration
Returns an object that provides access to the deployment descriptor data and classes of a J2EE module.
getDeployableObjects(ModuleType) - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Return the all DeployableObjects of the specified type.
getDeployableObjects() - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Return the all DeployableObjects in this application.
getDeploymentFactories() - Method in class javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
Retrieve the lists of currently registered DeploymentFactories.
getDeploymentManager(String, String, String) - Method in class javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
Retrieves a DeploymentManager instance to use for deployment.
getDeploymentManager(String, String, String) - Method in interface javax.enterprise.deploy.spi.factories.DeploymentFactory
Return a connected DeploymentManager instance.
getDeploymentStatus() - Method in class javax.enterprise.deploy.spi.status.ProgressEvent
Retrieve the status information.
getDeploymentStatus() - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
Retrieve the status of this activity.
getDescendantConcepts() - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Gets all descendant Concepts.
getDescendantConcepts() - Method in interface javax.xml.registry.infomodel.Concept
Gets all descendant Concepts.
getDescendantOrganizations() - Method in interface javax.xml.registry.infomodel.Organization
Gets all descendant Organizations.
getDescription() - Method in interface javax.enterprise.deploy.spi.Target
Retrieve other descriptive information about the target.
getDescription() - Method in class javax.faces.model.SelectItem
Return a description of this item, for use in development tools.
getDescription() - Method in class javax.mail.internet.MimeBodyPart
Returns the "Content-Description" header field of this body part.
getDescription() - Method in class javax.mail.internet.MimeMessage
Returns the "Content-Description" header field of this Message.
getDescription() - Method in interface javax.mail.Part
Return a description String for this part.
getDescription() - Method in interface javax.management.j2ee.statistics.Statistic
A human-readable description of the Statistic.
getDescription() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Gets the description string of this tag attribute.
getDescription() - Method in interface javax.xml.registry.infomodel.RegistryObject
Gets the textual description for this object.
getDeserializer(Class, QName) - Method in interface javax.xml.rpc.encoding.TypeMapping
Gets the DeserializerFactory registered for the specified pair of Java type and XML data type.
getDeserializerAs(String) - Method in interface javax.xml.rpc.encoding.DeserializerFactory
Returns a Deserializer for the specified XML processing mechanism type.
getDestination() - Method in interface javax.jms.MessageProducer
Gets the destination associated with this MessageProducer.
getDestination() - Method in interface javax.management.j2ee.statistics.JMSProducerStats
Returns a string that encapsulates the identity of the message destination
getDetail() - Method in class javax.faces.application.FacesMessage
Return the localized detail text.
getDetail() - Method in exception javax.xml.rpc.soap.SOAPFaultException
Gets the detail element.
getDetail() - Method in interface javax.xml.soap.SOAPFault
Returns the optional detail element for this SOAPFault object.
getDetailEntries() - Method in interface javax.xml.soap.Detail
Gets an Iterator over all of the DetailEntrys in this Detail object.
getDir() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlForm
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlOutputFormat
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlOutputText
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the dir property.
getDir() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the dir property.
getDisabledClass() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the disabledClass property.
getDisabledClass() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the disabledClass property.
getDisabledClass() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the disabledClass property.
getDisabledClass() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the disabledClass property.
getDisabledClass() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the disabledClass property.
getDisabledClass() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the disabledClass property.
getDisableMessageID() - Method in interface javax.jms.MessageProducer
Gets an indication of whether message IDs are disabled.
getDisableMessageTimestamp() - Method in interface javax.jms.MessageProducer
Gets an indication of whether message timestamps are disabled.
getDisconnectedDeploymentManager(String) - Method in class javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
Return a disconnected DeploymentManager instance.
getDisconnectedDeploymentManager(String) - Method in interface javax.enterprise.deploy.spi.factories.DeploymentFactory
Return a disconnected DeploymentManager instance.
getDisplayName() - Method in interface javax.enterprise.deploy.spi.factories.DeploymentFactory
Provide a string with the name of this vendor's DeploymentManager.
getDisplayName() - Method in class javax.servlet.jsp.tagext.TagInfo
Get the displayName.
getDisposition() - Method in class javax.mail.internet.ContentDisposition
Return the disposition value.
getDisposition() - Method in class javax.mail.internet.MimeBodyPart
Returns the value of the "Content-Disposition" header field.
getDisposition() - Method in class javax.mail.internet.MimeMessage
Returns the value of the "Content-Disposition" header field.
getDisposition() - Method in interface javax.mail.Part
Return the disposition of this part.
getDoAfterBodyValue() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return the flag value that should be returned from the doAfterBody() method when it is called.
getDocumentTypeDeclaration() - Method in interface javax.xml.stream.events.DTD
Returns the entire Document Type Declaration as a string, including the internal DTD subset.
getDoEndValue() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return the flag value that should be returned from the doEnd() method when it is called.
getDomain() - Method in class javax.servlet.http.Cookie
Returns the domain name set for this cookie.
getDoStartValue() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return the flag value that should be returned from the doStart() method when it is called.
getDouble(String) - Method in interface javax.jms.MapMessage
Returns the double value with the specified name.
getDoubleProperty(String) - Method in interface javax.jms.Message
Returns the value of the double property with the specified name.
getDTDType() - Method in interface javax.xml.stream.events.Attribute
Gets the type of this attribute, default is the String "CDATA"
getDurableSubscriptionCount() - Method in interface javax.management.j2ee.statistics.JMSSessionStats
Number of durable subscriptions.
getEISProductName() - Method in interface javax.resource.cci.ConnectionMetaData
Returns product name of the underlying EIS instance connected through the Connection that produced this metadata.
getEISProductName() - Method in interface javax.resource.spi.ManagedConnectionMetaData
Returns Product name of the underlying EIS instance connected through the ManagedConnection.
getEISProductVersion() - Method in interface javax.resource.cci.ConnectionMetaData
Returns product version of the underlying EIS instance.
getEISProductVersion() - Method in interface javax.resource.spi.ManagedConnectionMetaData
Returns product version of the underlying EIS instance connected through the ManagedConnection.
getEJBHome() - Method in interface javax.ejb.EJBContext
Obtain the enterprise bean's remote home interface.
getEJBHome() - Method in interface javax.ejb.EJBMetaData
Obtain the remote home interface of the enterprise Bean.
getEJBHome() - Method in interface javax.ejb.EJBObject
Obtain the enterprise Bean's remote home interface.
getEJBHome() - Method in interface javax.ejb.HomeHandle
Obtain the home object represented by this handle.
getEJBLocalHome() - Method in interface javax.ejb.EJBContext
Obtain the enterprise bean's local home interface.
getEJBLocalHome() - Method in interface javax.ejb.EJBLocalObject
Obtain the enterprise Bean's local home interface.
getEJBLocalObject() - Method in interface javax.ejb.EntityContext
Obtain a reference to the EJB local object that is currently associated with the instance.
getEJBLocalObject() - Method in interface javax.ejb.SessionContext
Obtain a reference to the EJB local object that is associated with the instance.
getEJBMetaData() - Method in interface javax.ejb.EJBHome
Obtain the EJBMetaData interface for the enterprise Bean.
getEJBObject() - Method in interface javax.ejb.EntityContext
Obtain a reference to the EJB object that is currently associated with the instance.
getEJBObject() - Method in interface javax.ejb.Handle
Obtain the EJB object reference represented by this handle.
getEJBObject() - Method in interface javax.ejb.SessionContext
Obtain a reference to the EJB object that is currently associated with the instance.
getELContext() - Method in class javax.el.ELContextEvent
Returns the ELContext that was created.
getELContext() - Method in class javax.faces.context.FacesContext
Return the ELContext instance for this FacesContext instance.
getELContext() - Method in class javax.faces.webapp.UIComponentELTag
Return the ELContext for the FacesContext for this request.
getELContext() - Method in class javax.faces.webapp.UIComponentTagBase
Return the ELContext for the FacesContext for this request.
getELContext() - Method in class javax.servlet.jsp.JspContext
Returns the ELContext associated with this JspContext.
getELContextListeners() - Method in class javax.faces.application.Application
If no calls have been made to Application.addELContextListener(javax.el.ELContextListener), this method must return an empty array.
getElement(ResultT) - Method in interface javax.xml.bind.annotation.DomHandler
Once the portion is sent to the Result.
getElement(DOMResult) - Method in class javax.xml.bind.annotation.W3CDomHandler

getElementName(Object) - Method in class javax.xml.bind.JAXBIntrospector
Get xml element qname for jaxbElement.
getElementName() - Method in interface javax.xml.soap.SOAPElement
Returns the name of this SOAPElement object.
getElementQName() - Method in interface javax.xml.soap.SOAPElement
Returns the qname of this SOAPElement object.
getElementText() - Method in class javax.xml.stream.util.EventReaderDelegate

getElementText() - Method in class javax.xml.stream.util.StreamReaderDelegate

getElementText() - Method in interface javax.xml.stream.XMLEventReader
Reads the content of a text-only element.
getElementText() - Method in interface javax.xml.stream.XMLStreamReader
Reads the content of a text-only element, an exception is thrown if this is not a text-only element.
getELResolver() - Method in class javax.el.ELContext
Retrieves the ELResolver associated with this context.
getELResolver() - Method in class javax.faces.application.Application
Return the singleton ELResolver instance to be used for all EL resolution.
getEmailAddresses() - Method in interface javax.xml.registry.infomodel.User
Gets the email addresses for this User.
getEnabledClass() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the enabledClass property.
getEnabledClass() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the enabledClass property.
getEnabledClass() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the enabledClass property.
getEnabledClass() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the enabledClass property.
getEnabledClass() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the enabledClass property.
getEnabledClass() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the enabledClass property.
getEnclosingWriter() - Method in class javax.servlet.jsp.tagext.BodyContent
Get the enclosing JspWriter.
getEncoding() - Method in class javax.mail.internet.MimeBodyPart
Returns the content transfer encoding from the "Content-Transfer-Encoding" header field.
getEncoding() - Method in class javax.mail.internet.MimeMessage
Returns the content transfer encoding from the "Content-Transfer-Encoding" header field.
getEncoding() - Method in interface javax.mail.internet.MimePart
Get the transfer encoding of this part.
getEncoding(DataSource) - Static method in class javax.mail.internet.MimeUtility
Get the content-transfer-encoding that should be applied to the input stream of this datasource, to make it mailsafe.
getEncoding(DataHandler) - Static method in class javax.mail.internet.MimeUtility
Same as getEncoding(DataSource) except that instead of reading the data from an InputStream it uses the writeTo method to examine the data.
getEncoding() - Method in class javax.mail.internet.PreencodedMimeBodyPart
Returns the content transfer encoding specified when this object was created.
getEncoding() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for getting the current output encoding.
getEncoding() - Method in class javax.xml.stream.util.StreamReaderDelegate

getEncoding() - Method in interface javax.xml.stream.XMLStreamReader
Return input encoding if known or null if unknown.
getEncodingStyle() - Method in interface javax.xml.soap.SOAPElement
Returns the encoding style for this SOAPElement object.
getEnctype() - Method in class javax.faces.component.html.HtmlForm
Return the value of the enctype property.
getEngineInfo() - Method in class javax.servlet.jsp.JspFactory
called to get implementation-specific information on the current JSP engine.
getEntities() - Method in interface javax.xml.stream.events.DTD
Return a List containing the general entities, both external and internal, declared in the DTD.
getEntity() - Method in exception javax.persistence.OptimisticLockException
Returns the entity that caused this exception.
getEntry(String) - Method in interface javax.enterprise.deploy.model.DeployableObject
Returns the InputStream for the given entry name The file name must be relative to the root of the module.
getEnumeration() - Method in interface javax.jms.QueueBrowser
Gets an enumeration for browsing the current queue messages in the order they would be received.
getEnumValueTable() - Method in class javax.enterprise.deploy.shared.ActionType
Returns the enumeration value table for class ActionType
getEnumValueTable() - Method in class javax.enterprise.deploy.shared.CommandType
Returns the enumeration value table for class CommandType
getEnumValueTable() - Method in class javax.enterprise.deploy.shared.DConfigBeanVersionType
Returns the enumeration value table for class DConfigBeanVersionType
getEnumValueTable() - Method in class javax.enterprise.deploy.shared.ModuleType
Returns the enumeration value table for class ModuleType
getEnumValueTable() - Method in class javax.enterprise.deploy.shared.StateType
Returns the enumeration value table for class StateType
getEnvelope() - Method in class javax.xml.soap.SOAPPart
Gets the SOAPEnvelope object associated with this SOAPPart object.
getEnvironment() - Method in interface javax.ejb.EJBContext
Deprecated. Use the JNDI naming context java:comp/env to access enterprise bean's environment.
getErrorClass() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the errorClass property.
getErrorClass() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the errorClass property.
getErrorCode() - Method in exception javax.jms.JMSException
Gets the vendor-specific error code.
getErrorCode() - Method in exception javax.resource.ResourceException
Get the error code.
getErrorCode() - Method in exception javax.xml.bind.JAXBException
Get the vendor specific error code
getErrorCode() - Method in exception javax.xml.bind.TypeConstraintException
Get the vendor specific error code
getErrorData() - Method in class javax.servlet.jsp.PageContext
Provides convenient access to error information.
getErrorObjectKey() - Method in exception javax.xml.registry.RegistryException
Gets the Key to the first object that encountered an error in the registry.
getErrorStyle() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the errorStyle property.
getErrorStyle() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the errorStyle property.
getEventAllocator() - Method in class javax.xml.stream.XMLInputFactory
Gets the allocator used by streams created with this factory
getEventHandler() - Method in class javax.xml.bind.Binder
Return the current event handler or the default event handler if one hasn't been set.
getEventHandler() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

getEventHandler() - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Return the current event handler or the default event handler if one hasn't been set.
getEventHandler() - Method in interface javax.xml.bind.Marshaller
Return the current event handler or the default event handler if one hasn't been set.
getEventHandler() - Method in interface javax.xml.bind.Unmarshaller
Return the current event handler or the default event handler if one hasn't been set.
getEventHandler() - Method in interface javax.xml.bind.Validator
Deprecated. since JAXB2.0
getEvents() - Method in class javax.xml.bind.util.ValidationEventCollector
Return an array of ValidationEvent objects containing a copy of each of the collected errors and warnings.
getEventType() - Method in interface javax.xml.registry.infomodel.AuditableEvent
Gets the type of this event.
getEventType() - Method in interface javax.xml.stream.events.XMLEvent
Returns an integer code for this event.
getEventType() - Method in class javax.xml.stream.util.StreamReaderDelegate

getEventType() - Method in interface javax.xml.stream.XMLStreamReader
Returns an integer code that indicates the type of the event the cursor is pointing to.
getException() - Method in class javax.resource.spi.ConnectionEvent
Get the exception.
getException() - Method in class javax.resource.spi.work.WorkEvent
Return the WorkException.
getException() - Method in class javax.servlet.jsp.PageContext
The current value of the exception object (an Exception).
getException() - Method in error javax.xml.stream.FactoryConfigurationError
Return the nested exception (if any)
getExceptionListener() - Method in interface javax.jms.Connection
Gets the ExceptionListener object for this connection.
getExceptions() - Method in interface javax.xml.registry.BulkResponse
Get the Collection of RegistryException instances in case of partial commit.
getExecutor() - Method in class javax.xml.ws.Endpoint
Returns the executor for this Endpointinstance.
getExecutor() - Method in class javax.xml.ws.Service
Returns the executor for this Serviceinstance.
getExecutor() - Method in class javax.xml.ws.spi.ServiceDelegate
Returns the executor for this Serviceinstance.
getExpectedType() - Method in class javax.el.ValueExpression
Returns the type the result of the expression will be coerced to after evaluation.
getExpectedTypeName() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Returns the name of the expected type (as a String) of this deferred value attribute.
getExpiration() - Method in interface javax.xml.registry.infomodel.RegistryEntry
Gets expirationDate attribute of the RegistryEntry within the Registry.
getExpiredMessageCount() - Method in interface javax.management.j2ee.statistics.JMSEndpointStats
Number of messages that expired before delivery.
getExpiredMessageCount() - Method in interface javax.management.j2ee.statistics.JMSSessionStats
Number of expired messages.
getExpressionEvaluator() - Method in class javax.servlet.jsp.JspContext
Deprecated. As of JSP 2.1, replaced by JspApplicationContext.getExpressionFactory()
getExpressionFactory() - Method in class javax.faces.application.Application
Return the ExpressionFactory instance for this application.
getExpressionFactory() - Method in interface javax.servlet.jsp.JspApplicationContext
Returns a factory used to create ValueExpressions and MethodExpressions so that EL expressions can be parsed and evaluated.
getExpressionString() - Method in class javax.el.Expression
Returns the original String used to create this Expression, unmodified.
getExpressionString() - Method in class javax.faces.el.MethodBinding
Deprecated. Return the (possibly null) expression String, with leading and trailing delimiters, from which this MethodBinding was built.
getExpressionString() - Method in class javax.faces.el.ValueBinding
Deprecated. Return the (possibly null) expression String, including the delimiters, from which this ValueBinding was built.
getExtension() - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Gets the internal extension.
getExternalContext() - Method in class javax.faces.context.FacesContext
Return the ExternalContext instance for this FacesContext instance.
getExternalIdentifiers() - Method in interface javax.xml.registry.infomodel.RegistryObject
Returns the ExternalIdentifiers associated with this object that are external identifiers for this object.
getExternalLinks() - Method in interface javax.xml.registry.infomodel.RegistryObject
Returns the ExternalLinks associated with this object.
getExternalURI() - Method in interface javax.xml.registry.infomodel.ExternalLink
Gets URI to the an external resource.
getFacesContext() - Method in class javax.faces.component.UIComponent
Convenience method to return the FacesContext instance for the current request.
getFacesContext() - Method in class javax.faces.component.UIComponentBase

getFacesContext(Object, Object, Object, Lifecycle) - Method in class javax.faces.context.FacesContextFactory
Create (if needed) and return a FacesContext instance that is initialized for the processing of the specified request and response objects, utilizing the specified Lifecycle instance, for this web application.
getFacesContext() - Method in class javax.faces.event.PhaseEvent
Return the FacesContext for the request being processed.
getFacesContext() - Method in class javax.faces.webapp.UIComponentClassicTagBase

getFacesContext() - Method in class javax.faces.webapp.UIComponentTagBase
Return the FacesContext instance for the current request.
getFacesJspId() - Method in class javax.faces.webapp.UIComponentClassicTagBase
If this method has been called before on this tag's useful lifetime (before UIComponentClassicTagBase.release() was called), return the previously returned value.
getFacesListeners(Class) - Method in class javax.faces.component.UIComponent
Return an array of registered FacesListeners that are instances of the specified class.
getFacesListeners(Class) - Method in class javax.faces.component.UIComponentBase

getFacesMessage() - Method in exception javax.faces.convert.ConverterException
Returns the FacesMessage associated with this exception; this will only be available if the converter that thew this exception instance placed it there.
getFacesMessage() - Method in exception javax.faces.validator.ValidatorException
Returns the FacesMessage associated with the exception.
getFacet(String) - Method in class javax.faces.component.UIComponent
Convenience method to return the named facet, if it exists, or null otherwise.
getFacet(String) - Method in class javax.faces.component.UIComponentBase

getFacetCount() - Method in class javax.faces.component.UIComponent
Return the number of facet UIComponents that are associated with this UIComponent.
getFacetCount() - Method in class javax.faces.component.UIComponentBase

getFacetName() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return the facet name that we should be stored under, if any; otherwise, return null (indicating that we will be a child component).
getFacets() - Method in class javax.faces.component.UIComponent
Return a mutable Map representing the facet UIComponents associated with this UIComponent, keyed by facet name (which must be a String).
getFacets() - Method in class javax.faces.component.UIComponentBase

getFacetsAndChildren() - Method in class javax.faces.component.UIComponent
Return an Iterator over the facet followed by child UIComponents of this UIComponent.
getFacetsAndChildren() - Method in class javax.faces.component.UIComponentBase

getFactory(String) - Static method in class javax.faces.FactoryFinder
Create (if necessary) and return a per-web-application instance of the appropriate implementation class for the specified JavaServer Faces factory class, based on the discovery algorithm described in the class description.
getFamily() - Method in class javax.faces.component.UIColumn

getFamily() - Method in class javax.faces.component.UICommand

getFamily() - Method in class javax.faces.component.UIComponent
Return the identifier of the component family to which this component belongs.
getFamily() - Method in class javax.faces.component.UIData

getFamily() - Method in class javax.faces.component.UIForm

getFamily() - Method in class javax.faces.component.UIGraphic

getFamily() - Method in class javax.faces.component.UIInput

getFamily() - Method in class javax.faces.component.UIMessage

getFamily() - Method in class javax.faces.component.UIMessages

getFamily() - Method in class javax.faces.component.UINamingContainer

getFamily() - Method in class javax.faces.component.UIOutput

getFamily() - Method in class javax.faces.component.UIPanel

getFamily() - Method in class javax.faces.component.UIParameter

getFamily() - Method in class javax.faces.component.UISelectBoolean

getFamily() - Method in class javax.faces.component.UISelectItem

getFamily() - Method in class javax.faces.component.UISelectItems

getFamily() - Method in class javax.faces.component.UISelectMany

getFamily() - Method in class javax.faces.component.UISelectOne

getFamily() - Method in class javax.faces.component.UIViewRoot

getFatalClass() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the fatalClass property.
getFatalClass() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the fatalClass property.
getFatalStyle() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the fatalStyle property.
getFatalStyle() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the fatalStyle property.
getFault() - Method in interface javax.xml.soap.SOAPBody
Returns the SOAPFault object in this SOAPBody object.
getFault() - Method in exception javax.xml.ws.soap.SOAPFaultException
Gets the embedded SOAPFault instance.
getFaultActor() - Method in exception javax.xml.rpc.soap.SOAPFaultException
Gets the faultactor element.
getFaultActor() - Method in interface javax.xml.soap.SOAPFault
Gets the fault actor for this SOAPFault object.
getFaultCode() - Method in exception javax.xml.rpc.soap.SOAPFaultException
Gets the faultcode element.
getFaultCode() - Method in interface javax.xml.soap.SOAPFault
Gets the fault code for this SOAPFault object.
getFaultCodeAsName() - Method in interface javax.xml.soap.SOAPFault
Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object.
getFaultCodeAsQName() - Method in interface javax.xml.soap.SOAPFault
Gets the fault code for this SOAPFault object as a QName object.
getFaultNode() - Method in interface javax.xml.soap.SOAPFault
Returns the optional Node element value for this SOAPFault object.
getFaultReasonLocales() - Method in interface javax.xml.soap.SOAPFault
Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items.
getFaultReasonText(Locale) - Method in interface javax.xml.soap.SOAPFault
Returns the Reason Text associated with the given Locale.
getFaultReasonTexts() - Method in interface javax.xml.soap.SOAPFault
Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.
getFaultRole() - Method in interface javax.xml.soap.SOAPFault
Returns the optional Role element value for this SOAPFault object.
getFaultString() - Method in exception javax.xml.rpc.soap.SOAPFaultException
Gets the faultstring element.
getFaultString() - Method in interface javax.xml.soap.SOAPFault
Gets the fault string for this SOAPFault object.
getFaultStringLocale() - Method in interface javax.xml.soap.SOAPFault
Gets the locale of the fault string for this SOAPFault object.
getFaultSubcodes() - Method in interface javax.xml.soap.SOAPFault
Gets the Subcodes for this SOAPFault as an iterator over QNames.
getFeatureDescriptors(ELContext, Object) - Method in class javax.el.ArrayELResolver
Always returns null, since there is no reason to iterate through set set of all integers.
getFeatureDescriptors(ELContext, Object) - Method in class javax.el.BeanELResolver
If the base object is not null, returns an Iterator containing the set of JavaBeans properties available on the given object.
getFeatureDescriptors(ELContext, Object) - Method in class javax.el.CompositeELResolver
Returns information about the set of variables or properties that can be resolved for the given base object.
getFeatureDescriptors(ELContext, Object) - Method in class javax.el.ELResolver
Returns information about the set of variables or properties that can be resolved for the given base object.
getFeatureDescriptors(ELContext, Object) - Method in class javax.el.ListELResolver
Always returns null, since there is no reason to iterate through set set of all integers.
getFeatureDescriptors(ELContext, Object) - Method in class javax.el.MapELResolver
If the base object is a map, returns an Iterator containing the set of keys available in the Map.
getFeatureDescriptors(ELContext, Object) - Method in class javax.el.ResourceBundleELResolver
If the base object is a ResourceBundle, returns an Iterator containing the set of keys available in the ResourceBundle.
getFeatureDescriptors(ELContext, Object) - Method in class javax.servlet.jsp.el.ImplicitObjectELResolver
If the base object is null, and the property matches the name of a JSP implicit object, returns an Iterator containing FeatureDescriptor objects with information about each JSP implicit object resolved by this resolver.
getFeatureDescriptors(ELContext, Object) - Method in class javax.servlet.jsp.el.ScopedAttributeELResolver
If the base object is null, returns an Iterator containing FeatureDescriptor objects with information about each scoped attribute resolved by this resolver.
getFile() - Method in class javax.activation.FileDataSource
Return the File object that corresponds to this FileDataSource.
getFile() - Method in class javax.mail.URLName
Returns the file name of this URLName.
getFilename() - Method in interface javax.enterprise.deploy.model.DDBeanRoot
Returns the filename relative to the root of the module of the XML instance document this DDBeanRoot represents.
getFileName() - Method in class javax.mail.internet.MimeBodyPart
Get the filename associated with this body part.
getFileName() - Method in class javax.mail.internet.MimeMessage
Get the filename associated with this Message.
getFileName() - Method in interface javax.mail.Part
Get the filename associated with this part, if possible.
getFilterName() - Method in interface javax.servlet.FilterConfig
Returns the filter-name of this filter as defined in the deployment descriptor.
getFirst() - Method in class javax.faces.component.UIData
Return the zero-relative row number of the first row to be displayed.
getFirstName() - Method in interface javax.xml.registry.infomodel.PersonName
Gets the first name for this Person.
getFlags() - Method in class javax.mail.internet.MimeMessage
Return a Flags object containing the flags for this message.
getFlags() - Method in class javax.mail.Message
Returns a Flags object containing the flags for this message.
getFlags() - Method in class javax.mail.search.FlagTerm
Return the Flags to test.
getFloat(String) - Method in interface javax.jms.MapMessage
Returns the float value with the specified name.
getFloatProperty(String) - Method in interface javax.jms.Message
Returns the value of the float property with the specified name.
getFlushMode() - Method in interface javax.persistence.EntityManager
Get the flush mode that applies to all objects contained in the persistence context.
getFolder() - Method in class javax.mail.event.FolderEvent
Return the affected folder.
getFolder(String) - Method in class javax.mail.Folder
Return the Folder object corresponding to the given name.
getFolder() - Method in exception javax.mail.FolderClosedException
Returns the dead Folder object
getFolder() - Method in exception javax.mail.FolderNotFoundException
Returns the offending Folder object.
getFolder() - Method in class javax.mail.Message
Get the folder from which this message was obtained.
getFolder() - Method in exception javax.mail.ReadOnlyFolderException
Returns the dead Folder object.
getFolder(URLName) - Method in class javax.mail.Session
Get a closed Folder object for the given URLName.
getFolder(String) - Method in class javax.mail.Store
Return the Folder object corresponding to the given name.
getFolder(URLName) - Method in class javax.mail.Store
Return a closed Folder object, corresponding to the given URLName.
getFooter() - Method in class javax.faces.component.UIColumn
Return the footer facet of the column (if any).
getFooter() - Method in class javax.faces.component.UIData
Return the footer facet of this component (if any).
getFooterClass() - Method in class javax.faces.component.html.HtmlColumn
Return the value of the footerClass property.
getFooterClass() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the footerClass property.
getFooterClass() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the footerClass property.
getFor() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the for property.
getFor() - Method in class javax.faces.component.UIMessage
Return the client identifier of the component for which this component represents associated message(s) (if any).
getFormatId() - Method in interface javax.transaction.xa.Xid
Obtain the format identifier part of the XID.
getFrame() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the frame property.
getFrame() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the frame property.
getFreePoolSize() - Method in interface javax.management.j2ee.statistics.JCAConnectionPoolStats
The number of free connections in the pool
getFreePoolSize() - Method in interface javax.management.j2ee.statistics.JDBCConnectionPoolStats
Number of free connections in the pool.
getFrom() - Method in class javax.mail.internet.MimeMessage
Returns the value of the RFC 822 "From" header fields.
getFrom() - Method in class javax.mail.Message
Returns the "From" attribute.
getFullName() - Method in class javax.mail.Folder
Returns the full name of this Folder.
getFullName() - Method in interface javax.xml.registry.infomodel.PersonName
Gets the fully formatted name for this person.
getFunction(String) - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
Get the FunctionInfo for a given function name, looking through all the functions in this tag library.
getFunctionClass() - Method in class javax.servlet.jsp.tagext.FunctionInfo
The class of the function.
getFunctionMapper() - Method in class javax.el.ELContext
Retrieves the FunctionMapper associated with this ELContext.
getFunctions() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
An array describing the functions that are defined in this tag library.
getFunctionSignature() - Method in class javax.servlet.jsp.tagext.FunctionInfo
The signature of the function.
getGlobalTransactionId() - Method in interface javax.transaction.xa.Xid
Obtain the global transaction identifier part of XID as an array of bytes.
getGroup(boolean) - Method in class javax.mail.internet.InternetAddress
Return the members of a group address.
getHandle() - Method in interface javax.ejb.EJBObject
Obtain a handle for the EJB object.
getHandle() - Method in interface javax.ejb.Timer
Get a serializable handle to the timer.
getHandlerChain(QName) - Method in interface javax.xml.rpc.handler.HandlerRegistry
Gets the handler chain for the specified service endpoint.
getHandlerChain() - Method in interface javax.xml.ws.Binding
Gets a copy of the handler chain for a protocol binding instance.
getHandlerChain(PortInfo) - Method in interface javax.xml.ws.handler.HandlerResolver
Gets the handler chain for the specified port.
getHandlerClass() - Method in class javax.xml.rpc.handler.HandlerInfo
Gets the Handler class
getHandlerConfig() - Method in class javax.xml.rpc.handler.HandlerInfo
Gets the Handler configuration
getHandlerKeys() - Static method in class javax.security.jacc.PolicyContext
This method may be used to obtain the keys that identify the container specific context handlers registered by the container.
getHandlerRegistry() - Method in interface javax.xml.rpc.Service
Returns the configured HandlerRegistry instance for this Service instance.
getHandlerResolver() - Method in class javax.xml.ws.Service
Returns the configured handler resolver.
getHandlerResolver() - Method in class javax.xml.ws.spi.ServiceDelegate
Returns the configured handler resolver.
getHeader() - Method in class javax.faces.component.UIColumn
Return the header facet of the column (if any).
getHeader() - Method in class javax.faces.component.UIData
Return the header facet of this component (if any).
getHeader(String) - Method in class javax.mail.internet.InternetHeaders
Return all the values for the specified header.
getHeader(String, String) - Method in class javax.mail.internet.InternetHeaders
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.
getHeader(String) - Method in class javax.mail.internet.MimeBodyPart
Get all the headers for this header_name.
getHeader(String, String) - Method in class javax.mail.internet.MimeBodyPart
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.
getHeader(String) - Method in class javax.mail.internet.MimeMessage
Get all the headers for this header_name.
getHeader(String, String) - Method in class javax.mail.internet.MimeMessage
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.
getHeader(String, String) - Method in interface javax.mail.internet.MimePart
Get the values of all header fields available for this header, returned as a single String, with the values separated by the delimiter.
getHeader(String) - Method in interface javax.mail.Part
Get all the headers for this header name.
getHeader(String) - Method in interface javax.servlet.http.HttpServletRequest
Returns the value of the specified request header as a String.
getHeader(String) - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getHeader(String name) on the wrapped request object.
getHeader(String) - Method in class javax.xml.soap.MimeHeaders
Returns all of the values for the specified header as an array of String objects.
getHeader() - Method in interface javax.xml.soap.SOAPEnvelope
Returns the SOAPHeader object for this SOAPEnvelope object.
getHeaderClass() - Method in class javax.faces.component.html.HtmlColumn
Return the value of the headerClass property.
getHeaderClass() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the headerClass property.
getHeaderClass() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the headerClass property.
getHeaderName() - Method in class javax.mail.search.HeaderTerm
Return the name of the header to compare with.
getHeaderNames() - Method in class javax.mail.FetchProfile
Get the names of the header-fields set in this profile.
getHeaderNames() - Method in interface javax.servlet.http.HttpServletRequest
Returns an enumeration of all the header names this request contains.
getHeaderNames() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getHeaderNames() on the wrapped request object.
getHeaders(String) - Method in interface javax.servlet.http.HttpServletRequest
Returns all the values of the specified request header as an Enumeration of String objects.
getHeaders(String) - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getHeaders(String name) on the wrapped request object.
getHeaders() - Method in class javax.xml.rpc.handler.GenericHandler
Gets the header blocks processed by this Handler instance.
getHeaders() - Method in interface javax.xml.rpc.handler.Handler
Gets the header blocks that can be processed by this Handler instance.
getHeaders() - Method in class javax.xml.rpc.handler.HandlerInfo
Gets the header blocks processed by this Handler.
getHeaders() - Method in interface javax.xml.ws.handler.soap.SOAPHandler
Gets the header blocks that can be processed by this Handler instance.
getHeaders(QName, JAXBContext, boolean) - Method in interface javax.xml.ws.handler.soap.SOAPMessageContext
Gets headers that have a particular qualified name from the message in the message context.
getHeapSize() - Method in interface javax.management.j2ee.statistics.JVMStats
Size of the JVM's heap.
getHeight() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the height property.
getHighWaterMark() - Method in interface javax.management.j2ee.statistics.RangeStatistic
The highest value this attribute has held since the beginning of the measurement.
getHomeHandle() - Method in interface javax.ejb.EJBHome
Obtain a handle for the remote home object.
getHomeInterfaceClass() - Method in interface javax.ejb.EJBMetaData
Obtain the Class object for the enterprise Bean's remote home interface.
getHost() - Method in class javax.mail.internet.NewsAddress
Get the host.
getHost() - Method in class javax.mail.URLName
Returns the host of this URLName.
getHreflang() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the hreflang property.
getHreflang() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the hreflang property.
getHttpSession() - Method in interface javax.xml.rpc.server.ServletEndpointContext
The getHttpSession method returns the current HTTP session (as a javax.servlet.http.HTTPSession).
getHumanPresentableName() - Method in class javax.activation.ActivationDataFlavor
Return the Human Presentable name.
getId() - Method in interface javax.enterprise.deploy.model.DDBean
Returns a tool-specific reference for attribute ID on an element in the deployment descriptor.
getId() - Method in class javax.faces.component.UIComponent
Return the component identifier of this UIComponent.
getId() - Method in class javax.faces.component.UIComponentBase

getId() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return the id value assigned by the page author.
getId() - Method in class javax.resource.spi.ConnectionEvent
Get the type of event
getId() - Method in interface javax.servlet.http.HttpSession
Returns a string containing the unique identifier assigned to this session.
getId() - Method in class javax.servlet.jsp.tagext.TagData
The value of the tag's id attribute.
getId() - Method in class javax.servlet.jsp.tagext.TagSupport
The value of the id attribute of this tag; or null.
getId() - Method in class javax.servlet.jsp.tagext.ValidationMessage
Get the jsp:id.
getId() - Method in interface javax.xml.registry.infomodel.Key
Returns the unique Id of this key.
getIdAttribute(TagAttributeInfo[]) - Static method in class javax.servlet.jsp.tagext.TagAttributeInfo
Convenience static method that goes through an array of TagAttributeInfo objects and looks for "id".
getIdentificationScheme() - Method in interface javax.xml.registry.infomodel.ExternalIdentifier
Gets the ClassificationScheme that is used as the identification scheme for identifying this object.
getIds() - Method in interface javax.servlet.http.HttpSessionContext
Deprecated. As of Java Servlet API 2.1 with no replacement. This method must return an empty Enumeration and will be removed in a future version of this API.
getIgnoreCase() - Method in class javax.mail.search.StringTerm
Return true if we should ignore case when matching.
getImage() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the image property.
getImplementor() - Method in class javax.xml.ws.Endpoint
Returns the implementation object for this endpoint.
getIndexOfNextChildTag() - Method in class javax.faces.webapp.UIComponentClassicTagBase

getIndexOfNextChildTag() - Method in class javax.faces.webapp.UIComponentTagBase
Return the index of the next child to be added as a child of this tag.
getInfo() - Method in interface javax.ejb.Timer
Get the information associated with the timer at the time of creation.
getInfoClass() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the infoClass property.
getInfoClass() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the infoClass property.
getInfoString() - Method in class javax.servlet.jsp.tagext.TagInfo
The information string for the tag.
getInfoString() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
Information (documentation) for this TLD.
getInfoStyle() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the infoStyle property.
getInfoStyle() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the infoStyle property.
getInitParameter(String) - Method in class javax.faces.context.ExternalContext
Return the value of the specified application initialization parameter (if any).
getInitParameter(String) - Method in interface javax.servlet.FilterConfig
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
getInitParameter(String) - Method in class javax.servlet.GenericServlet
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
getInitParameter(String) - Method in interface javax.servlet.ServletConfig
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
getInitParameter(String) - Method in interface javax.servlet.ServletContext
Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.
getInitParameterMap() - Method in class javax.faces.context.ExternalContext
Return an immutable Map whose keys are the set of application initialization parameter names configured for this application, and whose values are the corresponding parameter values.
getInitParameterNames() - Method in interface javax.servlet.FilterConfig
Returns the names of the filter's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the filter has no initialization parameters.
getInitParameterNames() - Method in class javax.servlet.GenericServlet
Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters.
getInitParameterNames() - Method in interface javax.servlet.ServletConfig
Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters.
getInitParameterNames() - Method in interface javax.servlet.ServletContext
Returns the names of the context's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the context has no initialization parameters.
getInitParameters() - Method in class javax.servlet.jsp.tagext.TagLibraryValidator
Get the init parameters data as an immutable Map.
getInputStream() - Method in class javax.activation.DataHandler
Get the InputStream for this object.
getInputStream() - Method in interface javax.activation.DataSource
This method returns an InputStream representing the data and throws the appropriate exception if it can not do so.
getInputStream() - Method in class javax.activation.FileDataSource
This method will return an InputStream representing the the data and will throw an IOException if it can not do so.
getInputStream() - Method in class javax.activation.URLDataSource
The getInputStream method from the URL.
getInputStream() - Method in class javax.mail.internet.MimeBodyPart
Return a decoded input stream for this body part's "content".
getInputStream() - Method in class javax.mail.internet.MimeMessage
Return a decoded input stream for this Message's "content".
getInputStream() - Method in class javax.mail.internet.MimePartDataSource
Returns an input stream from this MimePart.
getInputStream() - Method in interface javax.mail.Part
Return an input stream for this part's "content".
getInputStream() - Method in class javax.mail.util.ByteArrayDataSource
Return an InputStream for the data.
getInputStream() - Method in class javax.servlet.jsp.tagext.PageData
Returns an input stream on the XML view of a JSP page.
getInputStream() - Method in interface javax.servlet.ServletRequest
Retrieves the body of the request as binary data using a ServletInputStream.
getInputStream() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getInputStream() on the wrapped request object.
getInstance() - Static method in class javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
Retrieve the Singleton DeploymentFactoryManager
getInstance(Properties, Authenticator) - Static method in class javax.mail.Session
Get a new Session object.
getInstance(Properties) - Static method in class javax.mail.Session
Get a new Session object.
getInt(String) - Method in interface javax.jms.MapMessage
Returns the int value with the specified name.
getInteractionSpecsSupported() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Returns an array of fully-qualified names of InteractionSpec types supported by the CCI implementation for this resource adapter.
getIntHeader(String) - Method in interface javax.servlet.http.HttpServletRequest
Returns the value of the specified request header as an int.
getIntHeader(String) - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.
getIntProperty(String) - Method in interface javax.jms.Message
Returns the value of the int property with the specified name.
getInvalidAddresses() - Method in class javax.mail.event.TransportEvent
Return the addresses to which this message could not be sent.
getInvalidAddresses() - Method in exception javax.mail.SendFailedException
Return the addresses to which this message could not be sent.
getInvalidConnections(Set) - Method in interface javax.resource.spi.ValidatingManagedConnectionFactory
This method returns a set of invalid ManagedConnection objects chosen from a specified set of ManagedConnection objects.
getInvalidPropertyDescriptors() - Method in exception javax.resource.spi.InvalidPropertyException
Get the list of invalid properties.
getInvokedBusinessInterface() - Method in interface javax.ejb.SessionContext
Obtain the business interface through which the current business method invocation was made.
getItemDescription() - Method in class javax.faces.component.UISelectItem
Return the description for this selection item.
getItemLabel() - Method in class javax.faces.component.UISelectItem
Return the localized label for this selection item.
getItems() - Method in class javax.mail.FetchProfile
Get the items set in this profile.
getItemValue() - Method in class javax.faces.component.UISelectItem
Return the server value for this selection item.
getJarFileUrls() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns a list of URLs for the jar files or exploded jar file directories that the persistence provider must examine for managed classes of the persistence unit.
getJavaEncoding(String) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Gets the corresponding Java encoding name from an IANA name.
getJAXBNode(XmlNode) - Method in class javax.xml.bind.Binder
Gets the JAXB object associated with the given XML element.
getJdbcDataSource() - Method in interface javax.management.j2ee.statistics.JDBCConnectionStats
Identifies the JDBC driver for the corresponding JDBCConnection.
getJMSCorrelationID() - Method in interface javax.jms.Message
Gets the correlation ID for the message.
getJMSCorrelationIDAsBytes() - Method in interface javax.jms.Message
Gets the correlation ID as an array of bytes for the message.
getJMSDeliveryMode() - Method in interface javax.jms.Message
Gets the DeliveryMode value specified for this message.
getJMSDestination() - Method in interface javax.jms.Message
Gets the Destination object for this message.
getJMSExpiration() - Method in interface javax.jms.Message
Gets the message's expiration value.
getJMSMajorVersion() - Method in interface javax.jms.ConnectionMetaData
Gets the JMS major version number.
getJMSMessageID() - Method in interface javax.jms.Message
Gets the message ID.
getJMSMinorVersion() - Method in interface javax.jms.ConnectionMetaData
Gets the JMS minor version number.
getJMSPriority() - Method in interface javax.jms.Message
Gets the message priority level.
getJMSProviderName() - Method in interface javax.jms.ConnectionMetaData
Gets the JMS provider name.
getJMSRedelivered() - Method in interface javax.jms.Message
Gets an indication of whether this message is being redelivered.
getJMSReplyTo() - Method in interface javax.jms.Message
Gets the Destination object to which a reply to this message should be sent.
getJMSTimestamp() - Method in interface javax.jms.Message
Gets the message timestamp.
getJMSType() - Method in interface javax.jms.Message
Gets the message type identifier supplied by the client when the message was sent.
getJMSVersion() - Method in interface javax.jms.ConnectionMetaData
Gets the JMS API version.
getJMSXPropertyNames() - Method in interface javax.jms.ConnectionMetaData
Gets an enumeration of the JMSX property names.
getJspApplicationContext(ServletContext) - Method in class javax.servlet.jsp.JspFactory
Obtains the JspApplicationContext instance associated with the web application for the given ServletContext.
getJspBody() - Method in class javax.servlet.jsp.tagext.SimpleTagSupport
Returns the body passed in by the container via setJspBody.
getJspContext() - Method in class javax.servlet.jsp.tagext.JspFragment
Returns the JspContext that is bound to this JspFragment.
getJspContext() - Method in class javax.servlet.jsp.tagext.SimpleTagSupport
Returns the page context passed in by the container via setJspContext.
getJspId() - Method in class javax.faces.webapp.UIComponentClassicTagBase

getJtaDataSource() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the JTA-enabled data source to be used by the persistence provider.
getKey() - Method in interface javax.xml.registry.infomodel.RegistryObject
Gets the key representing the universally unique ID (UUID) for this object.
getKeys() - Method in interface javax.security.jacc.PolicyContextHandler
This public method returns the keys identifying the context objects supported by the handler.
getLabel() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the label property.
getLabel() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the label property.
getLabel() - Method in class javax.faces.model.SelectItem
Return the label of this item, to be rendered visibly for the user.
getLang() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlForm
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlOutputFormat
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlOutputText
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the lang property.
getLang() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the lang property.
getLargeIcon() - Method in class javax.servlet.jsp.tagext.TagInfo
Get the path to the large icon.
getLastAccessedTime() - Method in interface javax.servlet.http.HttpSession
Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container received the request.
getLastModified(HttpServletRequest) - Method in class javax.servlet.http.HttpServlet
Returns the time the HttpServletRequest object was last modified, in milliseconds since midnight January 1, 1970 GMT.
getLastName() - Method in interface javax.xml.registry.infomodel.PersonName
Gets the last name (surname) for this Person.
getLastSampleTime() - Method in interface javax.management.j2ee.statistics.Statistic
The time of the last measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
getLayout() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the layout property.
getLayout() - Method in class javax.faces.component.html.HtmlPanelGroup
Return the value of the layout property.
getLayout() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the layout property.
getLayout() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the layout property.
getLifecycle(String) - Method in class javax.faces.lifecycle.LifecycleFactory
Create (if needed) and return a Lifecycle instance for the specified lifecycle identifier.
getLifecycleIds() - Method in class javax.faces.lifecycle.LifecycleFactory
Return an Iterator over the set of lifecycle identifiers supported by this factory.
getLifeCycleManager() - Method in interface javax.xml.registry.infomodel.RegistryObject
Returns the LifeCycleManager that created this object.
getLineCount() - Method in class javax.mail.internet.MimeBodyPart
Return the number of lines for the content of this Part.
getLineCount() - Method in class javax.mail.internet.MimeMessage
Return the number of lines for the content of this message.
getLineCount() - Method in interface javax.mail.Part
Return the number of lines in the content of this part.
getLineNumber() - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl

getLineNumber() - Method in interface javax.xml.bind.ValidationEventLocator
Return the line number if available
getLineNumber() - Method in interface javax.xml.stream.Location
Return the line number where the current event ends, returns -1 if none is available.
getLinkedCause() - Method in exception javax.xml.rpc.JAXRPCException
Gets the Linked cause
getLinkedCause() - Method in exception javax.xml.rpc.ServiceException
Gets the Linked cause
getLinkedException() - Method in exception javax.jms.JMSException
Gets the exception linked to this one.
getLinkedException() - Method in exception javax.resource.ResourceException
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class..
getLinkedException() - Method in class javax.xml.bind.helpers.ValidationEventImpl

getLinkedException() - Method in exception javax.xml.bind.JAXBException
Get the linked exception
getLinkedException() - Method in exception javax.xml.bind.TypeConstraintException
Get the linked exception
getLinkedException() - Method in interface javax.xml.bind.ValidationEvent
Retrieve the linked exception for this warning/error.
getLinkedObjects() - Method in interface javax.xml.registry.infomodel.ExternalLink
Gets the collection of RegistryObjects that are annotated by this ExternalLink.
getLinkedWarning() - Method in exception javax.resource.cci.ResourceWarning
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
getListener() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

getListener() - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

getListener() - Method in interface javax.xml.bind.Marshaller
Return Marshaller.Listener registered with this Marshaller.
getListener() - Method in interface javax.xml.bind.Unmarshaller
Return Unmarshaller.Listener registered with this Unmarshaller.
getListenerRegistry() - Method in interface javax.management.j2ee.Management
Returns the listener registry implementation for this MEJB.
getLocalAddr() - Method in interface javax.servlet.ServletRequest
Returns the Internet Protocol (IP) address of the interface on which the request was received.
getLocalAddr() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getLocalAddr() on the wrapped request object.
getLocalAddress(Session) - Static method in class javax.mail.internet.InternetAddress
Return an InternetAddress object representing the current user.
getLocale() - Method in class javax.el.ELContext
Get the Locale stored by a previous invocation to ELContext.setLocale(java.util.Locale).
getLocale() - Method in class javax.faces.component.UIViewRoot
Return the Locale to be used in localizing the response being created for this view.
getLocale() - Method in class javax.faces.convert.DateTimeConverter
Return the Locale to be used when parsing or formatting dates and times.
getLocale() - Method in class javax.faces.convert.NumberConverter
Return the Locale to be used when parsing numbers.
getLocale() - Method in interface javax.servlet.ServletRequest
Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.
getLocale() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getLocale() on the wrapped request object.
getLocale() - Method in interface javax.servlet.ServletResponse
Returns the locale specified for this response using the ServletResponse.setLocale(java.util.Locale) method.
getLocale() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to return getLocale() on the wrapped response object.
getLocale() - Method in interface javax.xml.registry.infomodel.LocalizedString
Get the Locale for this object.
getLocales() - Method in interface javax.servlet.ServletRequest
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.
getLocales() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getLocales() on the wrapped request object.
getLocalizedString(Locale, String) - Method in interface javax.xml.registry.infomodel.InternationalString
Gets the LocalizedString for the specified Locale and charsetName.
getLocalizedStrings() - Method in interface javax.xml.registry.infomodel.InternationalString
Returns the LocalizedStrings associated with this object.
getLocalName() - Method in interface javax.servlet.ServletRequest
Returns the host name of the Internet Protocol (IP) interface on which the request was received.
getLocalName() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getLocalName() on the wrapped request object.
getLocalName() - Method in interface javax.xml.soap.Name
Gets the local name part of the XML name that this Name object represents.
getLocalName() - Method in class javax.xml.stream.util.StreamReaderDelegate

getLocalName() - Method in interface javax.xml.stream.XMLStreamReader
Returns the (local) name of the current event.
getLocalPort() - Method in interface javax.servlet.ServletRequest
Returns the Internet Protocol (IP) port number of the interface on which the request was received.
getLocalPort() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getLocalPort() on the wrapped request object.
getLocalTransaction() - Method in interface javax.resource.cci.Connection
Returns an LocalTransaction instance that enables a component to demarcate resource manager local transactions on the Connection.
getLocalTransaction() - Method in interface javax.resource.spi.ManagedConnection
Returns an javax.resource.spi.LocalTransaction instance.
getLocalValue() - Method in class javax.faces.component.UIOutput

getLocalValue() - Method in interface javax.faces.component.ValueHolder
Return the local value of this UIComponent (if any), without evaluating any associated ValueExpression.
getLocation() - Method in interface javax.xml.stream.events.XMLEvent
Return the location of this event.
getLocation() - Method in class javax.xml.stream.util.StreamReaderDelegate

getLocation() - Method in exception javax.xml.stream.XMLStreamException
Gets the location of the exception
getLocation() - Method in interface javax.xml.stream.XMLStreamReader
Return the current location of the processor.
getLocator() - Method in class javax.xml.bind.helpers.ValidationEventImpl

getLocator() - Method in interface javax.xml.bind.ValidationEvent
Retrieve the locator for this warning/error.
getLogWriter() - Method in interface javax.resource.spi.ManagedConnection
Gets the log writer for this ManagedConnection instance.
getLogWriter() - Method in interface javax.resource.spi.ManagedConnectionFactory
Get the log writer for this ManagedConnectionFactory instance.
getLong(String) - Method in interface javax.jms.MapMessage
Returns the long value with the specified name.
getLongdesc() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the longdesc property.
getLongProperty(String) - Method in interface javax.jms.Message
Returns the value of the long property with the specified name.
getLowerBound() - Method in interface javax.management.j2ee.statistics.BoundaryStatistic
The lower limit of the value of this attribute.The upper limit of the value of this attribute.
getLowWaterMark() - Method in interface javax.management.j2ee.statistics.RangeStatistic
The lowest value this attribute has held since the beginning of the measurement.
getMajorVersion() - Method in interface javax.servlet.ServletContext
Returns the major version of the Java Servlet API that this servlet container supports.
getMajorVersion() - Method in interface javax.xml.registry.infomodel.Versionable
Gets the major revision number for this version of the Versionable object.
getManagedClassNames() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the list of the names of the classes that the persistence provider must add it to its set of managed classes.
getManagedConnectionFactory() - Method in interface javax.management.j2ee.statistics.JCAConnectionStats
Returns the associated JCAManagedConnectionFactory OBJECT_NAME
getManagedConnectionFactory() - Method in class javax.resource.spi.security.PasswordCredential
Gets the target ManagedConnectionFactory for which the user name and password has been set by the application server.
getMapNames() - Method in interface javax.jms.MapMessage
Returns an Enumeration of all the names in the MapMessage object.
getMappingFileNames() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the list of mapping file names that the persistence provider must load to determine the mappings for the entity classes.
getMatchingHeaderLines(String[]) - Method in class javax.mail.internet.InternetHeaders
Return all matching header lines as an Enumeration of Strings.
getMatchingHeaderLines(String[]) - Method in class javax.mail.internet.MimeBodyPart
Get matching header lines as an Enumeration of Strings.
getMatchingHeaderLines(String[]) - Method in class javax.mail.internet.MimeMessage
Get matching header lines as an Enumeration of Strings.
getMatchingHeaderLines(String[]) - Method in interface javax.mail.internet.MimePart
Get matching header lines as an Enumeration of Strings.
getMatchingHeaders(String[]) - Method in class javax.mail.internet.InternetHeaders
Return all matching Header objects.
getMatchingHeaders(String[]) - Method in class javax.mail.internet.MimeBodyPart
Return matching headers from this Message as an Enumeration of Header objects.
getMatchingHeaders(String[]) - Method in class javax.mail.internet.MimeMessage
Return matching headers from this Message as an Enumeration of Header objects.
getMatchingHeaders(String[]) - Method in interface javax.mail.Part
Return matching headers from this part as an Enumeration of Header objects.
getMatchingHeaders(String[]) - Method in class javax.xml.soap.MimeHeaders
Returns all the MimeHeader objects whose name matches a name in the given array of names.
getMatchingMimeHeaders(String[]) - Method in class javax.xml.soap.AttachmentPart
Retrieves all MimeHeader objects that match a name in the given array.
getMatchingMimeHeaders(String[]) - Method in class javax.xml.soap.SOAPPart
Retrieves all MimeHeader objects that match a name in the given array.
getMaxAge() - Method in class javax.servlet.http.Cookie
Returns the maximum age of the cookie, specified in seconds, By default, -1 indicating the cookie will persist until browser shutdown.
getMaxConnections() - Method in interface javax.resource.spi.ManagedConnectionMetaData
Returns maximum limit on number of active concurrent connections that an EIS instance can support across client processes.
getMaxFractionDigits() - Method in class javax.faces.convert.NumberConverter
Return the maximum number of digits getAsString() should render in the fraction portion of the result.
getMaximum() - Method in class javax.faces.validator.DoubleRangeValidator
Return the maximum value to be enforced by this Validator or Double.MAX_VALUE if it has not been set.
getMaximum() - Method in class javax.faces.validator.LengthValidator
Return the maximum length to be enforced by this Validator, or 0 if the maximum has not been set.
getMaximum() - Method in class javax.faces.validator.LongRangeValidator
Return the maximum value to be enforced by this Validator.
getMaximumSeverity() - Method in class javax.faces.context.FacesContext
Return the maximum severity level recorded on any FacesMessages that has been queued, whether or not they are associated with any specific UIComponent.
getMaxInactiveInterval() - Method in interface javax.servlet.http.HttpSession
Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses.
getMaxIntegerDigits() - Method in class javax.faces.convert.NumberConverter
Return the maximum number of digits getAsString() should render in the integer portion of the result.
getMaxlength() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the maxlength property.
getMaxlength() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the maxlength property.
getMaxTime() - Method in interface javax.management.j2ee.statistics.TimeStatistic
The maximum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
getMBeanCount() - Method in interface javax.management.j2ee.Management
Returns the number of managed objects registered in the MEJB.
getMBeanInfo(ObjectName) - Method in interface javax.management.j2ee.Management
This method discovers the attributes and operations that a managed object exposes for management.
getMechanismType() - Method in interface javax.xml.rpc.encoding.Deserializer
Gets the type of the XML processing mechanism and representation used by this Deserializer.
getMechanismType() - Method in interface javax.xml.rpc.encoding.Serializer
Gets the type of the XML processing mechanism and representation used by this Serializer.
getMechType() - Method in interface javax.resource.spi.security.GenericCredential
Deprecated. Returns the mechanism type for the GenericCredential instance.
getMessage() - Method in exception javax.ejb.EJBException
Returns the detail message, including the message from the nested exception if there is one.
getMessage() - Method in interface javax.enterprise.deploy.spi.status.DeploymentStatus
Retrieve any additional information about the status of this event.
getMessage() - Method in exception javax.faces.application.ViewExpiredException
Return the message for this exception prepended with the view identifier if the view identifier is not null, otherwise, return the message.
getMessage() - Method in class javax.mail.event.MessageChangedEvent
Return the changed Message.
getMessage() - Method in class javax.mail.event.StoreEvent
Get the message from the Store.
getMessage() - Method in class javax.mail.event.TransportEvent
Get the Message object associated with this Transport Event.
getMessage(int) - Method in class javax.mail.Folder
Get the Message object corresponding to the given message number.
getMessage() - Method in class javax.mail.MessageContext
Return the Message that contains the content.
getMessage() - Method in exception javax.resource.ResourceException
Returns a detailed message string describing this exception.
getMessage() - Method in class javax.servlet.jsp.tagext.ValidationMessage
Get the localized validation message.
getMessage() - Method in class javax.xml.bind.helpers.ValidationEventImpl

getMessage() - Method in interface javax.xml.bind.ValidationEvent
Retrieve the text message for this warning/error.
getMessage() - Method in exception javax.xml.registry.JAXRException
Returns the detail message for this JAXRException object.
getMessage() - Method in interface javax.xml.rpc.handler.soap.SOAPMessageContext
Gets the SOAPMessage from this message context
getMessage() - Method in exception javax.xml.soap.SOAPException
Returns the detail message for this SOAPException object.
getMessage() - Method in error javax.xml.stream.FactoryConfigurationError
Report the message associated with this error
getMessage() - Method in interface javax.xml.ws.handler.LogicalMessageContext
Gets the message from this message context
getMessage() - Method in interface javax.xml.ws.handler.soap.SOAPMessageContext
Gets the SOAPMessage from this message context.
getMessageBundle() - Method in class javax.faces.application.Application
Return the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application.
getMessageByUID(long) - Method in interface javax.mail.UIDFolder
Get the Message corresponding to the given UID.
getMessageChangeType() - Method in class javax.mail.event.MessageChangedEvent
Return the type of this event.
getMessageContext() - Method in interface javax.ejb.SessionContext
Obtain a reference to the JAX-RPC MessageContext.
getMessageContext() - Method in class javax.mail.internet.MimePartDataSource
Return the MessageContext for the current part.
getMessageContext() - Method in interface javax.mail.MessageAware
Return the message context.
getMessageContext() - Method in interface javax.xml.rpc.server.ServletEndpointContext
The method getMessageContext returns the MessageContext targeted for this endpoint instance.
getMessageContext() - Method in interface javax.xml.ws.WebServiceContext
Returns the MessageContext for the request being served at the time this method is called.
getMessageCount() - Method in class javax.mail.Folder
Get total number of messages in this Folder.
getMessageCount() - Method in interface javax.management.j2ee.statistics.JMSEndpointStats
Number of messages sent or received.
getMessageCount() - Method in interface javax.management.j2ee.statistics.JMSSessionStats
Number of messages exchanged.
getMessageCount() - Method in interface javax.management.j2ee.statistics.MessageDrivenBeanStats
Number of messages received.
getMessageFactory() - Method in interface javax.xml.ws.soap.SOAPBinding
Gets the SAAJ MessageFactory instance used by this SOAP binding.
getMessageID() - Method in class javax.mail.internet.MimeMessage
Returns the value of the "Message-ID" header field.
getMessageListener() - Method in interface javax.jms.MessageConsumer
Gets the message consumer's MessageListener.
getMessageListener() - Method in interface javax.jms.Session
Returns the session's distinguished message listener (optional).
getMessageNumber() - Method in class javax.mail.Message
Get the Message number for this Message.
getMessages() - Method in class javax.faces.context.FacesContext
Return an Iterator over the FacesMessages that have been queued, whether or not they are associated with any specific client identifier.
getMessages(String) - Method in class javax.faces.context.FacesContext
Return an Iterator over the FacesMessages that have been queued that are associated with the specified client identifier (if clientId is not null), or over the FacesMessages that have been queued that are not associated with any specific client identifier (if clientId is null).
getMessages() - Method in class javax.mail.event.MessageCountEvent
Return the array of messages added or removed.
getMessages(int, int) - Method in class javax.mail.Folder
Get the Message objects for message numbers ranging from start through end, both start and end inclusive.
getMessages(int[]) - Method in class javax.mail.Folder
Get the Message objects for message numbers specified in the array.
getMessages() - Method in class javax.mail.Folder
Get all Message objects from this Folder.
getMessagesByUID(long, long) - Method in interface javax.mail.UIDFolder
Get the Messages specified by the given range.
getMessagesByUID(long[]) - Method in interface javax.mail.UIDFolder
Get the Messages specified by the given array of UIDs.
getMessageSelector() - Method in interface javax.jms.MessageConsumer
Gets this message consumer's message selector expression.
getMessageSelector() - Method in interface javax.jms.QueueBrowser
Gets this queue browser's message selector expression.
getMessageType() - Method in class javax.mail.event.StoreEvent
Return the type of this event.
getMessageWaitTime() - Method in interface javax.management.j2ee.statistics.JMSEndpointStats
Time spent by a message before being delivered.
getMessageWaitTime() - Method in interface javax.management.j2ee.statistics.JMSSessionStats
Time spent by a message before being delivered.
getMetaData() - Method in interface javax.jms.Connection
Gets the metadata for this connection.
getMetaData() - Method in interface javax.resource.cci.Connection
Gets the information on the underlying EIS instance represented through an active connection.
getMetaData() - Method in interface javax.resource.cci.ConnectionFactory
Gets metadata for the Resource Adapter.
getMetaData() - Method in interface javax.resource.spi.ManagedConnection
Gets the metadata information for this connection's underlying EIS resource manager instance.
getMetadata() - Method in class javax.xml.ws.Endpoint
Returns a list of metadata documents for the service.
getMethod() - Method in interface javax.interceptor.InvocationContext
Returns the method of the bean class for which the interceptor was invoked.
getMethod() - Method in interface javax.servlet.http.HttpServletRequest
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
getMethod() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getMethod() on the wrapped request object.
getMethodInfo(ELContext) - Method in class javax.el.MethodExpression
Evaluates the expression relative to the provided context, and returns information about the actual referenced method.
getMethodReadyCount() - Method in interface javax.management.j2ee.statistics.SessionBeanStats
Number of beans in the method-ready state.
getMethodSignature() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Returns the expected method signature of this deferred method attribute.
getMiddleName() - Method in interface javax.xml.registry.infomodel.PersonName
Gets the middle name for this Person.
getMimeHeader(String) - Method in class javax.xml.soap.AttachmentPart
Gets all the values of the header identified by the given String.
getMimeHeader(String) - Method in class javax.xml.soap.SOAPPart
Gets all the values of the MimeHeader object in this SOAPPart object that is identified by the given String.
getMimeHeaders() - Method in class javax.xml.soap.SOAPMessage
Returns all the transport-specific MIME headers for this SOAPMessage object in a transport-independent fashion.
getMimeType() - Method in class javax.activation.ActivationDataFlavor
Return the MIME type for this DataFlavor.
getMimeType(String) - Method in interface javax.servlet.ServletContext
Returns the MIME type of the specified file, or null if the MIME type is not known.
getMimeType() - Method in interface javax.xml.registry.infomodel.ExtrinsicObject
Gets the mime type associated with this object.
getMimeTypes() - Method in class javax.activation.CommandMap
Get all the MIME types known to this command map.
getMimeTypes() - Method in class javax.activation.MailcapCommandMap
Get all the MIME types known to this command map.
getMinFractionDigits() - Method in class javax.faces.convert.NumberConverter
Return the minimum number of digits getAsString() should render in the fraction portion of the result.
getMinimum() - Method in class javax.faces.validator.DoubleRangeValidator
Return the minimum value to be enforced by this Validator, or Double.MIN_VALUE if it has not been set.
getMinimum() - Method in class javax.faces.validator.LengthValidator
Return the minimum length to be enforced by this Validator, or 0 if the minimum has not been set.
getMinimum() - Method in class javax.faces.validator.LongRangeValidator
Return the minimum value to be enforced by this Validator.
getMinIntegerDigits() - Method in class javax.faces.convert.NumberConverter
Return the minimum number of digits getAsString() should render in the integer portion of the result.
getMinorVersion() - Method in interface javax.servlet.ServletContext
Returns the minor version of the Servlet API that this servlet container supports.
getMinorVersion() - Method in interface javax.xml.registry.infomodel.Versionable
Gets the minor revision number for this version of the Versionable object.
getMinTime() - Method in interface javax.management.j2ee.statistics.TimeStatistic
The minimum amount of time taken to complete one invocation of this operation since the beginning of this measurement.
getMode() - Method in class javax.mail.Folder
Return the open mode of this folder.
getModuleDTDVersion() - Method in interface javax.enterprise.deploy.model.DDBeanRoot
Deprecated. As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()
getModuleDTDVersion() - Method in interface javax.enterprise.deploy.model.DeployableObject
Deprecated. As of version 1.1 replaced by DDBeanRoot.getDDBeanRootVersion()
getModuleExtension() - Method in class javax.enterprise.deploy.shared.ModuleType
Return the file extension string for this enumeration.
getModuleID() - Method in interface javax.enterprise.deploy.spi.TargetModuleID
Retrieve the id assigned to represent the deployed module.
getModuleType(int) - Static method in class javax.enterprise.deploy.shared.ModuleType
Return an object of the specified value.
getModuleUris(ModuleType) - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Return the list of URIs of the designated module type.
getModuleUris() - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Return the list of URIs for all modules in the application.
getMustUnderstand() - Method in interface javax.xml.soap.SOAPHeaderElement
Returns the boolean value of the mustUnderstand attribute for this SOAPHeaderElement.
getName() - Method in class javax.activation.DataHandler
Return the name of the data object.
getName() - Method in interface javax.activation.DataSource
Return the name of this object where the name of the object is dependant on the nature of the underlying objects.
getName() - Method in class javax.activation.FileDataSource
Return the name of this object.
getName() - Method in class javax.activation.URLDataSource
Calls the getFile method on the URL used to instantiate the object.
getName() - Method in class javax.el.MethodInfo
Returns the name of the method
getName() - Method in interface javax.enterprise.deploy.spi.Target
Retrieve the name of the target server.
getName() - Method in class javax.faces.component.UIParameter
Return the optional parameter name for this parameter.
getName() - Method in class javax.faces.webapp.FacetTag
Return the name to be assigned to this facet.
getName() - Method in class javax.mail.Folder
Returns the name of this Folder.
getName() - Method in class javax.mail.Header
Returns the name of this header.
getName() - Method in class javax.mail.internet.MimePartDataSource
DataSource method to return a name.
getName() - Method in class javax.mail.util.ByteArrayDataSource
Get the name of the data.
getName() - Method in interface javax.management.j2ee.statistics.Statistic
The name of this Statistic.
getName() - Method in interface javax.resource.spi.security.GenericCredential
Deprecated. Returns the name of the resource principal associated with a GenericCredential instance.
getName() - Method in class javax.servlet.http.Cookie
Returns the name of the cookie.
getName() - Method in class javax.servlet.http.HttpSessionBindingEvent
Returns the name with which the attribute is bound to or unbound from the session.
getName() - Method in class javax.servlet.jsp.tagext.FunctionInfo
The name of the function.
getName() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
The name of this attribute.
getName() - Method in class javax.servlet.jsp.tagext.TagFileInfo
The unique action name of this tag.
getName() - Method in class javax.servlet.ServletContextAttributeEvent
Return the name of the attribute that changed on the ServletContext.
getName() - Method in class javax.servlet.ServletRequestAttributeEvent
Return the name of the attribute that changed on the ServletRequest.
getName() - Method in class javax.xml.bind.JAXBElement
Returns the xml element tag name.
getName() - Method in interface javax.xml.registry.infomodel.RegistryObject
Gets the user-friendly name of this object.
getName() - Method in interface javax.xml.registry.infomodel.Slot
Gets the name for this Slot.
getName() - Method in class javax.xml.soap.MimeHeader
Returns the name of this MimeHeader object.
getName() - Method in interface javax.xml.stream.events.Attribute
Returns the QName for this attribute
getName() - Method in interface javax.xml.stream.events.EndElement
Get the name of this event
getName() - Method in interface javax.xml.stream.events.EntityDeclaration
The entity's name
getName() - Method in interface javax.xml.stream.events.EntityReference
The name of the entity
getName() - Method in interface javax.xml.stream.events.NotationDeclaration
The notation name.
getName() - Method in interface javax.xml.stream.events.StartElement
Get the name of this event
getName() - Method in class javax.xml.stream.util.StreamReaderDelegate

getName() - Method in interface javax.xml.stream.XMLStreamReader
Returns a QName for the current START_ELEMENT or END_ELEMENT event
getNamedDispatcher(String) - Method in interface javax.servlet.ServletContext
Returns a RequestDispatcher object that acts as a wrapper for the named servlet.
getNameFromAttribute() - Method in class javax.servlet.jsp.tagext.TagVariableInfo
The body of the <name-from-attribute> element.
getNameGiven() - Method in class javax.servlet.jsp.tagext.TagVariableInfo
The body of the <name-given> element.
getNames() - Method in class javax.activation.MimeTypeParameterList
Retrieve an enumeration of all the names in this list.
getNames() - Method in class javax.mail.internet.ParameterList
Return an enumeration of the names of all parameters in this list.
getNamespaceContext() - Method in interface javax.xml.stream.events.StartElement
Gets a read-only namespace context.
getNamespaceContext() - Method in class javax.xml.stream.util.StreamReaderDelegate

getNamespaceContext() - Method in interface javax.xml.stream.XMLEventWriter
Returns the current namespace context.
getNamespaceContext() - Method in interface javax.xml.stream.XMLStreamReader
Returns a read only namespace context for the current position.
getNamespaceContext() - Method in interface javax.xml.stream.XMLStreamWriter
Returns the current namespace context.
getNamespaceCount() - Method in class javax.xml.stream.util.StreamReaderDelegate

getNamespaceCount() - Method in interface javax.xml.stream.XMLStreamReader
Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE.
getNamespacePrefix(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getNamespacePrefix(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the prefix for the namespace declared at the index.
getNamespacePrefixes() - Method in interface javax.xml.soap.SOAPElement
Returns an Iterator over the namespace prefix Strings declared by this element.
getNamespaces() - Method in interface javax.xml.stream.events.EndElement
Returns an Iterator of namespaces that have gone out of scope.
getNamespaces() - Method in interface javax.xml.stream.events.StartElement
Returns an Iterator of namespaces declared on this element.
getNamespaceURI(String) - Method in interface javax.xml.soap.SOAPElement
Returns the URI of the namespace that has the given prefix.
getNamespaceURI() - Method in interface javax.xml.stream.events.Namespace
Gets the uri bound to the prefix of this namespace
getNamespaceURI(String) - Method in interface javax.xml.stream.events.StartElement
Gets the value that the prefix is bound to in the context of this element.
getNamespaceURI(String) - Method in class javax.xml.stream.util.StreamReaderDelegate

getNamespaceURI(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getNamespaceURI() - Method in class javax.xml.stream.util.StreamReaderDelegate

getNamespaceURI(String) - Method in interface javax.xml.stream.XMLStreamReader
Return the uri for the given prefix.
getNamespaceURI(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns the uri for the namespace declared at the index.
getNamespaceURI() - Method in interface javax.xml.stream.XMLStreamReader
If the current event is a START_ELEMENT or END_ELEMENT this method returns the URI of the prefix or the default namespace.
getNativeCommands(String) - Method in class javax.activation.MailcapCommandMap
Get the native commands for the given MIME type.
getNavigationHandler() - Method in class javax.faces.application.Application
Return the NavigationHandler instance that will be passed the outcome returned by any invoked application action for this web application.
getNestedException() - Method in exception javax.xml.stream.XMLStreamException
Gets the nested exception.
getNewFolder() - Method in class javax.mail.event.FolderEvent
If this event indicates that a folder is renamed, (i.e, the event type is RENAMED), then this method returns the Folder object representing the new name.
getNewMessageCount() - Method in class javax.mail.Folder
Get the number of new messages in this Folder.
getNewsgroup() - Method in class javax.mail.internet.NewsAddress
Get the newsgroup.
getNewTempClassLoader() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Return a new instance of a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs.
getNewValue() - Method in class javax.faces.event.ValueChangeEvent
Return the current local value of the source UIComponent.
getNextException() - Method in exception javax.mail.MessagingException
Get the next exception chained to this one.
getNextTimeout() - Method in interface javax.ejb.Timer
Get the point in time at which the next timer expiration is scheduled to occur.
getNode(Object) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
By default, the getNode method is unsupported and throw an UnsupportedOperationException.
getNode() - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl

getNode(Object) - Method in interface javax.xml.bind.Marshaller
Get a DOM tree view of the content tree(Optional).
getNode() - Method in interface javax.xml.bind.ValidationEventLocator
Return a reference to the DOM Node if available
getNoLocal() - Method in interface javax.jms.TopicSubscriber
Gets the NoLocal attribute for this subscriber.
getNonJtaDataSource() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.
getNonMatchingHeaderLines(String[]) - Method in class javax.mail.internet.InternetHeaders
Return all non-matching header lines
getNonMatchingHeaderLines(String[]) - Method in class javax.mail.internet.MimeBodyPart
Get non-matching header lines as an Enumeration of Strings.
getNonMatchingHeaderLines(String[]) - Method in class javax.mail.internet.MimeMessage
Get non-matching header lines as an Enumeration of Strings.
getNonMatchingHeaderLines(String[]) - Method in interface javax.mail.internet.MimePart
Get non-matching header lines as an Enumeration of Strings.
getNonMatchingHeaders(String[]) - Method in class javax.mail.internet.InternetHeaders
Return all non-matching Header objects.
getNonMatchingHeaders(String[]) - Method in class javax.mail.internet.MimeBodyPart
Return non-matching headers from this Message as an Enumeration of Header objects.
getNonMatchingHeaders(String[]) - Method in class javax.mail.internet.MimeMessage
Return non-matching headers from this Message as an Enumeration of Header objects.
getNonMatchingHeaders(String[]) - Method in interface javax.mail.Part
Return non-matching headers from this envelope as an Enumeration of Header objects.
getNonMatchingHeaders(String[]) - Method in class javax.xml.soap.MimeHeaders
Returns all of the MimeHeader objects whose name does not match a name in the given array of names.
getNonMatchingMimeHeaders(String[]) - Method in class javax.xml.soap.AttachmentPart
Retrieves all MimeHeader objects whose name does not match a name in the given array.
getNonMatchingMimeHeaders(String[]) - Method in class javax.xml.soap.SOAPPart
Retrieves all MimeHeader objects whose name does not match a name in the given array.
getNonRunningModules(ModuleType, Target[]) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently not running on the associated server or servers.
getNoNSSchemaLocation() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for getting the current noNamespaceSchemaLocation.
getNotationName() - Method in interface javax.xml.stream.events.EntityDeclaration
The name of the associated notation.
getNotations() - Method in interface javax.xml.stream.events.DTD
Return a List containing the notations declared in the DTD.
getNumber() - Method in class javax.mail.search.IntegerComparisonTerm
Return the number to compare with.
getNumber() - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Gets the telephone number suffix, not including the country or area code.
getObject(String) - Method in interface javax.jms.MapMessage
Returns the value of the object with the specified name.
getObject() - Method in interface javax.jms.ObjectMessage
Gets the serializable object containing this message's data.
getObject() - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl

getObject() - Method in interface javax.xml.bind.ValidationEventLocator
Return a reference to the object in the Java content tree if available
getObjectProperty(String) - Method in interface javax.jms.Message
Returns the value of the Java object property with the specified name.
getObjectType() - Method in interface javax.xml.registry.infomodel.RegistryObject
Gets the object type that best describes the RegistryObject.
getOffset() - Method in class javax.enterprise.deploy.shared.ActionType
Returns the lowest integer value used by this enumeration value's enumeration class.
getOffset() - Method in class javax.enterprise.deploy.shared.CommandType
Returns the lowest integer value used by this enumeration value's enumeration class.
getOffset() - Method in class javax.enterprise.deploy.shared.DConfigBeanVersionType
Returns the lowest integer value used by this enumeration value's enumeration class.
getOffset() - Method in class javax.enterprise.deploy.shared.ModuleType
Returns the lowest integer value used by this enumeration value's enumeration class.
getOffset() - Method in class javax.enterprise.deploy.shared.StateType
Returns the lowest integer value used by this enumeration value's enumeration class.
getOffset() - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl

getOffset() - Method in interface javax.xml.bind.ValidationEventLocator
Return the byte offset if available
getOldValue() - Method in class javax.faces.event.ValueChangeEvent
Return the previous local value of the source UIComponent.
getOnblur() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onblur property.
getOnblur() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onblur property.
getOnchange() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onchange property.
getOnchange() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onchange property.
getOnclick() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onclick property.
getOnclick() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlForm
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the ondblclick property.
getOndblclick() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the ondblclick property.
getOnfocus() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onfocus property.
getOnfocus() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onfocus property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onkeydown property.
getOnkeydown() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onkeydown property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onkeypress property.
getOnkeypress() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onkeypress property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onkeyup property.
getOnkeyup() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onkeyup property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onmousedown property.
getOnmousedown() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onmousedown property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onmousemove property.
getOnmousemove() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onmousemove property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onmouseout property.
getOnmouseout() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onmouseout property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onmouseover property.
getOnmouseover() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onmouseover property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onmouseup property.
getOnmouseup() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onmouseup property.
getOnreset() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onreset property.
getOnselect() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the onselect property.
getOnselect() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the onselect property.
getOnsubmit() - Method in class javax.faces.component.html.HtmlForm
Return the value of the onsubmit property.
getOperationName() - Method in interface javax.xml.rpc.Call
Gets the name of the operation to be invoked using this Call instance.
getOrdinal() - Method in class javax.faces.application.FacesMessage.Severity
Return the ordinal value of this FacesMessage.Severity instance.
getOrdinal() - Method in class javax.faces.event.PhaseId
Return the ordinal value of this PhaseId instance.
getOrganization() - Method in interface javax.xml.registry.infomodel.User
Gets the Organization that this User is affiliated with.
getOrigin() - Method in interface javax.management.j2ee.statistics.JMSConsumerStats
Returns a string that encapsulates the identity of a message origin
getOut() - Method in class javax.servlet.jsp.JspContext
The current value of the out object (a JspWriter).
getOutputParams() - Method in interface javax.xml.rpc.Call
Returns a Map of {name, value} for the output parameters of the last invoked operation.
getOutputStream() - Method in class javax.activation.DataHandler
Get an OutputStream for this DataHandler to allow overwriting the underlying data.
getOutputStream() - Method in interface javax.activation.DataSource
This method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so.
getOutputStream() - Method in class javax.activation.FileDataSource
This method will return an OutputStream representing the the data and will throw an IOException if it can not do so.
getOutputStream() - Method in class javax.activation.URLDataSource
The getOutputStream method from the URL.
getOutputStream() - Method in class javax.mail.internet.MimePartDataSource
DataSource method to return an output stream.
getOutputStream() - Method in class javax.mail.util.ByteArrayDataSource
Return an OutputStream for the data.
getOutputStream() - Method in interface javax.servlet.ServletResponse
Returns a ServletOutputStream suitable for writing binary data in the response.
getOutputStream() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to return getOutputStream() on the wrapped response object.
getOutputValues() - Method in interface javax.xml.rpc.Call
Returns a List values for the output parameters of the last invoked operation.
getPage() - Method in class javax.servlet.jsp.PageContext
The current value of the page object (In a Servlet environment, this is an instance of javax.servlet.Servlet).
getPageContext(Servlet, ServletRequest, ServletResponse, String, boolean, int, boolean) - Method in class javax.servlet.jsp.JspFactory
obtains an instance of an implementation dependent javax.servlet.jsp.PageContext abstract class for the calling Servlet and currently pending request and response.
getParameter(String) - Method in class javax.activation.MimeType
Retrieve the value associated with the given name, or null if there is no current association.
getParameter(String) - Method in class javax.mail.internet.ContentDisposition
Return the specified parameter value.
getParameter(String) - Method in class javax.mail.internet.ContentType
Return the specified parameter value.
getParameter(String) - Method in interface javax.servlet.ServletRequest
Returns the value of a request parameter as a String, or null if the parameter does not exist.
getParameter(String) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getParameter(String name) on the wrapped request object.
getParameterList() - Method in class javax.mail.internet.ContentDisposition
Return a ParameterList object that holds all the available parameters.
getParameterList() - Method in class javax.mail.internet.ContentType
Return a ParameterList object that holds all the available parameters.
getParameterMap() - Method in interface javax.servlet.ServletRequest
Returns a java.util.Map of the parameters of this request.
getParameterMap() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getParameterMap() on the wrapped request object.
getParameterNames() - Method in interface javax.servlet.ServletRequest
Returns an Enumeration of String objects containing the names of the parameters contained in this request.
getParameterNames() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getParameterNames() on the wrapped request object.
getParameters() - Method in class javax.activation.MimeType
Retrieve this object's parameter list.
getParameters() - Method in interface javax.interceptor.InvocationContext
Returns the parameters that will be used to invoke the business method.
getParameterTypeByName(String) - Method in interface javax.xml.rpc.Call
Gets the XML type of a parameter by name
getParameterValues(String) - Method in interface javax.servlet.ServletRequest
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
getParameterValues(String) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.
getParamTypes() - Method in class javax.el.MethodInfo
Returns the parameter types of the method
getParent() - Method in class javax.faces.component.UIComponent
Return the parent UIComponent of this UIComponent, if any.
getParent() - Method in class javax.faces.component.UIComponentBase

getParent() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return the Tag that is the parent of this instance.
getParent() - Method in class javax.mail.BodyPart
Return the containing Multipart object, or null if not known.
getParent() - Method in class javax.mail.Folder
Returns the parent folder of this folder.
getParent() - Method in class javax.mail.Multipart
Return the Part that contains this Multipart object, or null if not known.
getParent() - Method in interface javax.servlet.jsp.tagext.SimpleTag
Returns the parent of this tag, for collaboration purposes.
getParent() - Method in class javax.servlet.jsp.tagext.SimpleTagSupport
Returns the parent of this tag, for collaboration purposes.
getParent() - Method in interface javax.servlet.jsp.tagext.Tag
Get the parent (closest enclosing tag handler) for this tag handler.
getParent() - Method in class javax.servlet.jsp.tagext.TagAdapter
Returns the parent of this tag, which is always getAdaptee().getParent().
getParent() - Method in class javax.servlet.jsp.tagext.TagSupport
The Tag instance most closely enclosing this tag instance.
getParent() - Method in interface javax.xml.registry.infomodel.Concept
Gets the parent Concept or ClassificationScheme for this object.
getParent() - Method in class javax.xml.stream.util.EventReaderDelegate
Get the parent of this instance.
getParent() - Method in class javax.xml.stream.util.StreamReaderDelegate
Get the parent of this instance.
getParentConcept() - Method in interface javax.xml.registry.infomodel.Concept
Gets the parent Concept or null if parent is a ClassificationScheme.
getParentElement() - Method in interface javax.xml.soap.Node
Returns the parent element of this Node object.
getParentOrganization() - Method in interface javax.xml.registry.infomodel.Organization
Gets the parent (container) organization.
getParentTargetModuleID() - Method in interface javax.enterprise.deploy.spi.TargetModuleID
Retrieve the identifier of the parent object of this deployed module.
getParentUIComponentClassicTagBase(PageContext) - Static method in class javax.faces.webapp.UIComponentClassicTagBase
Locate and return the nearest enclosing UIComponentClassicTagBase if any; otherwise, return null.
getParentUIComponentTag(PageContext) - Static method in class javax.faces.webapp.UIComponentTag
Deprecated. Locate and return the nearest enclosing UIComponentTag if any; otherwise, return null.
getPart() - Method in class javax.mail.MessageContext
Return the Part that contains the content.
getPassiveCount() - Method in interface javax.management.j2ee.statistics.StatefulSessionBeanStats
Number of beans that are in the passive state.
getPassword() - Method in class javax.mail.PasswordAuthentication

getPassword() - Method in class javax.mail.URLName
Returns the password of this URLName.
getPassword() - Method in class javax.resource.spi.security.PasswordCredential
Returns the user password.
getPasswordAuthentication() - Method in class javax.mail.Authenticator
Called when password authentication is needed.
getPasswordAuthentication(URLName) - Method in class javax.mail.Session
Return any saved PasswordAuthentication for this (store or transport) URLName.
getPath() - Method in class javax.servlet.http.Cookie
Returns the path on the server to which the browser returns this cookie.
getPath() - Method in class javax.servlet.jsp.tagext.TagFileInfo
Where to find the .tag file implementing this action.
getPath() - Method in interface javax.xml.registry.infomodel.Concept
Gets the canonical path representation for this Concept.
getPathInfo() - Method in interface javax.servlet.http.HttpServletRequest
Returns any extra path information associated with the URL the client sent when it made this request.
getPathInfo() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getPathInfo() on the wrapped request object.
getPathTranslated() - Method in interface javax.servlet.http.HttpServletRequest
Returns any extra path information after the servlet name but before the query string, and translates it to a real path.
getPathTranslated() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getPathTranslated() on the wrapped request object.
getPattern() - Method in class javax.faces.convert.DateTimeConverter
Return the format pattern to be used when formatting and parsing dates and times.
getPattern() - Method in class javax.faces.convert.NumberConverter
Return the format pattern to be used when formatting and parsing numbers.
getPattern() - Method in class javax.mail.search.StringTerm
Return the string to match with.
getPayload() - Method in interface javax.xml.ws.LogicalMessage
Gets the message payload as an XML source, may be called multiple times on the same LogicalMessage instance, always returns a new Source that may be used to retrieve the entire message payload.
getPayload(JAXBContext) - Method in interface javax.xml.ws.LogicalMessage
Gets the message payload as a JAXB object.
getPendingMessageCount() - Method in interface javax.management.j2ee.statistics.JMSEndpointStats
Number of pending messages.
getPendingMessageCount() - Method in interface javax.management.j2ee.statistics.JMSSessionStats
Number of pending messages.
getPermanentFlags() - Method in class javax.mail.Folder
Get the permanent flags supported by this Folder.
getPersistenceProviderClassName() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the fully qualified name of the persistence provider implementation class.
getPersistenceUnitName() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the name of the persistence unit.
getPersistenceUnitRootUrl() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the URL for the jar file or directory that is the root of the persistence unit.
getPersonal() - Method in class javax.mail.internet.InternetAddress
Get the personal name.
getPersonalNamespaces() - Method in class javax.mail.Store
Return a set of folders representing the personal namespaces for the current user.
getPersonName() - Method in interface javax.xml.registry.infomodel.User
Returns the name of this User.
getPhaseId() - Method in class javax.faces.event.FacesEvent
Return the identifier of the request processing phase during which this event should be delivered.
getPhaseId() - Method in class javax.faces.event.PhaseEvent
Return the PhaseId representing the current request processing lifecycle phase.
getPhaseId() - Method in interface javax.faces.event.PhaseListener
Return the identifier of the request processing phase during which this listener is interested in processing PhaseEvent events.
getPhaseListeners() - Method in class javax.faces.lifecycle.Lifecycle
Return the set of registered PhaseListeners for this Lifecycle instance.
getPIData() - Method in class javax.xml.stream.util.StreamReaderDelegate

getPIData() - Method in interface javax.xml.stream.XMLStreamReader
Get the data section of a processing instruction
getPITarget() - Method in class javax.xml.stream.util.StreamReaderDelegate

getPITarget() - Method in interface javax.xml.stream.XMLStreamReader
Get the target of a processing instruction
getPolicyConfiguration(String, boolean) - Method in class javax.security.jacc.PolicyConfigurationFactory
This method is used to obtain an instance of the provider specific class that implements the PolicyConfiguration interface that corresponds to the identified policy context within the provider.
getPolicyConfigurationFactory() - Static method in class javax.security.jacc.PolicyConfigurationFactory
This static method uses a system property to find and instantiate (via a public constructor) a provider specific factory implementation class.
getPooledCount() - Method in interface javax.management.j2ee.statistics.EntityBeanStats
Number of beans in the pooled state.
getPoolSize() - Method in interface javax.management.j2ee.statistics.JCAConnectionPoolStats
The size of the connection pool
getPoolSize() - Method in interface javax.management.j2ee.statistics.JDBCConnectionPoolStats
Size of the connection pool.
getPort() - Method in class javax.mail.URLName
Returns the port number of this URLName.
getPort(QName, Class) - Method in interface javax.xml.rpc.Service
The getPort method returns either an instance of a generated stub implementation class or a dynamic proxy.
getPort(Class) - Method in interface javax.xml.rpc.Service
The getPort method returns either an instance of a generated stub implementation class or a dynamic proxy.
getPort(QName, Class<T>) - Method in class javax.xml.ws.Service
The getPort method returns a stub.
getPort(Class<T>) - Method in class javax.xml.ws.Service
The getPort method returns a stub.
getPort(QName, Class<T>) - Method in class javax.xml.ws.spi.ServiceDelegate
The getPort method returns a stub.
getPort(Class<T>) - Method in class javax.xml.ws.spi.ServiceDelegate
The getPort method returns a stub.
getPortName() - Method in interface javax.xml.ws.handler.PortInfo
Gets the qualified name of the WSDL port being accessed.
getPorts() - Method in interface javax.xml.rpc.Service
Returns an Iterator for the list of QNames of service endpoints grouped by this service
getPorts() - Method in class javax.xml.ws.Service
Returns an Iterator for the list of QNames of service endpoints grouped by this service
getPorts() - Method in class javax.xml.ws.spi.ServiceDelegate
Returns an Iterator for the list of QNames of service endpoints grouped by this service
getPortTypeName() - Method in interface javax.xml.rpc.Call
Gets the qualified name of the port type.
getPos() - Method in exception javax.mail.internet.AddressException
Get the position with the reference string where the error was detected (-1 if not relevant).
getPosition() - Method in interface javax.mail.internet.SharedInputStream
Return the current position in the InputStream, as an offset from the beginning of the InputStream.
getPosition() - Method in class javax.mail.util.SharedByteArrayInputStream
Return the current position in the InputStream, as an offset from the beginning of the InputStream.
getPosition() - Method in class javax.mail.util.SharedFileInputStream
Return the current position in the InputStream, as an offset from the beginning of the InputStream.
getPostalAddress() - Method in interface javax.xml.registry.infomodel.Organization
Gets the Address for this Organization.
getPostalAddresses() - Method in interface javax.xml.registry.infomodel.User
Gets the postal address for this User.
getPostalCode() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns the postal or zip code.
getPostalScheme() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns a user-defined postal scheme for codifying the attributes of PostalAddress.
getPreamble() - Method in class javax.mail.internet.MimeMultipart
Get the preamble text, if any, that appears before the first body part of this multipart.
getPreferredCommands(String) - Method in class javax.activation.CommandMap
Get the preferred command list from a MIME Type.
getPreferredCommands(String, DataSource) - Method in class javax.activation.CommandMap
Get the preferred command list from a MIME Type.
getPreferredCommands() - Method in class javax.activation.DataHandler
Return the preferred commands for this type of data.
getPreferredCommands(String) - Method in class javax.activation.MailcapCommandMap
Get the preferred command list for a MIME Type.
getPrefix() - Method in interface javax.xml.soap.Name
Returns the prefix that was specified when this Name object was initialized.
getPrefix() - Method in interface javax.xml.stream.events.Namespace
Gets the prefix, returns "" if this is a default namespace declaration.
getPrefix() - Method in class javax.xml.stream.util.StreamReaderDelegate

getPrefix(String) - Method in interface javax.xml.stream.XMLEventWriter
Gets the prefix the uri is bound to
getPrefix() - Method in interface javax.xml.stream.XMLStreamReader
Returns the prefix of the current event or null if the event does not have a prefix
getPrefix(String) - Method in interface javax.xml.stream.XMLStreamWriter
Gets the prefix the uri is bound to
getPrefixString() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
The prefix assigned to this taglib from the taglib directive
getPreviousOut() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Get the JspWriter from our BodyContent.
getPreviousOut() - Method in class javax.servlet.jsp.tagext.BodyTagSupport
Get surrounding out JspWriter.
getPrimaryContact() - Method in interface javax.xml.registry.infomodel.Organization
Gets the primary Contact for this Organization.
getPrimaryKey() - Method in interface javax.ejb.EJBLocalObject
Obtain the primary key of the EJB local object.
getPrimaryKey() - Method in interface javax.ejb.EJBObject
Obtain the primary key of the EJB object.
getPrimaryKey() - Method in interface javax.ejb.EntityContext
Obtain the primary key of the EJB object that is currently associated with this instance.
getPrimaryKeyClass() - Method in interface javax.ejb.EJBMetaData
Obtain the Class object for the enterprise Bean's primary key class.
getPrimaryType() - Method in class javax.activation.MimeType
Retrieve the primary type of this object.
getPrimaryType() - Method in class javax.mail.internet.ContentType
Return the primary type.
getPriority() - Method in interface javax.jms.MessageProducer
Gets the producer's default priority.
getProcessedDTD() - Method in interface javax.xml.stream.events.DTD
Returns an implementation defined representation of the DTD.
getProducers() - Method in interface javax.management.j2ee.statistics.JMSSessionStats
Returns an array of JMSProducerStats that provide statistics about the message producers associated with the referencing JMS session statistics.
getProductVersion() - Method in interface javax.enterprise.deploy.spi.factories.DeploymentFactory
Provide a string identifying version of this vendor's DeploymentManager.
getProperties() - Method in class javax.mail.Session
Returns the Properties object associated with this Session
getProperties() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns properties object.
getProperties() - Method in class javax.xml.registry.ConnectionFactory
Gets the Properties used during createConnection and createFederatedConnection calls.
getProperties() - Method in class javax.xml.ws.Endpoint
Returns the property bag for this Endpoint instance.
getProperty(String) - Method in class javax.mail.Session
Returns the value of the specified property.
getProperty(String) - Method in class javax.xml.bind.Binder
Get the particular property in the underlying implementation of Binder.
getProperty(String) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Default implementation of the getProperty method handles the four defined properties in Marshaller.
getProperty(String) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Default implementation of the getProperty method always throws PropertyException since there are no required properties.
getProperty(String) - Method in interface javax.xml.bind.Marshaller
Get the particular property in the underlying implementation of Marshaller.
getProperty(String) - Method in interface javax.xml.bind.Unmarshaller
Get the particular property in the underlying implementation of Unmarshaller.
getProperty(String) - Method in interface javax.xml.bind.Validator
Deprecated. since JAXB2.0
getProperty(String) - Method in interface javax.xml.rpc.Call
Gets the value of a named property.
getProperty(String) - Method in interface javax.xml.rpc.handler.MessageContext
Gets the value of a specific property from the MessageContext
getProperty(String) - Method in class javax.xml.soap.SOAPMessage
Retrieves value of the specified property.
getProperty(String) - Method in class javax.xml.stream.util.EventReaderDelegate

getProperty(String) - Method in class javax.xml.stream.util.StreamReaderDelegate

getProperty(String) - Method in interface javax.xml.stream.XMLEventReader
Get the value of a feature/property from the underlying implementation
getProperty(String) - Method in class javax.xml.stream.XMLInputFactory
Get the value of a feature/property from the underlying implementation
getProperty(String) - Method in class javax.xml.stream.XMLOutputFactory
Get a feature/property on the underlying implementation
getProperty(String) - Method in interface javax.xml.stream.XMLStreamReader
Get the value of a feature/property from the underlying implementation
getProperty(String) - Method in interface javax.xml.stream.XMLStreamWriter
Get the value of a feature/property from the underlying implementation
getPropertyNames() - Method in interface javax.jms.Message
Returns an Enumeration of all the property names.
getPropertyNames() - Method in interface javax.xml.rpc.Call
Gets the names of configurable properties supported by this Call object.
getPropertyNames() - Method in interface javax.xml.rpc.handler.MessageContext
Returns an Iterator view of the names of the properties in this MessageContext
getPropertyResolver() - Method in class javax.faces.application.Application
Deprecated. This has been replaced by Application.getELResolver().
getPropertyType() - Method in class javax.el.BeanELResolver.BeanProperty

getProtocol() - Method in class javax.mail.Provider
Returns the protocol supported by this Provider
getProtocol() - Method in class javax.mail.URLName
Returns the protocol of this URLName.
getProtocol() - Method in interface javax.servlet.ServletRequest
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
getProtocol() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getProtocol() on the wrapped request object.
getProvider(String) - Method in class javax.mail.Session
Returns the default Provider for the protocol specified.
getProviderMajorVersion() - Method in interface javax.jms.ConnectionMetaData
Gets the JMS provider major version number.
getProviderMinorVersion() - Method in interface javax.jms.ConnectionMetaData
Gets the JMS provider minor version number.
getProviders() - Method in class javax.mail.Session
This method returns an array of all the implementations installed via the javamail.
getProviderVersion() - Method in interface javax.jms.ConnectionMetaData
Gets the JMS provider version.
getProvidingOrganization() - Method in interface javax.xml.registry.infomodel.Service
Gets the Organization that provides this service.
getPublicId() - Method in interface javax.xml.stream.events.EntityDeclaration
The entity's public identifier, or null if none was given
getPublicId() - Method in interface javax.xml.stream.events.NotationDeclaration
The notation's public identifier, or null if none was given.
getPublicId() - Method in interface javax.xml.stream.Location
Returns the public ID of the XML
getQualifiedName() - Method in interface javax.xml.soap.Name
Gets the namespace-qualified name of the XML name that this Name object represents.
getQueryString() - Method in interface javax.servlet.http.HttpServletRequest
Returns the query string that is contained in the request URL after the path.
getQueryString() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getQueryString() on the wrapped request object.
getQueue() - Method in interface javax.jms.QueueBrowser
Gets the queue associated with this queue browser.
getQueue() - Method in interface javax.jms.QueueReceiver
Gets the Queue associated with this queue receiver.
getQueue() - Method in interface javax.jms.QueueSender
Gets the queue associated with this QueueSender.
getQueueName() - Method in interface javax.jms.Queue
Gets the name of this queue.
getQueueSession() - Method in interface javax.jms.XAQueueSession
Gets the queue session associated with this XAQueueSession.
getQuota(String) - Method in interface javax.mail.QuotaAwareStore
Get the quotas for the named quota root.
getRawContent() - Method in class javax.xml.soap.AttachmentPart
Gets the content of this AttachmentPart object as an InputStream as if a call had been made to getContent and no DataContentHandler had been registered for the content-type of this AttachmentPart.
getRawContentBytes() - Method in class javax.xml.soap.AttachmentPart
Gets the content of this AttachmentPart object as a byte[] array as if a call had been made to getContent and no DataContentHandler had been registered for the content-type of this AttachmentPart.
getRawInputStream() - Method in class javax.mail.internet.MimeBodyPart
Return an InputStream to the raw data with any Content-Transfer-Encoding intact.
getRawInputStream() - Method in class javax.mail.internet.MimeMessage
Return an InputStream to the raw data with any Content-Transfer-Encoding intact.
getReader() - Method in class javax.servlet.jsp.tagext.BodyContent
Return the value of this BodyContent as a Reader.
getReader() - Method in interface javax.servlet.ServletRequest
Retrieves the body of the request as character data using a BufferedReader.
getReader() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getReader() on the wrapped request object.
getReadMethod() - Method in class javax.el.BeanELResolver.BeanProperty

getReadyCount() - Method in interface javax.management.j2ee.statistics.EntityBeanStats
Number of beans in the ready state.
getRealPath(String) - Method in interface javax.servlet.ServletContext
Returns a String containing the real path for a given virtual path.
getRealPath(String) - Method in interface javax.servlet.ServletRequest
Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String) instead.
getRealPath(String) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getRealPath(String path) on the wrapped request object.
getReceivedDate() - Method in class javax.mail.internet.MimeMessage
Returns the Date on this message was received.
getReceivedDate() - Method in class javax.mail.Message
Get the date this message was received.
getRecipients(Message.RecipientType) - Method in class javax.mail.internet.MimeMessage
Returns the recepients specified by the type.
getRecipients(Message.RecipientType) - Method in class javax.mail.Message
Get all the recipient addresses of the given type.
getRecipientType() - Method in class javax.mail.search.RecipientStringTerm
Return the type of recipient to match with.
getRecipientType() - Method in class javax.mail.search.RecipientTerm
Return the type of recipient to match with.
getRecordFactory() - Method in interface javax.resource.cci.ConnectionFactory
Gets a RecordFactory instance.
getRecordName() - Method in interface javax.resource.cci.Record
Gets the name of the Record.
getRecordShortDescription() - Method in interface javax.resource.cci.Record
Gets a short description string for the Record.
getRef() - Method in exception javax.mail.internet.AddressException
Get the string that was being parsed when the error was detected (null if not relevant).
getRef() - Method in class javax.mail.URLName
Returns the reference of this URLName.
getReference(Class<T>, Object) - Method in interface javax.persistence.EntityManager
Get an instance, whose state may be lazily fetched.
getRegisteredEncodingStyleURIs() - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.
getRegistryObject() - Method in interface javax.xml.registry.infomodel.AuditableEvent
Gets the RegistryObject associated with this AuditableEvent.
getRegistryObject() - Method in interface javax.xml.registry.infomodel.ExternalIdentifier
Gets the parent RegistryObject for this ExternalIdentifier.
getRegistryObject(String, String) - Method in interface javax.xml.registry.QueryManager
Gets the RegistryObject specified by the Id and type of object.
getRegistryObject(String) - Method in interface javax.xml.registry.QueryManager
Gets the RegistryObject specified by the Id.
getRegistryObjects() - Method in interface javax.xml.registry.infomodel.RegistryPackage
Gets the collection of member RegistryObjects of this RegistryPackage.
getRegistryObjects(Collection) - Method in interface javax.xml.registry.QueryManager
Gets the specified RegistryObjects.
getRegistryObjects(Collection, String) - Method in interface javax.xml.registry.QueryManager
Gets the specified RegistryObjects.
getRegistryObjects() - Method in interface javax.xml.registry.QueryManager
Gets the RegistryObjects owned by the caller.
getRegistryObjects(String) - Method in interface javax.xml.registry.QueryManager
Gets the RegistryObjects owned by the caller, that are of the specified type.
getRegistryPackages() - Method in interface javax.xml.registry.infomodel.RegistryObject
Returns the Package associated with this object.
getRegistryService() - Method in interface javax.xml.registry.Connection
Gets the RegistryService interface associated with the Connection.
getRegistryService() - Method in interface javax.xml.registry.LifeCycleManager
Returns the parent RegistryService that created this object.
getRegistryService() - Method in interface javax.xml.registry.QueryManager
Returns the parent RegistryService that created this object.
getRel() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the rel property.
getRel() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the rel property.
getRelay() - Method in interface javax.xml.soap.SOAPHeaderElement
Returns the boolean value of the relay attribute for this SOAPHeaderElement
getReliableURN() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
The "reliable" URN indicated in the TLD (the uri element).
getRemainder() - Method in class javax.mail.internet.HeaderTokenizer
Return the rest of the Header.
getRemaining() - Method in class javax.servlet.jsp.JspWriter
This method returns the number of unused bytes in the buffer.
getRemoteAddr() - Method in interface javax.servlet.ServletRequest
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
getRemoteAddr() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getRemoteAddr() on the wrapped request object.
getRemoteHost() - Method in interface javax.servlet.ServletRequest
Returns the fully qualified name of the client or the last proxy that sent the request.
getRemoteHost() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getRemoteHost() on the wrapped request object.
getRemoteInterfaceClass() - Method in interface javax.ejb.EJBMetaData
Obtain the Class object for the enterprise Bean's remote interface.
getRemotePort() - Method in interface javax.servlet.ServletRequest
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
getRemotePort() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getRemotePort() on the wrapped request object.
getRemoteUser() - Method in class javax.faces.context.ExternalContext
Return the login name of the user making the current request if any; otherwise, return null.
getRemoteUser() - Method in interface javax.servlet.http.HttpServletRequest
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
getRemoteUser() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getRemoteUser() on the wrapped request object.
getRemoveCount() - Method in interface javax.management.j2ee.statistics.EJBStats
Number of times remove was called.
getRenderer(FacesContext) - Method in class javax.faces.component.UIComponent
Convenience method to return the Renderer instance associated with this component, if any; otherwise, return null.
getRenderer(FacesContext) - Method in class javax.faces.component.UIComponentBase

getRenderer(String, String) - Method in class javax.faces.render.RenderKit
Return the Renderer instance most recently registered for the specified component family and rendererType, if any; otherwise, return null.
getRendererType() - Method in class javax.faces.component.UIComponent
Return the Renderer type for this UIComponent (if any).
getRendererType() - Method in class javax.faces.component.UIComponentBase

getRendererType() - Method in class javax.faces.webapp.UIComponentTagBase
Return the rendererType property that selects the Renderer to be used for encoding this component, or null to ask the component to render itself directly.
getRenderKit() - Method in class javax.faces.context.FacesContext
Return the RenderKit instance for the render kit identifier specified on our UIViewRoot, if there is one.
getRenderKit(FacesContext, String) - Method in class javax.faces.render.RenderKitFactory
Return a RenderKit instance for the specified render kit identifier, possibly customized based on dynamic characteristics of the specified FacesContext, if non-null.
getRenderKitId() - Method in class javax.faces.component.UIViewRoot
Return the render kit identifier of the RenderKit associated with this view.
getRenderKitIds() - Method in class javax.faces.render.RenderKitFactory
Return an Iterator over the set of render kit identifiers registered with this factory.
getRenderResponse() - Method in class javax.faces.context.FacesContext
Return true if the renderResponse() method has been called for the current request.
getRendersChildren() - Method in class javax.faces.component.UIComponent
Return a flag indicating whether this component is responsible for rendering its child components.
getRendersChildren() - Method in class javax.faces.component.UIComponentBase

getRendersChildren() - Method in class javax.faces.render.Renderer
Return a flag indicating whether this Renderer is responsible for rendering the children the component it is asked to render.
getReplacementText() - Method in interface javax.xml.stream.events.EntityDeclaration
The replacement text of the entity.
getReplyTo() - Method in class javax.mail.internet.MimeMessage
Return the value of the RFC 822 "Reply-To" header field.
getReplyTo() - Method in class javax.mail.Message
Get the addresses to which replies should be directed.
getRepositoryItem() - Method in interface javax.xml.registry.infomodel.ExtrinsicObject
Gets the repository item for this object.
getRepresentationClass() - Method in class javax.activation.ActivationDataFlavor
Return the representation class.
getRequest() - Method in class javax.faces.context.ExternalContext
Return the environment-specific object instance for the current request.
getRequest() - Method in class javax.servlet.jsp.PageContext
The current value of the request object (a ServletRequest).
getRequest() - Method in class javax.servlet.ServletRequestWrapper
Return the wrapped request object.
getRequestCharacterEncoding() - Method in class javax.faces.context.ExternalContext
Return the character encoding currently being used to interpret this request.
getRequestContentType() - Method in class javax.faces.context.ExternalContext
Return the MIME Content-Type for this request.
getRequestContext() - Method in interface javax.xml.ws.BindingProvider
Get the context that is used to initialize the message context for request messages.
getRequestContextPath() - Method in class javax.faces.context.ExternalContext
Return the portion of the request URI that identifies the web application context for this request.
getRequestCookieMap() - Method in class javax.faces.context.ExternalContext
Return an immutable Map whose keys are the set of cookie names included in the current request, and whose values (of type javax.servlet.http.Cookie) are the first (or only) cookie for each cookie name returned by the underlying request.
getRequestDispatcher(String) - Method in interface javax.servlet.ServletContext
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.
getRequestDispatcher(String) - Method in interface javax.servlet.ServletRequest
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.
getRequestDispatcher(String) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.
getRequestedSessionId() - Method in interface javax.servlet.http.HttpServletRequest
Returns the session ID specified by the client.
getRequestedSessionId() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getRequestedSessionId() on the wrapped request object.
getRequestHeaderMap() - Method in class javax.faces.context.ExternalContext
Return an immutable Map whose keys are the set of request header names included in the current request, and whose values (of type String) are the first (or only) value for each header name returned by the underlying request.
getRequestHeaderValuesMap() - Method in class javax.faces.context.ExternalContext
Return an immutable Map whose keys are the set of request header names included in the current request, and whose values (of type String[]) are all of the value for each header name returned by the underlying request.
getRequestId() - Method in exception javax.xml.registry.JAXRException

getRequestId() - Method in interface javax.xml.registry.JAXRResponse
Returns the unique id for the request that generated this response.
getRequestingPort() - Method in class javax.mail.Authenticator

getRequestingPrompt() - Method in class javax.mail.Authenticator

getRequestingProtocol() - Method in class javax.mail.Authenticator
Give the protocol that's requesting the connection.
getRequestingSite() - Method in class javax.mail.Authenticator

getRequestLocale() - Method in class javax.faces.context.ExternalContext
Return the preferred Locale in which the client will accept content.
getRequestLocales() - Method in class javax.faces.context.ExternalContext
Return an Iterator over the preferred Locales specified in the request, in decreasing order of preference.
getRequestMap() - Method in class javax.faces.context.ExternalContext
Return a mutable Map representing the request scope attributes for the current application.
getRequestParameterMap() - Method in class javax.faces.context.ExternalContext
Return an immutable Map whose keys are the set of request parameters names included in the current request, and whose values (of type String) are the first (or only) value for each parameter name returned by the underlying request.
getRequestParameterNames() - Method in class javax.faces.context.ExternalContext
Return an Iterator over the names of all request parameters included in the current request.
getRequestParameterValuesMap() - Method in class javax.faces.context.ExternalContext
Return an immutable Map whose keys are the set of request parameters names included in the current request, and whose values (of type String[]) are all of the values for each parameter name returned by the underlying request.
getRequestPathInfo() - Method in class javax.faces.context.ExternalContext
Return the extra path information (if any) included in the request URI; otherwise, return null.
getRequestServletPath() - Method in class javax.faces.context.ExternalContext
Return the servlet path information (if any) included in the request URI; otherwise, return null.
getRequestURI() - Method in interface javax.servlet.http.HttpServletRequest
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
getRequestURI() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getRequestURI() on the wrapped request object.
getRequestURI() - Method in class javax.servlet.jsp.ErrorData
Returns the request URI.
getRequestURL() - Method in interface javax.servlet.http.HttpServletRequest
Reconstructs the URL the client used to make the request.
getRequestURL() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getRequestURL() on the wrapped request object.
getRequestURL(HttpServletRequest) - Static method in class javax.servlet.http.HttpUtils
Deprecated. Reconstructs the URL the client used to make the request, using information in the HttpServletRequest object.
getRequiredMessage() - Method in class javax.faces.component.UIInput
If there has been a call to UIInput.setRequiredMessage(java.lang.String) on this instance, return the message.
getRequiredVersion() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
A string describing the required version of the JSP container.
getResource(String) - Method in class javax.faces.context.ExternalContext
Return a URL for the application resource mapped to the specified path, if it exists; otherwise, return null.
getResource(String) - Method in interface javax.servlet.ServletContext
Returns a URL to the resource that is mapped to a specified path.
getResource(Object) - Method in interface javax.transaction.TransactionSynchronizationRegistry
Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
getResourceAdapter() - Method in interface javax.resource.spi.ResourceAdapterAssociation
Get the associated ResourceAdapter object.
getResourceAsStream(String) - Method in class javax.faces.context.ExternalContext
Return an InputStream for an application resource mapped to the specified path, if it exists; otherwise, return null.
getResourceAsStream(String) - Method in interface javax.servlet.ServletContext
Returns the resource located at the named path as an InputStream object.
getResourceBundle(FacesContext, String) - Method in class javax.faces.application.Application
Find a ResourceBundle as defined in the application configuration resources under the specified name.
getResourcePaths(String) - Method in class javax.faces.context.ExternalContext
Return the Set of resource paths for all application resources whose resource path starts with the specified argument.
getResourcePaths(String) - Method in interface javax.servlet.ServletContext
Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.
getResourceURL(FacesContext, String) - Method in class javax.faces.application.ViewHandler
Return a URL suitable for rendering (after optional encoding perfomed by the encodeResourceURL() method of ExternalContext) that selects the specifed web application resource.
getResourceURL(FacesContext, String) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.getResourceURL(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
getResponse() - Method in class javax.faces.context.ExternalContext
Return the environment-specific object instance for the current response.
getResponse() - Method in class javax.servlet.jsp.PageContext
The current value of the response object (a ServletResponse).
getResponse() - Method in class javax.servlet.ServletResponseWrapper
Return the wrapped ServletResponse object.
getResponseCharacterEncoding() - Method in class javax.faces.context.ExternalContext
Returns the name of the character encoding (MIME charset) used for the body sent in this response.
getResponseComplete() - Method in class javax.faces.context.FacesContext
Return true if the responseComplete() method has been called for the current request.
getResponseContentType() - Method in class javax.faces.context.ExternalContext
Return the MIME Content-Type for this response.
getResponseContext() - Method in interface javax.xml.ws.BindingProvider
Get the context that resulted from processing a response message.
getResponseStateManager() - Method in class javax.faces.render.RenderKit
Return an instance of ResponseStateManager to handle rendering technology specific state management decisions.
getResponseStream() - Method in class javax.faces.context.FacesContext
Return the ResponseStream to which components should direct their binary output.
getResponseWriter() - Method in class javax.faces.context.FacesContext
Return the ResponseWriter to which components should direct their character-based output.
getResult() - Method in interface javax.xml.bind.UnmarshallerHandler
Obtains the unmarshalled result.
getResult() - Method in class javax.xml.bind.util.JAXBResult
Gets the unmarshalled object created by the transformation.
getResult() - Method in class javax.xml.soap.SAAJResult

getResultList() - Method in interface javax.persistence.Query
Execute a SELECT query and return the query results as a List.
getResultSetInfo() - Method in interface javax.resource.cci.Connection
Gets the information on the ResultSet functionality supported by a connected EIS instance.
getResultTargetModuleIDs() - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
Retrieve the list of TargetModuleIDs successfully processed or created by the associated DeploymentManager operation.
getReturnType() - Method in class javax.el.MethodInfo
Returns the return type of the method
getReturnType() - Method in interface javax.xml.rpc.Call
Gets the return type for a specific operation
getRev() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the rev property.
getRev() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the rev property.
getRole() - Method in interface javax.xml.soap.SOAPHeaderElement
Returns the value of the Role attribute of this SOAPHeaderElement.
getRoles() - Method in interface javax.xml.rpc.handler.HandlerChain
Gets SOAP actor roles registered for this HandlerChain at this SOAP node.
getRoles() - Method in interface javax.xml.rpc.handler.soap.SOAPMessageContext
Gets the SOAP actor roles associated with an execution of the HandlerChain and its contained Handler instances.
getRoles() - Method in interface javax.xml.ws.handler.soap.SOAPMessageContext
Gets the SOAP actor roles associated with an execution of the handler chain.
getRoles() - Method in interface javax.xml.ws.soap.SOAPBinding
Gets the roles played by the SOAP binding instance.
getRollbackOnly() - Method in interface javax.ejb.EJBContext
Test if the transaction has been marked for rollback only.
getRollbackOnly() - Method in interface javax.persistence.EntityTransaction
Determine whether the current transaction has been marked for rollback.
getRollbackOnly() - Method in interface javax.transaction.TransactionSynchronizationRegistry
Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
getRolledbackCount() - Method in interface javax.management.j2ee.statistics.JTAStats
Number of rolled-back transactions.
getRoot() - Method in interface javax.enterprise.deploy.model.DDBean
Return the root element for this DDBean.
getRootCause() - Method in exception javax.servlet.jsp.el.ELException
Deprecated. Returns the root cause.
getRootCause() - Method in exception javax.servlet.jsp.JspException
Deprecated. As of JSP 2.1, replaced by Throwable.getCause()
getRootCause() - Method in exception javax.servlet.ServletException
Returns the exception that caused this servlet exception.
getRootOrganization() - Method in interface javax.xml.registry.infomodel.Organization
Gets the root organization.
getRowClasses() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the rowClasses property.
getRowClasses() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the rowClasses property.
getRowCount() - Method in class javax.faces.component.UIData
Return the number of rows in the underlying data model.
getRowCount() - Method in class javax.faces.model.ArrayDataModel
If there is wrappedData available, return the length of the array.
getRowCount() - Method in class javax.faces.model.DataModel
Return the number of rows of data objects represented by this DataModel.
getRowCount() - Method in class javax.faces.model.ListDataModel
If there is wrappedData available, return the length of the list.
getRowCount() - Method in class javax.faces.model.ResultDataModel
If there is wrappedData available, return the length of the array returned by calling getRows() on the underlying Result.
getRowCount() - Method in class javax.faces.model.ResultSetDataModel
Return -1, since ResultSet does not provide a standard way to determine the number of available rows without scrolling through the entire ResultSet, and this can be very expensive if the number of rows is large.
getRowCount() - Method in class javax.faces.model.ScalarDataModel
If there is wrappedData available, return 1.
getRowData() - Method in class javax.faces.component.UIData
Return the data object representing the data for the currently selected row index, if any.
getRowData() - Method in class javax.faces.model.ArrayDataModel
If row data is available, return the array element at the index specified by rowIndex.
getRowData() - Method in class javax.faces.model.DataModel
Return an object representing the data for the currenty selected row index.
getRowData() - Method in class javax.faces.model.DataModelEvent
Return the object representing the data for the specified row index, or null for no associated row data.
getRowData() - Method in class javax.faces.model.ListDataModel
If row data is available, return the array element at the index specified by rowIndex.
getRowData() - Method in class javax.faces.model.ResultDataModel
If row data is available, return the SortedMap array element at the index specified by rowIndex of the array returned by calling getRows() on the underlying Result.
getRowData() - Method in class javax.faces.model.ResultSetDataModel
If row data is available, return a Map representing the values of the columns for the row specified by rowIndex, keyed by the corresponding column names.
getRowData() - Method in class javax.faces.model.ScalarDataModel
If wrapped data is available, return the wrapped data instance.
getRowIndex() - Method in class javax.faces.component.UIData
Return the zero-relative index of the currently selected row.
getRowIndex() - Method in class javax.faces.model.ArrayDataModel

getRowIndex() - Method in class javax.faces.model.DataModel
Return the zero-relative index of the currently selected row.
getRowIndex() - Method in class javax.faces.model.DataModelEvent
Return the row index for this event, or -1 for no specific row.
getRowIndex() - Method in class javax.faces.model.ListDataModel

getRowIndex() - Method in class javax.faces.model.ResultDataModel

getRowIndex() - Method in class javax.faces.model.ResultSetDataModel

getRowIndex() - Method in class javax.faces.model.ScalarDataModel

getRows() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the rows property.
getRows() - Method in class javax.faces.component.UIData
Return the number of rows to be displayed, or zero for all remaining rows in the table.
getRules() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the rules property.
getRules() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the rules property.
getRunningModules(ModuleType, Target[]) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Retrieve the list of J2EE application modules distributed to the identified targets and that are currently running on the associated server or servers.
getSchema() - Method in class javax.xml.bind.Binder
Gets the last Schema object (including null) set by the Binder.setSchema(Schema) method.
getSchema() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

getSchema() - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

getSchema() - Method in interface javax.xml.bind.Marshaller
Get the JAXP 1.3 Schema object being used to perform marshal-time validation.
getSchema() - Method in interface javax.xml.bind.Unmarshaller
Get the JAXP 1.3 Schema object being used to perform unmarshal-time validation.
getSchemaLocation() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for getting the current schemaLocation.
getSchemaType() - Method in interface javax.xml.stream.events.XMLEvent
This method is provided for implementations to provide optional type information about the associated event.
getScheme() - Method in interface javax.servlet.ServletRequest
Returns the name of the scheme used to make this request, for example, http, https, or ftp.
getScheme() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getScheme() on the wrapped request object.
getScope() - Method in class javax.servlet.jsp.tagext.TagVariableInfo
The body of the <scope> element.
getScope() - Method in class javax.servlet.jsp.tagext.VariableInfo
Returns the lexical scope of the variable.
getScope() - Method in class javax.xml.bind.JAXBElement
Returns scope of xml element declaration.
getScope(String) - Method in interface javax.xml.ws.handler.MessageContext
Gets the scope of a property.
getSecure() - Method in class javax.servlet.http.Cookie
Returns true if the browser is sending cookies only over a secure protocol, or false if the browser can send cookies using any protocol.
getSelectedValues() - Method in class javax.faces.component.UISelectMany
Return the currently selected values, or null if there are no currently selected values.
getSelectItems() - Method in class javax.faces.model.SelectItemGroup
Return the set of subordinate SelectItems for this group.
getSender() - Method in class javax.mail.internet.MimeMessage
Returns the value of the RFC 822 "Sender" header field.
getSentDate() - Method in class javax.mail.internet.MimeMessage
Returns the value of the RFC 822 "Date" field.
getSentDate() - Method in class javax.mail.Message
Get the date this message was sent.
getSentMailCount() - Method in interface javax.management.j2ee.statistics.JavaMailStats
The number of mail messages sent.
getSeparator() - Method in class javax.mail.Folder
Return the delimiter character that separates this Folder's pathname from the names of immediate subfolders.
getSerializer(Class, QName) - Method in interface javax.xml.rpc.encoding.TypeMapping
Gets the SerializerFactory registered for the specified pair of Java type and XML data type.
getSerializerAs(String) - Method in interface javax.xml.rpc.encoding.SerializerFactory
Returns a Serializer for the specified XML processing mechanism type.
getServerInfo() - Method in interface javax.servlet.ServletContext
Returns the name and version of the servlet container on which the servlet is running.
getServerName() - Method in interface javax.servlet.ServletRequest
Returns the host name of the server to which the request was sent.
getServerName() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getServerName() on the wrapped request object.
getServerPort() - Method in interface javax.servlet.ServletRequest
Returns the port number to which the request was sent.
getServerPort() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getServerPort() on the wrapped request object.
getServerSession() - Method in interface javax.jms.ServerSessionPool
Return a server session from the pool.
getServerSessionPool() - Method in interface javax.jms.ConnectionConsumer
Gets the server session pool associated with this connection consumer.
getService() - Method in interface javax.xml.registry.infomodel.ServiceBinding
Gets the parent service for which this is a binding.
getServiceBinding() - Method in interface javax.xml.registry.infomodel.SpecificationLink
Gets the parent ServiceBinding for this SpecificationLink.
getServiceBindings() - Method in interface javax.xml.registry.infomodel.Service
Gets all children ServiceBindings.
getServiceName() - Method in interface javax.xml.rpc.Service
Gets the name of this service.
getServiceName() - Method in interface javax.xml.ws.handler.PortInfo
Gets the qualified name of the WSDL service name containing the port being accessed.
getServiceName() - Method in class javax.xml.ws.Service
Gets the name of this service.
getServiceName() - Method in class javax.xml.ws.spi.ServiceDelegate
Gets the name of this service.
getServices() - Method in interface javax.xml.registry.infomodel.Organization
Gets all children Services.
getServiceTime() - Method in interface javax.management.j2ee.statistics.ServletStats
Execution times for the methods.
getServlet(String) - Method in interface javax.servlet.ServletContext
Deprecated. As of Java Servlet API 2.1, with no direct replacement.
This method was originally defined to retrieve a servlet from a ServletContext. In this version, this method always returns null and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.
In lieu of this method, servlets can share information using the ServletContext class and can perform shared business logic by invoking methods on common non-servlet classes.
getServlet() - Method in exception javax.servlet.UnavailableException
Deprecated. As of Java Servlet API 2.2, with no replacement. Returns the servlet that is reporting its unavailability.
getServletConfig() - Method in class javax.faces.webapp.FacesServlet
Return the ServletConfig instance for this servlet.
getServletConfig() - Method in class javax.servlet.GenericServlet
Returns this servlet's ServletConfig object.
getServletConfig() - Method in class javax.servlet.jsp.PageContext
The ServletConfig instance.
getServletConfig() - Method in interface javax.servlet.Servlet
Returns a ServletConfig object, which contains initialization and startup parameters for this servlet.
getServletContext() - Method in interface javax.servlet.FilterConfig
Returns a reference to the ServletContext in which the caller is executing.
getServletContext() - Method in class javax.servlet.GenericServlet
Returns a reference to the ServletContext in which this servlet is running.
getServletContext() - Method in interface javax.servlet.http.HttpSession
Returns the ServletContext to which this session belongs.
getServletContext() - Method in class javax.servlet.jsp.PageContext
The ServletContext instance.
getServletContext() - Method in interface javax.servlet.ServletConfig
Returns a reference to the ServletContext in which the caller is executing.
getServletContext() - Method in class javax.servlet.ServletContextEvent
Return the ServletContext that changed.
getServletContext() - Method in class javax.servlet.ServletRequestEvent
Returns the ServletContext of this web application.
getServletContext() - Method in interface javax.xml.rpc.server.ServletEndpointContext
The method getServletContext returns the ServletContext associated with the web application that contain this endpoint.
getServletContextName() - Method in interface javax.servlet.ServletContext
Returns the name of this web application corresponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.
getServletInfo() - Method in class javax.faces.webapp.FacesServlet
Return information about this Servlet.
getServletInfo() - Method in class javax.servlet.GenericServlet
Returns information about the servlet, such as author, version, and copyright.
getServletInfo() - Method in interface javax.servlet.Servlet
Returns information about the servlet, such as author, version, and copyright.
getServletName() - Method in class javax.servlet.GenericServlet
Returns the name of this servlet instance.
getServletName() - Method in class javax.servlet.jsp.ErrorData
Returns the name of the servlet invoked.
getServletName() - Method in interface javax.servlet.ServletConfig
Returns the name of this servlet instance.
getServletNames() - Method in interface javax.servlet.ServletContext
Deprecated. As of Java Servlet API 2.1, with no replacement.
This method was originally defined to return an Enumeration of all the servlet names known to this context. In this version, this method always returns an empty Enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.
getServletPath() - Method in interface javax.servlet.http.HttpServletRequest
Returns the part of this request's URL that calls the servlet.
getServletPath() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getServletPath() on the wrapped request object.
getServletRequest() - Method in class javax.servlet.ServletRequestEvent
Returns the ServletRequest that is changing.
getServlets() - Method in interface javax.servlet.ServletContext
Deprecated. As of Java Servlet API 2.0, with no replacement.
This method was originally defined to return an Enumeration of all the servlets known to this servlet context. In this version, this method always returns an empty enumeration and remains only to preserve binary compatibility. This method will be permanently removed in a future version of the Java Servlet API.
getSession(boolean) - Method in class javax.faces.context.ExternalContext
If the create parameter is true, create (if necessary) and return a session instance associated with the current request.
getSession() - Method in interface javax.jms.ServerSession
Return the ServerSession's Session.
getSession() - Method in interface javax.jms.XASession
Gets the session associated with this XASession.
getSession() - Method in class javax.mail.MessageContext
Return the Session we're operating in.
getSession(boolean) - Method in interface javax.servlet.http.HttpServletRequest
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.
getSession() - Method in interface javax.servlet.http.HttpServletRequest
Returns the current session associated with this request, or if the request does not have a session, creates one.
getSession(boolean) - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getSession(boolean create) on the wrapped request object.
getSession() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getSession() on the wrapped request object.
getSession() - Method in class javax.servlet.http.HttpSessionBindingEvent
Return the session that changed.
getSession(String) - Method in interface javax.servlet.http.HttpSessionContext
Deprecated. As of Java Servlet API 2.1 with no replacement. This method must return null and will be removed in a future version of this API.
getSession() - Method in class javax.servlet.http.HttpSessionEvent
Return the session that changed.
getSession() - Method in class javax.servlet.jsp.PageContext
The current value of the session object (an HttpSession).
getSessionContext() - Method in interface javax.servlet.http.HttpSession
Deprecated. As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API.
getSessionMap() - Method in class javax.faces.context.ExternalContext
Return a mutable Map representing the session scope attributes for the current application.
getSessions() - Method in interface javax.management.j2ee.statistics.JMSConnectionStats
Returns an array of JMSSessionStats that provide statistics about the sessions associated with the referencing JMSConnectionStats.
getSeverity() - Method in class javax.faces.application.FacesMessage
Return the severity level.
getSeverity() - Method in class javax.xml.bind.helpers.ValidationEventImpl

getSeverity() - Method in interface javax.xml.bind.ValidationEvent
Retrieve the severity code for this warning/error.
getShape() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the shape property.
getShape() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the shape property.
getSharedNamespaces() - Method in class javax.mail.Store
Return a set of folders representing the shared namespaces.
getShort(String) - Method in interface javax.jms.MapMessage
Returns the short value with the specified name.
getShortName() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
The preferred short name (prefix) as indicated in the TLD.
getShortProperty(String) - Method in interface javax.jms.Message
Returns the value of the short property with the specified name.
getSingleResult() - Method in interface javax.persistence.Query
Execute a SELECT query that returns a single result.
getSize() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the size property.
getSize() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the size property.
getSize() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the size property.
getSize() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the size property.
getSize() - Method in class javax.mail.internet.MimeBodyPart
Return the size of the content of this body part in bytes.
getSize() - Method in class javax.mail.internet.MimeMessage
Return the size of the content of this message in bytes.
getSize() - Method in interface javax.mail.Part
Return the size of the content of this part in bytes.
getSize() - Method in class javax.xml.soap.AttachmentPart
Returns the number of bytes in this AttachmentPart object.
getSlot(String) - Method in interface javax.xml.registry.infomodel.ExtensibleObject
Gets the slot specified by slotName.
getSlots() - Method in interface javax.xml.registry.infomodel.ExtensibleObject
Returns the Slots associated with this object.
getSlotType() - Method in interface javax.xml.registry.infomodel.Slot
Gets the slotType for this Slot.
getSmallIcon() - Method in class javax.servlet.jsp.tagext.TagInfo
Get the path to the small icon.
getSOAPBody() - Method in class javax.xml.soap.SOAPMessage
Gets the SOAP Body contained in this SOAPMessage object.
getSOAPFactory() - Method in interface javax.xml.ws.soap.SOAPBinding
Gets the SAAJ SOAPFactory instance used by this SOAP binding.
getSOAPHeader() - Method in class javax.xml.soap.SOAPMessage
Gets the SOAP Header contained in this SOAPMessage object.
getSOAPPart() - Method in class javax.xml.soap.SOAPMessage
Gets the SOAP part of this SOAPMessage object.
getSourceObject() - Method in interface javax.xml.registry.infomodel.Association
Gets the Object that is the source of this Association.
getSpecificationLinks() - Method in interface javax.xml.registry.infomodel.ServiceBinding
Gets all children SpecificationLinks.
getSpecificationObject() - Method in interface javax.xml.registry.infomodel.SpecificationLink
Gets the specification object for this object.
getSpecificationVersion() - Method in class javax.servlet.jsp.JspEngineInfo
Return the version number of the JSP specification that is supported by this JSP engine.
getSpecVersion() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Returns a string representation of the version of the connector architecture specification that is supported by the resource adapter.
getStability() - Method in interface javax.xml.registry.infomodel.RegistryEntry
Gets the stability indicator for the RegistryEntry within the Registry.
getStartDuration() - Method in class javax.resource.spi.work.WorkEvent
Return the start interval duration.
getStartTime() - Method in interface javax.management.j2ee.statistics.Statistic
The time of the first measurement represented as a long, whose value is the number of milliseconds since January 1, 1970, 00:00:00.
getState() - Method in interface javax.enterprise.deploy.spi.status.DeploymentStatus
Retrieve the StateType value.
getState() - Method in class javax.faces.application.StateManager.SerializedView
Deprecated.
getState(FacesContext, String) - Method in class javax.faces.render.ResponseStateManager
The implementation must inspect the current request and return an Object representing the tree structure and component state passed in to a previous invocation of ResponseStateManager.writeState(javax.faces.context.FacesContext,java.lang.Object).
getStateManager() - Method in class javax.faces.application.Application
Return the StateManager instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
getStateOrProvince() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns the state or province.
getStateType(int) - Static method in class javax.enterprise.deploy.shared.StateType
Return an object of the specified value.
getStatistic(String) - Method in interface javax.management.j2ee.statistics.Stats
Get a Statistic by name.
getStatisticNames() - Method in interface javax.management.j2ee.statistics.Stats
Returns an array of Strings which are the names of the attributes from the specific Stats submodel that this object supports.
getStatistics() - Method in interface javax.management.j2ee.statistics.Stats
Returns an array containing all of the Statistic objects supported by this Stats object.
getStatus() - Method in interface javax.transaction.Transaction
Obtain the status of the transaction associated with the target Transaction object.
getStatus() - Method in interface javax.transaction.TransactionManager
Obtain the status of the transaction associated with the current thread.
getStatus() - Method in interface javax.transaction.UserTransaction
Obtain the status of the transaction associated with the current thread.
getStatus() - Method in interface javax.xml.registry.infomodel.RegistryEntry
Gets the life cycle status of the RegistryEntry within the registry.
getStatus() - Method in exception javax.xml.registry.JAXRException

getStatus() - Method in interface javax.xml.registry.JAXRResponse
Returns the status for this response.
getStatusCode() - Method in class javax.servlet.jsp.ErrorData
Returns the status code of the error.
getStatusCode() - Method in exception javax.xml.ws.http.HTTPException
Gets the HTTP status code.
getStore() - Method in class javax.mail.Folder
Returns the Store that owns this Folder object.
getStore() - Method in class javax.mail.Session
Get a Store object that implements this user's desired Store protocol.
getStore(String) - Method in class javax.mail.Session
Get a Store object that implements the specified protocol.
getStore(URLName) - Method in class javax.mail.Session
Get a Store object for the given URLName.
getStore(Provider) - Method in class javax.mail.Session
Get an instance of the store specified by Provider.
getStore() - Method in exception javax.mail.StoreClosedException
Returns the dead Store object
getStreet() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns the street name.
getStreetNumber() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns the street number.
getString(String) - Method in interface javax.jms.MapMessage
Returns the String value with the specified name.
getString() - Method in class javax.servlet.jsp.tagext.BodyContent
Return the value of the BodyContent as a String.
getStringProperty(String) - Method in interface javax.jms.Message
Returns the value of the String property with the specified name.
getStringTable() - Method in class javax.enterprise.deploy.shared.ActionType
Returns the string table for class ActionType
getStringTable() - Method in class javax.enterprise.deploy.shared.CommandType
Returns the string table for class CommandType
getStringTable() - Method in class javax.enterprise.deploy.shared.DConfigBeanVersionType
Returns the string table for class DConfigBeanVersionType
getStringTable() - Method in class javax.enterprise.deploy.shared.ModuleType
Returns the string table for class ModuleType
getStringTable() - Method in class javax.enterprise.deploy.shared.StateType
Returns the string table for class StateType
getStructure() - Method in class javax.faces.application.StateManager.SerializedView
Deprecated.
getStyle() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlForm
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlOutputFormat
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlOutputText
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlPanelGroup
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the style property.
getStyle() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the style property.
getStyleClass() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlForm
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlOutputFormat
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlOutputText
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlPanelGroup
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the styleClass property.
getStyleClass() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the styleClass property.
getSubject() - Method in class javax.mail.internet.MimeMessage
Returns the value of the "Subject" header field.
getSubject() - Method in class javax.mail.Message
Get the subject of this message.
getSubmittedValue() - Method in interface javax.faces.component.EditableValueHolder
Return the submittedValue value of this component.
getSubmittedValue() - Method in class javax.faces.component.UIInput
Return the submittedValue value of this UIInput component.
getSubmittingOrganization() - Method in interface javax.xml.registry.infomodel.RegistryObject
Gets the Organization that submitted this RegistryObject.
getSubType() - Method in class javax.activation.MimeType
Retrieve the subtype of this object.
getSubType() - Method in class javax.mail.internet.ContentType
Return the subType.
getSummary() - Method in class javax.faces.application.FacesMessage
Return the localized summary text.
getSummary() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the summary property.
getSummary() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the summary property.
getSupportedEncodings() - Method in interface javax.xml.rpc.encoding.TypeMapping
Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance.
getSupportedLocales() - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Returns an array of supported locales for this implementation.
getSupportedLocales() - Method in class javax.faces.application.Application
Return an Iterator over the supported Locales for this appication.
getSupportedMechanismTypes() - Method in interface javax.xml.rpc.encoding.DeserializerFactory
Returns a list of all XML processing mechanism types supported by this DeserializerFactory.
getSupportedMechanismTypes() - Method in interface javax.xml.rpc.encoding.SerializerFactory
Returns a list of all XML processing mechanism types supported by this SerializerFactory.
getSystemFlags() - Method in class javax.mail.Flags
Return all the system flags in this Flags object.
getSystemId() - Method in interface javax.xml.stream.events.EntityDeclaration
The entity's system identifier.
getSystemId() - Method in interface javax.xml.stream.events.NotationDeclaration
The notation's system identifier, or null if none was given.
getSystemId() - Method in interface javax.xml.stream.events.StartDocument
Returns the system ID of the XML data
getSystemId() - Method in interface javax.xml.stream.Location
Returns the system ID of the XML
getTabindex() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the tabindex property.
getTabindex() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the tabindex property.
getTag(String) - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
Get the TagInfo for a given tag name, looking through all the tags in this tag library.
getTagClassName() - Method in class javax.servlet.jsp.tagext.TagInfo
Name of the class that provides the handler for this tag.
getTagExtraInfo() - Method in class javax.servlet.jsp.tagext.TagInfo
The instance (if any) for extra tag information.
getTagFile(String) - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
Get the TagFileInfo for a given tag name, looking through all the tag files in this tag library.
getTagFiles() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
An array describing the tag files that are defined in this tag library.
getTagInfo() - Method in class javax.servlet.jsp.tagext.TagExtraInfo
Get the TagInfo for this class.
getTagInfo() - Method in class javax.servlet.jsp.tagext.TagFileInfo
Returns information about this tag, parsed from the directives in the tag file.
getTagLibrary() - Method in class javax.servlet.jsp.tagext.TagInfo
The instance of TabLibraryInfo we belong to.
getTagLibraryInfos() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
Returns an array of TagLibraryInfo objects representing the entire set of tag libraries (including this TagLibraryInfo) imported by taglib directives in the translation unit that references this TagLibraryInfo.
getTagName() - Method in class javax.servlet.jsp.tagext.TagInfo
The name of the Tag.
getTags() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
An array describing the tags that are defined in this tag library.
getTagVariableInfos() - Method in class javax.servlet.jsp.tagext.TagInfo
Get TagVariableInfo objects associated with this TagInfo.
getTarget() - Method in interface javax.enterprise.deploy.spi.TargetModuleID
Retrieve the name of the target server.
getTarget() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the target property.
getTarget() - Method in class javax.faces.component.html.HtmlForm
Return the value of the target property.
getTarget() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the target property.
getTarget() - Method in interface javax.interceptor.InvocationContext
Returns the target instance.
getTarget() - Method in interface javax.xml.stream.events.ProcessingInstruction
The target section of the processing instruction
getTargetBinding() - Method in interface javax.xml.registry.infomodel.ServiceBinding
Gets the next ServiceBinding in case there is a redirection from one service provider to another service provider.
getTargetEndpointAddress() - Method in interface javax.xml.rpc.Call
Gets the address of a target service endpoint.
getTargetModuleID() - Method in class javax.enterprise.deploy.spi.status.ProgressEvent
Retrieve the TargetModuleID for this event
getTargetObject() - Method in interface javax.xml.registry.infomodel.Association
Gets the Object that is the target of this Association.
getTargets() - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Retrieve the list of deployment targets supported by this DeploymentManager.
getTelephoneNumbers(String) - Method in interface javax.xml.registry.infomodel.Organization
Gets the telephone numbers for this User that match the specified telephone number type.
getTelephoneNumbers(String) - Method in interface javax.xml.registry.infomodel.User
Gets the telephone numbers for this User that match the specified telephone number type.
getTerm() - Method in class javax.mail.search.NotTerm
Return the term to negate.
getTerms() - Method in class javax.mail.search.AndTerm
Return the search terms.
getTerms() - Method in class javax.mail.search.OrTerm
Return the search terms.
getTestSet() - Method in class javax.mail.search.FlagTerm
Return true if testing whether the flags are set.
getText() - Method in interface javax.enterprise.deploy.model.DDBean
Returns the XML text for by this bean.
getText(String) - Method in interface javax.enterprise.deploy.model.DDBean
Return a list of text values for a given XPath in the deployment descriptor.
getText(String) - Method in interface javax.enterprise.deploy.model.DeployableObject
Return the XML content associated with the XPath from a deployment descriptor.
getText(ModuleType, String) - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Return the text value from the XPath; search only the deployment descriptors of the specified type.
getText() - Method in interface javax.jms.TextMessage
Gets the string containing this message's data.
getText() - Method in interface javax.xml.stream.events.Comment
Return the string data of the comment, returns empty string if it does not exist
getText() - Method in class javax.xml.stream.util.StreamReaderDelegate

getText() - Method in interface javax.xml.stream.XMLStreamReader
Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD.
getTextCharacters(int, char[], int, int) - Method in class javax.xml.stream.util.StreamReaderDelegate

getTextCharacters() - Method in class javax.xml.stream.util.StreamReaderDelegate

getTextCharacters() - Method in interface javax.xml.stream.XMLStreamReader
Returns an array which contains the characters from this event.
getTextCharacters(int, char[], int, int) - Method in interface javax.xml.stream.XMLStreamReader
Gets the the text associated with a CHARACTERS, SPACE or CDATA event.
getTextLength() - Method in class javax.xml.stream.util.StreamReaderDelegate

getTextLength() - Method in interface javax.xml.stream.XMLStreamReader
Returns the length of the sequence of characters for this Text event within the text character array.
getTextStart() - Method in class javax.xml.stream.util.StreamReaderDelegate

getTextStart() - Method in interface javax.xml.stream.XMLStreamReader
Returns the offset into the text character array where the first character (of this text event) is stored.
getThrowable() - Method in class javax.servlet.jsp.ErrorData
Returns the Throwable that caused the error.
getTimer() - Method in interface javax.ejb.TimerHandle
Obtain a reference to the timer represented by this handle.
getTimeRemaining() - Method in interface javax.ejb.Timer
Get the number of milliseconds that will elapse before the next scheduled timer expiration.
getTimers() - Method in interface javax.ejb.TimerService
Get all the active timers associated with this bean.
getTimerService() - Method in interface javax.ejb.EJBContext
Get access to the EJB Timer Service.
getTimestamp() - Method in interface javax.xml.registry.infomodel.AuditableEvent
Gets the Timestamp for when this event occurred.
getTimeStyle() - Method in class javax.faces.convert.DateTimeConverter
Return the style to be used to format or parse times.
getTimeToLive() - Method in interface javax.jms.MessageProducer
Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
getTimeZone() - Method in class javax.faces.convert.DateTimeConverter
Return the TimeZone used to interpret a time value.
getTitle() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlForm
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlOutputFormat
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlOutputText
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the title property.
getTitle() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the title property.
getTopic() - Method in interface javax.jms.TopicPublisher
Gets the topic associated with this TopicPublisher.
getTopic() - Method in interface javax.jms.TopicSubscriber
Gets the Topic associated with this subscriber.
getTopicName() - Method in interface javax.jms.Topic
Gets the name of this topic.
getTopicSession() - Method in interface javax.jms.XATopicSession
Gets the topic session associated with this XATopicSession.
getTotalTime() - Method in interface javax.management.j2ee.statistics.TimeStatistic
This is the sum total of time taken to complete every invocation of this operation since the beginning of this measurement.
getTransacted() - Method in interface javax.jms.Session
Indicates whether the session is in transacted mode.
getTransacted() - Method in interface javax.jms.XASession
Indicates whether the session is in transacted mode.
getTransaction() - Method in interface javax.persistence.EntityManager
Returns the resource-level transaction object.
getTransaction() - Method in interface javax.transaction.TransactionManager
Get the transaction object that represents the transaction context of the calling thread.
getTransactionKey() - Method in interface javax.transaction.TransactionSynchronizationRegistry
Return an opaque object to represent the transaction bound to the current thread at the time this method is called.
getTransactionStatus() - Method in interface javax.transaction.TransactionSynchronizationRegistry
Return the status of the transaction bound to the current thread at the time this method is called.
getTransactionTimeout() - Method in class javax.resource.spi.work.ExecutionContext
Get the transaction timeout value for a imported transaction.
getTransactionTimeout() - Method in interface javax.transaction.xa.XAResource
Obtains the current transaction timeout value set for this XAResource instance.
getTransactionType() - Method in interface javax.persistence.spi.PersistenceUnitInfo
Returns the transaction type of the entity managers created by the EntityManagerFactory.
getTransferData(DataFlavor, DataSource) - Method in interface javax.activation.DataContentHandler
Returns an object which represents the data to be transferred.
getTransferData(DataFlavor) - Method in class javax.activation.DataHandler
Returns an object that represents the data to be transferred.
getTransferDataFlavors() - Method in interface javax.activation.DataContentHandler
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
getTransferDataFlavors() - Method in class javax.activation.DataHandler
Return the DataFlavors in which this data is available.
getTransport() - Method in class javax.mail.Session
Get a Transport object that implements this user's desired Transport protcol.
getTransport(String) - Method in class javax.mail.Session
Get a Transport object that implements the specified protocol.
getTransport(URLName) - Method in class javax.mail.Session
Get a Transport object for the given URLName.
getTransport(Provider) - Method in class javax.mail.Session
Get an instance of the transport specified in the Provider.
getTransport(Address) - Method in class javax.mail.Session
Get a Transport object that can transport a Message to the specified address type.
getTreeStructureToRestore(FacesContext, String) - Method in class javax.faces.render.ResponseStateManager
Deprecated. This method has been replaced by ResponseStateManager.getState(javax.faces.context.FacesContext, java.lang.String). The default implementation returns null.
getTreeStructureToSave(FacesContext) - Method in class javax.faces.application.StateManager
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
getTreeStructureToSave(FacesContext) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.getTreeStructureToSave(javax.faces.context.FacesContext) on the wrapped StateManager object.
getType(ELContext, Object, Object) - Method in class javax.el.ArrayELResolver
If the base object is an array, returns the most general acceptable type for a value in this array.
getType(ELContext, Object, Object) - Method in class javax.el.BeanELResolver
If the base object is not null, returns the most general acceptable type that can be set on this bean property.
getType(ELContext, Object, Object) - Method in class javax.el.CompositeELResolver
For a given base and property, attempts to identify the most general type that is acceptable for an object to be passed as the value parameter in a future call to the CompositeELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) method.
getType(ELContext, Object, Object) - Method in class javax.el.ELResolver
For a given base and property, attempts to identify the most general type that is acceptable for an object to be passed as the value parameter in a future call to the ELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) method.
getType(ELContext, Object, Object) - Method in class javax.el.ListELResolver
If the base object is a list, returns the most general acceptable type for a value in this list.
getType(ELContext, Object, Object) - Method in class javax.el.MapELResolver
If the base object is a map, returns the most general acceptable type for a value in this map.
getType(ELContext, Object, Object) - Method in class javax.el.ResourceBundleELResolver
If the base object is an instance of ResourceBundle, return null, since the resolver is read only.
getType(ELContext) - Method in class javax.el.ValueExpression
Evaluates the expression relative to the provided context, and returns the most general type that is acceptable for an object to be passed as the value parameter in a future call to the ValueExpression.setValue(javax.el.ELContext, java.lang.Object) method.
getType() - Method in interface javax.enterprise.deploy.model.DDBeanRoot
Return the ModuleType of deployment descriptor.
getType() - Method in interface javax.enterprise.deploy.model.DeployableObject
Return the ModuleType of deployment descriptor (i.e., EAR, JAR, WAR, RAR) this deployable object represents.
getType() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the type property.
getType() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the type property.
getType() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the type property.
getType() - Method in class javax.faces.convert.DateTimeConverter
Return the type of value to be formatted or parsed.
getType() - Method in class javax.faces.convert.NumberConverter
Return the number type to be used when formatting and parsing numbers.
getType(FacesContext) - Method in class javax.faces.el.MethodBinding
Deprecated. Return the Java class representing the return type from the method identified by this method binding expression.
getType(Object, Object) - Method in class javax.faces.el.PropertyResolver
Deprecated. Return the java.lang.Class representing the type of the specified property.
getType(Object, int) - Method in class javax.faces.el.PropertyResolver
Deprecated. Return the java.lang.Class representing the type of the specified index.
getType(FacesContext) - Method in class javax.faces.el.ValueBinding
Deprecated. Return the type of the property represented by this ValueBinding, relative to the specified FacesContext.
getType() - Method in class javax.mail.Address
Return a type string that identifies this address type.
getType() - Method in class javax.mail.event.ConnectionEvent
Return the type of this event
getType() - Method in class javax.mail.event.FolderEvent
Return the type of this event.
getType() - Method in class javax.mail.event.MessageCountEvent
Return the type of this event.
getType() - Method in class javax.mail.event.TransportEvent
Return the type of this event.
getType() - Method in class javax.mail.Folder
Returns the type of this Folder, that is, whether this folder can hold messages or subfolders or both.
getType() - Method in class javax.mail.internet.HeaderTokenizer.Token
Return the type of the token.
getType() - Method in class javax.mail.internet.InternetAddress
Return the type of this address.
getType() - Method in class javax.mail.internet.NewsAddress
Return the type of this address.
getType() - Method in class javax.mail.Provider
Returns the type of this Provider
getType() - Method in class javax.resource.spi.work.WorkEvent
Return the type of this event.
getType(ELContext, Object, Object) - Method in class javax.servlet.jsp.el.ImplicitObjectELResolver
If the base object is null, and the property matches the name of a JSP implicit object, returns null to indicate that no types are ever accepted to setValue().
getType(ELContext, Object, Object) - Method in class javax.servlet.jsp.el.ScopedAttributeELResolver
If the base object is null, returns Object.class to indicate that any type is valid to set for a scoped attribute.
getType() - Method in interface javax.xml.registry.infomodel.EmailAddress
Gets the type for this object.
getType() - Method in interface javax.xml.registry.infomodel.PostalAddress
Returns the type of address (for example, "headquarters") as a String.
getType() - Method in interface javax.xml.registry.infomodel.TelephoneNumber
The type of telephone number (for example, "fax").
getType() - Method in interface javax.xml.registry.infomodel.User
Gets the type for this User.
getType() - Method in interface javax.xml.registry.Query
Gets the type of Query (for example, QUERY_TYPE_SQL).
getTypeMapping(String) - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Returns the registered TypeMapping for the specified encodingStyle URI.
getTypeMappingRegistry() - Method in interface javax.xml.rpc.Service
Gets the TypeMappingRegistry for this Service object.
getTypeName() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
The type (as a String) of this attribute.
getUID(Message) - Method in interface javax.mail.UIDFolder
Get the UID for the specified message.
getUIDValidity() - Method in interface javax.mail.UIDFolder
Returns the UIDValidity value associated with this folder.
getUnavailableSeconds() - Method in exception javax.servlet.UnavailableException
Returns the number of seconds the servlet expects to be temporarily unavailable.
getUnit() - Method in interface javax.management.j2ee.statistics.Statistic
The unit of measurement for this Statistic.
getUnmarshallerHandler() - Method in interface javax.xml.bind.Unmarshaller
Get an unmarshaller handler object that can be used as a component in an XML pipeline.
getUnreadMessageCount() - Method in class javax.mail.Folder
Get the total number of unread messages in this Folder.
getUpperBound() - Method in interface javax.management.j2ee.statistics.BoundaryStatistic
The upper limit of the value of this attribute.
getUpTime() - Method in interface javax.management.j2ee.statistics.JVMStats
Amount of time the JVM has been running.
getURI() - Method in class javax.servlet.jsp.tagext.TagLibraryInfo
The value of the uri attribute from the taglib directive for this library.
getURI() - Method in interface javax.xml.soap.Name
Returns the URI of the namespace for the XML name that this Name object represents.
getURL() - Method in class javax.activation.URLDataSource
Return the URL used to create this DataSource.
getUrl() - Method in class javax.faces.component.UIGraphic
Return the image URL for this UIGraphic.
getURL() - Method in class javax.mail.URLName
Constructs a URL from the URLName.
getURL() - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl

getURL() - Method in interface javax.xml.bind.ValidationEventLocator
Return the name of the XML source as a URL if available
getUrl() - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Gets the URL that can dial this number electronically.
getUrl() - Method in interface javax.xml.registry.infomodel.User
Gets the URL to the web page for this User.
getURLName() - Method in class javax.mail.Folder
Return a URLName representing this folder.
getURLName() - Method in class javax.mail.Service
Return a URLName representing this service.
getUsageDescription() - Method in interface javax.xml.registry.infomodel.SpecificationLink
Gets the description of usage parameters.
getUsageParameters() - Method in interface javax.xml.registry.infomodel.SpecificationLink
Gets any usage parameters.
getUsemap() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the usemap property.
getUser() - Method in interface javax.xml.registry.infomodel.AuditableEvent
Gets the User associated with this object.
getUserFlags() - Method in class javax.mail.Flags
Return all the user flags in this Flags object.
getUserName() - Method in class javax.mail.PasswordAuthentication

getUsername() - Method in class javax.mail.URLName
Returns the user name of this URLName.
getUserName() - Method in interface javax.resource.cci.ConnectionMetaData
Returns the user name for an active connection as known to the underlying EIS instance.
getUserName() - Method in interface javax.resource.spi.ManagedConnectionMetaData
Returns name of the user associated with the ManagedConnection instance.
getUserName() - Method in class javax.resource.spi.security.PasswordCredential
Returns the user name.
getUserNamespaces(String) - Method in class javax.mail.Store
Return a set of folders representing the namespaces for user.
getUserPrincipal() - Method in class javax.faces.context.ExternalContext
Return the Principal object containing the name of the current authenticated user, if any; otherwise, return null.
getUserPrincipal() - Method in interface javax.servlet.http.HttpServletRequest
Returns a java.security.Principal object containing the name of the current authenticated user.
getUserPrincipal() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getUserPrincipal() on the wrapped request object.
getUserPrincipal() - Method in interface javax.xml.rpc.server.ServletEndpointContext
Returns a java.security.Principal instance that contains the name of the authenticated user for the current method invocation on the endpoint instance.
getUserPrincipal() - Method in interface javax.xml.ws.WebServiceContext
Returns the Principal that identifies the sender of the request currently being serviced.
getUsers() - Method in interface javax.xml.registry.infomodel.Organization
Gets the Collection of Users affiliated with this Organization.
getUserTransaction() - Method in interface javax.ejb.EJBContext
Obtain the transaction demarcation interface.
getUserVersion() - Method in interface javax.xml.registry.infomodel.Versionable
Gets the user-specified revision number for this version of the Versionable object.
getUseTime() - Method in interface javax.management.j2ee.statistics.JCAConnectionStats
Returns the time spent using a connection
getUseTime() - Method in interface javax.management.j2ee.statistics.JDBCConnectionStats
Time spent using a connection.
getValidateURI() - Method in interface javax.xml.registry.infomodel.URIValidator
Gets whether to do URI validation for this object.
getValidator() - Method in interface javax.faces.component.EditableValueHolder
Deprecated. EditableValueHolder.getValidators() should be used instead.
getValidator() - Method in class javax.faces.component.UIInput
Deprecated. UIInput.getValidators() should be used instead.
getValidatorIds() - Method in class javax.faces.application.Application
Return an Iterator over the set of currently registered validator ids for this Application.
getValidatorMessage() - Method in class javax.faces.component.UIInput
If there has been a call to UIInput.setRequiredMessage(java.lang.String) on this instance, return the message.
getValidators() - Method in interface javax.faces.component.EditableValueHolder
Return the set of registered Validators for this component instance.
getValidators() - Method in class javax.faces.component.UIInput
Return the set of registered Validators for this UIInput instance.
getValidSentAddresses() - Method in class javax.mail.event.TransportEvent
Return the addresses to which this message was sent succesfully.
getValidSentAddresses() - Method in exception javax.mail.SendFailedException
Return the addresses to which this message was sent succesfully.
getValidUnsentAddresses() - Method in class javax.mail.event.TransportEvent
Return the addresses that are valid but to which this message was not sent.
getValidUnsentAddresses() - Method in exception javax.mail.SendFailedException
Return the addresses that are valid but to which this message was not sent.
getValue(ELContext, Object, Object) - Method in class javax.el.ArrayELResolver
If the base object is a Java language array, returns the value at the given index.
getValue(ELContext, Object, Object) - Method in class javax.el.BeanELResolver
If the base object is not null, returns the current value of the given property on this bean.
getValue(ELContext, Object, Object) - Method in class javax.el.CompositeELResolver
Attempts to resolve the given property object on the given base object by querying all component resolvers.
getValue(ELContext, Object, Object) - Method in class javax.el.ELResolver
Attempts to resolve the given property object on the given base object.
getValue(ELContext, Object, Object) - Method in class javax.el.ListELResolver
If the base object is a list, returns the value at the given index.
getValue(ELContext, Object, Object) - Method in class javax.el.MapELResolver
If the base object is a map, returns the value associated with the given key, as specified by the property argument.
getValue(ELContext, Object, Object) - Method in class javax.el.ResourceBundleELResolver
If the base object is an instance of ResourceBundle, the provided property will first be coerced to a String.
getValue(ELContext) - Method in class javax.el.ValueExpression
Evaluates the expression relative to the provided context, and returns the resulting value.
getValue() - Method in class javax.enterprise.deploy.shared.ActionType
Returns this enumeration value's integer value.
getValue() - Method in class javax.enterprise.deploy.shared.CommandType
Returns this enumeration value's integer value.
getValue() - Method in class javax.enterprise.deploy.shared.DConfigBeanVersionType
Returns this enumeration value's integer value.
getValue() - Method in class javax.enterprise.deploy.shared.ModuleType
Returns this enumeration value's integer value.
getValue() - Method in class javax.enterprise.deploy.shared.StateType
Returns this enumeration value's integer value.
getValue() - Method in class javax.faces.component.UICommand
Returns the value property of the UICommand.
getValue() - Method in class javax.faces.component.UIData
Return the value of the UIData.
getValue() - Method in class javax.faces.component.UIGraphic
Returns the value property of the UIGraphic.
getValue() - Method in class javax.faces.component.UIOutput

getValue() - Method in class javax.faces.component.UIParameter
Returns the value property of the UIParameter.
getValue() - Method in class javax.faces.component.UISelectItem
Returns the value property of the UISelectItem.
getValue() - Method in class javax.faces.component.UISelectItems
Returns the value property of the UISelectItems.
getValue() - Method in interface javax.faces.component.ValueHolder
Gets the value of this UIComponent.
getValue(Object, Object) - Method in class javax.faces.el.PropertyResolver
Deprecated. Return the value of the specified property from the specified base object.
getValue(Object, int) - Method in class javax.faces.el.PropertyResolver
Deprecated. Return the value at the specified index of the specified base object.
getValue(FacesContext) - Method in class javax.faces.el.ValueBinding
Deprecated. Return the value of the property represented by this ValueBinding, relative to the specified FacesContext.
getValue() - Method in class javax.faces.model.SelectItem
Return the value of this item, to be delivered to the model if this item is selected by the user.
getValue() - Method in class javax.mail.Header
Returns the value of this header.
getValue() - Method in class javax.mail.internet.HeaderTokenizer.Token
Returns the value of the token just read.
getValue() - Method in class javax.mail.internet.InternetHeaders.InternetHeader
Return the "value" part of the header line.
getValue() - Method in class javax.servlet.http.Cookie
Returns the value of the cookie.
getValue(String) - Method in interface javax.servlet.http.HttpSession
Deprecated. As of Version 2.2, this method is replaced by HttpSession.getAttribute(java.lang.String).
getValue() - Method in class javax.servlet.http.HttpSessionBindingEvent
Returns the value of the attribute that has been added, removed or replaced.
getValue(ELContext, Object, Object) - Method in class javax.servlet.jsp.el.ImplicitObjectELResolver
If the base object is null, and the property matches the name of a JSP implicit object, returns the implicit object.
getValue(ELContext, Object, Object) - Method in class javax.servlet.jsp.el.ScopedAttributeELResolver
If the base object is null, searches the page, request, session and application scopes for an attribute with the given name and returns it, or null if no attribute exists with the current name.
getValue(String) - Method in class javax.servlet.jsp.tagext.TagSupport
Get a the value associated with a key.
getValue() - Method in class javax.servlet.ServletContextAttributeEvent
Returns the value of the attribute that has been added, removed, or replaced.
getValue() - Method in class javax.servlet.ServletRequestAttributeEvent
Returns the value of the attribute that has been added, removed or replaced.
getValue() - Method in class javax.xml.bind.JAXBElement
Return the content model and attribute values for this element.
getValue(Object) - Static method in class javax.xml.bind.JAXBIntrospector
Get the element value of a JAXB element.
getValue() - Method in interface javax.xml.registry.infomodel.Classification
Gets the taxonomy value for this Classification.
getValue() - Method in interface javax.xml.registry.infomodel.Concept
Gets the value (usually a code in a taxonomy) associated with this Concept.
getValue() - Method in interface javax.xml.registry.infomodel.ExternalIdentifier
Gets the value of an ExternalIdentifier.
getValue() - Method in interface javax.xml.registry.infomodel.InternationalString
Gets the String value for the Locale returned by Locale.getDefault().
getValue(Locale) - Method in interface javax.xml.registry.infomodel.InternationalString
Gets the String value for the specified Locale.
getValue() - Method in interface javax.xml.registry.infomodel.LocalizedString
Get the String value for this object.
getValue() - Method in class javax.xml.soap.MimeHeader
Returns the value of this MimeHeader object.
getValue() - Method in interface javax.xml.soap.Node
Returns the value of this node if this is a Text node or the value of the immediate child of this node otherwise.
getValue() - Method in interface javax.xml.stream.events.Attribute
Gets the normalized value of this attribute
getValueBinding(String) - Method in class javax.faces.component.UIComponent
Deprecated. This has been replaced by UIComponent.getValueExpression(java.lang.String).
getValueBinding(String) - Method in class javax.faces.component.UIComponentBase
Deprecated. This has been replaced by UIComponent.getValueExpression(java.lang.String).
getValueBinding(String) - Method in class javax.faces.component.UIGraphic
Deprecated. This has been replaced by UIGraphic.getValueExpression(java.lang.String).
getValueBinding(String) - Method in class javax.faces.component.UISelectBoolean
Deprecated. This has been replaced by UISelectBoolean.getValueExpression(java.lang.String).
getValueBinding(String) - Method in class javax.faces.component.UISelectMany
Deprecated. this has been replaced by UISelectMany.getValueExpression(java.lang.String).
getValueChangeListener() - Method in interface javax.faces.component.EditableValueHolder
Deprecated. Use EditableValueHolder.getValueChangeListeners() instead.
getValueChangeListener() - Method in class javax.faces.component.UIInput

getValueChangeListeners() - Method in interface javax.faces.component.EditableValueHolder
Return the set of registered ValueChangeListeners for this component instance.
getValueChangeListeners() - Method in class javax.faces.component.UIInput
Return the set of registered ValueChangeListeners for this UIInput instance.
getValueExpression(String) - Method in class javax.faces.component.UIComponent
Return the ValueExpression used to calculate the value for the specified attribute or property name, if any.
getValueExpression(String) - Method in class javax.faces.component.UIGraphic
Return any ValueExpression set for value if a ValueExpression for url is requested; otherwise, perform the default superclass processing for this method.
getValueExpression(String) - Method in class javax.faces.component.UISelectBoolean
Return any ValueExpression set for value if a ValueExpression for selected is requested; otherwise, perform the default superclass processing for this method.
getValueExpression(String) - Method in class javax.faces.component.UISelectMany
Return any ValueExpression set for value if a ValueExpression for selectedValues is requested; otherwise, perform the default superclass processing for this method.
getValueNames() - Method in interface javax.servlet.http.HttpSession
Deprecated. As of Version 2.2, this method is replaced by HttpSession.getAttributeNames()
getValues() - Method in class javax.servlet.jsp.tagext.TagSupport
Enumerate the keys for the values kept by this tag handler.
getValues() - Method in interface javax.xml.registry.infomodel.Slot
Gets the values for this Slot.
getValueType() - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Gets the value type for this object.
getVar() - Method in class javax.faces.component.UIData
Return the request-scope attribute under which the data object for the current row will be exposed when iterating.
getVariableInfo(TagData) - Method in class javax.servlet.jsp.tagext.TagExtraInfo
information on scripting variables defined by the tag associated with this TagExtraInfo instance.
getVariableInfo(TagData) - Method in class javax.servlet.jsp.tagext.TagInfo
Information on the scripting objects created by this tag at runtime.
getVariableMapper() - Method in class javax.el.ELContext
Retrieves the VariableMapper associated with this ELContext.
getVariableResolver() - Method in class javax.faces.application.Application
Deprecated. This has been replaced by Application.getELResolver().
getVariableResolver() - Method in class javax.servlet.jsp.JspContext
Deprecated. As of JSP 2.1, replaced by ELContext.getELResolver(), which can be obtained by jspContext.getELContext().getELResolver().
getVarName() - Method in class javax.servlet.jsp.tagext.VariableInfo
Returns the name of the scripting variable.
getVendor() - Method in class javax.mail.Provider
Returns name of vendor associated with this implementation or null
getVersion() - Method in class javax.mail.Provider
Returns version of this implementation or null if no version
getVersion() - Method in class javax.servlet.http.Cookie
Returns the version of the protocol this cookie complies with.
getVersion() - Method in interface javax.xml.registry.CapabilityProfile
Gets the JAXR specification version supported by the JAXR provider.
getVersion() - Method in interface javax.xml.stream.events.StartDocument
Returns the version of XML of this XML stream
getVersion() - Method in class javax.xml.stream.util.StreamReaderDelegate

getVersion() - Method in interface javax.xml.stream.XMLStreamReader
Get the xml version declared on the xml declaration Returns null if none was declared
getViewHandler() - Method in class javax.faces.application.Application
Return the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
getViewId() - Method in exception javax.faces.application.ViewExpiredException
Return the view identifier of this exception, or null if the view identifier is nonexistent or unknown.
getViewId() - Method in class javax.faces.component.UIViewRoot
Return the view identifier for this view.
getViewRoot() - Method in class javax.faces.context.FacesContext
Return the root component that is associated with the this request.
getVisibleNamespacePrefixes() - Method in interface javax.xml.soap.SOAPElement
Returns an Iterator over the namespace prefix Strings visible to this element.
getWaitingThreadCount() - Method in interface javax.management.j2ee.statistics.JCAConnectionPoolStats
The number of threads waiting for a connection
getWaitingThreadCount() - Method in interface javax.management.j2ee.statistics.JDBCConnectionPoolStats
Number of threads waiting for a connection.
getWaitTime() - Method in interface javax.management.j2ee.statistics.JCAConnectionStats
Returns the time spent waiting for a connection to be available
getWaitTime() - Method in interface javax.management.j2ee.statistics.JDBCConnectionStats
Time spent waiting for a connection to be available.
getWarnClass() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the warnClass property.
getWarnClass() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the warnClass property.
getWarnings() - Method in interface javax.resource.cci.Interaction
Gets the first ResourceWarning from the chain of warnings associated with this Interaction instance.
getWarnStyle() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the warnStyle property.
getWarnStyle() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the warnStyle property.
getWebURL() - Method in interface javax.enterprise.deploy.spi.TargetModuleID
If this TargetModulID represents a web module retrieve the URL for it.
getWidth() - Method in class javax.faces.component.html.HtmlDataTable
Return the value of the width property.
getWidth() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the width property.
getWidth() - Method in class javax.faces.component.html.HtmlPanelGrid
Return the value of the width property.
getWork() - Method in class javax.resource.spi.work.WorkEvent
Return the Work instance which is the cause of the event.
getWorkManager() - Method in interface javax.resource.spi.BootstrapContext
Provides a handle to a WorkManager instance.
getWrapped() - Method in class javax.faces.application.StateManagerWrapper

getWrapped() - Method in class javax.faces.application.ViewHandlerWrapper

getWrapped() - Method in class javax.faces.context.ResponseWriterWrapper

getWrappedData() - Method in class javax.faces.model.ArrayDataModel

getWrappedData() - Method in class javax.faces.model.DataModel
Return the object representing the data wrapped by this DataModel, if any.
getWrappedData() - Method in class javax.faces.model.ListDataModel

getWrappedData() - Method in class javax.faces.model.ResultDataModel

getWrappedData() - Method in class javax.faces.model.ResultSetDataModel

getWrappedData() - Method in class javax.faces.model.ScalarDataModel

getWriteMethod() - Method in class javax.el.BeanELResolver.BeanProperty

getWriter() - Method in interface javax.servlet.ServletResponse
Returns a PrintWriter object that can send character text to the client.
getWriter() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to return getWriter() on the wrapped response object.
getWSDLDocumentLocation() - Method in interface javax.xml.rpc.Service
Gets the location of the WSDL document for this Service.
getWSDLDocumentLocation() - Method in class javax.xml.ws.Service
Gets the location of the WSDL document for this Service.
getWSDLDocumentLocation() - Method in class javax.xml.ws.spi.ServiceDelegate
Gets the location of the WSDL document for this Service.
getXAResource() - Method in interface javax.jms.XASession
Returns an XA resource to the caller.
getXAResource() - Method in interface javax.resource.spi.ManagedConnection
Returns an javax.transaction.xa.XAresource instance.
getXAResources(ActivationSpec[]) - Method in interface javax.resource.spi.ResourceAdapter
This method is called by the application server during crash recovery.
getXATerminator() - Method in interface javax.resource.spi.BootstrapContext
Provides a handle to a XATerminator instance.
getXid() - Method in class javax.resource.spi.work.ExecutionContext

getXMLNode(Object) - Method in class javax.xml.bind.Binder
Gets the XML element associated with the given JAXB object.
getXMLReader() - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Obtains a configured XMLReader.
getXMLReporter() - Method in class javax.xml.stream.XMLInputFactory
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
getXMLResolver() - Method in class javax.xml.stream.XMLInputFactory
The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
getXpath() - Method in interface javax.enterprise.deploy.model.DDBean
Returns the original xpath string provided by the DConfigBean.
getXpath() - Method in interface javax.enterprise.deploy.model.DDBeanRoot
Return the XPath for this standard bean.
getXpaths() - Method in interface javax.enterprise.deploy.spi.DConfigBean
Return a list of XPaths designating the deployment descriptor information this DConfigBean requires.
GT - Static variable in class javax.mail.search.ComparisonTerm

H

Handle - Interface in javax.ejb
The Handle interface is implemented by all EJB object handles.
HandleDelegate - Interface in javax.ejb.spi
The HandleDelegate interface is implemented by the EJB container.
handleEvent(ValidationEvent) - Method in class javax.xml.bind.helpers.DefaultValidationEventHandler

handleEvent(ValidationEvent) - Method in class javax.xml.bind.util.ValidationEventCollector

handleEvent(ValidationEvent) - Method in interface javax.xml.bind.ValidationEventHandler
Receive notification of a validation warning or error.
handleFault(MessageContext) - Method in class javax.xml.rpc.handler.GenericHandler
The handleFault method processes the SOAP faults based on the SOAP message processing model.
handleFault(MessageContext) - Method in interface javax.xml.rpc.handler.Handler
The handleFault method processes the SOAP faults based on the SOAP message processing model.
handleFault(MessageContext) - Method in interface javax.xml.rpc.handler.HandlerChain
The handleFault method initiates the SOAP fault processing for this handler chain.
handleFault(C) - Method in interface javax.xml.ws.handler.Handler
The handleFault method is invoked for fault message processing.
handleMessage(C) - Method in interface javax.xml.ws.handler.Handler
The handleMessage method is invoked for normal processing of inbound and outbound messages.
handleNavigation(FacesContext, String, String) - Method in class javax.faces.application.NavigationHandler
Perform navigation processing based on the state information in the specified FacesContext, plus the outcome string returned by an executed application action.
handlePageException(Exception) - Method in class javax.servlet.jsp.PageContext
This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP.
handlePageException(Throwable) - Method in class javax.servlet.jsp.PageContext
This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP.
handleProgressEvent(ProgressEvent) - Method in interface javax.enterprise.deploy.spi.status.ProgressListener
Invoked when a deployment progress event occurs.
Handler - Interface in javax.xml.rpc.handler
The javax.xml.rpc.handler.Handler interface is required to be implemented by a SOAP message handler.
Handler<C extends MessageContext> - Interface in javax.xml.ws.handler
The Handler interface is the base interface for JAX-WS handlers.
HandlerChain - Annotation Type in javax.jws
Associates the Web Service with an externally defined handler chain.
HandlerChain - Interface in javax.xml.rpc.handler
The javax.xml.rpc.handler.HandlerChain represents a list of handlers.
handleRequest(MessageContext) - Method in class javax.xml.rpc.handler.GenericHandler
The handleRequest method processes the request SOAP message.
handleRequest(MessageContext) - Method in interface javax.xml.rpc.handler.Handler
The handleRequest method processes the request message.
handleRequest(MessageContext) - Method in interface javax.xml.rpc.handler.HandlerChain
The handleRequest method initiates the request processing for this handler chain.
handleResponse(MessageContext) - Method in class javax.xml.rpc.handler.GenericHandler
The handleResponse method processes the response message.
handleResponse(MessageContext) - Method in interface javax.xml.rpc.handler.Handler
The handleResponse method processes the response SOAP message.
handleResponse(MessageContext) - Method in interface javax.xml.rpc.handler.HandlerChain
The handleResponse method initiates the response processing for this handler chain.
handleResponse(Response<T>) - Method in interface javax.xml.ws.AsyncHandler
Called when the response to an asynchronous operation is available.
HandlerInfo - Class in javax.xml.rpc.handler
The javax.xml.rpc.handler.HandlerInfo represents information about a handler in the HandlerChain.
HandlerInfo() - Constructor for class javax.xml.rpc.handler.HandlerInfo
Default constructor
HandlerInfo(Class, Map, QName[]) - Constructor for class javax.xml.rpc.handler.HandlerInfo
Constructor for HandlerInfo
HandlerRegistry - Interface in javax.xml.rpc.handler
The javax.xml.rpc.handler.HandlerRegistry provides support for the programmatic configuration of handlers in a HandlerRegistry.
HandlerResolver - Interface in javax.xml.ws.handler
HandlerResolver is an interface implemented by an application to get control over the handler chain set on proxy/dispatch objects at the time of their creation.
handlesURI(String) - Method in interface javax.enterprise.deploy.spi.factories.DeploymentFactory
Tests whether this factory can create a DeploymentManager object based on the specificed URI.
hasBinding() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Return true if this component has a non-null binding attribute.
hasBinding() - Method in class javax.faces.webapp.UIComponentELTag

hasBinding() - Method in class javax.faces.webapp.UIComponentTag
Deprecated.
hasDetail() - Method in interface javax.xml.soap.SOAPFault
Returns true if this SOAPFault has a Detail subelement and false otherwise.
hasDynamicAttributes() - Method in class javax.servlet.jsp.tagext.TagInfo
Get dynamicAttributes associated with this TagInfo.
hasEvents() - Method in class javax.xml.bind.util.ValidationEventCollector
Returns true if this event collector contains at least one ValidationEvent.
hasFault() - Method in interface javax.xml.soap.SOAPBody
Indicates whether a SOAPFault object exists in this SOAPBody object.
hashCode() - Method in class javax.el.Expression
Returns the hash code for this Expression.
hashCode() - Method in class javax.faces.validator.DoubleRangeValidator

hashCode() - Method in class javax.faces.validator.LengthValidator

hashCode() - Method in class javax.faces.validator.LongRangeValidator

hashCode() - Method in class javax.mail.Flags
Compute a hash code for this Flags object.
hashCode() - Method in class javax.mail.internet.InternetAddress
Compute a hash code for the address.
hashCode() - Method in class javax.mail.internet.NewsAddress
Compute a hash code for the address.
hashCode() - Method in class javax.mail.search.AddressTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.AndTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.ComparisonTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.DateTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.FlagTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.HeaderTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.IntegerComparisonTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.NotTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.OrTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.RecipientStringTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.RecipientTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.search.StringTerm
Compute a hashCode for this object.
hashCode() - Method in class javax.mail.URLName
Compute the hash code for this URLName.
hashCode() - Method in interface javax.resource.cci.Record
Returns the hash code for the Record instance.
hashCode() - Method in interface javax.resource.spi.ConnectionRequestInfo
Returns the hashCode of the ConnectionRequestInfo.
hashCode() - Method in interface javax.resource.spi.ManagedConnectionFactory
Returns the hash code for the ManagedConnectionFactory
hashCode() - Method in interface javax.resource.spi.security.GenericCredential
Deprecated. Returns the hash code for this GenericCredential
hashCode() - Method in class javax.resource.spi.security.PasswordCredential
Returns the hash code for this PasswordCredential
hashCode() - Method in class javax.security.jacc.EJBMethodPermission
Returns the hash code value for this EJBMethodPermission.
hashCode() - Method in class javax.security.jacc.EJBRoleRefPermission
Returns the hash code value for this EJBRoleRefPermission.
hashCode() - Method in class javax.security.jacc.WebResourcePermission
Returns the hash code value for this WebResourcePermission.
hashCode() - Method in class javax.security.jacc.WebRoleRefPermission
Returns the hash code value for this WebRoleRefPermission.
hashCode() - Method in class javax.security.jacc.WebUserDataPermission
Returns the hash code value for this WebUserDataPermission.
hasName() - Method in class javax.xml.stream.util.StreamReaderDelegate

hasName() - Method in interface javax.xml.stream.XMLStreamReader
returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT) returns false otherwise
hasNewMessages() - Method in class javax.mail.Folder
Returns true if this Folder has new messages since the last time this indication was reset.
hasNext() - Method in class javax.xml.stream.util.EventReaderDelegate

hasNext() - Method in class javax.xml.stream.util.StreamReaderDelegate

hasNext() - Method in interface javax.xml.stream.XMLEventReader
Check if there are more events.
hasNext() - Method in interface javax.xml.stream.XMLStreamReader
Returns true if there are more parsing events and false if there are no more events.
hasText() - Method in class javax.xml.stream.util.StreamReaderDelegate

hasText() - Method in interface javax.xml.stream.XMLStreamReader
Return true if the current event has text, false otherwise The following events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE
Header - Class in javax.mail
The Header class stores a name/value pair to represent headers.
Header(String, String) - Constructor for class javax.mail.Header
Construct a Header object.
headerName - Variable in class javax.mail.search.HeaderTerm
The name of the header.
headers - Variable in class javax.mail.internet.InternetHeaders
The actual list of Headers, including placeholder entries.
headers - Variable in class javax.mail.internet.MimeBodyPart
The InternetHeaders object that stores all the headers of this body part.
headers - Variable in class javax.mail.internet.MimeMessage
The InternetHeaders object that stores the header of this message.
HeaderTerm - Class in javax.mail.search
This class implements comparisons for Message headers.
HeaderTerm(String, String) - Constructor for class javax.mail.search.HeaderTerm
Constructor.
HeaderTokenizer - Class in javax.mail.internet
This class tokenizes RFC822 and MIME headers into the basic symbols specified by RFC822 and MIME.
HeaderTokenizer(String, String, boolean) - Constructor for class javax.mail.internet.HeaderTokenizer
Constructor that takes a rfc822 style header.
HeaderTokenizer(String, String) - Constructor for class javax.mail.internet.HeaderTokenizer
Constructor.
HeaderTokenizer(String) - Constructor for class javax.mail.internet.HeaderTokenizer
Constructor.
HeaderTokenizer.Token - Class in javax.mail.internet
The Token class represents tokens returned by the HeaderTokenizer.
HeaderTokenizer.Token(int, String) - Constructor for class javax.mail.internet.HeaderTokenizer.Token
Constructor.
HeuristicCommitException - Exception in javax.transaction
This exception is thrown by the rollback operation on a resource to report that a heuristic decision was made and that all relevant updates have been committed.
HeuristicCommitException() - Constructor for exception javax.transaction.HeuristicCommitException

HeuristicCommitException(String) - Constructor for exception javax.transaction.HeuristicCommitException

HeuristicMixedException - Exception in javax.transaction
This exception is thrown to report that a heuristic decision was made and that some relevant updates have been committed and others have been rolled back.
HeuristicMixedException() - Constructor for exception javax.transaction.HeuristicMixedException

HeuristicMixedException(String) - Constructor for exception javax.transaction.HeuristicMixedException

HeuristicRollbackException - Exception in javax.transaction
This exception is thrown by the commit operation to report that a heuristic decision was made and that all relevant updates have been rolled back.
HeuristicRollbackException() - Constructor for exception javax.transaction.HeuristicRollbackException

HeuristicRollbackException(String) - Constructor for exception javax.transaction.HeuristicRollbackException

HexBinaryAdapter - Class in javax.xml.bind.annotation.adapters
XmlAdapter for xs:hexBinary.
HexBinaryAdapter() - Constructor for class javax.xml.bind.annotation.adapters.HexBinaryAdapter

Holder - Interface in javax.xml.rpc.holders
The java.xml.rpc.holders.Holder interface represents the base interface for both standard and generated Holder classes.
Holder<T> - Class in javax.xml.ws
Holds a value of type T.
Holder() - Constructor for class javax.xml.ws.Holder
Creates a new holder with a null value.
Holder(T) - Constructor for class javax.xml.ws.Holder
Create a new holder with the specified value.
HOLDS_FOLDERS - Static variable in class javax.mail.Folder
This folder can contain other folders
HOLDS_MESSAGES - Static variable in class javax.mail.Folder
This folder can contain messages
HomeHandle - Interface in javax.ejb
The HomeHandle interface is implemented by all home object handles.
host - Variable in class javax.mail.internet.NewsAddress

HTML_BASIC_RENDER_KIT - Static variable in class javax.faces.render.RenderKitFactory
The render kit identifier of the default RenderKit instance for this JavaServer Faces implementation.
HtmlColumn - Class in javax.faces.component.html
Represents a column that will be rendered in an HTML table element.
HtmlColumn() - Constructor for class javax.faces.component.html.HtmlColumn

HtmlCommandButton - Class in javax.faces.component.html
Represents an HTML input element for a button of type submit or reset.
HtmlCommandButton() - Constructor for class javax.faces.component.html.HtmlCommandButton

HtmlCommandLink - Class in javax.faces.component.html
Represents an HTML a element for a hyperlink that acts like a submit button.
HtmlCommandLink() - Constructor for class javax.faces.component.html.HtmlCommandLink

HtmlDataTable - Class in javax.faces.component.html
Represents a set of repeating data (segregated into columns by child UIColumn components) that will be rendered in an HTML table element.
HtmlDataTable() - Constructor for class javax.faces.component.html.HtmlDataTable

HtmlForm - Class in javax.faces.component.html
Represents an HTML form element.
HtmlForm() - Constructor for class javax.faces.component.html.HtmlForm

HtmlGraphicImage - Class in javax.faces.component.html
Represents an HTML img element, used to retrieve and render a graphical image.
HtmlGraphicImage() - Constructor for class javax.faces.component.html.HtmlGraphicImage

HtmlInputHidden - Class in javax.faces.component.html
Represents an HTML input element of type hidden.
HtmlInputHidden() - Constructor for class javax.faces.component.html.HtmlInputHidden

HtmlInputSecret - Class in javax.faces.component.html
Represents an HTML input element of type password.
HtmlInputSecret() - Constructor for class javax.faces.component.html.HtmlInputSecret

HtmlInputText - Class in javax.faces.component.html
Represents an HTML input element of type text.
HtmlInputText() - Constructor for class javax.faces.component.html.HtmlInputText

HtmlInputTextarea - Class in javax.faces.component.html
Represents an HTML textarea element.
HtmlInputTextarea() - Constructor for class javax.faces.component.html.HtmlInputTextarea

HtmlMessage - Class in javax.faces.component.html
By default, the rendererType property must be set to "javax.faces.Message".
HtmlMessage() - Constructor for class javax.faces.component.html.HtmlMessage

HtmlMessages - Class in javax.faces.component.html
By default, the rendererType property must be set to "javax.faces.Messages".
HtmlMessages() - Constructor for class javax.faces.component.html.HtmlMessages

HtmlOutputFormat - Class in javax.faces.component.html
Represents a component that looks up a localized message in a resource bundle, optionally uses it as a MessageFormat pattern string and substitutes in parameter values from nested UIParameter components, and renders the result.
HtmlOutputFormat() - Constructor for class javax.faces.component.html.HtmlOutputFormat

HtmlOutputLabel - Class in javax.faces.component.html
Represents an HTML label element, used to define an accessible label for a corresponding input element.
HtmlOutputLabel() - Constructor for class javax.faces.component.html.HtmlOutputLabel

HtmlOutputLink - Class in javax.faces.component.html
Represents an HTML a (hyperlink) element that may be used to link to an arbitrary URL defined by the value property.
HtmlOutputLink() - Constructor for class javax.faces.component.html.HtmlOutputLink

HtmlOutputText - Class in javax.faces.component.html
Renders the component value as text, optionally wrapping in a span element if I18N attributes, CSS styles or style classes are specified.
HtmlOutputText() - Constructor for class javax.faces.component.html.HtmlOutputText

HtmlPanelGrid - Class in javax.faces.component.html
Renders child components in a table, starting a new row after the specified number of columns.
HtmlPanelGrid() - Constructor for class javax.faces.component.html.HtmlPanelGrid

HtmlPanelGroup - Class in javax.faces.component.html
Causes all child components of this component to be rendered.
HtmlPanelGroup() - Constructor for class javax.faces.component.html.HtmlPanelGroup

HtmlSelectBooleanCheckbox - Class in javax.faces.component.html
Represents an HTML input element of type checkbox.
HtmlSelectBooleanCheckbox() - Constructor for class javax.faces.component.html.HtmlSelectBooleanCheckbox

HtmlSelectManyCheckbox - Class in javax.faces.component.html
Represents a multiple-selection component that is rendered as a set of HTML input elements of type checkbox.
HtmlSelectManyCheckbox() - Constructor for class javax.faces.component.html.HtmlSelectManyCheckbox

HtmlSelectManyListbox - Class in javax.faces.component.html
Represents a multiple-selection component that is rendered as an HTML select element, showing either all available options or the specified number of options.
HtmlSelectManyListbox() - Constructor for class javax.faces.component.html.HtmlSelectManyListbox

HtmlSelectManyMenu - Class in javax.faces.component.html
Represents a multiple-selection component that is rendered as an HTML select element, showing a single available option at a time.
HtmlSelectManyMenu() - Constructor for class javax.faces.component.html.HtmlSelectManyMenu

HtmlSelectOneListbox - Class in javax.faces.component.html
Represents a single-selection component that is rendered as an HTML select element, showing either all available options or the specified number of options.
HtmlSelectOneListbox() - Constructor for class javax.faces.component.html.HtmlSelectOneListbox

HtmlSelectOneMenu - Class in javax.faces.component.html
Represents a single-selection component that is rendered as an HTML select element, showing a single available option at a time.
HtmlSelectOneMenu() - Constructor for class javax.faces.component.html.HtmlSelectOneMenu

HtmlSelectOneRadio - Class in javax.faces.component.html
Represents a single-selection component that is rendered as a set of HTML input elements of type radio.
HtmlSelectOneRadio() - Constructor for class javax.faces.component.html.HtmlSelectOneRadio

HTTP_BINDING - Static variable in interface javax.xml.ws.http.HTTPBinding
A constant representing the identity of the XML/HTTP binding.
HTTP_REQUEST_HEADERS - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: HTTP request headers.
HTTP_REQUEST_METHOD - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: HTTP request method.
HTTP_RESPONSE_CODE - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: HTTP response status code.
HTTP_RESPONSE_HEADERS - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: HTTP response headers.
HTTPBinding - Interface in javax.xml.ws.http
The HTTPBinding interface is an abstraction for the XML/HTTP binding.
HTTPException - Exception in javax.xml.ws.http
The HTTPException exception represents a XML/HTTP fault.
HTTPException(int) - Constructor for exception javax.xml.ws.http.HTTPException
Constructor for the HTTPException
HttpJspPage - Interface in javax.servlet.jsp
The HttpJspPage interface describes the interaction that a JSP Page Implementation Class must satisfy when using the HTTP protocol.
HttpServlet - Class in javax.servlet.http
Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site.
HttpServlet() - Constructor for class javax.servlet.http.HttpServlet
Does nothing, because this is an abstract class.
HttpServletRequest - Interface in javax.servlet.http
Extends the ServletRequest interface to provide request information for HTTP servlets.
HttpServletRequestWrapper - Class in javax.servlet.http
Provides a convenient implementation of the HttpServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet.
HttpServletRequestWrapper(HttpServletRequest) - Constructor for class javax.servlet.http.HttpServletRequestWrapper
Constructs a request object wrapping the given request.
HttpServletResponse - Interface in javax.servlet.http
Extends the ServletResponse interface to provide HTTP-specific functionality in sending a response.
HttpServletResponseWrapper - Class in javax.servlet.http
Provides a convenient implementation of the HttpServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet.
HttpServletResponseWrapper(HttpServletResponse) - Constructor for class javax.servlet.http.HttpServletResponseWrapper
Constructs a response adaptor wrapping the given response.
HttpSession - Interface in javax.servlet.http
Provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user.
HttpSessionActivationListener - Interface in javax.servlet.http
Objects that are bound to a session may listen to container events notifying them that sessions will be passivated and that session will be activated.
HttpSessionAttributeListener - Interface in javax.servlet.http
This listener interface can be implemented in order to get notifications of changes to the attribute lists of sessions within this web application.
HttpSessionBindingEvent - Class in javax.servlet.http
Events of this type are either sent to an object that implements HttpSessionBindingListener when it is bound or unbound from a session, or to a HttpSessionAttributeListener that has been configured in the deployment descriptor when any attribute is bound, unbound or replaced in a session.
HttpSessionBindingEvent(HttpSession, String) - Constructor for class javax.servlet.http.HttpSessionBindingEvent
Constructs an event that notifies an object that it has been bound to or unbound from a session.
HttpSessionBindingEvent(HttpSession, String, Object) - Constructor for class javax.servlet.http.HttpSessionBindingEvent
Constructs an event that notifies an object that it has been bound to or unbound from a session.
HttpSessionBindingListener - Interface in javax.servlet.http
Causes an object to be notified when it is bound to or unbound from a session.
HttpSessionContext - Interface in javax.servlet.http
Deprecated. As of Java(tm) Servlet API 2.1 for security reasons, with no replacement. This interface will be removed in a future version of this API.
HttpSessionEvent - Class in javax.servlet.http
This is the class representing event notifications for changes to sessions within a web application.
HttpSessionEvent(HttpSession) - Constructor for class javax.servlet.http.HttpSessionEvent
Construct a session event from the given source.
HttpSessionListener - Interface in javax.servlet.http
Implementations of this interface are notified of changes to the list of active sessions in a web application.
HttpUtils - Class in javax.servlet.http
Deprecated. As of Java(tm) Servlet API 2.3. These methods were only useful with the default encoding and have been moved to the request interfaces.
HttpUtils() - Constructor for class javax.servlet.http.HttpUtils
Deprecated. Constructs an empty HttpUtils object.

I

Id - Annotation Type in javax.persistence
Specifies the primary key property or field of an entity.
id - Variable in class javax.resource.spi.ConnectionEvent
Type of the event
ID - Static variable in class javax.servlet.jsp.tagext.TagAttributeInfo
"id" is wired in to be ID.
id - Variable in class javax.servlet.jsp.tagext.TagSupport
The value of the id attribute of this tag; or null.
IdClass - Annotation Type in javax.persistence
Specifies a composite primary key class that is mapped to multiple fields or properties of the entity.
ignoreCase - Variable in class javax.mail.search.StringTerm
Ignore case when comparing?
IllegalStateException - Exception in javax.jms
This exception is thrown when a method is invoked at an illegal or inappropriate time or if the provider is not in an appropriate state for the requested operation.
IllegalStateException(String, String) - Constructor for exception javax.jms.IllegalStateException
Constructs an IllegalStateException with the specified reason and error code.
IllegalStateException(String) - Constructor for exception javax.jms.IllegalStateException
Constructs an IllegalStateException with the specified reason.
IllegalStateException - Exception in javax.resource.spi
An IllegalStateException is thrown from a method if the callee (resource adapter or application server for system contracts) is in an illegal or inappropriate state for the method invocation.
IllegalStateException() - Constructor for exception javax.resource.spi.IllegalStateException
Constructs a new instance with null as its detail message.
IllegalStateException(String) - Constructor for exception javax.resource.spi.IllegalStateException
Constructs a new instance with the specified detail message.
IllegalStateException(Throwable) - Constructor for exception javax.resource.spi.IllegalStateException
Constructs a new throwable with the specified cause.
IllegalStateException(String, Throwable) - Constructor for exception javax.resource.spi.IllegalStateException
Constructs a new throwable with the specified detail message and cause.
IllegalStateException(String, String) - Constructor for exception javax.resource.spi.IllegalStateException
Constructs a new throwable with the specified detail message and an error code.
IllegalWriteException - Exception in javax.mail
The exception thrown when a write is attempted on a read-only attribute of any Messaging object.
IllegalWriteException() - Constructor for exception javax.mail.IllegalWriteException
Constructs a IllegalWriteException with no detail message.
IllegalWriteException(String) - Constructor for exception javax.mail.IllegalWriteException
Constructs a IllegalWriteException with the specified detail message.
IMMEDIATE - Static variable in interface javax.resource.spi.work.WorkManager
A constant to indicate timeout duration.
ImplicitObjectELResolver - Class in javax.servlet.jsp.el
Defines variable resolution behavior for the EL implicit objects defined in the JSP specification.
ImplicitObjectELResolver() - Constructor for class javax.servlet.jsp.el.ImplicitObjectELResolver

implies(Permission) - Method in class javax.security.jacc.EJBMethodPermission
Determines if the argument Permission is "implied by" this EJBMethodPermission.
implies(Permission) - Method in class javax.security.jacc.EJBRoleRefPermission
Determines if the argument Permission is "implied by" this EJBRoleRefPermission.
implies(Permission) - Method in class javax.security.jacc.WebResourcePermission
Determines if the argument Permission is "implied by" this WebResourcePermission.
implies(Permission) - Method in class javax.security.jacc.WebRoleRefPermission
Determines if the argument Permission is "implied by" this WebRoleRefPermission.
implies(Permission) - Method in class javax.security.jacc.WebUserDataPermission
Determines if the argument Permission is "implied by" this WebUserDataPermission.
in - Variable in class javax.mail.util.SharedFileInputStream
The file containing the data.
IN - Static variable in class javax.xml.rpc.ParameterMode
IN mode for parameter passing
INBOUND_MESSAGE_ATTACHMENTS - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: Map of attachments to a message for the inbound message, key is the MIME Content-ID, value is a DataHandler.
include(String) - Method in class javax.servlet.jsp.PageContext
Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
include(String, boolean) - Method in class javax.servlet.jsp.PageContext
Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
include(ServletRequest, ServletResponse) - Method in interface javax.servlet.RequestDispatcher
Includes the content of a resource (servlet, JSP page, HTML file) in the response.
INDEFINITE - Static variable in interface javax.resource.spi.work.WorkManager
A constant to indicate timeout duration.
IndexedRecord - Interface in javax.resource.cci
IndexedRecord represents an ordered collection of record elements based on the java.util.List interface.
info - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
Information (documentation) for this TLD.
Inheritance - Annotation Type in javax.persistence
Defines the inheritance strategy to be used for an entity class hierarchy.
InheritanceType - Enum in javax.persistence
Defines inheritance strategy options.
Init - Annotation Type in javax.ejb
Designates a method of a session bean that corresponds to the create method of an adapted Home interface or an adapted Local Home interface.
init(ServletConfig) - Method in class javax.faces.webapp.FacesServlet
Acquire the factory instances we will require.
init(FilterConfig) - Method in interface javax.servlet.Filter
Called by the web container to indicate to a filter that it is being placed into service.
init(ServletConfig) - Method in class javax.servlet.GenericServlet
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
init() - Method in class javax.servlet.GenericServlet
A convenience method which can be overridden so that there's no need to call super.init(config).
init(ServletConfig) - Method in interface javax.servlet.Servlet
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
init(HandlerInfo) - Method in class javax.xml.rpc.handler.GenericHandler
The init method to enable the Handler instance to initialize itself.
init(HandlerInfo) - Method in interface javax.xml.rpc.handler.Handler
The init method enables the Handler instance to initialize itself.
init(Map) - Method in interface javax.xml.rpc.handler.HandlerChain
Initializes the configuration for a HandlerChain.
init(Object) - Method in interface javax.xml.rpc.server.ServiceLifecycle
Used for initialization of a service endpoint.
initCause(Throwable) - Method in exception javax.xml.registry.JAXRException
Initializes the cause of this throwable to the specified value.
initCause(Throwable) - Method in exception javax.xml.soap.SOAPException
Initializes the cause field of this SOAPException object with the given Throwable object.
initialize(Servlet, ServletRequest, ServletResponse, String, boolean, int, boolean) - Method in class javax.servlet.jsp.PageContext
The initialize method is called to initialize an uninitialized PageContext so that it may be used by a JSP Implementation class to service an incoming request and response within it's _jspService() method.
InitParam - Annotation Type in javax.jws.soap
Deprecated. As of JSR-181 2.0 with no replacement.
initView(FacesContext) - Method in class javax.faces.application.ViewHandler
Initialize the view for the request processing lifecycle.
initView(FacesContext) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.initView(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
INLINE - Static variable in interface javax.mail.Part
This part should be presented inline.
INOUT - Static variable in class javax.xml.rpc.ParameterMode
INOUT mode for parameter passing
insertsAreDetected(int) - Method in interface javax.resource.cci.ResultSetInfo
Indicates whether or not a visible row insert can be detected by calling ResultSet.rowInserted.
inService() - Method in interface javax.security.jacc.PolicyConfiguration
This method is used to determine if the policy context whose interface is this PolicyConfiguration Object is in the "inService" state.
inService(String) - Method in class javax.security.jacc.PolicyConfigurationFactory
This method determines if the identified policy context exists with state "inService" in the Policy provider associated with the factory.
INTEGER_ID - Static variable in class javax.faces.convert.IntegerConverter
The message identifier of the FacesMessage to be created if the conversion to Integer fails.
IntegerComparisonTerm - Class in javax.mail.search
This class implements comparisons for integers.
IntegerComparisonTerm(int, int) - Constructor for class javax.mail.search.IntegerComparisonTerm

IntegerConverter - Class in javax.faces.convert
Converter implementation for java.lang.Integer (and int primitive) values.
IntegerConverter() - Constructor for class javax.faces.convert.IntegerConverter

IntegerWrapperHolder - Class in javax.xml.rpc.holders

IntegerWrapperHolder() - Constructor for class javax.xml.rpc.holders.IntegerWrapperHolder

IntegerWrapperHolder(Integer) - Constructor for class javax.xml.rpc.holders.IntegerWrapperHolder

Interaction - Interface in javax.resource.cci
The javax.resource.cci.Interaction enables a component to execute EIS functions.
InteractionSpec - Interface in javax.resource.cci
An InteractionSpec holds properties for driving an Interaction with an EIS instance.
Interceptors - Annotation Type in javax.interceptor
Declares an ordered list of interceptors for a class or method.
INTERNAL - Static variable in exception javax.resource.spi.work.WorkException
Indicates an internal error condition.
INTERNATIONAL_STRING - Static variable in interface javax.xml.registry.LifeCycleManager

InternationalString - Interface in javax.xml.registry.infomodel
This interface represents a String that has been internationalized into several Locales.
InternetAddress - Class in javax.mail.internet
This class represents an Internet email address using the syntax of RFC822.
InternetAddress() - Constructor for class javax.mail.internet.InternetAddress
Default constructor.
InternetAddress(String) - Constructor for class javax.mail.internet.InternetAddress
Constructor.
InternetAddress(String, boolean) - Constructor for class javax.mail.internet.InternetAddress
Parse the given string and create an InternetAddress.
InternetAddress(String, String) - Constructor for class javax.mail.internet.InternetAddress
Construct an InternetAddress given the address and personal name.
InternetAddress(String, String, String) - Constructor for class javax.mail.internet.InternetAddress
Construct an InternetAddress given the address and personal name.
InternetHeaders - Class in javax.mail.internet
InternetHeaders is a utility class that manages RFC822 style headers.
InternetHeaders() - Constructor for class javax.mail.internet.InternetHeaders
Create an empty InternetHeaders object.
InternetHeaders(InputStream) - Constructor for class javax.mail.internet.InternetHeaders
Read and parse the given RFC822 message stream till the blank line separating the header from the body.
InternetHeaders.InternetHeader - Class in javax.mail.internet
An individual internet header.
InternetHeaders.InternetHeader(String) - Constructor for class javax.mail.internet.InternetHeaders.InternetHeader
Constructor that takes a line and splits out the header name.
InternetHeaders.InternetHeader(String, String) - Constructor for class javax.mail.internet.InternetHeaders.InternetHeader
Constructor that takes a header name and value.
IntHolder - Class in javax.xml.rpc.holders

IntHolder() - Constructor for class javax.xml.rpc.holders.IntHolder

IntHolder(int) - Constructor for class javax.xml.rpc.holders.IntHolder

invalid - Variable in class javax.mail.event.TransportEvent

invalid - Variable in exception javax.mail.SendFailedException

INVALID_MESSAGE_ID - Static variable in class javax.faces.component.UISelectMany
The message identifier of the FacesMessage to be created if a value not matching the available options is specified.
INVALID_MESSAGE_ID - Static variable in class javax.faces.component.UISelectOne
The message identifier of the FacesMessage to be created if a value not matching the available options is specified.
invalidate() - Method in interface javax.servlet.http.HttpSession
Invalidates this session then unbinds any objects bound to it.
InvalidClientIDException - Exception in javax.jms
This exception must be thrown when a client attempts to set a connection's client ID to a value that is rejected by a provider.
InvalidClientIDException(String, String) - Constructor for exception javax.jms.InvalidClientIDException
Constructs an InvalidClientIDException with the specified reason and error code.
InvalidClientIDException(String) - Constructor for exception javax.jms.InvalidClientIDException
Constructs an InvalidClientIDException with the specified reason.
InvalidDestinationException - Exception in javax.jms
This exception must be thrown when a destination either is not understood by a provider or is no longer valid.
InvalidDestinationException(String, String) - Constructor for exception javax.jms.InvalidDestinationException
Constructs an InvalidDestinationException with the specified reason and error code.
InvalidDestinationException(String) - Constructor for exception javax.jms.InvalidDestinationException
Constructs an InvalidDestinationException with the specified reason.
InvalidModuleException - Exception in javax.enterprise.deploy.spi.exceptions
This exception is to report an invalid J2EE deployment module type.
InvalidModuleException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.InvalidModuleException
Creates an new InvalidModuleException object.
InvalidPropertyException - Exception in javax.resource.spi
This exception is thrown to indicate invalid configuration property settings.
InvalidPropertyException() - Constructor for exception javax.resource.spi.InvalidPropertyException
Create a InvalidPropertyException.
InvalidPropertyException(String) - Constructor for exception javax.resource.spi.InvalidPropertyException
Create a InvalidPropertyException.
InvalidPropertyException(Throwable) - Constructor for exception javax.resource.spi.InvalidPropertyException
Constructs a new throwable with the specified cause.
InvalidPropertyException(String, Throwable) - Constructor for exception javax.resource.spi.InvalidPropertyException
Constructs a new throwable with the specified detail message and cause.
InvalidPropertyException(String, String) - Constructor for exception javax.resource.spi.InvalidPropertyException
Constructs a new throwable with the specified detail message and an error code.
InvalidRequestException - Exception in javax.xml.registry
This exception is thrown when a JAXR client attempts to invoke an API method that is not valid for some reason.
InvalidRequestException() - Constructor for exception javax.xml.registry.InvalidRequestException
Constructs a JAXRException object with no reason or embedded Throwable.
InvalidRequestException(String) - Constructor for exception javax.xml.registry.InvalidRequestException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
InvalidRequestException(String, Throwable) - Constructor for exception javax.xml.registry.InvalidRequestException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
InvalidRequestException(Throwable) - Constructor for exception javax.xml.registry.InvalidRequestException
Constructs a JAXRException object initialized with the given Throwable object.
InvalidSelectorException - Exception in javax.jms
This exception must be thrown when a JMS client attempts to give a provider a message selector with invalid syntax.
InvalidSelectorException(String, String) - Constructor for exception javax.jms.InvalidSelectorException
Constructs an InvalidSelectorException with the specified reason and error code.
InvalidSelectorException(String) - Constructor for exception javax.jms.InvalidSelectorException
Constructs an InvalidSelectorException with the specified reason.
InvalidTransactionException - Exception in javax.transaction
This exception indicates that the request carried an invalid transaction context.
InvalidTransactionException() - Constructor for exception javax.transaction.InvalidTransactionException

InvalidTransactionException(String) - Constructor for exception javax.transaction.InvalidTransactionException

InvocationContext - Interface in javax.interceptor
Context information passed to AroundInvoke and Interceptor-class lifecycle callback methods.
invoke(ELContext, Object[]) - Method in class javax.el.MethodExpression
If a String literal is specified as the expression, returns the String literal coerced to the expected return type of the method signature.
invoke(FacesContext, Object[]) - Method in class javax.faces.el.MethodBinding
Deprecated. Return the return value (if any) resulting from a call to the method identified by this method binding expression, passing it the specified parameters, relative to the specified FacesContext.
invoke(ObjectName, String, Object[], String[]) - Method in interface javax.management.j2ee.Management
Invokes an operation on a managed object.
invoke(Writer) - Method in class javax.servlet.jsp.tagext.JspFragment
Executes the fragment and directs all output to the given Writer, or the JspWriter returned by the getOut() method of the JspContext associated with the fragment if out is null.
invoke(Object[]) - Method in interface javax.xml.rpc.Call
Invokes a specific operation using a synchronous request-response interaction mode.
invoke(QName, Object[]) - Method in interface javax.xml.rpc.Call
Invokes a specific operation using a synchronous request-response interaction mode.
invoke(T) - Method in interface javax.xml.ws.Dispatch
Invoke a service operation synchronously.
invoke(T) - Method in interface javax.xml.ws.Provider
Invokes an operation occording to the contents of the request message.
INVOKE_APPLICATION - Static variable in class javax.faces.event.PhaseId
Identifier that indicates an interest in events queued for the Invoke Application phase of the request processing lifecycle.
invokeAsync(T) - Method in interface javax.xml.ws.Dispatch
Invoke a service operation asynchronously.
invokeAsync(T, AsyncHandler<T>) - Method in interface javax.xml.ws.Dispatch
Invoke a service operation asynchronously.
invokeContextCallback(FacesContext, UIComponent) - Method in interface javax.faces.component.ContextCallback
This method will be called by an implementation of UIComponent.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback) and must be passed the component with the clientId given as an argument to invokeOnComponent.
invokeOnComponent(FacesContext, String, ContextCallback) - Method in class javax.faces.component.UIComponent
Starting at this component in the View hierarchy, search for a component with a clientId equal to the argument clientId and, if found, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing the current FacesContext and the found component as arguments.
invokeOnComponent(FacesContext, String, ContextCallback) - Method in class javax.faces.component.UIComponentBase

Starting at this component in the View hierarchy, search for a component with a clientId equal to the argument clientId and, if found, call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument callback, passing the current FacesContext and the found component as arguments.
invokeOnComponent(FacesContext, String, ContextCallback) - Method in class javax.faces.component.UIData
Override behavior from UIComponentBase.invokeOnComponent(javax.faces.context.FacesContext, java.lang.String, javax.faces.component.ContextCallback) to provide special care for positioning the data properly before finding the component and invoking the callback on it.
invokeOneWay(Object[]) - Method in interface javax.xml.rpc.Call
Invokes a remote method using the one-way interaction mode.
invokeOneWay(T) - Method in interface javax.xml.ws.Dispatch
Invokes a service operation using the one-way interaction mode.
IS_COALESCING - Static variable in class javax.xml.stream.XMLInputFactory
The property that requires the parser to coalesce adjacent character data sections
IS_NAMESPACE_AWARE - Static variable in class javax.xml.stream.XMLInputFactory
The property used to turn on/off namespace support, this is to support XML 1.0 documents, only the true setting must be supported
IS_REPAIRING_NAMESPACES - Static variable in class javax.xml.stream.XMLOutputFactory
Property used to set prefix defaulting on the output side
IS_REPLACING_ENTITY_REFERENCES - Static variable in class javax.xml.stream.XMLInputFactory
Requires the parser to replace internal entity references with their replacement text and report them as characters
IS_SUPPORTING_EXTERNAL_ENTITIES - Static variable in class javax.xml.stream.XMLInputFactory
The property that requires the parser to resolve external parsed entities
IS_VALIDATING - Static variable in class javax.xml.stream.XMLInputFactory
The property used to turn on/off implementation specific validation
isActive() - Method in interface javax.persistence.EntityTransaction
Indicate whether a transaction is in progress.
isAddEvent() - Method in class javax.enterprise.deploy.model.XpathEvent
Is this an add event?
isAppropriateListener(FacesListener) - Method in class javax.faces.event.ActionEvent

isAppropriateListener(FacesListener) - Method in class javax.faces.event.FacesEvent
Return true if this FacesListener is an instance of a listener class that this event supports.
isAppropriateListener(FacesListener) - Method in class javax.faces.event.ValueChangeEvent

isAttribute() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is an Attribute.
isAttributeSpecified(int) - Method in class javax.xml.stream.util.StreamReaderDelegate

isAttributeSpecified(int) - Method in interface javax.xml.stream.XMLStreamReader
Returns a boolean which indicates if this attribute was created by default
isAutoFlush() - Method in class javax.servlet.jsp.JspWriter
This method indicates whether the JspWriter is autoFlushing.
isAvailable() - Method in exception javax.xml.registry.JAXRException
Returns true if a response is available, false otherwise.
isAvailable() - Method in interface javax.xml.registry.JAXRResponse
Returns true if a response is available, false otherwise.
isCallerInRole(Identity) - Method in interface javax.ejb.EJBContext
Deprecated. Use boolean isCallerInRole(String roleName) instead.
isCallerInRole(String) - Method in interface javax.ejb.EJBContext
Test if the caller has a given security role.
isCancelSupported() - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
Tests whether the vendor supports a cancel opertation for deployment activities.
isCData() - Method in interface javax.xml.stream.events.Characters
Returns true if this is a CData section.
isChangeEvent() - Method in class javax.enterprise.deploy.model.XpathEvent
Is this a change event?
isCharacters() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is Characters.
isCharacters() - Method in class javax.xml.stream.util.StreamReaderDelegate

isCharacters() - Method in interface javax.xml.stream.XMLStreamReader
Returns true if the cursor points to a character data event
isClosed() - Method in interface javax.xml.registry.Connection
Indicated whether this Connection has been closed or not.
isComment() - Method in interface javax.xml.soap.Text
Retrieves whether this Text object represents a comment.
isCommitted() - Method in interface javax.servlet.ServletResponse
Returns a boolean indicating if the response has been committed.
isCommitted() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to return isCommitted() on the wrapped response object.
isComplete() - Method in class javax.mail.internet.MimeMultipart
Return true if the final boundary line for this multipart was seen.
isCompleted() - Method in interface javax.enterprise.deploy.spi.status.DeploymentStatus
A convience method to report if the operation is in the completed state.
isConfirmed() - Method in interface javax.xml.registry.infomodel.Association
Determines whether an Association has been confirmed completely.
isConfirmedBySourceOwner() - Method in interface javax.xml.registry.infomodel.Association
Determines whether an Association has been confirmed by the owner of the source object.
isConfirmedByTargetOwner() - Method in interface javax.xml.registry.infomodel.Association
Determines whether an Association has been confirmed by the owner of the target object.
isConnected() - Method in class javax.mail.Service
Is this service currently connected?
isDataFlavorSupported(DataFlavor) - Method in class javax.activation.DataHandler
Returns whether the specified data flavor is supported for this object.
isDConfigBeanVersionSupported(DConfigBeanVersionType) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Returns 'true' if the configuration beans support the J2EE platform version specified.
isDefaultNamespaceDeclaration() - Method in interface javax.xml.stream.events.Namespace
returns true if this attribute declares the default namespace
isDeferredMethod() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Returns true if this attribute is to be passed a MethodExpression so that expression evaluation can be deferred.
isDeferredValue() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Returns true if this attribute is to be passed a ValueExpression so that expression evaluation can be deferred.
isDeliveryTransacted(Method) - Method in interface javax.resource.spi.endpoint.MessageEndpointFactory
This is used to find out whether message deliveries to a target method on a message listener interface that is implemented by a message endpoint will be transacted or not.
isDisabled() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlCommandLink
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlOutputLink
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the disabled property.
isDisabled() - Method in class javax.faces.model.SelectItem
Return the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.
isElement(Object) - Method in class javax.xml.bind.JAXBIntrospector
Return true iff object represents a JAXB element.
isEmpty() - Method in class javax.activation.MimeTypeParameterList
Determine whether or not this list is empty.
isEndDocument() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is an EndDocument.
isEndElement() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is a EndElement.
isEndElement() - Method in class javax.xml.stream.util.StreamReaderDelegate

isEndElement() - Method in interface javax.xml.stream.XMLStreamReader
Returns true if the cursor points to an end tag (otherwise false)
isEntityReference() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is an EntityReference.
isEscape() - Method in class javax.faces.component.html.HtmlOutputFormat
Return the value of the escape property.
isEscape() - Method in class javax.faces.component.html.HtmlOutputLabel
Return the value of the escape property.
isEscape() - Method in class javax.faces.component.html.HtmlOutputText
Return the value of the escape property.
isEscape() - Method in class javax.faces.model.SelectItem
Getter for property escape.
isExpunged() - Method in class javax.mail.Message
Checks whether this message is expunged.
isExternal() - Method in interface javax.xml.registry.infomodel.Classification
Returns true if this is an external classification.
isExternal() - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Determines whether this ClassificationScheme is an external ClassificationScheme or an internal ClassificationScheme.
isExtramural() - Method in interface javax.xml.registry.infomodel.Association
Determines whether an Association is extramural or not.
isFailed() - Method in interface javax.enterprise.deploy.spi.status.DeploymentStatus
A convience method to report if the operation is in the failed state.
isFormattedOutput() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for getting the formatted output flag.
isFragment() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Whether this attribute is of type JspFragment.
isFragment() - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for getting the fragment flag.
isGlobalOnly() - Method in class javax.faces.component.UIMessages
Return the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.
isGlobalScope() - Method in class javax.xml.bind.JAXBElement
Returns true iff this xml element declaration is global.
isGroup() - Method in class javax.mail.internet.InternetAddress
Indicates whether this address is an RFC 822 group address.
isGroupingUsed() - Method in class javax.faces.convert.NumberConverter
Return true if getAsString should include grouping separators if necessary.
isIdentical(EJBLocalObject) - Method in interface javax.ejb.EJBLocalObject
Test if a given EJB local object is identical to the invoked EJB local object.
isIdentical(EJBObject) - Method in interface javax.ejb.EJBObject
Test if a given EJB object is identical to the invoked EJB object.
isIgnorableWhiteSpace() - Method in interface javax.xml.stream.events.Characters
Return true if this is ignorableWhiteSpace.
isImmediate() - Method in interface javax.faces.component.ActionSource
Return a flag indicating that the default ActionListener provided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase.
isImmediate() - Method in interface javax.faces.component.EditableValueHolder
Return the "immediate" state for this component.
isImmediate() - Method in class javax.faces.component.UICommand

isImmediate() - Method in class javax.faces.component.UIInput

isIntegerOnly() - Method in class javax.faces.convert.NumberConverter
Return true if only the integer portion of the given value should be returned from getAsObject().
isIsmap() - Method in class javax.faces.component.html.HtmlGraphicImage
Return the value of the ismap property.
isItemDisabled() - Method in class javax.faces.component.UISelectItem
Return the disabled setting for this selection item.
isItemEscaped() - Method in class javax.faces.component.UISelectItem
Return the escape setting for the label of this selection item.
isLiteralText() - Method in class javax.el.Expression
Returns whether this expression was created from only literal text.
isLocaleSupported(Locale) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Reports if this implementation supports the designated locale.
isLocalValueSet() - Method in interface javax.faces.component.EditableValueHolder
Return the "local value set" state for this component.
isLocalValueSet() - Method in class javax.faces.component.UIInput
Return the "local value set" state for this component.
isMimeType(String) - Method in class javax.mail.internet.MimeBodyPart
Is this Part of the specified MIME type?
isMimeType(String) - Method in class javax.mail.internet.MimeMessage
Is this Part of the specified MIME type?
isMimeType(String) - Method in interface javax.mail.Part
Is this Part of the specified MIME type?
isMimeTypeEqual(String) - Method in class javax.activation.ActivationDataFlavor
Is the string representation of the MIME type passed in equivalent to the MIME type of this DataFlavor.
isMTOMEnabled() - Method in interface javax.xml.ws.soap.SOAPBinding
Returns true if the use of MTOM is enabled.
isNamespace() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is a Namespace.
isNew() - Method in interface javax.servlet.http.HttpSession
Returns true if the client does not yet know about the session or if the client chooses not to join the session.
isNil() - Method in class javax.xml.bind.JAXBElement
Returns true iff this element instance content model is nil.
isOpaque() - Method in interface javax.xml.registry.infomodel.ExtrinsicObject
Determines whether the ExtrinsicObject is opaque (not readable) by the registry operator.
isOpen() - Method in class javax.mail.Folder
Indicates whether this Folder is in the 'open' state.
isOpen() - Method in interface javax.persistence.EntityManager
Determine whether the EntityManager is open.
isOpen() - Method in interface javax.persistence.EntityManagerFactory
Indicates whether or not this factory is open.
isParameterAndReturnSpecRequired(QName) - Method in interface javax.xml.rpc.Call
Indicates whether addParameter and setReturnType methods are to be invoked to specify the parameter and return type specification for a specific operation.
isPartialResponse() - Method in interface javax.xml.registry.BulkResponse
Determines whether the response is a partial response due to large result set.
isPermanent() - Method in exception javax.servlet.UnavailableException
Returns a boolean indicating whether the servlet is permanently unavailable.
isPostback(FacesContext) - Method in class javax.faces.render.ResponseStateManager
Return true if the current request is a postback.
isPrependId() - Method in class javax.faces.component.UIForm

isProcessingInstruction() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is a ProcessingInstruction.
isPropertyResolved() - Method in class javax.el.ELContext
Returns whether an ELResolver has successfully resolved a given (base, property) pair.
isPropertySupported(String) - Method in class javax.xml.stream.XMLInputFactory
Query the set of properties that this factory supports.
isPropertySupported(String) - Method in class javax.xml.stream.XMLOutputFactory
Query the set of properties that this factory supports.
isPublished() - Method in class javax.xml.ws.Endpoint
Returns true if the endpoint is in the published state.
isReadOnly(ELContext, Object, Object) - Method in class javax.el.ArrayELResolver
If the base object is a Java language array, returns whether a call to ArrayELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
isReadOnly() - Method in class javax.el.BeanELResolver.BeanProperty

isReadOnly(ELContext, Object, Object) - Method in class javax.el.BeanELResolver
If the base object is not null, returns whether a call to BeanELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
isReadOnly(ELContext, Object, Object) - Method in class javax.el.CompositeELResolver
For a given base and property, attempts to determine whether a call to CompositeELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
isReadOnly(ELContext, Object, Object) - Method in class javax.el.ELResolver
For a given base and property, attempts to determine whether a call to ELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
isReadOnly(ELContext, Object, Object) - Method in class javax.el.ListELResolver
If the base object is a list, returns whether a call to ListELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
isReadOnly(ELContext, Object, Object) - Method in class javax.el.MapELResolver
If the base object is a map, returns whether a call to MapELResolver.setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always fail.
isReadOnly(ELContext, Object, Object) - Method in class javax.el.ResourceBundleELResolver
If the base object is not null and an instanceof ResourceBundle, return true.
isReadOnly(ELContext) - Method in class javax.el.ValueExpression
Evaluates the expression relative to the provided context, and returns true if a call to ValueExpression.setValue(javax.el.ELContext, java.lang.Object) will always fail.
isReadonly() - Method in class javax.faces.component.html.HtmlCommandButton
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlInputText
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlInputTextarea
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlSelectManyListbox
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlSelectManyMenu
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlSelectOneListbox
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlSelectOneMenu
Return the value of the readonly property.
isReadonly() - Method in class javax.faces.component.html.HtmlSelectOneRadio
Return the value of the readonly property.
isReadOnly(Object, Object) - Method in class javax.faces.el.PropertyResolver
Deprecated. Checks if the specified property is read-only.
isReadOnly(Object, int) - Method in class javax.faces.el.PropertyResolver
Deprecated. Checks if the specified index is read-only.
isReadOnly(FacesContext) - Method in class javax.faces.el.ValueBinding
Deprecated. Return true if the specified property of the specified property is known to be immutable; otherwise, return false.
isReadOnly(ELContext, Object, Object) - Method in class javax.servlet.jsp.el.ImplicitObjectELResolver
If the base object is null, and the property matches the name of a JSP implicit object, returns true to indicate that implicit objects cannot be overwritten.
isReadOnly(ELContext, Object, Object) - Method in class javax.servlet.jsp.el.ScopedAttributeELResolver
If the base object is null, returns false to indicate that scoped attributes are never read-only.
isRedeploySupported() - Method in interface javax.enterprise.deploy.spi.DeploymentManager
This method designates whether this platform vendor provides application redeployment functionality.
isRedisplay() - Method in class javax.faces.component.html.HtmlInputSecret
Return the value of the redisplay property.
isRegistered(ObjectName) - Method in interface javax.management.j2ee.Management
Checks whether a managed object, identified by its object name, is already registered with the MEJB.
isRegistered(Class, QName) - Method in interface javax.xml.rpc.encoding.TypeMapping
Checks whether or not type mapping between specified XML type and Java type is registered.
isRemoved() - Method in class javax.mail.event.MessageCountEvent
Indicates whether this event is the result of an explicit expunge by this client, or due to an expunge from external sources.
isRemoveEvent() - Method in class javax.enterprise.deploy.model.XpathEvent
Is this a remove event?
isRendered() - Method in class javax.faces.component.UIComponent
Return true if this component (and its children) should be rendered during the Render Response phase of the request processing lifecycle.
isRendered() - Method in class javax.faces.component.UIComponentBase

isRequestedSessionIdFromCookie() - Method in interface javax.servlet.http.HttpServletRequest
Checks whether the requested session ID came in as a cookie.
isRequestedSessionIdFromCookie() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return isRequestedSessionIdFromCookie() on the wrapped request object.
isRequestedSessionIdFromURL() - Method in interface javax.servlet.http.HttpServletRequest
Checks whether the requested session ID came in as part of the request URL.
isRequestedSessionIdFromUrl() - Method in interface javax.servlet.http.HttpServletRequest
Deprecated. As of Version 2.1 of the Java Servlet API, use HttpServletRequest.isRequestedSessionIdFromURL() instead.
isRequestedSessionIdFromURL() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return isRequestedSessionIdFromURL() on the wrapped request object.
isRequestedSessionIdFromUrl() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return isRequestedSessionIdFromUrl() on the wrapped request object.
isRequestedSessionIdValid() - Method in interface javax.servlet.http.HttpServletRequest
Checks whether the requested session ID is still valid.
isRequestedSessionIdValid() - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return isRequestedSessionIdValid() on the wrapped request object.
isRequired() - Method in interface javax.faces.component.EditableValueHolder
Return the "required field" state for this component.
isRequired() - Method in class javax.faces.component.UIInput
Return the "required field" state for this component.
isRequired() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Whether this attribute is required.
isRowAvailable() - Method in class javax.faces.component.UIData
Return a flag indicating whether there is rowData available at the current rowIndex.
isRowAvailable() - Method in class javax.faces.model.ArrayDataModel
Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the length of the array.
isRowAvailable() - Method in class javax.faces.model.DataModel
Return a flag indicating whether there is rowData available at the current rowIndex.
isRowAvailable() - Method in class javax.faces.model.ListDataModel
Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the size of the list.
isRowAvailable() - Method in class javax.faces.model.ResultDataModel
Return true if there is wrappedData available, and the current value of rowIndex is greater than or equal to zero, and less than the length of the array returned by calling getRows() on the underlying Result.
isRowAvailable() - Method in class javax.faces.model.ResultSetDataModel
Return true if there is wrappedData available, and the result of calling absolute() on the underlying ResultSet, passing the current value of rowIndex plus one (to account for the fact that ResultSet uses one-relative indexing), returns true.
isRowAvailable() - Method in class javax.faces.model.ScalarDataModel
Return true if there is wrappedData available, and the current value of rowIndex is zero.
isRunning() - Method in interface javax.enterprise.deploy.spi.status.DeploymentStatus
A convience method to report if the operation is in the running state.
isSameRM(XAResource) - Method in interface javax.transaction.xa.XAResource
This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager instance represented by the parameter xares.
isSavingStateInClient(FacesContext) - Method in class javax.faces.application.StateManager

isSavingStateInClient(FacesContext) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.isSavingStateInClient(javax.faces.context.FacesContext) on the wrapped StateManager object.
isSecure() - Method in interface javax.servlet.ServletRequest
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
isSecure() - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return isSecure() on the wrapped request object.
isSelected() - Method in class javax.faces.component.UISelectBoolean
Return the local value of the selected state of this component.
isSession() - Method in interface javax.ejb.EJBMetaData
Test if the enterprise Bean's type is "session".
isSet(Flags.Flag) - Method in class javax.mail.internet.MimeMessage
Check whether the flag specified in the flag argument is set in this message.
isSet(Flags.Flag) - Method in class javax.mail.Message
Check whether the flag specified in the flag argument is set in this message.
isShowDetail() - Method in class javax.faces.component.UIMessage
Return the flag indicating whether the detail property of the associated message(s) should be displayed.
isShowDetail() - Method in class javax.faces.component.UIMessages
Return the flag indicating whether the detail property of the associated message(s) should be displayed.
isShowSummary() - Method in class javax.faces.component.UIMessage
Return the flag indicating whether the summary property of the associated message(s) should be displayed.
isShowSummary() - Method in class javax.faces.component.UIMessages
Return the flag indicating whether the summary property of the associated message(s) should be displayed.
isSpecified() - Method in interface javax.xml.stream.events.Attribute
A flag indicating whether this attribute was actually specified in the start-tag of its element, or was defaulted from the schema.
isStandalone() - Method in interface javax.xml.stream.events.StartDocument
Returns if this XML is standalone
isStandalone() - Method in class javax.xml.stream.util.StreamReaderDelegate

isStandalone() - Method in interface javax.xml.stream.XMLStreamReader
Get the standalone declaration from the xml declaration
isStartDocument() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is a StartDocument.
isStartElement() - Method in interface javax.xml.stream.events.XMLEvent
A utility function to check if this event is a StartElement.
isStartElement() - Method in class javax.xml.stream.util.StreamReaderDelegate

isStartElement() - Method in interface javax.xml.stream.XMLStreamReader
Returns true if the cursor points to a start tag (otherwise false)
isStatelessSession() - Method in interface javax.ejb.EJBMetaData
Test if the enterprise Bean's type is "stateless session".
isStopSupported() - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
Tests whether the vendor supports a stop opertation for deployment activities.
isSubmitted() - Method in class javax.faces.component.UIForm
Returns the current value of the submitted property.
isSubscribed() - Method in class javax.mail.Folder
Returns true if this Folder is subscribed.
isSuppressed() - Method in class javax.faces.webapp.UIComponentTag
Deprecated.
isSynchronous() - Method in interface javax.xml.registry.Connection
Indicates whether a client uses synchronous communication with JAXR provider or not.
isTooltip() - Method in class javax.faces.component.html.HtmlMessage
Return the value of the tooltip property.
isTooltip() - Method in class javax.faces.component.html.HtmlMessages
Return the value of the tooltip property.
isTransactional() - Method in interface javax.management.j2ee.statistics.JMSConnectionStats
Returns the transactional state of this JMS connection.
isTransient() - Method in interface javax.faces.component.StateHolder
If true, the Object implementing this interface must not participate in state saving or restoring.
isTransient() - Method in class javax.faces.component.UIComponentBase

isTransient() - Method in class javax.faces.convert.DateTimeConverter

isTransient() - Method in class javax.faces.convert.EnumConverter

isTransient() - Method in class javax.faces.convert.NumberConverter

isTransient() - Method in class javax.faces.event.MethodExpressionActionListener

isTransient() - Method in class javax.faces.event.MethodExpressionValueChangeListener

isTransient() - Method in class javax.faces.validator.DoubleRangeValidator

isTransient() - Method in class javax.faces.validator.LengthValidator

isTransient() - Method in class javax.faces.validator.LongRangeValidator

isTransient() - Method in class javax.faces.validator.MethodExpressionValidator

isTypeSubstituted() - Method in class javax.xml.bind.JAXBElement
Returns true iff this xml element instance's value has a different type than xml element declaration's declared type.
isUserInRole(String) - Method in class javax.faces.context.ExternalContext
Return true if the currently authenticated user is included in the specified role.
isUserInRole(String) - Method in interface javax.servlet.http.HttpServletRequest
Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
isUserInRole(String) - Method in class javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return isUserInRole(String role) on the wrapped request object.
isUserInRole(String) - Method in interface javax.xml.rpc.server.ServletEndpointContext
Returns a boolean indicating whether the authenticated user for the current method invocation on the endpoint instance is included in the specified logical "role".
isUserInRole(String) - Method in interface javax.xml.ws.WebServiceContext
Returns a boolean indicating whether the authenticated user is included in the specified logical role.
isValid() - Method in interface javax.faces.component.EditableValueHolder
Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).
isValid() - Method in class javax.faces.component.UIInput

isValid(TagData) - Method in class javax.servlet.jsp.tagext.TagExtraInfo
Translation-time validation of the attributes.
isValid(TagData) - Method in class javax.servlet.jsp.tagext.TagInfo
Translation-time validation of the attributes.
isValidating() - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Indicates whether or not the Unmarshaller is configured to validate during unmarshal operations.
isValidating() - Method in interface javax.xml.bind.Unmarshaller
Deprecated. since JAXB2.0, please see Unmarshaller.getSchema()
isValueReference(String) - Static method in class javax.faces.webapp.UIComponentTag
Deprecated. Return true if the specified value conforms to the syntax requirements of a value binding expression.
isWhiteSpace(char) - Static method in class javax.xml.bind.annotation.adapters.CollapsedStringAdapter
returns true if the specified char is a white space character.
isWhiteSpace() - Method in interface javax.xml.stream.events.Characters
Returns true if this set of Characters is all whitespace.
isWhiteSpace() - Method in class javax.xml.stream.util.StreamReaderDelegate

isWhiteSpace() - Method in interface javax.xml.stream.XMLStreamReader
Returns true if the cursor points to a character data event that consists of all whitespace
isWhiteSpaceExceptSpace(char) - Static method in class javax.xml.bind.annotation.adapters.NormalizedStringAdapter
Returns true if the specified char is a white space character but not 0x20.
isXOPPackage() - Method in class javax.xml.bind.attachment.AttachmentMarshaller
Read-only property that returns true if JAXB marshaller should enable XOP creation.
isXOPPackage() - Method in class javax.xml.bind.attachment.AttachmentUnmarshaller
Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.
itemExists(String) - Method in interface javax.jms.MapMessage
Indicates whether an item exists in this MapMessage object.
IterationTag - Interface in javax.servlet.jsp.tagext
The IterationTag interface extends Tag by defining one additional method that controls the reevaluation of its body.

J

J2eeApplicationObject - Interface in javax.enterprise.deploy.model
J2eeApplicationObject is an interface that represents a J2EE application (EAR); it maintains a DeployableObject for each module in the archive.
javaCharset(String) - Static method in class javax.mail.internet.MimeUtility
Convert a MIME charset name into a valid Java charset name.
JavaMailStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JavaMail resource.
javax.activation - package javax.activation
The JavaBeans(TM) Activation Framework is used by the JavaMail(TM) API to manage MIME data.
javax.annotation - package javax.annotation

javax.annotation.security - package javax.annotation.security

javax.ejb - package javax.ejb
The javax.ejb package contains the Enterprise JavaBeans classes and interfaces that define the contracts between the enterprise bean and its clients and between the enterprise bean and the EJB container.
javax.ejb.spi - package javax.ejb.spi
The javax.ejb.spi package defines interfaces that are implemented by the EJB container.
javax.el - package javax.el
Provides the API for the Unified Expression Language shared by the JSP 2.1 and JSF 1.2 technologies.
javax.enterprise.deploy.model - package javax.enterprise.deploy.model
Provides Tool Vendor implementation classes.
javax.enterprise.deploy.model.exceptions - package javax.enterprise.deploy.model.exceptions
Provides Tool Vendor exception implementation classes.
javax.enterprise.deploy.shared - package javax.enterprise.deploy.shared
Provides shared objects for Tool Vendor and Product Vendor implementation classes.
javax.enterprise.deploy.shared.factories - package javax.enterprise.deploy.shared.factories
Provides shared factory manager object for Tool Vendor and Product Vendor implementation classes.
javax.enterprise.deploy.spi - package javax.enterprise.deploy.spi
Provides J2EE Product Vendor implementation classes.
javax.enterprise.deploy.spi.exceptions - package javax.enterprise.deploy.spi.exceptions
Provides J2EE Product Vendor deployment exception implementation classes.
javax.enterprise.deploy.spi.factories - package javax.enterprise.deploy.spi.factories
Provides J2EE Product Vendor deployment factory implementation classes.
javax.enterprise.deploy.spi.status - package javax.enterprise.deploy.spi.status
Provides J2EE Product Vendor deployment status implementation classes.
javax.faces - package javax.faces
Top level classes for the JavaServer(tm) Faces API.
javax.faces.application - package javax.faces.application
APIs that are used to link an application's business logic objects to JavaServer Faces, as well as convenient pluggable mechanisms to manage the execution of an application that is based on JavaServer Faces.
javax.faces.component - package javax.faces.component
Fundamental APIs for user interface components.
javax.faces.component.html - package javax.faces.component.html
Specialized user interface component classes for HTML.
javax.faces.context - package javax.faces.context
Classes and interfaces defining per-request state information.
javax.faces.convert - package javax.faces.convert
Contains classes and interfaces defining converters.
javax.faces.el - package javax.faces.el
DEPRECATED Classes and interfaces for evaluating and processing reference expressions.
javax.faces.event - package javax.faces.event
Interfaces describing events and event listeners, and concrete event implementation classes.
javax.faces.lifecycle - package javax.faces.lifecycle
Classes and interfaces defining lifecycle management for the JavaServer Faces implementation.
javax.faces.model - package javax.faces.model
Standard model data beans for JavaServer Faces.
javax.faces.render - package javax.faces.render
Classes and interfaces defining the rendering model.
javax.faces.validator - package javax.faces.validator
Interface defining the validator model, and concrete validator implementation classes.
javax.faces.webapp - package javax.faces.webapp
Classes required for integration of JavaServer Faces into web applications, including a standard servlet, base classes for JSP custom component tags, and concrete tag implementations for core tags.
javax.interceptor - package javax.interceptor
The javax.interceptor package contains classes and interfaces for use with EJB interceptors.
javax.jms - package javax.jms
The Java Message Service (JMS) API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.
javax.jws - package javax.jws

javax.jws.soap - package javax.jws.soap

javax.mail - package javax.mail
The JavaMailTM API provides classes that model a mail system.
javax.mail.event - package javax.mail.event
Listeners and events for the JavaMail API.
javax.mail.internet - package javax.mail.internet
Classes specific to Internet mail systems.
javax.mail.search - package javax.mail.search
Message search terms for the JavaMail API.
javax.mail.util - package javax.mail.util
Utility classes.
javax.management.j2ee - package javax.management.j2ee
Provides the J2EE Management Enterprise Bean component (MEJB) interfaces.
javax.management.j2ee.statistics - package javax.management.j2ee.statistics
Provides the standard interfaces for accessing performance data from J2EE managed objects Package Specification JSR 77, J2EE Management Related Documentation For overviews, tutorials, examples, guides, and tool documentation, please see: J2EE Tools javax.persistence - package javax.persistence
The javax.persistence package contains the classes and interfaces that define the contracts between a persistence provider and the managed classes and the clients of the Java Persistence API.
javax.persistence.spi - package javax.persistence.spi
The javax.persistence.spi package defines the classes and interfaces that are implemented by the persistence provider and the Java EE container for use by the container, provider, and/or Persistence bootstrap class in deployment and bootstrapping.
javax.resource - package javax.resource
The javax.resource package is the top-level package for the J2EE Connector API specification.
javax.resource.cci - package javax.resource.cci
The javax.resource.cci package contains API specification for the Common Client Interface (CCI).
javax.resource.spi - package javax.resource.spi
The javax.resource.spi package contains APIs for the system contracts defined in the J2EE Connector Architecture specification.
javax.resource.spi.endpoint - package javax.resource.spi.endpoint
This package contains system contracts for service endpoint interactions.
javax.resource.spi.security - package javax.resource.spi.security
The javax.resource.spi.security package contains APIs for the security management contract.
javax.resource.spi.work - package javax.resource.spi.work
This package contains APIs for the work management contract.
javax.security.jacc - package javax.security.jacc
This package contains the Java Authorization Contract for Containers API
javax.servlet - package javax.servlet
The javax.servlet package contains a number of classes and interfaces that describe and define the contracts between a servlet class and the runtime environment provided for an instance of such a class by a conforming servlet container.
javax.servlet.http - package javax.servlet.http
The javax.servlet.http package contains a number of classes and interfaces that describe and define the contracts between a servlet class running under the HTTP protocol and the runtime environment provided for an instance of such a class by a conforming servlet container.
javax.servlet.jsp - package javax.servlet.jsp
Classes and interfaces for the Core JSP 2.1 API.
javax.servlet.jsp.el - package javax.servlet.jsp.el
Provides the ELResolver classes that define the object resolution rules that must be supported by a JSP container with the new unified Expression Language.
javax.servlet.jsp.tagext - package javax.servlet.jsp.tagext
Classes and interfaces for the definition of JavaServer Pages Tag Libraries.
javax.transaction - package javax.transaction
Provides the API that defines the contract between the transaction manager and the various parties involved in a distributed transaction namely : resource manager, application, and application server.
javax.transaction.xa - package javax.transaction.xa
Provides the API that defines the contract between the transaction manager and the resource manager, which allows the transaction manager to enlist and delist resource objects (supplied by the resource manager driver) in JTA transactions.
javax.xml.bind - package javax.xml.bind
Provides a runtime binding framework for client applications including unmarshalling, marshalling, and validation capabilities.
javax.xml.bind.annotation - package javax.xml.bind.annotation
Defines annotations for customizing Java program elements to XML Schema mapping.
javax.xml.bind.annotation.adapters - package javax.xml.bind.annotation.adapters
XmlAdapter and its spec-defined sub-classes to allow arbitrary Java classes to be used with JAXB.
javax.xml.bind.attachment - package javax.xml.bind.attachment
This package is implemented by a MIME-based package processor that enables the interpretation and creation of optimized binary data within an MIME-based package format.
javax.xml.bind.helpers - package javax.xml.bind.helpers
JAXB Provider Use Only: Provides partial default implementations for some of the javax.xml.bind interfaces.
javax.xml.bind.util - package javax.xml.bind.util
Useful client utility classes.
javax.xml.registry - package javax.xml.registry
This package and its sub-packages describe the API classes and interfaces for the JAXR API.
javax.xml.registry.infomodel - package javax.xml.registry.infomodel
This package describes the information model for the JAXR API.
javax.xml.rpc - package javax.xml.rpc
This package contains the core JAX-RPC APIs for the client programming model.
javax.xml.rpc.encoding - package javax.xml.rpc.encoding
This package defines APIs for the extensible type mapping framework.
javax.xml.rpc.handler - package javax.xml.rpc.handler
This package defines APIs for SOAP Message Handlers
javax.xml.rpc.handler.soap - package javax.xml.rpc.handler.soap
This package defines APIs for SOAP Message Handlers
javax.xml.rpc.holders - package javax.xml.rpc.holders
This package contains the standard Java Holder classes.
javax.xml.rpc.server - package javax.xml.rpc.server
This package defines APIs for the servlet based JAX-RPC endpoint model.
javax.xml.rpc.soap - package javax.xml.rpc.soap
This package defines APIs specific to the SOAP binding.
javax.xml.soap - package javax.xml.soap
Provides the API for creating and building SOAP messages.
javax.xml.stream - package javax.xml.stream

javax.xml.stream.events - package javax.xml.stream.events

javax.xml.stream.util - package javax.xml.stream.util

javax.xml.ws - package javax.xml.ws
This package contains the core JAX-WS APIs.
javax.xml.ws.handler - package javax.xml.ws.handler
This package defines APIs for message handlers.
javax.xml.ws.handler.soap - package javax.xml.ws.handler.soap
This package defines APIs for SOAP message handlers.
javax.xml.ws.http - package javax.xml.ws.http
This package defines APIs specific to the HTTP binding.
javax.xml.ws.soap - package javax.xml.ws.soap
This package defines APIs specific to the SOAP binding.
javax.xml.ws.spi - package javax.xml.ws.spi
This package defines SPIs for JAX-WS 2.0.
JAXB_CONTEXT_FACTORY - Static variable in class javax.xml.bind.JAXBContext
The name of the property that contains the name of the class capable of creating new JAXBContext objects.
JAXB_ENCODING - Static variable in interface javax.xml.bind.Marshaller
The name of the property used to specify the output encoding in the marshalled XML data.
JAXB_FORMATTED_OUTPUT - Static variable in interface javax.xml.bind.Marshaller
The name of the property used to specify whether or not the marshalled XML data is formatted with linefeeds and indentation.
JAXB_FRAGMENT - Static variable in interface javax.xml.bind.Marshaller
The name of the property used to specify whether or not the marshaller will generate document level events (ie calling startDocument or endDocument).
JAXB_NO_NAMESPACE_SCHEMA_LOCATION - Static variable in interface javax.xml.bind.Marshaller
The name of the property used to specify the xsi:noNamespaceSchemaLocation attribute value to place in the marshalled XML output.
JAXB_SCHEMA_LOCATION - Static variable in interface javax.xml.bind.Marshaller
The name of the property used to specify the xsi:schemaLocation attribute value to place in the marshalled XML output.
JAXBContext - Class in javax.xml.bind
The JAXBContext class provides the client's entry point to the JAXB API.
JAXBContext() - Constructor for class javax.xml.bind.JAXBContext

JAXBElement<T> - Class in javax.xml.bind
JAXB representation of an Xml Element.
JAXBElement(QName, Class<T>, Class, T) - Constructor for class javax.xml.bind.JAXBElement
Construct an xml element instance.
JAXBElement(QName, Class<T>, T) - Constructor for class javax.xml.bind.JAXBElement
Construct an xml element instance.
JAXBElement.GlobalScope - Class in javax.xml.bind
Designates global scope for an xml element.
JAXBElement.GlobalScope() - Constructor for class javax.xml.bind.JAXBElement.GlobalScope

JAXBException - Exception in javax.xml.bind
This is the root exception class for all JAXB exceptions.
JAXBException(String) - Constructor for exception javax.xml.bind.JAXBException
Construct a JAXBException with the specified detail message.
JAXBException(String, String) - Constructor for exception javax.xml.bind.JAXBException
Construct a JAXBException with the specified detail message and vendor specific errorCode.
JAXBException(Throwable) - Constructor for exception javax.xml.bind.JAXBException
Construct a JAXBException with a linkedException.
JAXBException(String, Throwable) - Constructor for exception javax.xml.bind.JAXBException
Construct a JAXBException with the specified detail message and linkedException.
JAXBException(String, String, Throwable) - Constructor for exception javax.xml.bind.JAXBException
Construct a JAXBException with the specified detail message, vendor specific errorCode, and linkedException.
JAXBIntrospector - Class in javax.xml.bind
Provide access to JAXB xml binding data for a JAXB object.
JAXBIntrospector() - Constructor for class javax.xml.bind.JAXBIntrospector

JAXBResult - Class in javax.xml.bind.util
JAXP Result implementation that unmarshals a JAXB object.
JAXBResult(JAXBContext) - Constructor for class javax.xml.bind.util.JAXBResult
Creates a new instance that uses the specified JAXBContext to unmarshal.
JAXBResult(Unmarshaller) - Constructor for class javax.xml.bind.util.JAXBResult
Creates a new instance that uses the specified Unmarshaller to unmarshal an object.
JAXBSource - Class in javax.xml.bind.util
JAXP Source implementation that marshals a JAXB-generated object.
JAXBSource(JAXBContext, Object) - Constructor for class javax.xml.bind.util.JAXBSource
Creates a new Source for the given content object.
JAXBSource(Marshaller, Object) - Constructor for class javax.xml.bind.util.JAXBSource
Creates a new Source for the given content object.
JAXRException - Exception in javax.xml.registry
Signals that a JAXR exception has occurred.
JAXRException() - Constructor for exception javax.xml.registry.JAXRException
Constructs a JAXRException object with no reason or embedded Throwable.
JAXRException(String) - Constructor for exception javax.xml.registry.JAXRException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
JAXRException(String, Throwable) - Constructor for exception javax.xml.registry.JAXRException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
JAXRException(Throwable) - Constructor for exception javax.xml.registry.JAXRException
Constructs a JAXRException object initialized with the given Throwable object.
JAXRPCException - Exception in javax.xml.rpc
The javax.xml.rpc.JAXRPCException is thrown from the core JAX-RPC APIs to indicate an exception related to the JAX-RPC runtime mechanisms.
JAXRPCException() - Constructor for exception javax.xml.rpc.JAXRPCException
Constructs a new exception with null as its detail message.
JAXRPCException(String) - Constructor for exception javax.xml.rpc.JAXRPCException
Constructs a new exception with the specified detail message.
JAXRPCException(String, Throwable) - Constructor for exception javax.xml.rpc.JAXRPCException
Constructs a new exception with the specified detail message and cause.
JAXRPCException(Throwable) - Constructor for exception javax.xml.rpc.JAXRPCException
Constructs a new JAXRPCException with the specified cause and a detail message of (cause==null ?
JAXRResponse - Interface in javax.xml.registry
A JAXR requests' response.
JAXWSPROVIDER_PROPERTY - Static variable in class javax.xml.ws.spi.Provider
A constant representing the property used to lookup the name of a Provider implementation class.
JCAConnectionPoolStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JCA Connection Pool
JCAConnectionStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JCA connection
JCAStats - Interface in javax.management.j2ee.statistics
Specifies statistics provided by a JCA resource
JDBCConnectionPoolStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JDBC connection pool.
JDBCConnectionStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by all (pooled and non-pooled) JDBC connections.
JDBCStats - Interface in javax.management.j2ee.statistics
Statistics provided by a JDBC resource
JMSConnectionStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JMS connection
JMSConsumerStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JMS message consumer
JMSEndpointStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JMS message producer or a JMS message consumer.
JMSException - Exception in javax.jms
This is the root class of all JMS API exceptions.
JMSException(String, String) - Constructor for exception javax.jms.JMSException
Constructs a JMSException with the specified reason and error code.
JMSException(String) - Constructor for exception javax.jms.JMSException
Constructs a JMSException with the specified reason and with the error code defaulting to null.
JMSProducerStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JMS message producer
JMSSecurityException - Exception in javax.jms
This exception must be thrown when a provider rejects a user name/password submitted by a client.
JMSSecurityException(String, String) - Constructor for exception javax.jms.JMSSecurityException
Constructs a JMSSecurityException with the specified reason and error code.
JMSSecurityException(String) - Constructor for exception javax.jms.JMSSecurityException
Constructs a JMSSecurityException with the specified reason.
JMSSessionStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JMS session.
JMSStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JMS Resource
JoinColumn - Annotation Type in javax.persistence
Is used to specify a mapped column for joining an entity association.
JoinColumns - Annotation Type in javax.persistence
Defines mapping for the composite foreign keys.
JoinTable - Annotation Type in javax.persistence
This annotation is used in the mapping of associations.
joinTransaction() - Method in interface javax.persistence.EntityManager
Indicate to the EntityManager that a JTA transaction is active.
JspApplicationContext - Interface in javax.servlet.jsp
Stores application-scoped information relevant to JSP containers.
JspContext - Class in javax.servlet.jsp
JspContext serves as the base class for the PageContext class and abstracts all information that is not specific to servlets.
JspContext() - Constructor for class javax.servlet.jsp.JspContext
Sole constructor.
jspDestroy() - Method in interface javax.servlet.jsp.JspPage
The jspDestroy() method is invoked when the JSP page is about to be destroyed.
JspEngineInfo - Class in javax.servlet.jsp
The JspEngineInfo is an abstract class that provides information on the current JSP engine.
JspEngineInfo() - Constructor for class javax.servlet.jsp.JspEngineInfo
Sole constructor.
JspException - Exception in javax.servlet.jsp
A generic exception known to the JSP engine; uncaught JspExceptions will result in an invocation of the errorpage machinery.
JspException() - Constructor for exception javax.servlet.jsp.JspException
Construct a JspException.
JspException(String) - Constructor for exception javax.servlet.jsp.JspException
Constructs a new JSP exception with the specified message.
JspException(String, Throwable) - Constructor for exception javax.servlet.jsp.JspException
Constructs a new JspException with the specified detail message and cause.
JspException(Throwable) - Constructor for exception javax.servlet.jsp.JspException
Constructs a new JspException with the specified cause.
JspFactory - Class in javax.servlet.jsp
The JspFactory is an abstract class that defines a number of factory methods available to a JSP page at runtime for the purposes of creating instances of various interfaces and classes used to support the JSP implementation.
JspFactory() - Constructor for class javax.servlet.jsp.JspFactory
Sole constructor.
JspFragment - Class in javax.servlet.jsp.tagext
Encapsulates a portion of JSP code in an object that can be invoked as many times as needed.
JspFragment() - Constructor for class javax.servlet.jsp.tagext.JspFragment

JspIdConsumer - Interface in javax.servlet.jsp.tagext
This interface indicates to the container that a tag handler wishes to be provided with a compiler generated ID.
jspInit() - Method in interface javax.servlet.jsp.JspPage
The jspInit() method is invoked when the JSP page is initialized.
JspPage - Interface in javax.servlet.jsp
The JspPage interface describes the generic interaction that a JSP Page Implementation class must satisfy; pages that use the HTTP protocol are described by the HttpJspPage interface.
JspTag - Interface in javax.servlet.jsp.tagext
Serves as a base class for Tag and SimpleTag.
JspTagException - Exception in javax.servlet.jsp
Exception to be used by a Tag Handler to indicate some unrecoverable error.
JspTagException(String) - Constructor for exception javax.servlet.jsp.JspTagException
Constructs a new JspTagException with the specified message.
JspTagException() - Constructor for exception javax.servlet.jsp.JspTagException
Constructs a new JspTagException with no message.
JspTagException(String, Throwable) - Constructor for exception javax.servlet.jsp.JspTagException
Constructs a new JspTagException when the JSP Tag needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message.
JspTagException(Throwable) - Constructor for exception javax.servlet.jsp.JspTagException
Constructs a new JSP Tag exception when the JSP Tag needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation.
jspversion - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
The version of the JSP specification this tag library is written to.
JspWriter - Class in javax.servlet.jsp
The actions and template data in a JSP page is written using the JspWriter object that is referenced by the implicit variable out which is initialized automatically using methods in the PageContext object.
JspWriter(int, boolean) - Constructor for class javax.servlet.jsp.JspWriter
Protected constructor.
JTAStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a JTA resource.
JVMStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a Java VM.

K

Key - Interface in javax.xml.registry.infomodel
Represents a unique key that identifies a RegistryObject.
KEY - Static variable in interface javax.xml.registry.LifeCycleManager

L

LASTUID - Static variable in interface javax.mail.UIDFolder
This is a special value that can be used as the end parameter in getMessagesByUID(start, end), to denote the UID of the last message in the folder.
LazyAssociatableConnectionManager - Interface in javax.resource.spi
This is a mix-in interface that may be optionally implemented by a ConnectionManager implementation.
lazyEnlist(ManagedConnection) - Method in interface javax.resource.spi.LazyEnlistableConnectionManager
This method is called by a resource adapter (that is capable of lazy transaction enlistment optimization) in order to lazily enlist a connection object with a XA transaction.
LazyEnlistableConnectionManager - Interface in javax.resource.spi
This is a mix-in interface that may be optionally implemented by a ConnectionManager implementation.
LazyEnlistableManagedConnection - Interface in javax.resource.spi
This is a mix-in interface that may be optionally implemented by a ManagedConnection implementation.
LE - Static variable in class javax.mail.search.ComparisonTerm

LengthValidator - Class in javax.faces.validator
LengthValidator is a Validator that checks the number of characters in the String representation of the value of the associated component.
LengthValidator() - Constructor for class javax.faces.validator.LengthValidator
Construct a Validator with no preconfigured limits.
LengthValidator(int) - Constructor for class javax.faces.validator.LengthValidator
Construct a Validator with the specified preconfigured limit.
LengthValidator(int, int) - Constructor for class javax.faces.validator.LengthValidator
Construct a Validator with the specified preconfigured limits.
Lifecycle - Class in javax.faces.lifecycle
Lifecycle manages the processing of the entire lifecycle of a particular JavaServer Faces request.
Lifecycle() - Constructor for class javax.faces.lifecycle.Lifecycle

LIFECYCLE_FACTORY - Static variable in class javax.faces.FactoryFinder
The property name for the LifecycleFactory class name.
LIFECYCLE_ID_ATTR - Static variable in class javax.faces.webapp.FacesServlet
Context initialization parameter name for the lifecycle identifier of the Lifecycle instance to be utilized.
LifecycleFactory - Class in javax.faces.lifecycle
LifecycleFactory is a factory object that creates (if needed) and returns Lifecycle instances.
LifecycleFactory() - Constructor for class javax.faces.lifecycle.LifecycleFactory

LifeCycleManager - Interface in javax.xml.registry
The LifeCycleManager interface is the main interface in the API for managing life cycle operations on objects defined by the information model.
limit - Variable in class javax.mail.Quota.Resource
The usage limit for the resource.
linkConfiguration(PolicyConfiguration) - Method in interface javax.security.jacc.PolicyConfiguration
Creates a relationship between this configuration and another such that they share the same principal-to-role mappings.
list(String) - Method in class javax.mail.Folder
Returns a list of Folders belonging to this Folder's namespace that match the specified pattern.
list() - Method in class javax.mail.Folder
Convenience method that returns the list of folders under this Folder.
ListDataModel - Class in javax.faces.model
ListDataModel is a convenience implementation of DataModel that wraps an List of Java objects.
ListDataModel() - Constructor for class javax.faces.model.ListDataModel
Construct a new ListDataModel with no specified wrapped data.
ListDataModel(List) - Constructor for class javax.faces.model.ListDataModel
Construct a new ListDataModel wrapping the specified list.
ListELResolver - Class in javax.el
Defines property resolution behavior on instances of List.
ListELResolver() - Constructor for class javax.el.ListELResolver
Creates a new read/write ListELResolver.
ListELResolver(boolean) - Constructor for class javax.el.ListELResolver
Creates a new ListELResolver whose read-only status is determined by the given parameter.
ListenerRegistration - Interface in javax.management.j2ee
ListenerRegistration defines the methods which clients of the MEJB use to add and remove event listeners.
listSubscribed(String) - Method in class javax.mail.Folder
Returns a list of subscribed Folders belonging to this Folder's namespace that match the specified pattern.
listSubscribed() - Method in class javax.mail.Folder
Convenience method that returns the list of subscribed folders under this Folder.
load(InputStream) - Method in class javax.mail.internet.InternetHeaders
Read and parse the given RFC822 message stream till the blank line separating the header from the body.
loadService(Class) - Method in class javax.xml.rpc.ServiceFactory
Create an instance of the generated service implementation class for a given service interface, if available.
loadService(URL, Class, Properties) - Method in class javax.xml.rpc.ServiceFactory
Create an instance of the generated service implementation class for a given service interface, if available.
loadService(URL, QName, Properties) - Method in class javax.xml.rpc.ServiceFactory
Create an instance of the generated service implementation class for a given service, if available.
Lob - Annotation Type in javax.persistence
Specifies that a persistent property or field should be persisted as a large object to a database-supported large object type.
Local - Annotation Type in javax.ejb
When used on the bean class, declares the local business interface(s) for a session bean.
LOCAL_TRANSACTION_COMMITTED - Static variable in class javax.resource.spi.ConnectionEvent
Event notification that a Resource Manager Local Transaction was committed on the connection
LOCAL_TRANSACTION_ROLLEDBACK - Static variable in class javax.resource.spi.ConnectionEvent
Event notification that a Resource Manager Local Transaction was rolled back on the connection
LOCAL_TRANSACTION_STARTED - Static variable in class javax.resource.spi.ConnectionEvent
Event notification that a Resource Manager Local Transaction was started on the connection
LocalHome - Annotation Type in javax.ejb
Declares the Local Home or adapted Local Home interface for a session bean.
LOCALIZED_STRING - Static variable in interface javax.xml.registry.LifeCycleManager

LocalizedString - Interface in javax.xml.registry.infomodel
This interface is used as a simple wrapper interface that associates a String with its Locale.
LocalTransaction - Interface in javax.resource.cci
The LocalTransaction defines a transaction demarcation interface for resource manager local transactions.
LocalTransaction - Interface in javax.resource.spi
LocalTransaction interface provides support for transactions that are managed internal to an EIS resource manager, and do not require an external transaction manager.
localTransactionCommitted(ConnectionEvent) - Method in interface javax.resource.spi.ConnectionEventListener
Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance.
LocalTransactionException - Exception in javax.resource.spi
A LocalTransactionException represents various error conditions related to the local transaction management contract.
LocalTransactionException() - Constructor for exception javax.resource.spi.LocalTransactionException
Constructs a new instance with null as its detail message.
LocalTransactionException(String) - Constructor for exception javax.resource.spi.LocalTransactionException
Constructs a new instance with the specified detail message.
LocalTransactionException(Throwable) - Constructor for exception javax.resource.spi.LocalTransactionException
Constructs a new throwable with the specified cause.
LocalTransactionException(String, Throwable) - Constructor for exception javax.resource.spi.LocalTransactionException
Constructs a new throwable with the specified detail message and cause.
LocalTransactionException(String, String) - Constructor for exception javax.resource.spi.LocalTransactionException
Constructs a new throwable with the specified detail message and an error code.
localTransactionRolledback(ConnectionEvent) - Method in interface javax.resource.spi.ConnectionEventListener
Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance.
localTransactionStarted(ConnectionEvent) - Method in interface javax.resource.spi.ConnectionEventListener
Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance.
Location - Interface in javax.xml.stream
Provides information on the location of an event.
location - Variable in exception javax.xml.stream.XMLStreamException

lock(Object, LockModeType) - Method in interface javax.persistence.EntityManager
Set the lock mode for an entity object contained in the persistence context.
LockModeType - Enum in javax.persistence
Lock modes that can be specified by means of the EntityManager.lock() method.
log(String) - Method in class javax.faces.context.ExternalContext
Log the specified message to the application object.
log(String, Throwable) - Method in class javax.faces.context.ExternalContext
Log the specified message and exception to the application object.
log - Static variable in class javax.faces.webapp.UIComponentTagBase

log(String) - Method in class javax.servlet.GenericServlet
Writes the specified message to a servlet log file, prepended by the servlet's name.
log(String, Throwable) - Method in class javax.servlet.GenericServlet
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file, prepended by the servlet's name.
log(String) - Method in interface javax.servlet.ServletContext
Writes the specified message to a servlet log file, usually an event log.
log(Exception, String) - Method in interface javax.servlet.ServletContext
Deprecated. As of Java Servlet API 2.1, use ServletContext.log(String message, Throwable throwable) instead.
This method was originally defined to write an exception's stack trace and an explanatory error message to the servlet log file.
log(String, Throwable) - Method in interface javax.servlet.ServletContext
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file.
LogicalHandler<C extends LogicalMessageContext> - Interface in javax.xml.ws.handler
The LogicalHandler extends Handler to provide typesafety for the message context parameter.
LogicalMessage - Interface in javax.xml.ws
The LogicalMessage interface represents a protocol agnostic XML message and contains methods that provide access to the payload of the message.
LogicalMessageContext - Interface in javax.xml.ws.handler
The LogicalMessageContext interface extends MessageContext to provide access to a the contained message as a protocol neutral LogicalMessage
LONG_ID - Static variable in class javax.faces.convert.LongConverter
The message identifier of the FacesMessage to be created if the conversion to Long fails.
LongConverter - Class in javax.faces.convert
Converter implementation for java.lang.Long (and long primitive) values.
LongConverter() - Constructor for class javax.faces.convert.LongConverter

LongHolder - Class in javax.xml.rpc.holders

LongHolder() - Constructor for class javax.xml.rpc.holders.LongHolder

LongHolder(long) - Constructor for class javax.xml.rpc.holders.LongHolder

LongRangeValidator - Class in javax.faces.validator
LongRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum values.
LongRangeValidator() - Constructor for class javax.faces.validator.LongRangeValidator
Construct a Validator with no preconfigured limits.
LongRangeValidator(long) - Constructor for class javax.faces.validator.LongRangeValidator
Construct a Validator with the specified preconfigured limit.
LongRangeValidator(long, long) - Constructor for class javax.faces.validator.LongRangeValidator
Construct a Validator with the specified preconfigured limits.
LongWrapperHolder - Class in javax.xml.rpc.holders

LongWrapperHolder() - Constructor for class javax.xml.rpc.holders.LongWrapperHolder

LongWrapperHolder(Long) - Constructor for class javax.xml.rpc.holders.LongWrapperHolder

lookup(String) - Method in interface javax.ejb.EJBContext
Lookup a resource within the component's private naming context.
LT - Static variable in class javax.mail.search.ComparisonTerm

M

MailcapCommandMap - Class in javax.activation
MailcapCommandMap extends the CommandMap abstract class.
MailcapCommandMap() - Constructor for class javax.activation.MailcapCommandMap
The default Constructor.
MailcapCommandMap(String) - Constructor for class javax.activation.MailcapCommandMap
Constructor that allows the caller to specify the path of a mailcap file.
MailcapCommandMap(InputStream) - Constructor for class javax.activation.MailcapCommandMap
Constructor that allows the caller to specify an InputStream containing a mailcap file.
MailDateFormat - Class in javax.mail.internet
Formats and parses date specification based on the draft-ietf-drums-msg-fmt-08 dated January 26, 2000.
MailDateFormat() - Constructor for class javax.mail.internet.MailDateFormat

MailEvent - Class in javax.mail.event
Common base class for mail events, defining the dispatch method.
MailEvent(Object) - Constructor for class javax.mail.event.MailEvent

makeRegistrySpecificRequest(String) - Method in interface javax.xml.registry.RegistryService
Takes a String that is an XML request in a registry-specific format, sends the request to the registry, and returns a String that is the registry-specific XML response.
ManagedConnection - Interface in javax.resource.spi
ManagedConnection instance represents a physical connection to the underlying EIS.
ManagedConnectionFactory - Interface in javax.resource.spi
ManagedConnectionFactory instance is a factory of both ManagedConnection and EIS-specific connection factory instances.
ManagedConnectionMetaData - Interface in javax.resource.spi
The ManagedConnectionMetaData interface provides information about the underlying EIS instance associated with a ManagedConnection instance.
Management - Interface in javax.management.j2ee
The Management interface provides the APIs to navigate and manipulate managed objects.
ManagementHome - Interface in javax.management.j2ee
The required home interface for the J2EE Management EJB component (MEJB).
ManyToMany - Annotation Type in javax.persistence
Defines a many-valued association with many-to-many multiplicity.
ManyToOne - Annotation Type in javax.persistence
This annotation defines a single-valued association to another entity class that has many-to-one multiplicity.
MapELResolver - Class in javax.el
Defines property resolution behavior on instances of Map.
MapELResolver() - Constructor for class javax.el.MapELResolver
Creates a new read/write MapELResolver.
MapELResolver(boolean) - Constructor for class javax.el.MapELResolver
Creates a new MapELResolver whose read-only status is determined by the given parameter.
MapKey - Annotation Type in javax.persistence
Is used to specify the map key for associations of type Map.
MapMessage - Interface in javax.jms
A MapMessage object is used to send a set of name-value pairs.
MappedRecord - Interface in javax.resource.cci
The interface javax.resource.cci.MappedRecord is used for key-value map based representation of record elements.
MappedSuperclass - Annotation Type in javax.persistence
Designates a class whose mapping information is applied to the entities that inherit from it.
mark(int) - Method in class javax.mail.util.SharedFileInputStream
See the general contract of the mark method of InputStream.
markSupported() - Method in class javax.mail.util.SharedFileInputStream
Tests if this input stream supports the mark and reset methods.
marshal(String) - Method in class javax.xml.bind.annotation.adapters.CollapsedStringAdapter
No-op.
marshal(byte[]) - Method in class javax.xml.bind.annotation.adapters.HexBinaryAdapter

marshal(String) - Method in class javax.xml.bind.annotation.adapters.NormalizedStringAdapter
No-op.
marshal(BoundType) - Method in class javax.xml.bind.annotation.adapters.XmlAdapter
Convert a bound type to a value type.
marshal(ElementT, ValidationEventHandler) - Method in interface javax.xml.bind.annotation.DomHandler
This method is called when a JAXB provider needs to marshal an element to XML.
marshal(Element, ValidationEventHandler) - Method in class javax.xml.bind.annotation.W3CDomHandler

marshal(Object, XmlNode) - Method in class javax.xml.bind.Binder
Marshal a JAXB object tree to a new XML document.
marshal(Object, OutputStream) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

marshal(Object, Writer) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

marshal(Object, ContentHandler) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

marshal(Object, Node) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

marshal(Object, XMLEventWriter) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

marshal(Object, XMLStreamWriter) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

marshal(Object, Result) - Method in interface javax.xml.bind.Marshaller
Marshal the content tree rooted at jaxbElement into the specified javax.xml.transform.Result.
marshal(Object, OutputStream) - Method in interface javax.xml.bind.Marshaller
Marshal the content tree rooted at jaxbElement into an output stream.
marshal(Object, Writer) - Method in interface javax.xml.bind.Marshaller
Marshal the content tree rooted at jaxbElement into a Writer.
marshal(Object, ContentHandler) - Method in interface javax.xml.bind.Marshaller
Marshal the content tree rooted at jaxbElement into SAX2 events.
marshal(Object, Node) - Method in interface javax.xml.bind.Marshaller
Marshal the content tree rooted at jaxbElement into a DOM tree.
marshal(Object, XMLStreamWriter) - Method in interface javax.xml.bind.Marshaller
Marshal the content tree rooted at jaxbElement into a XMLStreamWriter.
marshal(Object, XMLEventWriter) - Method in interface javax.xml.bind.Marshaller
Marshal the content tree rooted at jaxbElement into a XMLEventWriter.
MarshalException - Exception in javax.xml.bind
This exception indicates that an error has occurred while performing a marshal operation that the provider is unable to recover from.
MarshalException(String) - Constructor for exception javax.xml.bind.MarshalException
Construct a MarshalException with the specified detail message.
MarshalException(String, String) - Constructor for exception javax.xml.bind.MarshalException
Construct a MarshalException with the specified detail message and vendor specific errorCode.
MarshalException(Throwable) - Constructor for exception javax.xml.bind.MarshalException
Construct a MarshalException with a linkedException.
MarshalException(String, Throwable) - Constructor for exception javax.xml.bind.MarshalException
Construct a MarshalException with the specified detail message and linkedException.
MarshalException(String, String, Throwable) - Constructor for exception javax.xml.bind.MarshalException
Construct a MarshalException with the specified detail message, vendor specific errorCode, and linkedException.
Marshaller - Interface in javax.xml.bind
The Marshaller class is responsible for governing the process of serializing Java content trees back into XML data.
Marshaller.Listener - Class in javax.xml.bind

Register an instance of an implementation of this class with a Marshaller to externally listen for marshal events.
Marshaller.Listener() - Constructor for class javax.xml.bind.Marshaller.Listener

match(MimeType) - Method in class javax.activation.MimeType
Determine if the primary and sub type of this object is the same as what is in the given type.
match(String) - Method in class javax.activation.MimeType
Determine if the primary and sub type of this object is the same as the content type described in rawdata.
match(ContentType) - Method in class javax.mail.internet.ContentType
Match with the specified ContentType object.
match(String) - Method in class javax.mail.internet.ContentType
Match with the specified content-type string.
match(SearchTerm) - Method in class javax.mail.Message
Apply the specified Search criterion to this message.
match(Address) - Method in class javax.mail.search.AddressStringTerm
Check whether the address pattern specified in the constructor is a substring of the string representation of the given Address object.
match(Address) - Method in class javax.mail.search.AddressTerm
Match against the argument Address.
match(Message) - Method in class javax.mail.search.AndTerm
The AND operation.
match(Message) - Method in class javax.mail.search.BodyTerm
The match method.
match(Date) - Method in class javax.mail.search.DateTerm
The date comparison method.
match(Message) - Method in class javax.mail.search.FlagTerm
The comparison method.
match(Message) - Method in class javax.mail.search.FromStringTerm
Check whether the address string specified in the constructor is a substring of the From address of this Message.
match(Message) - Method in class javax.mail.search.FromTerm
The address comparator.
match(Message) - Method in class javax.mail.search.HeaderTerm
The header match method.
match(int) - Method in class javax.mail.search.IntegerComparisonTerm

match(Message) - Method in class javax.mail.search.MessageIDTerm
The match method.
match(Message) - Method in class javax.mail.search.MessageNumberTerm
The match method.
match(Message) - Method in class javax.mail.search.NotTerm

match(Message) - Method in class javax.mail.search.OrTerm
The OR operation.
match(Message) - Method in class javax.mail.search.ReceivedDateTerm
The match method.
match(Message) - Method in class javax.mail.search.RecipientStringTerm
Check whether the address specified in the constructor is a substring of the recipient address of this Message.
match(Message) - Method in class javax.mail.search.RecipientTerm
The match method.
match(Message) - Method in class javax.mail.search.SearchTerm
This method applies a specific match criterion to the given message and returns the result.
match(Message) - Method in class javax.mail.search.SentDateTerm
The match method.
match(Message) - Method in class javax.mail.search.SizeTerm
The match method.
match(String) - Method in class javax.mail.search.StringTerm

match(Message) - Method in class javax.mail.search.SubjectTerm
The match method.
matchManagedConnections(Set, Subject, ConnectionRequestInfo) - Method in interface javax.resource.spi.ManagedConnectionFactory
Returns a matched connection from the candidate set of connections.
MAXBQUALSIZE - Static variable in interface javax.transaction.xa.Xid
Maximum number of bytes returned by getBqual.
MAXGTRIDSIZE - Static variable in interface javax.transaction.xa.Xid
Maximum number of bytes returned by getGtrid.
MAXIMUM_MESSAGE_ID - Static variable in class javax.faces.validator.DoubleRangeValidator
The message identifier of the FacesMessage to be created if the maximum value check fails.
MAXIMUM_MESSAGE_ID - Static variable in class javax.faces.validator.LengthValidator
The message identifier of the FacesMessage to be created if the maximum length check fails.
MAXIMUM_MESSAGE_ID - Static variable in class javax.faces.validator.LongRangeValidator
The message identifier of the FacesMessage to be created if the maximum value check fails.
merge(T) - Method in interface javax.persistence.EntityManager
Merge the state of the given entity into the current persistence context.
Message - Interface in javax.jms
The Message interface is the root interface of all JMS messages.
message - Variable in class javax.mail.event.StoreEvent
The message text to be presented to the user.
Message - Class in javax.mail
This class models an email message.
Message() - Constructor for class javax.mail.Message
No-arg version of the constructor.
Message(Folder, int) - Constructor for class javax.mail.Message
Constructor that takes a Folder and a message number.
Message(Session) - Constructor for class javax.mail.Message
Constructor that takes a Session.
Message.RecipientType - Class in javax.mail
This inner class defines the types of recipients allowed by the Message class.
Message.RecipientType(String) - Constructor for class javax.mail.Message.RecipientType
Constructor for use by subclasses.
MESSAGE_DELIVERED - Static variable in class javax.mail.event.TransportEvent
Message has been successfully delivered to all recipients by the transport firing this event. validSent[] contains all the addresses this transport sent to successfully. validUnsent[] and invalid[] should be null,
MESSAGE_NOT_DELIVERED - Static variable in class javax.mail.event.TransportEvent
Message was not sent for some reason. validSent[] should be null.
MESSAGE_OUTBOUND_PROPERTY - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: message direction, true for outbound messages, false for inbound.
MESSAGE_PARTIALLY_DELIVERED - Static variable in class javax.mail.event.TransportEvent
Message was successfully sent to some recipients but not to all.
MessageAware - Interface in javax.mail
An interface optionally implemented by DataSources to supply information to a DataContentHandler about the message context in which the data content object is operating.
messageChanged(MessageChangedEvent) - Method in interface javax.mail.event.MessageChangedListener
Invoked when a message is changed.
MessageChangedEvent - Class in javax.mail.event
This class models Message change events.
MessageChangedEvent(Object, int, Message) - Constructor for class javax.mail.event.MessageChangedEvent
Constructor.
MessageChangedListener - Interface in javax.mail.event
This is the Listener interface for MessageChanged events
MessageConsumer - Interface in javax.jms
A client uses a MessageConsumer object to receive messages from a destination.
MessageContext - Class in javax.mail
The context in which a piece of Message content is contained.
MessageContext(Part) - Constructor for class javax.mail.MessageContext
Create a MessageContext object describing the context of the given Part.
MessageContext - Interface in javax.xml.rpc.handler
The interface MessageContext abstracts the message context that is processed by a handler in the handle method.
MessageContext - Interface in javax.xml.ws.handler
The interface MessageContext abstracts the message context that is processed by a handler in the handle method.
MessageContext.Scope - Enum in javax.xml.ws.handler
Property scope.
MessageCountAdapter - Class in javax.mail.event
The adapter which receives MessageCount events.
MessageCountAdapter() - Constructor for class javax.mail.event.MessageCountAdapter

MessageCountEvent - Class in javax.mail.event
This class notifies changes in the number of messages in a folder.
MessageCountEvent(Folder, int, boolean, Message[]) - Constructor for class javax.mail.event.MessageCountEvent
Constructor.
MessageCountListener - Interface in javax.mail.event
This is the Listener interface for MessageCount events.
messageDelivered(TransportEvent) - Method in class javax.mail.event.TransportAdapter

messageDelivered(TransportEvent) - Method in interface javax.mail.event.TransportListener
Invoked when a Message is succesfully delivered.
MessageDriven - Annotation Type in javax.ejb
Component-defining annotation for a message driven bean.
MessageDrivenBean - Interface in javax.ejb
The MessageDrivenBean interface is implemented by every message-driven enterprise Bean class.
MessageDrivenBeanStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a message driven bean.
MessageDrivenContext - Interface in javax.ejb
The MessageDrivenContext interface provides access to the runtime message-driven context that the container provides for a message-driven enterprise Bean instance.
MessageEndpoint - Interface in javax.resource.spi.endpoint
This defines a contract for a message endpoint.
MessageEndpointFactory - Interface in javax.resource.spi.endpoint
This serves as a factory for creating message endpoints.
MessageEOFException - Exception in javax.jms
This exception must be thrown when an unexpected end of stream has been reached when a StreamMessage or BytesMessage is being read.
MessageEOFException(String, String) - Constructor for exception javax.jms.MessageEOFException
Constructs a MessageEOFException with the specified reason and error code.
MessageEOFException(String) - Constructor for exception javax.jms.MessageEOFException
Constructs a MessageEOFException with the specified reason.
MessageFactory - Class in javax.xml.soap
A factory for creating SOAPMessage objects.
MessageFactory() - Constructor for class javax.xml.soap.MessageFactory

MessageFormatException - Exception in javax.jms
This exception must be thrown when a JMS client attempts to use a data type not supported by a message or attempts to read data in a message as the wrong type.
MessageFormatException(String, String) - Constructor for exception javax.jms.MessageFormatException
Constructs a MessageFormatException with the specified reason and error code.
MessageFormatException(String) - Constructor for exception javax.jms.MessageFormatException
Constructs a MessageFormatException with the specified reason.
MessageIDTerm - Class in javax.mail.search
This term models the RFC822 "MessageId" - a message-id for Internet messages that is supposed to be unique per message.
MessageIDTerm(String) - Constructor for class javax.mail.search.MessageIDTerm
Constructor.
MessageListener - Interface in javax.jms
A MessageListener object is used to receive asynchronously delivered messages.
MessageListener - Interface in javax.resource.cci
This serves as a request-response message listener type that message endpoints (message-driven beans) may implement.
messageNotDelivered(TransportEvent) - Method in class javax.mail.event.TransportAdapter

messageNotDelivered(TransportEvent) - Method in interface javax.mail.event.TransportListener
Invoked when a Message is not delivered.
MessageNotReadableException - Exception in javax.jms
This exception must be thrown when a JMS client attempts to read a write-only message.
MessageNotReadableException(String, String) - Constructor for exception javax.jms.MessageNotReadableException
Constructs a MessageNotReadableException with the specified reason and error code.
MessageNotReadableException(String) - Constructor for exception javax.jms.MessageNotReadableException
Constructs a MessageNotReadableException with the specified reason.
MessageNotWriteableException - Exception in javax.jms
This exception must be thrown when a JMS client attempts to write to a read-only message.
MessageNotWriteableException(String, String) - Constructor for exception javax.jms.MessageNotWriteableException
Constructs a MessageNotWriteableException with the specified reason and error code.
MessageNotWriteableException(String) - Constructor for exception javax.jms.MessageNotWriteableException
Constructs a MessageNotWriteableException with the specified reason.
MessageNumberTerm - Class in javax.mail.search
This class implements comparisons for Message numbers.
MessageNumberTerm(int) - Constructor for class javax.mail.search.MessageNumberTerm
Constructor.
messagePartiallyDelivered(TransportEvent) - Method in class javax.mail.event.TransportAdapter

messagePartiallyDelivered(TransportEvent) - Method in interface javax.mail.event.TransportListener
Invoked when a Message is partially delivered.
MessageProducer - Interface in javax.jms
A client uses a MessageProducer object to send messages to a destination.
MessageRemovedException - Exception in javax.mail
The exception thrown when an invalid method is invoked on an expunged Message.
MessageRemovedException() - Constructor for exception javax.mail.MessageRemovedException
Constructs a MessageRemovedException with no detail message.
MessageRemovedException(String) - Constructor for exception javax.mail.MessageRemovedException
Constructs a MessageRemovedException with the specified detail message.
messagesAdded(MessageCountEvent) - Method in class javax.mail.event.MessageCountAdapter

messagesAdded(MessageCountEvent) - Method in interface javax.mail.event.MessageCountListener
Invoked when messages are added into a folder.
messagesRemoved(MessageCountEvent) - Method in class javax.mail.event.MessageCountAdapter

messagesRemoved(MessageCountEvent) - Method in interface javax.mail.event.MessageCountListener
Invoked when messages are removed (expunged) from a folder.
MessagingException - Exception in javax.mail
The base class for all exceptions thrown by the Messaging classes
MessagingException() - Constructor for exception javax.mail.MessagingException
Constructs a MessagingException with no detail message.
MessagingException(String) - Constructor for exception javax.mail.MessagingException
Constructs a MessagingException with the specified detail message.
MessagingException(String, Exception) - Constructor for exception javax.mail.MessagingException
Constructs a MessagingException with the specified Exception and detail message.
MethodBinding - Class in javax.faces.el
Deprecated. This has been replaced by MethodExpression.
MethodBinding() - Constructor for class javax.faces.el.MethodBinding
Deprecated.
MethodExpression - Class in javax.el
An Expression that refers to a method on an object.
MethodExpression() - Constructor for class javax.el.MethodExpression

MethodExpressionActionListener - Class in javax.faces.event
MethodExpressionActionListener is an ActionListener that wraps a MethodExpression.
MethodExpressionActionListener() - Constructor for class javax.faces.event.MethodExpressionActionListener

MethodExpressionActionListener(MethodExpression) - Constructor for class javax.faces.event.MethodExpressionActionListener
Construct a ValueChangeListener that contains a MethodExpression.
MethodExpressionValidator - Class in javax.faces.validator
MethodExpressionValidator is a Validator that wraps a MethodExpression, and it performs validation by executing a method on an object identified by the MethodExpression.
MethodExpressionValidator() - Constructor for class javax.faces.validator.MethodExpressionValidator

MethodExpressionValidator(MethodExpression) - Constructor for class javax.faces.validator.MethodExpressionValidator
Construct a Validator that contains a MethodExpression.
MethodExpressionValueChangeListener - Class in javax.faces.event
MethodExpressionValueChangeListener is a ValueChangeListener that wraps a MethodExpression.
MethodExpressionValueChangeListener() - Constructor for class javax.faces.event.MethodExpressionValueChangeListener

MethodExpressionValueChangeListener(MethodExpression) - Constructor for class javax.faces.event.MethodExpressionValueChangeListener
Construct a ValueChangeListener that contains a MethodExpression.
MethodInfo - Class in javax.el
Holds information about a method that a MethodExpression evaluated to.
MethodInfo(String, Class<?>, Class<?>[]) - Constructor for class javax.el.MethodInfo
Creates a new instance of MethodInfo with the given information.
MethodNotFoundException - Exception in javax.el
Thrown when a method could not be found while evaluating a MethodExpression.
MethodNotFoundException() - Constructor for exception javax.el.MethodNotFoundException
Creates a MethodNotFoundException with no detail message.
MethodNotFoundException(String) - Constructor for exception javax.el.MethodNotFoundException
Creates a MethodNotFoundException with the provided detail message.
MethodNotFoundException(Throwable) - Constructor for exception javax.el.MethodNotFoundException
Creates a MethodNotFoundException with the given root cause.
MethodNotFoundException(String, Throwable) - Constructor for exception javax.el.MethodNotFoundException
Creates a MethodNotFoundException with the given detail message and root cause.
MethodNotFoundException - Exception in javax.faces.el
Deprecated. This has been replaced by MethodNotFoundException.
MethodNotFoundException() - Constructor for exception javax.faces.el.MethodNotFoundException
Deprecated. Construct a new exception with no detail message or root cause.
MethodNotFoundException(String) - Constructor for exception javax.faces.el.MethodNotFoundException
Deprecated. Construct a new exception with the specified detail message and no root cause.
MethodNotFoundException(Throwable) - Constructor for exception javax.faces.el.MethodNotFoundException
Deprecated. Construct a new exception with the specified root cause.
MethodNotFoundException(String, Throwable) - Constructor for exception javax.faces.el.MethodNotFoundException
Deprecated. Construct a new exception with the specified detail message and root cause.
MethodNotSupportedException - Exception in javax.mail
The exception thrown when a method is not supported by the implementation
MethodNotSupportedException() - Constructor for exception javax.mail.MethodNotSupportedException
Constructs a MethodNotSupportedException with no detail message.
MethodNotSupportedException(String) - Constructor for exception javax.mail.MethodNotSupportedException
Constructs a MethodNotSupportedException with the specified detail message.
MIME - Static variable in class javax.mail.internet.HeaderTokenizer
MIME specials
MimeBodyPart - Class in javax.mail.internet
This class represents a MIME body part.
MimeBodyPart() - Constructor for class javax.mail.internet.MimeBodyPart
An empty MimeBodyPart object is created.
MimeBodyPart(InputStream) - Constructor for class javax.mail.internet.MimeBodyPart
Constructs a MimeBodyPart by reading and parsing the data from the specified input stream.
MimeBodyPart(InternetHeaders, byte[]) - Constructor for class javax.mail.internet.MimeBodyPart
Constructs a MimeBodyPart using the given header and content bytes.
mimeCharset(String) - Static method in class javax.mail.internet.MimeUtility
Convert a java charset into its MIME charset name.
MimeHeader - Class in javax.xml.soap
An object that stores a MIME header name and its value.
MimeHeader(String, String) - Constructor for class javax.xml.soap.MimeHeader
Constructs a MimeHeader object initialized with the given name and value.
MimeHeaders - Class in javax.xml.soap
A container for MimeHeader objects, which represent the MIME headers present in a MIME part of a message.
MimeHeaders() - Constructor for class javax.xml.soap.MimeHeaders
Constructs a default MimeHeaders object initialized with an empty Vector object.
MimeMessage - Class in javax.mail.internet
This class represents a MIME style email message.
MimeMessage(Session) - Constructor for class javax.mail.internet.MimeMessage
Default constructor.
MimeMessage(Session, InputStream) - Constructor for class javax.mail.internet.MimeMessage
Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.
MimeMessage(MimeMessage) - Constructor for class javax.mail.internet.MimeMessage
Constructs a new MimeMessage with content initialized from the source MimeMessage.
MimeMessage(Folder, int) - Constructor for class javax.mail.internet.MimeMessage
Constructs an empty MimeMessage object with the given Folder and message number.
MimeMessage(Folder, InputStream, int) - Constructor for class javax.mail.internet.MimeMessage
Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.
MimeMessage(Folder, InternetHeaders, byte[], int) - Constructor for class javax.mail.internet.MimeMessage
Constructs a MimeMessage from the given InternetHeaders object and content.
MimeMessage.RecipientType - Class in javax.mail.internet
This inner class extends the javax.mail.Message.RecipientType class to add additional RecipientTypes.
MimeMessage.RecipientType(String) - Constructor for class javax.mail.internet.MimeMessage.RecipientType

MimeMultipart - Class in javax.mail.internet
The MimeMultipart class is an implementation of the abstract Multipart class that uses MIME conventions for the multipart data.
MimeMultipart() - Constructor for class javax.mail.internet.MimeMultipart
Default constructor.
MimeMultipart(String) - Constructor for class javax.mail.internet.MimeMultipart
Construct a MimeMultipart object of the given subtype.
MimeMultipart(DataSource) - Constructor for class javax.mail.internet.MimeMultipart
Constructs a MimeMultipart object and its bodyparts from the given DataSource.
MimePart - Interface in javax.mail.internet
The MimePart interface models an Entity as defined by MIME (RFC2045, Section 2.4).
MimePartDataSource - Class in javax.mail.internet
A utility class that implements a DataSource out of a MimePart.
MimePartDataSource(MimePart) - Constructor for class javax.mail.internet.MimePartDataSource
Constructor, that constructs a DataSource from a MimePart.
MimeType - Class in javax.activation
A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
MimeType() - Constructor for class javax.activation.MimeType
Default constructor.
MimeType(String) - Constructor for class javax.activation.MimeType
Constructor that builds a MimeType from a String.
MimeType(String, String) - Constructor for class javax.activation.MimeType
Constructor that builds a MimeType with the given primary and sub type but has an empty parameter list.
MimeTypeParameterList - Class in javax.activation
A parameter list of a MimeType as defined in RFC 2045 and 2046.
MimeTypeParameterList() - Constructor for class javax.activation.MimeTypeParameterList
Default constructor.
MimeTypeParameterList(String) - Constructor for class javax.activation.MimeTypeParameterList
Constructs a new MimeTypeParameterList with the passed in data.
MimeTypeParseException - Exception in javax.activation
A class to encapsulate MimeType parsing related exceptions.
MimeTypeParseException() - Constructor for exception javax.activation.MimeTypeParseException
Constructs a MimeTypeParseException with no specified detail message.
MimeTypeParseException(String) - Constructor for exception javax.activation.MimeTypeParseException
Constructs a MimeTypeParseException with the specified detail message.
MimetypesFileTypeMap - Class in javax.activation
This class extends FileTypeMap and provides data typing of files via their file extension.
MimetypesFileTypeMap() - Constructor for class javax.activation.MimetypesFileTypeMap
The default constructor.
MimetypesFileTypeMap(String) - Constructor for class javax.activation.MimetypesFileTypeMap
Construct a MimetypesFileTypeMap with programmatic entries added from the named file.
MimetypesFileTypeMap(InputStream) - Constructor for class javax.activation.MimetypesFileTypeMap
Construct a MimetypesFileTypeMap with programmatic entries added from the InputStream.
MimeUtility - Class in javax.mail.internet
This is a utility class that provides various MIME related functionality.
MINIMUM_MESSAGE_ID - Static variable in class javax.faces.validator.DoubleRangeValidator
The message identifier of the FacesMessage to be created if the minimum value check fails.
MINIMUM_MESSAGE_ID - Static variable in class javax.faces.validator.LengthValidator
The message identifier of the FacesMessage to be created if the minimum length check fails.
MINIMUM_MESSAGE_ID - Static variable in class javax.faces.validator.LongRangeValidator
The message identifier of the FacesMessage to be created if the minimum value check fails.
mode - Variable in class javax.mail.Folder
The open mode of this folder.
modified - Variable in class javax.mail.internet.MimeMessage
A flag indicating whether the message has been modified.
ModuleType - Class in javax.enterprise.deploy.shared
Class ModuleTypes defines enumeration values for the J2EE module types.
ModuleType(int) - Constructor for class javax.enterprise.deploy.shared.ModuleType
Construct a new enumeration value with the given integer value.
msg - Variable in class javax.mail.event.MessageChangedEvent
The message that changed.
msg - Variable in class javax.mail.event.TransportEvent

msgnum - Variable in class javax.mail.Message
The number of this message within its folder, or zero if the message was not retrieved from a folder.
msgs - Variable in class javax.mail.event.MessageCountEvent
The messages.
Multipart - Class in javax.mail
Multipart is a container that holds multiple body parts.
Multipart() - Constructor for class javax.mail.Multipart
Default constructor.
MultipartDataSource - Interface in javax.mail
MultipartDataSource is a DataSource that contains body parts.

N

name - Variable in class javax.mail.Header
The name of the header.
name - Variable in class javax.mail.Quota.Resource
The name of the resource.
name - Variable in class javax.xml.bind.JAXBElement
xml element tag name
Name - Interface in javax.xml.soap
A representation of an XML name.
NamedNativeQueries - Annotation Type in javax.persistence
Is used to specify an array of native SQL named queries.
NamedNativeQuery - Annotation Type in javax.persistence
Is used to specify a native SQL named query.
NamedQueries - Annotation Type in javax.persistence
Specifies an array of named Java Persistence query language queries.
NamedQuery - Annotation Type in javax.persistence
Is used to specify a named query in the Java Persistence query language, which is a static query expressed in metadata.
Namespace - Interface in javax.xml.stream.events
An interface that contains information about a namespace.
NAMESPACE - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates the event is a namespace declaration
NamespaceConstants - Class in javax.xml.rpc
Constants used in JAX-RPC for namespace prefixes and URIs
NamespaceConstants() - Constructor for class javax.xml.rpc.NamespaceConstants

NamingContainer - Interface in javax.faces.component
NamingContainer is an interface that must be implemented by any UIComponent that wants to be a naming container.
NavigationHandler - Class in javax.faces.application
A NavigationHandler is passed the outcome string returned by an application action invoked for this application, and will use this (along with related state information) to choose the view to be displayed next.
NavigationHandler() - Constructor for class javax.faces.application.NavigationHandler

NE - Static variable in class javax.mail.search.ComparisonTerm

NESTED - Static variable in class javax.servlet.jsp.tagext.VariableInfo
Scope information that scripting variable is visible only within the start/end tags.
nested - Variable in exception javax.xml.stream.XMLStreamException

newFolder - Variable in class javax.mail.event.FolderEvent
The folder that represents the new name, in case of a RENAMED event.
newInstance() - Static method in class javax.el.ExpressionFactory
Creates a new instance of a ExpressionFactory.
newInstance(Properties) - Static method in class javax.el.ExpressionFactory
Create a new instance of a ExpressionFactory, with optional properties.
newInstance(String) - Static method in class javax.xml.bind.JAXBContext
Obtain a new instance of a JAXBContext class.
newInstance(String, ClassLoader) - Static method in class javax.xml.bind.JAXBContext
Obtain a new instance of a JAXBContext class.
newInstance(String, ClassLoader, Map<String, ?>) - Static method in class javax.xml.bind.JAXBContext
Obtain a new instance of a JAXBContext class.
newInstance(Class...) - Static method in class javax.xml.bind.JAXBContext
Obtain a new instance of a JAXBContext class.
newInstance(Class[], Map<String, ?>) - Static method in class javax.xml.bind.JAXBContext
Obtain a new instance of a JAXBContext class.
newInstance() - Static method in class javax.xml.registry.ConnectionFactory
Creates a default ConnectionFactory object.
newInstance() - Static method in class javax.xml.rpc.ServiceFactory
Gets an instance of the ServiceFactory Only one copy of a factory exists and is returned to the application each time this method is called.
newInstance() - Static method in class javax.xml.soap.MessageFactory
Creates a new MessageFactory object that is an instance of the default implementation (SOAP 1.1), This method uses the following ordered lookup procedure to determine the MessageFactory implementation class to load: Use the javax.xml.soap.MessageFactory system property.
newInstance(String) - Static method in class javax.xml.soap.MessageFactory
Creates a new MessageFactory object that is an instance of the specified implementation.
newInstance() - Static method in class javax.xml.soap.SOAPConnectionFactory
Creates an instance of the default SOAPConnectionFactory object.
newInstance() - Static method in class javax.xml.soap.SOAPElementFactory
Deprecated. Creates a new instance of SOAPElementFactory.
newInstance() - Static method in class javax.xml.soap.SOAPFactory
Creates a new SOAPFactory object that is an instance of the default implementation (SOAP 1.1), This method uses the following ordered lookup procedure to determine the SOAPFactory implementation class to load: Use the javax.xml.soap.SOAPFactory system property.
newInstance(String) - Static method in class javax.xml.soap.SOAPFactory
Creates a new SOAPFactory object that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.
newInstance() - Method in interface javax.xml.stream.util.XMLEventAllocator
This method creates an instance of the XMLEventAllocator.
newInstance() - Static method in class javax.xml.stream.XMLEventFactory
Create a new instance of the factory
newInstance(String, ClassLoader) - Static method in class javax.xml.stream.XMLEventFactory
Create a new instance of the factory
newInstance() - Static method in class javax.xml.stream.XMLInputFactory
Create a new instance of the factory.
newInstance(String, ClassLoader) - Static method in class javax.xml.stream.XMLInputFactory
Create a new instance of the factory
newInstance() - Static method in class javax.xml.stream.XMLOutputFactory
Create a new instance of the factory.
newInstance(String, ClassLoader) - Static method in class javax.xml.stream.XMLOutputFactory
Create a new instance of the factory
newLine() - Method in class javax.servlet.jsp.JspWriter
Write a line separator.
newMessageFactory(String) - Method in class javax.xml.soap.SAAJMetaFactory
Creates a MessageFactory object for the given String protocol.
NewsAddress - Class in javax.mail.internet
This class models an RFC1036 newsgroup address.
NewsAddress() - Constructor for class javax.mail.internet.NewsAddress
Default constructor.
NewsAddress(String) - Constructor for class javax.mail.internet.NewsAddress
Construct a NewsAddress with the given newsgroup.
NewsAddress(String, String) - Constructor for class javax.mail.internet.NewsAddress
Construct a NewsAddress with the given newsgroup and host.
newsgroup - Variable in class javax.mail.internet.NewsAddress

NEWSGROUPS - Static variable in class javax.mail.internet.MimeMessage.RecipientType
The "Newsgroup" (Usenet news) recipients.
newSOAPFactory(String) - Method in class javax.xml.soap.SAAJMetaFactory
Creates a SOAPFactory object for the given String protocol.
newStream(long, long) - Method in interface javax.mail.internet.SharedInputStream
Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive).
newStream(long, long) - Method in class javax.mail.util.SharedByteArrayInputStream
Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive).
newStream(long, long) - Method in class javax.mail.util.SharedFileInputStream
Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive) up to end (exclusive).
next() - Method in class javax.mail.internet.HeaderTokenizer
Parses the next token from this String.
next() - Method in class javax.xml.stream.util.EventReaderDelegate

next() - Method in class javax.xml.stream.util.StreamReaderDelegate

next() - Method in interface javax.xml.stream.XMLStreamReader
Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks.
nextEvent() - Method in class javax.xml.stream.util.EventReaderDelegate

nextEvent() - Method in interface javax.xml.stream.XMLEventReader
Get the next XMLEvent
nextTag() - Method in class javax.xml.stream.util.EventReaderDelegate

nextTag() - Method in class javax.xml.stream.util.StreamReaderDelegate

nextTag() - Method in interface javax.xml.stream.XMLEventReader
Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached.
nextTag() - Method in interface javax.xml.stream.XMLStreamReader
Skips any white space (isWhiteSpace() returns true), COMMENT, or PROCESSING_INSTRUCTION, until a START_ELEMENT or END_ELEMENT is reached.
nil - Variable in class javax.xml.bind.JAXBElement
true iff the xml element instance has xsi:nil="true".
NO_BUFFER - Static variable in class javax.servlet.jsp.JspWriter
Constant indicating that the Writer is not buffering output.
Node - Interface in javax.xml.soap
A representation of a node (element) in an XML document.
NON_PERSISTENT - Static variable in interface javax.jms.DeliveryMode
This is the lowest-overhead delivery mode because it does not require that the message be logged to stable storage.
NonUniqueResultException - Exception in javax.persistence
Thrown by the persistence provider when getSingleResult() is executed on a query and there is more than one result from the query.
NonUniqueResultException() - Constructor for exception javax.persistence.NonUniqueResultException
Constructs a new NonUniqueResultException exception with null as its detail message.
NonUniqueResultException(String) - Constructor for exception javax.persistence.NonUniqueResultException
Constructs a new NonUniqueResultException exception with the specified detail message.
NoResultException - Exception in javax.persistence
Thrown by the persistence provider when getSingleResult() is executed on a query and there is no result to return.
NoResultException() - Constructor for exception javax.persistence.NoResultException
Constructs a new NoResultException exception with null as its detail message.
NoResultException(String) - Constructor for exception javax.persistence.NoResultException
Constructs a new NoResultException exception with the specified detail message.
NormalizedStringAdapter - Class in javax.xml.bind.annotation.adapters
XmlAdapter to handle xs:normalizedString.
NormalizedStringAdapter() - Constructor for class javax.xml.bind.annotation.adapters.NormalizedStringAdapter

normalizeMimeType(String) - Method in class javax.activation.ActivationDataFlavor
Deprecated.
normalizeMimeTypeParameter(String, String) - Method in class javax.activation.ActivationDataFlavor
Deprecated.
NoSuchEJBException - Exception in javax.ejb
A NoSuchEJBException is thrown if an attempt is made to invoke a method on an object that no longer exists.
NoSuchEJBException() - Constructor for exception javax.ejb.NoSuchEJBException
Constructs a NoSuchEJBException with no detail message.
NoSuchEJBException(String) - Constructor for exception javax.ejb.NoSuchEJBException
Constructs a NoSuchEJBException with the specified detail message.
NoSuchEJBException(String, Exception) - Constructor for exception javax.ejb.NoSuchEJBException
Constructs a NoSuchEJBException with the specified detail message and a nested exception.
NoSuchEntityException - Exception in javax.ejb
The NoSuchEntityException exception is thrown by an Entity Bean instance to its container to report that the invoked business method or callback method could not be completed because of the underlying entity was removed from the database.
NoSuchEntityException() - Constructor for exception javax.ejb.NoSuchEntityException
Constructs a NoSuchEntityException with no detail message.
NoSuchEntityException(String) - Constructor for exception javax.ejb.NoSuchEntityException
Constructs a NoSuchEntityException with the specified detailed message.
NoSuchEntityException(Exception) - Constructor for exception javax.ejb.NoSuchEntityException
Constructs a NoSuchEntityException that embeds the originally thrown exception.
NoSuchObjectLocalException - Exception in javax.ejb
A NoSuchObjectLocalException is thrown if an attempt is made to invoke a method on an object that no longer exists.
NoSuchObjectLocalException() - Constructor for exception javax.ejb.NoSuchObjectLocalException
Constructs a NoSuchObjectLocalException with no detail message.
NoSuchObjectLocalException(String) - Constructor for exception javax.ejb.NoSuchObjectLocalException
Constructs a NoSuchObjectLocalException with the specified detail message.
NoSuchObjectLocalException(String, Exception) - Constructor for exception javax.ejb.NoSuchObjectLocalException
Constructs a NoSuchObjectLocalException with the specified detail message and a nested exception.
NoSuchProviderException - Exception in javax.mail
This exception is thrown when Session attempts to instantiate a Provider that doesn't exist.
NoSuchProviderException() - Constructor for exception javax.mail.NoSuchProviderException
Constructor.
NoSuchProviderException(String) - Constructor for exception javax.mail.NoSuchProviderException
Constructor.
NOT_IN_RANGE_MESSAGE_ID - Static variable in class javax.faces.validator.DoubleRangeValidator
The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set.
NOT_IN_RANGE_MESSAGE_ID - Static variable in class javax.faces.validator.LongRangeValidator
The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set.
NOT_IN_RANGE_MESSAGE_ID - Static variable in interface javax.faces.validator.Validator
Deprecated. Use DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID or LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID instead.
NOTATION_DECLARATION - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates a Notation
NotationDeclaration - Interface in javax.xml.stream.events
An interface for handling Notation Declarations Receive notification of a notation declaration event.
NOTICE - Static variable in class javax.mail.event.StoreEvent
Indicates that this message is a NOTICE.
NotIdentifiableEvent - Interface in javax.xml.bind
This event indicates that a problem was encountered resolving an ID/IDREF.
NotIdentifiableEventImpl - Class in javax.xml.bind.helpers
Default implementation of the NotIdentifiableEvent interface.
NotIdentifiableEventImpl(int, String, ValidationEventLocator) - Constructor for class javax.xml.bind.helpers.NotIdentifiableEventImpl
Create a new NotIdentifiableEventImpl.
NotIdentifiableEventImpl(int, String, ValidationEventLocator, Throwable) - Constructor for class javax.xml.bind.helpers.NotIdentifiableEventImpl
Create a new NotIdentifiableEventImpl.
notification(StoreEvent) - Method in interface javax.mail.event.StoreListener
Invoked when the Store generates a notification event.
notifyConnectionListeners(int) - Method in class javax.mail.Folder
Notify all ConnectionListeners.
notifyConnectionListeners(int) - Method in class javax.mail.Service
Notify all ConnectionListeners.
notifyDDChange(XpathEvent) - Method in interface javax.enterprise.deploy.spi.DConfigBean
A notification that the DDBean provided in the event has changed and this bean or its child beans need to reevaluate themselves.
notifyFolderListeners(int) - Method in class javax.mail.Folder
Notify all FolderListeners registered on this Folder and this folder's Store.
notifyFolderListeners(int, Folder) - Method in class javax.mail.Store
Notify all FolderListeners.
notifyFolderRenamedListeners(Folder) - Method in class javax.mail.Folder
Notify all FolderListeners registered on this Folder and this folder's Store about the renaming of this folder.
notifyFolderRenamedListeners(Folder, Folder) - Method in class javax.mail.Store
Notify all FolderListeners about the renaming of a folder.
notifyMessageAddedListeners(Message[]) - Method in class javax.mail.Folder
Notify all MessageCountListeners about the addition of messages into this folder.
notifyMessageChangedListeners(int, Message) - Method in class javax.mail.Folder
Notify all MessageChangedListeners.
notifyMessageRemovedListeners(boolean, Message[]) - Method in class javax.mail.Folder
Notify all MessageCountListeners about the removal of messages from this Folder.
notifyStoreListeners(int, String) - Method in class javax.mail.Store
Notify all StoreListeners.
notifyTransportListeners(int, Address[], Address[], Address[], Message) - Method in class javax.mail.Transport
Notify all TransportListeners.
NotSupportedException - Exception in javax.resource
A NotSupportedException is thrown to indicate that callee (resource adapter or application server for system contracts) cannot execute an operation because the operation is not a supported feature.
NotSupportedException() - Constructor for exception javax.resource.NotSupportedException
Constructs a new instance with null as its detail message.
NotSupportedException(String) - Constructor for exception javax.resource.NotSupportedException
Constructs a new instance with the specified detail message.
NotSupportedException(Throwable) - Constructor for exception javax.resource.NotSupportedException
Constructs a new throwable with the specified cause.
NotSupportedException(String, Throwable) - Constructor for exception javax.resource.NotSupportedException
Constructs a new throwable with the specified detail message and cause.
NotSupportedException(String, String) - Constructor for exception javax.resource.NotSupportedException
Constructs a new throwable with the specified detail message and error code.
NotSupportedException - Exception in javax.transaction
NotSupportedException exception indicates that the request cannot be executed because the operation is not a supported feature.
NotSupportedException() - Constructor for exception javax.transaction.NotSupportedException

NotSupportedException(String) - Constructor for exception javax.transaction.NotSupportedException

NotTerm - Class in javax.mail.search
This class implements the logical NEGATION operator.
NotTerm(SearchTerm) - Constructor for class javax.mail.search.NotTerm

NSPREFIX_SCHEMA_XSD - Static variable in class javax.xml.rpc.NamespaceConstants
Namespace prefix for XML schema XSD
NSPREFIX_SCHEMA_XSI - Static variable in class javax.xml.rpc.NamespaceConstants
Namespace prefix for XML Schema XSI
NSPREFIX_SOAP_ENCODING - Static variable in class javax.xml.rpc.NamespaceConstants
Namespace prefix for SOAP Encoding
NSPREFIX_SOAP_ENVELOPE - Static variable in class javax.xml.rpc.NamespaceConstants
Namespace prefix for SOAP Envelope
NSURI_SCHEMA_XSD - Static variable in class javax.xml.rpc.NamespaceConstants
Namespace URI for XML Schema XSD
NSURI_SCHEMA_XSI - Static variable in class javax.xml.rpc.NamespaceConstants
Namespace URI for XML Schema XSI
NSURI_SOAP_ENCODING - Static variable in class javax.xml.rpc.NamespaceConstants
Nameapace URI for SOAP 1.1 Encoding
NSURI_SOAP_ENVELOPE - Static variable in class javax.xml.rpc.NamespaceConstants
Nameapace URI for SOAP 1.1 Envelope
NSURI_SOAP_NEXT_ACTOR - Static variable in class javax.xml.rpc.NamespaceConstants
Nameapace URI for SOAP 1.1 next actor role
number - Variable in class javax.mail.search.IntegerComparisonTerm
The number.
NUMBER_ID - Static variable in class javax.faces.convert.NumberConverter
The message identifier of the FacesMessage to be created if the conversion to Number fails.
NumberConverter - Class in javax.faces.convert
Converter implementation for java.lang.Number values.
NumberConverter() - Constructor for class javax.faces.convert.NumberConverter

O

ObjectHolder - Class in javax.xml.rpc.holders

ObjectHolder() - Constructor for class javax.xml.rpc.holders.ObjectHolder

ObjectHolder(Object) - Constructor for class javax.xml.rpc.holders.ObjectHolder

ObjectMessage - Interface in javax.jms
An ObjectMessage object is used to send a message that contains a serializable object in the Java programming language ("Java object").
ObjectNotFoundException - Exception in javax.ejb
The ObjectNotFoundException exception is thrown by a finder method to indicate that the specified EJB object does not exist.
ObjectNotFoundException() - Constructor for exception javax.ejb.ObjectNotFoundException
Constructs an ObjectNotFoundException with no detail message.
ObjectNotFoundException(String) - Constructor for exception javax.ejb.ObjectNotFoundException
Constructs an ObjectNotFoundException with the specified detail message.
OneToMany - Annotation Type in javax.persistence
Defines a many-valued association with one-to-many multiplicity.
OneToOne - Annotation Type in javax.persistence
This annotation defines a single-valued association to another entity that has one-to-one multiplicity.
Oneway - Annotation Type in javax.jws
Indicates that the given @WebMethod has only an input message and no output.
onException(JMSException) - Method in interface javax.jms.ExceptionListener
Notifies user of a JMS exception.
onMessage(Message) - Method in interface javax.jms.MessageListener
Passes a message to the listener.
onMessage(Record) - Method in interface javax.resource.cci.MessageListener
This method allows an EIS to call a message endpoint using a request-response style communication.
open(int) - Method in class javax.mail.Folder
Open this Folder.
opened(ConnectionEvent) - Method in class javax.mail.event.ConnectionAdapter

OPENED - Static variable in class javax.mail.event.ConnectionEvent
A connection was opened.
opened(ConnectionEvent) - Method in interface javax.mail.event.ConnectionListener
Invoked when a Store/Folder/Transport is opened.
OPERATION_STYLE_PROPERTY - Static variable in interface javax.xml.rpc.Call
Standard property for operation style.
OperationUnsupportedException - Exception in javax.enterprise.deploy.spi.exceptions
This exception is to report that the method called is not supported by this implementation.
OperationUnsupportedException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
Creates an new OperationUnsupportedException object.
OPERATOR_SLOT - Static variable in interface javax.xml.registry.infomodel.Slot
Name for pre-defined Slot used in Organization and ClassificationScheme by JAXR UDDI provider.
OptimisticLockException - Exception in javax.persistence
Thrown by the persistence provider when an optimistic locking conflict occurs.
OptimisticLockException() - Constructor for exception javax.persistence.OptimisticLockException
Constructs a new OptimisticLockException exception with null as its detail message.
OptimisticLockException(String) - Constructor for exception javax.persistence.OptimisticLockException
Constructs a new OptimisticLockException exception with the specified detail message.
OptimisticLockException(String, Throwable) - Constructor for exception javax.persistence.OptimisticLockException
Constructs a new OptimisticLockException exception with the specified detail message and cause.
OptimisticLockException(Throwable) - Constructor for exception javax.persistence.OptimisticLockException
Constructs a new OptimisticLockException exception with the specified cause.
OptimisticLockException(Object) - Constructor for exception javax.persistence.OptimisticLockException
Constructs a new OptimisticLockException exception with the specified entity.
OptimisticLockException(String, Throwable, Object) - Constructor for exception javax.persistence.OptimisticLockException
Constructs a new OptimisticLockException exception with the specified detail message, cause, and entity.
OR_ALL_KEYS - Static variable in interface javax.xml.registry.FindQualifier

OR_LIKE_KEYS - Static variable in interface javax.xml.registry.FindQualifier

OrderBy - Annotation Type in javax.persistence
This annotation specifies the ordering of the elements of a collection valued association at the point when the association is retrieved.
Organization - Interface in javax.xml.registry.infomodel
Organization instances provide information on organizations such as a Submitting Organization.
ORGANIZATION - Static variable in interface javax.xml.registry.LifeCycleManager

OrTerm - Class in javax.mail.search
This class implements the logical OR operator on individual SearchTerms.
OrTerm(SearchTerm, SearchTerm) - Constructor for class javax.mail.search.OrTerm
Constructor that takes two operands.
OrTerm(SearchTerm[]) - Constructor for class javax.mail.search.OrTerm
Constructor that takes an array of SearchTerms.
othersDeletesAreVisible(int) - Method in interface javax.resource.cci.ResultSetInfo
Indicates whether deletes made by others are visible.
othersInsertsAreVisible(int) - Method in interface javax.resource.cci.ResultSetInfo
Indicates whether inserts made by others are visible.
othersUpdatesAreVisible(int) - Method in interface javax.resource.cci.ResultSetInfo
Indicates whether updates made by others are visible.
OUT - Static variable in class javax.servlet.jsp.PageContext
Name used to store current JspWriter in PageContext name table.
OUT - Static variable in class javax.xml.rpc.ParameterMode
OUT mode for parameter passing
OUTBOUND_MESSAGE_ATTACHMENTS - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler.
ownDeletesAreVisible(int) - Method in interface javax.resource.cci.ResultSetInfo

ownInsertsAreVisible(int) - Method in interface javax.resource.cci.ResultSetInfo

ownUpdatesAreVisible(int) - Method in interface javax.resource.cci.ResultSetInfo

P

PAGE - Static variable in class javax.servlet.jsp.PageContext
Name used to store the Servlet in this PageContext's nametables.
PAGE_SCOPE - Static variable in class javax.servlet.jsp.PageContext
Page scope: (this is the default) the named reference remains available in this PageContext until the return from the current Servlet.service() invocation.
pageContext - Variable in class javax.faces.webapp.UIComponentClassicTagBase
The JSP PageContext for the page we are embedded in.
PageContext - Class in javax.servlet.jsp
PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment.
PageContext() - Constructor for class javax.servlet.jsp.PageContext
Sole constructor.
PAGECONTEXT - Static variable in class javax.servlet.jsp.PageContext
Name used to store this PageContext in it's own name table.
pageContext - Variable in class javax.servlet.jsp.tagext.TagSupport
The PageContext.
PageData - Class in javax.servlet.jsp.tagext
Translation-time information on a JSP page.
PageData() - Constructor for class javax.servlet.jsp.tagext.PageData
Sole constructor.
ParameterList - Class in javax.mail.internet
This class holds MIME parameters (attribute-value pairs).
ParameterList() - Constructor for class javax.mail.internet.ParameterList
No-arg Constructor.
ParameterList(String) - Constructor for class javax.mail.internet.ParameterList
Constructor that takes a parameter-list string.
ParameterMode - Class in javax.xml.rpc
The javax.xml.rpc.ParameterMode is a type-safe enumeration for parameter mode.
parent - Variable in class javax.mail.BodyPart
The Multipart object containing this BodyPart, if known.
parent - Variable in class javax.mail.Multipart
The Part containing this Multipart, if known.
parse(String) - Method in class javax.activation.MimeTypeParameterList
A routine for parsing the parameter list out of a String.
parse(String) - Static method in class javax.mail.internet.InternetAddress
Parse the given comma separated sequence of addresses into InternetAddress objects.
parse(String, boolean) - Static method in class javax.mail.internet.InternetAddress
Parse the given sequence of addresses into InternetAddress objects.
parse(String, ParsePosition) - Method in class javax.mail.internet.MailDateFormat
Parses the given date in the format specified by draft-ietf-drums-msg-fmt-08 in the current TimeZone.
parse(InputStream) - Method in class javax.mail.internet.MimeMessage
Parse the InputStream setting the headers and content fields appropriately.
parse() - Method in class javax.mail.internet.MimeMultipart
Parse the InputStream from our DataSource, constructing the appropriate MimeBodyParts.
parse(String) - Static method in class javax.mail.internet.NewsAddress
Parse the given comma separated sequence of newsgroup into NewsAddress objects.
parseAnySimpleType(String) - Static method in class javax.xml.bind.DatatypeConverter
Return a string containing the lexical representation of the simple type.
parseAnySimpleType(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Return a string containing the lexical representation of the simple type.
parseBase64Binary(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into an array of bytes.
parseBase64Binary(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into an array of bytes.
parseBoolean(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a boolean value.
parseBoolean(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a boolean value.
parseByte(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a byte value.
parseByte(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a byte value.
ParseConversionEvent - Interface in javax.xml.bind
This event indicates that a problem was encountered while converting a string from the XML data into a value of the target Java data type.
ParseConversionEventImpl - Class in javax.xml.bind.helpers
Default implementation of the ParseConversionEvent interface.
ParseConversionEventImpl(int, String, ValidationEventLocator) - Constructor for class javax.xml.bind.helpers.ParseConversionEventImpl
Create a new ParseConversionEventImpl.
ParseConversionEventImpl(int, String, ValidationEventLocator, Throwable) - Constructor for class javax.xml.bind.helpers.ParseConversionEventImpl
Create a new ParseConversionEventImpl.
parsed - Variable in class javax.mail.internet.MimeMultipart
Have we parsed the data from our InputStream yet?
parseDate(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a Calendar value.
parseDate(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a Calendar value.
parseDateTime(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a Calendar value.
parseDateTime(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a Calendar value.
parseDecimal(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a BigDecimal value.
parseDecimal(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a BigDecimal value.
parseDouble(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a double value.
parseDouble(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a double value.
ParseException - Exception in javax.mail.internet
The exception thrown due to an error in parsing RFC822 or MIME headers
ParseException() - Constructor for exception javax.mail.internet.ParseException
Constructs a ParseException with no detail message.
ParseException(String) - Constructor for exception javax.mail.internet.ParseException
Constructs a ParseException with the specified detail message.
parseExpression(String, Class, FunctionMapper) - Method in class javax.servlet.jsp.el.ExpressionEvaluator
Deprecated. Prepare an expression for later evaluation.
parseFloat(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a float value.
parseFloat(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a float value.
parseHeader(String, boolean) - Static method in class javax.mail.internet.InternetAddress
Parse the given sequence of addresses into InternetAddress objects.
parseHexBinary(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into an array of bytes.
parseHexBinary(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into an array of bytes.
parseInt(String) - Static method in class javax.xml.bind.DatatypeConverter
Convert the string argument into an int value.
parseInt(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Convert the string argument into an int value.
parseInteger(String) - Static method in class javax.xml.bind.DatatypeConverter
Convert the string argument into a BigInteger value.
parseInteger(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Convert the string argument into a BigInteger value.
parseLong(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a long value.
parseLong(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a long value.
parsePostData(int, ServletInputStream) - Static method in class javax.servlet.http.HttpUtils
Deprecated. Parses data from an HTML form that the client sends to the server using the HTTP POST method and the application/x-www-form-urlencoded MIME type.
parseQName(String, NamespaceContext) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a byte value.
parseQName(String, NamespaceContext) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a QName value.
parseQueryString(String) - Static method in class javax.servlet.http.HttpUtils
Deprecated. Parses a query string passed from the client to the server and builds a HashTable object with key-value pairs.
parseShort(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a short value.
parseShort(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a short value.
parseString(String) - Method in class javax.mail.URLName
Method which does all of the work of parsing the string.
parseString(String) - Static method in class javax.xml.bind.DatatypeConverter
Convert the lexical XSD string argument into a String value.
parseString(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Convert the string argument into a string.
parseTime(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a Calendar value.
parseTime(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a Calendar value.
parseUnsignedInt(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a long value.
parseUnsignedInt(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a long value.
parseUnsignedShort(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into an int value.
parseUnsignedShort(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into an int value.
part - Variable in class javax.mail.internet.MimePartDataSource
The MimePart that provides the data for this DataSource.
Part - Interface in javax.mail
The Part interface is the common base interface for Messages and BodyParts.
parts - Variable in class javax.mail.Multipart
Vector of BodyPart objects.
PASSWORD_PROPERTY - Static variable in interface javax.xml.rpc.Call
Standard property: Password for authentication Type: java.lang.String
PASSWORD_PROPERTY - Static variable in interface javax.xml.rpc.Stub
Standard property: Password for authentication.
PASSWORD_PROPERTY - Static variable in interface javax.xml.ws.BindingProvider
Standard property: Password for authentication.
PasswordAuthentication - Class in javax.mail
The class PasswordAuthentication is a data holder that is used by Authenticator.
PasswordAuthentication(String, String) - Constructor for class javax.mail.PasswordAuthentication
Initialize a new PasswordAuthentication
PasswordCredential - Class in javax.resource.spi.security
The class PasswordCredential acts as a holder for username and password.
PasswordCredential(String, char[]) - Constructor for class javax.resource.spi.security.PasswordCredential
Creates a new PasswordCredential object from the given user name and password.
PATH_INFO - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: Request Path Info Type: String
pattern - Variable in class javax.mail.search.StringTerm
The pattern.
PATTERN_ID - Static variable in class javax.faces.convert.NumberConverter
The message identifier of the FacesMessage to be created if the conversion to Number fails.
peek() - Method in class javax.mail.internet.HeaderTokenizer
Peek at the next token, without actually removing the token from the parse stream.
peek() - Method in class javax.xml.stream.util.EventReaderDelegate

peek() - Method in interface javax.xml.stream.XMLEventReader
Check the next XMLEvent without reading it from the stream.
PERCENT_ID - Static variable in class javax.faces.convert.NumberConverter
The message identifier of the FacesMessage to be created if the conversion to Number fails.
PermitAll - Annotation Type in javax.annotation.security
Specifies that all security roles are allowed to invoke the specified method(s) i.e that the specified method(s) are "unchecked".
persist(Object) - Method in interface javax.persistence.EntityManager
Make an entity instance managed and persistent.
Persistence - Class in javax.persistence
Bootstrap class that is used to obtain an EntityManagerFactory.
Persistence() - Constructor for class javax.persistence.Persistence

PERSISTENCE_PROVIDER - Static variable in class javax.persistence.Persistence

PersistenceContext - Annotation Type in javax.persistence
Expresses a dependency on an EntityManager persistence context.
PersistenceContexts - Annotation Type in javax.persistence
Declares one or more PersistenceContext annotations.
PersistenceContextType - Enum in javax.persistence
Specifies whether a transaction-scoped or extended persistence context is to be used in PersistenceContext.
PersistenceException - Exception in javax.persistence
Thrown by the persistence provider when a problem occurs.
PersistenceException() - Constructor for exception javax.persistence.PersistenceException
Constructs a new PersistenceException exception with null as its detail message.
PersistenceException(String) - Constructor for exception javax.persistence.PersistenceException
Constructs a new PersistenceException exception with the specified detail message.
PersistenceException(String, Throwable) - Constructor for exception javax.persistence.PersistenceException
Constructs a new PersistenceException exception with the specified detail message and cause.
PersistenceException(Throwable) - Constructor for exception javax.persistence.PersistenceException
Constructs a new PersistenceException exception with the specified cause.
PersistenceProperty - Annotation Type in javax.persistence
Describes a single container or persistence provider property.
PersistenceProvider - Interface in javax.persistence.spi
Interface implemented by a persistence provider.
PersistenceUnit - Annotation Type in javax.persistence
Expresses a dependency on an EntityManagerFactory.
PersistenceUnitInfo - Interface in javax.persistence.spi
Interface implemented by the container and used by the persistence provider when creating an EntityManagerFactory.
PersistenceUnits - Annotation Type in javax.persistence
Declares one or more PersistenceUnit annotations.
PersistenceUnitTransactionType - Enum in javax.persistence.spi
This enum class defines whether the entity managers created by the EntityManagerFactory will be JTA or resource-local entity managers.
PERSISTENT - Static variable in interface javax.jms.DeliveryMode
This delivery mode instructs the JMS provider to log the message to stable storage as part of the client's send operation.
PERSON_NAME - Static variable in interface javax.xml.registry.LifeCycleManager

personal - Variable in class javax.mail.internet.InternetAddress
The personal name.
PersonName - Interface in javax.xml.registry.infomodel
Represents a person's name.
PhaseEvent - Class in javax.faces.event
PhaseEvent represents the beginning or ending of processing for a particular phase of the request processing lifecycle, for the request encapsulated by the specified FacesContext.
PhaseEvent(FacesContext, PhaseId, Lifecycle) - Constructor for class javax.faces.event.PhaseEvent
Construct a new event object from the specified parameters.
PhaseId - Class in javax.faces.event
Typesafe enumeration of the legal values that may be returned by the getPhaseId() method of the FacesEvent interface.
PhaseListener - Interface in javax.faces.event
An interface implemented by objects that wish to be notified at the beginning and ending of processing for each standard phase of the request processing lifecycle.
PolicyConfiguration - Interface in javax.security.jacc
The methods of this interface are used by containers to create policy statements in a Policy provider.
PolicyConfigurationFactory - Class in javax.security.jacc
Abstract factory and finder class for obtaining the instance of the class that implements the PolicyConfigurationFactory of a provider.
PolicyConfigurationFactory() - Constructor for class javax.security.jacc.PolicyConfigurationFactory

PolicyContext - Class in javax.security.jacc
This utility class is used by containers to communicate policy context identifiers and other policy relevant context to Policy providers.
PolicyContextException - Exception in javax.security.jacc
This checked exception is thrown by implementations of the javax.security.jacc.PolicyConfiguration Interface, the javax.security.jacc.PolicyConfigurationFactory abstract class, the javax.security.jacc.PolicyContext utility class, and implementations of the javax.security.jacc.PolicyContextException Interface.
PolicyContextException() - Constructor for exception javax.security.jacc.PolicyContextException
Constructs a new PolicyContextException with null as its detail message.
PolicyContextException(String) - Constructor for exception javax.security.jacc.PolicyContextException
Constructs a new PolicyContextException with the specified detail message
PolicyContextException(String, Throwable) - Constructor for exception javax.security.jacc.PolicyContextException
Constructs a new PolicyContextException with the specified detail message and cause.
PolicyContextException(Throwable) - Constructor for exception javax.security.jacc.PolicyContextException
Constructs a new PolicyContextException with the specified cause.
PolicyContextHandler - Interface in javax.security.jacc
This interface defines the methods that must be implemented by handlers that are to be registered and activated by the PolicyContext class.
popBody() - Method in class javax.servlet.jsp.JspContext
Return the previous JspWriter "out" saved by the matching pushBody(), and update the value of the "out" attribute in the page scope attribute namespace of the JspContext.
PortInfo - Interface in javax.xml.ws.handler
The PortInfo interface is used by a HandlerResolver to query information about the port it is being asked to create a handler chain for.
pos - Variable in exception javax.mail.internet.AddressException
The index in the string where the error occurred, or -1 if not known.
PostActivate - Annotation Type in javax.ejb
Designates a method to receive a callback after a stateful session bean has been activated.
POSTAL_ADDRESS - Static variable in interface javax.xml.registry.LifeCycleManager

PostalAddress - Interface in javax.xml.registry.infomodel
PostalAddress is a simple re-usable entity class that defines attributes of a postal Address.
PostConstruct - Annotation Type in javax.annotation
The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization.
PostLoad - Annotation Type in javax.persistence
Is used to specify callback methods for the corresponding lifecycle event.
PostPersist - Annotation Type in javax.persistence
Is used to specify callback methods for the corresponding lifecycle event.
PostRemove - Annotation Type in javax.persistence
Is used to specify callback methods for the corresponding lifecycle event.
PostUpdate - Annotation Type in javax.persistence
Is used to specify callback methods for the corresponding lifecycle event.
PreDestroy - Annotation Type in javax.annotation
The PreDestroy annotation is used on methods as a callback notification to signal that the instance is in the process of being removed by the container.
PreencodedMimeBodyPart - Class in javax.mail.internet
A MimeBodyPart that handles data that has already been encoded.
PreencodedMimeBodyPart(String) - Constructor for class javax.mail.internet.PreencodedMimeBodyPart
Create a PreencodedMimeBodyPart that assumes the data is encoded using the specified encoding.
prefix - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
The prefix assigned to this taglib from the taglib directive.
prepare(Xid) - Method in interface javax.resource.spi.XATerminator
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
prepare(Xid) - Method in interface javax.transaction.xa.XAResource
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
PrePassivate - Annotation Type in javax.ejb
Designates a method to receive a callback before a stateful session bean is passivated.
PrePersist - Annotation Type in javax.persistence
Is used to specify callback methods for the corresponding lifecycle event.
PreRemove - Annotation Type in javax.persistence
Is used to specify callback methods for the corresponding lifecycle event.
PreUpdate - Annotation Type in javax.persistence
Is used to specify callback methods for the corresponding lifecycle event.
PrimaryKeyJoinColumn - Annotation Type in javax.persistence
This annotation specifies a primary key column that is used as a foreign key to join to another table.
PrimaryKeyJoinColumns - Annotation Type in javax.persistence
This annotation groups PrimaryKeyJoinColumn annotations.
print(boolean) - Method in class javax.servlet.jsp.JspWriter
Print a boolean value.
print(char) - Method in class javax.servlet.jsp.JspWriter
Print a character.
print(int) - Method in class javax.servlet.jsp.JspWriter
Print an integer.
print(long) - Method in class javax.servlet.jsp.JspWriter
Print a long integer.
print(float) - Method in class javax.servlet.jsp.JspWriter
Print a floating-point number.
print(double) - Method in class javax.servlet.jsp.JspWriter
Print a double-precision floating-point number.
print(char[]) - Method in class javax.servlet.jsp.JspWriter
Print an array of characters.
print(String) - Method in class javax.servlet.jsp.JspWriter
Print a string.
print(Object) - Method in class javax.servlet.jsp.JspWriter
Print an object.
print(String) - Method in class javax.servlet.ServletOutputStream
Writes a String to the client, without a carriage return-line feed (CRLF) character at the end.
print(boolean) - Method in class javax.servlet.ServletOutputStream
Writes a boolean value to the client, with no carriage return-line feed (CRLF) character at the end.
print(char) - Method in class javax.servlet.ServletOutputStream
Writes a character to the client, with no carriage return-line feed (CRLF) at the end.
print(int) - Method in class javax.servlet.ServletOutputStream
Writes an int to the client, with no carriage return-line feed (CRLF) at the end.
print(long) - Method in class javax.servlet.ServletOutputStream
Writes a long value to the client, with no carriage return-line feed (CRLF) at the end.
print(float) - Method in class javax.servlet.ServletOutputStream
Writes a float value to the client, with no carriage return-line feed (CRLF) at the end.
print(double) - Method in class javax.servlet.ServletOutputStream
Writes a double value to the client, with no carriage return-line feed (CRLF) at the end.
printAnySimpleType(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts a string value into a string.
printAnySimpleType(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a string value into a string.
printBase64Binary(byte[]) - Static method in class javax.xml.bind.DatatypeConverter
Converts an array of bytes into a string.
printBase64Binary(byte[]) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts an array of bytes into a string.
printBoolean(boolean) - Static method in class javax.xml.bind.DatatypeConverter
Converts a boolean value into a string.
printBoolean(boolean) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a boolean value into a string.
printByte(byte) - Static method in class javax.xml.bind.DatatypeConverter
Converts a byte value into a string.
printByte(byte) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a byte value into a string.
PrintConversionEvent - Interface in javax.xml.bind
This event indicates that a problem was encountered while converting data from the Java content tree into its lexical representation.
PrintConversionEventImpl - Class in javax.xml.bind.helpers
Default implementation of the PrintConversionEvent interface.
PrintConversionEventImpl(int, String, ValidationEventLocator) - Constructor for class javax.xml.bind.helpers.PrintConversionEventImpl
Create a new PrintConversionEventImpl.
PrintConversionEventImpl(int, String, ValidationEventLocator, Throwable) - Constructor for class javax.xml.bind.helpers.PrintConversionEventImpl
Create a new PrintConversionEventImpl.
printDate(Calendar) - Static method in class javax.xml.bind.DatatypeConverter
Converts a Calendar value into a string.
printDate(Calendar) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a Calendar value into a string.
printDateTime(Calendar) - Static method in class javax.xml.bind.DatatypeConverter
Converts a Calendar value into a string.
printDateTime(Calendar) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a Calendar value into a string.
printDecimal(BigDecimal) - Static method in class javax.xml.bind.DatatypeConverter
Converts a BigDecimal value into a string.
printDecimal(BigDecimal) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a BigDecimal value into a string.
printDouble(double) - Static method in class javax.xml.bind.DatatypeConverter
Converts a double value into a string.
printDouble(double) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a double value into a string.
printFloat(float) - Static method in class javax.xml.bind.DatatypeConverter
Converts a float value into a string.
printFloat(float) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a float value into a string.
printHexBinary(byte[]) - Static method in class javax.xml.bind.DatatypeConverter
Converts an array of bytes into a string.
printHexBinary(byte[]) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts an array of bytes into a string.
printInt(int) - Static method in class javax.xml.bind.DatatypeConverter
Converts an int value into a string.
printInt(int) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts an int value into a string.
printInteger(BigInteger) - Static method in class javax.xml.bind.DatatypeConverter
Converts a BigInteger value into a string.
printInteger(BigInteger) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a BigInteger value into a string.
println() - Method in class javax.servlet.jsp.JspWriter
Terminate the current line by writing the line separator string.
println(boolean) - Method in class javax.servlet.jsp.JspWriter
Print a boolean value and then terminate the line.
println(char) - Method in class javax.servlet.jsp.JspWriter
Print a character and then terminate the line.
println(int) - Method in class javax.servlet.jsp.JspWriter
Print an integer and then terminate the line.
println(long) - Method in class javax.servlet.jsp.JspWriter
Print a long integer and then terminate the line.
println(float) - Method in class javax.servlet.jsp.JspWriter
Print a floating-point number and then terminate the line.
println(double) - Method in class javax.servlet.jsp.JspWriter
Print a double-precision floating-point number and then terminate the line.
println(char[]) - Method in class javax.servlet.jsp.JspWriter
Print an array of characters and then terminate the line.
println(String) - Method in class javax.servlet.jsp.JspWriter
Print a String and then terminate the line.
println(Object) - Method in class javax.servlet.jsp.JspWriter
Print an Object and then terminate the line.
println() - Method in class javax.servlet.ServletOutputStream
Writes a carriage return-line feed (CRLF) to the client.
println(String) - Method in class javax.servlet.ServletOutputStream
Writes a String to the client, followed by a carriage return-line feed (CRLF).
println(boolean) - Method in class javax.servlet.ServletOutputStream
Writes a boolean value to the client, followed by a carriage return-line feed (CRLF).
println(char) - Method in class javax.servlet.ServletOutputStream
Writes a character to the client, followed by a carriage return-line feed (CRLF).
println(int) - Method in class javax.servlet.ServletOutputStream
Writes an int to the client, followed by a carriage return-line feed (CRLF) character.
println(long) - Method in class javax.servlet.ServletOutputStream
Writes a long value to the client, followed by a carriage return-line feed (CRLF).
println(float) - Method in class javax.servlet.ServletOutputStream
Writes a float value to the client, followed by a carriage return-line feed (CRLF).
println(double) - Method in class javax.servlet.ServletOutputStream
Writes a double value to the client, followed by a carriage return-line feed (CRLF).
printLong(long) - Static method in class javax.xml.bind.DatatypeConverter
Converts A long value into a string.
printLong(long) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a long value into a string.
printQName(QName, NamespaceContext) - Static method in class javax.xml.bind.DatatypeConverter
Converts a QName instance into a string.
printQName(QName, NamespaceContext) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a QName instance into a string.
printShort(short) - Static method in class javax.xml.bind.DatatypeConverter
Converts a short value into a string.
printShort(short) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a short value into a string.
printStackTrace(PrintStream) - Method in exception javax.ejb.EJBException
Prints the composite message and the embedded stack trace to the specified stream ps.
printStackTrace() - Method in exception javax.ejb.EJBException
Prints the composite message to System.err.
printStackTrace(PrintWriter) - Method in exception javax.ejb.EJBException
Prints the composite message and the embedded stack trace to the specified print writer pw.
printStackTrace(PrintStream) - Method in exception javax.xml.bind.JAXBException
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.
printStackTrace() - Method in exception javax.xml.bind.JAXBException
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.
printStackTrace(PrintWriter) - Method in exception javax.xml.bind.JAXBException
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintWriter.
printStackTrace(PrintStream) - Method in exception javax.xml.bind.TypeConstraintException
Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.
printStackTrace() - Method in exception javax.xml.bind.TypeConstraintException
Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.
printString(String) - Static method in class javax.xml.bind.DatatypeConverter
Converts the string argument into a string.
printString(String) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts the string argument into a string.
printTime(Calendar) - Static method in class javax.xml.bind.DatatypeConverter
Converts a Calendar value into a string.
printTime(Calendar) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a Calendar value into a string.
printUnsignedInt(long) - Static method in class javax.xml.bind.DatatypeConverter
Converts a long value into a string.
printUnsignedInt(long) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts a long value into a string.
printUnsignedShort(int) - Static method in class javax.xml.bind.DatatypeConverter
Converts an int value into a string.
printUnsignedShort(int) - Method in interface javax.xml.bind.DatatypeConverterInterface
Converts an int value into a string.
proceed() - Method in interface javax.interceptor.InvocationContext
Proceed to the next entry in the interceptor chain.
PROCESS_VALIDATIONS - Static variable in class javax.faces.event.PhaseId
Identifier that indicates an interest in events queued for the Process Validations phase of the request processing lifecycle.
processAction(ActionEvent) - Method in interface javax.faces.event.ActionListener
Invoked when the action described by the specified ActionEvent occurs.
processAction(ActionEvent) - Method in class javax.faces.event.MethodExpressionActionListener

processApplication(FacesContext) - Method in class javax.faces.component.UIViewRoot
Broadcast any events that have been queued for the Invoke Application phase of the request processing lifecycle and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
processDecodes(FacesContext) - Method in class javax.faces.component.UIComponent
Perform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
processDecodes(FacesContext) - Method in class javax.faces.component.UIComponentBase

processDecodes(FacesContext) - Method in class javax.faces.component.UIData
Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext) processing to perform the following steps.
processDecodes(FacesContext) - Method in class javax.faces.component.UIForm
Override UIComponent.processDecodes(javax.faces.context.FacesContext) to ensure that the form is decoded before its children.
processDecodes(FacesContext) - Method in class javax.faces.component.UIInput
Specialized decode behavior on top of that provided by the superclass.
processDecodes(FacesContext) - Method in class javax.faces.component.UIViewRoot
Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext) behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
PROCESSING_INSTRUCTION - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is a processing instruction
ProcessingInstruction - Interface in javax.xml.stream.events
An interface that describes the data found in processing instructions
processListener(FacesListener) - Method in class javax.faces.event.ActionEvent

processListener(FacesListener) - Method in class javax.faces.event.FacesEvent
Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate.
processListener(FacesListener) - Method in class javax.faces.event.ValueChangeEvent

processRestoreState(FacesContext, Object) - Method in class javax.faces.component.UIComponent
Perform the component tree processing required by the Restore View phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
processRestoreState(FacesContext, Object) - Method in class javax.faces.component.UIComponentBase

processSaveState(FacesContext) - Method in class javax.faces.component.UIComponent
Perform the component tree processing required by the state saving portion of the Render Response phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
processSaveState(FacesContext) - Method in class javax.faces.component.UIComponentBase

processUpdates(FacesContext) - Method in class javax.faces.component.UIComponent
Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
processUpdates(FacesContext) - Method in class javax.faces.component.UIComponentBase

processUpdates(FacesContext) - Method in class javax.faces.component.UIData
Override the default UIComponentBase.processUpdates(javax.faces.context.FacesContext) processing to perform the following steps.
processUpdates(FacesContext) - Method in class javax.faces.component.UIForm
Override UIComponent.processUpdates(javax.faces.context.FacesContext) to ensure that the children of this UIForm instance are only processed if UIForm.isSubmitted() returns true.
processUpdates(FacesContext) - Method in class javax.faces.component.UIInput
In addition to the standard processUpdates behavior inherited from UIComponentBase, calls updateModel().
processUpdates(FacesContext) - Method in class javax.faces.component.UIViewRoot
Override the default UIComponentBase behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
processValidators(FacesContext) - Method in class javax.faces.component.UIComponent
Perform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
processValidators(FacesContext) - Method in class javax.faces.component.UIComponentBase

processValidators(FacesContext) - Method in class javax.faces.component.UIData
Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext) processing to perform the following steps.
processValidators(FacesContext) - Method in class javax.faces.component.UIForm
Override UIComponent.processValidators(javax.faces.context.FacesContext) to ensure that the children of this UIForm instance are only processed if UIForm.isSubmitted() returns true.
processValidators(FacesContext) - Method in class javax.faces.component.UIInput
In addition to the standard processValidators behavior inherited from UIComponentBase, calls validate() if the immediate property is false (which is the default); if the component is invalid afterwards, calls FacesContext.renderResponse().
processValidators(FacesContext) - Method in class javax.faces.component.UIViewRoot
Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext) behavior to broadcast any queued events after the default processing has been completed and to clear out any events for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete() to be called.
processValueChange(ValueChangeEvent) - Method in class javax.faces.event.MethodExpressionValueChangeListener

processValueChange(ValueChangeEvent) - Method in interface javax.faces.event.ValueChangeListener
Invoked when the value change described by the specified ValueChangeEvent occurs.
ProgressEvent - Class in javax.enterprise.deploy.spi.status
An event which indicates that a deployment status change has occurred.
ProgressEvent(Object, TargetModuleID, DeploymentStatus) - Constructor for class javax.enterprise.deploy.spi.status.ProgressEvent
Creates a new object representing a deployment progress event.
ProgressListener - Interface in javax.enterprise.deploy.spi.status
The listener interface for receiving deployment progress events.
ProgressObject - Interface in javax.enterprise.deploy.spi.status
The ProgressObject interface tracks and reports the progress of the deployment activities, distribute, start, stop, undeploy.
PropertyException - Exception in javax.xml.bind
This exception indicates that an error was encountered while getting or setting a property.
PropertyException(String) - Constructor for exception javax.xml.bind.PropertyException
Construct a PropertyException with the specified detail message.
PropertyException(String, String) - Constructor for exception javax.xml.bind.PropertyException
Construct a PropertyException with the specified detail message and vendor specific errorCode.
PropertyException(Throwable) - Constructor for exception javax.xml.bind.PropertyException
Construct a PropertyException with a linkedException.
PropertyException(String, Throwable) - Constructor for exception javax.xml.bind.PropertyException
Construct a PropertyException with the specified detail message and linkedException.
PropertyException(String, String, Throwable) - Constructor for exception javax.xml.bind.PropertyException
Construct a PropertyException with the specified detail message, vendor specific errorCode, and linkedException.
PropertyException(String, Object) - Constructor for exception javax.xml.bind.PropertyException
Construct a PropertyException whose message field is set based on the name of the property and value.toString().
propertyExists(String) - Method in interface javax.jms.Message
Indicates whether a property value exists.
PropertyNotFoundException - Exception in javax.el
Thrown when a property could not be found while evaluating a ValueExpression or MethodExpression.
PropertyNotFoundException() - Constructor for exception javax.el.PropertyNotFoundException
Creates a PropertyNotFoundException with no detail message.
PropertyNotFoundException(String) - Constructor for exception javax.el.PropertyNotFoundException
Creates a PropertyNotFoundException with the provided detail message.
PropertyNotFoundException(Throwable) - Constructor for exception javax.el.PropertyNotFoundException
Creates a PropertyNotFoundException with the given root cause.
PropertyNotFoundException(String, Throwable) - Constructor for exception javax.el.PropertyNotFoundException
Creates a PropertyNotFoundException with the given detail message and root cause.
PropertyNotFoundException - Exception in javax.faces.el
Deprecated. This has been replaced by PropertyNotFoundException.
PropertyNotFoundException() - Constructor for exception javax.faces.el.PropertyNotFoundException
Deprecated. Construct a new exception with no detail message or root cause.
PropertyNotFoundException(String) - Constructor for exception javax.faces.el.PropertyNotFoundException
Deprecated. Construct a new exception with the specified detail message and no root cause.
PropertyNotFoundException(Throwable) - Constructor for exception javax.faces.el.PropertyNotFoundException
Deprecated. Construct a new exception with the specified root cause.
PropertyNotFoundException(String, Throwable) - Constructor for exception javax.faces.el.PropertyNotFoundException
Deprecated. Construct a new exception with the specified detail message and root cause.
PropertyNotWritableException - Exception in javax.el
Thrown when a property could not be written to while setting the value on a ValueExpression.
PropertyNotWritableException() - Constructor for exception javax.el.PropertyNotWritableException
Creates a PropertyNotWritableException with no detail message.
PropertyNotWritableException(String) - Constructor for exception javax.el.PropertyNotWritableException
Creates a PropertyNotWritableException with the provided detail message.
PropertyNotWritableException(Throwable) - Constructor for exception javax.el.PropertyNotWritableException
Creates a PropertyNotWritableException with the given root cause.
PropertyNotWritableException(String, Throwable) - Constructor for exception javax.el.PropertyNotWritableException
Creates a PropertyNotWritableException with the given detail message and root cause.
PropertyResolver - Class in javax.faces.el
Deprecated. This has been replaced by ELResolver.
PropertyResolver() - Constructor for class javax.faces.el.PropertyResolver
Deprecated.
protocolConnect(String, int, String, String) - Method in class javax.mail.Service
The service implementation should override this method to perform the actual protocol-specific connection attempt.
ProtocolException - Exception in javax.xml.ws
The ProtocolException class is a base class for exceptions related to a specific protocol binding.
ProtocolException() - Constructor for exception javax.xml.ws.ProtocolException
Constructs a new protocol exception with null as its detail message.
ProtocolException(String) - Constructor for exception javax.xml.ws.ProtocolException
Constructs a new protocol exception with the specified detail message.
ProtocolException(String, Throwable) - Constructor for exception javax.xml.ws.ProtocolException
Constructs a new runtime exception with the specified detail message and cause.
ProtocolException(Throwable) - Constructor for exception javax.xml.ws.ProtocolException
Constructs a new runtime exception with the specified cause and a detail message of (cause==null ?
Provider - Class in javax.mail
The Provider is a class that describes a protocol implementation.
Provider(Provider.Type, String, String, String, String) - Constructor for class javax.mail.Provider
Create a new provider of the specified type for the specified protocol.
Provider<T> - Interface in javax.xml.ws
Service endpoints may implement the Provider interface as a dynamic alternative to an SEI.
Provider - Class in javax.xml.ws.spi
Service provider for ServiceDelegate and Endpoint objects.
Provider() - Constructor for class javax.xml.ws.spi.Provider
Creates a new instance of Provider
provider() - Static method in class javax.xml.ws.spi.Provider
Creates a new provider object.
Provider.Type - Class in javax.mail
This inner class defines the Provider type.
providers - Static variable in class javax.persistence.Persistence

publish(Message) - Method in interface javax.jms.TopicPublisher
Publishes a message to the topic.
publish(Message, int, int, long) - Method in interface javax.jms.TopicPublisher
Publishes a message to the topic, specifying delivery mode, priority, and time to live.
publish(Topic, Message) - Method in interface javax.jms.TopicPublisher
Publishes a message to a topic for an unidentified message producer.
publish(Topic, Message, int, int, long) - Method in interface javax.jms.TopicPublisher
Publishes a message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.
publish(String) - Method in class javax.xml.ws.Endpoint
Publishes this endpoint at the given address.
publish(String, Object) - Static method in class javax.xml.ws.Endpoint
Creates and publishes an endpoint for the specified implementor object at the given address.
publish(Object) - Method in class javax.xml.ws.Endpoint
Publishes this endpoint at the provided server context.
pushBody(Writer) - Method in class javax.servlet.jsp.JspContext
Return a new JspWriter object that sends output to the provided Writer.
pushBody() - Method in class javax.servlet.jsp.PageContext
Return a new BodyContent object, save the current "out" JspWriter, and update the value of the "out" attribute in the page scope attribute namespace of the PageContext.
putContext(Class, Object) - Method in class javax.el.ELContext
Associates a context object with this ELContext.
putResource(Object, Object) - Method in interface javax.transaction.TransactionSynchronizationRegistry
Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
putValue(String, Object) - Method in interface javax.servlet.http.HttpSession
Deprecated. As of Version 2.2, this method is replaced by HttpSession.setAttribute(java.lang.String, java.lang.Object)

Q

QNameHolder - Class in javax.xml.rpc.holders

QNameHolder() - Constructor for class javax.xml.rpc.holders.QNameHolder

QNameHolder(QName) - Constructor for class javax.xml.rpc.holders.QNameHolder

Query - Interface in javax.persistence
Interface used to control query execution.
Query - Interface in javax.xml.registry
The Query interface encapsulates a query in a declarative query language.
QUERY_STRING - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: Query string for request.
QUERY_TYPE_EBXML_FILTER_QUERY - Static variable in interface javax.xml.registry.Query
An OASIS ebXML Registry XML Filter Query type.
QUERY_TYPE_SQL - Static variable in interface javax.xml.registry.Query
An SQL query type.
QUERY_TYPE_XQUERY - Static variable in interface javax.xml.registry.Query
A W3C XQuery type.
QueryHint - Annotation Type in javax.persistence
An implementation-specific Query hint.
QueryManager - Interface in javax.xml.registry
This is the common base interface for all QueryManagers in the API.
queryNames(ObjectName, QueryExp) - Method in interface javax.management.j2ee.Management
Gets the names of managed objects controlled by the MEJB.
queue() - Method in class javax.faces.event.FacesEvent
Convenience method to queue this event for broadcast at the end of the current request processing lifecycle phase.
Queue - Interface in javax.jms
A Queue object encapsulates a provider-specific queue name.
QueueBrowser - Interface in javax.jms
A client uses a QueueBrowser object to look at messages on a queue without removing them.
QueueConnection - Interface in javax.jms
A QueueConnection object is an active connection to a point-to-point JMS provider.
QueueConnectionFactory - Interface in javax.jms
A client uses a QueueConnectionFactory object to create QueueConnection objects with a point-to-point JMS provider.
queueEvent(FacesEvent) - Method in class javax.faces.component.UICommand
Intercept queueEvent and, for ActionEvents, mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise.
queueEvent(FacesEvent) - Method in class javax.faces.component.UIComponent
Queue an event for broadcast at the end of the current request processing lifecycle phase.
queueEvent(FacesEvent) - Method in class javax.faces.component.UIComponentBase

queueEvent(FacesEvent) - Method in class javax.faces.component.UIData
Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent) processing to wrap any queued events in a wrapper so that we can reset the current row index in broadcast().
queueEvent(FacesEvent) - Method in class javax.faces.component.UIViewRoot
Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent) behavior to accumulate the queued events for later broadcasting.
queueEvent(MailEvent, Vector) - Method in class javax.mail.Service
Add the event and vector of listeners to the queue to be delivered.
QueueReceiver - Interface in javax.jms
A client uses a QueueReceiver object to receive messages that have been delivered to a queue.
QueueRequestor - Class in javax.jms
The QueueRequestor helper class simplifies making service requests.
QueueRequestor(QueueSession, Queue) - Constructor for class javax.jms.QueueRequestor
Constructor for the QueueRequestor class.
QueueSender - Interface in javax.jms
A client uses a QueueSender object to send messages to a queue.
QueueSession - Interface in javax.jms
A QueueSession object provides methods for creating QueueReceiver, QueueSender, QueueBrowser, and TemporaryQueue objects.
Quota - Class in javax.mail
This class represents a set of quotas for a given quota root.
Quota(String) - Constructor for class javax.mail.Quota
Create a Quota object for the named quotaroot with no associated resources.
Quota.Resource - Class in javax.mail
An individual resource in a quota root.
Quota.Resource(String, long, long) - Constructor for class javax.mail.Quota.Resource
Construct a Resource object with the given name, usage, and limit.
QuotaAwareStore - Interface in javax.mail
An interface implemented by Stores that support quotas.
quotaRoot - Variable in class javax.mail.Quota
The name of the quota root.
quote(String, String) - Static method in class javax.mail.internet.MimeUtility
A utility method to quote a word, if the word contains any characters from the specified 'specials' list.
QUOTEDSTRING - Static variable in class javax.mail.internet.HeaderTokenizer.Token
Token type indicating a quoted string.

R

RangeStatistic - Interface in javax.management.j2ee.statistics
Specifies standard measurements of the lowest and highest values an attribute has held as well as its current value.
RAR - Static variable in class javax.enterprise.deploy.shared.ModuleType
The module is an Connector archive.
read() - Method in class javax.mail.util.SharedFileInputStream
See the general contract of the read method of InputStream.
read(byte[], int, int) - Method in class javax.mail.util.SharedFileInputStream
Reads bytes from this stream into the specified byte array, starting at the given offset.
read(InputStream) - Method in interface javax.resource.cci.Streamable
Read data from an InputStream and initialize fields of a Streamable object.
READ_ONLY - Static variable in class javax.mail.Folder
The Folder is read only.
READ_WRITE - Static variable in class javax.mail.Folder
The state and contents of this folder can be modified.
readBoolean() - Method in interface javax.jms.BytesMessage
Reads a boolean from the bytes message stream.
readBoolean() - Method in interface javax.jms.StreamMessage
Reads a boolean from the stream message.
readByte() - Method in interface javax.jms.BytesMessage
Reads a signed 8-bit value from the bytes message stream.
readByte() - Method in interface javax.jms.StreamMessage
Reads a byte value from the stream message.
readBytes(byte[]) - Method in interface javax.jms.BytesMessage
Reads a byte array from the bytes message stream.
readBytes(byte[], int) - Method in interface javax.jms.BytesMessage
Reads a portion of the bytes message stream.
readBytes(byte[]) - Method in interface javax.jms.StreamMessage
Reads a byte array field from the stream message into the specified byte[] object (the read buffer).
readChar() - Method in interface javax.jms.BytesMessage
Reads a Unicode character value from the bytes message stream.
readChar() - Method in interface javax.jms.StreamMessage
Reads a Unicode character value from the stream message.
readDouble() - Method in interface javax.jms.BytesMessage
Reads a double from the bytes message stream.
readDouble() - Method in interface javax.jms.StreamMessage
Reads a double from the stream message.
readEJBHome(ObjectInputStream) - Method in interface javax.ejb.spi.HandleDelegate
Deserialize the EJBHome reference corresponding to a HomeHandle.
readEJBObject(ObjectInputStream) - Method in interface javax.ejb.spi.HandleDelegate
Deserialize the EJBObject reference corresponding to a Handle.
readExternal(ObjectInput) - Method in class javax.activation.MimeType
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
readFloat() - Method in interface javax.jms.BytesMessage
Reads a float from the bytes message stream.
readFloat() - Method in interface javax.jms.StreamMessage
Reads a float from the stream message.
readInt() - Method in interface javax.jms.BytesMessage
Reads a signed 32-bit integer from the bytes message stream.
readInt() - Method in interface javax.jms.StreamMessage
Reads a 32-bit integer from the stream message.
readLine(byte[], int, int) - Method in class javax.servlet.ServletInputStream
Reads the input stream, one line at a time.
readLong() - Method in interface javax.jms.BytesMessage
Reads a signed 64-bit integer from the bytes message stream.
readLong() - Method in interface javax.jms.StreamMessage
Reads a 64-bit integer from the stream message.
readObject() - Method in interface javax.jms.StreamMessage
Reads an object from the stream message.
ReadOnlyFolderException - Exception in javax.mail
This exception is thrown when an attempt is made to open a folder read-write access when the folder is marked read-only.
ReadOnlyFolderException(Folder) - Constructor for exception javax.mail.ReadOnlyFolderException
Constructs a MessagingException with the specified folder.
ReadOnlyFolderException(Folder, String) - Constructor for exception javax.mail.ReadOnlyFolderException
Constructs a MessagingException with the specified folder and the specified detail message.
readResolve() - Method in class javax.mail.internet.MimeMessage.RecipientType

readResolve() - Method in class javax.mail.Message.RecipientType
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class.
readShort() - Method in interface javax.jms.BytesMessage
Reads a signed 16-bit number from the bytes message stream.
readShort() - Method in interface javax.jms.StreamMessage
Reads a 16-bit integer from the stream message.
readString() - Method in interface javax.jms.StreamMessage
Reads a String from the stream message.
readUnsignedByte() - Method in interface javax.jms.BytesMessage
Reads an unsigned 8-bit number from the bytes message stream.
readUnsignedShort() - Method in interface javax.jms.BytesMessage
Reads an unsigned 16-bit number from the bytes message stream.
readUTF() - Method in interface javax.jms.BytesMessage
Reads a string that has been encoded using a modified UTF-8 format from the bytes message stream.
receive() - Method in interface javax.jms.MessageConsumer
Receives the next message produced for this message consumer.
receive(long) - Method in interface javax.jms.MessageConsumer
Receives the next message that arrives within the specified timeout interval.
ReceivedDateTerm - Class in javax.mail.search
This class implements comparisons for the Message Received date
ReceivedDateTerm(int, Date) - Constructor for class javax.mail.search.ReceivedDateTerm
Constructor.
receiveNoWait() - Method in interface javax.jms.MessageConsumer
Receives the next message if one is immediately available.
RECENT - Static variable in class javax.mail.Flags.Flag
This message is recent.
RecipientStringTerm - Class in javax.mail.search
This class implements string comparisons for the Recipient Address headers.
RecipientStringTerm(Message.RecipientType, String) - Constructor for class javax.mail.search.RecipientStringTerm
Constructor.
RecipientTerm - Class in javax.mail.search
This class implements comparisons for the Recipient Address headers.
RecipientTerm(Message.RecipientType, Address) - Constructor for class javax.mail.search.RecipientTerm
Constructor.
Record - Interface in javax.resource.cci
The javax.resource.cci.Record interface is the base interface for the representation of an input or output to the execute methods defined on an Interaction.
RecordFactory - Interface in javax.resource.cci
The RecordFactory interface is used for creating MappedRecord and IndexedRecord instances.
recover() - Method in interface javax.jms.Session
Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message.
recover(int) - Method in interface javax.resource.spi.XATerminator
Obtains a list of prepared transaction branches from a resource manager.
recover(int) - Method in interface javax.transaction.xa.XAResource
Obtains a list of prepared transaction branches from a resource manager.
recycleNode() - Method in interface javax.xml.soap.Node
Notifies the implementation that this Node object is no longer being used by the application and that the implementation is free to reuse this object for nodes that may be created later.
REDEPLOY - Static variable in class javax.enterprise.deploy.shared.CommandType
The DeploymentManger action operation being processed is redeploy.
redeploy(TargetModuleID[], File, File) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
(optional) The redeploy method provides a means for updating currently deployed J2EE applications.
redeploy(TargetModuleID[], InputStream, InputStream) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
(optional) The redeploy method provides a means for updating currently deployed J2EE applications.
redirect(String) - Method in class javax.faces.context.ExternalContext
Redirect a request to the specified URL, and cause the responseComplete() method to be called on the FacesContext instance for the current request.
ref - Variable in exception javax.mail.internet.AddressException
The string being parsed.
Referenceable - Interface in javax.resource
The Referenceable interface extends the javax.naming.Referenceable interface.
ReferenceSyntaxException - Exception in javax.faces.el
Deprecated. This has been replaced by ELException.
ReferenceSyntaxException() - Constructor for exception javax.faces.el.ReferenceSyntaxException
Deprecated. Construct a new exception with no detail message or root cause.
ReferenceSyntaxException(String) - Constructor for exception javax.faces.el.ReferenceSyntaxException
Deprecated. Construct a new exception with the specified detail message and no root cause.
ReferenceSyntaxException(Throwable) - Constructor for exception javax.faces.el.ReferenceSyntaxException
Deprecated. Construct a new exception with the specified root cause.
ReferenceSyntaxException(String, Throwable) - Constructor for exception javax.faces.el.ReferenceSyntaxException
Deprecated. Construct a new exception with the specified detail message and root cause.
refresh(Object) - Method in interface javax.persistence.EntityManager
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.
register(Class, QName, SerializerFactory, DeserializerFactory) - Method in interface javax.xml.rpc.encoding.TypeMapping
Registers SerializerFactory and DeserializerFactory for a specific type mapping between an XML type and Java type.
register(String, TypeMapping) - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Registers a TypeMapping instance with the TypeMappingRegistry.
registerDefault(TypeMapping) - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Registers the TypeMapping instance that is default for all encoding styles supported by the TypeMappingRegistry.
registerDeploymentFactory(DeploymentFactory) - Method in class javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
Registers a DeploymentFactory so it will be able to handle requests.
registerHandler(String, PolicyContextHandler, boolean) - Static method in class javax.security.jacc.PolicyContext
Authorization protected method used to register a container specific PolicyContext handler.
registerInterposedSynchronization(Synchronization) - Method in interface javax.transaction.TransactionSynchronizationRegistry
Register a Synchronization instance with special ordering semantics.
registerSynchronization(Synchronization) - Method in interface javax.transaction.Transaction
Register a synchronization object for the transaction currently associated with the target object.
REGISTRY_ENTRY - Static variable in interface javax.xml.registry.LifeCycleManager

REGISTRY_PACKAGE - Static variable in interface javax.xml.registry.LifeCycleManager

RegistryEntry - Interface in javax.xml.registry.infomodel
The RegistryEntry interface is a base interface for interfaces in the model that require additional metadata beyond what is provided by the RegistryObject interface.
RegistryException - Exception in javax.xml.registry
This is the common base class for all Exceptions that are detected on the registry provider side rather than the JAXR client side.
RegistryException() - Constructor for exception javax.xml.registry.RegistryException
Constructs a JAXRException object with no reason or embedded Throwable.
RegistryException(String) - Constructor for exception javax.xml.registry.RegistryException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
RegistryException(String, Throwable) - Constructor for exception javax.xml.registry.RegistryException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
RegistryException(Throwable) - Constructor for exception javax.xml.registry.RegistryException
Constructs a JAXRException object initialized with the given Throwable object.
RegistryObject - Interface in javax.xml.registry.infomodel
The RegistryObject class is an abstract base class used by most classes in the model.
RegistryPackage - Interface in javax.xml.registry.infomodel
RegistryPackage instances are RegistryEntries that group logically related RegistryEntries together.
RegistryService - Interface in javax.xml.registry
This is the principal interface implemented by a JAXR provider.
release() - Method in interface javax.enterprise.deploy.spi.DeploymentManager
The release method is the mechanism by which the tool signals to the DeploymentManager that the tool does not need it to continue running connected to the platform.
release() - Method in class javax.faces.context.FacesContext
Release any resources associated with this FacesContext instance.
release() - Method in class javax.faces.webapp.AttributeTag
Deprecated. Release references to any acquired resources.
release() - Method in class javax.faces.webapp.ConverterTag
Deprecated. Release references to any acquired resources.
release() - Method in class javax.faces.webapp.FacetTag
Release any resources allocated by this tag instance.
release() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Release any resources allocated during the execution of this tag handler.
release() - Method in class javax.faces.webapp.UIComponentELTag
Release any resources allocated during the execution of this tag handler.
release() - Method in class javax.faces.webapp.UIComponentTag
Deprecated. Release any resources allocated during the execution of this tag handler.
release() - Method in class javax.faces.webapp.ValidatorTag
Deprecated. Release references to any acquired resources.
release() - Method in interface javax.resource.spi.endpoint.MessageEndpoint
This method may be called by the resource adapter to indicate that it no longer needs a proxy endpoint instance.
release() - Method in interface javax.resource.spi.work.Work
The WorkManager might call this method to hint the active Work instance to complete execution as soon as possible.
release() - Method in class javax.servlet.jsp.PageContext
This method shall "reset" the internal state of a PageContext, releasing all internal references, and preparing the PageContext for potential reuse by a later invocation of initialize().
release() - Method in class javax.servlet.jsp.tagext.BodyTagSupport
Release state.
release() - Method in interface javax.servlet.jsp.tagext.Tag
Called on a Tag handler to release state.
release() - Method in class javax.servlet.jsp.tagext.TagAdapter
Must not be called.
release() - Method in class javax.servlet.jsp.tagext.TagLibraryValidator
Release any data kept by this instance for validation purposes.
release() - Method in class javax.servlet.jsp.tagext.TagSupport
Release state.
RELEASED - Static variable in class javax.enterprise.deploy.shared.StateType
The DeploymentManager is running in discommected mode.
releaseFactories() - Static method in class javax.faces.FactoryFinder
Release any references to factory instances associated with the class loader for the calling web application.
releasePageContext(PageContext) - Method in class javax.servlet.jsp.JspFactory
called to release a previously allocated PageContext object.
Remote - Annotation Type in javax.ejb
Declares the remote business interface(s) for a session bean.
RemoteHome - Annotation Type in javax.ejb
Declares the Remote Home or adapted Remote Home interface for a session bean.
remove(String) - Method in class javax.activation.MimeTypeParameterList
Remove any value associated with the given name.
remove(Handle) - Method in interface javax.ejb.EJBHome
Remove an EJB object identified by its handle.
remove(Object) - Method in interface javax.ejb.EJBHome
Remove an EJB object identified by its primary key.
remove(Object) - Method in interface javax.ejb.EJBLocalHome
Remove an EJB object identified by its primary key.
remove() - Method in interface javax.ejb.EJBLocalObject
Remove the EJB local object.
remove() - Method in interface javax.ejb.EJBObject
Remove the EJB object.
Remove - Annotation Type in javax.ejb
Applied to a business method of a stateful session bean class.
remove(Flags.Flag) - Method in class javax.mail.Flags
Remove the specified system flag from this Flags object.
remove(String) - Method in class javax.mail.Flags
Remove the specified user flag from this Flags object.
remove(Flags) - Method in class javax.mail.Flags
Remove all flags in the given Flags object from this Flags object.
remove(String) - Method in class javax.mail.internet.ParameterList
Removes the specified parameter from this ParameterList.
remove(Object) - Method in interface javax.persistence.EntityManager
Remove the entity instance.
remove() - Method in class javax.xml.stream.util.EventReaderDelegate

removeActionListener(ActionListener) - Method in interface javax.faces.component.ActionSource
Remove an existing ActionListener (if any) from the set of listeners interested in being notified when ActionEvents occur.
removeActionListener(ActionListener) - Method in class javax.faces.component.UICommand

removeAllAttachments() - Method in class javax.xml.soap.SOAPMessage
Removes all AttachmentPart objects that have been added to this SOAPMessage object.
removeAllFaultSubcodes() - Method in interface javax.xml.soap.SOAPFault
Removes any Subcodes that may be contained by this SOAPFault.
removeAllHeaders() - Method in class javax.xml.soap.MimeHeaders
Removes all the header entries from this MimeHeaders object.
removeAllMimeHeaders() - Method in class javax.xml.soap.AttachmentPart
Removes all the MIME header entries.
removeAllMimeHeaders() - Method in class javax.xml.soap.SOAPPart
Removes all the MimeHeader objects for this SOAPEnvelope object.
removeAllParameters() - Method in interface javax.xml.rpc.Call
Removes all specified parameters from this Call instance.
removeAssociation(Association) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified Association from this object.
removeAssociations(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified Associations from this object.
removeAttachments(MimeHeaders) - Method in class javax.xml.soap.SOAPMessage
Removes all the AttachmentPart objects that have header entries that match the specified headers.
removeAttribute(String) - Method in interface javax.servlet.http.HttpSession
Removes the object bound with the specified name from this session.
removeAttribute(String) - Method in class javax.servlet.jsp.JspContext
Remove the object reference associated with the given name from all scopes.
removeAttribute(String, int) - Method in class javax.servlet.jsp.JspContext
Remove the object reference associated with the specified name in the given scope.
removeAttribute(String) - Method in interface javax.servlet.ServletContext
Removes the attribute with the given name from the servlet context.
removeAttribute(String) - Method in interface javax.servlet.ServletRequest
Removes an attribute from this request.
removeAttribute(String) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.
removeAttribute(Name) - Method in interface javax.xml.soap.SOAPElement
Removes the attribute with the specified name.
removeAttribute(QName) - Method in interface javax.xml.soap.SOAPElement
Removes the attribute with the specified qname.
removeBodyPart(BodyPart) - Method in class javax.mail.internet.MimeMultipart
Remove the specified part from the multipart message.
removeBodyPart(int) - Method in class javax.mail.internet.MimeMultipart
Remove the part at specified location (starting from 0).
removeBodyPart(BodyPart) - Method in class javax.mail.Multipart
Remove the specified part from the multipart message.
removeBodyPart(int) - Method in class javax.mail.Multipart
Remove the part at specified location (starting from 0).
removeChildConcept(Concept) - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Removes a child Concept.
removeChildConcept(Concept) - Method in interface javax.xml.registry.infomodel.Concept
Removes a child Concept.
removeChildConcepts(Collection) - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Removes a Collection of children Concepts.
removeChildConcepts(Collection) - Method in interface javax.xml.registry.infomodel.Concept
Removes a Collection of children Concepts.
removeChildOrganization(Organization) - Method in interface javax.xml.registry.infomodel.Organization
Removes a child Organization.
removeChildOrganizations(Collection) - Method in interface javax.xml.registry.infomodel.Organization
Removes a Collection of children Organizations.
removeClassification(Classification) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified Classification from this object.
removeClassifications(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified Classifications from this object.
removeConnectionEventListener(ConnectionEventListener) - Method in interface javax.resource.spi.ManagedConnection
Removes an already registered connection event listener from the ManagedConnection instance.
removeConnectionListener(ConnectionListener) - Method in class javax.mail.Folder
Remove a Connection event listener.
removeConnectionListener(ConnectionListener) - Method in class javax.mail.Service
Remove a Connection event listener.
removeContents() - Method in interface javax.xml.soap.SOAPElement
Detaches all children of this SOAPElement.
REMOVED - Static variable in class javax.mail.event.MessageCountEvent
The messages were removed from their folder
removed - Variable in class javax.mail.event.MessageCountEvent
If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this.
removeDataModelListener(DataModelListener) - Method in class javax.faces.model.DataModel
Remove an existing DataModelListener from the set interested in notifications from this DataModel.
removeDConfigBean(DConfigBean) - Method in interface javax.enterprise.deploy.spi.DConfigBean
Remove a child DConfigBean from this bean.
removeDConfigBean(DConfigBeanRoot) - Method in interface javax.enterprise.deploy.spi.DeploymentConfiguration
Remove the root DConfigBean and all its children.
removeDeserializer(Class, QName) - Method in interface javax.xml.rpc.encoding.TypeMapping
Removes the DeserializerFactory registered for the specified pair of Java type and XML data type.
removeELContextListener(ELContextListener) - Method in class javax.faces.application.Application
Remove the argument listener from the list of ELContextListeners.
RemoveException - Exception in javax.ejb
The RemoveException exception is thrown at an attempt to remove an EJB object when the enterprise Bean or the container does not allow the EJB object to be removed.
RemoveException() - Constructor for exception javax.ejb.RemoveException
Constructs an RemoveException with no detail message.
RemoveException(String) - Constructor for exception javax.ejb.RemoveException
Constructs an RemoveException with the specified detail message.
removeExcludedPolicy() - Method in interface javax.security.jacc.PolicyConfiguration
Used to remove any excluded policy statements from this PolicyConfiguration.
removeExternalIdentifier(ExternalIdentifier) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified ExternalIdentifier as an external identifier from this object.
removeExternalIdentifiers(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified ExternalIdentifiers as an external identifiers from this object.
removeExternalLink(ExternalLink) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified ExternalLink from this object.
removeExternalLinks(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Removes specified ExternalLinks from this object.
removeFacesListener(FacesListener) - Method in class javax.faces.component.UIComponent
Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent.
removeFacesListener(FacesListener) - Method in class javax.faces.component.UIComponentBase
Remove the specified FacesListener from the set of listeners registered to receive event notifications from this UIComponent.
removeFolderListener(FolderListener) - Method in class javax.mail.Folder
Remove a Folder event listener.
removeFolderListener(FolderListener) - Method in class javax.mail.Store
Remove a listener for Folder events.
removeHeader(String) - Method in class javax.mail.internet.InternetHeaders
Remove all header entries that match the given name
removeHeader(String) - Method in class javax.mail.internet.MimeBodyPart
Remove all headers with this name.
removeHeader(String) - Method in class javax.mail.internet.MimeMessage
Remove all headers with this name.
removeHeader(String) - Method in interface javax.mail.Part
Remove all headers with this name.
removeHeader(String) - Method in class javax.xml.soap.MimeHeaders
Remove all MimeHeader objects whose name matches the given name.
removeLocalizedString(LocalizedString) - Method in interface javax.xml.registry.infomodel.InternationalString
Removes a LocalizedString from this object.
removeLocalizedStrings(Collection) - Method in interface javax.xml.registry.infomodel.InternationalString
Removes specified LocalizedStrings to this object.
removeMessageChangedListener(MessageChangedListener) - Method in class javax.mail.Folder
Remove a MessageChanged listener.
removeMessageCountListener(MessageCountListener) - Method in class javax.mail.Folder
Remove a MessageCount listener.
removeMimeHeader(String) - Method in class javax.xml.soap.AttachmentPart
Removes all MIME headers that match the given name.
removeMimeHeader(String) - Method in class javax.xml.soap.SOAPPart
Removes all MIME headers that match the given name.
removeNamespaceDeclaration(String) - Method in interface javax.xml.soap.SOAPElement
Removes the namespace declaration corresponding to the given prefix.
removeNotificationListener(ObjectName, NotificationListener) - Method in interface javax.management.j2ee.ListenerRegistration
Remove a listener from a registered managed object.
removeParameter(String) - Method in class javax.activation.MimeType
Remove any value associated with the given name.
removePhaseListener(PhaseListener) - Method in class javax.faces.component.UIViewRoot

removePhaseListener(PhaseListener) - Method in class javax.faces.lifecycle.Lifecycle
Deregister an existing PhaseListener instance that is no longer interested in being notified before and after the processing for standard phases of the request processing lifecycle.
removeProgressListener(ProgressListener) - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
Remove a ProgressObject listener.
removeProperty(String) - Method in interface javax.xml.rpc.Call
Removes a named property.
removeProperty(String) - Method in interface javax.xml.rpc.handler.MessageContext
Removes a property (name-value pair) from the MessageContext
removePropertyChangeListener(PropertyChangeListener) - Method in interface javax.enterprise.deploy.spi.DConfigBean
Unregister a property listener for this bean.
removeRegistryObject(RegistryObject) - Method in interface javax.xml.registry.infomodel.RegistryPackage
Removes a child RegistryObject from membership.
removeRegistryObjects(Collection) - Method in interface javax.xml.registry.infomodel.RegistryPackage
Removes a Collection of children RegistryObjects from membership.
removeRole(String) - Method in interface javax.security.jacc.PolicyConfiguration
Used to remove a role and all its permissions from this PolicyConfiguration.
removeSerializer(Class, QName) - Method in interface javax.xml.rpc.encoding.TypeMapping
Removes the SerializerFactory registered for the specified pair of Java type and XML data type.
removeService(Service) - Method in interface javax.xml.registry.infomodel.Organization
Removes a Service from this object.
removeServiceBinding(ServiceBinding) - Method in interface javax.xml.registry.infomodel.Service
Removes a child ServiceBinding.
removeServiceBindings(Collection) - Method in interface javax.xml.registry.infomodel.Service
Removes a Collection of children ServiceBindings.
removeServices(Collection) - Method in interface javax.xml.registry.infomodel.Organization
Removes a Collection of children Services from this object.
removeSlot(String) - Method in interface javax.xml.registry.infomodel.ExtensibleObject
Removes a Slot from this object.
removeSlots(Collection) - Method in interface javax.xml.registry.infomodel.ExtensibleObject
Removes specified Slots from this object.
removeSpecificationLink(SpecificationLink) - Method in interface javax.xml.registry.infomodel.ServiceBinding
Removes a child SpecificationLink.
removeSpecificationLinks(Collection) - Method in interface javax.xml.registry.infomodel.ServiceBinding
Removes a Collection of children SpecificationLinks.
removeStoreListener(StoreListener) - Method in class javax.mail.Store
Remove a listener for Store events.
removeTransportListener(TransportListener) - Method in class javax.mail.Transport
Remove a listener for Transport events.
removeTypeMapping(TypeMapping) - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Removes a TypeMapping from the TypeMappingRegistry.
removeUncheckedPolicy() - Method in interface javax.security.jacc.PolicyConfiguration
Used to remove any unchecked policy statements from this PolicyConfiguration.
removeUser(User) - Method in interface javax.xml.registry.infomodel.Organization
Removes a User.
removeUsers(Collection) - Method in interface javax.xml.registry.infomodel.Organization
Removes a Collection of Users.
removeValidator(Validator) - Method in interface javax.faces.component.EditableValueHolder
Remove a Validator instance from the set associated with this component, if it was previously associated.
removeValidator(Validator) - Method in class javax.faces.component.UIInput
Remove a Validator instance from the set associated with this UIInput, if it was previously associated.
removeValue(String) - Method in interface javax.servlet.http.HttpSession
Deprecated. As of Version 2.2, this method is replaced by HttpSession.removeAttribute(java.lang.String)
removeValue(String) - Method in class javax.servlet.jsp.tagext.TagSupport
Remove a value associated with a key.
removeValueChangeListener(ValueChangeListener) - Method in interface javax.faces.component.EditableValueHolder
Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.
removeValueChangeListener(ValueChangeListener) - Method in class javax.faces.component.UIInput
Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.
removeXpathListener(String, XpathListener) - Method in interface javax.enterprise.deploy.model.DDBean
Unregister a listener for a specific XPath.
removeXpathListener(ModuleType, String, XpathListener) - Method in interface javax.enterprise.deploy.model.J2eeApplicationObject
Unregister the listener for an XPath.
RENAMED - Static variable in class javax.mail.event.FolderEvent
The folder was renamed.
renameTo(Folder) - Method in class javax.mail.Folder
Rename this Folder.
render(FacesContext) - Method in class javax.faces.lifecycle.Lifecycle
Execute the Render Response phase of the request processing lifecycle, unless the responseComplete() method has been called on the FacesContext instance associated with the current request.
RENDER_KIT_FACTORY - Static variable in class javax.faces.FactoryFinder
The property name for the RenderKitFactory class name.
RENDER_KIT_ID_PARAM - Static variable in class javax.faces.render.ResponseStateManager
The name of the request parameter used by the default implementation of ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext) to derive a RenderKit ID.
RENDER_RESPONSE - Static variable in class javax.faces.event.PhaseId
Identifier for the Render Response phase of the request processing lifecycle.
Renderer - Class in javax.faces.render
A Renderer converts the internal representation of UIComponents into the output stream (or writer) associated with the response we are creating for a particular request.
Renderer() - Constructor for class javax.faces.render.Renderer

RenderKit - Class in javax.faces.render
RenderKit represents a collection of Renderer instances that, together, know how to render JavaServer Faces UIComponent instances for a specific client.
RenderKit() - Constructor for class javax.faces.render.RenderKit

RenderKitFactory - Class in javax.faces.render
RenderKitFactory is a factory object that registers and returns RenderKit instances.
RenderKitFactory() - Constructor for class javax.faces.render.RenderKitFactory

renderResponse() - Method in class javax.faces.context.FacesContext
Signal the JavaServer faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the Render Response phase, bypassing any phases that have not been executed yet.
renderView(FacesContext, UIViewRoot) - Method in class javax.faces.application.ViewHandler
Perform whatever actions are required to render the response view to the response object associated with the current FacesContext.
renderView(FacesContext, UIViewRoot) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot) on the wrapped ViewHandler object.
reply(boolean) - Method in class javax.mail.internet.MimeMessage
Get a new Message suitable for a reply to this message.
reply(boolean) - Method in class javax.mail.Message
Get a new Message suitable for a reply to this message.
report(String, String, Object, Location) - Method in interface javax.xml.stream.XMLReporter
Report the desired message in an application specific format.
REPORTER - Static variable in class javax.xml.stream.XMLInputFactory
The property used to set/get the implementation of the XMLReporter interface
request(Message) - Method in class javax.jms.QueueRequestor
Sends a request and waits for a reply.
request(Message) - Method in class javax.jms.TopicRequestor
Sends a request and waits for a reply.
REQUEST - Static variable in class javax.servlet.jsp.PageContext
Name used to store ServletRequest in PageContext name table.
REQUEST_SCOPE - Static variable in class javax.servlet.jsp.PageContext
Request scope: the named reference remains available from the ServletRequest associated with the Servlet until the current request is completed.
REQUEST_TIME_VALUE - Static variable in class javax.servlet.jsp.tagext.TagData
Distinguished value for an attribute to indicate its value is a request-time expression (which is not yet available because TagData instances are used at translation-time).
requestDestroyed(ServletRequestEvent) - Method in interface javax.servlet.ServletRequestListener
The request is about to go out of scope of the web application.
RequestDispatcher - Interface in javax.servlet
Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server.
requestInitialized(ServletRequestEvent) - Method in interface javax.servlet.ServletRequestListener
The request is about to come into scope of the web application.
requestPasswordAuthentication(InetAddress, int, String, String, String) - Method in class javax.mail.Session
Call back to the application to get the needed user name and password.
RequestWrapper - Annotation Type in javax.xml.ws
Used to annotate methods in the Service Endpoint Interface with the request wrapper bean to be used at runtime.
require(int, String, String) - Method in class javax.xml.stream.util.StreamReaderDelegate

require(int, String, String) - Method in interface javax.xml.stream.XMLStreamReader
Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event.
REQUIRED_MESSAGE_ID - Static variable in class javax.faces.component.UIInput
The message identifier of the FacesMessage to be created if a required check fails.
reset() - Method in interface javax.jms.BytesMessage
Puts the message body in read-only mode and repositions the stream of bytes to the beginning.
reset() - Method in interface javax.jms.StreamMessage
Puts the message body in read-only mode and repositions the stream to the beginning.
reset() - Method in class javax.mail.util.SharedFileInputStream
See the general contract of the reset method of InputStream.
reset() - Method in interface javax.servlet.ServletResponse
Clears any data that exists in the buffer as well as the status code and headers.
reset() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call reset() on the wrapped response object.
reset() - Method in class javax.xml.bind.util.ValidationEventCollector
Clear all collected errors and warnings.
resetBuffer() - Method in interface javax.servlet.ServletResponse
Clears the content of the underlying buffer in the response without clearing headers or status code.
resetBuffer() - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call resetBuffer() on the wrapped response object.
resetValue() - Method in class javax.faces.component.UIInput
Convenience method to reset this component's value to the un-initialized state.
RESOLVABLE_AT_DESIGN_TIME - Static variable in class javax.el.ELResolver
The attribute name of the named attribute in the FeatureDescriptor that specifies whether the variable or property can be resolved at runtime.
resolveEntity(String, String, String, String) - Method in interface javax.xml.stream.XMLResolver
Retrieves a resource.
resolveFunction(String, String) - Method in class javax.el.FunctionMapper
Resolves the specified prefix and local name into a java.lang.Method.
resolveFunction(String, String) - Method in interface javax.servlet.jsp.el.FunctionMapper
Deprecated. Resolves the specified local name and prefix into a Java.lang.Method.
RESOLVER - Static variable in class javax.xml.stream.XMLInputFactory
The property used to set/get the implementation of the XMLResolver
resolveVariable(String) - Method in class javax.el.VariableMapper

resolveVariable(FacesContext, String) - Method in class javax.faces.el.VariableResolver
Deprecated. Resolve the specified variable name, and return the corresponding object, if any; otherwise, return null.
resolveVariable(String) - Method in interface javax.servlet.jsp.el.VariableResolver
Deprecated. Resolves the specified variable.
Resource - Annotation Type in javax.annotation
The Resource annotation marks a resource that is needed by the application.
Resource.AuthenticationType - Enum in javax.annotation
The two possible authentication types for a resource.
ResourceAdapter - Interface in javax.resource.spi
This represents a resource adapter instance and contains operations for lifecycle management and message endpoint setup.
ResourceAdapterAssociation - Interface in javax.resource.spi
This interface specifies the methods to associate a ResourceAdapter object with other objects that implement this interface like ManagedConnectionFactory and ActivationSpec.
ResourceAdapterInternalException - Exception in javax.resource.spi
A ResourceAdapterInternalException indicates any system-level error conditions related to a resource adapter.
ResourceAdapterInternalException() - Constructor for exception javax.resource.spi.ResourceAdapterInternalException
Constructs a new instance with null as its detail message.
ResourceAdapterInternalException(String) - Constructor for exception javax.resource.spi.ResourceAdapterInternalException
Constructs a new instance with the specified detail message.
ResourceAdapterInternalException(Throwable) - Constructor for exception javax.resource.spi.ResourceAdapterInternalException
Constructs a new throwable with the specified cause.
ResourceAdapterInternalException(String, Throwable) - Constructor for exception javax.resource.spi.ResourceAdapterInternalException
Constructs a new throwable with the specified detail message and cause.
ResourceAdapterInternalException(String, String) - Constructor for exception javax.resource.spi.ResourceAdapterInternalException
Constructs a new throwable with the specified detail message and an error code.
ResourceAdapterMetaData - Interface in javax.resource.cci
The interface javax.resource.cci.ResourceAdapterMetaData provides information about capabilities of a resource adapter implementation.
ResourceAllocationException - Exception in javax.jms
This exception is thrown when a provider is unable to allocate the resources required by a method.
ResourceAllocationException(String, String) - Constructor for exception javax.jms.ResourceAllocationException
Constructs a ResourceAllocationException with the specified reason and error code.
ResourceAllocationException(String) - Constructor for exception javax.jms.ResourceAllocationException
Constructs a ResourceAllocationException with the specified reason.
ResourceAllocationException - Exception in javax.resource.spi
A ResourceAllocationException can be thrown by an application server or resource adapter to indicate any failure to allocate system resources (example: threads, physical connections).
ResourceAllocationException() - Constructor for exception javax.resource.spi.ResourceAllocationException
Constructs a new instance with null as its detail message.
ResourceAllocationException(String) - Constructor for exception javax.resource.spi.ResourceAllocationException
Constructs a new instance with the specified detail message.
ResourceAllocationException(Throwable) - Constructor for exception javax.resource.spi.ResourceAllocationException
Constructs a new throwable with the specified cause.
ResourceAllocationException(String, Throwable) - Constructor for exception javax.resource.spi.ResourceAllocationException
Constructs a new throwable with the specified detail message and cause.
ResourceAllocationException(String, String) - Constructor for exception javax.resource.spi.ResourceAllocationException
Constructs a new throwable with the specified detail message and an error code.
ResourceBundleELResolver - Class in javax.el
Defines property resolution behavior on instances of ResourceBundle.
ResourceBundleELResolver() - Constructor for class javax.el.ResourceBundleELResolver

ResourceException - Exception in javax.resource
This is the root interface of the exception hierarchy defined for the Connector architecture.
ResourceException() - Constructor for exception javax.resource.ResourceException
Constructs a new instance with null as its detail message.
ResourceException(String) - Constructor for exception javax.resource.ResourceException
Constructs a new instance with the specified detail message.
ResourceException(Throwable) - Constructor for exception javax.resource.ResourceException
Constructs a new throwable with the specified cause.
ResourceException(String, Throwable) - Constructor for exception javax.resource.ResourceException
Constructs a new throwable with the specified detail message and cause.
ResourceException(String, String) - Constructor for exception javax.resource.ResourceException
Create a new throwable with the specified message and error code.
Resources - Annotation Type in javax.annotation
This class is used to allow multiple resources declarations.
resources - Variable in class javax.mail.Quota
The set of resources associated with this quota root.
ResourceWarning - Exception in javax.resource.cci
A ResourceWarning provides information on warnings related to execution of an interaction with an EIS.
ResourceWarning() - Constructor for exception javax.resource.cci.ResourceWarning
Constructs a new instance with null as its detail message.
ResourceWarning(String) - Constructor for exception javax.resource.cci.ResourceWarning
Constructs a new instance with the specified detail message.
ResourceWarning(Throwable) - Constructor for exception javax.resource.cci.ResourceWarning
Constructs a new throwable with the specified cause.
ResourceWarning(String, Throwable) - Constructor for exception javax.resource.cci.ResourceWarning
Constructs a new throwable with the specified detail message and cause.
ResourceWarning(String, String) - Constructor for exception javax.resource.cci.ResourceWarning
Constructs a new throwable with the specified detail message and an error code.
RESPONSE - Static variable in class javax.servlet.jsp.PageContext
Name used to store ServletResponse in PageContext name table.
Response<T> - Interface in javax.xml.ws
The Response interface provides methods used to obtain the payload and context of a message sent in response to an operation invocation.
responseComplete() - Method in class javax.faces.context.FacesContext
Signal the JavaServer Faces implementation that the HTTP response for this request has already been generated (such as an HTTP redirect), and that the request processing lifecycle should be terminated as soon as the current phase is completed.
ResponseStateManager - Class in javax.faces.render
ResponseStateManager is the helper class to StateManager that knows the specific rendering technology being used to generate the response.
ResponseStateManager() - Constructor for class javax.faces.render.ResponseStateManager

ResponseStream - Class in javax.faces.context
ResponseStream is an interface describing an adapter to an underlying output mechanism for binary output.
ResponseStream() - Constructor for class javax.faces.context.ResponseStream

ResponseWrapper - Annotation Type in javax.xml.ws
Used to annotate methods in the Service Endpoint Interface with the response wrapper bean to be used at runtime.
ResponseWriter - Class in javax.faces.context
ResponseWriter is an abstract class describing an adapter to an underlying output mechanism for character-based output.
ResponseWriter() - Constructor for class javax.faces.context.ResponseWriter

ResponseWriterWrapper - Class in javax.faces.context
Provides a simple implementation of ResponseWriter that can be subclassed by developers wishing to provide specialized behavior to an existing ResponseWriter instance.
ResponseWriterWrapper() - Constructor for class javax.faces.context.ResponseWriterWrapper

restore(InputStream) - Method in interface javax.enterprise.deploy.spi.DeploymentConfiguration
Restore from disk to a full set of configuration beans previously stored.
RESTORE_VIEW - Static variable in class javax.faces.event.PhaseId
Identifier that indicates an interest in events queued for the Restore View phase of the request processing lifecycle.
restoreAttachedState(FacesContext, Object) - Static method in class javax.faces.component.UIComponentBase
This method is called by UIComponent subclasses that need to restore the objects they saved using UIComponentBase.saveAttachedState(javax.faces.context.FacesContext, java.lang.Object).
restoreComponentState(FacesContext, UIViewRoot, String) - Method in class javax.faces.application.StateManager
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation does nothing.
restoreComponentState(FacesContext, UIViewRoot, String) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String) on the wrapped StateManager object.
restoreDConfigBean(InputStream, DDBeanRoot) - Method in interface javax.enterprise.deploy.spi.DeploymentConfiguration
Restore from disk to instantated objects all the DConfigBeans associated with a specific deployment descriptor.
restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlColumn

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlCommandButton

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlCommandLink

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlDataTable

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlForm

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlGraphicImage

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlInputHidden

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlInputSecret

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlInputText

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlInputTextarea

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlMessage

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlMessages

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlOutputFormat

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlOutputLabel

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlOutputLink

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlOutputText

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlPanelGrid

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlPanelGroup

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlSelectManyListbox

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlSelectManyMenu

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlSelectOneListbox

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlSelectOneMenu

restoreState(FacesContext, Object) - Method in class javax.faces.component.html.HtmlSelectOneRadio

restoreState(FacesContext, Object) - Method in interface javax.faces.component.StateHolder
Perform any processing required to restore the state from the entries in the state Object.
restoreState(FacesContext, Object) - Method in class javax.faces.component.UICommand

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIComponentBase

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIData

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIGraphic

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIInput

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIMessage

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIMessages

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIOutput

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIParameter

restoreState(FacesContext, Object) - Method in class javax.faces.component.UISelectItem

restoreState(FacesContext, Object) - Method in class javax.faces.component.UISelectItems

restoreState(FacesContext, Object) - Method in class javax.faces.component.UIViewRoot

restoreState(FacesContext, Object) - Method in class javax.faces.convert.DateTimeConverter

restoreState(FacesContext, Object) - Method in class javax.faces.convert.EnumConverter

restoreState(FacesContext, Object) - Method in class javax.faces.convert.NumberConverter

restoreState(FacesContext, Object) - Method in class javax.faces.event.MethodExpressionActionListener

restoreState(FacesContext, Object) - Method in class javax.faces.event.MethodExpressionValueChangeListener

restoreState(FacesContext, Object) - Method in class javax.faces.validator.DoubleRangeValidator

restoreState(FacesContext, Object) - Method in class javax.faces.validator.LengthValidator

restoreState(FacesContext, Object) - Method in class javax.faces.validator.LongRangeValidator

restoreState(FacesContext, Object) - Method in class javax.faces.validator.MethodExpressionValidator

restoreTreeStructure(FacesContext, String, String) - Method in class javax.faces.application.StateManager
Deprecated. the distinction between tree structure and component state is now an implementation detail. The default implementation returns null.
restoreTreeStructure(FacesContext, String, String) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String) on the wrapped StateManager object.
restoreView(FacesContext, String, String) - Method in class javax.faces.application.StateManager
Restore the tree structure and the component state of the view for the specified viewId, in an implementation dependent manner, and return the restored UIViewRoot.
restoreView(FacesContext, String, String) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.restoreView(javax.faces.context.FacesContext, String, String) on the wrapped StateManager object.
restoreView(FacesContext, String) - Method in class javax.faces.application.ViewHandler
Perform whatever actions are required to restore the view associated with the specified FacesContext and viewId.
restoreView(FacesContext, String) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.restoreView(javax.faces.context.FacesContext, String) on the wrapped ViewHandler object.
ResultDataModel - Class in javax.faces.model
ResultDataModel is a convenience implementation of DataModel that wraps a JSTL Result object, typically representing the results of executing an SQL query via JSTL tags.
ResultDataModel() - Constructor for class javax.faces.model.ResultDataModel
Construct a new ResultDataModel with no specified wrapped data.
ResultDataModel(Result) - Constructor for class javax.faces.model.ResultDataModel
Construct a new ResultDataModel wrapping the specified Result.
ResultSet - Interface in javax.resource.cci
A ResultSet represents tabular data that is retrieved from an EIS instance by the execution of an Interaction..
ResultSetDataModel - Class in javax.faces.model
ResultSetDataModel is a convenience implementation of DataModel that wraps a ResultSet of Java objects.
ResultSetDataModel() - Constructor for class javax.faces.model.ResultSetDataModel
Construct a new ResultSetDataModel with no specified wrapped data.
ResultSetDataModel(ResultSet) - Constructor for class javax.faces.model.ResultSetDataModel
Construct a new ResultSetDataModel wrapping the specified ResultSet.
ResultSetInfo - Interface in javax.resource.cci
The interface javax.resource.cci.ResultSetInfo provides information on the support provided for ResultSet by a connected EIS instance.
resume(Transaction) - Method in interface javax.transaction.TransactionManager
Resume the transaction context association of the calling thread with the transaction represented by the supplied Transaction object.
RFC822 - Static variable in class javax.mail.internet.HeaderTokenizer
RFC822 specials
RolesAllowed - Annotation Type in javax.annotation.security
Specifies the list of roles permitted to access method(s) in an application.
rollback() - Method in interface javax.jms.Session
Rolls back any messages done in this transaction and releases any locks currently held.
rollback() - Method in interface javax.jms.XASession
Throws a TransactionInProgressException, since it should not be called for an XASession object.
rollback() - Method in interface javax.persistence.EntityTransaction
Roll back the current transaction
rollback() - Method in interface javax.resource.cci.LocalTransaction
Rollbacks the current resource manager local transaction.
rollback() - Method in interface javax.resource.spi.LocalTransaction
Rollback a local transaction
rollback(Xid) - Method in interface javax.resource.spi.XATerminator
Informs the resource manager to roll back work done on behalf of a transaction branch.
rollback() - Method in interface javax.transaction.Transaction
Rollback the transaction represented by this Transaction object.
rollback() - Method in interface javax.transaction.TransactionManager
Roll back the transaction associated with the current thread.
rollback() - Method in interface javax.transaction.UserTransaction
Roll back the transaction associated with the current thread.
rollback(Xid) - Method in interface javax.transaction.xa.XAResource
Informs the resource manager to roll back work done on behalf of a transaction branch.
RollbackException - Exception in javax.persistence
Thrown by the persistence provider when the EntityTransaction.commit() fails.
RollbackException() - Constructor for exception javax.persistence.RollbackException
Constructs a new RollbackException exception with null as its detail message.
RollbackException(String) - Constructor for exception javax.persistence.RollbackException
Constructs a new RollbackException exception with the specified detail message.
RollbackException(String, Throwable) - Constructor for exception javax.persistence.RollbackException
Constructs a new RollbackException exception with the specified detail message and cause.
RollbackException(Throwable) - Constructor for exception javax.persistence.RollbackException
Constructs a new RollbackException exception with the specified cause.
RollbackException - Exception in javax.transaction
RollbackException exception is thrown when the transaction has been marked for rollback only or the transaction has been rolled back instead of committed.
RollbackException() - Constructor for exception javax.transaction.RollbackException

RollbackException(String) - Constructor for exception javax.transaction.RollbackException

rowSelected(DataModelEvent) - Method in interface javax.faces.model.DataModelListener
Notification that a particular row index, with the associated row data, has been selected for processing.
run() - Method in interface javax.jms.Session
Optional operation, intended to be used only by Application Servers, not by ordinary JMS clients.
RunAs - Annotation Type in javax.annotation.security
Defines the identity of the application during execution in a J2EE container.
RUNNING - Static variable in class javax.enterprise.deploy.shared.StateType
The action operation is running normally.

S

SAAJMetaFactory - Class in javax.xml.soap
The access point for the implementation classes of the factories defined in the SAAJ API.
SAAJMetaFactory() - Constructor for class javax.xml.soap.SAAJMetaFactory

SAAJResult - Class in javax.xml.soap
Acts as a holder for the results of a JAXP transformation or a JAXB marshalling, in the form of a SAAJ tree.
SAAJResult() - Constructor for class javax.xml.soap.SAAJResult
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the default (SOAP 1.1) protocol.
SAAJResult(String) - Constructor for class javax.xml.soap.SAAJResult
Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the specified protocol.
SAAJResult(SOAPMessage) - Constructor for class javax.xml.soap.SAAJResult
Creates a SAAJResult that will write the results into the SOAPPart of the supplied SOAPMessage.
SAAJResult(SOAPElement) - Constructor for class javax.xml.soap.SAAJResult
Creates a SAAJResult that will write the results as a child node of the SOAPElement specified.
save(OutputStream) - Method in interface javax.enterprise.deploy.spi.DeploymentConfiguration
Save to disk the current set configuration beans created for this deployable module.
saveAssociations(Collection, boolean) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Saves the specified Association instances.
saveAttachedState(FacesContext, Object) - Static method in class javax.faces.component.UIComponentBase
This method is called by UIComponent subclasses that want to save one or more attached objects.
saveChanges() - Method in class javax.mail.internet.MimeMessage
Updates the appropriate header fields of this message to be consistent with the message's contents.
saveChanges() - Method in class javax.mail.Message
Save any changes made to this message into the message-store when the containing folder is closed, if the message is contained in a folder.
saveChanges() - Method in class javax.xml.soap.SOAPMessage
Updates this SOAPMessage object with all the changes that have been made to it.
saveClassificationSchemes(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Saves the specified ClassificationScheme instances.
saveConcepts(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Saves the specified Concepts.
saved - Variable in class javax.mail.internet.MimeMessage
Does the saveChanges method need to be called on this message?
saveDConfigBean(OutputStream, DConfigBeanRoot) - Method in interface javax.enterprise.deploy.spi.DeploymentConfiguration
Save to disk all the configuration beans associated with a particular deployment descriptor file.
SaveException - Exception in javax.xml.registry
A RegistryException that occurs during a save action.
SaveException() - Constructor for exception javax.xml.registry.SaveException
Constructs a JAXRException object with no reason or embedded Throwable.
SaveException(String) - Constructor for exception javax.xml.registry.SaveException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
SaveException(String, Throwable) - Constructor for exception javax.xml.registry.SaveException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
SaveException(Throwable) - Constructor for exception javax.xml.registry.SaveException
Constructs a JAXRException object initialized with the given Throwable object.
saveFile(File) - Method in class javax.mail.internet.MimeBodyPart
Save the contents of this part in the specified file.
saveFile(String) - Method in class javax.mail.internet.MimeBodyPart
Save the contents of this part in the specified file.
saveObjects(Collection) - Method in interface javax.xml.registry.LifeCycleManager
Saves one or more Objects to the registry.
saveOrganizations(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Saves the specified Organizations.
saveRequired() - Method in class javax.xml.soap.SOAPMessage
Indicates whether this SOAPMessage object needs to have the method saveChanges called on it.
saveSerializedView(FacesContext) - Method in class javax.faces.application.StateManager
Deprecated. this has been replaced by StateManager.saveView(javax.faces.context.FacesContext). The default implementation returns null.
saveSerializedView(FacesContext) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.saveSerializedView(javax.faces.context.FacesContext) on the wrapped StateManager object.
saveServiceBindings(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Saves the specified ServiceBindings.
saveServices(Collection) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Saves the specified Services.
saveState(FacesContext) - Method in class javax.faces.component.html.HtmlColumn

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlCommandButton

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlCommandLink

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlDataTable

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlForm

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlGraphicImage

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlInputHidden

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlInputSecret

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlInputText

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlInputTextarea

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlMessage

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlMessages

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlOutputFormat

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlOutputLabel

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlOutputLink

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlOutputText

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlPanelGrid

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlPanelGroup

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlSelectManyListbox

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlSelectManyMenu

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlSelectOneListbox

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlSelectOneMenu

saveState(FacesContext) - Method in class javax.faces.component.html.HtmlSelectOneRadio

saveState(FacesContext) - Method in interface javax.faces.component.StateHolder
Gets the state of the instance as a Serializable Object.
saveState(FacesContext) - Method in class javax.faces.component.UICommand

saveState(FacesContext) - Method in class javax.faces.component.UIComponentBase

saveState(FacesContext) - Method in class javax.faces.component.UIData

saveState(FacesContext) - Method in class javax.faces.component.UIGraphic

saveState(FacesContext) - Method in class javax.faces.component.UIInput

saveState(FacesContext) - Method in class javax.faces.component.UIMessage

saveState(FacesContext) - Method in class javax.faces.component.UIMessages

saveState(FacesContext) - Method in class javax.faces.component.UIOutput

saveState(FacesContext) - Method in class javax.faces.component.UIParameter

saveState(FacesContext) - Method in class javax.faces.component.UISelectItem

saveState(FacesContext) - Method in class javax.faces.component.UISelectItems

saveState(FacesContext) - Method in class javax.faces.component.UIViewRoot

saveState(FacesContext) - Method in class javax.faces.convert.DateTimeConverter

saveState(FacesContext) - Method in class javax.faces.convert.EnumConverter

saveState(FacesContext) - Method in class javax.faces.convert.NumberConverter

saveState(FacesContext) - Method in class javax.faces.event.MethodExpressionActionListener

saveState(FacesContext) - Method in class javax.faces.event.MethodExpressionValueChangeListener

saveState(FacesContext) - Method in class javax.faces.validator.DoubleRangeValidator

saveState(FacesContext) - Method in class javax.faces.validator.LengthValidator

saveState(FacesContext) - Method in class javax.faces.validator.LongRangeValidator

saveState(FacesContext) - Method in class javax.faces.validator.MethodExpressionValidator

saveView(FacesContext) - Method in class javax.faces.application.StateManager
Return an opaque Object containing sufficient information for this same instance to restore the state of the current UIViewRoot on a subsequent request.
saveView(FacesContext) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.saveView(javax.faces.context.FacesContext) on the wrapped StateManager object.
SC_ACCEPTED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (202) indicating that a request was accepted for processing, but was not completed.
SC_BAD_GATEWAY - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (502) indicating that the HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.
SC_BAD_REQUEST - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (400) indicating the request sent by the client was syntactically incorrect.
SC_CONFLICT - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (409) indicating that the request could not be completed due to a conflict with the current state of the resource.
SC_CONTINUE - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (100) indicating the client can continue.
SC_CREATED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (201) indicating the request succeeded and created a new resource on the server.
SC_EXPECTATION_FAILED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (417) indicating that the server could not meet the expectation given in the Expect request header.
SC_FORBIDDEN - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (403) indicating the server understood the request but refused to fulfill it.
SC_FOUND - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (302) indicating that the resource reside temporarily under a different URI.
SC_GATEWAY_TIMEOUT - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (504) indicating that the server did not receive a timely response from the upstream server while acting as a gateway or proxy.
SC_GONE - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (410) indicating that the resource is no longer available at the server and no forwarding address is known.
SC_HTTP_VERSION_NOT_SUPPORTED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (505) indicating that the server does not support or refuses to support the HTTP protocol version that was used in the request message.
SC_INTERNAL_SERVER_ERROR - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (500) indicating an error inside the HTTP server which prevented it from fulfilling the request.
SC_LENGTH_REQUIRED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (411) indicating that the request cannot be handled without a defined Content-Length.
SC_METHOD_NOT_ALLOWED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (405) indicating that the method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
SC_MOVED_PERMANENTLY - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (301) indicating that the resource has permanently moved to a new location, and that future references should use a new URI with their requests.
SC_MOVED_TEMPORARILY - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (302) indicating that the resource has temporarily moved to another location, but that future references should still use the original URI to access the resource.
SC_MULTIPLE_CHOICES - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (300) indicating that the requested resource corresponds to any one of a set of representations, each with its own specific location.
SC_NO_CONTENT - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (204) indicating that the request succeeded but that there was no new information to return.
SC_NON_AUTHORITATIVE_INFORMATION - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (203) indicating that the meta information presented by the client did not originate from the server.
SC_NOT_ACCEPTABLE - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (406) indicating that the resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
SC_NOT_FOUND - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (404) indicating that the requested resource is not available.
SC_NOT_IMPLEMENTED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (501) indicating the HTTP server does not support the functionality needed to fulfill the request.
SC_NOT_MODIFIED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (304) indicating that a conditional GET operation found that the resource was available and not modified.
SC_OK - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (200) indicating the request succeeded normally.
SC_PARTIAL_CONTENT - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (206) indicating that the server has fulfilled the partial GET request for the resource.
SC_PAYMENT_REQUIRED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (402) reserved for future use.
SC_PRECONDITION_FAILED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (412) indicating that the precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.
SC_PROXY_AUTHENTICATION_REQUIRED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (407) indicating that the client MUST first authenticate itself with the proxy.
SC_REQUEST_ENTITY_TOO_LARGE - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (413) indicating that the server is refusing to process the request because the request entity is larger than the server is willing or able to process.
SC_REQUEST_TIMEOUT - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (408) indicating that the client did not produce a request within the time that the server was prepared to wait.
SC_REQUEST_URI_TOO_LONG - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (414) indicating that the server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.
SC_REQUESTED_RANGE_NOT_SATISFIABLE - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (416) indicating that the server cannot serve the requested byte range.
SC_RESET_CONTENT - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (205) indicating that the agent SHOULD reset the document view which caused the request to be sent.
SC_SEE_OTHER - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (303) indicating that the response to the request can be found under a different URI.
SC_SERVICE_UNAVAILABLE - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (503) indicating that the HTTP server is temporarily overloaded, and unable to handle the request.
SC_SWITCHING_PROTOCOLS - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (101) indicating the server is switching protocols according to Upgrade header.
SC_TEMPORARY_REDIRECT - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (307) indicating that the requested resource resides temporarily under a different URI.
SC_UNAUTHORIZED - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (401) indicating that the request requires HTTP authentication.
SC_UNSUPPORTED_MEDIA_TYPE - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (415) indicating that the server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
SC_USE_PROXY - Static variable in interface javax.servlet.http.HttpServletResponse
Status code (305) indicating that the requested resource MUST be accessed through the proxy given by the Location field.
ScalarDataModel - Class in javax.faces.model
ScalarDataModel is a convenience implementation of DataModel that wraps an individual Java object.
ScalarDataModel() - Constructor for class javax.faces.model.ScalarDataModel
Construct a new ScalarDataModel with no specified wrapped data.
ScalarDataModel(Object) - Constructor for class javax.faces.model.ScalarDataModel
Construct a new ScalarDataModel wrapping the specified scalar object.
scheduleWork(Work) - Method in interface javax.resource.spi.work.WorkManager
Accepts a Work instance for processing.
scheduleWork(Work, long, ExecutionContext, WorkListener) - Method in interface javax.resource.spi.work.WorkManager
Accepts a Work instance for processing.
SchemaOutputResolver - Class in javax.xml.bind
Controls where a JAXB implementation puts the generates schema files.
SchemaOutputResolver() - Constructor for class javax.xml.bind.SchemaOutputResolver

scope - Variable in class javax.xml.bind.JAXBElement
Scope of xml element declaration representing this xml element instance.
ScopedAttributeELResolver - Class in javax.servlet.jsp.el
Defines variable resolution behavior for scoped attributes.
ScopedAttributeELResolver() - Constructor for class javax.servlet.jsp.el.ScopedAttributeELResolver

search(SearchTerm) - Method in class javax.mail.Folder
Search this Folder for messages matching the specified search criterion.
search(SearchTerm, Message[]) - Method in class javax.mail.Folder
Search the given array of messages for those that match the specified search criterion.
SearchException - Exception in javax.mail.search
The exception thrown when a Search expression could not be handled.
SearchException() - Constructor for exception javax.mail.search.SearchException
Constructs a SearchException with no detail message.
SearchException(String) - Constructor for exception javax.mail.search.SearchException
Constructs a SearchException with the specified detail message.
SearchTerm - Class in javax.mail.search
Search criteria are expressed as a tree of search-terms, forming a parse-tree for the search expression.
SearchTerm() - Constructor for class javax.mail.search.SearchTerm

SecondaryTable - Annotation Type in javax.persistence
This annotation is used to specify a secondary table for the annotated entity class.
SecondaryTables - Annotation Type in javax.persistence
This annotation is used to specify multiple secondary tables for an entity.
SecurityException - Exception in javax.resource.spi
A SecurityException indicates error conditions related to the security contract between an application server and resource adapter.
SecurityException() - Constructor for exception javax.resource.spi.SecurityException
Constructs a new instance with null as its detail message.
SecurityException(String) - Constructor for exception javax.resource.spi.SecurityException
Constructs a new instance with the specified detail message.
SecurityException(Throwable) - Constructor for exception javax.resource.spi.SecurityException
Constructs a new throwable with the specified cause.
SecurityException(String, Throwable) - Constructor for exception javax.resource.spi.SecurityException
Constructs a new throwable with the specified detail message and cause.
SecurityException(String, String) - Constructor for exception javax.resource.spi.SecurityException
Constructs a new throwable with the specified detail message and an error code.
SEEN - Static variable in class javax.mail.Flags.Flag
This message is seen.
SelectItem - Class in javax.faces.model
SelectItem represents a single item in the list of supported items associated with a UISelectMany or UISelectOne component.
SelectItem() - Constructor for class javax.faces.model.SelectItem
Construct a SelectItem with no initialized property values.
SelectItem(Object) - Constructor for class javax.faces.model.SelectItem
Construct a SelectItem with the specified value.
SelectItem(Object, String) - Constructor for class javax.faces.model.SelectItem
Construct a SelectItem with the specified value and label.
SelectItem(Object, String, String) - Constructor for class javax.faces.model.SelectItem
Construct a SelectItem instance with the specified value, label and description.
SelectItem(Object, String, String, boolean) - Constructor for class javax.faces.model.SelectItem
Construct a SelectItem instance with the specified property values.
SelectItem(Object, String, String, boolean, boolean) - Constructor for class javax.faces.model.SelectItem
Construct a SelectItem instance with the specified property values.
SelectItemGroup - Class in javax.faces.model
SelectItemGroup is a subclass of SelectItem that identifies a set of options that will be made available as a subordinate "submenu" or "options list", depending upon the requirements of the UISelectMany or UISelectOne renderer that is actually used.
SelectItemGroup() - Constructor for class javax.faces.model.SelectItemGroup
Construct a SelectItemGroup with no initialized property values.
SelectItemGroup(String) - Constructor for class javax.faces.model.SelectItemGroup
Construct a SelectItemGroup with the specified label and no associated selectItems.
SelectItemGroup(String, String, boolean, SelectItem[]) - Constructor for class javax.faces.model.SelectItemGroup
Construct a SelectItemGroup with the specified properties.
send(Message) - Method in interface javax.jms.MessageProducer
Sends a message using the MessageProducer's default delivery mode, priority, and time to live.
send(Message, int, int, long) - Method in interface javax.jms.MessageProducer
Sends a message to the destination, specifying delivery mode, priority, and time to live.
send(Destination, Message) - Method in interface javax.jms.MessageProducer
Sends a message to a destination for an unidentified message producer.
send(Destination, Message, int, int, long) - Method in interface javax.jms.MessageProducer
Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live.
send(Message) - Method in interface javax.jms.QueueSender
Sends a message to the queue.
send(Message, int, int, long) - Method in interface javax.jms.QueueSender
Sends a message to the queue, specifying delivery mode, priority, and time to live.
send(Queue, Message) - Method in interface javax.jms.QueueSender
Sends a message to a queue for an unidentified message producer.
send(Queue, Message, int, int, long) - Method in interface javax.jms.QueueSender
Sends a message to a queue for an unidentified message producer, specifying delivery mode, priority and time to live.
send(Message) - Static method in class javax.mail.Transport
Send a message.
send(Message, Address[]) - Static method in class javax.mail.Transport
Send the message to the specified addresses, ignoring any recipients specified in the message itself.
sendError(int, String) - Method in interface javax.servlet.http.HttpServletResponse
Sends an error response to the client using the specified status.
sendError(int) - Method in interface javax.servlet.http.HttpServletResponse
Sends an error response to the client using the specified status code and clearing the buffer.
sendError(int, String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call sendError(int sc, String msg) on the wrapped response object.
sendError(int) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call sendError(int sc) on the wrapped response object.
SendFailedException - Exception in javax.mail
This exception is thrown when the message cannot be sent.
SendFailedException() - Constructor for exception javax.mail.SendFailedException
Constructs a SendFailedException with no detail message.
SendFailedException(String) - Constructor for exception javax.mail.SendFailedException
Constructs a SendFailedException with the specified detail message.
SendFailedException(String, Exception) - Constructor for exception javax.mail.SendFailedException
Constructs a SendFailedException with the specified Exception and detail message.
SendFailedException(String, Exception, Address[], Address[], Address[]) - Constructor for exception javax.mail.SendFailedException
Constructs a SendFailedException with the specified string and the specified address objects.
sendMessage(Message, Address[]) - Method in class javax.mail.Transport
Send the Message to the specified list of addresses.
sendRedirect(String) - Method in interface javax.servlet.http.HttpServletResponse
Sends a temporary redirect response to the client using the specified redirect location URL.
sendRedirect(String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to return sendRedirect(String location) on the wrapped response object.
SentDateTerm - Class in javax.mail.search
This class implements comparisons for the Message SentDate.
SentDateTerm(int, Date) - Constructor for class javax.mail.search.SentDateTerm
Constructor.
SEPARATOR_CHAR - Static variable in interface javax.faces.component.NamingContainer
The separator character used in component identifiers to demarcate navigation to a child naming container.
SequenceGenerator - Annotation Type in javax.persistence
This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
SerializationContext - Interface in javax.xml.rpc.encoding
The javax.xml.rpc.encoding.SerializationContext interface is implemented by the JAX-RPC runtime system in an XML processing mechanism specific manner.
Serializer - Interface in javax.xml.rpc.encoding
The javax.xml.rpc.encoding.Serializer interface defines the base interface for serializers.
SerializerFactory - Interface in javax.xml.rpc.encoding
The javax.xml.rpc.encoding.SerializerFactory is a factory of the serializers.
ServerSession - Interface in javax.jms
A ServerSession object is an application server object that is used by a server to associate a thread with a JMS session (optional).
ServerSessionPool - Interface in javax.jms
A ServerSessionPool object is an object implemented by an application server to provide a pool of ServerSession objects for processing the messages of a ConnectionConsumer (optional).
service(ServletRequest, ServletResponse) - Method in class javax.faces.webapp.FacesServlet
Process an incoming request, and create the corresponding response, by executing the request processing lifecycle.
Service - Class in javax.mail
An abstract class that contains the functionality common to messaging services, such as stores and transports.
Service(Session, URLName) - Constructor for class javax.mail.Service
Constructor.
service(ServletRequest, ServletResponse) - Method in class javax.servlet.GenericServlet
Called by the servlet container to allow the servlet to respond to a request.
service(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet
Receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class.
service(ServletRequest, ServletResponse) - Method in class javax.servlet.http.HttpServlet
Dispatches client requests to the protected service method.
service(ServletRequest, ServletResponse) - Method in interface javax.servlet.Servlet
Called by the servlet container to allow the servlet to respond to a request.
Service - Interface in javax.xml.registry.infomodel
Service instances are RegistryObjects that provide information on services (for example, web services) offered by an Organization.
SERVICE - Static variable in interface javax.xml.registry.LifeCycleManager

Service - Interface in javax.xml.rpc
Service class acts as a factory of the following: Dynamic proxy for the target service endpoint.
Service - Class in javax.xml.ws
Service objects provide the client view of a Web service.
Service(URL, QName) - Constructor for class javax.xml.ws.Service

Service.Mode - Enum in javax.xml.ws
The orientation of a dynamic client or service.
SERVICE_BINDING - Static variable in interface javax.xml.registry.LifeCycleManager

SERVICE_SUBSET - Static variable in interface javax.xml.registry.FindQualifier
Maps to UDDI serviceSubset.
ServiceBinding - Interface in javax.xml.registry.infomodel
ServiceBinding instances are RegistryObjects that represent technical information on a specific way to access a specific interface offered by a Service instance.
ServiceDelegate - Class in javax.xml.ws.spi
Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.
ServiceDelegate() - Constructor for class javax.xml.ws.spi.ServiceDelegate

ServiceException - Exception in javax.xml.rpc
The javax.xml.rpc.ServiceException is thrown from the methods in the javax.xml.rpc.Service interface and ServiceFactory class.
ServiceException() - Constructor for exception javax.xml.rpc.ServiceException
Constructs a new exception with null as its detail message.
ServiceException(String) - Constructor for exception javax.xml.rpc.ServiceException
Constructs a new exception with the specified detail message.
ServiceException(String, Throwable) - Constructor for exception javax.xml.rpc.ServiceException
Constructs a new exception with the specified detail message and cause.
ServiceException(Throwable) - Constructor for exception javax.xml.rpc.ServiceException
Constructs a new exception with the specified cause and a detail message of (cause==null ?
ServiceFactory - Class in javax.xml.rpc
The javax.xml.rpc.ServiceFactory is an abstract class that provides a factory for the creation of instances of the type javax.xml.rpc.Service.
ServiceFactory() - Constructor for class javax.xml.rpc.ServiceFactory

SERVICEFACTORY_PROPERTY - Static variable in class javax.xml.rpc.ServiceFactory
A constant representing the property used to lookup the name of a ServiceFactory implementation class.
ServiceLifecycle - Interface in javax.xml.rpc.server
The javax.xml.rpc.server.ServiceLifecycle defines a lifecycle interface for a JAX-RPC service endpoint.
ServiceMode - Annotation Type in javax.xml.ws
Used to indicate whether a Provider implementation wishes to work with entire protocol messages or just with protocol message payloads.
Servlet - Interface in javax.servlet
Defines methods that all servlets must implement.
SERVLET_CONTEXT - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: servlet context object.
SERVLET_REQUEST - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: servlet request object.
SERVLET_RESPONSE - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: servlet response object.
ServletConfig - Interface in javax.servlet
A servlet configuration object used by a servlet container to pass information to a servlet during initialization.
ServletContext - Interface in javax.servlet
Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.
ServletContextAttributeEvent - Class in javax.servlet
This is the event class for notifications about changes to the attributes of the servlet context of a web application.
ServletContextAttributeEvent(ServletContext, String, Object) - Constructor for class javax.servlet.ServletContextAttributeEvent
Construct a ServletContextAttributeEvent from the given context for the given attribute name and attribute value.
ServletContextAttributeListener - Interface in javax.servlet
Implementations of this interface receive notifications of changes to the attribute list on the servlet context of a web application.
ServletContextEvent - Class in javax.servlet
This is the event class for notifications about changes to the servlet context of a web application.
ServletContextEvent(ServletContext) - Constructor for class javax.servlet.ServletContextEvent
Construct a ServletContextEvent from the given context.
ServletContextListener - Interface in javax.servlet
Implementations of this interface receive notifications about changes to the servlet context of the web application they are part of.
ServletEndpointContext - Interface in javax.xml.rpc.server
The ServletEndpointContext provides an endpoint context maintained by the underlying servlet container based JAX-RPC runtime system.
ServletException - Exception in javax.servlet
Defines a general exception a servlet can throw when it encounters difficulty.
ServletException() - Constructor for exception javax.servlet.ServletException
Constructs a new servlet exception.
ServletException(String) - Constructor for exception javax.servlet.ServletException
Constructs a new servlet exception with the specified message.
ServletException(String, Throwable) - Constructor for exception javax.servlet.ServletException
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation, including a description message.
ServletException(Throwable) - Constructor for exception javax.servlet.ServletException
Constructs a new servlet exception when the servlet needs to throw an exception and include a message about the "root cause" exception that interfered with its normal operation.
ServletInputStream - Class in javax.servlet
Provides an input stream for reading binary data from a client request, including an efficient readLine method for reading data one line at a time.
ServletInputStream() - Constructor for class javax.servlet.ServletInputStream
Does nothing, because this is an abstract class.
ServletOutputStream - Class in javax.servlet
Provides an output stream for sending binary data to the client.
ServletOutputStream() - Constructor for class javax.servlet.ServletOutputStream
Does nothing, because this is an abstract class.
ServletRequest - Interface in javax.servlet
Defines an object to provide client request information to a servlet.
ServletRequestAttributeEvent - Class in javax.servlet
This is the event class for notifications of changes to the attributes of the servlet request in an application.
ServletRequestAttributeEvent(ServletContext, ServletRequest, String, Object) - Constructor for class javax.servlet.ServletRequestAttributeEvent
Construct a ServletRequestAttributeEvent giving the servlet context of this web application, the ServletRequest whose attributes are changing and the name and value of the attribute.
ServletRequestAttributeListener - Interface in javax.servlet
A ServletRequestAttributeListener can be implemented by the developer interested in being notified of request attribute changes.
ServletRequestEvent - Class in javax.servlet
Events of this kind indicate lifecycle events for a ServletRequest.
ServletRequestEvent(ServletContext, ServletRequest) - Constructor for class javax.servlet.ServletRequestEvent
Construct a ServletRequestEvent for the given ServletContext and ServletRequest.
ServletRequestListener - Interface in javax.servlet
A ServletRequestListener can be implemented by the developer interested in being notified of requests coming in and out of scope in a web component.
ServletRequestWrapper - Class in javax.servlet
Provides a convenient implementation of the ServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet.
ServletRequestWrapper(ServletRequest) - Constructor for class javax.servlet.ServletRequestWrapper
Creates a ServletRequest adaptor wrapping the given request object.
ServletResponse - Interface in javax.servlet
Defines an object to assist a servlet in sending a response to the client.
ServletResponseWrapper - Class in javax.servlet
Provides a convenient implementation of the ServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet.
ServletResponseWrapper(ServletResponse) - Constructor for class javax.servlet.ServletResponseWrapper
Creates a ServletResponse adaptor wrapping the given response object.
ServletStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a Servlet.
Session - Interface in javax.jms
A Session object is a single-threaded context for producing and consuming messages.
session - Variable in class javax.mail.Message
The Session object for this Message
session - Variable in class javax.mail.Service
The session from which this service was created.
Session - Class in javax.mail
The Session class represents a mail session and is not subclassed.
SESSION - Static variable in class javax.servlet.jsp.PageContext
Name used to store HttpSession in PageContext name table.
SESSION_MAINTAIN_PROPERTY - Static variable in interface javax.xml.rpc.Call
Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint.
SESSION_MAINTAIN_PROPERTY - Static variable in interface javax.xml.rpc.Stub
Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint.
SESSION_MAINTAIN_PROPERTY - Static variable in interface javax.xml.ws.BindingProvider
Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint.
SESSION_SCOPE - Static variable in class javax.servlet.jsp.PageContext
Session scope (only valid if this page participates in a session): the named reference remains available from the HttpSession (if any) associated with the Servlet until the HttpSession is invalidated.
SESSION_TRANSACTED - Static variable in interface javax.jms.Session
This value is returned from the method getAcknowledgeMode if the session is transacted.
SessionBean - Interface in javax.ejb
The SessionBean interface is implemented by every session enterprise Bean class.
SessionBeanStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by session beans of both stateful and stateless types.
SessionContext - Interface in javax.ejb
The SessionContext interface provides access to the runtime session context that the container provides for a session enterprise Bean instance.
sessionCreated(HttpSessionEvent) - Method in interface javax.servlet.http.HttpSessionListener
Notification that a session was created.
sessionDestroyed(HttpSessionEvent) - Method in interface javax.servlet.http.HttpSessionListener
Notification that a session is about to be invalidated.
sessionDidActivate(HttpSessionEvent) - Method in interface javax.servlet.http.HttpSessionActivationListener
Notification that the session has just been activated.
SessionSynchronization - Interface in javax.ejb
The SessionSynchronization interface allows a session Bean instance to be notified by its container of transaction boundaries.
sessionWillPassivate(HttpSessionEvent) - Method in interface javax.servlet.http.HttpSessionActivationListener
Notification that the session is about to be passivated.
set(String, String) - Method in class javax.activation.MimeTypeParameterList
Set the value to be associated with the given name, replacing any previous association.
set(String, String) - Method in class javax.mail.internet.ParameterList
Set a parameter.
set(String, String, String) - Method in class javax.mail.internet.ParameterList
Set a parameter.
set - Variable in class javax.mail.search.FlagTerm
Indicates whether to test for the presence or absence of the specified Flag.
setAccept(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the accept property.
setAcceptcharset(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the acceptcharset property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the accesskey property.
setAccesskey(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the accesskey property.
setAccessURI(String) - Method in interface javax.xml.registry.infomodel.ServiceBinding
Sets the URI that gives access to the service via this binding.
setAction(MethodBinding) - Method in interface javax.faces.component.ActionSource
Deprecated. This has been replaced by ActionSource2.setActionExpression(javax.el.MethodExpression).
setAction(MethodBinding) - Method in class javax.faces.component.UICommand
Deprecated. This has been replaced by UICommand.setActionExpression(javax.el.MethodExpression).
setActionExpression(MethodExpression) - Method in interface javax.faces.component.ActionSource2
Set the MethodExpression pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.
setActionExpression(MethodExpression) - Method in class javax.faces.component.UICommand

setActionListener(ActionListener) - Method in class javax.faces.application.Application
Set the default ActionListener to be registered for all ActionSource components.
setActionListener(MethodBinding) - Method in interface javax.faces.component.ActionSource
Deprecated. This has been replaced by ActionSource.addActionListener(javax.faces.event.ActionListener).
setActionListener(MethodBinding) - Method in class javax.faces.component.UICommand
Deprecated. This has been replaced by UICommand.addActionListener(javax.faces.event.ActionListener).
setActor(String) - Method in interface javax.xml.soap.SOAPHeaderElement
Sets the actor associated with this SOAPHeaderElement object to the specified actor.
setAdapter(XmlAdapter) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

setAdapter(Class<A>, A) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

setAdapter(XmlAdapter) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

setAdapter(Class<A>, A) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

setAdapter(XmlAdapter) - Method in interface javax.xml.bind.Marshaller
Associates a configured instance of XmlAdapter with this marshaller.
setAdapter(Class<A>, A) - Method in interface javax.xml.bind.Marshaller
Associates a configured instance of XmlAdapter with this marshaller.
setAdapter(XmlAdapter) - Method in interface javax.xml.bind.Unmarshaller
Associates a configured instance of XmlAdapter with this unmarshaller.
setAdapter(Class<A>, A) - Method in interface javax.xml.bind.Unmarshaller
Associates a configured instance of XmlAdapter with this unmarshaller.
setAddress(String) - Method in class javax.mail.internet.InternetAddress
Set the email address.
setAddress(String) - Method in interface javax.xml.registry.infomodel.EmailAddress
Sets the email address for this object.
setAfterPhaseListener(MethodExpression) - Method in class javax.faces.component.UIViewRoot
Allow an arbitrary method to be called for the "afterPhase" event as the UIViewRoot runs through its lifecycle.
setAlt(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the alt property.
setAlt(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the alt property.
setAlt(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the alt property.
setAlt(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the alt property.
setApplication(Application) - Method in class javax.faces.application.ApplicationFactory
Replace the Application instance that will be returned for this web application.
setAreaCode(String) - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Sets the area code.
setAssociations(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Replaces all previous Associations from this object with specified Associations.
setAssociationType(Concept) - Method in interface javax.xml.registry.infomodel.Association
Sets the association type for this Association.
setAttachmentMarshaller(AttachmentMarshaller) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

setAttachmentMarshaller(AttachmentMarshaller) - Method in interface javax.xml.bind.Marshaller
Associate a context that enables binary data within an XML document to be transmitted as XML-binary optimized attachment.
setAttachmentUnmarshaller(AttachmentUnmarshaller) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

setAttachmentUnmarshaller(AttachmentUnmarshaller) - Method in interface javax.xml.bind.Unmarshaller
Associate a context that resolves cid's, content-id URIs, to binary data passed as attachments.
setAttribute(ObjectName, Attribute) - Method in interface javax.management.j2ee.Management
Sets the value of a specific attribute of a named managed object.
setAttribute(String, Object) - Method in interface javax.servlet.http.HttpSession
Binds an object to this session, using the name specified.
setAttribute(String, Object) - Method in class javax.servlet.jsp.JspContext
Register the name and value specified with page scope semantics.
setAttribute(String, Object, int) - Method in class javax.servlet.jsp.JspContext
Register the name and value specified with appropriate scope semantics.
setAttribute(String, Object) - Method in class javax.servlet.jsp.tagext.TagData
Set the value of an attribute.
setAttribute(String, Object) - Method in interface javax.servlet.ServletContext
Binds an object to a given attribute name in this servlet context.
setAttribute(String, Object) - Method in interface javax.servlet.ServletRequest
Stores an attribute in this request.
setAttribute(String, Object) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object.
setAttributes(ObjectName, AttributeList) - Method in interface javax.management.j2ee.Management
Sets the values of several attributes of a named managed object.
setAutocomplete(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the autocomplete property.
setAutocomplete(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the autocomplete property.
setBase64Content(InputStream, String) - Method in class javax.xml.soap.AttachmentPart
Sets the content of this attachment part from the Base64 source InputStream and sets the value of the Content-Type header to the value contained in contentType, This method would first decode the base64 input and write the resulting raw bytes to the attachment.
setBeforePhaseListener(MethodExpression) - Method in class javax.faces.component.UIViewRoot
Allow an arbitrary method to be called for the "beforePhase" event as the UIViewRoot runs through its lifecycle.
setBgcolor(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the bgcolor property.
setBgcolor(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the bgcolor property.
setBinding(String) - Method in class javax.faces.webapp.ConverterTag
Deprecated. Set the expression that will be used to create a ValueExpression that references a backing bean property of the Converter instance to be created.
setBinding(ValueExpression) - Method in class javax.faces.webapp.UIComponentELTag
Set the value expression for our component.
setBinding(String) - Method in class javax.faces.webapp.UIComponentTag
Deprecated. Set the value binding expression for our component.
setBinding(String) - Method in class javax.faces.webapp.ValidatorTag
Deprecated. Set the expression that will be used to create a ValueExpression that references a backing bean property of the Validator instance to be created.
setBodyContent(BodyContent) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Set the bodyContent for this tag handler.
setBodyContent(BodyContent) - Method in interface javax.servlet.jsp.tagext.BodyTag
Set the bodyContent property.
setBodyContent(BodyContent) - Method in class javax.servlet.jsp.tagext.BodyTagSupport
Prepare for evaluation of the body: stash the bodyContent away.
setBoolean(String, boolean) - Method in interface javax.jms.MapMessage
Sets a boolean value with the specified name into the Map.
setBooleanProperty(String, boolean) - Method in interface javax.jms.Message
Sets a boolean property value with the specified name into the message.
setBorder(int) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the border property.
setBorder(int) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the border property.
setBorder(int) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the border property.
setBorder(int) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the border property.
setBufferSize(int) - Method in interface javax.servlet.ServletResponse
Sets the preferred buffer size for the body of the response.
setBufferSize(int) - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object.
setBuilder(DocumentBuilder) - Method in class javax.xml.bind.annotation.W3CDomHandler

setByte(String, byte) - Method in interface javax.jms.MapMessage
Sets a byte value with the specified name into the Map.
setByteProperty(String, byte) - Method in interface javax.jms.Message
Sets a byte property value with the specified name into the message.
setBytes(String, byte[]) - Method in interface javax.jms.MapMessage
Sets a byte array value with the specified name into the Map.
setBytes(String, byte[], int, int) - Method in interface javax.jms.MapMessage
Sets a portion of the byte array value with the specified name into the Map.
setCalendar(Calendar) - Method in class javax.mail.internet.MailDateFormat
Don't allow setting the calendar
setCaptionClass(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the captionClass property.
setCaptionClass(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the captionClass property.
setCaptionStyle(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the captionStyle property.
setCaptionStyle(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the captionStyle property.
setCellpadding(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the cellpadding property.
setCellpadding(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the cellpadding property.
setCellspacing(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the cellspacing property.
setCellspacing(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the cellspacing property.
setChangeEvent(PropertyChangeEvent) - Method in class javax.enterprise.deploy.model.XpathEvent

setChar(String, char) - Method in interface javax.jms.MapMessage
Sets a Unicode character value with the specified name into the Map.
setCharacterEncoding(String) - Method in interface javax.servlet.ServletRequest
Overrides the name of the character encoding used in the body of this request.
setCharacterEncoding(String) - Method in class javax.servlet.ServletRequestWrapper
The default behavior of this method is to set the character encoding on the wrapped request object.
setCharacterEncoding(String) - Method in interface javax.servlet.ServletResponse
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.
setCharacterEncoding(String) - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object.
setCharset(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the charset property.
setCharset(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the charset property.
setCharsetName(String) - Method in interface javax.xml.registry.infomodel.LocalizedString
Set the canonical name for the charset for this object.
setCity(String) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets the city.
setClassifications(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Replaces all previous Classifications with specified Classifications.
setClassificationScheme(ClassificationScheme) - Method in interface javax.xml.registry.infomodel.Classification
Sets the ClassificationScheme for this external classification.
setClassifiedObject(RegistryObject) - Method in interface javax.xml.registry.infomodel.Classification
Sets the object that is being classified.
setClientID(String) - Method in interface javax.jms.Connection
Sets the client identifier for this connection.
setCols(int) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the cols property.
setColumnClasses(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the columnClasses property.
setColumnClasses(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the columnClasses property.
setColumnNumber(int) - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl
Set the columnNumber field on this event locator.
setColumns(int) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the columns property.
setCommandContext(String, DataHandler) - Method in interface javax.activation.CommandObject
Initialize the Command with the verb it is requested to handle and the DataHandler that describes the data it will operate on.
setCommandMap(CommandMap) - Method in class javax.activation.DataHandler
Set the CommandMap for use by this DataHandler.
setComment(String) - Method in class javax.servlet.http.Cookie
Specifies a comment that describes a cookie's purpose.
setConcept(Concept) - Method in interface javax.xml.registry.infomodel.Classification
Sets the concept for this internal classification.
setConnected(boolean) - Method in class javax.mail.Service
Set the connection state of this service.
setConnectionHandle(Object) - Method in class javax.resource.spi.ConnectionEvent
Set the connection handle.
setContent(Object, String) - Method in class javax.mail.internet.MimeBodyPart
A convenience method for setting this body part's content.
setContent(Multipart) - Method in class javax.mail.internet.MimeBodyPart
This method sets the body part's content to a Multipart object.
setContent(Object, String) - Method in class javax.mail.internet.MimeMessage
A convenience method for setting this Message's content.
setContent(Multipart) - Method in class javax.mail.internet.MimeMessage
This method sets the Message's content to a Multipart object.
setContent(Object, String) - Method in interface javax.mail.Part
A convenience method for setting this part's content.
setContent(Multipart) - Method in interface javax.mail.Part
This method sets the given Multipart object as this message's content.
setContent(Object, String) - Method in class javax.xml.soap.AttachmentPart
Sets the content of this attachment part to that of the given Object and sets the value of the Content-Type header to the given type.
setContent(Source) - Method in class javax.xml.soap.SOAPPart
Sets the content of the SOAPEnvelope object with the data from the given Source object.
setContentDescription(String) - Method in class javax.xml.soap.SOAPMessage
Sets the description of this SOAPMessage object's content with the given description.
setContentID(String) - Method in class javax.mail.internet.MimeBodyPart
Set the "Content-ID" header field of this body part.
setContentID(String) - Method in class javax.mail.internet.MimeMessage
Set the "Content-ID" header field of this Message.
setContentId(String) - Method in class javax.xml.soap.AttachmentPart
Sets the MIME header whose name is "Content-ID" with the given value.
setContentId(String) - Method in class javax.xml.soap.SOAPPart
Sets the value of the MIME header named "Content-Id" to the given String.
setContentLanguage(String[]) - Method in class javax.mail.internet.MimeBodyPart
Set the Content-Language header of this MimePart.
setContentLanguage(String[]) - Method in class javax.mail.internet.MimeMessage
Set the "Content-Language" header of this MimePart.
setContentLanguage(String[]) - Method in interface javax.mail.internet.MimePart
Set the Content-Language header of this MimePart.
setContentLength(int) - Method in interface javax.servlet.ServletResponse
Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header.
setContentLength(int) - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call setContentLength(int len) on the wrapped response object.
setContentLocation(String) - Method in class javax.xml.soap.AttachmentPart
Sets the MIME header whose name is "Content-Location" with the given value.
setContentLocation(String) - Method in class javax.xml.soap.SOAPPart
Sets the value of the MIME header "Content-Location" to the given String.
setContentMD5(String) - Method in class javax.mail.internet.MimeBodyPart
Set the "Content-MD5" header field of this body part.
setContentMD5(String) - Method in class javax.mail.internet.MimeMessage
Set the "Content-MD5" header field of this Message.
setContentMD5(String) - Method in interface javax.mail.internet.MimePart
Set the Content-MD5 of this part.
setContentType(String) - Method in interface javax.servlet.ServletResponse
Sets the content type of the response being sent to the client, if the response has not been committed yet.
setContentType(String) - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call setContentType(String type) on the wrapped response object.
setContentType(String) - Method in class javax.xml.soap.AttachmentPart
Sets the MIME header whose name is "Content-Type" with the given value.
setContextID(String) - Static method in class javax.security.jacc.PolicyContext
Authorization protected method used to modify the value of the policy context identifier associated with the thread on which this method is called.
setConverter(Converter) - Method in class javax.faces.component.UIOutput

setConverter(Converter) - Method in interface javax.faces.component.ValueHolder
Set the Converter (if any) that is registered for this UIComponent.
setConverterId(String) - Method in class javax.faces.webapp.ConverterTag
Deprecated. Set the identifer of the Converter instance to be created.
setConverterMessage(String) - Method in class javax.faces.component.UIInput
Override any ValueExpression set for the "converterMessage" with the literal argument provided to this method.
setCoords(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the coords property.
setCoords(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the coords property.
setCountry(String) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets the country.
setCountryCode(String) - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Sets country code.
setCredentials(Set) - Method in interface javax.xml.registry.Connection
Sets the Credentials associated with this client.
setCurrencyCode(String) - Method in class javax.faces.convert.NumberConverter
Set the ISO 4217 currency code used by getAsString() with a type of currency.
setCurrencySymbol(String) - Method in class javax.faces.convert.NumberConverter
Set the currency symbol used by getAsString() with a type of currency.
setCurrentInstance(FacesContext) - Static method in class javax.faces.context.FacesContext
Set the FacesContext instance for the request that is being processed by the current thread.
setDataContentHandlerFactory(DataContentHandlerFactory) - Static method in class javax.activation.DataHandler
Sets the DataContentHandlerFactory.
setDataHandler(DataHandler) - Method in class javax.mail.internet.MimeBodyPart
This method provides the mechanism to set this body part's content.
setDataHandler(DataHandler) - Method in class javax.mail.internet.MimeMessage
This method provides the mechanism to set this part's content.
setDataHandler(DataHandler) - Method in interface javax.mail.Part
This method provides the mechanism to set this part's content.
setDataHandler(DataHandler) - Method in class javax.xml.soap.AttachmentPart
Sets the given DataHandler object as the data handler for this AttachmentPart object.
setDataModel(DataModel) - Method in class javax.faces.component.UIData
Set the internal DataModel.
setDatatypeConverter(DatatypeConverterInterface) - Static method in class javax.xml.bind.DatatypeConverter
This method is for JAXB provider use only.
setDateHeader(String, long) - Method in interface javax.servlet.http.HttpServletResponse
Sets a response header with the given name and date-value.
setDateHeader(String, long) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call setDateHeader(String name, long date) on the wrapped response object.
setDateStyle(String) - Method in class javax.faces.convert.DateTimeConverter
Set the style to be used to format or parse dates.
setDConfigBeanVersion(DConfigBeanVersionType) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Set the configuration beans to be used to the J2EE platform version specificed.
setDebug(boolean) - Method in class javax.mail.Session
Set the debug setting for this Session.
setDebugOut(PrintStream) - Method in class javax.mail.Session
Set the stream to be used for debugging output for this session.
setDefaultCommandMap(CommandMap) - Static method in class javax.activation.CommandMap
Set the default CommandMap.
setDefaultFactory(JspFactory) - Static method in class javax.servlet.jsp.JspFactory
set the default factory for this implementation.
setDefaultFileTypeMap(FileTypeMap) - Static method in class javax.activation.FileTypeMap
Sets the default FileTypeMap for the system.
setDefaultLocale(Locale) - Method in class javax.faces.application.Application
Set the default Locale for this application.
setDefaultNamespace(String) - Method in interface javax.xml.stream.XMLEventWriter
Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair.
setDefaultNamespace(String) - Method in interface javax.xml.stream.XMLStreamWriter
Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair.
setDefaultRenderKitId(String) - Method in class javax.faces.application.Application
Set the renderKitId to be used to render this application.
setDeliveryMode(int) - Method in interface javax.jms.MessageProducer
Sets the producer's default delivery mode.
setDescription(String) - Method in class javax.faces.model.SelectItem
Set the description of this item, for use in development tools.
setDescription(String) - Method in class javax.mail.internet.MimeBodyPart
Set the "Content-Description" header field for this body part.
setDescription(String, String) - Method in class javax.mail.internet.MimeBodyPart
Set the "Content-Description" header field for this body part.
setDescription(String) - Method in class javax.mail.internet.MimeMessage
Set the "Content-Description" header field for this Message.
setDescription(String, String) - Method in class javax.mail.internet.MimeMessage
Set the "Content-Description" header field for this Message.
setDescription(String) - Method in interface javax.mail.Part
Set a description String for this part.
setDescription(InternationalString) - Method in interface javax.xml.registry.infomodel.RegistryObject
Sets the context independent textual description for this object.
setDetail(String) - Method in class javax.faces.application.FacesMessage
Set the localized detail text.
setDir(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlOutputFormat
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlOutputText
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the dir property.
setDir(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the dir property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the disabled property.
setDisabled(boolean) - Method in class javax.faces.model.SelectItem
Set the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.
setDisabledClass(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the disabledClass property.
setDisabledClass(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the disabledClass property.
setDisabledClass(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the disabledClass property.
setDisabledClass(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the disabledClass property.
setDisabledClass(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the disabledClass property.
setDisabledClass(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the disabledClass property.
setDisableMessageID(boolean) - Method in interface javax.jms.MessageProducer
Sets whether message IDs are disabled.
setDisableMessageTimestamp(boolean) - Method in interface javax.jms.MessageProducer
Sets whether message timestamps are disabled.
setDisposition(String) - Method in class javax.mail.internet.ContentDisposition
Set the disposition.
setDisposition(String) - Method in class javax.mail.internet.MimeBodyPart
Set the "Content-Disposition" header field of this body part.
setDisposition(String) - Method in class javax.mail.internet.MimeMessage
Set the "Content-Disposition" header field of this Message.
setDisposition(String) - Method in interface javax.mail.Part
Set the disposition of this part.
setDomain(String) - Method in class javax.servlet.http.Cookie
Specifies the domain within which this cookie should be presented.
setDouble(String, double) - Method in interface javax.jms.MapMessage
Sets a double value with the specified name into the Map.
setDoubleProperty(String, double) - Method in interface javax.jms.Message
Sets a double property value with the specified name into the message.
setDynamicAttribute(String, String, Object) - Method in interface javax.servlet.jsp.tagext.DynamicAttributes
Called when a tag declared to accept dynamic attributes is passed an attribute that is not declared in the Tag Library Descriptor.
setElementQName(QName) - Method in interface javax.xml.soap.SOAPElement
Changes the name of this Element to newName if possible.
setEmailAddresses(Collection) - Method in interface javax.xml.registry.infomodel.User
Sets the Collection of EmailAddress instances for this User.
setEnabledClass(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the enabledClass property.
setEnabledClass(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the enabledClass property.
setEnabledClass(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the enabledClass property.
setEnabledClass(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the enabledClass property.
setEnabledClass(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the enabledClass property.
setEnabledClass(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the enabledClass property.
setEncoding(String) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for setting the output encoding.
setEncodingStyle(String) - Method in interface javax.xml.soap.SOAPElement
Sets the encoding style for this SOAPElement object to one specified.
setEnctype(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the enctype property.
setEntityContext(EntityContext) - Method in interface javax.ejb.EntityBean
Set the associated entity context.
setErrorClass(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the errorClass property.
setErrorClass(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the errorClass property.
setErrorCode(String) - Method in exception javax.resource.ResourceException
Set the error code.
setErrorObjectKey(Key) - Method in exception javax.xml.registry.RegistryException
Sets the Key to the first object that encountered an error in the registry.
setErrorStyle(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the errorStyle property.
setErrorStyle(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the errorStyle property.
setEscape(boolean) - Method in class javax.faces.component.html.HtmlOutputFormat
Set the value of the escape property.
setEscape(boolean) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the escape property.
setEscape(boolean) - Method in class javax.faces.component.html.HtmlOutputText
Set the value of the escape property.
setEscape(boolean) - Method in class javax.faces.model.SelectItem
Setter for property escape.
setEventAllocator(XMLEventAllocator) - Method in class javax.xml.stream.XMLInputFactory
Set a user defined event allocator for events
setEventHandler(ValidationEventHandler) - Method in class javax.xml.bind.Binder
Allow an application to register a ValidationEventHandler.
setEventHandler(ValidationEventHandler) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

setEventHandler(ValidationEventHandler) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Allow an application to register a validation event handler.
setEventHandler(ValidationEventHandler) - Method in interface javax.xml.bind.Marshaller
Allow an application to register a validation event handler.
setEventHandler(ValidationEventHandler) - Method in interface javax.xml.bind.Unmarshaller
Allow an application to register a ValidationEventHandler.
setEventHandler(ValidationEventHandler) - Method in interface javax.xml.bind.Validator
Deprecated. since JAXB2.0
setExceptionListener(ExceptionListener) - Method in interface javax.jms.Connection
Sets an exception listener for this connection.
setExecutor(Executor) - Method in class javax.xml.ws.Endpoint
Sets the executor for this Endpoint instance.
setExecutor(Executor) - Method in class javax.xml.ws.Service
Sets the executor for this Service instance.
setExecutor(Executor) - Method in class javax.xml.ws.spi.ServiceDelegate
Sets the executor for this Service instance.
setExpiration(Date) - Method in interface javax.xml.registry.infomodel.RegistryEntry
Sets the expirationDate.
setExpunged(boolean) - Method in class javax.mail.Message
Sets the expunged flag for this Message.
setExtension(String) - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Sets the internal extension.
setExternalIdentifiers(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Replaces all previous external identifiers with specified Collection of ExternalIdentifiers as an external identifier.
setExternalLinks(Collection) - Method in interface javax.xml.registry.infomodel.RegistryObject
Replaces all previous ExternalLinks with specified ExternalLinks.
setExternalURI(String) - Method in interface javax.xml.registry.infomodel.ExternalLink
Sets URI for an external resource.
setFactory(String, String) - Static method in class javax.faces.FactoryFinder
This method will store the argument factoryName/implName mapping in such a way that FactoryFinder.getFactory(java.lang.String) will find this mapping when searching for a match.
setFatalClass(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the fatalClass property.
setFatalClass(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the fatalClass property.
setFatalStyle(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the fatalStyle property.
setFatalStyle(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the fatalStyle property.
setFaultActor(String) - Method in interface javax.xml.soap.SOAPFault
Sets this SOAPFault object with the given fault actor.
setFaultCode(Name) - Method in interface javax.xml.soap.SOAPFault
Sets this SOAPFault object with the given fault code.
setFaultCode(QName) - Method in interface javax.xml.soap.SOAPFault
Sets this SOAPFault object with the given fault code.
setFaultCode(String) - Method in interface javax.xml.soap.SOAPFault
Sets this SOAPFault object with the give fault code.
setFaultNode(String) - Method in interface javax.xml.soap.SOAPFault
Creates or replaces any existing Node element value for this SOAPFault object.
setFaultRole(String) - Method in interface javax.xml.soap.SOAPFault
Creates or replaces any existing Role element value for this SOAPFault object.
setFaultString(String) - Method in interface javax.xml.soap.SOAPFault
Sets the fault string for this SOAPFault object to the given string.
setFaultString(String, Locale) - Method in interface javax.xml.soap.SOAPFault
Sets the fault string for this SOAPFault object to the given string and localized to the given locale.
setFileName(String) - Method in class javax.mail.internet.MimeBodyPart
Set the filename associated with this body part, if possible.
setFileName(String) - Method in class javax.mail.internet.MimeMessage
Set the filename associated with this part, if possible.
setFileName(String) - Method in interface javax.mail.Part
Set the filename associated with this part, if possible.
setFileTypeMap(FileTypeMap) - Method in class javax.activation.FileDataSource
Set the FileTypeMap to use with this FileDataSource
setFirst(int) - Method in class javax.faces.component.UIData
Set the zero-relative row number of the first row to be displayed.
setFirstName(String) - Method in interface javax.xml.registry.infomodel.PersonName
Sets the first name for this Person.
setFirstResult(int) - Method in interface javax.persistence.Query
Set the position of the first result to retrieve.
setFlag(Flags.Flag, boolean) - Method in class javax.mail.Message
Set the specified flag on this message to the specified value.
setFlags(Message[], Flags, boolean) - Method in class javax.mail.Folder
Set the specified flags on the messages specified in the array.
setFlags(int, int, Flags, boolean) - Method in class javax.mail.Folder
Set the specified flags on the messages numbered from start through end, both start and end inclusive.
setFlags(int[], Flags, boolean) - Method in class javax.mail.Folder
Set the specified flags on the messages whose message numbers are in the array.
setFlags(Flags, boolean) - Method in class javax.mail.internet.MimeMessage
Set the flags for this message.
setFlags(Flags, boolean) - Method in class javax.mail.Message
Set the specified flags on this message to the specified value.
setFloat(String, float) - Method in interface javax.jms.MapMessage
Sets a float value with the specified name into the Map.
setFloatProperty(String, float) - Method in interface javax.jms.Message
Sets a float property value with the specified name into the message.
setFlushMode(FlushModeType) - Method in interface javax.persistence.EntityManager
Set the flush mode that applies to all objects contained in the persistence context.
setFlushMode(FlushModeType) - Method in interface javax.persistence.Query
Set the flush mode type to be used for the query execution.
setFooter(UIComponent) - Method in class javax.faces.component.UIColumn
Set the footer facet of the column.
setFooter(UIComponent) - Method in class javax.faces.component.UIData
Set the footer facet of this component.
setFooterClass(String) - Method in class javax.faces.component.html.HtmlColumn
Set the value of the footerClass property.
setFooterClass(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the footerClass property.
setFooterClass(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the footerClass property.
setFor(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the for property.
setFor(String) - Method in class javax.faces.component.UIMessage
Set the client identifier of the component for which this component represents associated message(s) (if any).
setFormattedOutput(boolean) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for setting the formatted output flag.
setFragment(boolean) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for setting the fragment flag.
setFrame(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the frame property.
setFrame(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the frame property.
setFrom(Address) - Method in class javax.mail.internet.MimeMessage
Set the RFC 822 "From" header field.
setFrom() - Method in class javax.mail.internet.MimeMessage
Set the RFC 822 "From" header field using the value of the InternetAddress.getLocalAddress method.
setFrom() - Method in class javax.mail.Message
Set the "From" attribute in this Message.
setFrom(Address) - Method in class javax.mail.Message
Set the "From" attribute in this Message.
setFullName(String) - Method in interface javax.xml.registry.infomodel.PersonName
Sets the fully formatted name for this person.
setGlobalOnly(boolean) - Method in class javax.faces.component.UIMessages
Set the flag indicating whether only global messages (that is, messages with no associated client identifier) should be rendered.
setGroupingUsed(boolean) - Method in class javax.faces.convert.NumberConverter
Set the flag indicating whether getAsString() should include grouping separators if necessary.
setHandlerChain(QName, List) - Method in interface javax.xml.rpc.handler.HandlerRegistry
Sets the handler chain for the specified service endpoint as a java.util.List.
setHandlerChain(List<Handler>) - Method in interface javax.xml.ws.Binding
Sets the handler chain for the protocol binding instance.
setHandlerClass(Class) - Method in class javax.xml.rpc.handler.HandlerInfo
Sets the Handler class
setHandlerConfig(Map) - Method in class javax.xml.rpc.handler.HandlerInfo
Sets the Handler configuration as java.util.Map
setHandlerData(Object) - Static method in class javax.security.jacc.PolicyContext
Authorization protected method that may be used to associate a thread-scoped handler data object with the PolicyContext.
setHandlerResolver(HandlerResolver) - Method in class javax.xml.ws.Service
Sets the HandlerResolver for this Service instance.
setHandlerResolver(HandlerResolver) - Method in class javax.xml.ws.spi.ServiceDelegate
Sets the HandlerResolver for this Service instance.
setHeader(UIComponent) - Method in class javax.faces.component.UIColumn
Set the header facet of the column.
setHeader(UIComponent) - Method in class javax.faces.component.UIData
Set the header facet of this component.
setHeader(String, String) - Method in class javax.mail.internet.InternetHeaders
Change the first header line that matches name to have value, adding a new header if no existing header matches.
setHeader(String, String) - Method in class javax.mail.internet.MimeBodyPart
Set the value for this header_name.
setHeader(String, String) - Method in class javax.mail.internet.MimeMessage
Set the value for this header_name.
setHeader(String, String) - Method in interface javax.mail.Part
Set the value for this header_name.
setHeader(String, String) - Method in interface javax.servlet.http.HttpServletResponse
Sets a response header with the given name and value.
setHeader(String, String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.
setHeader(String, String) - Method in class javax.xml.soap.MimeHeaders
Replaces the current value of the first header entry whose name matches the given name with the given value, adding a new header if no existing header name matches.
setHeaderClass(String) - Method in class javax.faces.component.html.HtmlColumn
Set the value of the headerClass property.
setHeaderClass(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the headerClass property.
setHeaderClass(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the headerClass property.
setHeaders(QName[]) - Method in class javax.xml.rpc.handler.HandlerInfo
Sets the header blocks processed by this Handler.
setHeight(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the height property.
setHint(String, Object) - Method in interface javax.persistence.Query
Set an implementation-specific hint.
setHost(String) - Method in class javax.mail.internet.NewsAddress
Set the host.
setHreflang(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the hreflang property.
setHreflang(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the hreflang property.
setHumanPresentableName(String) - Method in class javax.activation.ActivationDataFlavor
Set the human presentable name.
setId(String) - Method in class javax.faces.component.UIComponent
Set the component identifier of this UIComponent (if any).
setId(String) - Method in class javax.faces.component.UIComponentBase

setId(String) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Set the component identifier for our component.
setId(String) - Method in class javax.faces.webapp.UIComponentTagBase
Set the component identifier for the component corresponding to this tag instance.
setId(String) - Method in class javax.servlet.jsp.tagext.TagSupport
Set the id attribute for this tag.
setId(String) - Method in interface javax.xml.registry.infomodel.Key
Sets the unique id associated with this key.
setIdentificationScheme(ClassificationScheme) - Method in interface javax.xml.registry.infomodel.ExternalIdentifier
Sets the ClassificationScheme that is used as the identification scheme for identifying this object.
setImage(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the image property.
setImmediate(boolean) - Method in interface javax.faces.component.ActionSource
Set the "immediate execution" flag for this UIComponent.
setImmediate(boolean) - Method in interface javax.faces.component.EditableValueHolder
Set the "immediate" state for this component.
setImmediate(boolean) - Method in class javax.faces.component.UICommand

setImmediate(boolean) - Method in class javax.faces.component.UIInput

setInfoClass(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the infoClass property.
setInfoClass(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the infoClass property.
setInfoStyle(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the infoStyle property.
setInfoStyle(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the infoStyle property.
setInitParameters(Map<String, Object>) - Method in class javax.servlet.jsp.tagext.TagLibraryValidator
Set the init data in the TLD for this validator.
setInt(String, int) - Method in interface javax.jms.MapMessage
Sets an int value with the specified name into the Map.
setIntegerOnly(boolean) - Method in class javax.faces.convert.NumberConverter
Set to true if only the integer portion of the given value should be returned from getAsObject().
setIntHeader(String, int) - Method in interface javax.servlet.http.HttpServletResponse
Sets a response header with the given name and integer value.
setIntHeader(String, int) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.
setIntProperty(String, int) - Method in interface javax.jms.Message
Sets an int property value with the specified name into the message.
setInvalidPropertyDescriptors(PropertyDescriptor[]) - Method in exception javax.resource.spi.InvalidPropertyException
Set a list of invalid properties.
setIsmap(boolean) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the ismap property.
setItemDescription(String) - Method in class javax.faces.component.UISelectItem
Set the description for this selection item.
setItemDisabled(boolean) - Method in class javax.faces.component.UISelectItem
Set the disabled value for this selection item.
setItemEscaped(boolean) - Method in class javax.faces.component.UISelectItem
Set the escape value for the label of this selection item.
setItemLabel(String) - Method in class javax.faces.component.UISelectItem
Set the localized label for this selection item.
setItemValue(Object) - Method in class javax.faces.component.UISelectItem
Set the server value for this selection item.
setJMSCorrelationID(String) - Method in interface javax.jms.Message
Sets the correlation ID for the message.
setJMSCorrelationIDAsBytes(byte[]) - Method in interface javax.jms.Message
Sets the correlation ID as an array of bytes for the message.
setJMSDeliveryMode(int) - Method in interface javax.jms.Message
Sets the DeliveryMode value for this message.
setJMSDestination(Destination) - Method in interface javax.jms.Message
Sets the Destination object for this message.
setJMSExpiration(long) - Method in interface javax.jms.Message
Sets the message's expiration value.
setJMSMessageID(String) - Method in interface javax.jms.Message
Sets the message ID.
setJMSPriority(int) - Method in interface javax.jms.Message
Sets the priority level for this message.
setJMSRedelivered(boolean) - Method in interface javax.jms.Message
Specifies whether this message is being redelivered.
setJMSReplyTo(Destination) - Method in interface javax.jms.Message
Sets the Destination object to which a reply to this message should be sent.
setJMSTimestamp(long) - Method in interface javax.jms.Message
Sets the message timestamp.
setJMSType(String) - Method in interface javax.jms.Message
Sets the message type.
setJspBody(JspFragment) - Method in interface javax.servlet.jsp.tagext.SimpleTag
Provides the body of this tag as a JspFragment object, able to be invoked zero or more times by the tag handler.
setJspBody(JspFragment) - Method in class javax.servlet.jsp.tagext.SimpleTagSupport
Stores the provided JspFragment.
setJspContext(JspContext) - Method in interface javax.servlet.jsp.tagext.SimpleTag
Called by the container to provide this tag handler with the JspContext for this invocation.
setJspContext(JspContext) - Method in class javax.servlet.jsp.tagext.SimpleTagSupport
Stores the provided JSP context in the private jspContext field.
setJspId(String) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Defined on JspIdConsumer.
setJspId(String) - Method in interface javax.servlet.jsp.tagext.JspIdConsumer
Called by the container generated code to set a value for the jspId attribute.
setKey(Key) - Method in interface javax.xml.registry.infomodel.RegistryObject
Sets the key representing the universally unique ID (UUID) for this object.
setLabel(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the label property.
setLabel(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the label property.
setLabel(String) - Method in class javax.faces.model.SelectItem
Set the label of this item, to be rendered visibly for the user.
setLang(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlOutputFormat
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlOutputText
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the lang property.
setLang(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the lang property.
setLastName(String) - Method in interface javax.xml.registry.infomodel.PersonName
Sets the last name (surname) for this Person.
setLayout(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the layout property.
setLayout(String) - Method in class javax.faces.component.html.HtmlPanelGroup
Set the value of the layout property.
setLayout(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the layout property.
setLayout(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the layout property.
setLineNumber(int) - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl
Set the lineNumber field on this event locator.
setLinkedException(Exception) - Method in exception javax.jms.JMSException
Adds a linked Exception.
setLinkedException(Exception) - Method in exception javax.resource.ResourceException
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
setLinkedException(Throwable) - Method in class javax.xml.bind.helpers.ValidationEventImpl
Set the linked exception field of this event.
setLinkedException(Throwable) - Method in exception javax.xml.bind.JAXBException
Add a linked Exception.
setLinkedException(Throwable) - Method in exception javax.xml.bind.TypeConstraintException
Add a linked Exception.
setLinkedWarning(ResourceWarning) - Method in exception javax.resource.cci.ResourceWarning
Deprecated. J2SE release 1.4 supports a chained exception facility that allows any throwable to know about another throwable, if any, that caused it to get thrown. Refer to getCause and initCause methods of the java.lang.Throwable class.
setListener(Marshaller.Listener) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

setListener(Unmarshaller.Listener) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

setListener(Marshaller.Listener) - Method in interface javax.xml.bind.Marshaller
Register marshal event callback Marshaller.Listener with this Marshaller.
setListener(Unmarshaller.Listener) - Method in interface javax.xml.bind.Unmarshaller
Register unmarshal event callback Unmarshaller.Listener with this Unmarshaller.
setLocale(Locale) - Method in class javax.el.ELContext
Set the Locale for this instance.
setLocale(Locale) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Set the active locale for this implementation of javax.enterprise.deploy.spi subpackages to run.
setLocale(Locale) - Method in class javax.faces.component.UIViewRoot
Set the Locale to be used in localizing the response being created for this view.
setLocale(Locale) - Method in class javax.faces.convert.DateTimeConverter
Set the Locale to be used when parsing or formatting dates and times.
setLocale(Locale) - Method in class javax.faces.convert.NumberConverter
Set the Locale to be used when parsing numbers.
setLocale(Locale) - Method in interface javax.servlet.ServletResponse
Sets the locale of the response, if the response has not been committed yet.
setLocale(Locale) - Method in class javax.servlet.ServletResponseWrapper
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object.
setLocale(Locale) - Method in interface javax.xml.registry.infomodel.LocalizedString
Set the Locale for this object.
setLocalValueSet(boolean) - Method in interface javax.faces.component.EditableValueHolder
Sets the "local value set" state for this component.
setLocalValueSet(boolean) - Method in class javax.faces.component.UIInput
Sets the "local value set" state for this component.
setLocation(Location) - Method in class javax.xml.stream.XMLEventFactory
This method allows setting of the Location on each event that is created by this factory.
setLocator(ValidationEventLocator) - Method in class javax.xml.bind.helpers.ValidationEventImpl
Set the locator object for this event.
setLogWriter(PrintWriter) - Method in interface javax.resource.spi.ManagedConnection
Sets the log writer for this ManagedConnection instance.
setLogWriter(PrintWriter) - Method in interface javax.resource.spi.ManagedConnectionFactory
Set the log writer for this ManagedConnectionFactory instance.
setLong(String, long) - Method in interface javax.jms.MapMessage
Sets a long value with the specified name into the Map.
setLongdesc(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the longdesc property.
setLongProperty(String, long) - Method in interface javax.jms.Message
Sets a long property value with the specified name into the message.
setMajorVersion(int) - Method in interface javax.xml.registry.infomodel.Versionable
Sets the major revision number for this version of the Versionable object.
setManagedConnectionFactory(ManagedConnectionFactory) - Method in class javax.resource.spi.security.PasswordCredential
Sets the target ManagedConenctionFactory instance for which the user name and password has been set by the application server.
setMaxAge(int) - Method in class javax.servlet.http.Cookie
Sets the maximum age of the cookie in seconds.
setMaxFractionDigits(int) - Method in class javax.faces.convert.NumberConverter
Set the maximum number of digits getAsString() should render in the fraction portion of the result.
setMaximum(double) - Method in class javax.faces.validator.DoubleRangeValidator
Set the maximum value to be enforced by this Validator.
setMaximum(int) - Method in class javax.faces.validator.LengthValidator
Set the maximum length to be enforced by this Validator.
setMaximum(long) - Method in class javax.faces.validator.LongRangeValidator
Set the maximum value to be enforced by this Validator.
setMaxInactiveInterval(int) - Method in interface javax.servlet.http.HttpSession
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.
setMaxIntegerDigits(int) - Method in class javax.faces.convert.NumberConverter
Set the maximum number of digits getAsString() should render in the integer portion of the result.
setMaxlength(int) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the maxlength property.
setMaxlength(int) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the maxlength property.
setMaxResults(int) - Method in interface javax.persistence.Query
Set the maximum number of results to retrieve.
setMessage(String) - Method in class javax.xml.bind.helpers.ValidationEventImpl
Set the message field of this event.
setMessage(SOAPMessage) - Method in interface javax.xml.rpc.handler.soap.SOAPMessageContext
Sets the SOAPMessage in this message context
setMessage(SOAPMessage) - Method in interface javax.xml.ws.handler.soap.SOAPMessageContext
Sets the SOAPMessage in this message context
setMessageBundle(String) - Method in class javax.faces.application.Application
Set the fully qualified class name of the ResourceBundle to be used for JavaServer Faces messages for this application.
setMessageDrivenContext(MessageDrivenContext) - Method in interface javax.ejb.MessageDrivenBean
Set the associated message-driven context.
setMessageListener(MessageListener) - Method in interface javax.jms.MessageConsumer
Sets the message consumer's MessageListener.
setMessageListener(MessageListener) - Method in interface javax.jms.Session
Sets the session's distinguished message listener (optional).
setMessageNumber(int) - Method in class javax.mail.Message
Set the Message number for this Message.
setMetadata(List<Source>) - Method in class javax.xml.ws.Endpoint
Sets the metadata for this endpoint.
setMiddleName(String) - Method in interface javax.xml.registry.infomodel.PersonName
Sets the middle name for this Person.
setMimeHeader(String, String) - Method in class javax.xml.soap.AttachmentPart
Changes the first header entry that matches the given name to the given value, adding a new header if no existing header matches.
setMimeHeader(String, String) - Method in class javax.xml.soap.SOAPPart
Changes the first header entry that matches the given header name so that its value is the given value, adding a new header with the given name and value if no existing header is a match.
setMimeType(String) - Method in interface javax.xml.registry.infomodel.ExtrinsicObject
Sets the mime type associated with this object.
setMinFractionDigits(int) - Method in class javax.faces.convert.NumberConverter
Set the minimum number of digits getAsString() should render in the fraction portion of the result.
setMinimum(double) - Method in class javax.faces.validator.DoubleRangeValidator
Set the minimum value to be enforced by this Validator.
setMinimum(int) - Method in class javax.faces.validator.LengthValidator
Set the minimum length to be enforced by this Validator.
setMinimum(long) - Method in class javax.faces.validator.LongRangeValidator
Set the minimum value to be enforced by this Validator.
setMinIntegerDigits(int) - Method in class javax.faces.convert.NumberConverter
Set the minimum number of digits getAsString() should render in the integer portion of the result.
setMinorVersion(int) - Method in interface javax.xml.registry.infomodel.Versionable
Sets the minor revision number for this version of the Versionable object.
setMTOMEnabled(boolean) - Method in interface javax.xml.ws.soap.SOAPBinding
Enables or disables use of MTOM.
setMultipartDataSource(MultipartDataSource) - Method in class javax.mail.Multipart
Setup this Multipart object from the given MultipartDataSource.
setMustUnderstand(boolean) - Method in interface javax.xml.soap.SOAPHeaderElement
Sets the mustUnderstand attribute for this SOAPHeaderElement object to be either true or false.
setName(String) - Method in class javax.faces.component.UIParameter
Set the optional parameter name for this parameter.
setName(String) - Method in class javax.faces.webapp.AttributeTag
Deprecated. Set the attribute name.
setName(String) - Method in class javax.faces.webapp.FacetTag
Set the name to be assigned to this facet.
setName(String) - Method in class javax.mail.util.ByteArrayDataSource
Set the name of the data.
setName(InternationalString) - Method in interface javax.xml.registry.infomodel.RegistryObject
Sets user-friendly name of object in repository.
setName(String) - Method in interface javax.xml.registry.infomodel.Slot
Sets the name for this Slot.
setNamespaceContext(NamespaceContext) - Method in interface javax.xml.stream.XMLEventWriter
Sets the current namespace context for prefix and uri bindings.
setNamespaceContext(NamespaceContext) - Method in interface javax.xml.stream.XMLStreamWriter
Sets the current namespace context for prefix and uri bindings.
setNavigationHandler(NavigationHandler) - Method in class javax.faces.application.Application
Set the NavigationHandler instance that will be passed the outcome returned by any invoked application action for this web application.
setNewsgroup(String) - Method in class javax.mail.internet.NewsAddress
Set the newsgroup.
setNextException(Exception) - Method in exception javax.mail.MessagingException
Add an exception to the end of the chain.
setNil(boolean) - Method in class javax.xml.bind.JAXBElement
Set whether this element has nil content.
setNode(Node) - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl
Set the Node field on this event locator.
setNoNSSchemaLocation(String) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for setting the noNamespaceSchemaLocation.
setNumber(String) - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Sets the telephone number suffix, not including the country or area code.
setNumberFormat(NumberFormat) - Method in class javax.mail.internet.MailDateFormat
Don't allow setting the NumberFormat
setObject(String, Object) - Method in interface javax.jms.MapMessage
Sets an object value with the specified name into the Map.
setObject(Serializable) - Method in interface javax.jms.ObjectMessage
Sets the serializable object containing this message's data.
setObject(Object) - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl
Set the Object field on this event locator.
setObjectProperty(String, Object) - Method in interface javax.jms.Message
Sets a Java object property value with the specified name into the message.
setOffset(int) - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl
Set the offset field on this event locator.
setOnblur(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onblur property.
setOnblur(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onblur property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onchange property.
setOnchange(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onchange property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onclick property.
setOnclick(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the ondblclick property.
setOndblclick(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the ondblclick property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onfocus property.
setOnfocus(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onfocus property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onkeydown property.
setOnkeydown(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onkeydown property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onkeypress property.
setOnkeypress(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onkeypress property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onkeyup property.
setOnkeyup(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onkeyup property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onmousedown property.
setOnmousedown(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onmousedown property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onmousemove property.
setOnmousemove(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onmousemove property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onmouseout property.
setOnmouseout(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onmouseout property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onmouseover property.
setOnmouseover(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onmouseover property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onmouseup property.
setOnmouseup(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onmouseup property.
setOnreset(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onreset property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the onselect property.
setOnselect(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the onselect property.
setOnsubmit(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the onsubmit property.
setOpaque(boolean) - Method in interface javax.xml.registry.infomodel.ExtrinsicObject
Sets whether the ExtrinsicObject is opaque (not readable) by the registry.
setOperationName(QName) - Method in interface javax.xml.rpc.Call
Sets the name of the operation to be invoked using this Call instance.
setPageContext(PageContext) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Set the PageContext of the page containing this tag instance.
setPageContext(PageContext) - Method in interface javax.servlet.jsp.tagext.Tag
Set the current page context.
setPageContext(PageContext) - Method in class javax.servlet.jsp.tagext.TagAdapter
Must not be called.
setPageContext(PageContext) - Method in class javax.servlet.jsp.tagext.TagSupport
Set the page context.
setParameter(String, String) - Method in class javax.activation.MimeType
Set the value to be associated with the given name, replacing any previous association.
setParameter(String, String) - Method in class javax.mail.internet.ContentDisposition
Set the specified parameter.
setParameter(String, String) - Method in class javax.mail.internet.ContentType
Set the specified parameter.
setParameter(String, Object) - Method in interface javax.persistence.Query
Bind an argument to a named parameter.
setParameter(String, Date, TemporalType) - Method in interface javax.persistence.Query
Bind an instance of java.util.Date to a named parameter.
setParameter(String, Calendar, TemporalType) - Method in interface javax.persistence.Query
Bind an instance of java.util.Calendar to a named parameter.
setParameter(int, Object) - Method in interface javax.persistence.Query
Bind an argument to a positional parameter.
setParameter(int, Date, TemporalType) - Method in interface javax.persistence.Query
Bind an instance of java.util.Date to a positional parameter.
setParameter(int, Calendar, TemporalType) - Method in interface javax.persistence.Query
Bind an instance of java.util.Calendar to a positional parameter.
setParameterList(ParameterList) - Method in class javax.mail.internet.ContentDisposition
Set a new ParameterList.
setParameterList(ParameterList) - Method in class javax.mail.internet.ContentType
Set a new ParameterList.
setParameters(Object[]) - Method in interface javax.interceptor.InvocationContext
Sets the parameters that will be used to invoke the business method.
setParent(UIComponent) - Method in class javax.faces.component.UIComponent
Set the parent UIComponent of this UIComponent.
setParent(UIComponent) - Method in class javax.faces.component.UIComponentBase

setParent(Tag) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Set the Tag that is the parent of this instance.
setParent(Part) - Method in class javax.mail.Multipart
Set the parent of this Multipart to be the specified Part.
setParent(JspTag) - Method in interface javax.servlet.jsp.tagext.SimpleTag
Sets the parent of this tag, for collaboration purposes.
setParent(JspTag) - Method in class javax.servlet.jsp.tagext.SimpleTagSupport
Sets the parent of this tag, for collaboration purposes.
setParent(Tag) - Method in interface javax.servlet.jsp.tagext.Tag
Set the parent (closest enclosing tag handler) of this tag handler.
setParent(Tag) - Method in class javax.servlet.jsp.tagext.TagAdapter
Must not be called.
setParent(Tag) - Method in class javax.servlet.jsp.tagext.TagSupport
Set the nesting tag of this tag.
setParent(XMLEventReader) - Method in class javax.xml.stream.util.EventReaderDelegate
Set the parent of this instance.
setParent(XMLStreamReader) - Method in class javax.xml.stream.util.StreamReaderDelegate
Set the parent of this instance.
setParentElement(SOAPElement) - Method in interface javax.xml.soap.Node
Sets the parent of this Node object to the given SOAPElement object.
setPasswordAuthentication(URLName, PasswordAuthentication) - Method in class javax.mail.Session
Save a PasswordAuthentication for this (store or transport) URLName.
setPath(String) - Method in class javax.servlet.http.Cookie
Specifies a path for the cookie to which the client should return the cookie.
setPattern(String) - Method in class javax.faces.convert.DateTimeConverter
Set the format pattern to be used when formatting and parsing dates and times.
setPattern(String) - Method in class javax.faces.convert.NumberConverter
Set the format pattern to be used when formatting and parsing numbers.
setPayload(Source) - Method in interface javax.xml.ws.LogicalMessage
Sets the message payload
setPayload(Object, JAXBContext) - Method in interface javax.xml.ws.LogicalMessage
Sets the message payload
setPersonal(String, String) - Method in class javax.mail.internet.InternetAddress
Set the personal name.
setPersonal(String) - Method in class javax.mail.internet.InternetAddress
Set the personal name.
setPersonName(PersonName) - Method in interface javax.xml.registry.infomodel.User
Sets the name of this User.
setPhaseId(PhaseId) - Method in class javax.faces.event.FacesEvent
Set the PhaseId during which this event will be delivered.
setPortTypeName(QName) - Method in interface javax.xml.rpc.Call
Sets the qualified name of the port type.
setPostalAddress(PostalAddress) - Method in interface javax.xml.registry.infomodel.Organization
Sets the address for this Organization.
setPostalAddresses(Collection) - Method in interface javax.xml.registry.infomodel.User
Sets the addresses for this User.
setPostalCode(String) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets the postal or zip code.
setPostalScheme(ClassificationScheme) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets a user-defined postal scheme for codifying the attributes of PostalAddress.
setPreamble(String) - Method in class javax.mail.internet.MimeMultipart
Set the preamble text to be included before the first body part.
setPrefix(String, String) - Method in interface javax.xml.stream.XMLEventWriter
Sets the prefix the uri is bound to.
setPrefix(String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Sets the prefix the uri is bound to.
setPrependId(boolean) - Method in class javax.faces.component.UIForm

setPrimaryContact(User) - Method in interface javax.xml.registry.infomodel.Organization
Sets the primary contact for this Organization.
setPrimaryType(String) - Method in class javax.activation.MimeType
Set the primary type for this object to the given String.
setPrimaryType(String) - Method in class javax.mail.internet.ContentType
Set the primary type.
setPriority(int) - Method in interface javax.jms.MessageProducer
Sets the producer's default priority.
setProperties(UIComponent) - Method in class javax.faces.webapp.UIComponentClassicTagBase
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.
setProperties(UIComponent) - Method in class javax.faces.webapp.UIComponentELTag
Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set.
setProperties(UIComponent) - Method in class javax.faces.webapp.UIComponentTag
Deprecated.
setProperties(Properties) - Method in class javax.xml.registry.ConnectionFactory
Sets the Properties used during createConnection and createFederatedConnection calls.
setProperties(Map<String, Object>) - Method in class javax.xml.ws.Endpoint
Sets the property bag for this Endpoint instance.
setProperty(String, Object) - Method in class javax.xml.bind.Binder
Set the particular property in the underlying implementation of Binder.
setProperty(String, Object) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Default implementation of the setProperty method handles the four defined properties in Marshaller.
setProperty(String, Object) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Default implementation of the setProperty method always throws PropertyException since there are no required properties.
setProperty(String, Object) - Method in interface javax.xml.bind.Marshaller
Set the particular property in the underlying implementation of Marshaller.
setProperty(String, Object) - Method in interface javax.xml.bind.Unmarshaller
Set the particular property in the underlying implementation of Unmarshaller.
setProperty(String, Object) - Method in interface javax.xml.bind.Validator
Deprecated. since JAXB2.0
setProperty(String, Object) - Method in interface javax.xml.rpc.Call
Sets the value for a named property.
setProperty(String, Object) - Method in interface javax.xml.rpc.handler.MessageContext
Sets the name and value of a property associated with the MessageContext.
setProperty(String, Object) - Method in class javax.xml.soap.SOAPMessage
Associates the specified value with the specified property.
setProperty(String, Object) - Method in class javax.xml.stream.XMLInputFactory
Allows the user to set specific feature/property on the underlying implementation.
setProperty(String, Object) - Method in class javax.xml.stream.XMLOutputFactory
Allows the user to set specific features/properties on the underlying implementation.
setPropertyResolved(boolean) - Method in class javax.el.ELContext
Called to indicate that a ELResolver has successfully resolved a given (base, property) pair.
setPropertyResolver(PropertyResolver) - Method in class javax.faces.application.Application
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called Application.addELResolver(javax.el.ELResolver).
setProtocolForAddress(String, String) - Method in class javax.mail.Session
Set the default transport protocol to use for addresses of the specified type.
setProvider(Provider) - Method in class javax.mail.Session
Set the passed Provider to be the default implementation for the protocol in Provider.protocol overriding any previous values.
setProvidingOrganization(Organization) - Method in interface javax.xml.registry.infomodel.Service
Sets the Organization that provides this service.
setQuota(Quota) - Method in interface javax.mail.QuotaAwareStore
Set the quotas for the quota root specified in the quota argument.
setRawContent(InputStream, String) - Method in class javax.xml.soap.AttachmentPart
Sets the content of this attachment part to that contained by the InputStream content and sets the value of the Content-Type header to the value contained in contentType.
setRawContentBytes(byte[], int, int, String) - Method in class javax.xml.soap.AttachmentPart
Sets the content of this attachment part to that contained by the byte[] array content and sets the value of the Content-Type header to the value contained in contentType.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the readonly property.
setReadonly(boolean) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the readonly property.
setRecipient(Message.RecipientType, Address) - Method in class javax.mail.Message
Set the recipient address.
setRecipients(Message.RecipientType, Address[]) - Method in class javax.mail.internet.MimeMessage
Set the specified recipient type to the given addresses.
setRecipients(Message.RecipientType, String) - Method in class javax.mail.internet.MimeMessage
Set the specified recipient type to the given addresses.
setRecipients(Message.RecipientType, Address[]) - Method in class javax.mail.Message
Set the recipient addresses.
setRecordName(String) - Method in interface javax.resource.cci.Record
Sets the name of the Record.
setRecordShortDescription(String) - Method in interface javax.resource.cci.Record
Sets a short description string for the Record.
setRedisplay(boolean) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the redisplay property.
setReference(Reference) - Method in interface javax.resource.Referenceable
Sets the Reference instance.
setRel(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the rel property.
setRel(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the rel property.
setRelay(boolean) - Method in interface javax.xml.soap.SOAPHeaderElement
Sets the relay attribute for this SOAPHeaderElement to be either true or false.
setRendered(boolean) - Method in class javax.faces.component.UIComponent
Set the rendered property of this UIComponent.
setRendered(boolean) - Method in class javax.faces.component.UIComponentBase

setRendered(ValueExpression) - Method in class javax.faces.webapp.UIComponentELTag
Set an override for the rendered attribute.
setRendered(String) - Method in class javax.faces.webapp.UIComponentTag
Deprecated. Set an override for the rendered attribute.
setRendererType(String) - Method in class javax.faces.component.UIComponent
Set the Renderer type for this UIComponent, or null for components that render themselves.
setRendererType(String) - Method in class javax.faces.component.UIComponentBase

setRenderKitId(String) - Method in class javax.faces.component.UIViewRoot
Set the render kit identifier of the RenderKit associated with this view.
setReplyTo(Address[]) - Method in class javax.mail.internet.MimeMessage
Set the RFC 822 "Reply-To" header field.
setReplyTo(Address[]) - Method in class javax.mail.Message
Set the addresses to which replies should be directed.
setRepositoryItem(DataHandler) - Method in interface javax.xml.registry.infomodel.ExtrinsicObject
Sets the repository item for this object.
setRequest(Object) - Method in class javax.faces.context.ExternalContext
Set the environment-specific request to be returned by subsequent calls to ExternalContext.getRequest().
setRequest(ServletRequest) - Method in class javax.servlet.ServletRequestWrapper
Sets the request object being wrapped.
setRequestCharacterEncoding(String) - Method in class javax.faces.context.ExternalContext
Overrides the name of the character encoding used in the body of this request.
setRequired(boolean) - Method in interface javax.faces.component.EditableValueHolder
Set the "required field" state for this component.
setRequired(boolean) - Method in class javax.faces.component.UIInput
Set the "required field" state for this component.
setRequiredMessage(String) - Method in class javax.faces.component.UIInput
Override any ValueExpression set for the "requiredMessage" with the literal argument provided to this method.
setResourceAdapter(ResourceAdapter) - Method in interface javax.resource.spi.ResourceAdapterAssociation
Associate this object with a ResourceAdapter object.
setResourceLimit(String, long) - Method in class javax.mail.Quota
Set a resource limit for this quota root.
setResponse(Object) - Method in class javax.faces.context.ExternalContext
Set the environment-specific response to be returned by subsequent calls to ExternalContext.getResponse().
setResponse(ServletResponse) - Method in class javax.servlet.ServletResponseWrapper
Sets the response being wrapped.
setResponseCharacterEncoding(String) - Method in class javax.faces.context.ExternalContext
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.
setResponseStream(ResponseStream) - Method in class javax.faces.context.FacesContext
Set the ResponseStream to which components should direct their binary output.
setResponseWriter(ResponseWriter) - Method in class javax.faces.context.FacesContext
Set the ResponseWriter to which components should direct their character-based output.
setReturnType(QName) - Method in interface javax.xml.rpc.Call
Sets the return type for a specific operation.
setReturnType(QName, Class) - Method in interface javax.xml.rpc.Call
Sets the return type for a specific operation.
setRev(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the rev property.
setRev(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the rev property.
setRole(String) - Method in interface javax.xml.soap.SOAPHeaderElement
Sets the Role associated with this SOAPHeaderElement object to the specified Role.
setRoles(String[]) - Method in interface javax.xml.rpc.handler.HandlerChain
Sets SOAP Actor roles for this HandlerChain.
setRoles(Set<String>) - Method in interface javax.xml.ws.soap.SOAPBinding
Sets the roles played by the SOAP binding instance.
setRollbackOnly() - Method in interface javax.ejb.EJBContext
Mark the current transaction for rollback.
setRollbackOnly() - Method in interface javax.persistence.EntityTransaction
Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.
setRollbackOnly() - Method in interface javax.transaction.Transaction
Modify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction.
setRollbackOnly() - Method in interface javax.transaction.TransactionManager
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
setRollbackOnly() - Method in interface javax.transaction.TransactionSynchronizationRegistry
Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
setRollbackOnly() - Method in interface javax.transaction.UserTransaction
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
setRowClasses(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the rowClasses property.
setRowClasses(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the rowClasses property.
setRowIndex(int) - Method in class javax.faces.component.UIData
Set the zero relative index of the current row, or -1 to indicate that no row is currently selected, by implementing the following algorithm.
setRowIndex(int) - Method in class javax.faces.model.ArrayDataModel

setRowIndex(int) - Method in class javax.faces.model.DataModel
Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.
setRowIndex(int) - Method in class javax.faces.model.ListDataModel

setRowIndex(int) - Method in class javax.faces.model.ResultDataModel

setRowIndex(int) - Method in class javax.faces.model.ResultSetDataModel

setRowIndex(int) - Method in class javax.faces.model.ScalarDataModel

setRows(int) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the rows property.
setRows(int) - Method in class javax.faces.component.UIData
Set the number of rows to be displayed, or zero for all remaining rows in the table.
setRules(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the rules property.
setRules(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the rules property.
setSchema(Schema) - Method in class javax.xml.bind.Binder
Specifies whether marshal, unmarshal and update methods performs validation on their XML content.
setSchema(Schema) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl

setSchema(Schema) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

setSchema(Schema) - Method in interface javax.xml.bind.Marshaller
Specify the JAXP 1.3 Schema object that should be used to validate subsequent marshal operations against.
setSchema(Schema) - Method in interface javax.xml.bind.Unmarshaller
Specify the JAXP 1.3 Schema object that should be used to validate subsequent unmarshal operations against.
setSchemaLocation(String) - Method in class javax.xml.bind.helpers.AbstractMarshallerImpl
Convenience method for setting the schemaLocation.
setScope(String, MessageContext.Scope) - Method in interface javax.xml.ws.handler.MessageContext
Sets the scope of a property.
setSecure(boolean) - Method in class javax.servlet.http.Cookie
Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.
setSelected(boolean) - Method in class javax.faces.component.UISelectBoolean
Set the local value of the selected state of this component.
setSelectedValues(Object[]) - Method in class javax.faces.component.UISelectMany
Set the currently selected values, or null to indicate that there are no currently selected values.
setSelectItems(SelectItem[]) - Method in class javax.faces.model.SelectItemGroup
Set the set of subordinate SelectItems for this group.
setSender(Address) - Method in class javax.mail.internet.MimeMessage
Set the RFC 822 "Sender" header field.
setSentDate(Date) - Method in class javax.mail.internet.MimeMessage
Set the RFC 822 "Date" header field.
setSentDate(Date) - Method in class javax.mail.Message
Set the sent date of this message.
setSessionContext(SessionContext) - Method in interface javax.ejb.SessionBean
Set the associated session context.
setSeverity(FacesMessage.Severity) - Method in class javax.faces.application.FacesMessage
Set the severity level.
setSeverity(int) - Method in class javax.xml.bind.helpers.ValidationEventImpl
Set the severity field of this event.
setShape(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the shape property.
setShape(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the shape property.
setShort(String, short) - Method in interface javax.jms.MapMessage
Sets a short value with the specified name into the Map.
setShortProperty(String, short) - Method in interface javax.jms.Message
Sets a short property value with the specified name into the message.
setShowDetail(boolean) - Method in class javax.faces.component.UIMessage
Set the flag indicating whether the detail property of the associated message(s) should be displayed.
setShowDetail(boolean) - Method in class javax.faces.component.UIMessages
Set the flag indicating whether the detail property of the associated message(s) should be displayed.
setShowSummary(boolean) - Method in class javax.faces.component.UIMessage
Set the flag indicating whether the summary property of the associated message(s) should be displayed.
setShowSummary(boolean) - Method in class javax.faces.component.UIMessages
Set the flag indicating whether the summary property of the associated message(s) should be displayed.
setSize(int) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the size property.
setSize(int) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the size property.
setSize(int) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the size property.
setSize(int) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the size property.
setSlotType(String) - Method in interface javax.xml.registry.infomodel.Slot
Sets the slotType for this Slot.
setSourceObject(RegistryObject) - Method in interface javax.xml.registry.infomodel.Association
Sets the Object that is the source of this Association.
setSpecificationObject(RegistryObject) - Method in interface javax.xml.registry.infomodel.SpecificationLink
Sets the specification object for this object.
setStability(int) - Method in interface javax.xml.registry.infomodel.RegistryEntry
Sets the stability indicator for the RegistryEntry.
setStateManager(StateManager) - Method in class javax.faces.application.Application
Set the StateManager instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
setStateOrProvince(String) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets the state or province.
setStatus(int) - Method in interface javax.servlet.http.HttpServletResponse
Sets the status code for this response.
setStatus(int, String) - Method in interface javax.servlet.http.HttpServletResponse
Deprecated. As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use setStatus(int), to send an error with a description use sendError(int, String). Sets the status code and message for this response.
setStatus(int) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call setStatus(int sc) on the wrapped response object.
setStatus(int, String) - Method in class javax.servlet.http.HttpServletResponseWrapper
The default behavior of this method is to call setStatus(int sc, String sm) on the wrapped response object.
setStreet(String) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets the street name.
setStreetNumber(String) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets the street number.
setString(String, String) - Method in interface javax.jms.MapMessage
Sets a String value with the specified name into the Map.
setStringProperty(String, String) - Method in interface javax.jms.Message
Sets a String property value with the specified name into the message.
setStyle(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlOutputFormat
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlOutputText
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlPanelGroup
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the style property.
setStyle(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the style property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlOutputFormat
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlOutputText
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlPanelGroup
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the styleClass property.
setStyleClass(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the styleClass property.
setSubject(String) - Method in class javax.mail.internet.MimeMessage
Set the "Subject" header field.
setSubject(String, String) - Method in class javax.mail.internet.MimeMessage
Set the "Subject" header field.
setSubject(String) - Method in class javax.mail.Message
Set the subject of this message.
setSubmitted(boolean) - Method in class javax.faces.component.UIForm
If this UIForm instance (as opposed to other forms in the page) is experiencing a submit during this request processing lifecycle, this method must be called, with true as the argument, during the UIComponent.decode(javax.faces.context.FacesContext) for this UIForm instance.
setSubmittedValue(Object) - Method in interface javax.faces.component.EditableValueHolder
Set the submittedValue value of this component.
setSubmittedValue(Object) - Method in class javax.faces.component.UIInput
Set the submittedValue value of this UIInput component.
setSubscribed(boolean) - Method in class javax.mail.Folder
Subscribe or unsubscribe this Folder.
setSubType(String) - Method in class javax.activation.MimeType
Set the subtype for this object to the given String.
setSubType(String) - Method in class javax.mail.internet.ContentType
Set the subType.
setSubType(String) - Method in class javax.mail.internet.MimeMultipart
Set the subtype.
setSummary(String) - Method in class javax.faces.application.FacesMessage
Set the localized summary text.
setSummary(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the summary property.
setSummary(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the summary property.
setSupportedEncodings(String[]) - Method in interface javax.xml.rpc.encoding.TypeMapping
Sets the encodingStyle URIs supported by this TypeMapping instance.
setSupportedLocales(Collection<Locale>) - Method in class javax.faces.application.Application
Set the Locale instances representing the supported Locales for this application.
setSynchronous(boolean) - Method in interface javax.xml.registry.Connection
Sets whether the client uses synchronous communication or not.
setTabindex(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the tabindex property.
setTabindex(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the tabindex property.
setTagExtraInfo(TagExtraInfo) - Method in class javax.servlet.jsp.tagext.TagInfo
Set the instance for extra tag information.
setTagInfo(TagInfo) - Method in class javax.servlet.jsp.tagext.TagExtraInfo
Set the TagInfo for this class.
setTagLibrary(TagLibraryInfo) - Method in class javax.servlet.jsp.tagext.TagInfo
Set the TagLibraryInfo property.
setTarget(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the target property.
setTarget(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the target property.
setTarget(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the target property.
setTargetBinding(ServiceBinding) - Method in interface javax.xml.registry.infomodel.ServiceBinding
Sets the next ServiceBinding in case there is a redirection.
setTargetEndpointAddress(String) - Method in interface javax.xml.rpc.Call
Sets the address of the target service endpoint.
setTargetObject(RegistryObject) - Method in interface javax.xml.registry.infomodel.Association
Sets the Object that is the target of this Association.
setTelephoneNumbers(Collection) - Method in interface javax.xml.registry.infomodel.Organization
Sets the various telephone numbers for this user.
setTelephoneNumbers(Collection) - Method in interface javax.xml.registry.infomodel.User
Sets the various telephone numbers for this user.
setText(String) - Method in interface javax.jms.TextMessage
Sets the string containing this message's data.
setText(String) - Method in class javax.mail.internet.MimeBodyPart
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".
setText(String, String) - Method in class javax.mail.internet.MimeBodyPart
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.
setText(String, String, String) - Method in class javax.mail.internet.MimeBodyPart
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.
setText(String) - Method in class javax.mail.internet.MimeMessage
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".
setText(String, String) - Method in class javax.mail.internet.MimeMessage
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.
setText(String, String, String) - Method in class javax.mail.internet.MimeMessage
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.
setText(String) - Method in interface javax.mail.internet.MimePart
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".
setText(String, String) - Method in interface javax.mail.internet.MimePart
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.
setText(String, String, String) - Method in interface javax.mail.internet.MimePart
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.
setText(String) - Method in interface javax.mail.Part
A convenience method that sets the given String as this part's content with a MIME type of "text/plain".
setTimeStyle(String) - Method in class javax.faces.convert.DateTimeConverter
Set the style to be used to format or parse times.
setTimeToLive(long) - Method in interface javax.jms.MessageProducer
Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
setTimeZone(TimeZone) - Method in class javax.faces.convert.DateTimeConverter
Set the TimeZone used to interpret a time value.
setTitle(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlForm
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlInputSecret
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlInputText
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlInputTextarea
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlOutputFormat
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlOutputLabel
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlOutputText
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlSelectBooleanCheckbox
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlSelectManyCheckbox
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlSelectManyListbox
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlSelectManyMenu
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlSelectOneListbox
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlSelectOneMenu
Set the value of the title property.
setTitle(String) - Method in class javax.faces.component.html.HtmlSelectOneRadio
Set the value of the title property.
setTooltip(boolean) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the tooltip property.
setTooltip(boolean) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the tooltip property.
setTransactionTimeout(long) - Method in class javax.resource.spi.work.ExecutionContext
Set the transaction timeout value for a imported transaction.
setTransactionTimeout(int) - Method in interface javax.transaction.TransactionManager
Modify the timeout value that is associated with transactions started by the current thread with the begin method.
setTransactionTimeout(int) - Method in interface javax.transaction.UserTransaction
Modify the timeout value that is associated with transactions started by the current thread with the begin method.
setTransactionTimeout(int) - Method in interface javax.transaction.xa.XAResource
Sets the current transaction timeout value for this XAResource instance.
setTransient(boolean) - Method in interface javax.faces.component.StateHolder
Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
setTransient(boolean) - Method in class javax.faces.component.UIComponentBase

setTransient(boolean) - Method in class javax.faces.convert.DateTimeConverter

setTransient(boolean) - Method in class javax.faces.convert.EnumConverter

setTransient(boolean) - Method in class javax.faces.convert.NumberConverter

setTransient(boolean) - Method in class javax.faces.event.MethodExpressionActionListener

setTransient(boolean) - Method in class javax.faces.event.MethodExpressionValueChangeListener

setTransient(boolean) - Method in class javax.faces.validator.DoubleRangeValidator

setTransient(boolean) - Method in class javax.faces.validator.LengthValidator

setTransient(boolean) - Method in class javax.faces.validator.LongRangeValidator

setTransient(boolean) - Method in class javax.faces.validator.MethodExpressionValidator

setType(String) - Method in class javax.faces.component.html.HtmlCommandButton
Set the value of the type property.
setType(String) - Method in class javax.faces.component.html.HtmlCommandLink
Set the value of the type property.
setType(String) - Method in class javax.faces.component.html.HtmlOutputLink
Set the value of the type property.
setType(String) - Method in class javax.faces.convert.DateTimeConverter
Set the type of value to be formatted or parsed.
setType(String) - Method in class javax.faces.convert.NumberConverter
Set the number type to be used when formatting and parsing numbers.
setType(String) - Method in interface javax.xml.registry.infomodel.EmailAddress
Sets the type for this object.
setType(String) - Method in interface javax.xml.registry.infomodel.PostalAddress
Sets the type of address (for example, "headquarters") as a String.
setType(String) - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Sets the type of telephone number (for example, "fax").
setType(String) - Method in interface javax.xml.registry.infomodel.User
Sets the type for this User.
setupResponseWriter() - Method in class javax.faces.webapp.UIComponentClassicTagBase
Set up the ResponseWriter for the current response, if this has not been done already.
setUrl(String) - Method in class javax.faces.component.UIGraphic
Set the image URL for this UIGraphic.
setURL(URL) - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl
Set the URL field on this event locator.
setUrl(String) - Method in interface javax.xml.registry.infomodel.TelephoneNumber
Sets the URL that can dial this number electronically.
setUrl(URL) - Method in interface javax.xml.registry.infomodel.User
Sets the URL to the web page for this User.
setURLName(URLName) - Method in class javax.mail.Service
Set the URLName representing this service.
setUsageDescription(InternationalString) - Method in interface javax.xml.registry.infomodel.SpecificationLink
Sets the description of usage parameters.
setUsageParameters(Collection) - Method in interface javax.xml.registry.infomodel.SpecificationLink
Sets any usage parameters.
setUsemap(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the usemap property.
setUserVersion(String) - Method in interface javax.xml.registry.infomodel.Versionable
Sets the user specified revision number for this version of the Versionable object.
setValid(boolean) - Method in interface javax.faces.component.EditableValueHolder
Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).
setValid(boolean) - Method in class javax.faces.component.UIInput

setValidateURI(boolean) - Method in interface javax.xml.registry.infomodel.URIValidator
Sets whether to do URI validation for this object.
setValidating(boolean) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Specifies whether or not the Unmarshaller should validate during unmarshal operations.
setValidating(boolean) - Method in interface javax.xml.bind.Unmarshaller
Deprecated. since JAXB2.0, please see Unmarshaller.setSchema(javax.xml.validation.Schema)
setValidator(MethodBinding) - Method in interface javax.faces.component.EditableValueHolder
Deprecated. Use EditableValueHolder.addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.
setValidator(MethodBinding) - Method in class javax.faces.component.UIInput
Deprecated. Use UIInput.addValidator(javax.faces.validator.Validator) instead, obtaining the argument Validator by creating an instance of MethodExpressionValidator.
setValidatorId(String) - Method in class javax.faces.webapp.ValidatorTag
Deprecated. Set the identifer of the Validator instance to be created.
setValidatorMessage(String) - Method in class javax.faces.component.UIInput
Override any ValueExpression set for the "validatorMessage" with the literal argument provided to this method.
setValue(ELContext, Object, Object, Object) - Method in class javax.el.ArrayELResolver
If the base object is a Java language array, attempts to set the value at the given index with the given value.
setValue(ELContext, Object, Object, Object) - Method in class javax.el.BeanELResolver
If the base object is not null, attempts to set the value of the given property on this bean.
setValue(ELContext, Object, Object, Object) - Method in class javax.el.CompositeELResolver
Attempts to set the value of the given property object on the given base object.
setValue(ELContext, Object, Object, Object) - Method in class javax.el.ELResolver
Attempts to set the value of the given property object on the given base object.
setValue(ELContext, Object, Object, Object) - Method in class javax.el.ListELResolver
If the base object is a list, attempts to set the value at the given index with the given value.
setValue(ELContext, Object, Object, Object) - Method in class javax.el.MapELResolver
If the base object is a map, attempts to set the value associated with the given key, as specified by the property argument.
setValue(ELContext, Object, Object, Object) - Method in class javax.el.ResourceBundleELResolver
If the base object is a ResourceBundle, throw a PropertyNotWritableException.
setValue(ELContext, Object) - Method in class javax.el.ValueExpression
Evaluates the expression relative to the provided context, and sets the result to the provided value.
setValue(Object) - Method in class javax.faces.component.UICommand
Sets the value property of the UICommand.
setValue(Object) - Method in class javax.faces.component.UIData
Set the value of the UIData.
setValue(Object) - Method in class javax.faces.component.UIGraphic
Sets the value property of the UIGraphic.
setValue(Object) - Method in class javax.faces.component.UIInput

setValue(Object) - Method in class javax.faces.component.UIOutput

setValue(Object) - Method in class javax.faces.component.UIParameter
Sets the value property of the\ UIParameter.
setValue(Object) - Method in class javax.faces.component.UISelectItem
Sets the value property of the UISelectItem.
setValue(Object) - Method in class javax.faces.component.UISelectItems
Sets the value property of the UISelectItems.
setValue(Object) - Method in interface javax.faces.component.ValueHolder
Set the value of this UIComponent (if any).
setValue(Object, Object, Object) - Method in class javax.faces.el.PropertyResolver
Deprecated. Set the specified value of the specified property on the specified base object.
setValue(Object, int, Object) - Method in class javax.faces.el.PropertyResolver
Deprecated. Set the value at the specified index of the specified base object.
setValue(FacesContext, Object) - Method in class javax.faces.el.ValueBinding
Deprecated. Set the value of the property represented by this ValueBinding, relative to the specified FacesContext.
setValue(Object) - Method in class javax.faces.model.SelectItem
Set the value of this item, to be delivered to the model if this item is selected by this user.
setValue(String) - Method in class javax.faces.webapp.AttributeTag
Deprecated. Set the attribute value.
setValue(String) - Method in class javax.servlet.http.Cookie
Assigns a new value to a cookie after the cookie is created.
setValue(ELContext, Object, Object, Object) - Method in class javax.servlet.jsp.el.ImplicitObjectELResolver
If the base object is null, and the property matches the name of a JSP implicit object, throws PropertyNotWritableException to indicate that implicit objects cannot be overwritten.
setValue(ELContext, Object, Object, Object) - Method in class javax.servlet.jsp.el.ScopedAttributeELResolver
If the base object is null, sets an existing scoped attribute to the new value, or creates a new scoped attribute if one does not exist by this name.
setValue(String, Object) - Method in class javax.servlet.jsp.tagext.TagSupport
Associate a value with a String key.
setValue(T) - Method in class javax.xml.bind.JAXBElement
Set the content model and attributes of this xml element.
setValue(String) - Method in interface javax.xml.registry.infomodel.Classification
Sets the taxonomy value for this external Classification.
setValue(String) - Method in interface javax.xml.registry.infomodel.Concept
Sets the value (usually a taxonomy value) associated with this Concept.
setValue(String) - Method in interface javax.xml.registry.infomodel.ExternalIdentifier
Sets the value of an ExternalIdentifier.
setValue(String) - Method in interface javax.xml.registry.infomodel.InternationalString
Sets the String value for the Locale returned by Locale.getDefault().
setValue(Locale, String) - Method in interface javax.xml.registry.infomodel.InternationalString
Sets the String value for the specified Locale.
setValue(String) - Method in interface javax.xml.registry.infomodel.LocalizedString
Set the String value for the specified object.
setValue(String) - Method in interface javax.xml.soap.Node
If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node.
setValueBinding(String, ValueBinding) - Method in class javax.faces.component.UIComponent
Deprecated. This has been replaced by UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression).
setValueBinding(String, ValueBinding) - Method in class javax.faces.component.UIComponentBase
Deprecated. This has been replaced by UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression).
setValueBinding(String, ValueBinding) - Method in class javax.faces.component.UIData
Deprecated. This has been replaced by UIData.setValueExpression(java.lang.String, javax.el.ValueExpression).
setValueBinding(String, ValueBinding) - Method in class javax.faces.component.UIGraphic
Deprecated. This has been replaced by UIGraphic.setValueExpression(java.lang.String, javax.el.ValueExpression).
setValueBinding(String, ValueBinding) - Method in class javax.faces.component.UISelectBoolean
Deprecated. This has been replaced by UISelectBoolean.setValueExpression(java.lang.String, javax.el.ValueExpression).
setValueBinding(String, ValueBinding) - Method in class javax.faces.component.UISelectMany
Deprecated. This has been replaced by UISelectMany.setValueExpression(java.lang.String, javax.el.ValueExpression).
setValueChangeListener(MethodBinding) - Method in interface javax.faces.component.EditableValueHolder
Deprecated. Use EditableValueHolder.addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.
setValueChangeListener(MethodBinding) - Method in class javax.faces.component.UIInput
Deprecated. Use UIInput.addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument ValueChangeListener by creating an instance of MethodExpressionValueChangeListener.
setValueExpression(String, ValueExpression) - Method in class javax.faces.component.UIComponent
Set the ValueExpression used to calculate the value for the specified attribute or property name, if any.
setValueExpression(String, ValueExpression) - Method in class javax.faces.component.UIData
Set the ValueExpression used to calculate the value for the specified attribute or property name, if any.
setValueExpression(String, ValueExpression) - Method in class javax.faces.component.UIGraphic
Store any ValueExpression specified for url under value instead; otherwise, perform the default superclass processing for this method.
setValueExpression(String, ValueExpression) - Method in class javax.faces.component.UISelectBoolean
Store any ValueExpression specified for selected under value instead; otherwise, perform the default superclass processing for this method.
setValueExpression(String, ValueExpression) - Method in class javax.faces.component.UISelectMany
Store any ValueExpression specified for selectedValues under value instead; otherwise, perform the default superclass processing for this method.
setValues(Collection) - Method in interface javax.xml.registry.infomodel.Slot
Sets the values for this Slot.
setValueType(int) - Method in interface javax.xml.registry.infomodel.ClassificationScheme
Sets the value type for this object.
setVar(String) - Method in class javax.faces.component.UIData
Set the request-scope attribute under which the data object for the current row wil be exposed when iterating.
setVariable(String, ValueExpression) - Method in class javax.el.VariableMapper
Assign a ValueExpression to an EL variable, replacing any previously assignment to the same variable.
setVariableResolver(VariableResolver) - Method in class javax.faces.application.Application
Deprecated. The recommended way to affect the execution of the EL is to provide an <el-resolver> element at the right place in the application configuration resources which will be considered in the normal course of expression evaluation. This method now will cause the argument resolver to be wrapped inside an implementation of ELResolver and exposed to the EL resolution system as if the user had called Application.addELResolver(javax.el.ELResolver).
setVersion(int) - Method in class javax.servlet.http.Cookie
Sets the version of the cookie protocol this cookie complies with.
setViewHandler(ViewHandler) - Method in class javax.faces.application.Application
Set the ViewHandler instance that will be utilized during the Restore View and Render Response phases of the request processing lifecycle.
setViewId(String) - Method in class javax.faces.component.UIViewRoot
Set the view identifier for this view.
setViewRoot(UIViewRoot) - Method in class javax.faces.context.FacesContext
Set the root component that is associated with this request.
setWarnClass(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the warnClass property.
setWarnClass(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the warnClass property.
setWarnStyle(String) - Method in class javax.faces.component.html.HtmlMessage
Set the value of the warnStyle property.
setWarnStyle(String) - Method in class javax.faces.component.html.HtmlMessages
Set the value of the warnStyle property.
setWidth(String) - Method in class javax.faces.component.html.HtmlDataTable
Set the value of the width property.
setWidth(String) - Method in class javax.faces.component.html.HtmlGraphicImage
Set the value of the width property.
setWidth(String) - Method in class javax.faces.component.html.HtmlPanelGrid
Set the value of the width property.
setWrappedData(Object) - Method in class javax.faces.model.ArrayDataModel

setWrappedData(Object) - Method in class javax.faces.model.DataModel
Set the object representing the data collection wrapped by this DataModel.
setWrappedData(Object) - Method in class javax.faces.model.ListDataModel

setWrappedData(Object) - Method in class javax.faces.model.ResultDataModel

setWrappedData(Object) - Method in class javax.faces.model.ResultSetDataModel

setWrappedData(Object) - Method in class javax.faces.model.ScalarDataModel

setXid(Xid) - Method in class javax.resource.spi.work.ExecutionContext
set a transaction context.
setXMLReporter(XMLReporter) - Method in class javax.xml.stream.XMLInputFactory
The reporter that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
setXMLResolver(XMLResolver) - Method in class javax.xml.stream.XMLInputFactory
The resolver that will be set on any XMLStreamReader or XMLEventReader created by this factory instance.
SEVERITY_ERROR - Static variable in class javax.faces.application.FacesMessage
Message severity level indicating that an error has occurred.
SEVERITY_FATAL - Static variable in class javax.faces.application.FacesMessage
Message severity level indicating that a serious error has occurred.
SEVERITY_INFO - Static variable in class javax.faces.application.FacesMessage
Message severity level indicating an informational message rather than an error.
SEVERITY_WARN - Static variable in class javax.faces.application.FacesMessage
Message severity level indicating that an error might have occurred.
SharedByteArrayInputStream - Class in javax.mail.util
A ByteArrayInputStream that implements the SharedInputStream interface, allowing the underlying byte array to be shared between multiple readers.
SharedByteArrayInputStream(byte[]) - Constructor for class javax.mail.util.SharedByteArrayInputStream
Create a SharedByteArrayInputStream representing the entire byte array.
SharedByteArrayInputStream(byte[], int, int) - Constructor for class javax.mail.util.SharedByteArrayInputStream
Create a SharedByteArrayInputStream representing the part of the byte array from offset for length bytes.
SharedFileInputStream - Class in javax.mail.util
A SharedFileInputStream is a BufferedInputStream that buffers data from the file and supports the mark and reset methods.
SharedFileInputStream(File) - Constructor for class javax.mail.util.SharedFileInputStream
Creates a SharedFileInputStream for the file.
SharedFileInputStream(String) - Constructor for class javax.mail.util.SharedFileInputStream
Creates a SharedFileInputStream for the named file
SharedFileInputStream(File, int) - Constructor for class javax.mail.util.SharedFileInputStream
Creates a SharedFileInputStream with the specified buffer size.
SharedFileInputStream(String, int) - Constructor for class javax.mail.util.SharedFileInputStream
Creates a SharedFileInputStream with the specified buffer size.
SharedInputStream - Interface in javax.mail.internet
An InputStream that is backed by data that can be shared by multiple readers may implement this interface.
SharingViolationException - Exception in javax.resource.spi
This is thrown to indicate a connection sharing violation.
SharingViolationException() - Constructor for exception javax.resource.spi.SharingViolationException
Constructs a new instance with null as its detail message.
SharingViolationException(String) - Constructor for exception javax.resource.spi.SharingViolationException
Constructs a new instance with the specified detail message.
SharingViolationException(Throwable) - Constructor for exception javax.resource.spi.SharingViolationException
Constructs a new throwable with the specified cause.
SharingViolationException(String, Throwable) - Constructor for exception javax.resource.spi.SharingViolationException
Constructs a new throwable with the specified detail message and cause.
SharingViolationException(String, String) - Constructor for exception javax.resource.spi.SharingViolationException
Constructs a new throwable with the specified detail message and error code.
SHORT_ID - Static variable in class javax.faces.convert.ShortConverter
The message identifier of the FacesMessage to be created if the conversion to Short fails.
ShortConverter - Class in javax.faces.convert
Converter implementation for java.lang.Short (and short primitive) values.
ShortConverter() - Constructor for class javax.faces.convert.ShortConverter

ShortHolder - Class in javax.xml.rpc.holders

ShortHolder() - Constructor for class javax.xml.rpc.holders.ShortHolder

ShortHolder(short) - Constructor for class javax.xml.rpc.holders.ShortHolder

shortname - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
The preferred short name (prefix) as indicated in the TLD.
ShortWrapperHolder - Class in javax.xml.rpc.holders

ShortWrapperHolder() - Constructor for class javax.xml.rpc.holders.ShortWrapperHolder

ShortWrapperHolder(Short) - Constructor for class javax.xml.rpc.holders.ShortWrapperHolder

SimpleTag - Interface in javax.servlet.jsp.tagext
Interface for defining Simple Tag Handlers.
SimpleTagSupport - Class in javax.servlet.jsp.tagext
A base class for defining tag handlers implementing SimpleTag.
SimpleTagSupport() - Constructor for class javax.servlet.jsp.tagext.SimpleTagSupport
Sole constructor.
SingleThreadModel - Interface in javax.servlet
Deprecated. As of Java Servlet API 2.4, with no direct replacement.
size() - Method in class javax.activation.MimeTypeParameterList
Return the number of name-value pairs in this list.
size() - Method in class javax.mail.internet.ParameterList
Return the number of parameters in this list.
SizeTerm - Class in javax.mail.search
This class implements comparisons for Message sizes.
SizeTerm(int, int) - Constructor for class javax.mail.search.SizeTerm
Constructor.
skip(long) - Method in class javax.mail.util.SharedFileInputStream
See the general contract of the skip method of InputStream.
SKIP_BODY - Static variable in interface javax.servlet.jsp.tagext.Tag
Skip body evaluation.
SKIP_PAGE - Static variable in interface javax.servlet.jsp.tagext.Tag
Skip the rest of the page.
SkipPageException - Exception in javax.servlet.jsp
Exception to indicate the calling page must cease evaluation.
SkipPageException() - Constructor for exception javax.servlet.jsp.SkipPageException
Creates a SkipPageException with no message.
SkipPageException(String) - Constructor for exception javax.servlet.jsp.SkipPageException
Creates a SkipPageException with the provided message.
SkipPageException(String, Throwable) - Constructor for exception javax.servlet.jsp.SkipPageException
Creates a SkipPageException with the provided message and root cause.
SkipPageException(Throwable) - Constructor for exception javax.servlet.jsp.SkipPageException
Creates a SkipPageException with the provided root cause.
Slot - Interface in javax.xml.registry.infomodel
Slot instances provide a dynamic way to add arbitrary attributes to RegistryObject instances.
SLOT - Static variable in interface javax.xml.registry.LifeCycleManager

SOAP11HTTP_BINDING - Static variable in interface javax.xml.ws.soap.SOAPBinding
A constant representing the identity of the SOAP 1.1 over HTTP binding.
SOAP11HTTP_MTOM_BINDING - Static variable in interface javax.xml.ws.soap.SOAPBinding
A constant representing the identity of the SOAP 1.1 over HTTP binding with MTOM enabled by default.
SOAP12HTTP_BINDING - Static variable in interface javax.xml.ws.soap.SOAPBinding
A constant representing the identity of the SOAP 1.2 over HTTP binding.
SOAP12HTTP_MTOM_BINDING - Static variable in interface javax.xml.ws.soap.SOAPBinding
A constant representing the identity of the SOAP 1.2 over HTTP binding with MTOM enabled by default.
SOAP_1_1_CONTENT_TYPE - Static variable in interface javax.xml.soap.SOAPConstants
The media type of the Content-Type MIME header in SOAP 1.1.
SOAP_1_1_PROTOCOL - Static variable in interface javax.xml.soap.SOAPConstants
Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.1 specification.
SOAP_1_2_CONTENT_TYPE - Static variable in interface javax.xml.soap.SOAPConstants
The media type of the Content-Type MIME header in SOAP 1.2.
SOAP_1_2_PROTOCOL - Static variable in interface javax.xml.soap.SOAPConstants
Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.2 specification
SOAP_ARRAY - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:Array type.
SOAP_BASE64 - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:base64 type.
SOAP_BOOLEAN - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:boolean type.
SOAP_BYTE - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:byte type.
SOAP_DATAENCODINGUNKNOWN_FAULT - Static variable in interface javax.xml.soap.SOAPConstants
SOAP 1.2 DataEncodingUnknown Fault
SOAP_DOUBLE - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:double type.
SOAP_ENV_PREFIX - Static variable in interface javax.xml.soap.SOAPConstants
The default namespace prefix for http://www.w3.org/2003/05/soap-envelope
SOAP_FLOAT - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:float type.
SOAP_INT - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:int type.
SOAP_LONG - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:long type.
SOAP_MUSTUNDERSTAND_FAULT - Static variable in interface javax.xml.soap.SOAPConstants
SOAP 1.2 MustUnderstand Fault
SOAP_RECEIVER_FAULT - Static variable in interface javax.xml.soap.SOAPConstants
SOAP 1.2 Receiver Fault
SOAP_SENDER_FAULT - Static variable in interface javax.xml.soap.SOAPConstants
SOAP 1.2 Sender Fault
SOAP_SHORT - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:short type.
SOAP_STRING - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the SOAP-ENC:string type.
SOAP_VERSIONMISMATCH_FAULT - Static variable in interface javax.xml.soap.SOAPConstants
SOAP 1.2 VersionMismatch Fault
SOAPACTION_URI_PROPERTY - Static variable in interface javax.xml.rpc.Call
Standard property for SOAPAction.
SOAPACTION_URI_PROPERTY - Static variable in interface javax.xml.ws.BindingProvider
Standard property for SOAPAction.
SOAPACTION_USE_PROPERTY - Static variable in interface javax.xml.rpc.Call
Standard property for SOAPAction.
SOAPACTION_USE_PROPERTY - Static variable in interface javax.xml.ws.BindingProvider
Standard property for SOAPAction.
SOAPBinding - Annotation Type in javax.jws.soap
Specifies the mapping of the Web Service onto the SOAP message protocol.
SOAPBinding - Interface in javax.xml.ws.soap
The SOAPBinding interface is an abstraction for the SOAP binding.
SOAPBinding.ParameterStyle - Enum in javax.jws.soap
The style of mapping parameters onto SOAP messages
SOAPBinding.Style - Enum in javax.jws.soap
The SOAP binding style
SOAPBinding.Use - Enum in javax.jws.soap
The SOAP binding use
SOAPBody - Interface in javax.xml.soap
An object that represents the contents of the SOAP body element in a SOAP message.
SOAPBodyElement - Interface in javax.xml.soap
A SOAPBodyElement object represents the contents in a SOAPBody object.
SOAPConnection - Class in javax.xml.soap
A point-to-point connection that a client can use for sending messages directly to a remote party (represented by a URL, for instance).
SOAPConnection() - Constructor for class javax.xml.soap.SOAPConnection

SOAPConnectionFactory - Class in javax.xml.soap
A factory for creating SOAPConnection objects.
SOAPConnectionFactory() - Constructor for class javax.xml.soap.SOAPConnectionFactory

SOAPConstants - Interface in javax.xml.soap
The definition of constants pertaining to the SOAP protocol.
SOAPElement - Interface in javax.xml.soap
An object representing an element of a SOAP message that is allowed but not specifically prescribed by a SOAP specification.
SOAPElementFactory - Class in javax.xml.soap
Deprecated. - Use javax.xml.soap.SOAPFactory for creating SOAPElements.
SOAPEnvelope - Interface in javax.xml.soap
The container for the SOAPHeader and SOAPBody portions of a SOAPPart object.
SOAPException - Exception in javax.xml.soap
An exception that signals that a SOAP exception has occurred.
SOAPException() - Constructor for exception javax.xml.soap.SOAPException
Constructs a SOAPException object with no reason or embedded Throwable object.
SOAPException(String) - Constructor for exception javax.xml.soap.SOAPException
Constructs a SOAPException object with the given String as the reason for the exception being thrown.
SOAPException(String, Throwable) - Constructor for exception javax.xml.soap.SOAPException
Constructs a SOAPException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded exception.
SOAPException(Throwable) - Constructor for exception javax.xml.soap.SOAPException
Constructs a SOAPException object initialized with the given Throwable object.
SOAPFactory - Class in javax.xml.soap
SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree.
SOAPFactory() - Constructor for class javax.xml.soap.SOAPFactory

SOAPFault - Interface in javax.xml.soap
An element in the SOAPBody object that contains error and/or status information.
SOAPFaultElement - Interface in javax.xml.soap
A representation of the contents in a SOAPFault object.
SOAPFaultException - Exception in javax.xml.rpc.soap
The SOAPFaultException exception represents a SOAP fault.
SOAPFaultException(QName, String, String, Detail) - Constructor for exception javax.xml.rpc.soap.SOAPFaultException
Constructor for the SOAPFaultException
SOAPFaultException - Exception in javax.xml.ws.soap
The SOAPFaultException exception represents a SOAP 1.1 or 1.2 fault.
SOAPFaultException(SOAPFault) - Constructor for exception javax.xml.ws.soap.SOAPFaultException
Constructor for SOAPFaultException
SOAPHandler<T extends SOAPMessageContext> - Interface in javax.xml.ws.handler.soap
The SOAPHandler class extends Handler to provide typesafety for the message context parameter and add a method to obtain access to the headers that may be processed by the handler.
SOAPHeader - Interface in javax.xml.soap
A representation of the SOAP header element.
SOAPHeaderElement - Interface in javax.xml.soap
An object representing the contents in the SOAP header part of the SOAP envelope.
SOAPMessage - Class in javax.xml.soap
The root class for all SOAP messages.
SOAPMessage() - Constructor for class javax.xml.soap.SOAPMessage

SOAPMessageContext - Interface in javax.xml.rpc.handler.soap
The interface javax.xml.rpc.soap.SOAPMessageContext provides access to the SOAP message for either RPC request or response.
SOAPMessageContext - Interface in javax.xml.ws.handler.soap
The interface SOAPMessageContext provides access to the SOAP message for either RPC request or response.
SOAPMessageHandler - Annotation Type in javax.jws.soap
Deprecated. As of JSR-181 2.0 with no replacement.
SOAPMessageHandlers - Annotation Type in javax.jws.soap
Deprecated. As of JSR-181 2.0 with no replacement.
SOAPPart - Class in javax.xml.soap
The container for the SOAP-specific portion of a SOAPMessage object.
SOAPPart() - Constructor for class javax.xml.soap.SOAPPart

SORT_BY_DATE_ASC - Static variable in interface javax.xml.registry.FindQualifier

SORT_BY_DATE_DESC - Static variable in interface javax.xml.registry.FindQualifier

SORT_BY_NAME_ASC - Static variable in interface javax.xml.registry.FindQualifier

SORT_BY_NAME_DESC - Static variable in interface javax.xml.registry.FindQualifier

SORT_CODE_SLOT - Static variable in interface javax.xml.registry.infomodel.Slot
Name for pre-defined Slot used in PostalAddress by JAXR UDDI provider.
SOUNDEX - Static variable in interface javax.xml.registry.FindQualifier
Optional qualifier that allows matching strings by their sounds.
SPACE - Static variable in interface javax.xml.stream.XMLStreamConstants
The characters are white space (see [XML], 2.10 "White Space Handling").
SPECIFICATION_LINK - Static variable in interface javax.xml.registry.LifeCycleManager

SpecificationLink - Interface in javax.xml.registry.infomodel
A SpecificationLink provides the linkage between a ServiceBinding and one of its technical specifications that describes how to use the service using the ServiceBinding.
SqlResultSetMapping - Annotation Type in javax.persistence
This annotation is used to specify the mapping of the result of a native SQL query.
SqlResultSetMappings - Annotation Type in javax.persistence
This annotation is used to define one or more SqlResultSetMapping.
STABILITY_DYNAMIC - Static variable in interface javax.xml.registry.infomodel.RegistryEntry
RegistryEntry may change at any time.
STABILITY_DYNAMIC_COMPATIBLE - Static variable in interface javax.xml.registry.infomodel.RegistryEntry
RegistryEntry may change at any time, however the changes will be backward compatible.
STABILITY_STATIC - Static variable in interface javax.xml.registry.infomodel.RegistryEntry
RegistryEntry will not change.
standaloneSet() - Method in interface javax.xml.stream.events.StartDocument
Returns true if the standalone attribute was set in the encoding declaration of the document.
standaloneSet() - Method in class javax.xml.stream.util.StreamReaderDelegate

standaloneSet() - Method in interface javax.xml.stream.XMLStreamReader
Checks if standalone was set in the document
START - Static variable in class javax.enterprise.deploy.shared.CommandType
The DeploymentManger action operation being processed is start.
start(TargetModuleID[]) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Start the application running.
start() - Method in interface javax.jms.Connection
Starts (or restarts) a connection's delivery of incoming messages.
start() - Method in interface javax.jms.ServerSession
Cause the Session's run method to be called to process messages that were just assigned to it.
start - Variable in class javax.mail.util.SharedByteArrayInputStream
Position within shared buffer that this stream starts at.
start - Variable in class javax.mail.util.SharedFileInputStream
The file offset of the start of data in this subset of the file.
start(BootstrapContext) - Method in interface javax.resource.spi.ResourceAdapter
This is called when a resource adapter instance is bootstrapped.
start(Xid, int) - Method in interface javax.transaction.xa.XAResource
Starts work on behalf of a transaction branch specified in xid.
START_DOCUMENT - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is a start document
START_ELEMENT - Static variable in interface javax.xml.stream.XMLStreamConstants
Indicates an event is a start element
START_TIMED_OUT - Static variable in exception javax.resource.spi.work.WorkException
Indicates start timeout expiration.
startDocument() - Method in class javax.faces.context.ResponseWriter
Write whatever text should begin a response.
startDocument() - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.startDocument() on the wrapped ResponseWriter object.
StartDocument - Interface in javax.xml.stream.events
An interface for the start document event
startElement(String, UIComponent) - Method in class javax.faces.context.ResponseWriter
Write the start of an element, up to and including the element name.
startElement(String, UIComponent) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.startElement(String, javax.faces.component.UIComponent) on the wrapped ResponseWriter object.
StartElement - Interface in javax.xml.stream.events
The StartElement interface provides access to information about start elements.
startWork(Work) - Method in interface javax.resource.spi.work.WorkManager
Accepts a Work instance for processing.
startWork(Work, long, ExecutionContext, WorkListener) - Method in interface javax.resource.spi.work.WorkManager
Accepts a Work instance for processing.
STATE_SAVING_METHOD_CLIENT - Static variable in class javax.faces.application.StateManager
Constant value for the initialization parameter named by the STATE_SAVING_METHOD_PARAM_NAME that indicates state saving should take place on the client.
STATE_SAVING_METHOD_PARAM_NAME - Static variable in class javax.faces.application.StateManager
The ServletContext init parameter consulted by the StateManager to tell where the state should be saved.
STATE_SAVING_METHOD_SERVER - Static variable in class javax.faces.application.StateManager
Constant value for the initialization parameter named by the STATE_SAVING_METHOD_PARAM_NAME that indicates state saving should take place on the server.
Stateful - Annotation Type in javax.ejb
Component-defining annotation for a stateful session bean.
StatefulSessionBeanStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a stateful session bean.
StateHolder - Interface in javax.faces.component
This interface is implemented by classes that need to save their state between requests.
Stateless - Annotation Type in javax.ejb
Component-defining annotation for a stateless session bean.
StatelessSessionBeanStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a stateless session bean.
StateManager - Class in javax.faces.application
StateManager directs the process of saving and restoring the view between requests.
StateManager() - Constructor for class javax.faces.application.StateManager

StateManager.SerializedView - Class in javax.faces.application
Deprecated. This class was not marked Serializable in the 1.0 version of the spec. It was also not a static inner class, so it can't be made to be Serializable. Therefore, it is being deprecated in version 1.2 of the spec. The replacement is to use an implementation dependent Object.
StateManager.SerializedView(Object, Object) - Constructor for class javax.faces.application.StateManager.SerializedView
Deprecated.
StateManagerWrapper - Class in javax.faces.application
Provides a simple implementation of StateManager that can be subclassed by developers wishing to provide specialized behavior to an existing StateManager instance.
StateManagerWrapper() - Constructor for class javax.faces.application.StateManagerWrapper

StateType - Class in javax.enterprise.deploy.shared
Class StateTypes defines enumeration values for the DeploymentStatus object.
StateType(int) - Constructor for class javax.enterprise.deploy.shared.StateType
Construct a new enumeration value with the given integer value.
Statistic - Interface in javax.management.j2ee.statistics
The Statistic model and its sub-models specify the data models which are requried to be used to provide the performance data described by the specific attributes in the Stats models.
Stats - Interface in javax.management.j2ee.statistics
The Stats model and its submodels specify performance data attributes for each of the specific managed object types.
Status - Interface in javax.transaction
The Status interface defines static variables used for transaction status codes.
STATUS_ACTIVE - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and it is in the active state.
STATUS_APPROVED - Static variable in interface javax.xml.registry.infomodel.RegistryEntry
RegistryEntry has been submitted and approved.
STATUS_COMMITTED - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and it has been committed.
STATUS_COMMITTING - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and it is in the process of committing.
STATUS_DEPRECATED - Static variable in interface javax.xml.registry.infomodel.RegistryEntry
RegistryEntry has been deprecated.
STATUS_FAILURE - Static variable in interface javax.xml.registry.JAXRResponse
Status indicating a failure response.
STATUS_MARKED_ROLLBACK - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and it has been marked for rollback, perhaps as a result of a setRollbackOnly operation.
STATUS_NO_TRANSACTION - Static variable in interface javax.transaction.Status
No transaction is currently associated with the target object.
STATUS_PREPARED - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and it has been prepared.
STATUS_PREPARING - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and it is in the process of preparing.
STATUS_ROLLEDBACK - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and the outcome has been determined to be rollback.
STATUS_ROLLING_BACK - Static variable in interface javax.transaction.Status
A transaction is associated with the target object and it is in the process of rolling back.
STATUS_SUBMITTED - Static variable in interface javax.xml.registry.infomodel.RegistryEntry
RegistryEntry has been submitted.
STATUS_SUCCESS - Static variable in interface javax.xml.registry.JAXRResponse
Status indicating a successful response.
STATUS_UNAVAILABLE - Static variable in interface javax.xml.registry.JAXRResponse
Status indicating that the results are currently unavailable.
STATUS_UNKNOWN - Static variable in interface javax.transaction.Status
A transaction is associated with the target object but its current status cannot be determined.
STATUS_WARNING - Static variable in interface javax.xml.registry.JAXRResponse
Status indicating a successful response that included at least one warning.
STATUS_WITHDRAWN - Static variable in interface javax.xml.registry.infomodel.RegistryEntry
RegistryEntry has been withdrawn by the submitter.
STOP - Static variable in class javax.enterprise.deploy.shared.ActionType
A stop operation is being preformed on the DeploymentManager action command.
STOP - Static variable in class javax.enterprise.deploy.shared.CommandType
The DeploymentManger action operation being processed is stop.
stop(TargetModuleID[]) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Stop the application running.
stop() - Method in interface javax.enterprise.deploy.spi.status.ProgressObject
(optional) A stop request on an in-process operation allows the operation on the current TargetModuleID to run to completion but does not process any of the remaining unprocessed TargetModuleID objects.
stop() - Method in interface javax.jms.Connection
Temporarily stops a connection's delivery of incoming messages.
stop() - Method in interface javax.resource.spi.ResourceAdapter
This is called when a resource adapter instance is undeployed or during application server shutdown.
stop() - Method in class javax.xml.ws.Endpoint
Stops publishing this endpoint.
store - Variable in class javax.mail.Folder
The parent store.
STORE - Static variable in class javax.mail.Provider.Type

Store - Class in javax.mail
An abstract class that models a message store and its access protocol, for storing and retrieving messages.
Store(Session, URLName) - Constructor for class javax.mail.Store
Constructor.
StoreClosedException - Exception in javax.mail
This exception is thrown when a method is invoked on a Messaging object and the Store that owns that object has died due to some reason.
StoreClosedException(Store) - Constructor for exception javax.mail.StoreClosedException
Constructor
StoreClosedException(Store, String) - Constructor for exception javax.mail.StoreClosedException
Constructor
StoreEvent - Class in javax.mail.event
This class models notifications from the Store connection.
StoreEvent(Store, int, String) - Constructor for class javax.mail.event.StoreEvent
Constructor.
StoreListener - Interface in javax.mail.event
This is the Listener interface for Store Notifications.
Streamable - Interface in javax.resource.cci
Streamable interface enables a resource adapter to extract data from an input Record or set data into an output Record as a stream of bytes.
StreamFilter - Interface in javax.xml.stream
This interface declares a simple filter interface that one can create to filter XMLStreamReaders
StreamMessage - Interface in javax.jms
A StreamMessage object is used to send a stream of primitive types in the Java programming language.
StreamReaderDelegate - Class in javax.xml.stream.util
This is the base class for deriving an XMLStreamReader filter This class is designed to sit between an XMLStreamReader and an application's XMLStreamReader.
StreamReaderDelegate() - Constructor for class javax.xml.stream.util.StreamReaderDelegate
Construct an empty filter with no parent.
StreamReaderDelegate(XMLStreamReader) - Constructor for class javax.xml.stream.util.StreamReaderDelegate
Construct an filter with the specified parent.
STRING_ID - Static variable in class javax.faces.convert.BigDecimalConverter
The message identifier of the FacesMessage to be created if the conversion of the BigDecimal value to String fails.
STRING_ID - Static variable in class javax.faces.convert.BigIntegerConverter
The message identifier of the FacesMessage to be created if the conversion of the BigInteger value to String fails.
STRING_ID - Static variable in class javax.faces.convert.BooleanConverter
The message identifier of the FacesMessage to be created if the conversion of the Boolean value to String fails.
STRING_ID - Static variable in class javax.faces.convert.ByteConverter
The message identifier of the FacesMessage to be created if the conversion of the Byte value to String fails.
STRING_ID - Static variable in class javax.faces.convert.CharacterConverter
The message identifier of the FacesMessage to be created if the conversion of the Character value to String fails.
STRING_ID - Static variable in class javax.faces.convert.DateTimeConverter
The message identifier of the FacesMessage to be created if the conversion of the DateTime value to String fails.
STRING_ID - Static variable in class javax.faces.convert.DoubleConverter
The message identifier of the FacesMessage to be created if the conversion of the Double value to String fails.
STRING_ID - Static variable in class javax.faces.convert.FloatConverter
The message identifier of the FacesMessage to be created if the conversion of the Float value to String fails.
STRING_ID - Static variable in class javax.faces.convert.IntegerConverter
The message identifier of the FacesMessage to be created if the conversion of the Integer value to String fails.
STRING_ID - Static variable in class javax.faces.convert.LongConverter
The message identifier of the FacesMessage to be created if the conversion of the Long value to String fails.
STRING_ID - Static variable in class javax.faces.convert.NumberConverter
The message identifier of the FacesMessage to be created if the conversion of the Number value to String fails.
STRING_ID - Static variable in class javax.faces.convert.ShortConverter
The message identifier of the FacesMessage to be created if the conversion of the Short value to String fails.
StringHolder - Class in javax.xml.rpc.holders

StringHolder() - Constructor for class javax.xml.rpc.holders.StringHolder

StringHolder(String) - Constructor for class javax.xml.rpc.holders.StringHolder

StringTerm - Class in javax.mail.search
This class implements the match method for Strings.
StringTerm(String) - Constructor for class javax.mail.search.StringTerm

StringTerm(String, boolean) - Constructor for class javax.mail.search.StringTerm

Stub - Interface in javax.xml.rpc
The interface javax.xml.rpc.Stub is the common base interface for the stub classes.
SubjectTerm - Class in javax.mail.search
This class implements comparisons for the Message Subject header.
SubjectTerm(String) - Constructor for class javax.mail.search.SubjectTerm
Constructor.
SUPPORT_DTD - Static variable in class javax.xml.stream.XMLInputFactory
The property that requires the parser to support DTDs
supports(String) - Method in interface javax.security.jacc.PolicyContextHandler
This public method returns a boolean result indicating whether or not the handler supports the context object identified by the (case-sensitive) key value.
supportsExecuteWithInputAndOutputRecord() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Returns true if the implementation class for the Interaction interface implements public boolean execute(InteractionSpec ispec, Record input, Record output) method; otherwise the method returns false.
supportsExecuteWithInputRecordOnly() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Returns true if the implementation class for the Interaction interface implements public Record execute(InteractionSpec ispec, Record input) method; otherwise the method returns false.
supportsLocalTransactionDemarcation() - Method in interface javax.resource.cci.ResourceAdapterMetaData
Returns true if the resource adapter implements the LocalTransaction interface and supports local transaction demarcation on the underlying EIS instance through the LocalTransaction interface.
supportsResultSetType(int) - Method in interface javax.resource.cci.ResultSetInfo
Indicates whether or not a resource adapter supports a type of ResultSet.
supportsResultTypeConcurrency(int, int) - Method in interface javax.resource.cci.ResultSetInfo
Indicates whether or not a resource adapter supports the concurrency type in combination with the given ResultSet type/
suspend() - Method in interface javax.transaction.TransactionManager
Suspend the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended.
SYNC_RECEIVE - Static variable in interface javax.resource.cci.InteractionSpec
The execution of an Interaction results in a synchronous receive of an output Record.
SYNC_SEND - Static variable in interface javax.resource.cci.InteractionSpec
Interaction Verb type: The execution of an Interaction does only a send to the target EIS instance.
SYNC_SEND_RECEIVE - Static variable in interface javax.resource.cci.InteractionSpec
Interaction Verb type: The execution of an Interaction sends a request to the EIS instance and receives response synchronously.
Synchronization - Interface in javax.transaction
The transaction manager supports a synchronization mechanism that allows the interested party to be notified before and after the transaction completes.
SystemException - Exception in javax.transaction
The SystemException is thrown by the transaction manager to indicate that it has encountered an unexpected error condition that prevents future transaction services from proceeding.
SystemException() - Constructor for exception javax.transaction.SystemException

SystemException(String) - Constructor for exception javax.transaction.SystemException
Create a SystemException with a given string.
SystemException(int) - Constructor for exception javax.transaction.SystemException
Create a SystemException with a given error code.

T

Table - Annotation Type in javax.persistence
This annotation specifies the primary table for the annotated entity.
TableGenerator - Annotation Type in javax.persistence
This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
Tag - Interface in javax.servlet.jsp.tagext
The interface of a classic tag handler that does not want to manipulate its body.
TagAdapter - Class in javax.servlet.jsp.tagext
Wraps any SimpleTag and exposes it using a Tag interface.
TagAdapter(SimpleTag) - Constructor for class javax.servlet.jsp.tagext.TagAdapter
Creates a new TagAdapter that wraps the given SimpleTag and returns the parent tag when getParent() is called.
TagAttributeInfo - Class in javax.servlet.jsp.tagext
Information on the attributes of a Tag, available at translation time.
TagAttributeInfo(String, boolean, String, boolean) - Constructor for class javax.servlet.jsp.tagext.TagAttributeInfo
Constructor for TagAttributeInfo.
TagAttributeInfo(String, boolean, String, boolean, boolean) - Constructor for class javax.servlet.jsp.tagext.TagAttributeInfo
JSP 2.0 Constructor for TagAttributeInfo.
TagAttributeInfo(String, boolean, String, boolean, boolean, String, boolean, boolean, String, String) - Constructor for class javax.servlet.jsp.tagext.TagAttributeInfo
JSP 2.1 Constructor for TagAttributeInfo.
TagData - Class in javax.servlet.jsp.tagext
The (translation-time only) attribute/value information for a tag instance.
TagData(Object[][]) - Constructor for class javax.servlet.jsp.tagext.TagData
Constructor for TagData.
TagData(Hashtable<String, Object>) - Constructor for class javax.servlet.jsp.tagext.TagData
Constructor for a TagData.
TagExtraInfo - Class in javax.servlet.jsp.tagext
Optional class provided by the tag library author to describe additional translation-time information not described in the TLD.
TagExtraInfo() - Constructor for class javax.servlet.jsp.tagext.TagExtraInfo
Sole constructor.
TagFileInfo - Class in javax.servlet.jsp.tagext
Tag information for a tag file in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.
TagFileInfo(String, String, TagInfo) - Constructor for class javax.servlet.jsp.tagext.TagFileInfo
Constructor for TagFileInfo from data in the JSP 2.0 format for TLD.
tagFiles - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
An array describing the tag files that are defined in this tag library.
TagInfo - Class in javax.servlet.jsp.tagext
Tag information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.
TagInfo(String, String, String, String, TagLibraryInfo, TagExtraInfo, TagAttributeInfo[]) - Constructor for class javax.servlet.jsp.tagext.TagInfo
Constructor for TagInfo from data in the JSP 1.1 format for TLD.
TagInfo(String, String, String, String, TagLibraryInfo, TagExtraInfo, TagAttributeInfo[], String, String, String, TagVariableInfo[]) - Constructor for class javax.servlet.jsp.tagext.TagInfo
Constructor for TagInfo from data in the JSP 1.2 format for TLD.
TagInfo(String, String, String, String, TagLibraryInfo, TagExtraInfo, TagAttributeInfo[], String, String, String, TagVariableInfo[], boolean) - Constructor for class javax.servlet.jsp.tagext.TagInfo
Constructor for TagInfo from data in the JSP 2.0 format for TLD.
TagLibraryInfo - Class in javax.servlet.jsp.tagext
Translation-time information associated with a taglib directive, and its underlying TLD file.
TagLibraryInfo(String, String) - Constructor for class javax.servlet.jsp.tagext.TagLibraryInfo
Constructor.
TagLibraryValidator - Class in javax.servlet.jsp.tagext
Translation-time validator class for a JSP page.
TagLibraryValidator() - Constructor for class javax.servlet.jsp.tagext.TagLibraryValidator
Sole constructor.
tags - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
An array describing the tags that are defined in this tag library.
TagSupport - Class in javax.servlet.jsp.tagext
A base class for defining new tag handlers implementing Tag.
TagSupport() - Constructor for class javax.servlet.jsp.tagext.TagSupport
Default constructor, all subclasses are required to define only a public constructor with the same signature, and to call the superclass constructor.
TagVariableInfo - Class in javax.servlet.jsp.tagext
Variable information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file (TLD) and is available only at translation time.
TagVariableInfo(String, String, String, boolean, int) - Constructor for class javax.servlet.jsp.tagext.TagVariableInfo
Constructor for TagVariableInfo.
Target - Interface in javax.enterprise.deploy.spi
A Target interface represents a single logical core server of one instance of a J2EE platform product.
TargetException - Exception in javax.enterprise.deploy.spi.exceptions
This exception is to report bad target designators.
TargetException(String) - Constructor for exception javax.enterprise.deploy.spi.exceptions.TargetException
Creates an new TargetException object.
TargetModuleID - Interface in javax.enterprise.deploy.spi
A TargetModuleID interface represents a unique identifier for a deployed application module.
TELEPHONE_NUMBER - Static variable in interface javax.xml.registry.LifeCycleManager

TelephoneNumber - Interface in javax.xml.registry.infomodel
A simple re-usable entity class that defines attributes of a telephone number.
Temporal - Annotation Type in javax.persistence
This annotation must be specified for persistent fields or properties of type Date and Calendar.
TemporalType - Enum in javax.persistence
Type used to indicate a specific mapping of Date or Calendar.
TemporaryQueue - Interface in javax.jms
A TemporaryQueue object is a unique Queue object created for the duration of a Connection.
TemporaryTopic - Interface in javax.jms
A TemporaryTopic object is a unique Topic object created for the duration of a Connection.
term - Variable in class javax.mail.search.NotTerm
The search term to negate.
terms - Variable in class javax.mail.search.AndTerm
The array of terms on which the AND operator should be applied.
terms - Variable in class javax.mail.search.OrTerm
The array of terms on which the OR operator should be applied.
Text - Interface in javax.xml.soap
A representation of a node whose value is text.
TextMessage - Interface in javax.jms
A TextMessage object is used to send a message containing a java.lang.String.
TIME_ID - Static variable in class javax.faces.convert.DateTimeConverter
The message identifier of the FacesMessage to be created if the conversion to Time fails.
TimedObject - Interface in javax.ejb
The TimedObject interface contains the callback method that is used to deliver timer expiration notifications.
Timeout - Annotation Type in javax.ejb
Designates a method on a stateless session bean class or message driven bean class that should receive EJB timer expirations for that bean.
Timer - Interface in javax.ejb
The Timer interface contains information about a timer that was created through the EJB Timer Service.
TimerHandle - Interface in javax.ejb
The TimerHandle interface is implemented by all EJB timer handles.
TimerService - Interface in javax.ejb
The TimerService interface provides enterprise bean components with access to the container-provided Timer Service.
TimeStatistic - Interface in javax.management.j2ee.statistics
Specifies standard timing measurements.
tlibversion - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
The version of the tag library.
TMENDRSCAN - Static variable in interface javax.transaction.xa.XAResource
Ends a recovery scan.
TMFAIL - Static variable in interface javax.transaction.xa.XAResource
Disassociates the caller and marks the transaction branch rollback-only.
TMJOIN - Static variable in interface javax.transaction.xa.XAResource
Caller is joining existing transaction branch.
TMNOFLAGS - Static variable in interface javax.transaction.xa.XAResource
Use TMNOFLAGS to indicate no flags value is selected.
TMONEPHASE - Static variable in interface javax.transaction.xa.XAResource
Caller is using one-phase optimization.
TMRESUME - Static variable in interface javax.transaction.xa.XAResource
Caller is resuming association with a suspended transaction branch.
TMSTARTRSCAN - Static variable in interface javax.transaction.xa.XAResource
Starts a recovery scan.
TMSUCCESS - Static variable in interface javax.transaction.xa.XAResource
Disassociates caller from a transaction branch.
TMSUSPEND - Static variable in interface javax.transaction.xa.XAResource
Caller is suspending (not ending) its association with a transaction branch.
TO - Static variable in class javax.mail.Message.RecipientType
The "To" (primary) recipients.
Topic - Interface in javax.jms
A Topic object encapsulates a provider-specific topic name.
TopicConnection - Interface in javax.jms
A TopicConnection object is an active connection to a publish/subscribe JMS provider.
TopicConnectionFactory - Interface in javax.jms
A client uses a TopicConnectionFactory object to create TopicConnection objects with a publish/subscribe JMS provider.
TopicPublisher - Interface in javax.jms
A client uses a TopicPublisher object to publish messages on a topic.
TopicRequestor - Class in javax.jms
The TopicRequestor helper class simplifies making service requests.
TopicRequestor(TopicSession, Topic) - Constructor for class javax.jms.TopicRequestor
Constructor for the TopicRequestor class.
TopicSession - Interface in javax.jms
A TopicSession object provides methods for creating TopicPublisher, TopicSubscriber, and TemporaryTopic objects.
TopicSubscriber - Interface in javax.jms
A client uses a TopicSubscriber object to receive messages that have been published to a topic.
toString() - Method in class javax.activation.MimeType
Return the String representation of this object.
toString() - Method in class javax.activation.MimeTypeParameterList
Return a string representation of this object.
toString() - Method in class javax.enterprise.deploy.shared.ActionType
Return the string name of this ActionType or the integer value if outside the bounds of the table
toString() - Method in class javax.enterprise.deploy.shared.CommandType
Return the string name of this CommandType or the integer value if outside the bounds of the table
toString() - Method in class javax.enterprise.deploy.shared.DConfigBeanVersionType
Return the string name of this DConfigBeanVersionType or the integer value if outside the bounds of the table
toString() - Method in class javax.enterprise.deploy.shared.ModuleType
Return the string name of this ModuleType or the integer value if outside the bounds of the table
toString() - Method in class javax.enterprise.deploy.shared.StateType
Return the string name of this StateType or the integer value if outside the bounds of the table
toString() - Method in interface javax.enterprise.deploy.spi.TargetModuleID
Retrieve the identifier representing the deployed module.
toString() - Method in class javax.faces.application.FacesMessage.Severity
Return a String representation of this FacesMessage.Severity instance.
toString() - Method in class javax.faces.event.PhaseId
Return a String representation of this PhaseId instance.
toString() - Method in interface javax.jms.Queue
Returns a string representation of this object.
toString() - Method in interface javax.jms.Topic
Returns a string representation of this object.
toString() - Method in class javax.mail.Address
Return a String representation of this address object.
toString() - Method in class javax.mail.Folder
override the default toString(), it will return the String from Folder.getFullName() or if that is null, it will use the default toString() behavior.
toString() - Method in exception javax.mail.internet.AddressException

toString() - Method in class javax.mail.internet.ContentDisposition
Retrieve a RFC2045 style string representation of this ContentDisposition.
toString() - Method in class javax.mail.internet.ContentType
Retrieve a RFC2045 style string representation of this Content-Type.
toString() - Method in class javax.mail.internet.InternetAddress
Convert this address into a RFC 822 / RFC 2047 encoded address.
toString(Address[]) - Static method in class javax.mail.internet.InternetAddress
Convert the given array of InternetAddress objects into a comma separated sequence of address strings.
toString(Address[], int) - Static method in class javax.mail.internet.InternetAddress
Convert the given array of InternetAddress objects into a comma separated sequence of address strings.
toString() - Method in class javax.mail.internet.NewsAddress
Convert this address into a RFC 1036 address.
toString(Address[]) - Static method in class javax.mail.internet.NewsAddress
Convert the given array of NewsAddress objects into a comma separated sequence of address strings.
toString() - Method in class javax.mail.internet.ParameterList
Convert this ParameterList into a MIME String.
toString(int) - Method in class javax.mail.internet.ParameterList
Convert this ParameterList into a MIME String.
toString() - Method in class javax.mail.Message.RecipientType

toString() - Method in exception javax.mail.MessagingException
Override toString method to provide information on nested exceptions.
toString() - Method in class javax.mail.Provider
Overrides Object.toString()
toString() - Method in class javax.mail.Provider.Type

toString() - Method in class javax.mail.Service
Return getURLName.toString() if this service has a URLName, otherwise it will return the default toString.
toString() - Method in class javax.mail.URLName
Constructs a string representation of this URLName.
toString() - Method in class javax.servlet.jsp.tagext.TagAttributeInfo
Returns a String representation of this TagAttributeInfo, suitable for debugging purposes.
toString() - Method in class javax.xml.bind.helpers.ValidationEventImpl
Returns a string representation of this object in a format helpful to debugging.
toString() - Method in class javax.xml.bind.helpers.ValidationEventLocatorImpl
Returns a string representation of this object in a format helpful to debugging.
toString() - Method in exception javax.xml.bind.JAXBException
Returns a short description of this JAXBException.
toString() - Method in exception javax.xml.bind.TypeConstraintException
Returns a short description of this TypeConstraintException.
toString() - Method in interface javax.xml.registry.Query
Returns the String representing the query.
toString() - Method in class javax.xml.rpc.ParameterMode
Returns a String describing this ParameterMode object.
toUnicodeString() - Method in class javax.mail.internet.InternetAddress
Returns a properly formatted address (RFC 822 syntax) of Unicode characters.
toXML() - Method in interface javax.xml.registry.infomodel.RegistryObject
Returns a registry provider specific XML representation of this Object.
Transaction - Interface in javax.transaction
The Transaction interface allows operations to be performed against the transaction in the target Transaction object.
TransactionAttribute - Annotation Type in javax.ejb
When applied at the TYPE-level, designates the default transaction attribute for all business methods of the session or message driven bean.
TransactionAttributeType - Enum in javax.ejb

TransactionInProgressException - Exception in javax.jms
This exception is thrown when an operation is invalid because a transaction is in progress.
TransactionInProgressException(String, String) - Constructor for exception javax.jms.TransactionInProgressException
Constructs a TransactionInProgressException with the specified reason and error code.
TransactionInProgressException(String) - Constructor for exception javax.jms.TransactionInProgressException
Constructs a TransactionInProgressException with the specified reason.
TransactionManagement - Annotation Type in javax.ejb
Declares whether a session bean or message driven bean has container managed transactions or bean managed transactions.
TransactionManagementType - Enum in javax.ejb

TransactionManager - Interface in javax.transaction
The TransactionManager interface defines the methods that allow an application server to manage transaction boundaries.
TransactionRequiredException - Exception in javax.persistence
Thrown by the persistence provider when a transaction is required but is not active.
TransactionRequiredException() - Constructor for exception javax.persistence.TransactionRequiredException
Constructs a new TransactionRequiredException exception with null as its detail message.
TransactionRequiredException(String) - Constructor for exception javax.persistence.TransactionRequiredException
Constructs a new TransactionRequiredException exception with the specified detail message.
TransactionRequiredException - Exception in javax.transaction
This exception indicates that a request carried a null transaction context, but the target object requires an activate transaction.
TransactionRequiredException() - Constructor for exception javax.transaction.TransactionRequiredException

TransactionRequiredException(String) - Constructor for exception javax.transaction.TransactionRequiredException

TransactionRequiredLocalException - Exception in javax.ejb
This exception indicates that a request carried a null transaction context, but the target object requires an active transaction.
TransactionRequiredLocalException() - Constructor for exception javax.ejb.TransactionRequiredLocalException
Constructs a TransactionRequiredLocalException with no detail message.
TransactionRequiredLocalException(String) - Constructor for exception javax.ejb.TransactionRequiredLocalException
Constructs an TransactionRequiredLocalException with the specified detailed message.
TransactionRolledBackException - Exception in javax.jms
This exception must be thrown when a call to Session.commit results in a rollback of the current transaction.
TransactionRolledBackException(String, String) - Constructor for exception javax.jms.TransactionRolledBackException
Constructs a TransactionRolledBackException with the specified reason and error code.
TransactionRolledBackException(String) - Constructor for exception javax.jms.TransactionRolledBackException
Constructs a TransactionRolledBackException with the specified reason.
TransactionRolledbackException - Exception in javax.transaction
This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back.
TransactionRolledbackException() - Constructor for exception javax.transaction.TransactionRolledbackException

TransactionRolledbackException(String) - Constructor for exception javax.transaction.TransactionRolledbackException

TransactionRolledbackLocalException - Exception in javax.ejb
This exception indicates that the transaction associated with processing of the request has been rolled back, or marked to roll back.
TransactionRolledbackLocalException() - Constructor for exception javax.ejb.TransactionRolledbackLocalException
Constructs a TransactionRolledbackLocalException with no detail message.
TransactionRolledbackLocalException(String) - Constructor for exception javax.ejb.TransactionRolledbackLocalException
Constructs a TransactionRolledbackLocalException with the specified detailed message.
TransactionRolledbackLocalException(String, Exception) - Constructor for exception javax.ejb.TransactionRolledbackLocalException
Constructs a TransactionRolledbackLocalException with the specified detail message and a nested exception.
TransactionSynchronizationRegistry - Interface in javax.transaction
This interface is intended for use by system level application server components such as persistence managers, resource adapters, as well as EJB and Web application components.
transform(ClassLoader, String, Class<?>, ProtectionDomain, byte[]) - Method in interface javax.persistence.spi.ClassTransformer
Invoked when a class is being loaded or redefined.
Transient - Annotation Type in javax.persistence
This annotation specifies that the property or field is not persistent.
TRANSPORT - Static variable in class javax.mail.Provider.Type

Transport - Class in javax.mail
An abstract class that models a message transport.
Transport(Session, URLName) - Constructor for class javax.mail.Transport
Constructor.
TransportAdapter - Class in javax.mail.event
The adapter which receives Transport events.
TransportAdapter() - Constructor for class javax.mail.event.TransportAdapter

TransportEvent - Class in javax.mail.event
This class models Transport events.
TransportEvent(Transport, int, Address[], Address[], Address[], Message) - Constructor for class javax.mail.event.TransportEvent
Constructor.
TransportListener - Interface in javax.mail.event
This is the Listener interface for Transport events
TryCatchFinally - Interface in javax.servlet.jsp.tagext
The auxiliary interface of a Tag, IterationTag or BodyTag tag handler that wants additional hooks for managing resources.
TX_CONCURRENT_WORK_DISALLOWED - Static variable in exception javax.resource.spi.work.WorkException
Indicates that concurrent work within a transaction is disallowed.
TX_RECREATE_FAILED - Static variable in exception javax.resource.spi.work.WorkException
Indicates a failure in recreating the specified transaction context.
TYPE - Static variable in class javax.el.ELResolver
The attribute name of the named attribute in the FeatureDescriptor that specifies the runtime type of the variable or property.
type - Variable in class javax.mail.event.ConnectionEvent
The event type.
type - Variable in class javax.mail.event.FolderEvent
The event type.
type - Variable in class javax.mail.event.MessageChangedEvent
The event type.
type - Variable in class javax.mail.event.MessageCountEvent
The event type.
type - Variable in class javax.mail.event.StoreEvent
The event type.
type - Variable in class javax.mail.event.TransportEvent
The event type.
type - Variable in class javax.mail.Message.RecipientType
The type of recipient, usually the name of a corresponding Internet standard header.
type - Variable in class javax.mail.search.RecipientTerm
The recipient type.
TYPE_MESSAGE_ID - Static variable in class javax.faces.validator.DoubleRangeValidator
The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type.
TYPE_MESSAGE_ID - Static variable in class javax.faces.validator.LongRangeValidator
The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type.
TypeConstraintException - Exception in javax.xml.bind
This exception indicates that a violation of a dynamically checked type constraint was detected.
TypeConstraintException(String) - Constructor for exception javax.xml.bind.TypeConstraintException
Construct a TypeConstraintException with the specified detail message.
TypeConstraintException(String, String) - Constructor for exception javax.xml.bind.TypeConstraintException
Construct a TypeConstraintException with the specified detail message and vendor specific errorCode.
TypeConstraintException(Throwable) - Constructor for exception javax.xml.bind.TypeConstraintException
Construct a TypeConstraintException with a linkedException.
TypeConstraintException(String, Throwable) - Constructor for exception javax.xml.bind.TypeConstraintException
Construct a TypeConstraintException with the specified detail message and linkedException.
TypeConstraintException(String, String, Throwable) - Constructor for exception javax.xml.bind.TypeConstraintException
Construct a TypeConstraintException with the specified detail message, vendor specific errorCode, and linkedException.
TypeMapping - Interface in javax.xml.rpc.encoding
The javax.xml.rpc.encoding.TypeMapping is the base interface for the representation of a type mapping.
TypeMappingRegistry - Interface in javax.xml.rpc.encoding
The interface javax.xml.rpc.encoding.TypeMappingRegistry defines a registry of TypeMapping instances for various encoding styles.

U

UIColumn - Class in javax.faces.component
UIColumn is a UIComponent that represents a single column of data within a parent UIData component.
UIColumn() - Constructor for class javax.faces.component.UIColumn
Create a new UIColumn instance with default property values.
UICommand - Class in javax.faces.component
UICommand is a UIComponent that represents a user interface component which, when activated by the user, triggers an application specific "command" or "action".
UICommand() - Constructor for class javax.faces.component.UICommand
Create a new UICommand instance with default property values.
UIComponent - Class in javax.faces.component
UIComponent is the base class for all user interface components in JavaServer Faces.
UIComponent() - Constructor for class javax.faces.component.UIComponent

UIComponentBase - Class in javax.faces.component
UIComponentBase is a convenience base class that implements the default concrete behavior of all methods defined by UIComponent.
UIComponentBase() - Constructor for class javax.faces.component.UIComponentBase

UIComponentBodyTag - Class in javax.faces.webapp
Deprecated. All component tags now implement BodyTag. This class has been replaced by UIComponentELTag.
UIComponentBodyTag() - Constructor for class javax.faces.webapp.UIComponentBodyTag
Deprecated.
UIComponentClassicTagBase - Class in javax.faces.webapp
UIComponentTagBase is the base class for all JSP tags that use the "classic" JSP tag interface that correspond to a UIComponent instance in the view.
UIComponentClassicTagBase() - Constructor for class javax.faces.webapp.UIComponentClassicTagBase

UIComponentELTag - Class in javax.faces.webapp
UIComponentELTag specializes its superclass to allow for properties that take their values from EL API expressions.
UIComponentELTag() - Constructor for class javax.faces.webapp.UIComponentELTag

UIComponentTag - Class in javax.faces.webapp
Deprecated. Use of this class has been replaced with UIComponentELTag, which extends UIComponentClassicTagBase to add properties that use the EL API introduced as part of JSP 2.1.
UIComponentTag() - Constructor for class javax.faces.webapp.UIComponentTag
Deprecated.
UIComponentTagBase - Class in javax.faces.webapp
UIComponentTagBase is the base class for all JSP tags that correspond to a UIComponent instance in the view.
UIComponentTagBase() - Constructor for class javax.faces.webapp.UIComponentTagBase

UID - Static variable in class javax.mail.UIDFolder.FetchProfileItem
UID is a fetch profile item that can be included in a FetchProfile during a fetch request to a Folder.
UIData - Class in javax.faces.component
UIData is a UIComponent that supports data binding to a collection of data objects represented by a DataModel instance, which is the current value of this component itself (typically established via a ValueExpression).
UIData() - Constructor for class javax.faces.component.UIData
Create a new UIData instance with default property values.
UIDFolder - Interface in javax.mail
The UIDFolder interface is implemented by Folders that can support the "disconnected" mode of operation, by providing unique-ids for messages in the folder.
UIDFolder.FetchProfileItem - Class in javax.mail
A fetch profile item for fetching UIDs.
UIDFolder.FetchProfileItem(String) - Constructor for class javax.mail.UIDFolder.FetchProfileItem

UIForm - Class in javax.faces.component
UIForm is a UIComponent that represents an input form to be presented to the user, and whose child components represent (among other things) the input fields to be included when the form is submitted.
UIForm() - Constructor for class javax.faces.component.UIForm
Create a new UIForm instance with default property values.
UIGraphic - Class in javax.faces.component
UIGraphic is a UIComponent that displays a graphical image to the user.
UIGraphic() - Constructor for class javax.faces.component.UIGraphic
Create a new UIGraphic instance with default property values.
UIInput - Class in javax.faces.component
UIInput is a UIComponent that represents a component that both displays output to the user (like UIOutput components do) and processes request parameters on the subsequent request that need to be decoded.
UIInput() - Constructor for class javax.faces.component.UIInput
Create a new UIInput instance with default property values.
UIMessage - Class in javax.faces.component
This component is responsible for displaying messages for a specific UIComponent, identified by a clientId.
UIMessage() - Constructor for class javax.faces.component.UIMessage
Create a new UIMessage instance with default property values.
UIMessages - Class in javax.faces.component
The renderer for this component is responsible for obtaining the messages from the FacesContext and displaying them to the user.
UIMessages() - Constructor for class javax.faces.component.UIMessages
Create a new UIMessages instance with default property values.
UINamingContainer - Class in javax.faces.component
UINamingContainer is a convenience base class for components that wish to implement NamingContainer functionality.
UINamingContainer() - Constructor for class javax.faces.component.UINamingContainer
Create a new UINamingContainer instance with default property values.
UIOutput - Class in javax.faces.component
UIOutput is a UIComponent that has a value, optionally retrieved from a model tier bean via a value expression, that is displayed to the user.
UIOutput() - Constructor for class javax.faces.component.UIOutput
Create a new UIOutput instance with default property values.
UIPanel - Class in javax.faces.component
UIPanel is a UIComponent that manages the layout of its child components.
UIPanel() - Constructor for class javax.faces.component.UIPanel
Create a new UIPanel instance with default property values.
UIParameter - Class in javax.faces.component
UIParameter is a UIComponent that represents an optionally named configuration parameter for a parent component.
UIParameter() - Constructor for class javax.faces.component.UIParameter
Create a new UIParameter instance with default property values.
UISelectBoolean - Class in javax.faces.component
UISelectBoolean is a UIComponent that represents a single boolean (true or false) value.
UISelectBoolean() - Constructor for class javax.faces.component.UISelectBoolean
Create a new UISelectBoolean instance with default property values.
UISelectItem - Class in javax.faces.component
UISelectItem is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of a SelectItem instance to the list of available options for the parent component.
UISelectItem() - Constructor for class javax.faces.component.UISelectItem
Create a new UISelectItem instance with default property values.
UISelectItems - Class in javax.faces.component
UISelectItems is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of one or more SelectItem instances to the list of available options in the parent component.
UISelectItems() - Constructor for class javax.faces.component.UISelectItems
Create a new UISelectItems instance with default property values.
UISelectMany - Class in javax.faces.component
UISelectMany is a UIComponent that represents the user's choice of a zero or more items from among a discrete set of available options.
UISelectMany() - Constructor for class javax.faces.component.UISelectMany
Create a new UISelectMany instance with default property values.
UISelectOne - Class in javax.faces.component
UISelectOne is a UIComponent that represents the user's choice of zero or one items from among a discrete set of available options.
UISelectOne() - Constructor for class javax.faces.component.UISelectOne
Create a new UISelectOne instance with default property values.
UIViewRoot - Class in javax.faces.component
UIViewRoot is the UIComponent that represents the root of the UIComponent tree.
UIViewRoot() - Constructor for class javax.faces.component.UIViewRoot
Create a new UIViewRoot instance with default property values.
UnavailableException - Exception in javax.resource.spi
This is thrown to indicate that a service is unavailable.
UnavailableException() - Constructor for exception javax.resource.spi.UnavailableException
Constructs a new instance with null as its detail message.
UnavailableException(String) - Constructor for exception javax.resource.spi.UnavailableException
Constructs a new instance with the specified detail message.
UnavailableException(Throwable) - Constructor for exception javax.resource.spi.UnavailableException
Constructs a new throwable with the specified cause.
UnavailableException(String, Throwable) - Constructor for exception javax.resource.spi.UnavailableException
Constructs a new throwable with the specified detail message and cause.
UnavailableException(String, String) - Constructor for exception javax.resource.spi.UnavailableException
Constructs a new throwable with the specified detail message and an error code.
UnavailableException - Exception in javax.servlet
Defines an exception that a servlet or filter throws to indicate that it is permanently or temporarily unavailable.
UnavailableException(Servlet, String) - Constructor for exception javax.servlet.UnavailableException
Deprecated. As of Java Servlet API 2.2, use UnavailableException.UnavailableException(String) instead.
UnavailableException(int, Servlet, String) - Constructor for exception javax.servlet.UnavailableException
Deprecated. As of Java Servlet API 2.2, use UnavailableException.UnavailableException(String, int) instead.
UnavailableException(String) - Constructor for exception javax.servlet.UnavailableException
Constructs a new exception with a descriptive message indicating that the servlet is permanently unavailable.
UnavailableException(String, int) - Constructor for exception javax.servlet.UnavailableException
Constructs a new exception with a descriptive message indicating that the servlet is temporarily unavailable and giving an estimate of how long it will be unavailable.
UNBOUNDED_BUFFER - Static variable in class javax.servlet.jsp.JspWriter
Constant indicating that the Writer is buffered and is unbounded; this is used in BodyContent.
unConfirmAssociation(Association) - Method in interface javax.xml.registry.BusinessLifeCycleManager
Undoes a previous confirmation of this Association by the User associated with the caller.
UNDEFINED - Static variable in exception javax.resource.spi.work.WorkException
Undefined error code.
UNDEPLOY - Static variable in class javax.enterprise.deploy.shared.CommandType
The DeploymentManger action operation being processed is undeploy.
undeploy(TargetModuleID[]) - Method in interface javax.enterprise.deploy.spi.DeploymentManager
Remove the application from the target server.
unDeprecateObjects(Collection) - Method in interface javax.xml.registry.LifeCycleManager
Undeprecates one or more previously deprecated objects.
UnexpectedObjectException - Exception in javax.xml.registry
This exception is thrown when the JAXR provider finds a Object that is out-of-place or of the wrong type within the context of a user request.
UnexpectedObjectException() - Constructor for exception javax.xml.registry.UnexpectedObjectException
Constructs a JAXRException object with no reason or embedded Throwable.
UnexpectedObjectException(String) - Constructor for exception javax.xml.registry.UnexpectedObjectException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
UnexpectedObjectException(String, Throwable) - Constructor for exception javax.xml.registry.UnexpectedObjectException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
UnexpectedObjectException(Throwable) - Constructor for exception javax.xml.registry.UnexpectedObjectException
Constructs a JAXRException object initialized with the given Throwable object.
unfold(String) - Static method in class javax.mail.internet.MimeUtility
Unfold a folded header.
UNIQUE_ID_PREFIX - Static variable in class javax.faces.component.UIViewRoot
The prefix that will be used for identifiers generated by the createUniqueId() method.
UNIQUE_ID_PREFIX - Static variable in class javax.faces.webapp.UIComponentClassicTagBase
Used as the prefix for ids.
UniqueConstraint - Annotation Type in javax.persistence
This annotation is used to specify that a unique constraint is to be included in the generated DDL for a primary or secondary table.
UNKNOWN - Static variable in interface javax.resource.spi.work.WorkManager
A constant to indicate an unknown start delay duration or other unknown values.
unmarshal(String) - Method in class javax.xml.bind.annotation.adapters.CollapsedStringAdapter
Removes leading and trailing whitespaces of the string given as the parameter, then truncate any sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
unmarshal(String) - Method in class javax.xml.bind.annotation.adapters.HexBinaryAdapter

unmarshal(String) - Method in class javax.xml.bind.annotation.adapters.NormalizedStringAdapter
Removes leading and trailing whitespaces of the string given as the parameter, then replace any tab, CR, and LF by a whitespace character ' '.
unmarshal(ValueType) - Method in class javax.xml.bind.annotation.adapters.XmlAdapter
Convert a value type to a bound type.
unmarshal(XmlNode) - Method in class javax.xml.bind.Binder
Unmarshal XML infoset view to a JAXB object tree.
unmarshal(XmlNode, Class<T>) - Method in class javax.xml.bind.Binder
Unmarshal XML root element by provided declaredType to a JAXB object tree.
unmarshal(Source) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(XMLReader, InputSource) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
Unmarshals an object by using the specified XMLReader and the InputSource.
unmarshal(InputSource) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(URL) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(File) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(InputStream) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(Reader) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(XMLEventReader) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(XMLStreamReader) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(Node, Class<T>) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(Source, Class<T>) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(XMLStreamReader, Class<T>) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(XMLEventReader, Class<T>) - Method in class javax.xml.bind.helpers.AbstractUnmarshallerImpl

unmarshal(File) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified file and return the resulting content tree.
unmarshal(InputStream) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified InputStream and return the resulting content tree.
unmarshal(Reader) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified Reader and return the resulting content tree.
unmarshal(URL) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified URL and return the resulting content tree.
unmarshal(InputSource) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified SAX InputSource and return the resulting content tree.
unmarshal(Node) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal global XML data from the specified DOM tree and return the resulting content tree.
unmarshal(Node, Class<T>) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data by JAXB mapped declaredType and return the resulting content tree.
unmarshal(Source) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified XML Source and return the resulting content tree.
unmarshal(Source, Class<T>) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified XML Source by declaredType and return the resulting content tree.
unmarshal(XMLStreamReader) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified pull parser and return the resulting content tree.
unmarshal(XMLStreamReader, Class<T>) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.
unmarshal(XMLEventReader) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal XML data from the specified pull parser and return the resulting content tree.
unmarshal(XMLEventReader, Class<T>) - Method in interface javax.xml.bind.Unmarshaller
Unmarshal root element to JAXB mapped declaredType and return the resulting content tree.
UnmarshalException - Exception in javax.xml.bind
This exception indicates that an error has occurred while performing an unmarshal operation that prevents the JAXB Provider from completing the operation.
UnmarshalException(String) - Constructor for exception javax.xml.bind.UnmarshalException
Construct an UnmarshalException with the specified detail message.
UnmarshalException(String, String) - Constructor for exception javax.xml.bind.UnmarshalException
Construct an UnmarshalException with the specified detail message and vendor specific errorCode.
UnmarshalException(Throwable) - Constructor for exception javax.xml.bind.UnmarshalException
Construct an UnmarshalException with a linkedException.
UnmarshalException(String, Throwable) - Constructor for exception javax.xml.bind.UnmarshalException
Construct an UnmarshalException with the specified detail message and linkedException.
UnmarshalException(String, String, Throwable) - Constructor for exception javax.xml.bind.UnmarshalException
Construct an UnmarshalException with the specified detail message, vendor specific errorCode, and linkedException.
Unmarshaller - Interface in javax.xml.bind
The Unmarshaller class governs the process of deserializing XML data into newly created Java content trees, optionally validating the XML data as it is unmarshalled.
Unmarshaller.Listener - Class in javax.xml.bind

Register an instance of an implementation of this class with Unmarshaller to externally listen for unmarshal events.
Unmarshaller.Listener() - Constructor for class javax.xml.bind.Unmarshaller.Listener

UnmarshallerHandler - Interface in javax.xml.bind
Unmarshaller implemented as SAX ContentHandler.
unregisterTypeMapping(String) - Method in interface javax.xml.rpc.encoding.TypeMappingRegistry
Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.
unsetEntityContext() - Method in interface javax.ejb.EntityBean
Unset the associated entity context.
unsubscribe(String) - Method in interface javax.jms.Session
Unsubscribes a durable subscription that has been created by a client.
unsubscribe(String) - Method in interface javax.jms.TopicSession
Unsubscribes a durable subscription that has been created by a client.
UnsupportedCapabilityException - Exception in javax.xml.registry
This exception must be thrown when a JAXR client attempts to invoke an API method that is not supported by the capability profile that is supported by the JAXR provider.
UnsupportedCapabilityException() - Constructor for exception javax.xml.registry.UnsupportedCapabilityException
Constructs a JAXRException object with no reason or embedded Throwable.
UnsupportedCapabilityException(String) - Constructor for exception javax.xml.registry.UnsupportedCapabilityException
Constructs a JAXRException object with the given String as the reason for the exception being thrown.
UnsupportedCapabilityException(String, Throwable) - Constructor for exception javax.xml.registry.UnsupportedCapabilityException
Constructs a JAXRException object with the given String as the reason for the exception being thrown and the given Throwable object as an embedded Throwable.
UnsupportedCapabilityException(Throwable) - Constructor for exception javax.xml.registry.UnsupportedCapabilityException
Constructs a JAXRException object initialized with the given Throwable object.
UnsupportedDataTypeException - Exception in javax.activation
Signals that the requested operation does not support the requested data type.
UnsupportedDataTypeException() - Constructor for exception javax.activation.UnsupportedDataTypeException
Constructs an UnsupportedDataTypeException with no detail message.
UnsupportedDataTypeException(String) - Constructor for exception javax.activation.UnsupportedDataTypeException
Constructs an UnsupportedDataTypeException with the specified message.
UPDATE_MESSAGE_ID - Static variable in class javax.faces.component.UIInput
The message identifier of the FacesMessage to be created if a model update error occurs, and the thrown exception has no message.
UPDATE_MODEL_VALUES - Static variable in class javax.faces.event.PhaseId
Identifier that indicates an interest in events queued for the Update Model Values phase of the request processing lifecycle.
updateHeaders() - Method in class javax.mail.internet.MimeBodyPart
Examine the content of this body part and update the appropriate MIME headers.
updateHeaders() - Method in class javax.mail.internet.MimeMessage
Called by the saveChanges method to actually update the MIME headers.
updateHeaders() - Method in class javax.mail.internet.MimeMultipart
Update headers.
updateHeaders() - Method in class javax.mail.internet.PreencodedMimeBodyPart
Force the Content-Transfer-Encoding header to use the encoding that was specified when this object was created.
updateJAXB(XmlNode) - Method in class javax.xml.bind.Binder
Takes an XML node and updates its associated JAXB object and its descendants.
updateMessageID() - Method in class javax.mail.internet.MimeMessage
Update the Message-ID header.
updateModel(FacesContext) - Method in class javax.faces.component.UIInput
Perform the following algorithm to update the model data associated with this UIInput, if any, as appropriate.
updatesAreDetected(int) - Method in interface javax.resource.cci.ResultSetInfo
Indicates whether or not a visible row update can be detected by calling the method ResultSet.rowUpdated.
updateXML(Object) - Method in class javax.xml.bind.Binder
Takes an JAXB object and updates its associated XML node and its descendants.
updateXML(Object, XmlNode) - Method in class javax.xml.bind.Binder
Changes in JAXB object tree are updated in its associated XML parse tree.
uri - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
The value of the uri attribute from the taglib directive for this library.
URI_NS_SOAP_1_1_ENVELOPE - Static variable in interface javax.xml.soap.SOAPConstants
The namespace identifier for the SOAP 1.1 envelope.
URI_NS_SOAP_1_2_ENCODING - Static variable in interface javax.xml.soap.SOAPConstants
The namespace identifier for the SOAP 1.2 encoding.
URI_NS_SOAP_1_2_ENVELOPE - Static variable in interface javax.xml.soap.SOAPConstants
The namespace identifier for the SOAP 1.2 envelope.
URI_NS_SOAP_ENCODING - Static variable in interface javax.xml.soap.SOAPConstants
The namespace identifier for the SOAP 1.1 encoding.
URI_NS_SOAP_ENVELOPE - Static variable in interface javax.xml.soap.SOAPConstants
The namespace identifier for the SOAP 1.1 envelope, All SOAPElements in this namespace are defined by the SOAP 1.1 specification.
URI_SOAP_1_2_ROLE_NEXT - Static variable in interface javax.xml.soap.SOAPConstants
The URI identifying the next application processing a SOAP request as the intended role for a SOAP 1.2 header entry (see section 2.2 of part 1 of the SOAP 1.2 specification).
URI_SOAP_1_2_ROLE_NONE - Static variable in interface javax.xml.soap.SOAPConstants
The URI specifying the role None in SOAP 1.2.
URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER - Static variable in interface javax.xml.soap.SOAPConstants
The URI identifying the ultimate receiver of the SOAP 1.2 message.
URI_SOAP_ACTOR_NEXT - Static variable in interface javax.xml.soap.SOAPConstants
The URI identifying the next application processing a SOAP request as the intended actor for a SOAP 1.1 header entry (see section 4.2.2 of the SOAP 1.1 specification).
URIValidator - Interface in javax.xml.registry.infomodel
Defines common behavior expected of any class that validates URIs.
url - Variable in class javax.mail.Service
The URLName of this service.
URLDataSource - Class in javax.activation
The URLDataSource class provides an object that wraps a URL object in a DataSource interface.
URLDataSource(URL) - Constructor for class javax.activation.URLDataSource
URLDataSource constructor.
URLName - Class in javax.mail
The name of a URL.
URLName(String, String, int, String, String, String) - Constructor for class javax.mail.URLName
Creates a URLName object from the specified protocol, host, port number, file, username, and password.
URLName(URL) - Constructor for class javax.mail.URLName
Construct a URLName from a java.net.URL object.
URLName(String) - Constructor for class javax.mail.URLName
Construct a URLName from the string.
URLStats - Interface in javax.management.j2ee.statistics
Specifies the statistics provided by a URL resource.
urn - Variable in class javax.servlet.jsp.tagext.TagLibraryInfo
The "reliable" URN indicated in the TLD.
usage - Variable in class javax.mail.Quota.Resource
The current usage of the resource.
USER - Static variable in class javax.mail.Flags.Flag
A special flag that indicates that this folder supports user defined flags.
User - Interface in javax.xml.registry.infomodel
User instances are RegistryObjects that are used to provide information about registered users within the registry.
USER - Static variable in interface javax.xml.registry.LifeCycleManager

USERNAME_PROPERTY - Static variable in interface javax.xml.rpc.Call
Standard property: User name for authentication Type: java.lang.String
USERNAME_PROPERTY - Static variable in interface javax.xml.rpc.Stub
Standard property: User name for authentication.
USERNAME_PROPERTY - Static variable in interface javax.xml.ws.BindingProvider
Standard property: User name for authentication.
UserTransaction - Interface in javax.transaction
The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries.

V

V1_3 - Static variable in class javax.enterprise.deploy.shared.DConfigBeanVersionType
J2EE Platform version 1.3
V1_3_1 - Static variable in class javax.enterprise.deploy.shared.DConfigBeanVersionType
J2EE Platform version 1.3.1 THIS CONSTANT SHOULD NEVER BE USED.
V1_4 - Static variable in class javax.enterprise.deploy.shared.DConfigBeanVersionType
J2EE Platform version 1.4
V5 - Static variable in class javax.enterprise.deploy.shared.DConfigBeanVersionType
Java EE Platform version 5
validate(FacesContext) - Method in class javax.faces.component.UIInput
Perform the following algorithm to validate the local value of this UIInput.
validate(FacesContext, UIComponent, Object) - Method in class javax.faces.validator.DoubleRangeValidator

validate(FacesContext, UIComponent, Object) - Method in class javax.faces.validator.LengthValidator

validate(FacesContext, UIComponent, Object) - Method in class javax.faces.validator.LongRangeValidator

validate(FacesContext, UIComponent, Object) - Method in class javax.faces.validator.MethodExpressionValidator

validate(FacesContext, UIComponent, Object) - Method in interface javax.faces.validator.Validator
Perform the correctness checks implemented by this Validator against the specified UIComponent.
validate() - Method in class javax.mail.internet.InternetAddress
Validate that this address conforms to the syntax rules of RFC 822.
validate() - Method in interface javax.resource.spi.ActivationSpec
This method may be called by a deployment tool to validate the overall activation configuration information provided by the endpoint deployer.
validate(TagData) - Method in class javax.servlet.jsp.tagext.TagExtraInfo
Translation-time validation of the attributes.
validate(TagData) - Method in class javax.servlet.jsp.tagext.TagInfo
Translation-time validation of the attributes.
validate(String, String, PageData) - Method in class javax.servlet.jsp.tagext.TagLibraryValidator
Validate a JSP page.
validate(Object) - Method in interface javax.xml.bind.Validator
Deprecated. since JAXB2.0
validateRoot(Object) - Method in interface javax.xml.bind.Validator
Deprecated. since JAXB2.0
validateValue(FacesContext, Object) - Method in class javax.faces.component.UIInput
Set the "valid" property according to the below algorithm.
validateValue(FacesContext, Object) - Method in class javax.faces.component.UISelectMany
In addition to the standard validation behavior inherited from UIInput, ensure that any specified values are equal to one of the available options.
validateValue(FacesContext, Object) - Method in class javax.faces.component.UISelectOne
In addition to the standard validation behavior inherited from UIInput, ensure that any specified value is equal to one of the available options.
validating - Variable in class javax.xml.bind.helpers.AbstractUnmarshallerImpl
whether or not the unmarshaller will validate
ValidatingManagedConnectionFactory - Interface in javax.resource.spi
This interface is implemented by a ManagedConnectionFactory instance that supports the ability to validate ManagedConnection objects.
ValidationEvent - Interface in javax.xml.bind
This event indicates that a problem was encountered while validating the incoming XML data during an unmarshal operation, while performing on-demand validation of the Java content tree, or while marshalling the Java content tree back to XML data.
ValidationEventCollector - Class in javax.xml.bind.util
ValidationEventHandler implementation that collects all events.
ValidationEventCollector() - Constructor for class javax.xml.bind.util.ValidationEventCollector

ValidationEventHandler - Interface in javax.xml.bind
A basic event handler interface for validation errors.
ValidationEventImpl - Class in javax.xml.bind.helpers
Default implementation of the ValidationEvent interface.
ValidationEventImpl(int, String, ValidationEventLocator) - Constructor for class javax.xml.bind.helpers.ValidationEventImpl
Create a new ValidationEventImpl.
ValidationEventImpl(int, String, ValidationEventLocator, Throwable) - Constructor for class javax.xml.bind.helpers.ValidationEventImpl
Create a new ValidationEventImpl.
ValidationEventLocator - Interface in javax.xml.bind
Encapsulate the location of a ValidationEvent.
ValidationEventLocatorImpl - Class in javax.xml.bind.helpers
Default implementation of the ValidationEventLocator interface.
ValidationEventLocatorImpl() - Constructor for class javax.xml.bind.helpers.ValidationEventLocatorImpl
Creates an object with all fields unavailable.
ValidationEventLocatorImpl(Locator) - Constructor for class javax.xml.bind.helpers.ValidationEventLocatorImpl
Constructs an object from an org.xml.sax.Locator.
ValidationEventLocatorImpl(SAXParseException) - Constructor for class javax.xml.bind.helpers.ValidationEventLocatorImpl
Constructs an object from the location information of a SAXParseException.
ValidationEventLocatorImpl(Node) - Constructor for class javax.xml.bind.helpers.ValidationEventLocatorImpl
Constructs an object that points to a DOM Node.
ValidationEventLocatorImpl(Object) - Constructor for class javax.xml.bind.helpers.ValidationEventLocatorImpl
Constructs an object that points to a JAXB content object.
ValidationException - Exception in javax.xml.bind
This exception indicates that an error has occurred while performing a validate operation.
ValidationException(String) - Constructor for exception javax.xml.bind.ValidationException
Construct an ValidationException with the specified detail message.
ValidationException(String, String) - Constructor for exception javax.xml.bind.ValidationException
Construct an ValidationException with the specified detail message and vendor specific errorCode.
ValidationException(Throwable) - Constructor for exception javax.xml.bind.ValidationException
Construct an ValidationException with a linkedException.
ValidationException(String, Throwable) - Constructor for exception javax.xml.bind.ValidationException
Construct an ValidationException with the specified detail message and linkedException.
ValidationException(String, String, Throwable) - Constructor for exception javax.xml.bind.ValidationException
Construct an ValidationException with the specified detail message, vendor specific errorCode, and linkedException.
ValidationMessage - Class in javax.servlet.jsp.tagext
A validation message from either TagLibraryValidator or TagExtraInfo.
ValidationMessage(String, String) - Constructor for class javax.servlet.jsp.tagext.ValidationMessage
Create a ValidationMessage.
Validator - Interface in javax.faces.validator
A Validator implementation is a class that can perform validation (correctness checks) on a EditableValueHolder.
Validator - Interface in javax.xml.bind
Deprecated. since JAXB 2.0
VALIDATOR_ID - Static variable in class javax.faces.validator.DoubleRangeValidator
The standard converter id for this converter.
VALIDATOR_ID - Static variable in class javax.faces.validator.LengthValidator
The standard validator id for this validator.
VALIDATOR_ID - Static variable in class javax.faces.validator.LongRangeValidator
The standard converter id for this converter.
ValidatorELTag - Class in javax.faces.webapp
ValidatorELTag is a base class for all JSP custom actions that create and register a Validator instance on the EditableValueHolder associated with our most immediate surrounding instance of a tag whose implementation class is a subclass of UIComponentTag.
ValidatorELTag() - Constructor for class javax.faces.webapp.ValidatorELTag

ValidatorException - Exception in javax.faces.validator
A ValidatorException is an exception thrown by the validate() method of a Validator to indicate that validation failed.
ValidatorException(FacesMessage) - Constructor for exception javax.faces.validator.ValidatorException
Construct a new exception with the specified message and no root cause.
ValidatorException(FacesMessage, Throwable) - Constructor for exception javax.faces.validator.ValidatorException
Construct a new exception with the specified detail message and root cause.
ValidatorTag - Class in javax.faces.webapp
Deprecated. This has been partially replaced by ValidatorELTag. The remainder of the functionality, namely, the binding facility and the implementation of the ValidatorTag.createValidator() method, is now an implementation detail.
ValidatorTag() - Constructor for class javax.faces.webapp.ValidatorTag
Deprecated.
validSent - Variable in class javax.mail.event.TransportEvent

validSent - Variable in exception javax.mail.SendFailedException

validUnsent - Variable in class javax.mail.event.TransportEvent

validUnsent - Variable in exception javax.mail.SendFailedException

value - Variable in class javax.mail.Header
The value of the header.
value - Variable in class javax.xml.bind.JAXBElement
xml element value.
value - Variable in class javax.xml.rpc.holders.BigDecimalHolder

value - Variable in class javax.xml.rpc.holders.BigIntegerHolder

value - Variable in class javax.xml.rpc.holders.BooleanHolder

value - Variable in class javax.xml.rpc.holders.BooleanWrapperHolder

value - Variable in class javax.xml.rpc.holders.ByteArrayHolder

value - Variable in class javax.xml.rpc.holders.ByteHolder

value - Variable in class javax.xml.rpc.holders.ByteWrapperHolder

value - Variable in class javax.xml.rpc.holders.CalendarHolder

value - Variable in class javax.xml.rpc.holders.DoubleHolder

value - Variable in class javax.xml.rpc.holders.DoubleWrapperHolder

value - Variable in class javax.xml.rpc.holders.FloatHolder

value - Variable in class javax.xml.rpc.holders.FloatWrapperHolder

value - Variable in class javax.xml.rpc.holders.IntegerWrapperHolder

value - Variable in class javax.xml.rpc.holders.IntHolder

value - Variable in class javax.xml.rpc.holders.LongHolder

value - Variable in class javax.xml.rpc.holders.LongWrapperHolder

value - Variable in class javax.xml.rpc.holders.ObjectHolder

value - Variable in class javax.xml.rpc.holders.QNameHolder

value - Variable in class javax.xml.rpc.holders.ShortHolder

value - Variable in class javax.xml.rpc.holders.ShortWrapperHolder

value - Variable in class javax.xml.rpc.holders.StringHolder

value - Variable in class javax.xml.ws.Holder
The value contained in the holder.
VALUE_TYPE_EMBEDDED_PATH - Static variable in interface javax.xml.registry.infomodel.ClassificationScheme
Each taxonomy value in ClassificationScheme embeds the full path from scheme to that Concept.
VALUE_TYPE_NON_UNIQUE - Static variable in interface javax.xml.registry.infomodel.ClassificationScheme
Taxonomy values in ClassificationScheme may be repeated within the same scheme.
VALUE_TYPE_UNIQUE - Static variable in interface javax.xml.registry.infomodel.ClassificationScheme
Each taxonomy value in ClassificationScheme is unique.
ValueBinding - Class in javax.faces.el
Deprecated. This has been replaced by ValueExpression.
ValueBinding() - Constructor for class javax.faces.el.ValueBinding
Deprecated.
valueBound(HttpSessionBindingEvent) - Method in interface javax.servlet.http.HttpSessionBindingListener
Notifies the object that it is being bound to a session and identifies the session.
ValueChangeEvent - Class in javax.faces.event
A ValueChangeEvent is a notification that the local value of the source component has been change as a result of user interface activity.
ValueChangeEvent(UIComponent, Object, Object) - Constructor for class javax.faces.event.ValueChangeEvent
Construct a new event object from the specified source component, old value, and new value.
ValueChangeListener - Interface in javax.faces.event
A listener interface for receiving ValueChangeEvents.
ValueExpression - Class in javax.el
An Expression that can get or set a value.
ValueExpression() - Constructor for class javax.el.ValueExpression

ValueHolder - Interface in javax.faces.component
ValueHolder is an interface that may be implemented by any concrete UIComponent that wishes to support a local value, as well as access data in the model tier via a value expression, and support conversion between String and the model tier data's native data type.
valueOf(String) - Static method in enum javax.annotation.Resource.AuthenticationType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.ejb.TransactionAttributeType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.ejb.TransactionManagementType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.jws.soap.SOAPBinding.ParameterStyle
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.jws.soap.SOAPBinding.Style
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.jws.soap.SOAPBinding.Use
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.jws.WebParam.Mode
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.CascadeType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.DiscriminatorType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.EnumType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.FetchType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.FlushModeType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.GenerationType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.InheritanceType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.LockModeType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.PersistenceContextType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.spi.PersistenceUnitTransactionType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.persistence.TemporalType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.xml.bind.annotation.XmlAccessOrder
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.xml.bind.annotation.XmlAccessType
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.xml.bind.annotation.XmlNsForm
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.xml.ws.handler.MessageContext.Scope
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum javax.xml.ws.Service.Mode
Returns the enum constant of this type with the specified name.
values() - Static method in enum javax.annotation.Resource.AuthenticationType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.ejb.TransactionAttributeType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.ejb.TransactionManagementType
Returns an array containing the constants of this enum type, in the order they're declared.
VALUES - Static variable in class javax.faces.application.FacesMessage
Immutable List of valid FacesMessage.Severity instances, in ascending order of their ordinal value.
VALUES - Static variable in class javax.faces.event.PhaseId
List of valid PhaseId instances, in ascending order of their ordinal value.
values() - Static method in enum javax.jws.soap.SOAPBinding.ParameterStyle
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.jws.soap.SOAPBinding.Style
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.jws.soap.SOAPBinding.Use
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.jws.WebParam.Mode
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.CascadeType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.DiscriminatorType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.EnumType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.FetchType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.FlushModeType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.GenerationType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.InheritanceType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.LockModeType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.PersistenceContextType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.spi.PersistenceUnitTransactionType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.persistence.TemporalType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.xml.bind.annotation.XmlAccessOrder
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.xml.bind.annotation.XmlAccessType
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.xml.bind.annotation.XmlNsForm
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.xml.ws.handler.MessageContext.Scope
Returns an array containing the constants of this enum type, in the order they're declared.
values() - Static method in enum javax.xml.ws.Service.Mode
Returns an array containing the constants of this enum type, in the order they're declared.
VALUES_MAP - Static variable in class javax.faces.application.FacesMessage
Immutable Map of valid FacesMessage.Severity instances, keyed by name.
valueUnbound(HttpSessionBindingEvent) - Method in interface javax.servlet.http.HttpSessionBindingListener
Notifies the object that it is being unbound from a session and identifies the session.
VariableInfo - Class in javax.servlet.jsp.tagext
Information on the scripting variables that are created/modified by a tag (at run-time).
VariableInfo(String, String, boolean, int) - Constructor for class javax.servlet.jsp.tagext.VariableInfo
Constructor These objects can be created (at translation time) by the TagExtraInfo instances.
VariableMapper - Class in javax.el
The interface to a map between EL variables and the EL expressions they are associated with.
VariableMapper() - Constructor for class javax.el.VariableMapper

VariableResolver - Class in javax.faces.el
Deprecated. This has been replaced by ELResolver when operating with a null base argument.
VariableResolver() - Constructor for class javax.faces.el.VariableResolver
Deprecated.
VariableResolver - Interface in javax.servlet.jsp.el
Deprecated. As of JSP 2.1, replaced by ELResolver
Version - Annotation Type in javax.persistence
This annotation specifies the version field or property of an entity class that serves as its optimistic lock value.
Versionable - Interface in javax.xml.registry.infomodel
The Versionable interface defines the behavior common to classes that are capable of creating versions of their instances.
VERSIONABLE - Static variable in interface javax.xml.registry.LifeCycleManager

VIEW_STATE_PARAM - Static variable in class javax.faces.render.ResponseStateManager
Implementations must use this value as the name and id of the client parameter in which to save the state between requests.
ViewExpiredException - Exception in javax.faces.application
Implementations must throw this FacesException when attempting to restore the view StateManager.restoreView(javax.faces.context.FacesContext, String, String) results in failure on postback.
ViewExpiredException() - Constructor for exception javax.faces.application.ViewExpiredException
Construct a new exception with no detail message or root cause.
ViewExpiredException(String) - Constructor for exception javax.faces.application.ViewExpiredException
Construct a new exception with the specified view identifier.
ViewExpiredException(String, String) - Constructor for exception javax.faces.application.ViewExpiredException
Construct a new exception with the specified detail message and no root cause.
ViewExpiredException(Throwable, String) - Constructor for exception javax.faces.application.ViewExpiredException
Construct a new exception with the specified root cause.
ViewExpiredException(String, Throwable, String) - Constructor for exception javax.faces.application.ViewExpiredException
Construct a new exception with the specified detail message and root cause.
ViewHandler - Class in javax.faces.application
ViewHandler is the pluggablity mechanism for allowing implementations of or applications using the JavaServer Faces specification to provide their own handling of the activities in the Render Response and Restore View phases of the request processing lifecycle.
ViewHandler() - Constructor for class javax.faces.application.ViewHandler

ViewHandlerWrapper - Class in javax.faces.application
Provides a simple implementation of ViewHandler that can be subclassed by developers wishing to provide specialized behavior to an existing ViewHandler instance.
ViewHandlerWrapper() - Constructor for class javax.faces.application.ViewHandlerWrapper

W

W3CDomHandler - Class in javax.xml.bind.annotation
DomHandler implementation for W3C DOM (org.w3c.dom package.)
W3CDomHandler() - Constructor for class javax.xml.bind.annotation.W3CDomHandler
Default constructor.
W3CDomHandler(DocumentBuilder) - Constructor for class javax.xml.bind.annotation.W3CDomHandler
Constructor that allows applications to specify which DOM implementation to be used.
WAR - Static variable in class javax.enterprise.deploy.shared.ModuleType
The module is an Web Application archive.
WARNING - Static variable in interface javax.xml.bind.ValidationEvent
Conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation
WebEndpoint - Annotation Type in javax.xml.ws
Used to annotate the getPortName() methods of a generated service interface.
WebFault - Annotation Type in javax.xml.ws
Used to annotate service specific exception classes to customize to the local and namespace name of the fault element and the name of the fault bean.
WebMethod - Annotation Type in javax.jws
Customizes a method that is exposed as a Web Service operation.
WebParam - Annotation Type in javax.jws
Customizes the mapping of an individual parameter to a Web Service message part and XML element.
WebParam.Mode - Enum in javax.jws
The direction in which the parameter flows
WebResourcePermission - Class in javax.security.jacc
Class for Servlet web resource permissions.
WebResourcePermission(String, String) - Constructor for class javax.security.jacc.WebResourcePermission
Creates a new WebResourcePermission with the specified name and actions.
WebResourcePermission(String, String[]) - Constructor for class javax.security.jacc.WebResourcePermission
Creates a new WebResourcePermission with name corresponding to the URLPatternSpec, and actions composed from the array of HTTP methods.
WebResourcePermission(HttpServletRequest) - Constructor for class javax.security.jacc.WebResourcePermission
Creates a new WebResourcePermission from the HttpServletRequest object.
WebResult - Annotation Type in javax.jws
Customizes the mapping of the return value to a WSDL part and XML element.
WebRoleRefPermission - Class in javax.security.jacc
Class for Servlet isUserInRole (String reference) permissions.
WebRoleRefPermission(String, String) - Constructor for class javax.security.jacc.WebRoleRefPermission
Creates a new WebRoleRefPermission with the specified name and actions.
WebService - Annotation Type in javax.jws
Marks a Java class as implementing a Web Service, or a Java interface as defining a Web Service interface.
WebServiceClient - Annotation Type in javax.xml.ws
Used to annotate a generated service interface.
WebServiceContext - Interface in javax.xml.ws
A WebServiceContext makes it possible for a web service endpoint implementation class to access message context and security information relative to a request being served.
WebServiceException - Exception in javax.xml.ws
The WebServiceException class is the base exception class for all JAX-WS API runtime exceptions.
WebServiceException() - Constructor for exception javax.xml.ws.WebServiceException
Constructs a new exception with null as its detail message.
WebServiceException(String) - Constructor for exception javax.xml.ws.WebServiceException
Constructs a new exception with the specified detail message.
WebServiceException(String, Throwable) - Constructor for exception javax.xml.ws.WebServiceException
Constructs a new exception with the specified detail message and cause.
WebServiceException(Throwable) - Constructor for exception javax.xml.ws.WebServiceException
Constructs a new WebServiceException with the specified cause and a detail message of (cause==null ?
WebServicePermission - Class in javax.xml.ws
This class defines web service permissions.
WebServicePermission(String) - Constructor for class javax.xml.ws.WebServicePermission
Creates a new permission with the specified name.
WebServicePermission(String, String) - Constructor for class javax.xml.ws.WebServicePermission
Creates a new permission with the specified name and actions.
WebServiceProvider - Annotation Type in javax.xml.ws
Used to annotate a Provider implementation class.
WebServiceRef - Annotation Type in javax.xml.ws
The WebServiceRef annotation is used to define a reference to a web service and (optionally) an injection target for it.
WebServiceRefs - Annotation Type in javax.xml.ws
The WebServiceRefs annotation allows multiple web service references to be declared at the class level.
WebUserDataPermission - Class in javax.security.jacc
Class for Servlet Web user data permissions.
WebUserDataPermission(String, String) - Constructor for class javax.security.jacc.WebUserDataPermission
Creates a new WebUserDataPermission with the specified name and actions.
WebUserDataPermission(String, String[], String) - Constructor for class javax.security.jacc.WebUserDataPermission
Creates a new WebUserDataPermission with name corresponding to the URLPatternSpec, and actions composed from the array of HTTP methods and the transport type.
WebUserDataPermission(HttpServletRequest) - Constructor for class javax.security.jacc.WebUserDataPermission
Creates a new WebUserDataPermission from the HttpServletRequest object.
Work - Interface in javax.resource.spi.work
This models a Work instance that would be executed by a WorkManager upon submission.
WORK_ACCEPTED - Static variable in class javax.resource.spi.work.WorkEvent
Indicates Work instance has been accepted.
WORK_COMPLETED - Static variable in class javax.resource.spi.work.WorkEvent
Indicates Work instance has completed execution.
WORK_REJECTED - Static variable in class javax.resource.spi.work.WorkEvent
Indicates Work instance has been rejected.
WORK_STARTED - Static variable in class javax.resource.spi.work.WorkEvent
Indicates Work instance has started execution.
workAccepted(WorkEvent) - Method in class javax.resource.spi.work.WorkAdapter
Invoked when a Work instance has been accepted.
workAccepted(WorkEvent) - Method in interface javax.resource.spi.work.WorkListener
Invoked when a Work instance has been accepted.
WorkAdapter - Class in javax.resource.spi.work
This class is provided as a convenience for easily creating WorkListener instances by extending this class and overriding only those methods of interest.
WorkAdapter() - Constructor for class javax.resource.spi.work.WorkAdapter

workCompleted(WorkEvent) - Method in class javax.resource.spi.work.WorkAdapter
Invoked when a Work instance has completed execution.
workCompleted(WorkEvent) - Method in interface javax.resource.spi.work.WorkListener
Invoked when a Work instance has completed execution.
WorkCompletedException - Exception in javax.resource.spi.work
This exception is thrown by a WorkManager to indicate that a submitted Work instance has completed with an exception.
WorkCompletedException() - Constructor for exception javax.resource.spi.work.WorkCompletedException
Constructs a new instance with null as its detail message.
WorkCompletedException(String) - Constructor for exception javax.resource.spi.work.WorkCompletedException
Constructs a new instance with the specified detail message.
WorkCompletedException(Throwable) - Constructor for exception javax.resource.spi.work.WorkCompletedException
Constructs a new throwable with the specified cause.
WorkCompletedException(String, Throwable) - Constructor for exception javax.resource.spi.work.WorkCompletedException
Constructs a new throwable with the specified detail message and cause.
WorkCompletedException(String, String) - Constructor for exception javax.resource.spi.work.WorkCompletedException
Constructs a new throwable with the specified detail message and an error code.
WorkEvent - Class in javax.resource.spi.work
This class models the various events that occur during the processing of a Work instance.
WorkEvent(Object, int, Work, WorkException) - Constructor for class javax.resource.spi.work.WorkEvent
Constructor.
WorkEvent(Object, int, Work, WorkException, long) - Constructor for class javax.resource.spi.work.WorkEvent
Constructor.
WorkException - Exception in javax.resource.spi.work
A common base class for all Work processing related exceptions.
WorkException() - Constructor for exception javax.resource.spi.work.WorkException
Constructs a new instance with null as its detail message.
WorkException(String) - Constructor for exception javax.resource.spi.work.WorkException
Constructs a new instance with the specified detail message.
WorkException(Throwable) - Constructor for exception javax.resource.spi.work.WorkException
Constructs a new throwable with the specified cause.
WorkException(String, Throwable) - Constructor for exception javax.resource.spi.work.WorkException
Constructs a new throwable with the specified detail message and cause.
WorkException(String, String) - Constructor for exception javax.resource.spi.work.WorkException
Constructs a new throwable with the specified detail message and an error code.
WorkListener - Interface in javax.resource.spi.work
This models a WorkListener instance which would be notified by the WorkManager when the various Work processing events (work accepted, work rejected, work started, work completed) occur.
WorkManager - Interface in javax.resource.spi.work
This interface models a WorkManager which provides a facility to submit Work instances for execution.
workRejected(WorkEvent) - Method in class javax.resource.spi.work.WorkAdapter
Invoked when a Work instance has been rejected.
workRejected(WorkEvent) - Method in interface javax.resource.spi.work.WorkListener
Invoked when a Work instance has been rejected.
WorkRejectedException - Exception in javax.resource.spi.work
This exception is thrown by a WorkManager to indicate that a submitted Work instance has been rejected.
WorkRejectedException() - Constructor for exception javax.resource.spi.work.WorkRejectedException
Constructs a new instance with null as its detail message.
WorkRejectedException(String) - Constructor for exception javax.resource.spi.work.WorkRejectedException
Constructs a new instance with the specified detail message.
WorkRejectedException(Throwable) - Constructor for exception javax.resource.spi.work.WorkRejectedException
Constructs a new throwable with the specified cause.
WorkRejectedException(String, Throwable) - Constructor for exception javax.resource.spi.work.WorkRejectedException
Constructs a new throwable with the specified detail message and cause.
WorkRejectedException(String, String) - Constructor for exception javax.resource.spi.work.WorkRejectedException
Constructs a new throwable with the specified detail message and an error code.
workStarted(WorkEvent) - Method in class javax.resource.spi.work.WorkAdapter
Invoked when a Work instance has started execution.
workStarted(WorkEvent) - Method in interface javax.resource.spi.work.WorkListener
Invoked when a Work instance has started execution.
write(char[], int, int) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call Writer.write(char[], int, int) on the wrapped ResponseWriter object.
write(OutputStream) - Method in interface javax.resource.cci.Streamable
Write fields of a Streamable object to an OutputStream
WRITE_XML_DECLARATION - Static variable in class javax.xml.soap.SOAPMessage
Specifies whether the SOAP Message will contain an XML declaration when it is sent.
writeAsEncodedUnicode(Writer) - Method in interface javax.xml.stream.events.XMLEvent
This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
writeAttribute(String, Object, String) - Method in class javax.faces.context.ResponseWriter
Write an attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
writeAttribute(String, Object, String) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.writeAttribute(String, Object, String) on the wrapped ResponseWriter object.
writeAttribute(String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an attribute to the output stream without a prefix.
writeAttribute(String, String, String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an attribute to the output stream
writeAttribute(String, String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an attribute to the output stream
writeBoolean(boolean) - Method in interface javax.jms.BytesMessage
Writes a boolean to the bytes message stream as a 1-byte value.
writeBoolean(boolean) - Method in interface javax.jms.StreamMessage
Writes a boolean to the stream message.
writeByte(byte) - Method in interface javax.jms.BytesMessage
Writes a byte to the bytes message stream as a 1-byte value.
writeByte(byte) - Method in interface javax.jms.StreamMessage
Writes a byte to the stream message.
writeBytes(byte[]) - Method in interface javax.jms.BytesMessage
Writes a byte array to the bytes message stream.
writeBytes(byte[], int, int) - Method in interface javax.jms.BytesMessage
Writes a portion of a byte array to the bytes message stream.
writeBytes(byte[]) - Method in interface javax.jms.StreamMessage
Writes a byte array field to the stream message.
writeBytes(byte[], int, int) - Method in interface javax.jms.StreamMessage
Writes a portion of a byte array as a byte array field to the stream message.
writeCData(String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes a CData section
writeChar(char) - Method in interface javax.jms.BytesMessage
Writes a char to the bytes message stream as a 2-byte value, high byte first.
writeChar(char) - Method in interface javax.jms.StreamMessage
Writes a char to the stream message.
writeCharacters(String) - Method in interface javax.xml.stream.XMLStreamWriter
Write text to the output
writeCharacters(char[], int, int) - Method in interface javax.xml.stream.XMLStreamWriter
Write text to the output
writeComment(Object) - Method in class javax.faces.context.ResponseWriter
Write a comment containing the specified text, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
writeComment(Object) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.writeComment(Object) on the wrapped ResponseWriter object.
writeComment(String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an xml comment with the data enclosed
writeDefaultNamespace(String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes the default namespace to the stream
writeDouble(double) - Method in interface javax.jms.BytesMessage
Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the bytes message stream as an 8-byte quantity, high byte first.
writeDouble(double) - Method in interface javax.jms.StreamMessage
Writes a double to the stream message.
writeDTD(String) - Method in interface javax.xml.stream.XMLStreamWriter
Write a DTD section.
writeEJBHome(EJBHome, ObjectOutputStream) - Method in interface javax.ejb.spi.HandleDelegate
Serialize the EJBHome reference corresponding to a HomeHandle.
writeEJBObject(EJBObject, ObjectOutputStream) - Method in interface javax.ejb.spi.HandleDelegate
Serialize the EJBObject reference corresponding to a Handle.
writeEmptyElement(String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an empty element tag to the output
writeEmptyElement(String, String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an empty element tag to the output
writeEmptyElement(String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an empty element tag to the output
writeEndDocument() - Method in interface javax.xml.stream.XMLStreamWriter
Closes any start tags and writes corresponding end tags.
writeEndElement() - Method in interface javax.xml.stream.XMLStreamWriter
Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.
writeEntityRef(String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes an entity reference
writeExternal(ObjectOutput) - Method in class javax.activation.MimeType
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays.
writeFloat(float) - Method in interface javax.jms.BytesMessage
Converts the float argument to an int using the floatToIntBits method in class Float, and then writes that int value to the bytes message stream as a 4-byte quantity, high byte first.
writeFloat(float) - Method in interface javax.jms.StreamMessage
Writes a float to the stream message.
writeInt(int) - Method in interface javax.jms.BytesMessage
Writes an int to the bytes message stream as four bytes, high byte first.
writeInt(int) - Method in interface javax.jms.StreamMessage
Writes an int to the stream message.
writeLong(long) - Method in interface javax.jms.BytesMessage
Writes a long to the bytes message stream as eight bytes, high byte first.
writeLong(long) - Method in interface javax.jms.StreamMessage
Writes a long to the stream message.
writeNamespace(String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace
writeObject(Object) - Method in interface javax.jms.BytesMessage
Writes an object to the bytes message stream.
writeObject(Object) - Method in interface javax.jms.StreamMessage
Writes an object to the stream message.
writeOut(Writer) - Method in class javax.servlet.jsp.tagext.BodyContent
Write the contents of this BodyContent into a Writer.
writeProcessingInstruction(String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes a processing instruction
writeProcessingInstruction(String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes a processing instruction
writeShort(short) - Method in interface javax.jms.BytesMessage
Writes a short to the bytes message stream as two bytes, high byte first.
writeShort(short) - Method in interface javax.jms.StreamMessage
Writes a short to the stream message.
writeStartDocument() - Method in interface javax.xml.stream.XMLStreamWriter
Write the XML Declaration.
writeStartDocument(String) - Method in interface javax.xml.stream.XMLStreamWriter
Write the XML Declaration.
writeStartDocument(String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Write the XML Declaration.
writeStartElement(String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes a start tag to the output.
writeStartElement(String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes a start tag to the output
writeStartElement(String, String, String) - Method in interface javax.xml.stream.XMLStreamWriter
Writes a start tag to the output
writeState(FacesContext, Object) - Method in class javax.faces.application.StateManager
Save the state represented in the specified state Object instance, in an implementation dependent manner.
writeState(FacesContext, StateManager.SerializedView) - Method in class javax.faces.application.StateManager
Deprecated. This method has been replaced by StateManager.writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.
writeState(FacesContext, Object) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object) on the wrapped StateManager object.
writeState(FacesContext, StateManager.SerializedView) - Method in class javax.faces.application.StateManagerWrapper
The default behavior of this method is to call StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView) on the wrapped StateManager object.
writeState(FacesContext) - Method in class javax.faces.application.ViewHandler
Take any appropriate action to either immediately write out the current state information (by calling StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object), or noting where state information should later be written.
writeState(FacesContext) - Method in class javax.faces.application.ViewHandlerWrapper
The default behavior of this method is to call ViewHandler.writeState(javax.faces.context.FacesContext) on the wrapped ViewHandler object.
writeState(FacesContext, Object) - Method in class javax.faces.render.ResponseStateManager

writeState(FacesContext, StateManager.SerializedView) - Method in class javax.faces.render.ResponseStateManager
Deprecated. This method has been replaced by ResponseStateManager.writeState(javax.faces.context.FacesContext,java.lang.Object). The default implementation of this method does nothing.
writeString(String) - Method in interface javax.jms.StreamMessage
Writes a String to the stream message.
writeText(Object, String) - Method in class javax.faces.context.ResponseWriter
Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
writeText(Object, UIComponent, String) - Method in class javax.faces.context.ResponseWriter
Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered.
writeText(char[], int, int) - Method in class javax.faces.context.ResponseWriter
Write text from a character array, after any performing any escaping appropriate for the markup language being rendered.
writeText(Object, String) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.writeText(Object, String) on the wrapped ResponseWriter object.
writeText(Object, UIComponent, String) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.writeText(Object, UIComponent, String) on the wrapped ResponseWriter object.
writeText(char[], int, int) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.writeText(char[], int, int) on the wrapped ResponseWriter object.
writeTo(Object, String, OutputStream) - Method in interface javax.activation.DataContentHandler
Convert the object to a byte stream of the specified MIME type and write it to the output stream.
writeTo(OutputStream) - Method in class javax.activation.DataHandler
Write the data to an OutputStream.
writeTo(OutputStream) - Method in class javax.mail.internet.MimeBodyPart
Output the body part as an RFC 822 format stream.
writeTo(OutputStream) - Method in class javax.mail.internet.MimeMessage
Output the message as an RFC 822 format stream.
writeTo(OutputStream, String[]) - Method in class javax.mail.internet.MimeMessage
Output the message as an RFC 822 format stream, without specified headers.
writeTo(OutputStream) - Method in class javax.mail.internet.MimeMultipart
Iterates through all the parts and outputs each MIME part separated by a boundary.
writeTo(OutputStream) - Method in class javax.mail.internet.PreencodedMimeBodyPart
Output the body part as an RFC 822 format stream.
writeTo(OutputStream) - Method in class javax.mail.Multipart
Output an appropriately encoded bytestream to the given OutputStream.
writeTo(OutputStream) - Method in interface javax.mail.Part
Output a bytestream for this Part.
writeTo(OutputStream) - Method in class javax.xml.soap.SOAPMessage
Writes this SOAPMessage object to the given output stream.
writeURIAttribute(String, Object, String) - Method in class javax.faces.context.ResponseWriter
Write a URI attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any encoding appropriate to the markup language being rendered.
writeURIAttribute(String, Object, String) - Method in class javax.faces.context.ResponseWriterWrapper
The default behavior of this method is to call ResponseWriter.writeURIAttribute(String, Object, String) on the wrapped ResponseWriter object.
writeUTF(String) - Method in interface javax.jms.BytesMessage
Writes a string to the bytes message stream using UTF-8 encoding in a machine-independent manner.
WSDL_DESCRIPTION - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: input source for WSDL document.
WSDL_INTERFACE - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: name of wsdl interface (2.0) or port type (1.1).
WSDL_OPERATION - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: name of WSDL operation.
WSDL_PORT - Static variable in class javax.xml.ws.Endpoint
Standard property: name of WSDL port.
WSDL_PORT - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: name of WSDL port.
WSDL_SERVICE - Static variable in class javax.xml.ws.Endpoint
Standard property: name of WSDL service.
WSDL_SERVICE - Static variable in interface javax.xml.ws.handler.MessageContext
Standard property: name of WSDL service.

X

XA_HEURCOM - Static variable in exception javax.transaction.xa.XAException
The transaction branch has been heuristically committed.
XA_HEURHAZ - Static variable in exception javax.transaction.xa.XAException
The transaction branch may have been heuristically completed.
XA_HEURMIX - Static variable in exception javax.transaction.xa.XAException
The transaction branch has been heuristically committed and rolled back.
XA_HEURRB - Static variable in exception javax.transaction.xa.XAException
The transaction branch has been heuristically rolled back.
XA_NOMIGRATE - Static variable in exception javax.transaction.xa.XAException
Resumption must occur where the suspension occurred.
XA_OK - Static variable in interface javax.transaction.xa.XAResource
The transaction work has been prepared normally.
XA_RBBASE - Static variable in exception javax.transaction.xa.XAException
The inclusive lower bound of the rollback codes.
XA_RBCOMMFAIL - Static variable in exception javax.transaction.xa.XAException
Indicates that the rollback was caused by a communication failure.
XA_RBDEADLOCK - Static variable in exception javax.transaction.xa.XAException
A deadlock was detected.
XA_RBEND - Static variable in exception javax.transaction.xa.XAException
The inclusive upper bound of the rollback error code.
XA_RBINTEGRITY - Static variable in exception javax.transaction.xa.XAException
A condition that violates the integrity of the resource was detected.
XA_RBOTHER - Static variable in exception javax.transaction.xa.XAException
The resource manager rolled back the transaction branch for a reason not on this list.
XA_RBPROTO - Static variable in exception javax.transaction.xa.XAException
A protocol error occurred in the resource manager.
XA_RBROLLBACK - Static variable in exception javax.transaction.xa.XAException
Indicates that the rollback was caused by an unspecified reason.
XA_RBTIMEOUT - Static variable in exception javax.transaction.xa.XAException
A transaction branch took too long.
XA_RBTRANSIENT - Static variable in exception javax.transaction.xa.XAException
May retry the transaction branch.
XA_RDONLY - Static variable in exception javax.transaction.xa.XAException
The transaction branch was read-only and has been committed.
XA_RDONLY - Static variable in interface javax.transaction.xa.XAResource
The transaction branch has been read-only and has been committed.
XA_RETRY - Static variable in exception javax.transaction.xa.XAException
Routine returned with no effect and may be reissued.
XAConnection - Interface in javax.jms
The XAConnection interface extends the capability of Connection by providing an XASession (optional).
XAConnectionFactory - Interface in javax.jms
The XAConnectionFactory interface is a base interface for the XAQueueConnectionFactory and XATopicConnectionFactory interfaces.
XAER_ASYNC - Static variable in exception javax.transaction.xa.XAException
There is an asynchronous operation already outstanding.
XAER_DUPID - Static variable in exception javax.transaction.xa.XAException
The XID already exists.
XAER_INVAL - Static variable in exception javax.transaction.xa.XAException
Invalid arguments were given.
XAER_NOTA - Static variable in exception javax.transaction.xa.XAException
The XID is not valid.
XAER_OUTSIDE - Static variable in exception javax.transaction.xa.XAException
The resource manager is doing work outside a global transaction.
XAER_PROTO - Static variable in exception javax.transaction.xa.XAException
Routine was invoked in an improper context.
XAER_RMERR - Static variable in exception javax.transaction.xa.XAException
A resource manager error has occurred in the transaction branch.
XAER_RMFAIL - Static variable in exception javax.transaction.xa.XAException
Resource manager is unavailable.
XAException - Exception in javax.transaction.xa
The XAException is thrown by the Resource Manager (RM) to inform the Transaction Manager of an error encountered by the involved transaction.
XAException() - Constructor for exception javax.transaction.xa.XAException
Create an XAException.
XAException(String) - Constructor for exception javax.transaction.xa.XAException
Create an XAException with a given string.
XAException(int) - Constructor for exception javax.transaction.xa.XAException
Create an XAException with a given error code.
XAQueueConnection - Interface in javax.jms
An XAQueueConnection provides the same create options as QueueConnection (optional).
XAQueueConnectionFactory - Interface in javax.jms
An XAQueueConnectionFactory provides the same create options as a QueueConnectionFactory (optional).
XAQueueSession - Interface in javax.jms
An XAQueueSession provides a regular QueueSession, which can be used to create QueueReceiver, QueueSender, and QueueBrowser objects (optional).
XAResource - Interface in javax.transaction.xa
The XAResource interface is a Java mapping of the industry standard XA interface based on the X/Open CAE Specification (Distributed Transaction Processing: The XA Specification).
XASession - Interface in javax.jms
The XASession interface extends the capability of Session by adding access to a JMS provider's support for the Java Transaction API (JTA) (optional).
XATerminator - Interface in javax.resource.spi
The XATerminator interface is used for transaction completion and crash recovery flows.
XATopicConnection - Interface in javax.jms
An XATopicConnection provides the same create options as TopicConnection (optional).
XATopicConnectionFactory - Interface in javax.jms
An XATopicConnectionFactory provides the same create options as a TopicConnectionFactory (optional).
XATopicSession - Interface in javax.jms
An XATopicSession provides a regular TopicSession.
Xid - Interface in javax.transaction.xa
The Xid interface is a Java mapping of the X/Open transaction identifier XID structure.
XmlAccessOrder - Enum in javax.xml.bind.annotation
Used by XmlAccessorOrder to control the ordering of properties and fields in a JAXB bound class.
XmlAccessorOrder - Annotation Type in javax.xml.bind.annotation
Controls the ordering of fields and properties in a class.
XmlAccessorType - Annotation Type in javax.xml.bind.annotation
Controls whether fields or Javabean properties are serialized by default.
XmlAccessType - Enum in javax.xml.bind.annotation
Used by XmlAccessorType to control serialization of fields or properties.
XmlAdapter<ValueType,BoundType> - Class in javax.xml.bind.annotation.adapters
Adapts a Java type for custom marshaling.
XmlAdapter() - Constructor for class javax.xml.bind.annotation.adapters.XmlAdapter
Do-nothing constructor for the derived classes.
XmlAnyAttribute - Annotation Type in javax.xml.bind.annotation
Maps a JavaBean property to a map of wildcard attributes.
XmlAnyElement - Annotation Type in javax.xml.bind.annotation
Maps a JavaBean property to XML infoset representation and/or JAXB element.
XmlAttachmentRef - Annotation Type in javax.xml.bind.annotation
Marks a field/property that its XML form is a uri reference to mime content.
XmlAttribute - Annotation Type in javax.xml.bind.annotation
Maps a JavaBean property to a XML attribute.
XmlElement - Annotation Type in javax.xml.bind.annotation
Maps a JavaBean property to a XML element derived from property name.
XmlElement.DEFAULT - Class in javax.xml.bind.annotation
Used in XmlElement.type() to signal that the type be inferred from the signature of the property.
XmlElement.DEFAULT() - Constructor for class javax.xml.bind.annotation.XmlElement.DEFAULT

XmlElementDecl - Annotation Type in javax.xml.bind.annotation
Maps a factory method to a XML element.
XmlElementDecl.GLOBAL - Class in javax.xml.bind.annotation
Used in XmlElementDecl.scope() to signal that the declaration is in the global scope.
XmlElementDecl.GLOBAL() - Constructor for class javax.xml.bind.annotation.XmlElementDecl.GLOBAL

XmlElementRef - Annotation Type in javax.xml.bind.annotation
Maps a JavaBean property to a XML element derived from property's type.
XmlElementRef.DEFAULT - Class in javax.xml.bind.annotation
Used in XmlElementRef.type() to signal that the type be inferred from the signature of the property.
XmlElementRef.DEFAULT() - Constructor for class javax.xml.bind.annotation.XmlElementRef.DEFAULT

XmlElementRefs - Annotation Type in javax.xml.bind.annotation
Marks a property that refers to classes with XmlElement or JAXBElement.
XmlElements - Annotation Type in javax.xml.bind.annotation
A container for multiple @XmlElement annotations.
XmlElementWrapper - Annotation Type in javax.xml.bind.annotation
Generates a wrapper element around XML representation.
XmlEnum - Annotation Type in javax.xml.bind.annotation
Maps an enum type Enum to XML representation.
XmlEnumValue - Annotation Type in javax.xml.bind.annotation
Maps an enum constant in Enum type to XML representation.
XMLEvent - Interface in javax.xml.stream.events
This is the base event interface for handling markup events.
XMLEventAllocator - Interface in javax.xml.stream.util
This interface defines a class that allows a user to register a way to allocate events given an XMLStreamReader.
XMLEventConsumer - Interface in javax.xml.stream.util
This interface defines an event consumer interface.
XMLEventFactory - Class in javax.xml.stream
This interface defines a utility class for creating instances of XMLEvents
XMLEventFactory() - Constructor for class javax.xml.stream.XMLEventFactory

XMLEventReader - Interface in javax.xml.stream
This is the top level interface for parsing XML Events.
XMLEventWriter - Interface in javax.xml.stream
This is the top level interface for writing XML documents.
XmlID - Annotation Type in javax.xml.bind.annotation
Maps a JavaBean property to XML ID.
XmlIDREF - Annotation Type in javax.xml.bind.annotation
Maps a JavaBean property to XML IDREF.
XmlInlineBinaryData - Annotation Type in javax.xml.bind.annotation
Disable consideration of XOP encoding for datatypes that are bound to base64-encoded binary data in XML.
XMLInputFactory - Class in javax.xml.stream
Defines an abstract implementation of a factory for getting streams.
XMLInputFactory() - Constructor for class javax.xml.stream.XMLInputFactory

XmlJavaTypeAdapter - Annotation Type in javax.xml.bind.annotation.adapters
Use an adapter that implements XmlAdapter for custom marshaling.
XmlJavaTypeAdapter.DEFAULT - Class in javax.xml.bind.annotation.adapters
Used in XmlJavaTypeAdapter.type() to signal that the type be inferred from the signature of the field, property, parameter or the class.
XmlJavaTypeAdapter.DEFAULT() - Constructor for class javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT

XmlJavaTypeAdapters - Annotation Type in javax.xml.bind.annotation.adapters
A container for multiple @XmlJavaTypeAdapter annotations.
XmlList - Annotation Type in javax.xml.bind.annotation
Used to map a property to a list simple type.
XmlMimeType - Annotation Type in javax.xml.bind.annotation
Associates the MIME type that controls the XML representation of the property.
XmlMixed - Annotation Type in javax.xml.bind.annotation
Annotate a JavaBean multi-valued property to support mixed content.
XmlNs - Annotation Type in javax.xml.bind.annotation
Associates a namespace prefix with a XML namespace URI.
XmlNsForm - Enum in javax.xml.bind.annotation
Enumeration of XML Schema namespace qualifications.
XMLOutputFactory - Class in javax.xml.stream
Defines an abstract implementation of a factory for getting XMLEventWriters and XMLStreamWriters.
XMLOutputFactory() - Constructor for class javax.xml.stream.XMLOutputFactory

XmlRegistry - Annotation Type in javax.xml.bind.annotation
Marks a class that has XmlElementDecls.
XMLReporter - Interface in javax.xml.stream
This interface is used to report non-fatal errors.
XMLResolver - Interface in javax.xml.stream
This interface is used to resolve resources during an XML parse.
XmlRootElement - Annotation Type in javax.xml.bind.annotation
Maps a class or an enum type to an XML element.
XmlSchema - Annotation Type in javax.xml.bind.annotation
Maps a package name to a XML namespace.
XmlSchemaType - Annotation Type in javax.xml.bind.annotation
Maps a Java type to a simple schema built-in type.
XmlSchemaType.DEFAULT - Class in javax.xml.bind.annotation
Used in XmlSchemaType.type() to signal that the type be inferred from the signature of the property.
XmlSchemaType.DEFAULT() - Constructor for class javax.xml.bind.annotation.XmlSchemaType.DEFAULT

XmlSchemaTypes - Annotation Type in javax.xml.bind.annotation
A container for multiple @XmlSchemaType annotations.
XMLStreamConstants - Interface in javax.xml.stream
This interface declares the constants used in this API.
XMLStreamException - Exception in javax.xml.stream
The base exception for unexpected processing errors.
XMLStreamException() - Constructor for exception javax.xml.stream.XMLStreamException
Default constructor
XMLStreamException(String) - Constructor for exception javax.xml.stream.XMLStreamException
Construct an exception with the assocated message.
XMLStreamException(Throwable) - Constructor for exception javax.xml.stream.XMLStreamException
Construct an exception with the assocated exception
XMLStreamException(String, Throwable) - Constructor for exception javax.xml.stream.XMLStreamException
Construct an exception with the assocated message and exception
XMLStreamException(String, Location, Throwable) - Constructor for exception javax.xml.stream.XMLStreamException
Construct an exception with the assocated message, exception and location.
XMLStreamException(String, Location) - Constructor for exception javax.xml.stream.XMLStreamException
Construct an exception with the assocated message, exception and location.
XMLStreamReader - Interface in javax.xml.stream
The XMLStreamReader interface allows forward, read-only access to XML.
XMLStreamWriter - Interface in javax.xml.stream
The XMLStreamWriter interface specifies how to write XML.
XmlTransient - Annotation Type in javax.xml.bind.annotation
Prevents the mapping of a JavaBean property to XML representation.
XmlType - Annotation Type in javax.xml.bind.annotation
Maps a class or an enum type to a XML Schema type.
XMLType - Class in javax.xml.rpc.encoding
Constants for common XML Schema and SOAP 1.1 types.
XMLType() - Constructor for class javax.xml.rpc.encoding.XMLType

XmlType.DEFAULT - Class in javax.xml.bind.annotation
Used in XmlType.factoryClass() to signal that either factory mehod is not used or that it's in the class with this XmlType itself.
XmlType.DEFAULT() - Constructor for class javax.xml.bind.annotation.XmlType.DEFAULT

XmlValue - Annotation Type in javax.xml.bind.annotation
Enables mapping a class to a XML Schema complex type with a simpleContent or a XML Schema simple type.
XpathEvent - Class in javax.enterprise.deploy.model
An Event class describing ConfigBeans being added/subtracted from a server configuration.
XpathEvent(DDBean, Object) - Constructor for class javax.enterprise.deploy.model.XpathEvent
A description of a change in the ConfigBean tree.
XpathListener - Interface in javax.enterprise.deploy.model
The listener interface for receiving XpathEvents
XSD_BASE64 - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:base64Binary type.
XSD_BOOLEAN - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:boolean type.
XSD_BYTE - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:byte type.
XSD_DATETIME - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:dateTime type.
XSD_DECIMAL - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:decimal type.
XSD_DOUBLE - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:double type.
XSD_FLOAT - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:float type.
XSD_HEXBINARY - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:hexBinary type.
XSD_INT - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:int type.
XSD_INTEGER - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:integer type.
XSD_LONG - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:long type.
XSD_QNAME - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:QName type.
XSD_SHORT - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:short type.
XSD_STRING - Static variable in class javax.xml.rpc.encoding.XMLType
The name of the xsd:string type.

_

_getProperty(String) - Method in interface javax.xml.rpc.Stub
Gets the value of a specific configuration property.
_getPropertyNames() - Method in interface javax.xml.rpc.Stub
Returns an Iterato view of the names of the properties that can be configured on this stub instance.
_jspService(HttpServletRequest, HttpServletResponse) - Method in interface javax.servlet.jsp.HttpJspPage
The _jspService()method corresponds to the body of the JSP page.
_setProperty(String, Object) - Method in interface javax.xml.rpc.Stub
Sets the name and value of a configuration property for this Stub instance.
A B C D E F G H I J K L M N O P Q R S T U V W X _

Overview

Package

Class

Tree

Deprecated

Index

Help

PREV   NEXT

FRAMES    NO FRAMES

Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.


Overview (Java EE 5)

All Classes

Packages
javax.activation
javax.annotation
javax.annotation.security
javax.ejb
javax.ejb.spi
javax.el
javax.enterprise.deploy.model
javax.enterprise.deploy.model.exceptions
javax.enterprise.deploy.shared
javax.enterprise.deploy.shared.factories
javax.enterprise.deploy.spi
javax.enterprise.deploy.spi.exceptions
javax.enterprise.deploy.spi.factories
javax.enterprise.deploy.spi.status
javax.faces
javax.faces.application
javax.faces.component
javax.faces.component.html
javax.faces.context
javax.faces.convert
javax.faces.el
javax.faces.event
javax.faces.lifecycle
javax.faces.model
javax.faces.render
javax.faces.validator
javax.faces.webapp
javax.interceptor
javax.jms
javax.jws
javax.jws.soap
javax.mail
javax.mail.event
javax.mail.internet
javax.mail.search
javax.mail.util
javax.management.j2ee
javax.management.j2ee.statistics
javax.persistence
javax.persistence.spi
javax.resource
javax.resource.cci
javax.resource.spi
javax.resource.spi.endpoint
javax.resource.spi.security
javax.resource.spi.work
javax.security.jacc
javax.servlet
javax.servlet.http
javax.servlet.jsp
javax.servlet.jsp.el
javax.servlet.jsp.tagext
javax.transaction
javax.transaction.xa
javax.xml.bind
javax.xml.bind.annotation
javax.xml.bind.annotation.adapters
javax.xml.bind.attachment
javax.xml.bind.helpers
javax.xml.bind.util
javax.xml.registry
javax.xml.registry.infomodel
javax.xml.rpc
javax.xml.rpc.encoding
javax.xml.rpc.handler
javax.xml.rpc.handler.soap
javax.xml.rpc.holders
javax.xml.rpc.server
javax.xml.rpc.soap
javax.xml.soap
javax.xml.stream
javax.xml.stream.events
javax.xml.stream.util
javax.xml.ws
javax.xml.ws.handler
javax.xml.ws.handler.soap
javax.xml.ws.http
javax.xml.ws.soap
javax.xml.ws.spi


Serialized Form (Java EE 5)

PREV NEXT FRAMES NO FRAMES

Serialized Form

Package javax.activation

Class javax.activation.ActivationDataFlavor extends DataFlavor implements Serializable

Serialization Methods

readExternal

public void readExternal(ObjectInput arg0)
                  throws IOException,
                         ClassNotFoundException
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput arg0)
                   throws IOException
Throws:
IOException

Class javax.activation.MimeType extends Object implements Serializable

Serialization Methods

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Throws:
ClassNotFoundException - If the class for an object being restored cannot be found.
IOException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays.

Throws:
IOException - Includes any I/O exceptions that may occur

Class javax.activation.MimeTypeParseException extends Exception implements Serializable

Class javax.activation.UnsupportedDataTypeException extends IOException implements Serializable

Package javax.ejb

Class javax.ejb.AccessLocalException extends EJBException implements Serializable

Class javax.ejb.ConcurrentAccessException extends EJBException implements Serializable

Class javax.ejb.CreateException extends Exception implements Serializable

Class javax.ejb.DuplicateKeyException extends CreateException implements Serializable

Class javax.ejb.EJBAccessException extends EJBException implements Serializable

Class javax.ejb.EJBException extends RuntimeException implements Serializable

Serialized Fields

causeException

Exception causeException

Class javax.ejb.EJBTransactionRequiredException extends EJBException implements Serializable

Class javax.ejb.EJBTransactionRolledbackException extends EJBException implements Serializable

Class javax.ejb.FinderException extends Exception implements Serializable

Class javax.ejb.NoSuchEJBException extends EJBException implements Serializable

Class javax.ejb.NoSuchEntityException extends EJBException implements Serializable

Class javax.ejb.NoSuchObjectLocalException extends EJBException implements Serializable

Class javax.ejb.ObjectNotFoundException extends FinderException implements Serializable

Class javax.ejb.RemoveException extends Exception implements Serializable

Class javax.ejb.TransactionRequiredLocalException extends EJBException implements Serializable

Class javax.ejb.TransactionRolledbackLocalException extends EJBException implements Serializable

Package javax.el

Class javax.el.ELContextEvent extends EventObject implements Serializable

Class javax.el.ELException extends RuntimeException implements Serializable

Class javax.el.Expression extends Object implements Serializable

Class javax.el.MethodExpression extends Expression implements Serializable

Class javax.el.MethodNotFoundException extends ELException implements Serializable

Class javax.el.PropertyNotFoundException extends ELException implements Serializable

Class javax.el.PropertyNotWritableException extends ELException implements Serializable

Class javax.el.ValueExpression extends Expression implements Serializable

Package javax.enterprise.deploy.model.exceptions

Class javax.enterprise.deploy.model.exceptions.DDBeanCreateException extends Exception implements Serializable

Package javax.enterprise.deploy.spi.exceptions

Class javax.enterprise.deploy.spi.exceptions.BeanNotFoundException extends Exception implements Serializable

Class javax.enterprise.deploy.spi.exceptions.ClientExecuteException extends Exception implements Serializable

Class javax.enterprise.deploy.spi.exceptions.ConfigurationException extends Exception implements Serializable

Class javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException extends Exception implements Serializable

Class javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException extends Exception implements Serializable

Class javax.enterprise.deploy.spi.exceptions.InvalidModuleException extends Exception implements Serializable

Class javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException extends Exception implements Serializable

Class javax.enterprise.deploy.spi.exceptions.TargetException extends Exception implements Serializable

Package javax.enterprise.deploy.spi.status

Class javax.enterprise.deploy.spi.status.ProgressEvent extends EventObject implements Serializable

Serialized Fields

statuscode

DeploymentStatus statuscode

targetModuleID

TargetModuleID targetModuleID
Package javax.faces

Class javax.faces.FacesException extends RuntimeException implements Serializable

Serialized Fields

cause

Throwable cause

The underlying exception that caused this exception.

Package javax.faces.application

Class javax.faces.application.FacesMessage extends Object implements Serializable

serialVersionUID: -1180773928220076822L

Serialized Fields

severity

FacesMessage.Severity severity

summary

String summary

detail

String detail

Class javax.faces.application.ViewExpiredException extends FacesException implements Serializable

Serialized Fields

viewId

String viewId

The view identifier of the view that could not be restored.

Package javax.faces.convert

Class javax.faces.convert.ConverterException extends FacesException implements Serializable

Serialized Fields

facesMessage

FacesMessage facesMessage
Package javax.faces.el

Class javax.faces.el.EvaluationException extends FacesException implements Serializable

Class javax.faces.el.MethodNotFoundException extends EvaluationException implements Serializable

Class javax.faces.el.PropertyNotFoundException extends EvaluationException implements Serializable

Class javax.faces.el.ReferenceSyntaxException extends EvaluationException implements Serializable

Package javax.faces.event

Class javax.faces.event.AbortProcessingException extends FacesException implements Serializable

Class javax.faces.event.ActionEvent extends FacesEvent implements Serializable

Class javax.faces.event.FacesEvent extends EventObject implements Serializable

Serialized Fields

phaseId

PhaseId phaseId

Class javax.faces.event.PhaseEvent extends EventObject implements Serializable

Serialized Fields

context

FacesContext context

phaseId

PhaseId phaseId

Class javax.faces.event.ValueChangeEvent extends FacesEvent implements Serializable

Serialized Fields

oldValue

Object oldValue

The previous local value of the source UIComponent.

newValue

Object newValue

The current local value of the source UIComponent.

Package javax.faces.model

Class javax.faces.model.DataModelEvent extends EventObject implements Serializable

Serialized Fields

data

Object data

index

int index

Class javax.faces.model.SelectItem extends Object implements Serializable

serialVersionUID: 876782311414654999L

Serialized Fields

description

String description

disabled

boolean disabled

label

String label

value

Object value

escape

boolean escape
Holds value of property escape.

Class javax.faces.model.SelectItemGroup extends SelectItem implements Serializable

Serialized Fields

selectItems

SelectItem[] selectItems
Package javax.faces.validator

Class javax.faces.validator.ValidatorException extends FacesException implements Serializable

Serialized Fields

message

FacesMessage message
Package javax.faces.webapp

Class javax.faces.webapp.AttributeTag extends TagSupport implements Serializable

serialVersionUID: -7782950243436672334L

Serialized Fields

name

String name
Deprecated.

The name of the attribute to be created, if not already present.

value

String value
Deprecated.

The value to be associated with this attribute, if it is created.

Class javax.faces.webapp.ConverterELTag extends TagSupport implements Serializable

Class javax.faces.webapp.ConverterTag extends TagSupport implements Serializable

serialVersionUID: -5909792518081427720L

Serialized Fields

converterId

String converterId
Deprecated.

The identifier of the Converter instance to be created.

binding

String binding
Deprecated.

The ValueExpression that evaluates to an object that implements Converter.

Class javax.faces.webapp.FacetTag extends TagSupport implements Serializable

Serialized Fields

name

String name

The name of this facet. This will be used as the facet name for our UIComponentTag child in our UIComponentTag parent's facet list.

Class javax.faces.webapp.ValidatorELTag extends TagSupport implements Serializable

Class javax.faces.webapp.ValidatorTag extends TagSupport implements Serializable

serialVersionUID: -5562623615418158868L

Serialized Fields

validatorId

String validatorId
Deprecated.

The identifier of the Validator instance to be created.

binding

String binding
Deprecated.

The ValueExpression that evaluates to an object that implements Validator.

Package javax.jms

Class javax.jms.IllegalStateException extends JMSException implements Serializable

Class javax.jms.InvalidClientIDException extends JMSException implements Serializable

Class javax.jms.InvalidDestinationException extends JMSException implements Serializable

Class javax.jms.InvalidSelectorException extends JMSException implements Serializable

Class javax.jms.JMSException extends Exception implements Serializable

Serialized Fields

errorCode

String errorCode
Vendor-specific error code.

linkedException

Exception linkedException
Exception reference.

Class javax.jms.JMSSecurityException extends JMSException implements Serializable

Class javax.jms.MessageEOFException extends JMSException implements Serializable

Class javax.jms.MessageFormatException extends JMSException implements Serializable

Class javax.jms.MessageNotReadableException extends JMSException implements Serializable

Class javax.jms.MessageNotWriteableException extends JMSException implements Serializable

Class javax.jms.ResourceAllocationException extends JMSException implements Serializable

Class javax.jms.TransactionInProgressException extends JMSException implements Serializable

Class javax.jms.TransactionRolledBackException extends JMSException implements Serializable

Package javax.mail

Class javax.mail.Address extends Object implements Serializable

serialVersionUID: -5822459626751992278L

Class javax.mail.AuthenticationFailedException extends MessagingException implements Serializable

serialVersionUID: 492080754054436511L

Class javax.mail.Flags extends Object implements Serializable

serialVersionUID: 6243590407214169028L

Serialized Fields

system_flags

int system_flags

user_flags

Hashtable<K,V> user_flags

Class javax.mail.FolderClosedException extends MessagingException implements Serializable

serialVersionUID: 1687879213433302315L

Class javax.mail.FolderNotFoundException extends MessagingException implements Serializable

serialVersionUID: 472612108891249403L

Class javax.mail.IllegalWriteException extends MessagingException implements Serializable

serialVersionUID: 3974370223328268013L

Class javax.mail.Message.RecipientType extends Object implements Serializable

serialVersionUID: -7479791750606340008L

Serialization Methods

readResolve

protected Object readResolve()
                      throws ObjectStreamException
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class. Subclasses must implement their own readResolve method that checks for their known instances before calling this super method.

Throws:
ObjectStreamException
Serialized Fields

type

String type
The type of recipient, usually the name of a corresponding Internet standard header.

Class javax.mail.MessageRemovedException extends MessagingException implements Serializable

serialVersionUID: 1951292550679528690L

Class javax.mail.MessagingException extends Exception implements Serializable

serialVersionUID: -7569192289819959253L

Serialized Fields

next

Exception next
The next exception in the chain.

Class javax.mail.MethodNotSupportedException extends MessagingException implements Serializable

serialVersionUID: -3757386618726131322L

Class javax.mail.NoSuchProviderException extends MessagingException implements Serializable

serialVersionUID: 8058319293154708827L

Class javax.mail.ReadOnlyFolderException extends MessagingException implements Serializable

serialVersionUID: 5711829372799039325L

Class javax.mail.SendFailedException extends MessagingException implements Serializable

serialVersionUID: -6457531621682372913L

Class javax.mail.StoreClosedException extends MessagingException implements Serializable

serialVersionUID: -3145392336120082655L

Package javax.mail.event

Class javax.mail.event.ConnectionEvent extends MailEvent implements Serializable

serialVersionUID: -1855480171284792957L

Serialized Fields

type

int type
The event type.

Class javax.mail.event.FolderEvent extends MailEvent implements Serializable

serialVersionUID: 5278131310563694307L

Serialized Fields

type

int type
The event type.

Class javax.mail.event.MailEvent extends EventObject implements Serializable

serialVersionUID: 1846275636325456631L

Class javax.mail.event.MessageChangedEvent extends MailEvent implements Serializable

serialVersionUID: -4974972972105535108L

Serialized Fields

type

int type
The event type.

Class javax.mail.event.MessageCountEvent extends MailEvent implements Serializable

serialVersionUID: -7447022340837897369L

Serialized Fields

type

int type
The event type.

removed

boolean removed
If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this. If false, this event is the result of an expunge by external sources.

Class javax.mail.event.StoreEvent extends MailEvent implements Serializable

serialVersionUID: 1938704919992515330L

Serialized Fields

type

int type
The event type.

message

String message
The message text to be presented to the user.

Class javax.mail.event.TransportEvent extends MailEvent implements Serializable

serialVersionUID: -4729852364684273073L

Serialized Fields

type

int type
The event type.

Package javax.mail.internet

Class javax.mail.internet.AddressException extends ParseException implements Serializable

serialVersionUID: 9134583443539323120L

Serialized Fields

ref

String ref
The string being parsed.

pos

int pos
The index in the string where the error occurred, or -1 if not known.

Class javax.mail.internet.InternetAddress extends Address implements Serializable

serialVersionUID: -7507595530758302903L

Serialized Fields

address

String address

personal

String personal
The personal name.

encodedPersonal

String encodedPersonal
The RFC 2047 encoded version of the personal name.

This field and the personal field track each other, so if a subclass sets one of these fields directly, it should set the other to null, so that it is suitably recomputed.

Class javax.mail.internet.MailDateFormat extends SimpleDateFormat implements Serializable

serialVersionUID: -8148227605210628779L

Class javax.mail.internet.MimeMessage.RecipientType extends Message.RecipientType implements Serializable

serialVersionUID: -5468290701714395543L

Serialization Methods

readResolve

protected Object readResolve()
                      throws ObjectStreamException
Throws:
ObjectStreamException

Class javax.mail.internet.NewsAddress extends Address implements Serializable

serialVersionUID: -4203797299824684143L

Serialized Fields

newsgroup

String newsgroup

host

String host

Class javax.mail.internet.ParseException extends MessagingException implements Serializable

serialVersionUID: 7649991205183658089L

Package javax.mail.search

Class javax.mail.search.AddressStringTerm extends StringTerm implements Serializable

serialVersionUID: 3086821234204980368L

Class javax.mail.search.AddressTerm extends SearchTerm implements Serializable

serialVersionUID: 2005405551929769980L

Serialized Fields

address

Address address
The address.

Class javax.mail.search.AndTerm extends SearchTerm implements Serializable

serialVersionUID: -3583274505380989582L

Serialized Fields

terms

SearchTerm[] terms
The array of terms on which the AND operator should be applied.

Class javax.mail.search.BodyTerm extends StringTerm implements Serializable

serialVersionUID: -4888862527916911385L

Class javax.mail.search.ComparisonTerm extends SearchTerm implements Serializable

serialVersionUID: 1456646953666474308L

Serialized Fields

comparison

int comparison
The comparison.

Class javax.mail.search.DateTerm extends ComparisonTerm implements Serializable

serialVersionUID: 4818873430063720043L

Serialized Fields

date

Date date
The date.

Class javax.mail.search.FlagTerm extends SearchTerm implements Serializable

serialVersionUID: -142991500302030647L

Serialized Fields

set

boolean set
Indicates whether to test for the presence or absence of the specified Flag. If true, then test whether all the specified flags are present, else test whether all the specified flags are absent.

flags

Flags flags
Flags object containing the flags to test.

Class javax.mail.search.FromStringTerm extends AddressStringTerm implements Serializable

serialVersionUID: 5801127523826772788L

Class javax.mail.search.FromTerm extends AddressTerm implements Serializable

serialVersionUID: 5214730291502658665L

Class javax.mail.search.HeaderTerm extends StringTerm implements Serializable

serialVersionUID: 8342514650333389122L

Serialized Fields

headerName

String headerName
The name of the header.

Class javax.mail.search.IntegerComparisonTerm extends ComparisonTerm implements Serializable

serialVersionUID: -6963571240154302484L

Serialized Fields

number

int number
The number.

Class javax.mail.search.MessageIDTerm extends StringTerm implements Serializable

serialVersionUID: -2121096296454691963L

Class javax.mail.search.MessageNumberTerm extends IntegerComparisonTerm implements Serializable

serialVersionUID: -5379625829658623812L

Class javax.mail.search.NotTerm extends SearchTerm implements Serializable

serialVersionUID: 7152293214217310216L

Serialized Fields

term

SearchTerm term
The search term to negate.

Class javax.mail.search.OrTerm extends SearchTerm implements Serializable

serialVersionUID: 5380534067523646936L

Serialized Fields

terms

SearchTerm[] terms
The array of terms on which the OR operator should be applied.

Class javax.mail.search.ReceivedDateTerm extends DateTerm implements Serializable

serialVersionUID: -2756695246195503170L

Class javax.mail.search.RecipientStringTerm extends AddressStringTerm implements Serializable

serialVersionUID: -8293562089611618849L

Serialized Fields

type

Message.RecipientType type
The recipient type.

Class javax.mail.search.RecipientTerm extends AddressTerm implements Serializable

serialVersionUID: 6548700653122680468L

Serialized Fields

type

Message.RecipientType type
The recipient type.

Class javax.mail.search.SearchException extends MessagingException implements Serializable

serialVersionUID: -7092886778226268686L

Class javax.mail.search.SearchTerm extends Object implements Serializable

serialVersionUID: -6652358452205992789L

Class javax.mail.search.SentDateTerm extends DateTerm implements Serializable

serialVersionUID: 5647755030530907263L

Class javax.mail.search.SizeTerm extends IntegerComparisonTerm implements Serializable

serialVersionUID: -2556219451005103709L

Class javax.mail.search.StringTerm extends SearchTerm implements Serializable

serialVersionUID: 1274042129007696269L

Serialized Fields

pattern

String pattern
The pattern.

ignoreCase

boolean ignoreCase
Ignore case when comparing?

Class javax.mail.search.SubjectTerm extends StringTerm implements Serializable

serialVersionUID: 7481568618055573432L

Package javax.management.j2ee
Package javax.persistence

Class javax.persistence.EntityExistsException extends PersistenceException implements Serializable

Class javax.persistence.EntityNotFoundException extends PersistenceException implements Serializable

Class javax.persistence.NonUniqueResultException extends PersistenceException implements Serializable

Class javax.persistence.NoResultException extends PersistenceException implements Serializable

Class javax.persistence.OptimisticLockException extends PersistenceException implements Serializable

Serialized Fields

entity

Object entity
The object that caused the exception

Class javax.persistence.PersistenceException extends RuntimeException implements Serializable

Class javax.persistence.RollbackException extends PersistenceException implements Serializable

Class javax.persistence.TransactionRequiredException extends PersistenceException implements Serializable

Package javax.resource

Class javax.resource.NotSupportedException extends ResourceException implements Serializable

Class javax.resource.ResourceException extends Exception implements Serializable

Serialized Fields

errorCode

String errorCode
Vendor specific error code

linkedException

Exception linkedException
reference to another exception

Package javax.resource.cci

Class javax.resource.cci.ResourceWarning extends ResourceException implements Serializable

Package javax.resource.spi

Class javax.resource.spi.ApplicationServerInternalException extends ResourceException implements Serializable

Class javax.resource.spi.CommException extends ResourceException implements Serializable

Class javax.resource.spi.ConnectionEvent extends EventObject implements Serializable

Serialized Fields

exception

Exception exception
Exception associated with the ConnectionEvent instance.

id

int id
Type of the event

connectionHandle

Object connectionHandle

Class javax.resource.spi.EISSystemException extends ResourceException implements Serializable

Class javax.resource.spi.IllegalStateException extends ResourceException implements Serializable

Class javax.resource.spi.InvalidPropertyException extends ResourceException implements Serializable

Serialized Fields

invalidProperties

PropertyDescriptor[] invalidProperties

Class javax.resource.spi.LocalTransactionException extends ResourceException implements Serializable

Class javax.resource.spi.ResourceAdapterInternalException extends ResourceException implements Serializable

Class javax.resource.spi.ResourceAllocationException extends ResourceException implements Serializable

Class javax.resource.spi.SecurityException extends ResourceException implements Serializable

Class javax.resource.spi.SharingViolationException extends ResourceException implements Serializable

Class javax.resource.spi.UnavailableException extends ResourceException implements Serializable

Package javax.resource.spi.security

Class javax.resource.spi.security.PasswordCredential extends Object implements Serializable

Serialized Fields

userName

String userName

password

char[] password

mcf

ManagedConnectionFactory mcf
Package javax.resource.spi.work

Class javax.resource.spi.work.WorkCompletedException extends WorkException implements Serializable

Class javax.resource.spi.work.WorkEvent extends EventObject implements Serializable

Serialized Fields

type

int type
The event type.

work

Work work
The Work object on which the event occured.

exc

WorkException exc
The exception that occured during Work processing.

startDuration

long startDuration
The start delay duration (in milliseconds).

Class javax.resource.spi.work.WorkException extends ResourceException implements Serializable

Class javax.resource.spi.work.WorkRejectedException extends WorkException implements Serializable

Package javax.security.jacc

Class javax.security.jacc.EJBMethodPermission extends Permission implements Serializable

serialVersionUID: 1L

Serialization Methods

readObject

private void readObject(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
readObject reads the serialized fields from the input stream and uses them to restore the permission. This method need not be implemented if establishing the values of the serialized fields (as is done by defaultReadObject) is sufficient to initialize the permission.

Throws:
IOException
ClassNotFoundException

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
writeObject is used to establish the values of the serialized fields before they are written to the output stream and need not be implemented if the values of the serialized fields are always available and up to date. The serialized fields are written to the output stream in the same form as they would be written by defaultWriteObject.

Throws:
IOException
Serialization Overview
The serialized fields of this permission are defined below. Whether or not the serialized fields correspond to actual (private) fields is an implementation decision.

Serialized Fields

actions

String actions
the canonicalized actions string (as returned by getActions).

Class javax.security.jacc.EJBRoleRefPermission extends Permission implements Serializable

serialVersionUID: 1L

Serialization Methods

readObject

private void readObject(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
readObject reads the serialized fields from the input stream and uses them to restore the permission. This method need not be implemented if establishing the values of the serialized fields (as is done by defaultReadObject) is sufficient to initialize the permission.

Throws:
IOException
ClassNotFoundException

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
writeObject is used to establish the values of the serialized fields before they are written to the output stream and need not be implemented if the values of the serialized fields are always available and up to date. The serialized fields are written to the output stream in the same form as they would be written by defaultWriteObject.

Throws:
IOException
Serialization Overview
The serialized fields of this permission are defined below. Whether or not the serialized fields correspond to actual (private) fields is an implementation decision.

Serialized Fields

actions

String actions
the canonicalized actions string (as returned by getActions).

Class javax.security.jacc.PolicyContextException extends Exception implements Serializable

Class javax.security.jacc.WebResourcePermission extends Permission implements Serializable

serialVersionUID: 1L

Serialization Methods

readObject

private void readObject(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
readObject reads the serialized fields from the input stream and uses them to restore the permission. This method need not be implemented if establishing the values of the serialized fields (as is done by defaultReadObject) is sufficient to initialize the permission.

Throws:
IOException
ClassNotFoundException

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
writeObject is used to establish the values of the serialized fields before they are written to the output stream and need not be implemented if the values of the serialized fields are always available and up to date. The serialized fields are written to the output stream in the same form as they would be written by defaultWriteObject.

Throws:
IOException
Serialization Overview
The serialized fields of this permission are defined below. Whether or not the serialized fields correspond to actual (private) fields is an implementation decision.

Serialized Fields

actions

String actions
the canonicalized actions string (as returned by getActions).

Class javax.security.jacc.WebRoleRefPermission extends Permission implements Serializable

serialVersionUID: 1L

Serialization Methods

readObject

private void readObject(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
readObject reads the serialized fields from the input stream and uses them to restore the permission. This method need not be implemented if establishing the values of the serialized fields (as is done by defaultReadObject) is sufficient to initialize the permission.

Throws:
IOException
ClassNotFoundException

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
writeObject is used to establish the values of the serialized fields before they are written to the output stream and need not be implemented if the values of the serialized fields are always available and up to date. The serialized fields are written to the output stream in the same form as they would be written by defaultWriteObject.

Throws:
IOException
Serialization Overview
The serialized fields of this permission are defined below. Whether or not the serialized fields correspond to actual (private) fields is an implementation decision.

Serialized Fields

actions

String actions
the canonicalized actions string (as returned by getActions).

Class javax.security.jacc.WebUserDataPermission extends Permission implements Serializable

serialVersionUID: 1L

Serialization Methods

readObject

private void readObject(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
readObject reads the serialized fields from the input stream and uses them to restore the permission. This method need not be implemented if establishing the values of the serialized fields (as is done by defaultReadObject) is sufficient to initialize the permission.

Throws:
IOException
ClassNotFoundException

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
writeObject is used to establish the values of the serialized fields before they are written to the output stream and need not be implemented if the values of the serialized fields are always available and up to date. The serialized fields are written to the output stream in the same form as they would be written by defaultWriteObject.

Throws:
IOException
Serialization Overview
The serialized fields of this permission are defined below. Whether or not the serialized fields correspond to actual (private) fields is an implementation decision.

Serialized Fields

actions

String actions
the canonicalized actions string (as returned by getActions).
Package javax.servlet

Class javax.servlet.GenericServlet extends Object implements Serializable

Class javax.servlet.ServletContextAttributeEvent extends ServletContextEvent implements Serializable

Serialized Fields

name

String name

value

Object value

Class javax.servlet.ServletContextEvent extends EventObject implements Serializable

Class javax.servlet.ServletException extends Exception implements Serializable

Serialized Fields

rootCause

Throwable rootCause

Class javax.servlet.ServletRequestAttributeEvent extends ServletRequestEvent implements Serializable

Serialized Fields

name

String name

value

Object value

Class javax.servlet.ServletRequestEvent extends EventObject implements Serializable

Serialized Fields

request

ServletRequest request

Class javax.servlet.UnavailableException extends ServletException implements Serializable

Serialized Fields

servlet

Servlet servlet

permanent

boolean permanent

seconds

int seconds
Package javax.servlet.http

Class javax.servlet.http.HttpServlet extends GenericServlet implements Serializable

Class javax.servlet.http.HttpSessionBindingEvent extends HttpSessionEvent implements Serializable

Serialized Fields

name

String name

value

Object value

Class javax.servlet.http.HttpSessionEvent extends EventObject implements Serializable

Package javax.servlet.jsp

Class javax.servlet.jsp.JspException extends Exception implements Serializable

Class javax.servlet.jsp.JspTagException extends JspException implements Serializable

Class javax.servlet.jsp.SkipPageException extends JspException implements Serializable

Package javax.servlet.jsp.el

Class javax.servlet.jsp.el.ELException extends Exception implements Serializable

Serialized Fields

mRootCause

Throwable mRootCause
Deprecated.

Class javax.servlet.jsp.el.ELParseException extends ELException implements Serializable

Package javax.servlet.jsp.tagext

Class javax.servlet.jsp.tagext.BodyTagSupport extends TagSupport implements Serializable

Serialized Fields

bodyContent

BodyContent bodyContent
The current BodyContent for this BodyTag.

Class javax.servlet.jsp.tagext.TagSupport extends Object implements Serializable

Serialized Fields

parent

Tag parent

values

Hashtable<K,V> values

id

String id
The value of the id attribute of this tag; or null.

pageContext

PageContext pageContext
The PageContext.

Package javax.transaction

Class javax.transaction.HeuristicCommitException extends Exception implements Serializable

Class javax.transaction.HeuristicMixedException extends Exception implements Serializable

Class javax.transaction.HeuristicRollbackException extends Exception implements Serializable

Class javax.transaction.InvalidTransactionException extends RemoteException implements Serializable

Class javax.transaction.NotSupportedException extends Exception implements Serializable

Class javax.transaction.RollbackException extends Exception implements Serializable

Class javax.transaction.SystemException extends Exception implements Serializable

Serialized Fields

errorCode

int errorCode
The error code with which to create the SystemException.

The error code for the exception

Class javax.transaction.TransactionRequiredException extends RemoteException implements Serializable

Class javax.transaction.TransactionRolledbackException extends RemoteException implements Serializable

Package javax.transaction.xa

Class javax.transaction.xa.XAException extends Exception implements Serializable

Serialized Fields

errorCode

int errorCode
The error code with which to create the SystemException.

The error code for the exception.
Package javax.xml.bind

Class javax.xml.bind.DataBindingException extends RuntimeException implements Serializable

Class javax.xml.bind.JAXBElement extends Object implements Serializable

serialVersionUID: 1L

Serialized Fields

name

QName name
xml element tag name

declaredType

Class<T> declaredType
Java datatype binding for xml element declaration's type.

scope

Class<T> scope
Scope of xml element declaration representing this xml element instance. Can be one of the following values: - JAXBElement.GlobalScope for global xml element declaration. - local element declaration has a scope set to the Java class representation of complex type defintion containing xml element declaration.

value

Object value
xml element value. Represents content model and attributes of an xml element instance.

nil

boolean nil
true iff the xml element instance has xsi:nil="true".

Class javax.xml.bind.JAXBException extends Exception implements Serializable

serialVersionUID: -5621384651494307979L

Serialized Fields

errorCode

String errorCode
Vendor specific error code

linkedException

Throwable linkedException
Exception reference

Class javax.xml.bind.MarshalException extends JAXBException implements Serializable

Class javax.xml.bind.PropertyException extends JAXBException implements Serializable

Class javax.xml.bind.TypeConstraintException extends RuntimeException implements Serializable

Serialized Fields

errorCode

String errorCode
Vendor specific error code

linkedException

Throwable linkedException
Exception reference

Class javax.xml.bind.UnmarshalException extends JAXBException implements Serializable

Class javax.xml.bind.ValidationException extends JAXBException implements Serializable

Package javax.xml.registry

Class javax.xml.registry.DeleteException extends RegistryException implements Serializable

Class javax.xml.registry.FindException extends RegistryException implements Serializable

Class javax.xml.registry.InvalidRequestException extends JAXRException implements Serializable

Class javax.xml.registry.JAXRException extends Exception implements Serializable

Serialized Fields

cause

Throwable cause

Class javax.xml.registry.RegistryException extends JAXRException implements Serializable

Serialized Fields

errorObjectKey

Key errorObjectKey

Class javax.xml.registry.SaveException extends RegistryException implements Serializable

Class javax.xml.registry.UnexpectedObjectException extends JAXRException implements Serializable

Class javax.xml.registry.UnsupportedCapabilityException extends JAXRException implements Serializable

Package javax.xml.rpc

Class javax.xml.rpc.JAXRPCException extends RuntimeException implements Serializable

Serialized Fields

cause

Throwable cause

Class javax.xml.rpc.ServiceException extends Exception implements Serializable

Serialized Fields

cause

Throwable cause
Package javax.xml.rpc.encoding
Package javax.xml.rpc.handler

Class javax.xml.rpc.handler.HandlerInfo extends Object implements Serializable

Serialized Fields

handlerClass

Class<T> handlerClass

config

Map<K,V> config

headers

Vector<E> headers
Package javax.xml.rpc.soap

Class javax.xml.rpc.soap.SOAPFaultException extends RuntimeException implements Serializable

Serialized Fields

faultcode

QName faultcode

faultstring

String faultstring

faultactor

String faultactor

detail

Detail detail
Package javax.xml.soap

Class javax.xml.soap.SOAPException extends Exception implements Serializable

Serialized Fields

cause

Throwable cause
Package javax.xml.stream

Class javax.xml.stream.FactoryConfigurationError extends Error implements Serializable

Serialized Fields

nested

Exception nested

Class javax.xml.stream.XMLStreamException extends Exception implements Serializable

Serialized Fields

nested

Throwable nested

location

Location location
Package javax.xml.ws

Class javax.xml.ws.ProtocolException extends WebServiceException implements Serializable

Class javax.xml.ws.WebServiceException extends RuntimeException implements Serializable

Class javax.xml.ws.WebServicePermission extends BasicPermission implements Serializable

serialVersionUID: -146474640053770988L

Package javax.xml.ws.http

Class javax.xml.ws.http.HTTPException extends ProtocolException implements Serializable

Serialized Fields

statusCode

int statusCode
Package javax.xml.ws.soap

Class javax.xml.ws.soap.SOAPFaultException extends ProtocolException implements Serializable

Serialized Fields

fault

SOAPFault fault

Overview Package Class Tree Deprecated Index Help
PREV NEXT FRAMES NO FRAMES
Submit a bug or feature

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


javax.activation (Java EE 5)

 javax.activation
Interfaces
CommandObject
DataContentHandler
DataContentHandlerFactory
DataSource
Classes
ActivationDataFlavor
CommandInfo
CommandMap
DataHandler
FileDataSource
FileTypeMap
MailcapCommandMap
MimeType
MimeTypeParameterList
MimetypesFileTypeMap
URLDataSource
Exceptions
MimeTypeParseException
UnsupportedDataTypeException


javax.annotation (Java EE 5)

 javax.annotation
Enums
Resource.AuthenticationType
Annotation Types
Generated
PostConstruct
PreDestroy
Resource
Resources


Resource.AuthenticationType (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.annotation
Enum Resource.AuthenticationType

java.lang.Object
    extended by  java.lang.Enum<Resource.AuthenticationType>
        extended by  javax.annotation.Resource.AuthenticationType
All Implemented Interfaces:
Serializable, Comparable<Resource.AuthenticationType>
Enclosing class:
Resource
public static enum Resource.AuthenticationType
extends Enum<Resource.AuthenticationType>

Extends: Enum<E>
Contained within: Resource

资源的两种可能验证类型。
英文文档：

The two possible authentication types for a resource.

Enum Constant Summary
APPLICATION
CONTAINER
Method Summary
static Resource.AuthenticationType | valueOf(String name) Returns the enum constant of this type with the specified name.
static Resource.AuthenticationType[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

CONTAINER

public static final Resource.AuthenticationType CONTAINER

英文文档：

APPLICATION

public static final Resource.AuthenticationType APPLICATION
Method Detail

final public static Resource.AuthenticationType[] values()
英文文档：

values

public static final Resource.AuthenticationType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Resource.AuthenticationType c : Resource.AuthenticationType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static Resource.AuthenticationType valueOf(String name)
英文文档：

valueOf

public static Resource.AuthenticationType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


javax.annotation.security (Java EE 5)

 javax.annotation.security
Annotation Types
DeclareRoles
DenyAll
PermitAll
RolesAllowed
RunAs


javax.ejb (Java EE 5)

 javax.ejb
Interfaces
EJBContext
EJBHome
EJBLocalHome
EJBLocalObject
EJBMetaData
EJBObject
EnterpriseBean
EntityBean
EntityContext
Handle
HomeHandle
MessageDrivenBean
MessageDrivenContext
SessionBean
SessionContext
SessionSynchronization
TimedObject
Timer
TimerHandle
TimerService
Enums
TransactionAttributeType
TransactionManagementType
Exceptions
AccessLocalException
ConcurrentAccessException
CreateException
DuplicateKeyException
EJBAccessException
EJBException
EJBTransactionRequiredException
EJBTransactionRolledbackException
FinderException
NoSuchEJBException
NoSuchEntityException
NoSuchObjectLocalException
ObjectNotFoundException
RemoveException
TransactionRequiredLocalException
TransactionRolledbackLocalException
Annotation Types
ActivationConfigProperty
ApplicationException
EJB
EJBs
Init
Local
LocalHome
MessageDriven
PostActivate
PrePassivate
Remote
RemoteHome
Remove
Stateful
Stateless
Timeout
TransactionAttribute
TransactionManagement


javax.ejb.spi (Java EE 5)

 javax.ejb.spi
Interfaces
HandleDelegate


javax.el (Java EE 5)

 javax.el
Interfaces
ELContextListener
Classes
ArrayELResolver
BeanELResolver
BeanELResolver.BeanProperties
BeanELResolver.BeanProperty
CompositeELResolver
ELContext
ELContextEvent
ELResolver
Expression
ExpressionFactory
FunctionMapper
ListELResolver
MapELResolver
MethodExpression
MethodInfo
ResourceBundleELResolver
ValueExpression
VariableMapper
Exceptions
ELException
MethodNotFoundException
PropertyNotFoundException
PropertyNotWritableException


javax.enterprise.deploy.model (Java EE 5)

 javax.enterprise.deploy.model
Interfaces
DDBean
DDBeanRoot
DeployableObject
J2eeApplicationObject
XpathListener
Classes
XpathEvent


javax.enterprise.deploy.model.exceptions (Java EE 5)

 javax.enterprise.deploy.model.exceptions
Exceptions
DDBeanCreateException


javax.enterprise.deploy.shared (Java EE 5)

 javax.enterprise.deploy.shared
Classes
ActionType
CommandType
DConfigBeanVersionType
ModuleType
StateType


javax.enterprise.deploy.shared.factories (Java EE 5)

 javax.enterprise.deploy.shared.factories
Classes
DeploymentFactoryManager


javax.enterprise.deploy.spi (Java EE 5)

 javax.enterprise.deploy.spi
Interfaces
DConfigBean
DConfigBeanRoot
DeploymentConfiguration
DeploymentManager
Target
TargetModuleID


javax.enterprise.deploy.spi.exceptions (Java EE 5)

 javax.enterprise.deploy.spi.exceptions
Exceptions
BeanNotFoundException
ClientExecuteException
ConfigurationException
DConfigBeanVersionUnsupportedException
DeploymentManagerCreationException
InvalidModuleException
OperationUnsupportedException
TargetException


javax.enterprise.deploy.spi.factories (Java EE 5)

 javax.enterprise.deploy.spi.factories
Interfaces
DeploymentFactory


javax.enterprise.deploy.spi.status (Java EE 5)

 javax.enterprise.deploy.spi.status
Interfaces
ClientConfiguration
DeploymentStatus
ProgressListener
ProgressObject
Classes
ProgressEvent


javax.faces (Java EE 5)

 javax.faces
Classes
FactoryFinder
Exceptions
FacesException


javax.faces.application (Java EE 5)

 javax.faces.application
Classes
Application
ApplicationFactory
FacesMessage
FacesMessage.Severity
NavigationHandler
StateManager
StateManagerWrapper
ViewHandler
ViewHandlerWrapper
Exceptions
ViewExpiredException


javax.faces.component (Java EE 5)

 javax.faces.component
Interfaces
ActionSource
ActionSource2
ContextCallback
EditableValueHolder
NamingContainer
StateHolder
ValueHolder
Classes
UIColumn
UICommand
UIComponent
UIComponentBase
UIData
UIForm
UIGraphic
UIInput
UIMessage
UIMessages
UINamingContainer
UIOutput
UIPanel
UIParameter
UISelectBoolean
UISelectItem
UISelectItems
UISelectMany
UISelectOne
UIViewRoot


javax.faces.component.html (Java EE 5)

 javax.faces.component.html
Classes
HtmlColumn
HtmlCommandButton
HtmlCommandLink
HtmlDataTable
HtmlForm
HtmlGraphicImage
HtmlInputHidden
HtmlInputSecret
HtmlInputText
HtmlInputTextarea
HtmlMessage
HtmlMessages
HtmlOutputFormat
HtmlOutputLabel
HtmlOutputLink
HtmlOutputText
HtmlPanelGrid
HtmlPanelGroup
HtmlSelectBooleanCheckbox
HtmlSelectManyCheckbox
HtmlSelectManyListbox
HtmlSelectManyMenu
HtmlSelectOneListbox
HtmlSelectOneMenu
HtmlSelectOneRadio


javax.faces.context (Java EE 5)

 javax.faces.context
Classes
ExternalContext
FacesContext
FacesContextFactory
ResponseStream
ResponseWriter
ResponseWriterWrapper


javax.faces.convert (Java EE 5)

 javax.faces.convert
Interfaces
Converter
Classes
BigDecimalConverter
BigIntegerConverter
BooleanConverter
ByteConverter
CharacterConverter
DateTimeConverter
DoubleConverter
EnumConverter
FloatConverter
IntegerConverter
LongConverter
NumberConverter
ShortConverter
Exceptions
ConverterException


javax.faces.el (Java EE 5)

 javax.faces.el
Classes
MethodBinding
PropertyResolver
ValueBinding
VariableResolver
Exceptions
EvaluationException
MethodNotFoundException
PropertyNotFoundException
ReferenceSyntaxException


javax.faces.event (Java EE 5)

 javax.faces.event
Interfaces
ActionListener
FacesListener
PhaseListener
ValueChangeListener
Classes
ActionEvent
FacesEvent
MethodExpressionActionListener
MethodExpressionValueChangeListener
PhaseEvent
PhaseId
ValueChangeEvent
Exceptions
AbortProcessingException


javax.faces.lifecycle (Java EE 5)

 javax.faces.lifecycle
Classes
Lifecycle
LifecycleFactory


javax.faces.model (Java EE 5)

 javax.faces.model
Interfaces
DataModelListener
Classes
ArrayDataModel
DataModel
DataModelEvent
ListDataModel
ResultDataModel
ResultSetDataModel
ScalarDataModel
SelectItem
SelectItemGroup


javax.faces.render (Java EE 5)

 javax.faces.render
Classes
Renderer
RenderKit
RenderKitFactory
ResponseStateManager


javax.faces.validator (Java EE 5)

 javax.faces.validator
Interfaces
Validator
Classes
DoubleRangeValidator
LengthValidator
LongRangeValidator
MethodExpressionValidator
Exceptions
ValidatorException


javax.faces.webapp (Java EE 5)

 javax.faces.webapp
Classes
AttributeTag
ConverterELTag
ConverterTag
FacesServlet
FacetTag
UIComponentBodyTag
UIComponentClassicTagBase
UIComponentELTag
UIComponentTag
UIComponentTagBase
ValidatorELTag
ValidatorTag


javax.interceptor (Java EE 5)

 javax.interceptor
Interfaces
InvocationContext
Annotation Types
AroundInvoke
ExcludeClassInterceptors
ExcludeDefaultInterceptors
Interceptors


javax.jms (Java EE 5)

 javax.jms
Interfaces
BytesMessage
Connection
ConnectionConsumer
ConnectionFactory
ConnectionMetaData
DeliveryMode
Destination
ExceptionListener
MapMessage
Message
MessageConsumer
MessageListener
MessageProducer
ObjectMessage
Queue
QueueBrowser
QueueConnection
QueueConnectionFactory
QueueReceiver
QueueSender
QueueSession
ServerSession
ServerSessionPool
Session
StreamMessage
TemporaryQueue
TemporaryTopic
TextMessage
Topic
TopicConnection
TopicConnectionFactory
TopicPublisher
TopicSession
TopicSubscriber
XAConnection
XAConnectionFactory
XAQueueConnection
XAQueueConnectionFactory
XAQueueSession
XASession
XATopicConnection
XATopicConnectionFactory
XATopicSession
Classes
QueueRequestor
TopicRequestor
Exceptions
IllegalStateException
InvalidClientIDException
InvalidDestinationException
InvalidSelectorException
JMSException
JMSSecurityException
MessageEOFException
MessageFormatException
MessageNotReadableException
MessageNotWriteableException
ResourceAllocationException
TransactionInProgressException
TransactionRolledBackException


javax.jws (Java EE 5)

 javax.jws
Enums
WebParam.Mode
Annotation Types
HandlerChain
Oneway
WebMethod
WebParam
WebResult
WebService


WebParam.Mode (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.jws
Enum WebParam.Mode

java.lang.Object
    extended by  java.lang.Enum<WebParam.Mode>
        extended by  javax.jws.WebParam.Mode
All Implemented Interfaces:
Serializable, Comparable<WebParam.Mode>
Enclosing class:
WebParam
public static enum WebParam.Mode
extends Enum<WebParam.Mode>

Extends: Enum<E>
Contained within: WebParam

参数的流向。
英文文档：

The direction in which the parameter flows

Enum Constant Summary
IN
INOUT
OUT
Method Summary
static WebParam.Mode | valueOf(String name) Returns the enum constant of this type with the specified name.
static WebParam.Mode[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

IN

public static final WebParam.Mode IN

英文文档：

OUT

public static final WebParam.Mode OUT

英文文档：

INOUT

public static final WebParam.Mode INOUT
Method Detail

final public static WebParam.Mode[] values()
英文文档：

values

public static final WebParam.Mode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(WebParam.Mode c : WebParam.Mode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static WebParam.Mode valueOf(String name)
英文文档：

valueOf

public static WebParam.Mode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


javax.jws.soap (Java EE 5)

 javax.jws.soap
Enums
SOAPBinding.ParameterStyle
SOAPBinding.Style
SOAPBinding.Use
Annotation Types
InitParam
SOAPBinding
SOAPMessageHandler
SOAPMessageHandlers


SOAPBinding.ParameterStyle (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.jws.soap
Enum SOAPBinding.ParameterStyle

java.lang.Object
    extended by  java.lang.Enum<SOAPBinding.ParameterStyle>
        extended by  javax.jws.soap.SOAPBinding.ParameterStyle
All Implemented Interfaces:
Serializable, Comparable<SOAPBinding.ParameterStyle>
Enclosing class:
SOAPBinding
public static enum SOAPBinding.ParameterStyle
extends Enum<SOAPBinding.ParameterStyle>

Extends: Enum<E>
Contained within: SOAPBinding

参数到 SOAP 消息的映射关系的样式。
英文文档：

The style of mapping parameters onto SOAP messages

Enum Constant Summary
BARE
WRAPPED
Method Summary
static SOAPBinding.ParameterStyle | valueOf(String name) Returns the enum constant of this type with the specified name.
static SOAPBinding.ParameterStyle[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

BARE

public static final SOAPBinding.ParameterStyle BARE

英文文档：

WRAPPED

public static final SOAPBinding.ParameterStyle WRAPPED
Method Detail

final public static SOAPBinding.ParameterStyle[] values()
英文文档：

values

public static final SOAPBinding.ParameterStyle[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SOAPBinding.ParameterStyle c : SOAPBinding.ParameterStyle.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static SOAPBinding.ParameterStyle valueOf(String name)
英文文档：

valueOf

public static SOAPBinding.ParameterStyle valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


SOAPBinding.Style (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.jws.soap
Enum SOAPBinding.Style

java.lang.Object
    extended by  java.lang.Enum<SOAPBinding.Style>
        extended by  javax.jws.soap.SOAPBinding.Style
All Implemented Interfaces:
Serializable, Comparable<SOAPBinding.Style>
Enclosing class:
SOAPBinding
public static enum SOAPBinding.Style
extends Enum<SOAPBinding.Style>

Extends: Enum<E>
Contained within: SOAPBinding

SOAP 绑定样式。
英文文档：

The SOAP binding style

Enum Constant Summary
DOCUMENT
RPC
Method Summary
static SOAPBinding.Style | valueOf(String name) Returns the enum constant of this type with the specified name.
static SOAPBinding.Style[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

DOCUMENT

public static final SOAPBinding.Style DOCUMENT

英文文档：

RPC

public static final SOAPBinding.Style RPC
Method Detail

final public static SOAPBinding.Style[] values()
英文文档：

values

public static final SOAPBinding.Style[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SOAPBinding.Style c : SOAPBinding.Style.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static SOAPBinding.Style valueOf(String name)
英文文档：

valueOf

public static SOAPBinding.Style valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


SOAPBinding.Use (Java EE 5)

SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD

javax.jws.soap
Enum SOAPBinding.Use

java.lang.Object
    extended by  java.lang.Enum<SOAPBinding.Use>
        extended by  javax.jws.soap.SOAPBinding.Use
All Implemented Interfaces:
Serializable, Comparable<SOAPBinding.Use>
Enclosing class:
SOAPBinding
public static enum SOAPBinding.Use
extends Enum<SOAPBinding.Use>

Extends: Enum<E>
Contained within: SOAPBinding

SOAP 绑定的使用。
英文文档：

The SOAP binding use

Enum Constant Summary
ENCODED
LITERAL
Method Summary
static SOAPBinding.Use | valueOf(String name) Returns the enum constant of this type with the specified name.
static SOAPBinding.Use[] | values() Returns an array containing the constants of this enum type, in the order they're declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

英文文档：

LITERAL

public static final SOAPBinding.Use LITERAL

英文文档：

ENCODED

public static final SOAPBinding.Use ENCODED
Method Detail

final public static SOAPBinding.Use[] values()
英文文档：

values

public static final SOAPBinding.Use[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SOAPBinding.Use c : SOAPBinding.Use.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

public static SOAPBinding.Use valueOf(String name)
英文文档：

valueOf

public static SOAPBinding.Use valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD DETAIL: ENUM CONSTANTS | FIELD | METHOD


javax.mail (Java EE 5)

 javax.mail
Interfaces
MessageAware
MultipartDataSource
Part
QuotaAwareStore
UIDFolder
Classes
Address
Authenticator
BodyPart
FetchProfile
FetchProfile.Item
Flags
Flags.Flag
Folder
Header
Message
Message.RecipientType
MessageContext
Multipart
PasswordAuthentication
Provider
Provider.Type
Quota
Quota.Resource
Service
Session
Store
Transport
UIDFolder.FetchProfileItem
URLName
Exceptions
AuthenticationFailedException
FolderClosedException
FolderNotFoundException
IllegalWriteException
MessageRemovedException
MessagingException
MethodNotSupportedException
NoSuchProviderException
ReadOnlyFolderException
SendFailedException
StoreClosedException


javax.mail.event (Java EE 5)

 javax.mail.event
Interfaces
ConnectionListener
FolderListener
MessageChangedListener
MessageCountListener
StoreListener
TransportListener
Classes
ConnectionAdapter
ConnectionEvent
FolderAdapter
FolderEvent
MailEvent
MessageChangedEvent
MessageCountAdapter
MessageCountEvent
StoreEvent
TransportAdapter
TransportEvent


javax.mail.internet (Java EE 5)

 javax.mail.internet
Interfaces
MimePart
SharedInputStream
Classes
ContentDisposition
ContentType
HeaderTokenizer
HeaderTokenizer.Token
InternetAddress
InternetHeaders
InternetHeaders.InternetHeader
MailDateFormat
MimeBodyPart
MimeMessage
MimeMessage.RecipientType
MimeMultipart
MimePartDataSource
MimeUtility
NewsAddress
ParameterList
PreencodedMimeBodyPart
Exceptions
AddressException
ParseException


javax.mail.search (Java EE 5)

 javax.mail.search
Classes
AddressStringTerm
AddressTerm
AndTerm
BodyTerm
ComparisonTerm
DateTerm
FlagTerm
FromStringTerm
FromTerm
HeaderTerm
IntegerComparisonTerm
MessageIDTerm
MessageNumberTerm
NotTerm
OrTerm
ReceivedDateTerm
RecipientStringTerm
RecipientTerm
SearchTerm
SentDateTerm
SizeTerm
StringTerm
SubjectTerm
Exceptions
SearchException


javax.mail.util (Java EE 5)

 javax.mail.util
Classes
ByteArrayDataSource
SharedByteArrayInputStream
SharedFileInputStream


javax.management.j2ee (Java EE 5)

 javax.management.j2ee
Interfaces
ListenerRegistration
Management
ManagementHome


javax.management.j2ee.statistics (Java EE 5)

 javax.management.j2ee.statistics
Interfaces
BoundaryStatistic
BoundedRangeStatistic
CountStatistic
EJBStats
EntityBeanStats
JavaMailStats
JCAConnectionPoolStats
JCAConnectionStats
JCAStats
JDBCConnectionPoolStats
JDBCConnectionStats
JDBCStats
JMSConnectionStats
JMSConsumerStats
JMSEndpointStats
JMSProducerStats
JMSSessionStats
JMSStats
JTAStats
JVMStats
MessageDrivenBeanStats
RangeStatistic
ServletStats
SessionBeanStats
StatefulSessionBeanStats
StatelessSessionBeanStats
Statistic
Stats
TimeStatistic
URLStats


javax.persistence (Java EE 5)

 javax.persistence
Interfaces
EntityManager
EntityManagerFactory
EntityTransaction
Query
Classes
Persistence
Enums
CascadeType
DiscriminatorType
EnumType
FetchType
FlushModeType
GenerationType
InheritanceType
LockModeType
PersistenceContextType
TemporalType
Exceptions
EntityExistsException
EntityNotFoundException
NonUniqueResultException
NoResultException
OptimisticLockException
PersistenceException
RollbackException
TransactionRequiredException
Annotation Types
AssociationOverride
AssociationOverrides
AttributeOverride
AttributeOverrides
Basic
Column
ColumnResult
DiscriminatorColumn
DiscriminatorValue
Embeddable
Embedded
EmbeddedId
Entity
EntityListeners
EntityResult
Enumerated
ExcludeDefaultListeners
ExcludeSuperclassListeners
FieldResult
GeneratedValue
Id
IdClass
Inheritance
JoinColumn
JoinColumns
JoinTable
Lob
ManyToMany
ManyToOne
MapKey
MappedSuperclass
NamedNativeQueries
NamedNativeQuery
NamedQueries
NamedQuery
OneToMany
OneToOne
OrderBy
PersistenceContext
PersistenceContexts
PersistenceProperty
PersistenceUnit
PersistenceUnits
PostLoad
PostPersist
PostRemove
PostUpdate
PrePersist
PreRemove
PreUpdate
PrimaryKeyJoinColumn
PrimaryKeyJoinColumns
QueryHint
SecondaryTable
SecondaryTables
SequenceGenerator
SqlResultSetMapping
SqlResultSetMappings
Table
TableGenerator
Temporal
Transient
UniqueConstraint
Version


javax.persistence.spi (Java EE 5)

 javax.persistence.spi
Interfaces
ClassTransformer
PersistenceProvider
PersistenceUnitInfo
Enums
PersistenceUnitTransactionType


javax.resource (Java EE 5)

 javax.resource
Interfaces
Referenceable
Exceptions
NotSupportedException
ResourceException


javax.resource.cci (Java EE 5)

 javax.resource.cci
Interfaces
Connection
ConnectionFactory
ConnectionMetaData
ConnectionSpec
IndexedRecord
Interaction
InteractionSpec
LocalTransaction
MappedRecord
MessageListener
Record
RecordFactory
ResourceAdapterMetaData
ResultSet
ResultSetInfo
Streamable
Exceptions
ResourceWarning


javax.resource.spi (Java EE 5)

 javax.resource.spi
Interfaces
ActivationSpec
BootstrapContext
ConnectionEventListener
ConnectionManager
ConnectionRequestInfo
DissociatableManagedConnection
LazyAssociatableConnectionManager
LazyEnlistableConnectionManager
LazyEnlistableManagedConnection
LocalTransaction
ManagedConnection
ManagedConnectionFactory
ManagedConnectionMetaData
ResourceAdapter
ResourceAdapterAssociation
ValidatingManagedConnectionFactory
XATerminator
Classes
ConnectionEvent
Exceptions
ApplicationServerInternalException
CommException
EISSystemException
IllegalStateException
InvalidPropertyException
LocalTransactionException
ResourceAdapterInternalException
ResourceAllocationException
SecurityException
SharingViolationException
UnavailableException


javax.resource.spi.endpoint (Java EE 5)

 javax.resource.spi.endpoint
Interfaces
MessageEndpoint
MessageEndpointFactory


javax.resource.spi.security (Java EE 5)

 javax.resource.spi.security
Interfaces
GenericCredential
Classes
PasswordCredential


javax.resource.spi.work (Java EE 5)

 javax.resource.spi.work
Interfaces
Work
WorkListener
WorkManager
Classes
ExecutionContext
WorkAdapter
WorkEvent
Exceptions
WorkCompletedException
WorkException
WorkRejectedException


javax.security.jacc (Java EE 5)

 javax.security.jacc
Interfaces
PolicyConfiguration
PolicyContextHandler
Classes
EJBMethodPermission
EJBRoleRefPermission
PolicyConfigurationFactory
PolicyContext
WebResourcePermission
WebRoleRefPermission
WebUserDataPermission
Exceptions
PolicyContextException


javax.servlet (Java EE 5)

 javax.servlet
Interfaces
Filter
FilterChain
FilterConfig
RequestDispatcher
Servlet
ServletConfig
ServletContext
ServletContextAttributeListener
ServletContextListener
ServletRequest
ServletRequestAttributeListener
ServletRequestListener
ServletResponse
SingleThreadModel
Classes
GenericServlet
ServletContextAttributeEvent
ServletContextEvent
ServletInputStream
ServletOutputStream
ServletRequestAttributeEvent
ServletRequestEvent
ServletRequestWrapper
ServletResponseWrapper
Exceptions
ServletException
UnavailableException


javax.servlet.http (Java EE 5)

 javax.servlet.http
Interfaces
HttpServletRequest
HttpServletResponse
HttpSession
HttpSessionActivationListener
HttpSessionAttributeListener
HttpSessionBindingListener
HttpSessionContext
HttpSessionListener
Classes
Cookie
HttpServlet
HttpServletRequestWrapper
HttpServletResponseWrapper
HttpSessionBindingEvent
HttpSessionEvent
HttpUtils


javax.servlet.jsp (Java EE 5)

 javax.servlet.jsp
Interfaces
HttpJspPage
JspApplicationContext
JspPage
Classes
ErrorData
JspContext
JspEngineInfo
JspFactory
JspWriter
PageContext
Exceptions
JspException
JspTagException
SkipPageException


javax.servlet.jsp.el (Java EE 5)

 javax.servlet.jsp.el
Interfaces
FunctionMapper
VariableResolver
Classes
Expression
ExpressionEvaluator
ImplicitObjectELResolver
ScopedAttributeELResolver
Exceptions
ELException
ELParseException


javax.servlet.jsp.tagext (Java EE 5)

 javax.servlet.jsp.tagext
Interfaces
BodyTag
DynamicAttributes
IterationTag
JspIdConsumer
JspTag
SimpleTag
Tag
TryCatchFinally
Classes
BodyContent
BodyTagSupport
FunctionInfo
JspFragment
PageData
SimpleTagSupport
TagAdapter
TagAttributeInfo
TagData
TagExtraInfo
TagFileInfo
TagInfo
TagLibraryInfo
TagLibraryValidator
TagSupport
TagVariableInfo
ValidationMessage
VariableInfo


javax.transaction (Java EE 5)

 javax.transaction
Interfaces
Status
Synchronization
Transaction
TransactionManager
TransactionSynchronizationRegistry
UserTransaction
Exceptions
HeuristicCommitException
HeuristicMixedException
HeuristicRollbackException
InvalidTransactionException
NotSupportedException
RollbackException
SystemException
TransactionRequiredException
TransactionRolledbackException


javax.transaction.xa (Java EE 5)

 javax.transaction.xa
Interfaces
XAResource
Xid
Exceptions
XAException


javax.xml.bind (Java EE 5)

 javax.xml.bind
Interfaces
DatatypeConverterInterface
Element
Marshaller
NotIdentifiableEvent
ParseConversionEvent
PrintConversionEvent
Unmarshaller
UnmarshallerHandler
ValidationEvent
ValidationEventHandler
ValidationEventLocator
Validator
Classes
Binder
DatatypeConverter
JAXBContext
JAXBElement
JAXBElement.GlobalScope
JAXBIntrospector
Marshaller.Listener
SchemaOutputResolver
Unmarshaller.Listener
Exceptions
JAXBException
MarshalException
PropertyException
TypeConstraintException
UnmarshalException
ValidationException


javax.xml.bind.annotation (Java EE 5)

 javax.xml.bind.annotation
Interfaces
DomHandler
Classes
W3CDomHandler
XmlElement.DEFAULT
XmlElementDecl.GLOBAL
XmlElementRef.DEFAULT
XmlSchemaType.DEFAULT
XmlType.DEFAULT
Enums
XmlAccessOrder
XmlAccessType
XmlNsForm
Annotation Types
XmlAccessorOrder
XmlAccessorType
XmlAnyAttribute
XmlAnyElement
XmlAttachmentRef
XmlAttribute
XmlElement
XmlElementDecl
XmlElementRef
XmlElementRefs
XmlElements
XmlElementWrapper
XmlEnum
XmlEnumValue
XmlID
XmlIDREF
XmlInlineBinaryData
XmlList
XmlMimeType
XmlMixed
XmlNs
XmlRegistry
XmlRootElement
XmlSchema
XmlSchemaType
XmlSchemaTypes
XmlTransient
XmlType
XmlValue


XmlElement.DEFAULT (Java EE 5)

javax.xml.bind.annotation
Class XmlElement.DEFAULT

java.lang.Object
    extended by  javax.xml.bind.annotation.XmlElement.DEFAULT
Enclosing class:
XmlElement
public static final class XmlElement.DEFAULT
extends Object

Contained within: XmlElement

在 type() 中使用，用于表示根据属性签名推断出来的类型。
英文文档：

Used in XmlElement.type() to signal that the type be inferred from the signature of the property.

Constructor Summary
XmlElement.DEFAULT()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public XmlElement.DEFAULT()
英文文档：

XmlElement.DEFAULT

public XmlElement.DEFAULT()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlElementDecl.GLOBAL (Java EE 5)

javax.xml.bind.annotation
Class XmlElementDecl.GLOBAL

java.lang.Object
    extended by  javax.xml.bind.annotation.XmlElementDecl.GLOBAL
Enclosing class:
XmlElementDecl
public static final class XmlElementDecl.GLOBAL
extends Object

Contained within: XmlElementDecl

在 scope() 中使用，指示声明是全局范围的。
英文文档：

Used in XmlElementDecl.scope() to signal that the declaration is in the global scope.

Constructor Summary
XmlElementDecl.GLOBAL()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public XmlElementDecl.GLOBAL()
英文文档：

XmlElementDecl.GLOBAL

public XmlElementDecl.GLOBAL()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlElementRef.DEFAULT (Java EE 5)

javax.xml.bind.annotation
Class XmlElementRef.DEFAULT

java.lang.Object
    extended by  javax.xml.bind.annotation.XmlElementRef.DEFAULT
Enclosing class:
XmlElementRef
public static final class XmlElementRef.DEFAULT
extends Object

Contained within: XmlElementRef

在 type() 中使用，用于表示根据属性签名推断出来的类型。
英文文档：

Used in XmlElementRef.type() to signal that the type be inferred from the signature of the property.

Constructor Summary
XmlElementRef.DEFAULT()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public XmlElementRef.DEFAULT()
英文文档：

XmlElementRef.DEFAULT

public XmlElementRef.DEFAULT()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlSchemaType.DEFAULT (Java EE 5)

javax.xml.bind.annotation
Class XmlSchemaType.DEFAULT

java.lang.Object
    extended by  javax.xml.bind.annotation.XmlSchemaType.DEFAULT
Enclosing class:
XmlSchemaType
public static final class XmlSchemaType.DEFAULT
extends Object

Contained within: XmlSchemaType

在 type() 中使用，用于表示根据属性签名推断出来的类型。
英文文档：

Used in XmlSchemaType.type() to signal that the type be inferred from the signature of the property.

Constructor Summary
XmlSchemaType.DEFAULT()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public XmlSchemaType.DEFAULT()
英文文档：

XmlSchemaType.DEFAULT

public XmlSchemaType.DEFAULT()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


XmlType.DEFAULT (Java EE 5)

javax.xml.bind.annotation
Class XmlType.DEFAULT

java.lang.Object
    extended by  javax.xml.bind.annotation.XmlType.DEFAULT
Enclosing class:
XmlType
public static final class XmlType.DEFAULT
extends Object

Contained within: XmlType

在 factoryClass() 中使用，指示工厂方法未被使用或者在具有此 XmlType 的类中。
英文文档：

Used in XmlType.factoryClass() to signal that either factory mehod is not used or that it's in the class with this XmlType itself.

Constructor Summary
XmlType.DEFAULT()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public XmlType.DEFAULT()
英文文档：

XmlType.DEFAULT

public XmlType.DEFAULT()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.bind.annotation.adapters (Java EE 5)

 javax.xml.bind.annotation.adapters
Classes
CollapsedStringAdapter
HexBinaryAdapter
NormalizedStringAdapter
XmlAdapter
XmlJavaTypeAdapter.DEFAULT
Annotation Types
XmlJavaTypeAdapter
XmlJavaTypeAdapters


XmlJavaTypeAdapter.DEFAULT (Java EE 5)

javax.xml.bind.annotation.adapters
Class XmlJavaTypeAdapter.DEFAULT

java.lang.Object
    extended by  javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT
Enclosing class:
XmlJavaTypeAdapter
public static final class XmlJavaTypeAdapter.DEFAULT
extends Object

Contained within: XmlJavaTypeAdapter

此类在 type() 中使用，用来表示从字段、属性、参数或类的签名推导出的类型。
英文文档：

Used in XmlJavaTypeAdapter.type() to signal that the type be inferred from the signature of the field, property, parameter or the class.

Constructor Summary
XmlJavaTypeAdapter.DEFAULT()
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

public XmlJavaTypeAdapter.DEFAULT()
英文文档：

XmlJavaTypeAdapter.DEFAULT

public XmlJavaTypeAdapter.DEFAULT()
Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES


javax.xml.bind.attachment (Java EE 5)

 javax.xml.bind.attachment
Classes
AttachmentMarshaller
AttachmentUnmarshaller


javax.xml.bind.helpers (Java EE 5)

 javax.xml.bind.helpers
Classes
AbstractMarshallerImpl
AbstractUnmarshallerImpl
DefaultValidationEventHandler
NotIdentifiableEventImpl
ParseConversionEventImpl
PrintConversionEventImpl
ValidationEventImpl
ValidationEventLocatorImpl


javax.xml.bind.util (Java EE 5)

 javax.xml.bind.util
Classes
JAXBResult
JAXBSource
ValidationEventCollector


javax.xml.registry (Java EE 5)

 javax.xml.registry
Interfaces
BulkResponse
BusinessLifeCycleManager
BusinessQueryManager
CapabilityProfile
Connection
DeclarativeQueryManager
FederatedConnection
FindQualifier
JAXRResponse
LifeCycleManager
Query
QueryManager
RegistryService
Classes
ConnectionFactory
Exceptions
DeleteException
FindException
InvalidRequestException
JAXRException
RegistryException
SaveException
UnexpectedObjectException
UnsupportedCapabilityException


javax.xml.registry.infomodel (Java EE 5)

 javax.xml.registry.infomodel
Interfaces
Association
AuditableEvent
Classification
ClassificationScheme
Concept
EmailAddress
ExtensibleObject
ExternalIdentifier
ExternalLink
ExtrinsicObject
InternationalString
Key
LocalizedString
Organization
PersonName
PostalAddress
RegistryEntry
RegistryObject
RegistryPackage
Service
ServiceBinding
Slot
SpecificationLink
TelephoneNumber
URIValidator
User
Versionable


javax.xml.rpc (Java EE 5)

 javax.xml.rpc
Interfaces
Call
Service
Stub
Classes
NamespaceConstants
ParameterMode
ServiceFactory
Exceptions
JAXRPCException
ServiceException


javax.xml.rpc.encoding (Java EE 5)

 javax.xml.rpc.encoding
Interfaces
DeserializationContext
Deserializer
DeserializerFactory
SerializationContext
Serializer
SerializerFactory
TypeMapping
TypeMappingRegistry
Classes
XMLType


javax.xml.rpc.handler (Java EE 5)

 javax.xml.rpc.handler
Interfaces
Handler
HandlerChain
HandlerRegistry
MessageContext
Classes
GenericHandler
HandlerInfo


javax.xml.rpc.handler.soap (Java EE 5)

 javax.xml.rpc.handler.soap
Interfaces
SOAPMessageContext


javax.xml.rpc.holders (Java EE 5)

 javax.xml.rpc.holders
Interfaces
Holder
Classes
BigDecimalHolder
BigIntegerHolder
BooleanHolder
BooleanWrapperHolder
ByteArrayHolder
ByteHolder
ByteWrapperHolder
CalendarHolder
DoubleHolder
DoubleWrapperHolder
FloatHolder
FloatWrapperHolder
IntegerWrapperHolder
IntHolder
LongHolder
LongWrapperHolder
ObjectHolder
QNameHolder
ShortHolder
ShortWrapperHolder
StringHolder


javax.xml.rpc.server (Java EE 5)

 javax.xml.rpc.server
Interfaces
ServiceLifecycle
ServletEndpointContext


javax.xml.rpc.soap (Java EE 5)

 javax.xml.rpc.soap
Exceptions
SOAPFaultException


javax.xml.soap (Java EE 5)

 javax.xml.soap
Interfaces
Detail
DetailEntry
Name
Node
SOAPBody
SOAPBodyElement
SOAPConstants
SOAPElement
SOAPEnvelope
SOAPFault
SOAPFaultElement
SOAPHeader
SOAPHeaderElement
Text
Classes
AttachmentPart
MessageFactory
MimeHeader
MimeHeaders
SAAJMetaFactory
SAAJResult
SOAPConnection
SOAPConnectionFactory
SOAPElementFactory
SOAPFactory
SOAPMessage
SOAPPart
Exceptions
SOAPException


javax.xml.stream (Java EE 5)

 javax.xml.stream
Interfaces
EventFilter
Location
StreamFilter
XMLEventReader
XMLEventWriter
XMLReporter
XMLResolver
XMLStreamConstants
XMLStreamReader
XMLStreamWriter
Classes
XMLEventFactory
XMLInputFactory
XMLOutputFactory
Exceptions
XMLStreamException
Errors
FactoryConfigurationError


javax.xml.stream.events (Java EE 5)

 javax.xml.stream.events
Interfaces
Attribute
Characters
Comment
DTD
EndDocument
EndElement
EntityDeclaration
EntityReference
Namespace
NotationDeclaration
ProcessingInstruction
StartDocument
StartElement
XMLEvent


javax.xml.stream.util (Java EE 5)

 javax.xml.stream.util
Interfaces
XMLEventAllocator
XMLEventConsumer
Classes
EventReaderDelegate
StreamReaderDelegate


javax.xml.ws (Java EE 5)

 javax.xml.ws
Interfaces
AsyncHandler
Binding
BindingProvider
Dispatch
LogicalMessage
Provider
Response
WebServiceContext
Classes
Endpoint
Holder
Service
WebServicePermission
Enums
Service.Mode
Exceptions
ProtocolException
WebServiceException
Annotation Types
BindingType
RequestWrapper
ResponseWrapper
ServiceMode
WebEndpoint
WebFault
WebServiceClient
WebServiceProvider
WebServiceRef
WebServiceRefs


javax.xml.ws.handler (Java EE 5)

 javax.xml.ws.handler
Interfaces
Handler
HandlerResolver
LogicalHandler
LogicalMessageContext
MessageContext
PortInfo
Enums
MessageContext.Scope


javax.xml.ws.handler.soap (Java EE 5)

 javax.xml.ws.handler.soap
Interfaces
SOAPHandler
SOAPMessageContext


javax.xml.ws.http (Java EE 5)

 javax.xml.ws.http
Interfaces
HTTPBinding
Exceptions
HTTPException


javax.xml.ws.soap (Java EE 5)

 javax.xml.ws.soap
Interfaces
SOAPBinding
Exceptions
SOAPFaultException


javax.xml.ws.spi (Java EE 5)

 javax.xml.ws.spi
Classes
Provider
ServiceDelegate